pub struct RowGeometry {
pub rows: usize,
pub stride: usize,
pub row_bytes: usize,
pub samples: usize,
}Expand description
Geometry of a row-structured payload, used to work out how many bytes are needed and how many samples a truncated range still holds.
Fields§
§rows: usizeRows in the unit.
stride: usizeBytes from one row start to the next.
row_bytes: usizeBytes holding a row’s samples (<= stride; the rest of the stride is padding).
samples: usizeSamples per row.
Implementations§
Source§impl RowGeometry
impl RowGeometry
Sourcepub fn packed(rows: usize, samples: usize, bits: u32, stride: usize) -> Self
pub fn packed(rows: usize, samples: usize, bits: u32, stride: usize) -> Self
Rows of samples values packed at bits per sample, stride bytes apart.
Sourcepub fn needed(&self) -> usize
pub fn needed(&self) -> usize
Bytes needed for every sample: the last row needs no padding. Saturates.
Sourcepub fn complete_rows(&self, avail: usize) -> usize
pub fn complete_rows(&self, avail: usize) -> usize
Rows whose samples lie entirely within the first avail bytes.
Sourcepub fn complete_samples(&self, avail: usize) -> u64
pub fn complete_samples(&self, avail: usize) -> u64
Samples entirely within the first avail bytes (complete rows plus the
complete samples of a partial row).
Sourcepub fn missing_samples(&self, avail: usize) -> u64
pub fn missing_samples(&self, avail: usize) -> u64
Samples not covered by the first avail bytes.
Trait Implementations§
Source§impl Clone for RowGeometry
impl Clone for RowGeometry
impl Copy for RowGeometry
Source§impl Debug for RowGeometry
impl Debug for RowGeometry
impl Eq for RowGeometry
Source§impl PartialEq for RowGeometry
impl PartialEq for RowGeometry
impl StructuralPartialEq for RowGeometry
Auto Trait Implementations§
impl Freeze for RowGeometry
impl RefUnwindSafe for RowGeometry
impl Send for RowGeometry
impl Sync for RowGeometry
impl Unpin for RowGeometry
impl UnsafeUnpin for RowGeometry
impl UnwindSafe for RowGeometry
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more