Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
bmatthieu3 opened this issue Jan 24, 2025 · 0 comments
Open

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

bmatthieu3 opened this issue Jan 24, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@bmatthieu3
Copy link
Collaborator

bmatthieu3 commented Jan 24, 2025

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
@bmatthieu3 bmatthieu3 changed the title Iterators over line/circle/polygon on the pixels of the image data Iterators over line and polygon on the pixels of the image data Jan 24, 2025
@bmatthieu3 bmatthieu3 added the enhancement New feature or request label Feb 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant