Method: Magick::Image#roll

Defined in:
ext/RMagick/rmimage.cpp

#roll(x_offset, y_offset) ⇒ Magick::Image

Offset an image as defined by x_offset and y_offset.

Parameters:

  • x_offset (Numeric)

    the x offset

  • y_offset (Numeric)

    the y offset

Returns:



12243
12244
12245
12246
12247
12248
12249
12250
12251
12252
12253
12254
12255
12256
12257
12258
12259
12260
# File 'ext/RMagick/rmimage.cpp', line 12243

VALUE
Image_roll(VALUE self, VALUE x_offset, VALUE y_offset)
{
    Image *image, *new_image;
    ExceptionInfo *exception;
    ssize_t x = NUM2LONG(x_offset);
    ssize_t y = NUM2LONG(y_offset);

    image = rm_check_destroyed(self);

    exception = AcquireExceptionInfo();
    GVL_STRUCT_TYPE(RollImage) args = { image, x, y, exception };
    new_image = (Image *)CALL_FUNC_WITHOUT_GVL(GVL_FUNC(RollImage), &args);
    rm_check_exception(exception, new_image, DestroyOnError);
    DestroyExceptionInfo(exception);

    return rm_image_new(new_image);
}