The reason it's I said it was murky was the dataExtractor class is
accessing (and) requires virtually all the private variables of the
image class. I have a get/set method for pretty much everything and
I'm using them everywhere. I mean, I have a flood method in
dataExtractor which get's a pointer to the pixeldata in image, gets
the size of the image, and performs a flood fill operation. I do this
to mark it visually and logically as already processed. But I also
obtain scanlines of the blob, create a binary duplication of the
flooded area, etc. The only way I can obtain this info is through a
flood operation. But flood fill? Flood sounds like it should be in the
image class, or maybe an image tools class, but it also does all this
specialized stuff that doesn't mean anything to any other program or
class.
The difficulty you are facing is primarily one of perspective. I
encourage you stop thinking in hierarchical terms such as has-a,
inside, outside, belongs, contains, etc. Instead think in flat
relational and functional terms.
For example "flood fill" should not "be in" an image class. It
is an operator, a function, that maps one image (the source or
domain or argument) to another image (the output or co-domain
or result). In is not "in" anything rather it is a mapping or
a relation "between" values.
So a usage of flood fill might look like any of these
floodFill(tmp) ; //modify in-place
floodFill(src,tgt) ; //out by reference
floodFill(src,&tgt) ; //out by pointer
tgt = floodFill(src) ; //out by return
...
whichever is most appropriate for your designs. Perhaps even a
2D-iterator solution is appropriate. The important point though
is that floodFill is not "inside" or "part of" any class, object,
etc just as a myriad of other functions or not "in" something. For
example, is the sqrt function "inside" a double? Or a float? No.
Rather it is a mapping "between" numbers. Think algebraically,
mathematically, and in flat relational terms as functions that
operate /between/ objects mapping values to values.
Some keywords to further your studies if interested:
http://en.wikipedia.org/wiki/Binary_relation
http://en.wikipedia.org/wiki/Function_(mathematics)
http://en.wikipedia.org/wiki/Operator
KHD