I have a probably trivial and simple question, but I don't find the answer nor do I get it working.
I want to use Magick++ as a library supporting image manipulations on an existing application.
That application stores a 16bit RGB image as uint16_t (*Image)[3].
Is there any way to construct an IM image along the lines of :
Magick::Image IM_Image(Width,Height,"RGB",ShortPixel,Image);
and then have IM does a transformation like
IM_Image.normalize() operating on the original data ?
Or do I need to go through a copy-in / copy-out based on setPixels etc ... ?
Thanks for clarification and/or (pointer to) sample code.
Have Magick++ operating on an existing uint16_t (*Image)[3]
Re: Have Magick++ operating on an existing uint16_t (*Image)[3]
You can import an image like you described from a memory buffer. There is no need to iterate over the pixels.
Re: Have Magick++ operating on an existing uint16_t (*Image)[3]
That's what I would have thought. However, the simple sequence :
uint16_t (*m_Image)[3];
... constructing some m_Image ...
Magick::Image IM_Image(Width,Height,"RGB",ShortPixel,m_Image);
IM_Image.normalize();
Seems to leave the image (m_Image) unaltered, while the iteration-over-pixels does work.
Where am I going wrong ?
uint16_t (*m_Image)[3];
... constructing some m_Image ...
Magick::Image IM_Image(Width,Height,"RGB",ShortPixel,m_Image);
IM_Image.normalize();
Seems to leave the image (m_Image) unaltered, while the iteration-over-pixels does work.
Where am I going wrong ?
Re: Have Magick++ operating on an existing uint16_t (*Image)[3]
Read your image with both methods and write it to different files on disk and display the results. We assume they produce two different renderings. Perhaps you need to set the endian, either LSBEndian or MSBEndian.