openexr-devel
[Top][All Lists]
Advanced

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

[Openexr-devel] Computing "base" Address When Setting up the FrameBuffer


From: Angus Taggart
Subject: [Openexr-devel] Computing "base" Address When Setting up the FrameBuffer
Date: Fri, 19 Nov 2004 15:21:45 -0800

OK, I think that my lack of sleep (due to a 5-month-old baby) is starting to catch up me because I can't wrap my head around this!

I'm having problems setting the y-offset component for the base address for the FrameBuffer correctly when reading a rgba scanline file (in chunks) for the case when the data window and the display window are not aligned. Specifically, I'm not getting the correct result for the example image t13.exr that has the following data window and display window values:

Display Window: min (399, 299), max (499, 399)
Data Window: min (0, 0), max(399, 299)

How should the yOffset component of the base address be calculated? Here's how I'm setting up the FrameBuffer:

int exrBufWidth = _fileHeader->dataWindow().max.y-_fileHeader->dataWindow().min.y+1;
int exrBufHeight = myOutputBuf->nLines;
int exrBufXOffset = _fileHeader->dataWindow().min.x;
int exrBufYOffset = myOutputBuf->lineNum + ?????; // NOTE:
myOutputBuf->lineNum is relative to the bottom of the display window.

_rgbaExrDataBuf.resizeErase(exrBufWidth, exrBufHeight);
_rgbaScanlineFile->setFrameBuffer (&_rgbaExrDataBuf[0] - exrBufXOffset - exrBufYOffset * exrBufWidth,
1, exrBufWidth);


Thanks for any help.

Angus


------------------------------------
Angus Taggart
Apple R&D, Santa Monica


reply via email to

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