[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Openexr-devel] Deep image input data memory layout.
From: |
Thomas Loockx |
Subject: |
[Openexr-devel] Deep image input data memory layout. |
Date: |
Mon, 3 Aug 2015 11:11:08 +1200 |
Hi,
I'm trying to integrate OpenEXR deep pixel rendering into our render engine.
We ran into a crash in copyFromDeepFrameBuffer in this snippet (more
specifically in line 1598 of ImfMisc.cpp).
case OPENEXR_IMF_INTERNAL_NAMESPACE::FLOAT:
for (int x = xMin; x <= xMax; x++)
{
unsigned int count =
sampleCount(sampleCountBase,
sampleCountXStride,
sampleCountYStride,
x - xOffsetForSampleCount,
y - yOffsetForSampleCount);
const char* ptr = base + (y-yOffsetForData) *
dataYStride + (x-xOffsetForData) * dataXStride;
const char* readPtr = ((const char**) ptr)[0];
for (unsigned int i = 0; i < count; i++)
{
Xdr::write <CharPtrIO> (writePtr, *(const float *)
readPtr); // CRASH HERE
readPtr += sampleStride;
}
}
break;
My understanding here is that OpenEXR internally interprets a deep
pixel in a channel as a pointer to an array of floating point values.
Unfortunately our memory isn't layed out like that. We allocate a
single memory chunk for the
full deep image. I tried several ways of creating the deep slice but I
can't seem to code my way around it.
Am I forced to copy all my data in arrays (or at least allocate a
separate buffer of float* pointers that point into my data) or is
there a way around this?
thanks,
Thomas Loockx
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Openexr-devel] Deep image input data memory layout.,
Thomas Loockx <=