2 * Copyright (c) 2010 Cyrille Berger <cberger@cberger.net>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 #ifndef _KIS_CUBIC_CURVE_H_
20 #define _KIS_CUBIC_CURVE_H_
29 * Hold the data for a cubic curve.
35 KisCubicCurve(const QList<QPointF>& points);
36 KisCubicCurve(const QVector<QPointF>& points);
37 KisCubicCurve(const KisCubicCurve& curve);
39 KisCubicCurve& operator=(const KisCubicCurve& curve);
40 bool operator==(const KisCubicCurve& curve) const;
42 qreal value(qreal x) const;
43 QList<QPointF> points() const;
44 void setPoints(const QList<QPointF>& points);
45 void setPoint(int idx, const QPointF& point);
47 * Add a point to the curve, the list of point is always sorted.
48 * @return the index of the inserted point
50 int addPoint(const QPointF& point);
51 void removePoint(int idx);
53 QVector<quint16> uint16Transfer(int size = 256) const;
54 QVector<qreal> floatTransfer(int size = 256) const;
56 QString toString() const;
57 void fromString(const QString&);
64 Q_DECLARE_METATYPE(KisCubicCurve);