On Sat, Jun 30, 2012 at 5:41 AM, Larry Gritz <[email protected]> wrote:
> Still, I am haunted by a key question: does the support of all the
> types merely seem nice and general to us idealists, or does anybody
> actually want and need such functionality?
Ah, simplicity vs generality... always a hard call :)
Given that the non-float code isn't currently used by oiio, it's pretty
tempting to go with the float-only option. OTOH, I'm sure there's plenty
of OIIO users who never contact us so it's pretty hard to assess whether
anybody wants this feature.
Here's a further option we haven't considered: Expose versions of the
IBA operations with explicit types (but in a separate header
imagebufalgo_templates.h or something). For example:
template<typename RPixelT, typename APixelT, typename BPixelT>
bool over_typed (ImageBuf &R, const ImageBuf &A, const ImageBuf &B,
ROI roi = ROI(), int threads = 0);
A float implementation of over() exposed by imagebufalgo.h would then
look like
#include "imagebufalgo_templates.h"
bool over (ImageBuf &R, const ImageBuf &A, const ImageBuf &B,
ROI roi, int threads)
{
return over_typed<float, float, float>(R, A, B, roi, threads);
}
Pros:
* Makes simple usage simple, complicated usage possible.
* Let's users of the API instantiate *exactly* the set of
specializations they're interested in.
* Reduces implementation complexity by removing the code
which deals with the cross product of types.
Cons:
* Forces (at least some of) the implementation details into a
public header. Ugh!
I'm not sure whether this is nice or ugly. Either way, it's an extra
option to consider.
~Chris
_______________________________________________
Oiio-dev mailing list
[email protected]
http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org