diff --git a/src/header.rs b/src/header.rs index 9369b1b..c1cd526 100644 --- a/src/header.rs +++ b/src/header.rs @@ -57,4 +57,8 @@ impl Header { out.colorspace = v[13].into(); out } + + pub const fn n_pixels(&self) -> usize { + (self.width as usize).saturating_mul(self.height as usize) + } }