Message 1 of 4
mata api c++ writeToFile not working for float
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
trying to write out data to a texture ( exr would be awsome).
the code snippit should work form the examples in the api .
it does not and i get no errors.
if i change the type to char its fine. why wont it work for float.?
is there another /better way to do this?
better solution to write out exr textures?
MImage animationImage;
int fWidth = 800;
int fHeight = 800;
int fChannels = 4;
animationImage.create( fWidth, fHeight, fChannels, MImage::kFloat);
float *dest = animationImage.floatPixels();
for (int y=0; y < fHeight; y++)
{
for (int x=0; x < fWidth; x++)
{
*dest++ = 0.5;
*dest++ = 0.5;
*dest++ = 0.5;
if (fChannels ==4)
{
*dest++ = 0.0;
}
}
}
animationImage.writeToFile ("D:/myTestiff.iff", "iff") ;