usage of displayWindow produces invalid files

Vincent Olivier <[email protected]>
Newsgroups gmane.comp.video.openexr.devel
Message-ID <[email protected]>
Hello,

This is probably very trivial, but I can seem to find a solution. This code works:

Header header (width, height);
RgbaOutputFile file(fileName, header, WRITE_RGB);
file.setFrameBuffer(pixels, 1, width);
file.writePixels(height);

This code doesn’t:

float DCI_SCOPE_RATIO = 858.0 / 1080.0;
int displayHeight = round(height * DCI_SCOPE_RATIO);
int displayHeightOffset = (height - displayHeight) / 2;
Box2i dataWindow (V2i (0, 0 - displayHeightOffset), V2i (width - 1, height - 1));
Box2i displayWindow (V2i (0, 0), V2i (width - 1, displayHeight - 1));
Header header (displayWindow, dataWindow);
RgbaOutputFile file(fileName, header, WRITE_RGB);
file.setFrameBuffer(pixels, 1, width);
file.writePixels(height);

It compiles and all, but it writes corrupted OpenEXR files that are unreadable and that exrheader reports as being “incomplete”. Is there an obvious problem somewhere?

Thanks!

Vincent

_______________________________________________
Openexr-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/openexr-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.