On Sun, Jul 15, 2012 at 10:19 AM, Larry Gritz <[email protected]> wrote:
[...]
> Then you just call like this:
>
>     over (R, A, B, Composite::Over);
>     blend (R, A, B, Blend::Screen);

Looks pretty nice to me.  Presumably we cut down the full list of
compositing operations to just

namespace Composite { enum Op {
    Over,
    In,
    Out,
    Atop,
    Xor
}; }

since the user can get to the other half by changing the order of A and
B.  (Is there any good reason to support the trivial compositing ops
which return just A,B or an empty image?  I can't think of one.)

> I used the namespaces because I think that pre-C++11, you can't count
> on the enum values being scoped as locally as we'd like.

Yeah, if we were using C++11 we could use an "enum class" to avoid
leaking the names into the surrounding scope:

enum class Blend { Normal, Multiply, Screen, ... };

~Chris
_______________________________________________
Oiio-dev mailing list
[email protected]
http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org

Reply via email to