Add Header::n_pixels()

This commit is contained in:
Ivan Smirnov 2021-12-01 16:04:04 +00:00
parent f17d2b6201
commit 8f0a78a8c9

View file

@ -57,4 +57,8 @@ impl Header {
out.colorspace = v[13].into(); out.colorspace = v[13].into();
out out
} }
pub const fn n_pixels(&self) -> usize {
(self.width as usize).saturating_mul(self.height as usize)
}
} }