Page 1 of 1

error C3861: 'AcquireImagePixels': identifier not found

Posted: 2008-07-28T06:16:53-07:00
by LiloLilo
Hi all!

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); }
}

Re: error C3861: 'AcquireImagePixels': identifier not found

Posted: 2008-07-28T06:23:47-07:00
by magick
AcquireImagePixel() is a MagickCore method so it requires the MagickLib:: namespace prefix. Instead use getConstPixels() which is a Magick++ method.

Re: error C3861: 'AcquireImagePixels': identifier not found

Posted: 2008-07-28T07:37:36-07:00
by LiloLilo
magick wrote:AcquireImagePixel() is a MagickCore method so it requires the MagickLib:: namespace prefix. Instead use getConstPixels() which is a Magick++ method.
It works! Thank you for help :D