File indexing completed on 2024-06-16 04:17:20

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_DEFORM_OPTION_DATA_H
0007 #define KIS_DEFORM_OPTION_DATA_H
0008 
0009 
0010 #include "kis_types.h"
0011 #include <boost/operators.hpp>
0012 
0013 class KisPropertiesConfiguration;
0014 class KisPaintopLodLimitations;
0015 
0016 enum DeformModes {
0017     GROW = 1,
0018     SHRINK,
0019     SWIRL_CW,
0020     SWIRL_CCW,
0021     MOVE,
0022     LENS_IN,
0023     LENS_OUT,
0024     DEFORM_COLOR
0025 };
0026 
0027 struct KisDeformOptionData : boost::equality_comparable<KisDeformOptionData>
0028 {
0029     inline friend bool operator==(const KisDeformOptionData &lhs, const KisDeformOptionData &rhs) {
0030         return qFuzzyCompare(lhs.deformAmount, rhs.deformAmount)
0031             && lhs.deformUseBilinear == rhs.deformUseBilinear
0032             && lhs.deformUseCounter == rhs.deformUseCounter
0033             && lhs.deformUseOldData == rhs.deformUseOldData
0034             && lhs.deformAction == rhs.deformAction;
0035     }
0036 
0037     qreal deformAmount {0.2};
0038     bool deformUseBilinear {false};
0039     bool deformUseCounter {false};
0040     bool deformUseOldData {false};
0041     DeformModes deformAction {DeformModes::GROW};
0042 
0043     bool read(const KisPropertiesConfiguration *setting);
0044     void write(KisPropertiesConfiguration *setting) const;
0045 
0046     KisPaintopLodLimitations lodLimitations() const;
0047 };
0048 
0049 #endif // KIS_DEFORM_OPTION_DATA_H