Skip to content

Iterators over line and polygon on the pixels of the image data #19

@bmatthieu3

Description

@bmatthieu3

From the image data iterator that read all the pixels of an image data unit, it could be great to get special methods

data.read_line<P: PixelType>(x1: u64, y1: u64, x2: u64, y2: u64) -> impl Iterator<Item=P>

that would impl something like brensenham to only seek over the pixels in the line between (x1,y1) to (x2,y2)

data.read_inside_polygon<P: PixelType>(p: &[(u64, u64)]) -> impl Iterator<Item=P>

that would only seek and return all the pixels inside a polygon (see https://medium.com/@dillihangrae/scanline-filling-algorithm-852ad47fb0dd)

These methods would be useful in astronomy for:

  • getting all the pixel values of an image along a line
  • computing the flux inside a polygon

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions