openexr-devel
[Top][All Lists]
Advanced

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

Re: [Openexr-devel] Storing multiple layers in OpenEXR files


From: Yves Poissant
Subject: Re: [Openexr-devel] Storing multiple layers in OpenEXR files
Date: Thu, 17 Feb 2005 12:29:49 -0500

Since a file's channels are already sorted alphabetically, it
would not be a lot of work to add a method to class ChannelList
that finds all channels whose names begin with with a  given
prefix, e.g. "layername.":

    void
    ChannelList::channelsWithPrefix
        (const char prefix[],
         ConstIterator &first,
         ConstIterator &last) const
     {
        first = last = _map.lower_bound (prefix);
        int n = strlen (prefix);

        while (last != end() && strncmp (last.name(), prefix, n) <= 0)
            ++last;
     }

The function might be used like this:

    ChannelList::ConstIterator first, last;
    channels.channelsWithPrefix ("diffuse.", first, last);

    for (ChannelList::constIterator i = first; i != last; ++i)
        doSomethingWithChannel (i.channel());

I agree with this. If this was implemented in a next release, I would use it that way.

In one single string attribute. I llike that idea. And this would
certainly save file space.

What about something like this :
"diffuse{R,G,B},ambiance{R,G,B},Z,tangent{X,Y},normal{X,Y}"

I would prefer:

    "diffuse,ambiance,Z,tangent,normal"

I have no problems with that if the above proposed new method is available.

Or, even better, use an attribute whose value is a vector of strings,
and store the names of the layers in the elements of the vector.

I did not know we had vector of strings attributes in OpenEXR. That would be the best approach. I'll look into that.

I guess we can expect the new channels retrieval method to be implemented and available in a future release, and I will have to change my code at this point to match the new method. In the meantime, since I don't want to change my code twice, I will keep my current code as it is for now.

Thanks,

Yves Poissant
Hash Inc.




reply via email to

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