Gtk-- Reference: Gtk::Curve

Class Index | Cross Index | Namespace Index

# Class Gtk::Curve

Allows direct editing of a curve.
Contained in: Gtk
Derived from: Gtk::DrawingArea
Derived by: none

#include <gtk--/curve.h>

### public function member index:
`` | `Curve` | `()`;
``signal` `void`` | `curve_type_changed` | `()`;
``void`` | `get_vector` | `(`int` `num`, `gfloat`* `data`)`;
``GtkCurve`*` | `gtkobj` | `()`;
``const` `GtkCurve`*` | `gtkobj` | `() `const``;
``static` `bool`` | `isA` | `(`Object`* `object`)`;
``void`` | `reset` | `()`;
``void`` | `set_curve_type` | `(`GtkCurveType` `type`)`;
``void`` | `set_gamma` | `(`gfloat` `gamma`)`;
``void`` | `set_range` | `(`gfloat` `min_x`, `gfloat` `max_x`, `gfloat` `min_y`, `gfloat` `max_y`)`;
``void`` | `set_vector` | `(`const` `CurveArray`& `vect`)`;
``virtual`` | `~Curve` | `()`;
### protected function member index:
``virtual` `void`` | `curve_type_changed_impl` | `()`;

## Description:

The `Gtk::Curve` 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 `Gtk::Curve` 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.

## Function Member Descriptions:

Gtk::Curve::curve_type_changed - Emitted when the curve type has been changed.

``signal` `void`` `curve_type_changed``()`;
``virtual` `void`` `curve_type_changed_impl``()`;

> The curve type can be changed explicitly with a call to `set_curve_type`. It is also changed as a side-effect of calling `reset` or `set_gamma`.

Gtk::Curve::get_vector - Returns a vector of points representing the curve.

``void`` `get_vector``(`int` `num`, `gfloat`* `data`)`;

> data: Returns the points.

Gtk::Curve::gtkobj - Returns the underlaying gtk+ object.

``GtkCurve`*` `gtkobj``()`;
Gtk::Curve::isA - Returns true if object is this type.

``static` `bool`` `isA``(`Object`* `object`)`;
Gtk::Curve::reset - Reset the curve.

``void`` `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_curve_type - Sets the type of the curve.

``void`` `set_curve_type``(`GtkCurveType` `type`)`;

> 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. type: The type of the curve. Possible values are: `GTK_CURVE_TYPE_LINEAR`, `GTK_CURVE_TYPE_SPLINE`, `GTK_CURVE_TYPE_FREE`.

Gtk::Curve::set_gamma - Recomputes the entire curve using the given gamma value.

``void`` `set_gamma``(`gfloat` `gamma`)`;

> 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`.

> gamma: The gamma value.

Gtk::Curve::set_range - Sets the minimum and maximum x & y values of the curve.

``void`` `set_range``(`gfloat` `min_x`, `gfloat` `max_x`, `gfloat` `min_y`, `gfloat` `max_y`)`;

> The curve is also reset with a call to ``.

> min_x: The minimum x value.

> max_x: The maximum x value.

> min_y: The minimum y value.

> max_y: The maximum y value.

Gtk::Curve::set_vector - Sets the vector of points on the curve.

``void`` `set_vector``(`const` `CurveArray`& `vect`)`;

> The curve type is set to `GTK_CURVE_TYPE_FREE`.

> vect: The points on the curve.