Class: Magick::TextureFill

Inherits:
Object
  • Object
show all
Defined in:
ext/RMagick/rmmain.c

Instance Method Summary collapse

Constructor Details

#initialize(texture_arg) ⇒ Object

Store the texture image.

Ruby usage:

- @verbatim TextureFill#initialize(texture) @endverbatim

Notes:

- The texture is an Image or Image *object

Parameters:

  • self

    this object

  • texture_arg

    the texture



673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
# File 'ext/RMagick/rmfill.c', line 673

VALUE
TextureFill_initialize(VALUE self, VALUE texture_arg)
{
    rm_TextureFill *fill;
    Image *texture;
    VALUE texture_image;

    Data_Get_Struct(self, rm_TextureFill, fill);

    texture_image = rm_cur_image(texture_arg);

    // Bump the reference count on the texture image.
    texture = rm_check_destroyed(texture_image);
    (void) ReferenceImage(texture);

    fill->texture = texture;

    RB_GC_GUARD(texture_image);

    return self;
}

Instance Method Details

#fill(image_obj) ⇒ Object

Call TextureFill with the texture specified when this fill object was created.

Ruby usage:

- @verbatim TextureFill#fill(image) @endverbatim

Parameters:

  • self

    this object

  • image_obj

    the image

Returns:

  • self



706
707
708
709
710
711
712
713
714
715
716
717
718
719
# File 'ext/RMagick/rmfill.c', line 706

VALUE
TextureFill_fill(VALUE self, VALUE image_obj)
{
    rm_TextureFill *fill;
    Image *image;

    image = rm_check_destroyed(image_obj);
    Data_Get_Struct(self, rm_TextureFill, fill);

    (void) TextureImage(image, fill->texture);
    rm_check_image_exception(image, RetainOnError);

    return self;
}