class Cairo::LinearPattern - cairo-1.12.9 Documentation

# class Cairo::LinearPattern

### Public Class Methods

new(p1, p2, p3, p4) click to toggle source

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

### Public Instance Methods

points() click to toggle source

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