I'd like to call your attention to this PR: 
https://github.com/OpenImageIO/oiio/pull/2204

You need not pore over the implementation (unless you want to), but I'd love to 
hear opinions about the basic design of the feature, as explained in the PR 
description.

The long and short of it is that the various classes that manage name/data 
pairs (for metadata, class options, etc.) that are set and retrieved via 
attribute() and getattribute() methods will have an additional 
associative-array-like syntax so you can do things like

    imagespec["oiio:ColorSpace"] = "sRGB";
    imagespec["Orientation"] = 3;

    orient = imagespec["Orientation"].get<int>();
    ...etc...

I kind of like this a lot. It doesn't cover all cases, just the common types. 
So attribute()/getattribute() will always be with us. But for a lot of use 
cases, this is easier to use and more readable.

If anybody has concerns, please voice them. In the absence of objections, I'm 
inclined to merge this into master some time next week.

--
Larry Gritz
[email protected]




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

Reply via email to