Class: Magick::TextureFill

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

Instance Method Summary collapse

Constructor Details

#initialize(texture_arg) ⇒ Magick::TextureFill

Initialize TextureFill object.

Parameters:



757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
# File 'ext/RMagick/rmfill.c', line 757

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

    TypedData_Get_Struct(self, rm_TextureFill, &rm_texture_fill_data_type, fill);

    texture_image = rm_cur_image(texture_arg);

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

    fill->texture = texture;

    RB_GC_GUARD(texture_image);

    return self;
}

Instance Method Details

#fill(image_obj) ⇒ Magick::TextureFill

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

Parameters:

Returns:



786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
# File 'ext/RMagick/rmfill.c', line 786

VALUE
TextureFill_fill(VALUE self, VALUE image_obj)
{
    rm_TextureFill *fill;
    Image *image;
#if defined(IMAGEMAGICK_7)
    ExceptionInfo *exception;
#endif

    image = rm_check_destroyed(image_obj);
    TypedData_Get_Struct(self, rm_TextureFill, &rm_texture_fill_data_type, fill);

#if defined(IMAGEMAGICK_7)
    exception = AcquireExceptionInfo();
    TextureImage(image, fill->texture, exception);
    CHECK_EXCEPTION();
    DestroyExceptionInfo(exception);
#else
    TextureImage(image, fill->texture);
    rm_check_image_exception(image, RetainOnError);
#endif

    return self;
}