OpenImageIO/oiio — pull request #224 by lgritz (2012-02-03 07:05:11+00:00)
Title: Review: global attribute()/getattribute for OIIO-wide options and thread control

Add global attribute()/getattribute for OIIO-wide options. First one: "threads"

set number of threads for things that can spawn threads to parallelize
(such as certain ImageBuf algorithms and OpenEXR multi-tile encode/decode).
Set this in the appropriate command-line utilities and also standardize on
--threads as the command line argument across all the utils.

The impetus from this was a suggest from Chris Kulla that we should not
automatically instruct OpenEXR to use many threads. But I didn't want
to lose this ability entirely, and the ability to set a nmber of threads
to be spawned pops up in many places, and generalizes to many potential
future cases of wanting to set various global options, for which we did
not previously have an API call. Now we do, in the form of attribute()
and getattribute(), syntax lifted directly from TextureSystem,
ImageCache, and OSL. But these global ones are not part of any class
(and do not take the place of class-specific ones such as
TextureSystem::attribute()), but rather are in the outer OIIO_NAMESPACE.