Struct symphonia_core::sample::u24

source ·
pub struct u24(pub u32);
Expand description

An unsigned 24-bit integer sample with an internal unsigned 32-bit integer representation.

There are no guarantees the sample is within the valid range 24-bit range. Use the Sample::clamped function to clamp the sample to the valid range.

Tuple Fields§

§0: u32

Implementations§

source§

impl u24

source

pub const MAX: u24 = _

The largest value that can be represented by this integer type.

source

pub const MIN: u24 = _

The smallest value that can be represented by this integer type.

source

pub fn into_u32(self) -> u32

👎Deprecated: Superseded by inner.

Get the underlying u32 backing this u24.

source

pub fn inner(self) -> u32

Get the underlying u32 backing this u24.

source

pub fn to_ne_bytes(self) -> [u8; 3]

Return the memory representation of this u24 as a byte array in native byte order.

Trait Implementations§

source§

impl Add for u24

§

type Output = u24

The resulting type after applying the + operator.
source§

fn add(self, other: Self) -> Self

Performs the + operation. Read more
source§

impl AddNoise<u24> for RandomNoise

source§

fn add_noise(self, s: u24) -> u24

source§

impl BitAnd for u24

§

type Output = u24

The resulting type after applying the & operator.
source§

fn bitand(self, other: Self) -> Self

Performs the & operation. Read more
source§

impl BitOr for u24

§

type Output = u24

The resulting type after applying the | operator.
source§

fn bitor(self, other: Self) -> Self

Performs the | operation. Read more
source§

impl BitXor for u24

§

type Output = u24

The resulting type after applying the ^ operator.
source§

fn bitxor(self, other: Self) -> Self

Performs the ^ operation. Read more
source§

impl Clone for u24

source§

fn clone(&self) -> u24

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for u24

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for u24

source§

fn default() -> u24

Returns the “default value” for a type. Read more
source§

impl Display for u24

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Div for u24

§

type Output = u24

The resulting type after applying the / operator.
source§

fn div(self, other: Self) -> Self

Performs the / operation. Read more
source§

impl From<u16> for u24

source§

fn from(val: u16) -> Self

Converts to this type from the input type.
source§

impl From<u32> for u24

source§

fn from(val: u32) -> Self

Converts to this type from the input type.
source§

impl From<u8> for u24

source§

fn from(val: u8) -> Self

Converts to this type from the input type.
source§

impl FromSample<f32> for u24

source§

fn from_sample(s: f32) -> Self

source§

impl FromSample<f64> for u24

source§

fn from_sample(s: f64) -> Self

source§

impl FromSample<i16> for u24

source§

fn from_sample(s: i16) -> Self

source§

impl FromSample<i24> for u24

source§

fn from_sample(s: i24) -> Self

source§

impl FromSample<i32> for u24

source§

fn from_sample(s: i32) -> Self

source§

impl FromSample<i8> for u24

source§

fn from_sample(s: i8) -> Self

source§

impl FromSample<u16> for u24

source§

fn from_sample(s: u16) -> Self

source§

impl FromSample<u24> for f32

source§

fn from_sample(s: u24) -> Self

source§

impl FromSample<u24> for f64

source§

fn from_sample(s: u24) -> Self

source§

impl FromSample<u24> for i16

source§

fn from_sample(s: u24) -> Self

source§

impl FromSample<u24> for i24

source§

fn from_sample(s: u24) -> Self

source§

impl FromSample<u24> for i32

source§

fn from_sample(s: u24) -> Self

source§

impl FromSample<u24> for i8

source§

fn from_sample(s: u24) -> Self

source§

impl FromSample<u24> for u16

source§

fn from_sample(s: u24) -> Self

source§

impl FromSample<u24> for u24

source§

fn from_sample(s: u24) -> Self

source§

impl FromSample<u24> for u32

source§

fn from_sample(s: u24) -> Self

source§

impl FromSample<u24> for u8

source§

fn from_sample(s: u24) -> Self

source§

impl FromSample<u32> for u24

source§

fn from_sample(s: u32) -> Self

source§

impl FromSample<u8> for u24

source§

fn from_sample(s: u8) -> Self

source§

impl MaybeDither<f32> for u24

source§

const DITHERABLE: bool = false

source§

fn maybe_dither<D: Dither<u24, f32>>(self, _: &mut D) -> Self

source§

impl MaybeDither<f64> for u24

source§

const DITHERABLE: bool = false

source§

fn maybe_dither<D: Dither<u24, f64>>(self, _: &mut D) -> Self

source§

impl MaybeDither<i16> for u24

source§

const DITHERABLE: bool = true

source§

fn maybe_dither<D: Dither<u24, i16>>(self, dither: &mut D) -> Self

source§

impl MaybeDither<i24> for u24

source§

const DITHERABLE: bool = false

source§

fn maybe_dither<D: Dither<u24, i24>>(self, _: &mut D) -> Self

source§

