2 * This file is part of RawTherapee.
4 * Copyright (c) 2004-2010 Gabor Horvath <hgabor@rawtherapee.com>
6 * RawTherapee is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
11 * RawTherapee is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with RawTherapee. If not, see <http://www.gnu.org/licenses/>.
28 virtual void curveChanged () {}
31 enum CurveType
{Linear
, Spline
};
37 std::vector
<double> x
, y
;
40 class MyCurve
: public Gtk::DrawingArea
{
42 CurveListener
* listener
;
44 Gdk::CursorType cursor_type
;
45 Glib::RefPtr
<Gdk::Pixmap
> pixmap
;
49 std::vector
<Gdk::Point
> point
;
52 void draw (int width
, int height
);
53 void interpolate (int width
, int height
);
54 std::vector
<double> get_vector (int veclen
);
55 double spline_eval (int n
, double x
[], double y
[], double y2
[], double val
);
56 void spline_solve (int n
, double x
[], double y
[], double y2
[]);
61 void setCurveListener (CurveListener
* cl
) { listener
= cl
; }
62 std::vector
<double> getPoints ();
63 void setPoints (const std::vector
<double>& p
);
64 void setType (CurveType t
);
65 bool handleEvents (GdkEvent
* event
);
66 void notifyListener ();