- "Closed intervals" model: if an object is described with
x0, y0, x1, y1, the point with coordinated x, y belongs to the object iff x0 <= x <= x1 and y0 <= y <= y1. In this case 0 <= x0 <= x1 < width and 0 <= y0 <= y1 < height.
- "Half-open intervals" model: if an object is described with
x0, y0, x1, y1, the point with coordinated x, y belongs to the object iff x0 <= x < x1 and y0 <= y < y1. In this case 0 <= x0 < x1 <= width and 0 <= y0 < y1 <= height.
AFAIU, DocLang uses the "closed" model, while "half-open" is in very common use among imaging applications. If not explicitly described, it may cause confusions and misunderstanding of developers implementing the standard.
So, I propose to describe the "closed" mode explicitly in the specification.
Another option is to switch to "half-open" model as it has some benefits. E.g. the rectangle width in half-open model is x1 - x0, while in closed it is x1 - x0 + 1.
x0,y0,x1,y1, the point with coordinatedx,ybelongs to the object iffx0 <= x <= x1andy0 <= y <= y1. In this case0 <= x0 <= x1 < widthand0 <= y0 <= y1 < height.x0,y0,x1,y1, the point with coordinatedx,ybelongs to the object iffx0 <= x < x1andy0 <= y < y1. In this case0 <= x0 < x1 <= widthand0 <= y0 < y1 <= height.AFAIU, DocLang uses the "closed" model, while "half-open" is in very common use among imaging applications. If not explicitly described, it may cause confusions and misunderstanding of developers implementing the standard.
So, I propose to describe the "closed" mode explicitly in the specification.
Another option is to switch to "half-open" model as it has some benefits. E.g. the rectangle width in half-open model is
x1 - x0, while in closed it isx1 - x0 + 1.