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

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
russianbear

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

Post 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!
Post Reply