pub struct SampleEncoding { /* private fields */ }Expand description
Storage word, significant code bits and their placement within the word.
Compatibility encoding from the existing unpublished media API. It mirrors
zenpixels::sample::SampleEncoding; removing this duplicate requires the
coordinated media migration to that type and its published dependency floor.
A 10-bit sample in a
16-bit word is new(U16, 10, 0) (LSB-aligned) or new(U16, 10, 6)
(MSB-aligned); it is never relabelled as a full-range 16-bit value.
Implementations§
Source§impl SampleEncoding
impl SampleEncoding
Sourcepub const U8: SampleEncoding
pub const U8: SampleEncoding
Eight-bit codes in 8-bit words.
Sourcepub const fn new(
storage: ChannelType,
code_bits: u8,
bit_shift: u8,
) -> Result<SampleEncoding, SampleEncodingError>
pub const fn new( storage: ChannelType, code_bits: u8, bit_shift: u8, ) -> Result<SampleEncoding, SampleEncodingError>
code_bits significant bits, shifted left by bit_shift, in a
storage word.
§Errors
A SampleEncodingError for an unsupported word or a code that does
not fit.
Sourcepub const fn bytes_per_sample(self) -> usize
pub const fn bytes_per_sample(self) -> usize
Bytes per stored sample.
Trait Implementations§
Source§impl Clone for SampleEncoding
impl Clone for SampleEncoding
Source§fn clone(&self) -> SampleEncoding
fn clone(&self) -> SampleEncoding
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for SampleEncoding
Source§impl Debug for SampleEncoding
impl Debug for SampleEncoding
impl Eq for SampleEncoding
Source§impl Hash for SampleEncoding
impl Hash for SampleEncoding
Source§impl PartialEq for SampleEncoding
impl PartialEq for SampleEncoding
impl StructuralPartialEq for SampleEncoding
Auto Trait Implementations§
impl Freeze for SampleEncoding
impl RefUnwindSafe for SampleEncoding
impl Send for SampleEncoding
impl Sync for SampleEncoding
impl Unpin for SampleEncoding
impl UnsafeUnpin for SampleEncoding
impl UnwindSafe for SampleEncoding
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