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

Graphic mode add access to buffered data #12

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

TravisThomp
Copy link

Adding direct access to the buffer to allow for easy manipulation. Convenient for applying filters.

@IniterWorker
Copy link
Owner

IniterWorker commented Oct 21, 2024

  1. From a graphics mode standpoint, I don't think exposing an "unchecked" method without the business logic of the buffering mechanism is a good idea. If you update something directly, the draw window will not reflect those changes.

  2. If you need raw performance, you can use the unbuffered mode.

let mut display_driver = Gc9a01::new(
    interface,
    DisplayResolution240x240,
    DisplayRotation::Rotate180,
);
  1. I think the filter should be a top layer of embedded-graphics, if you want it to be portable.

Let me know if you have more feedback about it.

@IniterWorker IniterWorker changed the title add access to buffered data Graphic mode add access to buffered data Oct 21, 2024
@TravisThomp
Copy link
Author

Thanks, that makes more sense, especially for portability. I solved my issue by using embedded-graphics-framebuf and the driver in unbuffered mode.

As for future considerations, would it be worth adding a get_pixel_at(x, y) method? It would resolve your concern about the unchecked method, but also provide some access to the data stored in the buffer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants