Class: Cairo::LinearPattern
- Inherits:
-
GradientPattern
- Object
- Pattern
- GradientPattern
- Cairo::LinearPattern
- Defined in:
- ext/cairo/rb_cairo_pattern.c
Instance Method Summary collapse
- #initialize ⇒ Object constructor
- #points ⇒ Object
Methods inherited from GradientPattern
#add_color_stop, #color_stop_count, #get_color_stop_color, #get_color_stop_rgba
Methods inherited from Pattern
#extend, #filter, #matrix, #set_extend, #set_filter, #set_matrix
Constructor Details
#initialize ⇒ Object
201 202 203 204 205 206 207 208 209 210 211 212 |
# File 'ext/cairo/rb_cairo_pattern.c', line 201
static VALUE
cr_linear_pattern_initialize (VALUE self, VALUE x0, VALUE y0,
VALUE x1, VALUE y1)
{
cairo_pattern_t *pattern;
pattern = cairo_pattern_create_linear (NUM2DBL (x0), NUM2DBL (y0),
NUM2DBL (x1), NUM2DBL (y1));
cr_pattern_check_status (pattern);
DATA_PTR (self) = pattern;
return Qnil;
}
|
Instance Method Details
#points ⇒ Object
406 407 408 409 410 411 412 413 414 415 416 417 |
# File 'ext/cairo/rb_cairo_pattern.c', line 406
static VALUE
cr_linear_pattern_get_linear_points (VALUE self)
{
cairo_status_t status;
double x0, y0, x1, y1;
status = cairo_pattern_get_linear_points (_SELF (self), &x0, &y0, &x1, &y1);
rb_cairo_check_status (status);
return rb_ary_new3 (4,
rb_float_new (x0), rb_float_new (y0),
rb_float_new (x1), rb_float_new (y1));
}
|