Question

I have an Image created with ImageMagick. I'm working in C++:

int height = xxx;
int width = xxx;
uchar* raw = xxxx; // data from somewhere else
format = "Y800";
Image myImage(width, height, format, raw, width*height);

I just want to visualize the Image to the screen in a very simple way to make sure that the raw data was applied correctly. How can I do this?

[yes I've RTFM. All I can find is how to do it in shell if I want to display image file]

Was it helpful?

Solution

I was confusing Zbar::Image with Magick::Image.

Zbar::Image myZbarImage(width, height, format, raw, width*height);

is the constructor for Zbar::Image which is not directly compatible with Magick::Image, which has its on constructors manual. I can then easily display with the display() function:

Magick::Image myMagickImage; // fill
myMagickImage.display();
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top