pub struct Geometry {
pub width: u32,
pub height: u32,
pub format: PixelFormat,
}Expand description
Width, height and pixel format.
Fields§
§width: u32Pixels per row.
height: u32Rows.
format: PixelFormatPixel layout.
Implementations§
Source§impl Geometry
impl Geometry
Sourcepub const fn new(
width: u32,
height: u32,
format: PixelFormat,
) -> Result<Geometry, Error>
pub const fn new( width: u32, height: u32, format: PixelFormat, ) -> Result<Geometry, Error>
Build a geometry, rejecting a zero dimension or an odd size where the format needs even dimensions (4:2:2 needs even width, 4:2:0 even both).
Sourcepub const fn byte_len(&self) -> Option<usize>
pub const fn byte_len(&self) -> Option<usize>
Byte length of a tightly packed frame in this geometry, or None for a
compressed format. Overflow yields None too.
Sourcepub const fn packed_stride(&self) -> Option<usize>
pub const fn packed_stride(&self) -> Option<usize>
Bytes per row of a tightly packed (non-planar) frame.
Trait Implementations§
impl Copy for Geometry
impl Eq for Geometry
impl StructuralPartialEq for Geometry
Auto Trait Implementations§
impl Freeze for Geometry
impl RefUnwindSafe for Geometry
impl Send for Geometry
impl Sync for Geometry
impl Unpin for Geometry
impl UnsafeUnpin for Geometry
impl UnwindSafe for Geometry
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