|GTK+ Reference Manual|
|Top | Description | Object Hierarchy | Implemented Interfaces | Properties | Signals|
#include <gtk/gtk.h> 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);
GObject +----GInitiallyUnowned +----GtkObject +----GtkWidget +----GtkDrawingArea +----GtkCurve
GtkCurve implements AtkImplementorIface and GtkBuildable.
"curve-type" GtkCurveType : Read / Write "max-x" gfloat : Read / Write "max-y" gfloat : Read / Write "min-x" gfloat : Read / Write "min-y" gfloat : Read / Write
"curve-type-changed" : Run First
This widget is considered too specialized/little-used for GTK+, and will in the future be moved to some other package. If your application needs this widget, feel free to use it, as the widget does work and is useful in some applications; it's just not of general interest. However, we are not accepting new features for the widget, and it will eventually move out of the GTK+ distribution.
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.
typedef struct _GtkCurve GtkCurve;
The GtkCurve struct contains private data only, and should be accessed using the functions below.
void gtk_curve_reset (GtkCurve *curve);
Resets the curve to a straight line from the minimum x and y values to the maximum x and y values (i.e. from the bottom-left to the top-right corners). The curve type is not changed.
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
FIXME: Needs a more precise definition of gamma.
||the gamma value.|
Sets the minimum and maximum x and y values of the curve.
The curve is also reset with a call to
||the minimum x value.|
||the maximum x value.|
||the minimum y value.|
||the maximum y value.|
Returns a vector of points representing the curve.
||the number of points to calculate.|
||returns the points.|
Sets the vector of points on the curve.
The curve type is set to
||the number of points.|
||the points on the curve.|
void gtk_curve_set_curve_type (GtkCurve *curve, GtkCurveType 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.
||the type of the curve.|
"curve-type" GtkCurveType : Read / Write
Is this curve linear, spline interpolated, or free-form.
Default value: GTK_CURVE_TYPE_SPLINE
"max-x" gfloat : Read / Write
Maximum possible X value.
Default value: 1
"max-y" gfloat : Read / Write
Maximum possible value for Y.
Default value: 1
"min-x" gfloat : Read / Write
Minimum possible value for X.
Default value: 0
"min-y" gfloat : Read / Write
Minimum possible value for Y.
Default value: 0
Emitted when the curve type has been changed.
The curve type can be changed explicitly with a call to
gtk_curve_set_curve_type(). It is also changed as a side-effect of
||the object which received the signal.|
||user data set when the signal handler was connected.|
a subclass for editing gamma curves.