unsigned short _imgWidth = 1920, _imgHeight = 1080;
Magick::Image *image = new Magick::Image();
image->size( Magick::Geometry( _imgWidth, _imgHeight ) );
image->backgroundColor( Magick::Color( "white" ) );
image->erase();
for ( unsigned int j = 0; j < _imgHeight; j++ ) {
for ( unsigned int i = 0; i < _imgWidth; i++ ) {
Magick::Color c = image->pixelColor( i, j );
unsigned char r = c.quantumRed() * 255 / QuantumRange;
unsigned char g = c.quantumGreen() * 255 / QuantumRange;
unsigned char b = c.quantumBlue() * 255 / QuantumRange;
}
}
delete image;
I should to process about 5000 images like that. It takes me about 3-4 seconds to just get all the pixels of one image (1920x1080). Are there any methods which work a little bit faster than that?
I would advise you to do some more reading on how to code C++. The error that you are receiving should not be that difficult to figure out. This is an error that is not related to Magick++.