impl MaybeDither<i32> for u24

source§

const DITHERABLE: bool = false

source§

fn maybe_dither<D: Dither<u24, i32>>(self, _: &mut D) -> Self

source§

impl MaybeDither<i8> for u24

source§

const DITHERABLE: bool = true

source§

fn maybe_dither<D: Dither<u24, i8>>(self, dither: &mut D) -> Self

source§

impl MaybeDither<u16> for u24

source§

const DITHERABLE: bool = true

source§

fn maybe_dither<D: Dither<u24, u16>>(self, dither: &mut D) -> Self

source§

impl MaybeDither<u24> for f32

source§

const DITHERABLE: bool = false

source§

fn maybe_dither<D: Dither<f32, u24>>(self, _: &mut D) -> Self

source§

impl MaybeDither<u24> for f64

source§

const DITHERABLE: bool = false

source§

fn maybe_dither<D: Dither<f64, u24>>(self, _: &mut D) -> Self

source§

impl MaybeDither<u24> for i16

source§

const DITHERABLE: bool = false

source§

fn maybe_dither<D: Dither<i16, u24>>(self, _: &mut D) -> Self

source§

impl MaybeDither<u24> for i24

source§

const DITHERABLE: bool = false

source§

fn maybe_dither<D: Dither<i24, u24>>(self, _: &mut D) -> Self

source§

impl MaybeDither<u24> for i32

source§

const DITHERABLE: bool = true

source§

fn maybe_dither<D: Dither<i32, u24>>(self, dither: &mut D) -> Self

source§

impl MaybeDither<u24> for i8

source§

const DITHERABLE: bool = false

source§

fn maybe_dither<D: Dither<i8, u24>>(self, _: &mut D) -> Self

source§

impl MaybeDither<u24> for u16

source§

const DITHERABLE: bool = false

source§

fn maybe_dither<D: Dither<u16, u24>>(self, _: &mut D) -> Self

source§

impl MaybeDither<u24> for u24

source§

const DITHERABLE: bool = false

source§

fn maybe_dither<D: Dither<u24, u24>>(self, _: &mut D) -> Self

source§

impl MaybeDither<u24> for u32

source§

const DITHERABLE: bool = true

source§

fn maybe_dither<D: Dither<u32, u24>>(self, dither: &mut D) -> Self

source§

impl MaybeDither<u24> for u8

source§

const DITHERABLE: bool = false

source§

fn maybe_dither<D: Dither<u8, u24>>(self, _: &mut D) -> Self

source§

impl MaybeDither<u32> for u24

source§

const DITHERABLE: bool = false

source§

fn maybe_dither<D: Dither<u24, u32>>(self, _: &mut D) -> Self

source§

impl MaybeDither<u8> for u24

source§

const DITHERABLE: bool = true

source§

fn maybe_dither<D: Dither<u24, u8>>(self, dither: &mut D) -> Self

source§

impl Mul for u24

§

type Output = u24

The resulting type after applying the * operator.
source§

fn mul(self, other: Self) -> Self

Performs the * operation. Read more
source§

impl Not for u24

§

type Output = u24

The resulting type after applying the ! operator.
source§

fn not(self) -> Self

Performs the unary ! operation. Read more
source§

impl Ord for u24

source§

fn cmp(&self, other: &u24) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for u24

source§

fn eq(&self, other: &u24) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for u24

source§

fn partial_cmp(&self, other: &u24) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl RawSample for u24

§

type RawType = [u8; 3]

The RawType is a primitive data type, or fixed-size byte array, that is the final binary representation of the sample when written out to a byte-buffer.
source§

fn into_raw_sample(self) -> Self::RawType

source§

impl Rem for u24

§

type Output = u24

The resulting type after applying the % operator.
source§

fn rem(self, other: Self) -> Self

Performs the % operation. Read more
source§

impl Sample for u24

source§

const FORMAT: SampleFormat = SampleFormat::U24

A unique enum value representing the sample format. This constant may be used to dynamically choose how to process the sample at runtime.
source§

const EFF_BITS: u32 = 24u32

The effective number of bits of the valid (clamped) sample range. Quantifies the dynamic range of the sample format in bits.
source§

const MID: u24 = _

The mid-point value between the maximum and minimum sample value. If a sample is set to this value it is silent.
source§

fn clamped(self) -> Self

If the sample format does not use the full range of the underlying data type, returns the sample clamped to the valid range. Otherwise, returns the sample unchanged.
source§

impl Shl<i128> for u24

§

type Output = u24

The resulting type after applying the << operator.
source§

fn shl(self, other: i128) -> u24

Performs the << operation. Read more
source§

impl Shl<i16> for u24

§

type Output = u24

The resulting type after applying the << operator.
source§

fn shl(self, other: i16) -> u24

Performs the << operation. Read more
source§

impl Shl<i32> for u24

§

type Output = u24

The resulting type after applying the << operator.
source§

fn shl(self, other: i32) -> u24

