Krita Source Code Documentation
Loading...
Searching...
No Matches
KoPatternBackground.h
Go to the documentation of this file.
1/* This file is part of the KDE project
2 * SPDX-FileCopyrightText: 2008 Jan Hambrecht <jaham@gmx.net>
3 *
4 * SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6
7#ifndef KOPATTERNBACKGROUND_H
8#define KOPATTERNBACKGROUND_H
9
10#include "KoShapeBackground.h"
11#include "kritaflake_export.h"
12
13#include <QSharedDataPointer>
14
15class KoPatternBackgroundPrivate;
16
17class QTransform;
18class QImage;
19class QPointF;
20class QRectF;
21
23class KRITAFLAKE_EXPORT KoPatternBackground : public KoShapeBackground
24{
25public:
30 Stretched
31 };
44
45 explicit KoPatternBackground();
46
47 ~KoPatternBackground() override;
48
49 // Work around MSVC inability to generate copy ops with QSharedDataPointer.
51 KoPatternBackground& operator=(const KoPatternBackground &);
52
53 bool compareTo(const KoShapeBackground *other) const override;
54
56 void setTransform(const QTransform &matrix);
57
59 QTransform transform() const;
60
62 void setPattern(const QImage &pattern);
63
65 QImage pattern() const;
66
68 void setRepeat(PatternRepeat repeat);
69
71 PatternRepeat repeat() const;
72
74 ReferencePoint referencePoint() const;
75
77 void setReferencePoint(ReferencePoint referencePoint);
78
80 QPointF referencePointOffset() const;
81
83 void setReferencePointOffset(const QPointF &offset);
84
86 QPointF tileRepeatOffset() const;
87
89 void setTileRepeatOffset(const QPointF &offset);
90
92 QSizeF patternDisplaySize() const;
93
95 void setPatternDisplaySize(const QSizeF &size);
96
98 QSizeF patternOriginalSize() const;
99
101 void paint(QPainter &painter, const QPainterPath &fillPath) const override;
102
104 QRectF patternRectFromFillSize(const QSizeF &size);
105private:
106 class Private;
107 QSharedDataPointer<Private> d;
108};
109
110#endif // KOPATTERNBACKGROUND_H
A pattern shape background.
QSharedDataPointer< Private > d
PatternRepeat
Pattern rendering style.
ReferencePoint
Pattern reference point.
virtual bool compareTo(const KoShapeBackground *other) const =0
virtual void paint(QPainter &painter, const QPainterPath &fillPath) const =0
Paints the background using the given fill path.