Class: Magick::Image::DrawOptions

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

Instance Method Summary collapse

Constructor Details

#initializeObject

Method: DrawOptions#initialize Purpose: Initialize a DrawOptions object



1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
# File 'ext/RMagick/rmdraw.c', line 1234

VALUE
DrawOptions_initialize(VALUE self)
{
    Draw *draw_options;

    Data_Get_Struct(self, Draw, draw_options);
    draw_options->info = magick_malloc(sizeof(DrawInfo));
    if (!draw_options->info)
    {
        rb_raise(rb_eNoMemError, "not enough memory to continue");
    }

    GetDrawInfo(NULL, draw_options->info);

    if (rb_block_given_p())
    {
        // Run the block in self's context
        (void) rb_obj_instance_eval(0, NULL, self);
    }

    return self;
}