openexr-devel
[Top][All Lists]
Advanced

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

Re: [Openexr-devel] Writing out to file : one tile at a time


From: Nicholas Yue
Subject: Re: [Openexr-devel] Writing out to file : one tile at a time
Date: Mon, 02 Jun 2014 08:32:26 -0700
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:24.0) Gecko/20100101 Thunderbird/24.5.0

On 2/06/14 12:38 AM, Michel Lerenard wrote:
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)
Thanks Michel, now I understand why there is the subtraction going on.

Cheers
-- 
Nicholas Yue
Graphics - RenderMan, Visualization, OpenGL, HDF5
Custom Dev - C++ porting, OSX, Linux, Windows
http://au.linkedin.com/in/nicholasyue
https://vimeo.com/channels/naiadtools

reply via email to

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