Hmm, It is unclear to me how to add a mask input to an image op. Could
someone answer these questions for me:
Is the mask rectangular?
Is it simply connected?
Is it binary?
If it's not binary, how should one blend the mask and image before
operating?
While I don't see any neighborhood based operations, I can only assume
they would be useful in the future. How do you handle regions of the
mask that are too small for neighborhood operations?
Is there a reference here I should be reading?
I am kinda thinking that it might be easier to include a mask channel in
the ImageData, and use the scanline accessor functions to to snark the
image data that is not covered by the mask. This could be implemented
with no change to the existing ops, since they only work on a single
scanline at a time. All the work would be done in the scanline accessor
function, which wouldn't pass data that was masked.
This still leaves some sticky issues about padding for neighborhood
regions, but is a wonderfully simple solution for point operations.
If the mask is binary, you can also use some rle scheme to eliminate
some work, while you are at it.
--
Dan