Class: Cairo::RadialPattern

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, #matrix, #set_extend, #set_filter, #set_matrix

Constructor Details

#initializeObject



214
215
216
217
218
219
220
221
222
223
224
225
226
227
# File 'ext/cairo/rb_cairo_pattern.c', line 214

static VALUE
cr_radial_pattern_initialize (VALUE self, VALUE cx0, VALUE cy0, VALUE radius0,
                              VALUE cx1, VALUE cy1, VALUE radius1)
{
  cairo_pattern_t *pattern;

  pattern = cairo_pattern_create_radial (NUM2DBL (cx0), NUM2DBL (cy0),
                                         NUM2DBL (radius0),
                                         NUM2DBL (cx1), NUM2DBL (cy1),
                                         NUM2DBL (radius1));
  cr_pattern_check_status (pattern);
  DATA_PTR (self) = pattern;
  return Qnil;
}

Instance Method Details

#circlesObject



419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
# File 'ext/cairo/rb_cairo_pattern.c', line 419

static VALUE
cr_radial_pattern_get_radial_circles (VALUE self)
{
  cairo_status_t status;
  double x0, y0, r0, x1, y1, r1;

  status = cairo_pattern_get_radial_circles (_SELF (self),
                                             &x0, &y0, &r0,
                                             &x1, &y1, &r1);
  rb_cairo_check_status (status);
  return rb_ary_new3 (2,
                      rb_ary_new3 (3,
                                   rb_float_new (x0),
                                   rb_float_new (y0),
                                   rb_float_new (r0)),
                      rb_ary_new3 (3,
                                   rb_float_new (x1),
                                   rb_float_new (y1),
                                   rb_float_new (r1)));
}