There are many places in ImageBuf and ImageBufAlgo in which we pass a float* 
and assume that the user has enough space allocated for all the channels.  I 
think it's fine to keep doing that.

The problem with passing a vector<float>& is that the data might not be in that 
form in the app, and would require an allocation and a copy to convert it to a 
vector.

I vote for the float* approach and assume the calling app is smart enough to do 
it right.


On Jul 27, 2012, at 10:26 PM, Stefan Stavrev wrote:

> Aha, I guess that was what Will was trying to warn me about too.
> 
> Chris, I really don't feel comfortable with this:
> 
> "Unfortunately C arrays don't come with a size, so you'll just have to assume
> that the user has done the right thing here."
> 
> How about we use vector<float>? It is either that, or provide an int
> for the number of elements in the float array, which would make the
> API uglier. But definitely not assume the user will do the right thing.
> What do you think?

--
Larry Gritz
[email protected]


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

Reply via email to