Page 1 of 1

How to cast image int -> float representation using Magick++

Posted: 2010-07-13T13:47:02-07:00
by russianbear
Hello.
I am trying to convert a jpg image to raw format, specifically RGBA 32 bit float.
Here is what I am doing so far...

Code: Select all

int _tmain(int argc, _TCHAR* argv[]) {

   Geometry g(800, 533);
   Image theI;
   try {
      theI.read(g, "./bluejay.jpg");
      theI.depth(32);
      theI.write("./bluejay32int.procd.rgba");
   }//end try block
   catch(Exception& ex) {
      cout << "imagicktstr,error," << ex.what() << endl;
   }//end catch block
   return 0;
}//end main
This code compiles and successfully outputs a raw image; however, it is still integer!

How do represent the pixels in Float format????
I noticed that using the command line interface you can use the convert and define options...but I don't see the corresponding APIs for Magick++. :?

Thanks for any sort of help!