How to convert jpg image to raw 32 bit float
Posted: 2010-07-13T16:01:38-07:00
Hello.
I am trying to convert a jpg image to raw format, specifically RGBA 32 bit float.
I am using Magick++ btw...
Here is what I am doing so far...
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++.
I've been looking at the Image.write method, specifically where I can specify a pixel buffer as the fifth paramter and the type...but I'm still not sure if that is proper way to do this.
Any sort of help would be much appreciated!
I am trying to convert a jpg image to raw format, specifically RGBA 32 bit float.
I am using Magick++ btw...
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
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++.
I've been looking at the Image.write method, specifically where I can specify a pixel buffer as the fifth paramter and the type...but I'm still not sure if that is proper way to do this.
Any sort of help would be much appreciated!