openexr-devel
[Top][All Lists]
Advanced

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

[Openexr-devel] Writing a tiled Rgba image file with tiles given


From: Werner Benger
Subject: [Openexr-devel] Writing a tiled Rgba image file with tiles given
Date: Tue, 03 Mar 2009 15:06:09 -0600
User-agent: Opera Mail/9.63 (Win32)

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) );
...
}

========================


--
___________________________________________________________________________
Dr. Werner Benger <address@hidden>               Visualization Research
Laboratory for Creative Arts and Technology (LCAT)
Center for Computation & Technology at Louisiana State University (CCT/LSU)
239 Johnston Hall, Baton Rouge, Louisiana 70803
Tel.: +1 225 578 4809                        Fax.: +1 225 578-5362




reply via email to

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