Public Member Functions | Protected Member Functions

Cairo::Gradient Class Reference

Inheritance diagram for Cairo::Gradient:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 Gradient (cairo_pattern_t*cobject, bool has_reference=false)
 Create a C++ wrapper for the C instance.
virtual ~Gradient ()
void add_color_stop_rgb (double offset, double red, double green, double blue)
 Adds an opaque color stop to a gradient pattern.
void add_color_stop_rgba (double offset, double red, double green, double blue, double alpha)
 Adds a translucent color stop to a gradient pattern.
std::vector< ColorStopget_color_stops () const

Protected Member Functions

 Gradient ()

Constructor & Destructor Documentation

Cairo::Gradient::Gradient ( cairo_pattern_t *  cobject,
bool  has_reference = false 
) [explicit]

Create a C++ wrapper for the C instance.

This C++ instance should then be given to a RefPtr.

Parameters:
cobjectThe C instance.
has_referenceWhether we already have a reference. Otherwise, the constructor will take an extra reference.
virtual Cairo::Gradient::~Gradient ( ) [virtual]
Cairo::Gradient::Gradient ( ) [protected]

Member Function Documentation

void Cairo::Gradient::add_color_stop_rgb ( double  offset,
double  red,
double  green,
double  blue 
)

Adds an opaque color stop to a gradient pattern.

The offset specifies the location along the gradient's control vector. For example, a linear gradient's control vector is from (x0,y0) to (x1,y1) while a radial gradient's control vector is from any point on the start circle to the corresponding point on the end circle.

The color is specified in the same way as in Context::set_source_rgb().

Parameters:
offsetan offset in the range [0.0 .. 1.0]
redred component of color
greengreen component of color
blueblue component of color
void Cairo::Gradient::add_color_stop_rgba ( double  offset,
double  red,
double  green,
double  blue,
double  alpha 
)

Adds a translucent color stop to a gradient pattern.

The offset specifies the location along the gradient's control vector. For example, a linear gradient's control vector is from (x0,y0) to (x1,y1) while a radial gradient's control vector is from any point on the start circle to the corresponding point on the end circle.

The color is specified in the same way as in Context::set_source_rgba().

Parameters:
offsetan offset in the range [0.0 .. 1.0]
redred component of color
greengreen component of color
blueblue component of color
alphaalpha component of color
std::vector<ColorStop> Cairo::Gradient::get_color_stops ( ) const

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