File indexing completed on 2024-06-23 04:27:43

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_HAIRYBRISTLE_OPTION_DATA_H
0007 #define KIS_HAIRYBRISTLE_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 KisHairyBristleOptionData : boost::equality_comparable<KisHairyBristleOptionData>
0017 {
0018     inline friend bool operator==(const KisHairyBristleOptionData &lhs, const KisHairyBristleOptionData &rhs) {
0019         return lhs.useMousePressure == rhs.useMousePressure
0020             && qFuzzyCompare(lhs.scaleFactor, rhs.scaleFactor)
0021             && qFuzzyCompare(lhs.randomFactor, rhs.randomFactor)
0022             && qFuzzyCompare(lhs.shearFactor, rhs.shearFactor)
0023             && qFuzzyCompare(lhs.densityFactor, rhs.densityFactor)
0024             && lhs.threshold == rhs.threshold
0025             && lhs.antialias == rhs.antialias
0026             && lhs.useCompositing == rhs.useCompositing
0027             && lhs.connectedPath == rhs.connectedPath;
0028     }
0029 
0030     bool useMousePressure {false};
0031     double scaleFactor {2.0};
0032     double randomFactor {2.0};
0033     double shearFactor {0.0};
0034     double densityFactor {100.0};
0035     bool threshold {false};
0036     bool antialias {false};
0037     bool useCompositing {false};
0038     bool connectedPath {false};
0039 
0040     bool read(const KisPropertiesConfiguration *setting);
0041     void write(KisPropertiesConfiguration *setting) const;
0042 
0043     KisPaintopLodLimitations lodLimitations() const;
0044 };
0045 
0046 #endif // KIS_HAIRYBRISTLE_OPTION_DATA_H