openexr-devel
[Top][All Lists]
Advanced

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

Re: [Openexr-devel] how to properly save with data window?


From: Paul Miller
Subject: Re: [Openexr-devel] how to properly save with data window?
Date: Mon, 13 Feb 2012 20:48:02 -0600
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0) Gecko/20111222 Thunderbird/9.0.1

On 2/13/2012 7:20 PM, Peter Hillman wrote:

On 14/02/12 11:44, Paul Miller wrote:
On 2/13/2012 4:33 PM, Ciaran Wills wrote:

I think you probably need to offset the pixel pointer to point at
where pixel (0, 0) would be - section 2.2 explains the pixel pointer
math a bit clearer.

I tried that as well:

const half *pixels = pixPtr + chan_index;
pixels = pixels - dataWindow.min.x - (dataWindow.min.y * width);
fb.insert(chanName, Slice(HALF, (char *)(pixels), sizeof(half) *
channels, sizeof(half) * width * channels));


Shouldn't that be:

pixels = pixels - ( dataWindow.min.x - (dataWindow.min.y * width) ) *
channels;

Close!! It *was* the missing channels scale. The calculation should be:

pixels -= (dw.min.x + (dw.min.y * width)) * channels;

Sorry for the false alarm (and help!) guys.

(Piotr - your test code you sent worked perfectly, as expected).

Cheers!



reply via email to

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