I am developing an application where I have a jpeg image in a memory buffer. Normally it just gets copied to a framebuffer and is displayed. What I have to do is Zoom in on the image. Here is basically what I am doing so far.
Code: Select all
Zoom_in_on_Image (jpegBuffer, jSize)
{
wand myWand;
size_t *image_length;
unsigned char *myBuffer;
// create wand
NewWandGenesis ( myWand);
// copy jpeg to wand
MagicReadImageFromBlob (myWand, jpegBuffer, jSize);
// Scale 2x
MagickMagnifyImage (myWand);
// get contents of the wand
myBuffer = MagickGetImageBlob(myWand, &image_length);
// copy it to the frame buffer memory
memcpy (frameBuffer, myBuffer,image_length);
// Display it in the frame buffer. If I use jpegBuffer it displayes a normal sized image.
display_fb (frameBuffer, Dev_0);
I do not get any error returns. But image_length from the MagickGetImageBlob() is zero. So what am I missing in my steps? As I said I am new to using these libraries. I assume ReadImageFromBlob is copying it into the 'wand' instance. Is it?
Any pointers, help, examples (in C please) would be very much appreciated.
Glen