Constructor of Magick::Image copies or references the buffer

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
madmage

Constructor of Magick::Image copies or references the buffer

Post 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!
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

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

Post by magick »

ImageMagick reads the pixel buffer you supply. You continue to own the buffer and may delete it at will.
Post Reply