~ubuntu-branches/ubuntu/raring/fyre/raring

« back to all changes in this revision

Viewing changes to src/spline.h

  • Committer: Bazaar Package Importer
  • Author(s): Christoph Haas
  • Date: 2005-05-25 21:59:19 UTC
  • Revision ID: james.westby@ubuntu.com-20050525215919-jawtso5ic23qb401
Tags: upstream-1.0.0
ImportĀ upstreamĀ versionĀ 1.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* GTK - The GIMP Toolkit
 
2
 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
 
3
 *
 
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.
 
8
 *
 
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.
 
13
 *
 
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.
 
18
 */
 
19
 
 
20
/*
 
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/.
 
25
 */
 
26
 
 
27
/* These spline solving and evaluation functions were separated from GtkCurve.
 
28
 * See the CurveEditor widget for more information.
 
29
 */
 
30
 
 
31
#ifndef __SPLINE_H__
 
32
#define __SPLINE_H__
 
33
 
 
34
#include <glib-object.h>
 
35
 
 
36
G_BEGIN_DECLS
 
37
 
 
38
#define SPLINE_TYPE  (spline_get_type ())
 
39
 
 
40
typedef gfloat SplineControlPoint[2];
 
41
 
 
42
typedef struct {
 
43
  SplineControlPoint *points;
 
44
  gint num_points;
 
45
} Spline;
 
46
 
 
47
 
 
48
extern const Spline spline_template_linear;
 
49
extern const Spline spline_template_smooth;
 
50
 
 
51
 
 
52
GType    spline_get_type(void);
 
53
Spline*  spline_copy(const Spline *spline);
 
54
void     spline_free(Spline *spline);
 
55
 
 
56
guchar* spline_serialize(Spline *spline, gsize *size);
 
57
Spline* spline_unserialize(const guchar *data, gsize size);
 
58
 
 
59
Spline* spline_find_active_points(Spline *spline);
 
60
 
 
61
/* Solve the spline and evaluate one point on it */
 
62
gfloat  spline_solve_and_eval(Spline *spline, gfloat val);
 
63
 
 
64
/* Solve the spline and fill a provided vector with
 
65
 * points evaluated from the given range.
 
66
 */
 
67
void    spline_solve_and_eval_range(Spline *spline,
 
68
                                    int     veclen,
 
69
                                    gfloat  vector[],
 
70
                                    float   lower,
 
71
                                    float   upper);
 
72
 
 
73
void    spline_solve_and_eval_all(Spline *spline,
 
74
                                  int     veclen,
 
75
                                  gfloat  vector[]);
 
76
 
 
77
void    spline_solve(Spline *spline, gfloat y2[]);
 
78
gfloat  spline_eval(Spline *spline, gfloat y2[], gfloat val);
 
79
 
 
80
G_END_DECLS
 
81
 
 
82
#endif /* __CURVE_EDITOR_H__ */
 
83
 
 
84
/* The End */