I'm trying to create an image object from raw image data. Here is the code I've
been using. It compiles fine but when it runs, it prints out this error in the
image.read call. I'm running on Red Hat Linux. Any ideas on what's wrong?
Thanks for your help.
terminate called after throwing an instance of 'Magick::ErrorMissingDelegate'
what(): ImageMagick: no decode delegate for this image format `'
Aborted
Image image;
void magicktest( void )
{
struct picoGC gc;
unsigned char red ( 0 );
unsigned char green ( 0 );
unsigned char blue ( 0 );
unsigned char* blobData = new unsigned char[100000];
char* c=reinterpret_cast<char *>(blobData);
size_t blobLen=0;
cout << "read" << endl;
ifstream fs ( "../images/red_boat.raw", ifstream::in );
if ( fs.good () )
{
for ( int y = 0; y < IMAGE_SIZE_Y; y++ )
{
for ( int x = 0; x < IMAGE_SIZE_X; x++ )
{
red = fs.get ();
green = fs.get ();
blue = fs.get ();
*c = red;
c++;
blobLen++;
*c = green;
c++;
blobLen++;
*c = blue;
c++;
blobLen++;
}
}
}
Blob blob(static_cast<const unsigned char*>(blobData), blobLen);
Geometry geometry_raw(IMAGE_SIZE_X,IMAGE_SIZE_Y);
Geometry geometry_scale(2*IMAGE_SIZE_X,2*IMAGE_SIZE_Y);
Geometry geo;
image.read( blob, Geometry(IMAGE_SIZE_X,IMAGE_SIZE_Y));
..
}
_______________________________________________
Magick-users mailing list
[email protected]
http://studio.imagemagick.org/mailman/listinfo/magick-users