File indexing completed on 2025-01-26 04:11:25

0001 /*
0002  *  SPDX-FileCopyrightText: 2022 Agata Cacko <cacko.azh@gmail.com>
0003  *  SPDX-FileCopyrightText: 2009, 2010 Lukáš Tvrdý (lukast.dev@gmail.com)
0004  *
0005  *  SPDX-License-Identifier: GPL-2.0-or-later
0006  */
0007 #ifndef KIS_COLOR_OPTION_DATA_H
0008 #define KIS_COLOR_OPTION_DATA_H
0009 
0010 
0011 #include "kis_types.h"
0012 #include <boost/operators.hpp>
0013 #include <kritapaintop_export.h>
0014 
0015 class KisPropertiesConfiguration;
0016 
0017 
0018 const QString COLOROP_HUE = "ColorOption/hue";
0019 const QString COLOROP_SATURATION = "ColorOption/saturation";
0020 const QString COLOROP_VALUE = "ColorOption/value";
0021 
0022 const QString COLOROP_USE_RANDOM_HSV = "ColorOption/useRandomHSV";
0023 const QString COLOROP_USE_RANDOM_OPACITY = "ColorOption/useRandomOpacity";
0024 const QString COLOROP_SAMPLE_COLOR = "ColorOption/sampleInputColor";
0025 
0026 const QString COLOROP_FILL_BG = "ColorOption/fillBackground";
0027 const QString COLOROP_COLOR_PER_PARTICLE = "ColorOption/colorPerParticle";
0028 const QString COLOROP_MIX_BG_COLOR = "ColorOption/mixBgColor";
0029 
0030 
0031 struct PAINTOP_EXPORT KisColorOptionData : boost::equality_comparable<KisColorOptionData>
0032 {   
0033     
0034     inline friend bool operator==(const KisColorOptionData &lhs, const KisColorOptionData &rhs) {
0035         return lhs.useRandomHSV == rhs.useRandomHSV
0036             && lhs.useRandomOpacity == rhs.useRandomOpacity
0037             && lhs.sampleInputColor == rhs.sampleInputColor
0038             
0039             && lhs.fillBackground == rhs.fillBackground
0040             && lhs.colorPerParticle == rhs.colorPerParticle
0041             && lhs.mixBgColor == rhs.mixBgColor
0042             
0043             && lhs.hue == rhs.hue
0044             && lhs.saturation == rhs.saturation
0045             && lhs.value == rhs.value
0046             ;
0047     }
0048 
0049 
0050     bool useRandomHSV {false};
0051     bool useRandomOpacity {false};
0052     bool sampleInputColor {false};
0053 
0054     bool fillBackground {false};
0055     bool colorPerParticle {false};
0056     bool mixBgColor {false};
0057 
0058     int hue {0};
0059     int saturation {0};
0060     int value {0};
0061     
0062     // functions
0063     bool read(const KisPropertiesConfiguration *setting);
0064     void write(KisPropertiesConfiguration *setting) const;
0065     
0066 };
0067 
0068 #endif // KIS_COLOR_OPTION_DATA_H