1
/* GTK - The GIMP Toolkit
2
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
4
* This library is free software; you can redistribute it and/or
5
* modify it under the terms of the GNU Lesser General Public
6
* License as published by the Free Software Foundation; either
7
* version 2 of the License, or (at your option) any later version.
9
* This library 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 GNU
12
* Lesser General Public License for more details.
14
* You should have received a copy of the GNU Lesser General Public
15
* License along with this library; if not, write to the
16
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17
* Boston, MA 02111-1307, USA.
21
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
22
* file for a list of people on the GTK+ Team. See the ChangeLog
23
* files for a list of changes. These files are distributed with
24
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
27
/* These spline solving and evaluation functions were separated from GtkCurve.
28
* See the CurveEditor widget for more information.
34
#include <glib-object.h>
38
#define SPLINE_TYPE (spline_get_type ())
40
typedef gfloat SplineControlPoint[2];
43
SplineControlPoint *points;
48
extern const Spline spline_template_linear;
49
extern const Spline spline_template_smooth;
52
GType spline_get_type(void);
53
Spline* spline_copy(const Spline *spline);
54
void spline_free(Spline *spline);
56
guchar* spline_serialize(Spline *spline, gsize *size);
57
Spline* spline_unserialize(const guchar *data, gsize size);
59
Spline* spline_find_active_points(Spline *spline);
61
/* Solve the spline and evaluate one point on it */
62
gfloat spline_solve_and_eval(Spline *spline, gfloat val);
64
/* Solve the spline and fill a provided vector with
65
* points evaluated from the given range.
67
void spline_solve_and_eval_range(Spline *spline,
73
void spline_solve_and_eval_all(Spline *spline,
77
void spline_solve(Spline *spline, gfloat y2[]);
78
gfloat spline_eval(Spline *spline, gfloat y2[], gfloat val);
82
#endif /* __CURVE_EDITOR_H__ */