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

0001 /*
0002  *  SPDX-FileCopyrightText: 2010 Lukáš Tvrdý <lukast.dev@gmail.com>
0003  *
0004  *  SPDX-License-Identifier: GPL-2.0-or-later
0005  */
0006 #ifndef KIS_SKETCHOP_OPTION_DATA_H
0007 #define KIS_SKETCHOP_OPTION_DATA_H
0008 
0009 
0010 #include "kis_types.h"
0011 #include <boost/operators.hpp>
0012 
0013 class KisPropertiesConfiguration;
0014 class KisPaintopLodLimitations;
0015 
0016 struct KisSketchOpOptionData : boost::equality_comparable<KisSketchOpOptionData>
0017 {
0018     inline friend bool operator==(const KisSketchOpOptionData &lhs, const KisSketchOpOptionData &rhs) {
0019         return qFuzzyCompare(lhs.offset, rhs.offset)
0020             && qFuzzyCompare(lhs.probability, rhs.probability)
0021             && lhs.simpleMode == rhs.simpleMode
0022             && lhs.makeConnection == rhs.makeConnection
0023             && lhs.magnetify == rhs.magnetify
0024             && lhs.randomRGB == rhs.randomRGB
0025             && lhs.randomOpacity == rhs.randomOpacity
0026             && lhs.distanceOpacity == rhs.distanceOpacity
0027             && lhs.distanceDensity == rhs.distanceDensity
0028             && lhs.antiAliasing == rhs.antiAliasing
0029             && lhs.lineWidth == rhs.lineWidth;
0030     }
0031 
0032     qreal offset {30.0}; // perc
0033     qreal probability {50.0}; // perc
0034     bool simpleMode {false};
0035     bool makeConnection {true};
0036     bool magnetify {true};
0037     bool randomRGB {false};
0038     bool randomOpacity {false};
0039     bool distanceOpacity {false};
0040     bool distanceDensity {true};
0041     bool antiAliasing {false};
0042     int lineWidth {1}; // px
0043 
0044     bool read(const KisPropertiesConfiguration *setting);
0045     void write(KisPropertiesConfiguration *setting) const;
0046 
0047     KisPaintopLodLimitations lodLimitations() const;
0048 };
0049 
0050 #endif // KIS_SKETCHOP_OPTION_DATA_H