Skip to content

Would be nice to explicitly document the coordinates model #161

Description

@slon-aby
  • "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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions