Name
GtkCurve -- allows direct editing of a curve.
Synopsis
#include <gtk/gtk.h>
struct GtkCurve;
GtkWidget* gtk_curve_new (void);
void gtk_curve_reset (GtkCurve *curve);
void gtk_curve_set_gamma (GtkCurve *curve,
gfloat gamma);
void gtk_curve_set_range (GtkCurve *curve,
gfloat min_x,
gfloat max_x,
gfloat min_y,
gfloat max_y);
void gtk_curve_get_vector (GtkCurve *curve,
int veclen,
gfloat vector[]);
void gtk_curve_set_vector (GtkCurve *curve,
int veclen,
gfloat vector[]);
void gtk_curve_set_curve_type (GtkCurve *curve,
GtkCurveType type);
|
Description
The GtkCurve widget allows the user to edit a curve covering a range of
values. It is typically used to fine-tune color balances in graphics
applications like the Gimp.
The GtkCurve widget has 3 modes of operation - spline, linear and free.
In spline mode the user places points on the curve which are automatically
connected together into a smooth curve. In linear mode the user places points
on the curve which are connected by straight lines. In free mode the user can
draw the points of the curve freely, and they are not connected at all.
Details
gtk_curve_reset ()
Resets the curve to a straight line from the minimum x & y values to the
maximum x & y values (i.e. from the bottom-left to the top-right corners).
The curve type is not changed.
gtk_curve_set_gamma ()
Recomputes the entire curve using the given gamma value.
A gamma value of 1 results in a straight line. Values greater than 1 result
in a curve above the straight line. Values less than 1 result in a curve
below the straight line. The curve type is changed to GTK_CURVE_TYPE_FREE.
FIXME: Needs a more precise definition of gamma.
gtk_curve_set_range ()
Sets the minimum and maximum x & y values of the curve.
The curve is also reset with a call to gtk_curve_reset().
gtk_curve_get_vector ()
void gtk_curve_get_vector (GtkCurve *curve,
int veclen,
gfloat vector[]); |
Returns a vector of points representing the curve.
gtk_curve_set_vector ()
void gtk_curve_set_vector (GtkCurve *curve,
int veclen,
gfloat vector[]); |
Sets the vector of points on the curve.
The curve type is set to GTK_CURVE_TYPE_FREE.
gtk_curve_set_curve_type ()
Sets the type of the curve. The curve will remain unchanged except when
changing from a free curve to a linear or spline curve, in which case the
curve will be changed as little as possible.