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!

_______________________________________________
Openexr-devel mailing list
Openexr-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/openexr-devel

Reply via email to