Class: Magick::Image::DrawOptions

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

Instance Method Summary collapse

Constructor Details

#initializeObject

Initialize a DrawOptions object.

Ruby usage:

- @verbatim DrawOptions#initialize @endverbatim

Parameters:

  • self

    this object



1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
# File 'ext/RMagick/rmdraw.c', line 1485

VALUE
DrawOptions_initialize(VALUE self)
{
    Draw *draw_options;

    Data_Get_Struct(self, Draw, draw_options);
    draw_options->info = AcquireDrawInfo();
    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;
}