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

ImageView::draw Method Inefficiency #15

Open
silverhadch opened this issue Oct 22, 2024 · 1 comment
Open

ImageView::draw Method Inefficiency #15

silverhadch opened this issue Oct 22, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@silverhadch
Copy link
Contributor

The ImageView::draw method uses a nested loop that calls painter.get_point and painter.paint for each pixel. This could be inefficient for larger images, affecting performance.

Consider buffering the image or optimizing the draw logic by reducing the number of calls inside the loop.

@Amjad50
Copy link
Owner

Amjad50 commented Oct 22, 2024

The Painter API provided by the Canvas in ratatui only give you this option, draw each pixel.

A possible improvement would be to ignore Canvas and implement our own Widget

@Amjad50 Amjad50 added the enhancement New feature or request label Oct 22, 2024
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

2 participants