diff --git a/bingus/Cargo.toml b/bingus/Cargo.toml index 824c2e8..f09e84b 100644 --- a/bingus/Cargo.toml +++ b/bingus/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bingus" -version = "0.6.0" +version = "0.8.0" edition.workspace = true license.workspace = true description.workspace = true diff --git a/bingus/src/img/image.rs b/bingus/src/img/image.rs index f8edff5..f17ae29 100644 --- a/bingus/src/img/image.rs +++ b/bingus/src/img/image.rs @@ -29,12 +29,22 @@ where } } +#[derive(PartialEq, Eq)] #[cfg_attr(debug_assertions, derive(Debug))] pub struct Dimensions { pub width: u32, pub height: u32, } +impl Dimensions { + pub fn square(width: u32) -> Self { + Self { + width, + height: width, + } + } +} + impl Div for Dimensions { type Output = Dimensions; fn div(self, rhs: Dimensions) -> Self::Output {