1 /* This file is part of the KDE project 2 * 3 * Copyright (C) 2011 Silvio Heinrich <plassy@web.de> 4 * 5 * This library is free software; you can redistribute it and/or 6 * modify it under the terms of the GNU Library General Public 7 * License as published by the Free Software Foundation; either 8 * version 2 of the License, or (at your option) any later version. 9 * 10 * This library is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 * Library General Public License for more details. 14 * 15 * You should have received a copy of the GNU Library General Public License 16 * along with this library; see the file COPYING.LIB. If not, write to 17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 18 * Boston, MA 02110-1301, USA. 19 */ 20 21 #ifndef KIS_RATE_OPTION_H 22 #define KIS_RATE_OPTION_H 23 24 #include "kis_curve_option.h" 25 #include <brushengine/kis_paint_information.h> 26 #include <kis_types.h> 27 28 class KisPainter; 29 30 class KisRateOption: public KisCurveOption 31 { 32 public: 33 KisRateOption(const QString& name, KisPaintOpOption::PaintopCategory category, bool checked); 34 35 /** 36 * Set the opacity of the painter based on the rate 37 * and the curve (if checked) 38 */ 39 void apply(KisPainter& painter, const KisPaintInformation& info, qreal scaleMin = 0.0, qreal scaleMax = 1.0, qreal multiplicator = 1.0) const; 40 setRate(qreal rate)41 void setRate(qreal rate) { 42 KisCurveOption::setValue(rate); 43 } getRate()44 qreal getRate() const { 45 return KisCurveOption::value(); 46 } 47 }; 48 49 #endif // KIS_RATE_OPTION_H 50