#include #define WIDTH 256 #define HEIGHT 300 ImfRgba pixels[WIDTH * HEIGHT]; int main(int argc, char **argv) { int i; int xmin, ymin, xmax, ymax; int width = WIDTH; int height = HEIGHT; float val; const ImfHeader *header; ImfInputFile *fp = NULL; fp = ImfOpenInputFile("test.exr"); if (!fp) { printf("can't open file\n"); exit(-1); } header = ImfInputHeader((const ImfInputFile *)fp); printf("channels = %d\n", ImfInputChannels(fp)); printf("channels = %d\n", ImfInputChannels(fp)); ImfHeaderDataWindow(header, &xmin, &ymin, &xmax, &ymax); printf("data = %d, %d, %d, %d\n", xmin, ymin, xmax, ymax); ImfInputSetFrameBuffer(fp, pixels, 1, width); ImfInputReadPixels(fp, ymin, ymax); val = ImfHalfToFloat(pixels[0].r); printf("r = %f\n", val); val = ImfHalfToFloat(pixels[0].g); printf("g = %f\n", val); val = ImfHalfToFloat(pixels[0].b); printf("b = %f\n", val); val = ImfHalfToFloat(pixels[0].a); printf("a = %f\n", val); ImfCloseInputFile(fp); }

Software error:

Permission denied at plugin/attach/AttachHandler.pm line 172.

For help, please send mail to the webmaster (webmaster@sourceforge.net), giving this error message and the time and date of the error.