I agree float* would be more appropriate than vector<float>. I really like your idea of having 4 functions. Here is how I see this:
1. The 'main' function that will take float* contrast, float* pivot, fails if both of these are not of size A.nchannels(). This function passes these two arrays to contrast_impl which then uses each contrast, pivot pair for their corresponding channel. It is the 'main' function that will do input validation, the other 3 functions will only 'prepare' the arguments and call the 'main' function. 2. The function that takes float* contrast, float pivot, will turn pivot in float*, so that it has A.nchannels() elements all with value pivot, and then call the 'main' function. Same for the other two functions, leave the float* argument alone but create an array from the float argument. So again, these 3 functions won't do input validation, they just create an array from the float argument. This is all we are left to deal with and contrast is pretty much done. So, let's just make a decision on this. I am fine with the above, but will wait for your approval.
_______________________________________________ Oiio-dev mailing list [email protected] http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org
