BEAST/BSE - Better Audio System and Sound Engine
0.8.2
|
00001 // Licensed GNU LGPL v2.1 or later: http://www.gnu.org/licenses/lgpl.html 00002 #ifndef __GXK_SPLINE_H__ 00003 #define __GXK_SPLINE_H__ 00004 00005 #include <gxk/gxkglobals.hh> 00006 00007 G_BEGIN_DECLS 00008 00009 typedef struct _GxkSpline GxkSpline; 00010 typedef struct { 00011 double x, y; 00012 } GxkSplinePoint; 00013 typedef struct { 00014 double x, y, yd2; 00015 double ymin, ymax; 00016 double ex1, ex2; 00017 } GxkSplineSegment; 00018 struct _GxkSpline { 00019 guint n_segs; /* == n_points */ 00020 GxkSplineSegment segs[0]; /* last segment always has NAN extrema */ 00021 }; 00022 GxkSpline* gxk_spline_new_natural (guint n_points, 00023 const GxkSplinePoint *points); 00024 GxkSpline* gxk_spline_new (guint n_points, 00025 const GxkSplinePoint *points, 00026 double dy_start, 00027 double dy_end); 00028 double gxk_spline_eval (const GxkSpline *spline, 00029 double x, 00030 double *yd1); 00031 double gxk_spline_y (const GxkSpline *spline, 00032 double x); 00033 double gxk_spline_findx (const GxkSpline *spline, 00034 double y); 00035 void gxk_spline_dump (GxkSpline *spline); 00036 GxkSpline* gxk_spline_copy (GxkSpline *spline); 00037 void gxk_spline_free (GxkSpline *spline); 00038 00039 00040 00041 G_END_DECLS 00042 00043 #endif /* __GXK_SPLINE_H__ */