Skip to content

PointMap::pixelate should not constrain to grid by default #4

@blsemo

Description

@blsemo

From @orange-vertex on May 13, 2017 21:47

PointMap::pixelate is used to convert a point in continuous 2D space to a PixelRef (pixel reference). This function will, by default, constrain the return value to pixels within the grid unless explicitly told so by the caller (by providing constrain = false). The expected behaviour when "pixelating" would be to get indices of pixels even if those are not on the grid because the name implies a conversion from a continuous space to a discreet space and not a choice on a grid.

Possible solutions (by my order of preference):

  1. Change the default value of the "constrain" input value to false
  2. Remove bounds checking from the function and expect it to happen outside it
  3. Change the name of the function to "getPixelFromGrid" or something like that

Copied from original issue: blsemo#14

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions