Class: Cairo::LinearPattern

Inherits:
GradientPattern show all
Defined in:
ext/cairo/rb_cairo_pattern.c

Instance Method Summary collapse

Methods inherited from GradientPattern

#add_color_stop, #color_stop_count, #get_color_stop_color, #get_color_stop_rgba

Methods inherited from Pattern

#extend, #filter, gradient_supported?, linear_supported?, #matrix, mesh_supported?, radial_supported?, raster_source_supported?, #set_extend, #set_filter, #set_matrix, solid_supported?, supported?, surface_supported?

Constructor Details

#initializeObject



269
270
271
272
273
274
275
276
277
278
279
280
# File 'ext/cairo/rb_cairo_pattern.c', line 269

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

#pointsObject



474
475
476
477
478
479
480
481
482
483
484
485
# File 'ext/cairo/rb_cairo_pattern.c', line 474

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));
}