pub struct PlaneSize { /* private fields */ }
Expand description
The size of the image plane in pixels
Implementations§
Source§impl PlaneSize
impl PlaneSize
Sourcepub fn new(width: u16, height: u16, channels: u8) -> Result<Self, PlaneError>
pub fn new(width: u16, height: u16, channels: u8) -> Result<Self, PlaneError>
Create a new PlaneSize
with the given width, height, and channels
Sourcepub fn area_wh(&self) -> usize
pub fn area_wh(&self) -> usize
The total number of 2D pixels in the image plane, across the height and width dimension
Sourcepub fn area_wc(&self) -> usize
pub fn area_wc(&self) -> usize
The total number of 2D pixels in the image plane, across the width and channel dimension
Sourcepub fn area_hc(&self) -> usize
pub fn area_hc(&self) -> usize
The total number of 2D pixels in the image plane, across the height and channel dimension
Sourcepub fn volume(&self) -> usize
pub fn volume(&self) -> usize
The total number of 3D pixels in the image plane (2D pixels * color depth)
Sourcepub fn min_resolution(&self) -> u16
pub fn min_resolution(&self) -> u16
The smaller of the width and height dimensions
Sourcepub fn max_resolution(&self) -> u16
pub fn max_resolution(&self) -> u16
The larger of the width and height dimensions
Trait Implementations§
impl Copy for PlaneSize
impl StructuralPartialEq for PlaneSize
Auto Trait Implementations§
impl Freeze for PlaneSize
impl RefUnwindSafe for PlaneSize
impl Send for PlaneSize
impl Sync for PlaneSize
impl Unpin for PlaneSize
impl UnwindSafe for PlaneSize
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more