Performs the << operation. Read more
source§

impl Shl<i64> for u24

§

type Output = u24

The resulting type after applying the << operator.
source§

fn shl(self, other: i64) -> u24

Performs the << operation. Read more
source§

impl Shl<i8> for u24

§

type Output = u24

The resulting type after applying the << operator.
source§

fn shl(self, other: i8) -> u24

Performs the << operation. Read more
source§

impl Shl<isize> for u24

§

type Output = u24

The resulting type after applying the << operator.
source§

fn shl(self, other: isize) -> u24

Performs the << operation. Read more
source§

impl Shl<u128> for u24

§

type Output = u24

The resulting type after applying the << operator.
source§

fn shl(self, other: u128) -> u24

Performs the << operation. Read more
source§

impl Shl<u16> for u24

§

type Output = u24

The resulting type after applying the << operator.
source§

fn shl(self, other: u16) -> u24

Performs the << operation. Read more
source§

impl Shl<u32> for u24

§

type Output = u24

The resulting type after applying the << operator.
source§

fn shl(self, other: u32) -> u24

Performs the << operation. Read more
source§

impl Shl<u64> for u24

§

type Output = u24

The resulting type after applying the << operator.
source§

fn shl(self, other: u64) -> u24

Performs the << operation. Read more
source§

impl Shl<u8> for u24

§

type Output = u24

The resulting type after applying the << operator.
source§

fn shl(self, other: u8) -> u24

Performs the << operation. Read more
source§

impl Shl<usize> for u24

§

type Output = u24

The resulting type after applying the << operator.
source§

fn shl(self, other: usize) -> u24

Performs the << operation. Read more
source§

impl Shl for u24

§

type Output = u24

The resulting type after applying the << operator.
source§

fn shl(self, other: Self) -> Self

Performs the << operation. Read more
source§

impl Shr<i128> for u24

§

type Output = u24

The resulting type after applying the >> operator.
source§

fn shr(self, other: i128) -> u24

Performs the >> operation. Read more
source§

impl Shr<i16> for u24

§

type Output = u24

The resulting type after applying the >> operator.
source§

fn shr(self, other: i16) -> u24

Performs the >> operation. Read more
source§

impl Shr<i32> for u24

§

type Output = u24

The resulting type after applying the >> operator.
source§

fn shr(self, other: i32) -> u24

Performs the >> operation. Read more
source§

impl Shr<i64> for u24

§

type Output = u24

The resulting type after applying the >> operator.
source§

fn shr(self, other: i64) -> u24

Performs the >> operation. Read more
source§

impl Shr<i8> for u24

§

type Output = u24

The resulting type after applying the >> operator.
source§

fn shr(self, other: i8) -> u24

Performs the >> operation. Read more
source§

impl Shr<isize> for u24

§

type Output = u24

The resulting type after applying the >> operator.
source§

fn shr(self, other: isize) -> u24

Performs the >> operation. Read more
source§

impl Shr<u128> for u24

§

type Output = u24

The resulting type after applying the >> operator.
source§

fn shr(self, other: u128) -> u24

Performs the >> operation. Read more
source§

impl Shr<u16> for u24

§

type Output = u24

The resulting type after applying the >> operator.
source§

fn shr(self, other: u16) -> u24

Performs the >> operation. Read more
source§

impl Shr<u32> for u24

§

type Output = u24

The resulting type after applying the >> operator.
source§

fn shr(self, other: u32) -> u24

Performs the >> operation. Read more
source§

impl Shr<u64> for u24

§

type Output = u24

The resulting type after applying the >> operator.
source§

fn shr(self, other: u64) -> u24

Performs the >> operation. Read more
source§

impl Shr<u8> for u24

§

type Output = u24

The resulting type after applying the >> operator.
source§

fn shr(self, other: u8) -> u24

Performs the >> operation. Read more
source§

impl Shr<usize> for u24

§

type Output = u24

The resulting type after applying the >> operator.
source§

fn shr(self, other: usize) -> u24

Performs the >> operation. Read more
source§

impl Shr for u24

§

type Output = u24

The resulting type after applying the >> operator.
source§

fn shr(self, other: Self) -> Self

Performs the >> operation. Read more
source§

impl Sub for u24

§

type Output = u24

The resulting type after applying the - operator.
source§

fn sub(self, other: Self) -> Self

Performs the - operation. Read more
source§

impl Copy for u24

source§

impl Eq for u24

source§

impl StructuralPartialEq for u24

Auto Trait Implementations§

§

impl RefUnwindSafe for u24

§

impl Send for u24

§

impl Sync for u24

§

impl Unpin for u24

§

impl UnwindSafe for u24

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<F, T> IntoSample<T> for F
where T: FromSample<F>,

source§

fn into_sample(self) -> T

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<S> ConvertibleSample for S

source§

impl<S, T> ReversibleSample<S> for T
where T: Sample + FromSample<S> + IntoSample<S>,