Krita Source Code Documentation
Loading...
Searching...
No Matches
kis_liquify_properties.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2014 Dmitry Kazakov <dimula73@gmail.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6
7#ifndef __KIS_LIQUIFY_PROPERTIES_H
8#define __KIS_LIQUIFY_PROPERTIES_H
9
10#include <QtGlobal>
11#include <QDebug>
12#include <boost/operators.hpp>
13#include "kritatooltransform_export.h"
14
15class QDomElement;
16
17
18class KRITATOOLTRANSFORM_EXPORT KisLiquifyProperties : boost::equality_comparable<KisLiquifyProperties>
19{
20public:
31
33 : m_mode(MOVE),
34 m_size(60),
35 m_amount(0.05),
36 m_spacing(0.2),
37 m_sizeHasPressure(false),
38 m_amountHasPressure(false),
39 m_reverseDirection(false),
40 m_useWashMode(false),
41 m_flow(0.2),
42 m_preserveShapeRotation(true),
43 m_preserveShapeScale(true),
44 m_preserveShapeStretch(false)
45 {
46 }
47
48
50
51 KisLiquifyProperties& operator=(const KisLiquifyProperties &rhs);
52
53 bool operator==(const KisLiquifyProperties &other) const;
54
55 LiquifyMode mode() const {
56 return m_mode;
57 }
59 m_mode = value;
60 }
61
62 static bool supportsReverseDirection(LiquifyMode mode);
63 static bool supportsWashMode(LiquifyMode mode);
64
65 qreal size() const {
66 return m_size;
67 }
68 void setSize(qreal value) {
69 m_size = value;
70 }
71
72 static qreal minSize() {
73 return 5.0;
74 }
75
76 static qreal maxSize() {
77 return 1000.0;
78 }
79
80 qreal amount() const {
81 return m_amount;
82 }
83 void setAmount(qreal value) {
84 m_amount = value;
85 }
86
87 qreal spacing() const {
88 return m_spacing;
89 }
90 void setSpacing(qreal value) {
91 m_spacing = value;
92 }
93
94 bool sizeHasPressure() const {
95 return m_sizeHasPressure;
96 }
98 m_sizeHasPressure = value;
99 }
100
101 bool amountHasPressure() const {
102 return m_amountHasPressure;
103 }
105 m_amountHasPressure = value;
106 }
107
108 bool reverseDirection() const {
109 return m_reverseDirection;
110 }
112 m_reverseDirection = value;
113 }
114
115 bool useWashMode() const {
116 return m_useWashMode;
117 }
119 m_useWashMode = value;
120 }
121
122 qreal flow() const {
123 return m_flow;
124 }
125 void setFlow(qreal value) {
126 m_flow = value;
127 }
128
130 return m_preserveShapeRotation;
131 }
133 m_preserveShapeRotation = value;
134 }
135
136 bool preserveShapeScale() const {
137 return m_preserveShapeScale;
138 }
140 m_preserveShapeScale = value;
141 }
142
143 bool preserveShapeStretch() const {
144 return m_preserveShapeStretch;
145 }
147 m_preserveShapeStretch = value;
148 }
149
150 void saveMode() const;
151 void loadMode();
152
153 void loadAndResetMode();
154
155 void toXML(QDomElement *e) const;
156 static KisLiquifyProperties fromXML(const QDomElement &e);
157
158private:
160 qreal m_size;
161 qreal m_amount;
166
168 qreal m_flow;
172};
173
174QDebug KRITATOOLTRANSFORM_EXPORT operator<<(QDebug dbg, const KisLiquifyProperties &properties);
175
176#endif /* __KIS_LIQUIFY_PROPERTIES_H */
float value(const T *src, size_t ch)
bool operator==(const KisRegion &lhs, const KisRegion &rhs)
void setMode(LiquifyMode value)
void setReverseDirection(bool value)
void setPreserveShapeStretch(bool value)
void setSizeHasPressure(bool value)
void setPreserveShapeScale(bool value)
void setPreserveShapeRotation(bool value)
void setAmountHasPressure(bool value)
QDebug KRITATOOLTRANSFORM_EXPORT operator<<(QDebug dbg, const KisLiquifyProperties &properties)