Skip to content

Conversation

cyrgani
Copy link
Contributor

@cyrgani cyrgani commented Mar 31, 2025

This PR adds the public helper method pixel_amount, which is simpler than always having to write image.width as usize * image.height as usize.
It also adds the private helper assert_same_size to avoid repeating the following larger assertion several times:

assert!(
    self.width as usize * self.height as usize
        == other.width as usize * other.height as usize
);

Both helpers are used in the other Image methods when possible.
Part of #748.

@cyrgani cyrgani force-pushed the simple-image-helpers branch from 2f10fa5 to d4d48b3 Compare March 31, 2025 11:30
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.

1 participant