During the reviews of #185760 we realized that the callers of the Geometry::CoverseArea method would only be calling the method with a rectangle that contains the integer bounds of a set of (whole) pixels. This information is not specifically mentioned in its doc comment and is not reinforced by the type of the rectangle (a 32-bit float rect). As analyzed in the PR mentioned above, the new class can only sufficiently answer the query posed by that method if it makes those assumptions (which are both reasonable and also true of all uses of the method), so they should be clarified to prevent future misuse and enforced by the API:
- Change the
Rect rect parameter of the method to IRect pixel_bounds
- Mention in the doc comments for the base virtual method that the bounds will implicitly contain the entire area of each pixel concerned by definition (assumes that the type of the parameter is changed to IRect).
During the reviews of #185760 we realized that the callers of the
Geometry::CoverseAreamethod would only be calling the method with a rectangle that contains the integer bounds of a set of (whole) pixels. This information is not specifically mentioned in its doc comment and is not reinforced by the type of the rectangle (a 32-bit float rect). As analyzed in the PR mentioned above, the new class can only sufficiently answer the query posed by that method if it makes those assumptions (which are both reasonable and also true of all uses of the method), so they should be clarified to prevent future misuse and enforced by the API:Rect rectparameter of the method toIRect pixel_bounds