Questions related to Over:

1. Can I assume the alpha channel has values only 0 to 1? I should not
check that?

2. Larry, from previous conversation, what does it mean for an ImageBuf to
be uninitialized here?

// Initialized Result -> use as allocated; Uninitialized Result -> size it
to the union
if (Result is uninitialized) {
ImageSpec newspec = A.spec();
newspec.{x,y,z,width,height,depth} = union of A's and B's pixel regions
Result.reset ("over", newspec); // Resize it
}

3. ImageBuf uses ROI and ROI uses ImageBuf. If I place ROI in ImageBuf.h I
will need to forward declare it. But that makes ROI an incomplete type.
This is a problem because ImageBuf class needs to use some methods of ROI,
in the Iterator constructors. Any suggestions where to place ROI class? I
found other places in the project where forward declarations are used, but
it works because there are no definitions in the *.h file. The challenge
here is that the iterator is defined in the .h file, that is in imagebuf.h.

4. I see xend - xbegin used in many places and it suggests width of region,
but isn't the width actually xend - xbegin + 1? I ask because I need to
implement width() getter method for ROI class.

5. Larry, again from previous conversation you said: "Working with
arbitrary pixel data values, not assuming values are always on [0,1] (i.e.,
HDR imagery) except for operations where that clearly makes no sense."

If I understand right, the input images have values in the range
spec.quant_black to spec.quant_white. I need to map that range to 0-1
because the math is easier and apply the algorithm. Before writing to the
result ImageBuf, map the result back to the range spec.quant_black -
spec.quant_white. That is all, or am I missing something?

6. From previous conversation "If spec.alpha_channel < 0, but it's a
4-channel image, assume that channel 3 is alpha."

Not sure about this because for any other number of channels if alpha is
not specified we assume it has value 1 everywhere. Should this be the only
exception? I vote for not allowing this, because it is kinda messy to
assume which channel is alpha if it is not specified. It will also break
the general rule, which is: if alpha is specified use it, otherwise assume
values 1 everywhere.

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

Reply via email to