Krita Source Code Documentation
Loading...
Searching...
No Matches
KisColorOptionData.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2022 Agata Cacko <cacko.azh@gmail.com>
3 * SPDX-FileCopyrightText: 2009, 2010 Lukáš Tvrdý (lukast.dev@gmail.com)
4 *
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 */
7#ifndef KIS_COLOR_OPTION_DATA_H
8#define KIS_COLOR_OPTION_DATA_H
9
10
11#include "kis_types.h"
12#include <boost/operators.hpp>
13#include <kritapaintop_export.h>
14
16
17
18const QString COLOROP_HUE = "ColorOption/hue";
19const QString COLOROP_SATURATION = "ColorOption/saturation";
20const QString COLOROP_VALUE = "ColorOption/value";
21
22const QString COLOROP_USE_RANDOM_HSV = "ColorOption/useRandomHSV";
23const QString COLOROP_USE_RANDOM_OPACITY = "ColorOption/useRandomOpacity";
24const QString COLOROP_SAMPLE_COLOR = "ColorOption/sampleInputColor";
25
26const QString COLOROP_FILL_BG = "ColorOption/fillBackground";
27const QString COLOROP_COLOR_PER_PARTICLE = "ColorOption/colorPerParticle";
28const QString COLOROP_MIX_BG_COLOR = "ColorOption/mixBgColor";
29
30
31struct PAINTOP_EXPORT KisColorOptionData : boost::equality_comparable<KisColorOptionData>
32{
33
34 inline friend bool operator==(const KisColorOptionData &lhs, const KisColorOptionData &rhs) {
35 return lhs.useRandomHSV == rhs.useRandomHSV
38
39 && lhs.fillBackground == rhs.fillBackground
41 && lhs.mixBgColor == rhs.mixBgColor
42
43 && lhs.hue == rhs.hue
44 && lhs.saturation == rhs.saturation
45 && lhs.value == rhs.value
46 ;
47 }
48
49
50 bool useRandomHSV {false};
51 bool useRandomOpacity {false};
52 bool sampleInputColor {false};
53
54 bool fillBackground {false};
55 bool colorPerParticle {false};
56 bool mixBgColor {false};
57
58 int hue {0};
59 int saturation {0};
60 int value {0};
61
62 // functions
63 bool read(const KisPropertiesConfiguration *setting);
64 void write(KisPropertiesConfiguration *setting) const;
65
66};
67
68#endif // KIS_COLOR_OPTION_DATA_H
float value(const T *src, size_t ch)
const QString COLOROP_SAMPLE_COLOR
const QString COLOROP_USE_RANDOM_HSV
const QString COLOROP_FILL_BG
const QString COLOROP_VALUE
const QString COLOROP_SATURATION
const QString COLOROP_COLOR_PER_PARTICLE
const QString COLOROP_HUE
const QString COLOROP_MIX_BG_COLOR
const QString COLOROP_USE_RANDOM_OPACITY
friend bool operator==(const KisColorOptionData &lhs, const KisColorOptionData &rhs)