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

0001 /*
0002  *  SPDX-FileCopyrightText: 2022 Agata Cacko <cacko.azh@gmail.com>
0003  *  SPDX-FileCopyrightText: 2010 Lukáš Tvrdý <lukast.dev@gmail.com>
0004  *
0005  *  SPDX-License-Identifier: GPL-2.0-or-later
0006  */
0007 #ifndef KIS_SPRAY_SHAPE_OPTION_DATA_H
0008 #define KIS_SPRAY_SHAPE_OPTION_DATA_H
0009 
0010 
0011 #include "kis_types.h"
0012 #include <boost/operators.hpp>
0013 #include <kritapaintop_export.h>
0014 
0015 #include <QImage>
0016 
0017 class KisPropertiesConfiguration;
0018 
0019 struct KisSprayShapeOptionData : boost::equality_comparable<KisSprayShapeOptionData>
0020 {
0021     inline friend bool operator==(const KisSprayShapeOptionData &lhs, const KisSprayShapeOptionData &rhs) {
0022         return lhs.shape == rhs.shape
0023             && lhs.size == rhs.size
0024             && lhs.enabled == rhs.enabled
0025             && lhs.proportional == rhs.proportional
0026             && lhs.imageUrl == rhs.imageUrl;
0027     }
0028     
0029     // particle type size
0030     quint8 shape;
0031     QSize size;
0032     bool enabled;
0033     bool proportional;
0034     
0035     // rotation
0036     QImage image;
0037     QString imageUrl;
0038 
0039     bool read(const KisPropertiesConfiguration *setting);
0040     void write(KisPropertiesConfiguration *setting) const;
0041 
0042     QSize effectiveSize(int diameter, qreal scale) const;
0043 };
0044 
0045 #endif // KIS_SPRAY_SHAPE_OPTION_DATA_H