I would like to be able to know the total area covered by a region (e.g. a double integral over this said area).
I cannot find any method for that, and I wonder will I have to go pixel-by-pixel.
Thanks in advance!
I would like to be able to know the total area covered by a
Share
You should be able to use a
RegionIteratorand sum the areas of the rectangles returned.Reasoning: The Andriod docs imply that when boolean ops are done on regions, the result region is a new set of non-overlapping rectangles with the desired union. In other words,
A - B, where A and B are rectangles, may produce 0, 1, 2, 3, or 4 rectangles as a result.I have not tested, but the source at the Android xRef site shows that a validated region consists of rectangles with no overlaps.