Page 1 of 1

Retrieve the image buffer

Posted: 2008-08-01T03:13:40-07:00
by imagetester
Is their any way to retrieve the image buffer ( data )after reading it ?! In other words i need the unsigned char* of the image.

Image im;
im.read("test.bmp");

unsigned char * buf;

buf=?!

Thanks

Re: Retrieve the image buffer

Posted: 2008-08-01T07:12:04-07:00
by magick
Try writePixels():
  • // Transfers one or more pixel components from the image pixel
    // cache to a buffer or file.
    // Used to support image encoders.
    void Magick::Image::writePixels ( const Magick::QuantumType quantum_,
    unsigned char *destination_ )