Method: Magick::Image#roll

Defined in:
ext/RMagick/rmimage.c

#roll(x_offset, y_offset) ⇒ Object

Offset an image as defined by x_offset and y_offset.

Ruby usage:

- @verbatim Image#roll(x_offset, y_offset) @endverbatim

Parameters:

  • self

    this object

  • x_offset

    the x offset

  • y_offset

    the y offset

Returns:

  • a new image


11090
11091
11092
11093
11094
11095
11096
11097
11098
11099
11100
11101
11102
11103
11104
11105
11106
11107
# File 'ext/RMagick/rmimage.c', line 11090

VALUE
Image_roll(VALUE self, VALUE x_offset, VALUE y_offset)
{
    Image *image, *new_image;
    ExceptionInfo exception;

    image = rm_check_destroyed(self);

    GetExceptionInfo(&exception);
    new_image = RollImage(image, NUM2LONG(x_offset), NUM2LONG(y_offset), &exception);
    rm_check_exception(&exception, new_image, DestroyOnError);

    (void) DestroyExceptionInfo(&exception);

    rm_ensure_result(new_image);

    return rm_image_new(new_image);
}