Struct sample::types::u24::U24 [−][src]
pub struct U24(_);
Methods
impl U24
[src]
impl U24
pub fn new(val: i32) -> Option<Self>
[src]
pub fn new(val: i32) -> Option<Self>
Construct a new sample if the given value is within range.
Returns None
if val
is out of range.
pub fn new_unchecked(s: i32) -> Self
[src]
pub fn new_unchecked(s: i32) -> Self
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.
pub fn inner(self) -> i32
[src]
pub fn inner(self) -> i32
Return the internal value used to represent the sample type.
Trait Implementations
impl FromSample<U24> for i8
[src]
impl FromSample<U24> for i8
fn from_sample_(s: U24) -> Self
[src]
fn from_sample_(s: U24) -> Self
impl FromSample<U24> for i16
[src]
impl FromSample<U24> for i16
fn from_sample_(s: U24) -> Self
[src]
fn from_sample_(s: U24) -> Self
impl FromSample<U24> for I24
[src]
impl FromSample<U24> for I24
fn from_sample_(s: U24) -> Self
[src]
fn from_sample_(s: U24) -> Self
impl FromSample<U24> for i32
[src]
impl FromSample<U24> for i32
fn from_sample_(s: U24) -> Self
[src]
fn from_sample_(s: U24) -> Self
impl FromSample<U24> for I48
[src]
impl FromSample<U24> for I48
fn from_sample_(s: U24) -> Self
[src]
fn from_sample_(s: U24) -> Self
impl FromSample<U24> for i64
[src]
impl FromSample<U24> for i64
fn from_sample_(s: U24) -> Self
[src]
fn from_sample_(s: U24) -> Self
impl FromSample<U24> for u8
[src]
impl FromSample<U24> for u8
fn from_sample_(s: U24) -> Self
[src]
fn from_sample_(s: U24) -> Self
impl FromSample<U24> for u16
[src]
impl FromSample<U24> for u16
fn from_sample_(s: U24) -> Self
[src]
fn from_sample_(s: U24) -> Self
impl FromSample<i8> for U24
[src]
impl FromSample<i8> for U24
fn from_sample_(s: i8) -> Self
[src]
fn from_sample_(s: i8) -> Self
impl FromSample<i16> for U24
[src]
impl FromSample<i16> for U24
fn from_sample_(s: i16) -> Self
[src]
fn from_sample_(s: i16) -> Self
impl FromSample<I24> for U24
[src]
impl FromSample<I24> for U24
fn from_sample_(s: I24) -> Self
[src]
fn from_sample_(s: I24) -> Self
impl FromSample<i32> for U24
[src]
impl FromSample<i32> for U24
fn from_sample_(s: i32) -> Self
[src]
fn from_sample_(s: i32) -> Self
impl FromSample<I48> for U24
[src]
impl FromSample<I48> for U24
fn from_sample_(s: I48) -> Self
[src]
fn from_sample_(s: I48) -> Self
impl FromSample<i64> for U24
[src]
impl FromSample<i64> for U24
fn from_sample_(s: i64) -> Self
[src]
fn from_sample_(s: i64) -> Self
impl FromSample<u8> for U24
[src]
impl FromSample<u8> for U24
fn from_sample_(s: u8) -> Self
[src]
fn from_sample_(s: u8) -> Self
impl FromSample<u16> for U24
[src]
impl FromSample<u16> for U24
fn from_sample_(s: u16) -> Self
[src]
fn from_sample_(s: u16) -> Self
impl FromSample<u32> for U24
[src]
impl FromSample<u32> for U24
fn from_sample_(s: u32) -> Self
[src]
fn from_sample_(s: u32) -> Self
impl FromSample<U48> for U24
[src]
impl FromSample<U48> for U24
fn from_sample_(s: U48) -> Self
[src]
fn from_sample_(s: U48) -> Self
impl FromSample<u64> for U24
[src]
impl FromSample<u64> for U24
fn from_sample_(s: u64) -> Self
[src]
fn from_sample_(s: u64) -> Self
impl FromSample<f32> for U24
[src]
impl FromSample<f32> for U24
fn from_sample_(s: f32) -> Self
[src]
fn from_sample_(s: f32) -> Self
impl FromSample<f64> for U24
[src]
impl FromSample<f64> for U24
fn from_sample_(s: f64) -> Self
[src]
fn from_sample_(s: f64) -> Self
impl FromSample<U24> for u32
[src]
impl FromSample<U24> for u32
fn from_sample_(s: U24) -> Self
[src]
fn from_sample_(s: U24) -> Self
impl FromSample<U24> for U48
[src]
impl FromSample<U24> for U48
fn from_sample_(s: U24) -> Self
[src]
fn from_sample_(s: U24) -> Self
impl FromSample<U24> for u64
[src]
impl FromSample<U24> for u64
fn from_sample_(s: U24) -> Self
[src]
fn from_sample_(s: U24) -> Self
impl FromSample<U24> for f32
[src]
impl FromSample<U24> for f32
fn from_sample_(s: U24) -> Self
[src]
fn from_sample_(s: U24) -> Self
impl FromSample<U24> for f64
[src]
impl FromSample<U24> for f64
fn from_sample_(s: U24) -> Self
[src]
fn from_sample_(s: U24) -> Self
impl Copy for U24
[src]
impl Copy for U24
impl Clone for U24
[src]
impl Clone for U24
fn clone(&self) -> U24
[src]
fn clone(&self) -> U24
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Debug for U24
[src]
impl Debug for U24
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl PartialEq for U24
[src]
impl PartialEq for U24
fn eq(&self, other: &U24) -> bool
[src]
fn eq(&self, other: &U24) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &U24) -> bool
[src]
fn ne(&self, other: &U24) -> bool
This method tests for !=
.
impl Eq for U24
[src]
impl Eq for U24
impl PartialOrd for U24
[src]
impl PartialOrd for U24
fn partial_cmp(&self, other: &U24) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &U24) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &U24) -> bool
[src]
fn lt(&self, other: &U24) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &U24) -> bool
[src]
fn le(&self, other: &U24) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &U24) -> bool
[src]
fn gt(&self, other: &U24) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &U24) -> bool
[src]
fn ge(&self, other: &U24) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Ord for U24
[src]
impl Ord for U24
fn cmp(&self, other: &U24) -> Ordering
[src]
fn cmp(&self, other: &U24) -> Ordering
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.21.0[src]
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
impl Default for U24
[src]
impl Default for U24
impl From<i32> for U24
[src]
impl From<i32> for U24
impl Add<U24> for U24
[src]
impl Add<U24> for U24
type Output = U24
The resulting type after applying the +
operator.
fn add(self, other: Self) -> Self
[src]
fn add(self, other: Self) -> Self
Performs the +
operation.
impl Sub<U24> for U24
[src]
impl Sub<U24> for U24
type Output = U24
The resulting type after applying the -
operator.
fn sub(self, other: Self) -> Self
[src]
fn sub(self, other: Self) -> Self
Performs the -
operation.
impl Mul<U24> for U24
[src]
impl Mul<U24> for U24
type Output = U24
The resulting type after applying the *
operator.
fn mul(self, other: Self) -> Self
[src]
fn mul(self, other: Self) -> Self
Performs the *
operation.
impl Div<U24> for U24
[src]
impl Div<U24> for U24
type Output = U24
The resulting type after applying the /
operator.
fn div(self, other: Self) -> Self
[src]
fn div(self, other: Self) -> Self
Performs the /
operation.
impl Not for U24
[src]
impl Not for U24
type Output = U24
The resulting type after applying the !
operator.
fn not(self) -> U24
[src]
fn not(self) -> U24
Performs the unary !
operation.
impl Rem<U24> for U24
[src]
impl Rem<U24> for U24
type Output = U24
The resulting type after applying the %
operator.
fn rem(self, other: Self) -> Self
[src]
fn rem(self, other: Self) -> Self
Performs the %
operation.
impl Shl<U24> for U24
[src]
impl Shl<U24> for U24
type Output = U24
The resulting type after applying the <<
operator.
fn shl(self, other: Self) -> Self
[src]
fn shl(self, other: Self) -> Self
Performs the <<
operation.
impl Shr<U24> for U24
[src]
impl Shr<U24> for U24
type Output = U24
The resulting type after applying the >>
operator.
fn shr(self, other: Self) -> Self
[src]
fn shr(self, other: Self) -> Self
Performs the >>
operation.
impl BitAnd<U24> for U24
[src]
impl BitAnd<U24> for U24
type Output = U24
The resulting type after applying the &
operator.
fn bitand(self, other: Self) -> Self
[src]
fn bitand(self, other: Self) -> Self
Performs the &
operation.
impl BitOr<U24> for U24
[src]
impl BitOr<U24> for U24
type Output = U24
The resulting type after applying the |
operator.
fn bitor(self, other: Self) -> Self
[src]
fn bitor(self, other: Self) -> Self
Performs the |
operation.
impl BitXor<U24> for U24
[src]
impl BitXor<U24> for U24
type Output = U24
The resulting type after applying the ^
operator.
fn bitxor(self, other: Self) -> Self
[src]
fn bitxor(self, other: Self) -> Self
Performs the ^
operation.
impl From<u8> for U24
[src]
impl From<u8> for U24
impl From<u16> for U24
[src]
impl From<u16> for U24
impl From<U20> for U24
[src]
impl From<U20> for U24
impl From<U24> for I48
[src]
impl From<U24> for I48
impl From<U24> for U48
[src]
impl From<U24> for U48
impl Sample for U24
[src]
impl Sample for U24
type Signed = i32
When summing two samples of a signal together, it is necessary for both samples to be represented in some signed format. This associated Addition
type represents the format to which Self
should be converted for optimal Addition
performance. Read more
type Float = f32
When multiplying two samples of a signal together, it is necessary for both samples to be represented in some signed, floating-point format. This associated Multiplication
type represents the format to which Self
should be converted for optimal Multiplication
performance. Read more
fn equilibrium() -> Self
[src]
fn equilibrium() -> Self
The equilibrium value for the wave that this Sample
type represents. This is normally the value that is equal distance from both the min and max ranges of the sample. Read more
fn identity() -> Self::Float
[src]
fn identity() -> Self::Float
The multiplicative identity of the signal. Read more
fn to_sample<S>(self) -> S where
Self: ToSample<S>,
[src]
fn to_sample<S>(self) -> S where
Self: ToSample<S>,
Convert self
to any type that implements FromSample<Self>
. Read more
fn from_sample<S>(s: S) -> Self where
Self: FromSample<S>,
[src]
fn from_sample<S>(s: S) -> Self where
Self: FromSample<S>,
Create a Self
from any type that implements ToSample<Self>
. Read more
fn to_signed_sample(self) -> Self::Signed
[src]
fn to_signed_sample(self) -> Self::Signed
Converts self
to the equivalent Sample
in the associated Signed
format. Read more
fn to_float_sample(self) -> Self::Float
[src]
fn to_float_sample(self) -> Self::Float
Converts self
to the equivalent Sample
in the associated Float
format. Read more
fn add_amp(self, amp: Self::Signed) -> Self
[src]
fn add_amp(self, amp: Self::Signed) -> Self
Adds (or "offsets") the amplitude of the Sample
by the given signed amplitude. Read more
fn mul_amp(self, amp: Self::Float) -> Self
[src]
fn mul_amp(self, amp: Self::Float) -> Self
Multiplies (or "scales") the amplitude of the Sample
by the given float amplitude. Read more