Page 1 of 1

Constructor of Magick::Image copies or references the buffer

Posted: 2009-07-04T11:13:19-07:00
by madmage
Hi there,
I have a strange behavior in my application and it seems to be related to ImageMagick. I am wondering if the Magick::Image constructor copies the buffer or references it.

That is,

Image image( 640, 480, "RGB", 0, pixels );

copies the pixels or references it? do I keep ownership (so that I can delete them) after the Image creation?

Thanks!

Re: Constructor of Magick::Image copies or references the buffer

Posted: 2009-07-04T13:01:32-07:00
by magick
ImageMagick reads the pixel buffer you supply. You continue to own the buffer and may delete it at will.