Class: Magick::TextureFill

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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(texture_arg) ⇒ Object

Extern: TextureFill#initialize Purpose: Store the texture image



575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
# File 'ext/RMagick/rmfill.c', line 575

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

    Data_Get_Struct(self, rm_TextureFill, fill);

    texture_image = ImageList_cur_image(texture_arg);

    // Bump the reference count on the texture image.
    Data_Get_Struct(texture_image, Image, texture);
    (void) ReferenceImage(texture);

    fill->texture = texture;
    return self;
}

Class Method Details

.new(texture) ⇒ Object



542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
# File 'ext/RMagick/rmfill.c', line 542

VALUE
TextureFill_new(VALUE class, VALUE texture)
{
    rm_TextureFill *fill;
    VALUE argv[1];
    volatile VALUE new_fill;

    new_fill = Data_Make_Struct(class
                              , rm_TextureFill
                              , NULL
                              , free_TextureFill
                              , fill);
    argv[0] = texture;
    rb_obj_call_init((VALUE)new_fill, 1, argv);
    return new_fill;
}

Instance Method Details

#fill(image_obj) ⇒ Object

Extern: TextureFill_fill(image_obj) Purpose: the TextureFill#fill method



598
599
600
601
602
603
604
605
606
607
608
609
610
611
# File 'ext/RMagick/rmfill.c', line 598

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

    Data_Get_Struct(image_obj, Image, image);
    Data_Get_Struct(self, rm_TextureFill, fill);

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

    return self;
}