|
From: | Michel Lerenard |
Subject: | Re: [Openexr-devel] Writing out to file : one tile at a time |
Date: | Mon, 02 Jun 2014 09:38:34 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130809 Thunderbird/17.0.8 |
Hi,
i've been there a few weeks back, the thing to understand if that the FrameBuffer and the Imf image will always work as if the data buffer was covering the whole image. You can't restrict a Framebuffer to work on a part of the image by, for example, giving it a size. What you'll need to do to write one tile is to configure the FrameBuffer with a pointer pointing to the address at which you buffer would start if it was covering the whole image. The rest is all pointer arithmetic. Typically if you're willing to write a tile that covers the region 256/128 : 287/163 ( a 32*32 tile starting at 256/128 ), and your data buffer contains data for the current tile only, call: out.setFrameBuffer (mybuffer - 256 * 128 * pixelSize , pixelSize, tileWidth * pixelSize); where mybuffer is a char*, pixelSize gives the memory size of an item. (char = 1, half= 2, float = 4) On 05/28/2014 07:36 PM, Nicholas Yue wrote:
|
[Prev in Thread] | Current Thread | [Next in Thread] |