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

Mutable methods #23

Open
owenthewizard opened this issue Apr 25, 2019 · 2 comments
Open

Mutable methods #23

owenthewizard opened this issue Apr 25, 2019 · 2 comments

Comments

@owenthewizard
Copy link

owenthewizard commented Apr 25, 2019

Would it be possible to write mutable versions of functions to allow for in-place image editing? For example, the BGRA --> RGBA in examples/screenshot.rs could be rewritten as:

for pixel in buffer.chunks_exact_mut(4) {
    unsafe { pixel.get_unchecked_mut(0..3).reverse() }
}

Not sure if that's actually better but I'm working on a project that could use scrap if it allowed in-place editing of the screenshot.

@owenthewizard
Copy link
Author

I think I could write a PR for this.

@owenthewizard
Copy link
Author

#24

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

No branches or pull requests

1 participant