pub struct U24(/* private fields */);Expand description
24-bit unsigned integer sample type.
Represents 24-bit audio with range 0..=((1 << 24) - 1), with origin at 1 << 23 == 8388608.
Note: While representing 24-bit audio, this format uses 4 bytes (u32) of storage
with the most significant byte unused. Use SampleFormat::bits_per_sample to get
the actual bit depth (24) vs SampleFormat::sample_size for storage size (4 bytes).
Implementations§
Source§impl U24
impl U24
Sourcepub fn new(val: i32) -> Option<U24>
pub fn new(val: i32) -> Option<U24>
Construct a new sample if the given value is within range.
Returns None if val is out of range.
Sourcepub fn new_unchecked(s: i32) -> U24
pub fn new_unchecked(s: i32) -> U24
Constructs a new sample without checking for overflowing.
This should only be used if the user can guarantee the sample will be within range and they require the extra performance.
If this function is used, the sample crate can’t guarantee that the returned sample or any interacting samples will remain within their MIN and MAX bounds.
Trait Implementations§
Source§impl FromSample<I24> for U24
impl FromSample<I24> for U24
fn from_sample_(s: I24) -> U24
Source§impl FromSample<I48> for U24
impl FromSample<I48> for U24
fn from_sample_(s: I48) -> U24
Source§impl FromSample<U24> for I24
impl FromSample<U24> for I24
fn from_sample_(s: U24) -> I24
Source§impl FromSample<U24> for I48
impl FromSample<U24> for I48
fn from_sample_(s: U24) -> I48
Source§impl FromSample<U24> for U48
impl FromSample<U24> for U48
fn from_sample_(s: U24) -> U48
Source§impl FromSample<U24> for f32
impl FromSample<U24> for f32
fn from_sample_(s: U24) -> f32
Source§impl FromSample<U24> for f64
impl FromSample<U24> for f64
fn from_sample_(s: U24) -> f64
Source§impl FromSample<U24> for i16
impl FromSample<U24> for i16
fn from_sample_(s: U24) -> i16
Source§impl FromSample<U24> for i32
impl FromSample<U24> for i32
fn from_sample_(s: U24) -> i32
Source§impl FromSample<U24> for i64
impl FromSample<U24> for i64
fn from_sample_(s: U24) -> i64
Source§impl FromSample<U24> for i8
impl FromSample<U24> for i8
fn from_sample_(s: U24) -> i8
Source§impl FromSample<U24> for u16
impl FromSample<U24> for u16
fn from_sample_(s: U24) -> u16
Source§impl FromSample<U24> for u32
impl FromSample<U24> for u32
fn from_sample_(s: U24) -> u32
Source§impl FromSample<U24> for u64
impl FromSample<U24> for u64
fn from_sample_(s: U24) -> u64
Source§impl FromSample<U24> for u8
impl FromSample<U24> for u8
fn from_sample_(s: U24) -> u8
Source§impl FromSample<U48> for U24
impl FromSample<U48> for U24
fn from_sample_(s: U48) -> U24
Source§impl FromSample<f32> for U24
impl FromSample<f32> for U24
fn from_sample_(s: f32) -> U24
Source§impl FromSample<f64> for U24
impl FromSample<f64> for U24
fn from_sample_(s: f64) -> U24
Source§impl FromSample<i16> for U24
impl FromSample<i16> for U24
fn from_sample_(s: i16) -> U24
Source§impl FromSample<i32> for U24
impl FromSample<i32> for U24
fn from_sample_(s: i32) -> U24
Source§impl FromSample<i64> for U24
impl FromSample<i64> for U24
fn from_sample_(s: i64) -> U24
Source§impl FromSample<i8> for U24
impl FromSample<i8> for U24
fn from_sample_(s: i8) -> U24
Source§impl FromSample<u16> for U24
impl FromSample<u16> for U24
fn from_sample_(s: u16) -> U24
Source§impl FromSample<u32> for U24
impl FromSample<u32> for U24
fn from_sample_(s: u32) -> U24
Source§impl FromSample<u64> for U24
impl FromSample<u64> for U24
fn from_sample_(s: u64) -> U24
Source§impl FromSample<u8> for U24
impl FromSample<u8> for U24
fn from_sample_(s: u8) -> U24
Source§impl Ord for U24
impl Ord for U24
Source§impl PartialOrd for U24
impl PartialOrd for U24
Source§impl Sample for U24
impl Sample for U24
Source§const EQUILIBRIUM: U24 = types::u24::EQUILIBRIUM
const EQUILIBRIUM: U24 = types::u24::EQUILIBRIUM
Sample type represents. This is normally the
value that is equal distance from both the min and max ranges of the sample. Read moreSource§type Signed = i32
type Signed = i32
Addition type represents the format to
which Self should be converted for optimal Addition performance. Read moreSource§type Float = f32
type Float = f32
Multiplication type
represents the format to which Self should be converted for optimal Multiplication
performance. Read moreSource§const IDENTITY: Self::Float = <Self::Float as FloatSample>::IDENTITY
const IDENTITY: Self::Float = <Self::Float as FloatSample>::IDENTITY
Source§fn from_sample<S>(s: S) -> Selfwhere
Self: FromSample<S>,
fn from_sample<S>(s: S) -> Selfwhere
Self: FromSample<S>,
Source§fn to_signed_sample(self) -> Self::Signed
fn to_signed_sample(self) -> Self::Signed
Source§fn to_float_sample(self) -> Self::Float
fn to_float_sample(self) -> Self::Float
Source§impl SizedSample for U24
impl SizedSample for U24
Source§const FORMAT: SampleFormat = SampleFormat::U24
const FORMAT: SampleFormat = SampleFormat::U24
SampleFormat for this sample type.