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:
30
32 : m_mode(MOVE),
33 m_size(60),
34 m_amount(0.05),
35 m_spacing(0.2),
36 m_sizeHasPressure(false),
37 m_amountHasPressure(false),
38 m_reverseDirection(false),
39 m_useWashMode(false),
40 m_flow(0.2)
41 {
42 }
43
44
46
47 KisLiquifyProperties& operator=(const KisLiquifyProperties &rhs);
48
49 bool operator==(const KisLiquifyProperties &other) const;
50
51 LiquifyMode mode() const {
52 return m_mode;
53 }
55 m_mode = value;
56 }
57
58 qreal size() const {
59 return m_size;
60 }
61 void setSize(qreal value) {
62 m_size = value;
63 }
64
65 static qreal minSize() {
66 return 5.0;
67 }
68
69 static qreal maxSize() {
70 return 1000.0;
71 }
72
73 qreal amount() const {
74 return m_amount;
75 }
76 void setAmount(qreal value) {
77 m_amount = value;
78 }
79
80 qreal spacing() const {
81 return m_spacing;
82 }
83 void setSpacing(qreal value) {
84 m_spacing = value;
85 }
86
87 bool sizeHasPressure() const {
88 return m_sizeHasPressure;
89 }
91 m_sizeHasPressure = value;
92 }
93
94 bool amountHasPressure() const {
95 return m_amountHasPressure;
96 }
98 m_amountHasPressure = value;
99 }
100
101 bool reverseDirection() const {
102 return m_reverseDirection;
103 }
105 m_reverseDirection = value;
106 }
107
108 bool useWashMode() const {
109 return m_useWashMode;
110 }
112 m_useWashMode = value;
113 }
114
115 qreal flow() const {
116 return m_flow;
117 }
118 void setFlow(qreal value) {
119 m_flow = value;
120 }
121
122 void saveMode() const;
123 void loadMode();
124
125 void loadAndResetMode();
126
127 void toXML(QDomElement *e) const;
128 static KisLiquifyProperties fromXML(const QDomElement &e);
129
130private:
132 qreal m_size;
133 qreal m_amount;
138
140 qreal m_flow;
141};
142
143QDebug KRITATOOLTRANSFORM_EXPORT operator<<(QDebug dbg, const KisLiquifyProperties &properties);
144
145#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 setSizeHasPressure(bool value)
void setAmountHasPressure(bool value)
QDebug KRITATOOLTRANSFORM_EXPORT operator<<(QDebug dbg, const KisLiquifyProperties &properties)