Skip to content

armgit / krita

Public Imported from GitHub
0

Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.

C++
969 B
Raw Blame
/*
 *  SPDX-FileCopyrightText: 2016 Dmitry Kazakov <[email protected]>
 *
 *  SPDX-License-Identifier: GPL-2.0-or-later
 */

#ifndef IMAGESHAPE_H
#define IMAGESHAPE_H

#include <QSharedDataPointer>

#include "KoShape.h"
#include <SvgShape.h>

#define ImageShapeId "ImageShape"


class ImageShape : public KoShape, public SvgShape
{
public:
    ImageShape();
    ~ImageShape() override;

    KoShape *cloneShape() const override;

    void paint(QPainter &painter) const override;

    void setSize(const QSizeF &size) override;

    bool saveSvg(SvgSavingContext &context) override;
    bool loadSvg(const QDomElement &element, SvgLoadingContext &context) override;

    void setImage(const QImage &img);
    QImage image() const;

    void setViewBoxTransform(const QTransform &tf);
    QTransform viewBoxTransform() const;

private:
    ImageShape(const ImageShape &rhs);

private:
    struct Private;
    QSharedDataPointer<Private> m_d;
};

#endif // IMAGESHAPE_H