I am new on Magick++, so I need some help for start. I wrote this simple code that load an image from command line and then create a pixel cache to access pixels in read-only. I found out that the line with AcquireImagePixels doesn't compile with error on Visual C++ 2008 Express Edition:
error C3861: 'AcquireImagePixels': identifier not found
but using getConst instead it works. Why?
Thank you all for help
Code: Select all
#include <iostream>
#include <Magick++.h>
using namespace std;
using namespace Magick;
int main(int argc, char * argv[]) {
if (argc != 2) { cout << "\nUsage: EncodeBRM ImageFileName\n"; exit(1); }
cout << "\nInitializing ImageMagick library..."; InitializeMagick(* argv); cout << "Done.";
try {
cout << "\nLoading source image..."; Image SourceImage; SourceImage.read(argv[1]); cout << "Done.";
cout << "\nImage info: " << SourceImage.columns() << "x" << SourceImage.rows() << "x" << SourceImage.depth() << "bpp " << SourceImage.format();
cout << "\nConverting to BRM...";
Pixels SourceImageCache(SourceImage);
const PixelPacket * pSourceImage = SourceImageCache.getConst(0, 0, SourceImage.columns(), SourceImage.rows());
//const PixelPacket * pSourceImage = AcquireImagePixels(SourceImage, 0, 0, SourceImage.columns(), SourceImage.rows());
} catch(exception &MagickError) { cout << "\nImageMagick exception: " << MagickError.what() << endl; return(1); }
}