Gtk::Curve
class Gtk::Curve
The Gtk::Curve widget allows the user to edit a curve covering a range of values. It is typically used to finetune 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.
NOTE
This widget is considered too specialized/littleused 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.
Class Methods
Gtk::Curve.new

Creates a new Gtk::Curve.
 Returns: a new Gtk::Curve.
Instance Methods
reset

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 bottomleft to the topright corners). The curve type is not changed.
 Returns: self
gamma=(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.
 gamma: the gamma value (Float)
 Returns: self
set_gamma(gamma)

Same as Gtk::Curve#gamma=.
 gamma: the gamma value (Float)
 Returns: self
set_range(min_x, max_x, min_y, max_y)

Sets the minimum and maximum x and y values of the curve. The curve is also reset with a call to Gtk::Curve#reset.
 min_x : the minimum x value.
 max_x : the maximum x value.
 min_y : the minimum y value.
 max_y : the maximum y value.
 Returns: self
get_vector(len)

Returns a vector of points representing the curve.
 len: the number of points to calculate.
 Returns: returns the points(An Array of Float).
set_vector(len, vector)

Sets the vector of points on the curve. The curve type is set to Gtk::Curve::TYPE_FREE.
 len: the number of points.
 vector: the points on the curve. (An Array of Float)
curve_type

Gets the type of the curve which is this curve linear, spline interpolated, or freeform.
 Returns: the type of the curve
curve_type=(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.
 type: the type of the curve. (Gtk::Curve#Type)
 Returns: type
set_curve_type(curve_type)

Same as Gtk::Curve#curve_type=.
 type: the type of the curve. (Gtk::Curve#Type)
 Returns: self
max_x

Gets the maximum possible X value.
 Returns: maximum possible X value
max_x=(max_x)

Sets the maximum possible X value.
 max_x: maximum possible X value
 Returns: max_x
set_max_x(max_x)

Same as max_x=.
 max_x: maximum possible X value
 Returns: self
max_y

Gets the maximum possible value for Y.
 Returns: maximum possible value for Y
max_y=(max_y)

Sets the maximum possible value for Y.
 max_y: maximum possible value for Y
 Returns: max_y
set_max_y(max_y)

Same as max_y=.
 max_y: maximum possible value for Y
 Returns: self
min_x

Gets the minimum possible value for X.
 Returns: minimum possible value for X
min_x=(min_x)

Sets the minimum possible value for X.
 min_x: minimum possible value for X
 Returns: min_x
set_min_x(min_x)

Same as min_x=.
 min_x: minimum possible value for X
 Returns: self
min_y

Gets the minimum possible value for Y.
 Returns: minimum possible value for Y
min_y=(min_y)

Sets the minimum possible value for Y.
 min_y: minimum possible value for Y
 Returns: min_y
set_min_y(min_y)

Same as min_y=.
 min_y: minimum possible value for Y
 Returns: self
Constants
Type
TYPE_LINEAR
 linear interpolation
TYPE_SPLINE
 spline interpolation
TYPE_FREE
 free form curve
Properties
curvetype: Gtk::CurveType (Read/Write)

Is this curve linear, spline interpolated, or freeform
 Default value: Gtk::Curve::TYPE_LINEAR
maxx: Float (Read/Write)

Maximum possible X value
 Default value: 1
maxy: Float (Read/Write)

Maximum possible value for Y
 Default value: 1
minx: Float (Read/Write)

Minimum possible value for X
 Default value: 0
miny: Float (Read/Write)

Minimum possible value for Y
 Default value: 0
Signals
curvetypechanged: self (Run First)

Emitted when the curve type has been changed. The curve type can be changed explicitly with a call to Gtk::Curve#curve_type=. It is also changed as a sideeffect of calling Gtk::Curve#reset or Gtk::Curve#gamma=.
 self: Gtk::Curve
Stichworte:
Referenzen:[Gtk::Curve] [Ruby/GTK]