File indexing completed on 2024-05-12 05:46:39

0001 /*
0002  *  Copyright (c) 2007 Cyrille Berger <cberger@cberger.net>
0003  *
0004  * This library is free software; you can redistribute it and/or
0005  * modify it under the terms of the GNU Lesser General Public
0006  * License as published by the Free Software Foundation; version 2
0007  * of the License.
0008  *
0009  * This library is distributed in the hope that it will be useful,
0010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0012  * Lesser General Public License for more details.
0013  *
0014  * You should have received a copy of the GNU Lesser General Public License
0015  * along with this library; see the file COPYING.LIB.  If not, write to
0016  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0017  * Boston, MA 02110-1301, USA.
0018 */
0019 
0020 
0021 #ifndef _KIS_HSV_ADJUSTMENT_FILTER_H_
0022 #define _KIS_HSV_ADJUSTMENT_FILTER_H_
0023 
0024 #include <QList>
0025 
0026 #include "filter/kis_filter.h"
0027 #include "kis_config_widget.h"
0028 #include "ui_wdg_hsv_adjustment.h"
0029 #include "filter/kis_color_transformation_filter.h"
0030 
0031 class QWidget;
0032 class KoColorTransformation;
0033 
0034 /**
0035  * This class affect Intensity Y of the image
0036  */
0037 class KisHSVAdjustmentFilter : public KisColorTransformationFilter
0038 {
0039 
0040 public:
0041 
0042     KisHSVAdjustmentFilter();
0043 
0044 public:
0045 
0046     KisConfigWidget * createConfigurationWidget(QWidget* parent, const KisPaintDeviceSP dev, bool useForMasks) const override;
0047 
0048     KoColorTransformation* createTransformation(const KoColorSpace* cs, const KisFilterConfigurationSP config) const override;
0049 
0050     static inline KoID id() {
0051         return KoID("hsvadjustment", i18n("HSV/HSL Adjustment"));
0052     }
0053 
0054     KisFilterConfigurationSP defaultConfiguration(KisResourcesInterfaceSP resourcesInterface) const override;
0055 
0056 };
0057 
0058 
0059 class KisHSVConfigWidget : public KisConfigWidget
0060 {
0061 
0062     Q_OBJECT
0063 
0064 public:
0065     KisHSVConfigWidget(QWidget * parent, Qt::WindowFlags f = 0);
0066     ~KisHSVConfigWidget() override;
0067 
0068     KisPropertiesConfigurationSP  configuration() const override;
0069     void setConfiguration(const KisPropertiesConfigurationSP config) override;
0070     Ui_WdgHSVAdjustment * m_page;
0071 
0072 private Q_SLOTS:
0073 
0074     void configureSliderLimitsAndLabels();
0075     void resetFilter();
0076 };
0077 
0078 #endif