openexr-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Openexr-devel] usage of displayWindow produces invalid files


From: Peter Hillman
Subject: Re: [Openexr-devel] usage of displayWindow produces invalid files
Date: Tue, 18 Mar 2014 09:03:54 +1300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0

Seems like you aren't writing enough rows - shouldn't you be writing (height + displayHeightOffset) rows of data in the second case?
Or perhaps you mean to say dataWindow (V2i (0, 0 - displayHeightOffset), V2i (width - 1, height - 1 - displayHeightOffset));


On 18/03/14 08:48, Vincent Olivier wrote:
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
address@hidden
https://lists.nongnu.org/mailman/listinfo/openexr-devel


reply via email to

[Prev in Thread] Current Thread [Next in Thread]