openexr-devel
[Top][All Lists]
Advanced

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

Re: [Openexr-devel] Using Rgba interface for non-rgba files?


From: Florian Kainz
Subject: Re: [Openexr-devel] Using Rgba interface for non-rgba files?
Date: Thu, 07 Apr 2005 11:06:02 -0700
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3) Gecko/20030314

When I added support for grouping channels into "layers" according
to their channel names, I considered adding a method to RgbaInputFile
that would allow you to specify which layer should be read.  If you
wanted to read layer "L", then RgbaInputFile would read channels
"L.R", "L.G", "L.B" and "L.A" instead of "R", "G", "B" and "A".
This could be extended to allow reading an arbitrary set of four
channels.  One could add two new methods to class RgbaInputFile:

    void setLayerName (const std::string &layerName);

    void setRGBAChannelNames (const std::string &rChannelName,
                              const std::string &gChannelName,
                              const std::string &bChannelName,
                              const std::string &aChannelName);

For symmetry, classes RgbaOutputFile, TiledRgbaInputFile and
TiledRgbaOutputFile should probably support similar methods.

Making RgbaInputFile automatically read the "first three" channels
in the file might not be such a good idea.  If a file has more than
three channels, which ones are the first three?  Which channel maps
to R, G, and B respectively?  Assuming that we go by alphabetical
order, are "R", "G" and "B" an exception?  If you have an image
with channels "x", "y" and "z", and you add an "R" channel, does
RgbaInputFile read "R", "x" and "y"?

Overall, I am not sure how useful support for non-RGBA channels
in the RGBA-only interface would be.  The fully general interface
already allows you to read an arbitrary set of channels.
The RGBA-only interface and its implementation would become more
complicated without giving you functionality that isn't already
available.

Florian






reply via email to

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