I handled all possible cases for the channels of the two input images. Not
sure how to check the result image though.
Just to remind you of the function:
bool ImageBufAlgo::over (ImageBuf &R, const ImageBuf &A, const ImageBuf &B,
ROI roi, int threads) {...}
R is either initialized by the caller or not.
1. If R is initialized already by the caller, I see two options if the
number of channels differ:
Option 1.1: If input images A and B have number of non-alpha channels X,
then fail if the number of non-alpha channels for R is different than X.
Option 1.2: If input images A and B have number of non-alpha channels X,
then DON'T fail if the number of non-alpha channels for R is different than
X. Modify the number of channels for R and move on.
I vote for Option 1.1 since the programmer already made a decision for the
number of channels by initializing R, so if we modify it, it leads to
unexpected behaviour.
2. What about the case where R is initialized, it has same number of
non-alpha channels as the input images but it does not have an alpha
channel? Should I add one or fail? I vote for fail for the same reason as
above.
3. If R is not initialized, then we can give ourselves the freedom to
modify it as we wish I guess? Modify not just the origin and dimensions,
but also number of channels.
Stefan
_______________________________________________
Oiio-dev mailing list
[email protected]
http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org