1 /* This code is based upon work that bore the legend:
3 * Copyright (C) 1997 David Mosberger
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.
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.
15 * You should have received a copy of the GNU Library General Public
16 * License along with this library; if not, write to the
17 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 * Boston, MA 02111-1307, USA.
21 #ifndef __ardour_spline_h__
22 #define __ardour_spline_h__
28 typedef struct _spline Spline;
29 typedef struct _spline_point SplinePoint;
37 Spline *spline_new (void);
38 void spline_free (Spline *);
40 void spline_set (Spline *, uint32_t n, SplinePoint *);
41 void spline_add (Spline *, uint32_t n, SplinePoint *);
42 void spline_solve (Spline *);
43 float spline_eval (Spline *, float val);
44 void spline_fill (Spline *, float x0, float x1, float *vec, uint32_t veclen);
45 float spline_get_max_x (Spline *);
46 float spline_get_min_x (Spline *);
61 void set (uint32_t n, SplinePoint *points) {
62 spline_set (this, n, points);
65 void add (uint32_t n, SplinePoint *points) {
66 spline_add (this, n, points);
73 float eval (float val) {
74 return spline_eval (this, val);
77 void fill (float x0, float x1, float *vec, uint32_t veclen) {
78 spline_fill (this, x0, x1, vec, veclen);
81 #endif /* __cplusplus */
90 #endif /* __ardour_spline_h__ */