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

Why crop need a mutable reference to an image #177

Open
dfeyer opened this issue May 13, 2024 · 0 comments
Open

Why crop need a mutable reference to an image #177

dfeyer opened this issue May 13, 2024 · 0 comments

Comments

@dfeyer
Copy link

dfeyer commented May 13, 2024

The current signature is:

pub fn crop(
    photon_image: &mut [PhotonImage](https://docs.rs/photon-rs/latest/photon_rs/struct.PhotonImage.html),
    x1: [u32](https://doc.rust-lang.org/nightly/std/primitive.u32.html),
    y1: [u32](https://doc.rust-lang.org/nightly/std/primitive.u32.html),
    x2: [u32](https://doc.rust-lang.org/nightly/std/primitive.u32.html),
    y2: [u32](https://doc.rust-lang.org/nightly/std/primitive.u32.html)
) -> [PhotonImage](https://docs.rs/photon-rs/latest/photon_rs/struct.PhotonImage.html)

But inside the implementation, I don't understand why we need a mutable reference. I need to crop really big image, and can be nice the have async cropper, but with the mutability it's a bit messy.

Thanks for the clarification, and thanks for all the hard on it, amazing project

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