Krita Source Code Documentation
Loading...
Searching...
No Matches
ImageShape.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2016 Dmitry Kazakov <dimula73@gmail.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6
7#ifndef IMAGESHAPE_H
8#define IMAGESHAPE_H
9
10#include <QSharedDataPointer>
11
12#include "KoTosContainer.h"
13#include <SvgShape.h>
14
15#define ImageShapeId "ImageShape"
16
17
18class ImageShape : public KoTosContainer, public SvgShape
19{
20public:
21 ImageShape();
22 ~ImageShape() override;
23
24 KoShape *cloneShape() const override;
25
26 void paint(QPainter &painter) const override;
27
28 void setSize(const QSizeF &size) override;
29
30 bool saveSvg(SvgSavingContext &context) override;
31 bool loadSvg(const QDomElement &element, SvgLoadingContext &context) override;
32
33 void setImage(const QImage &img);
34 QImage image() const;
35
36 void setViewBoxTransform(const QTransform &tf);
37 QTransform viewBoxTransform() const;
38
39private:
40 ImageShape(const ImageShape &rhs);
41
42private:
43 struct Private;
44 QSharedDataPointer<Private> m_d;
45};
46
47#endif // IMAGESHAPE_H
virtual QSizeF size() const
Get the size of the shape in pt.
Definition KoShape.cpp:820
Contains data used for loading svg.
Context for saving svg files.
An interface providing svg loading and saving routines.
Definition SvgShape.h:18
void setImage(const QImage &img)
void setViewBoxTransform(const QTransform &tf)
void setSize(const QSizeF &size) override
Resize the shape.
bool loadSvg(const QDomElement &element, SvgLoadingContext &context) override
Loads data from specified svg element.
QImage image() const
bool saveSvg(SvgSavingContext &context) override
Saves data utilizing specified svg saving context.
void paint(QPainter &painter) const override
Paint the shape fill The class extending this one is responsible for painting itself....
~ImageShape() override
KoShape * cloneShape() const override
creates a deep copy of the shape or shape's subtree
QSharedDataPointer< Private > m_d
Definition ImageShape.h:44
QTransform viewBoxTransform() const