openexr-devel
[Top][All Lists]
Advanced

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

[Openexr-devel] IlmImf TiledOutputFile small patch


From: Daniel Weatherford
Subject: [Openexr-devel] IlmImf TiledOutputFile small patch
Date: Wed, 15 Jun 2005 11:34:31 -0700

Hello all,

I'm in the process of developing some software that writes OpenEXR images
in tiled format. Due to various design decisions, I needed to be able to write
from a framebuffer that is only ever one tile in size. The example code
for doing that seemed to be a fairly roundabout way of handling things, and
I could not get it to work with the data alignment that I was using.

With easier single-tile writes in mind, I added another hook for 
IlmImf::TiledOutputFile::writeTile -- one that allows the caller to directly
specify the Box2i tileRange, rather than having the library autocompute it.

The change is only a few lines' worth, but it made my life a whole lot easier
writing this particular piece of software. It doesn't appear that the changes
would break any compatibility, binary or source, with existing applications,
either.

Just looking at the new method should make its use clear. Basically, if
you have a single-tile data buffer, you set up your framebuffer as normal
(x stride = channels * sizeof(data), y stride = channels * sizeof(data) * tile X
size, assuming your data is interleaved the same way mine is), then call
the new writeTile (int dx, int dy, int lx, int ly, Imath::Box2i
tileRange) method
with tileRange = Box2i(V2i(0,0), V2i(tile X size - 1, tile Y size - 1)).

I've attached the changes in `diff` format. If they're at all useful,
maybe they'll
make it into a future release. Or perhaps I've missed something, and there was
a reason why this behavior was not included / exposed in the library interface.


Daniel Weatherford
address@hidden

Attachment: writeTile_range.diff
Description: Binary data


reply via email to

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