Reference Manual

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

# Inti::Gtk::Curve Class Reference

A GtkCurve C++ wrapper class. More...

`#include <inti/gtk/curve.h>`

Inheritance diagram for Inti::Gtk::Curve:

List of all members.

## Public Member Functions

Constructors

- Curve ()
    Construct a new Curve.
- virtual ~Curve ()
    Destructor.

Accessors

- GtkCurve * gtk_curve () const
    Get a pointer to the GtkCurve structure.
- GtkCurveClass * gtk_curve_class () const
    Get a pointer to the GtkCurveClass structure.
- operator GtkCurve * () const
    Conversion operator; safely converts a Curve to a GtkCurve pointer.
- void get_vector (int count, float data[]) const
    Returns a vector of points representing the curve.

Methods

- void reset ()
    Resets the curve to a straight line from the minimum x and y values to the maximum x and y values (from the bottom-left to the top-right corners); the curve type is not changed.
- void set_gamma (float gamma)
    Recomputes the entire curve using the given gamma value.
- void set_range (float min_x, float max_x, float min_y, float max_y)
    Sets the minimum and maximum x and y values of the curve.
- void set_vector (int count, float data[])
    Sets the vector of points on the curve; the curve type is set to CURVE_TYPE_FREE.
- void set_curve_type (CurveType type)
    Sets the type of the curve.

Property Proxies

- const CurveTypePropertyProxy prop_curve_type ()
    Maximum possible X value (float : Read / Write).
- const MinXPropertyProxy prop_min_x ()
    Minimum possible value for X (float : Read / Write).
- const MinYPropertyProxy prop_min_y ()
    Minimum possible value for Y (float : Read / Write).
- const MaxXPropertyProxy prop_max_x ()
    Maximum possible X value (float : Read / Write).
- const MaxYPropertyProxy prop_max_y ()
    Maximum possible value for Y (float : Read / Write).

Signal Proxies

- const CurveTypeChangedSignalProxy sig_curve_type_changed ()
    Connect to the curve_type_changed_signal; emitted when the curve type changes.

## Protected Member Functions

Constructors

- Curve (GtkCurve *curve, bool reference=false)
    Construct a new Curve from an existing GtkCurve.

Signal Handlers

- virtual void on_curve_type_changed ()
    Called when the curve type changes.

## Detailed Description

A GtkCurve C++ wrapper class.

Curve is a widget that 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. Curve 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/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.

## Constructor & Destructor Documentation

Inti::Gtk::Curve::Curve | ( | GtkCurve * | curve,
|  | bool | reference = false
| ) | `[explicit, protected]`

Construct a new Curve from an existing GtkCurve.

Parameters:

  curve | A pointer to a GtkCurve.
  reference | Set false if the initial reference count is floating, set true if it's not.

The curve can be a newly created GtkCurve or an existing GtkCurve. (see G::Object::Object).

## Member Function Documentation

void Inti::Gtk::Curve::get_vector | ( | int | count,
|  | float | data[]
| ) | const

Returns a vector of points representing the curve.

Parameters:

  count | The number of points to calculate.
  data | The points.

virtual void Inti::Gtk::Curve::on_curve_type_changed | ( |  | ) | `[protected, virtual]`

| Called when the curve type changes. 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().

void Inti::Gtk::Curve::set_curve_type | ( | CurveType | type | ) |

Sets the type of the curve.

Parameters:

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

void Inti::Gtk::Curve::set_gamma | ( | float | gamma | ) |

Recomputes the entire curve using the given gamma value.

Parameters:

  gamma | The 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 CURVE_TYPE_FREE.

void Inti::Gtk::Curve::set_range | ( | float | min_x,
|  | float | max_x,
|  | float | min_y,
|  | float | max_y
| ) |

Sets the minimum and maximum x and y values of the curve.

Parameters:

  min_x | The minimum x value.
  max_x | The maximum x value.
  min_y | The minimum y value.
  max_y | The maximum y value.

The curve is also reset with a call to reset().

void Inti::Gtk::Curve::set_vector | ( | int | count,
|  | float | data[]
| ) |

Sets the vector of points on the curve; the curve type is set to CURVE_TYPE_FREE.

Parameters:

  count | The number of points.
  data | The points on the curve.

The documentation for this class was generated from the following file:

- curve.h

Main Page - Footer