Greetings,
I found a limitation in the class TiledRgbaOutputFile as provided in
the IlmImf
library, in that it seems to not allow writing a tile from a buffer
that only
contains this tile. By default it assumes that the provided pointer is
relative
to an absolute buffer that contains the entire image. However, the
underlying
class "Slice" already supports such relative data, and it's straightforward
to just pass this parameter to the creation of such slices.
Here are the modifications I made to the library, as I did not find another
way to achieve the same. These changes seem to be simple and don't
break any
existing code while it just works for me then.
Best regards,
Werner
==========================
In file ImgTiledRgbaFile.h : 170
void setFrameBuffer (const Rgba *base,
size_t xStride,
size_t yStride,
bool relativeBase = false);
========================
In file ImgTiledRgbaFile.cpp : 374
void
TiledRgbaOutputFile::setFrameBuffer (const Rgba *base,
size_t xStride,
size_t yStride,
bool relativeBase)
{
...
fb.insert ("R", Slice (HALF, (char *) &base[0].r, xs, ys, 1,1, 0.0,
relativeBase, relativeBase) );
fb.insert ("G", Slice (HALF, (char *) &base[0].g, xs, ys, 1,1, 0.0,
relativeBase, relativeBase) );
fb.insert ("B", Slice (HALF, (char *) &base[0].b, xs, ys, 1,1, 0.0,
relativeBase, relativeBase) );
fb.insert ("A", Slice (HALF, (char *) &base[0].a, xs, ys, 1,1, 0.0,
relativeBase, relativeBase) );
...
}
========================