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