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

rename unsafe_get_pixel to get_pixel_unchecked? #1340

Open
TianyiShi2001 opened this issue Oct 10, 2020 · 1 comment
Open

rename unsafe_get_pixel to get_pixel_unchecked? #1340

TianyiShi2001 opened this issue Oct 10, 2020 · 1 comment

Comments

@TianyiShi2001
Copy link
Member

Personally I think it's better to use .get_pixel_unchecked since there exist .get_unchecked() and .get_unchecked_mut for std slices.

Additionally, would .get_pixel_unchecked_mut be useful?

@TianyiShi2001
Copy link
Member Author

I notice that .get_pixel is not quite parallel with std's .get. The former returns T, the latter returns &T. But I saw this TODO comment:

    /// TODO: change this signature to &P
    fn get_pixel(&self, x: u32, y: u32) -> Self::Pixel;

Was there any progress in doing so?

@theotherphil theotherphil reopened this Oct 10, 2020
@theotherphil theotherphil transferred this issue from image-rs/imageproc Oct 10, 2020
@HeroicKatora HeroicKatora mentioned this issue Feb 13, 2021
22 tasks
@HeroicKatora HeroicKatora added this to To do in Version 0.24 Feb 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Version 0.24
  
To do
Development

No branches or pull requests

2 participants