pub struct Unorm(_);
Expand description
Unsigned normalized float in the range from 0 <= x <= 1 represented as an unsigend 32 Bit integer.
Implementations§
source§impl Unorm
impl Unorm
sourcepub fn from_u32_repr(repr: u32) -> Unorm
pub fn from_u32_repr(repr: u32) -> Unorm
Creates an Unorm from an u32. The returned type is binary identical to the passed u32, but
the new value is interpreted to be repr / (2^32 - 1)
.
sourcepub fn from_denominator(denom: u32) -> Unorm
pub fn from_denominator(denom: u32) -> Unorm
Creates an Unorm interpreted to be 1 / denom
.
sourcepub fn from_rational(nominator: u32, denom: u32) -> Unorm
pub fn from_rational(nominator: u32, denom: u32) -> Unorm
Creates an Unorm from nominator and denominator.
Trait Implementations§
source§impl<'a> AddAssign<&'a Unorm> for Unorm
impl<'a> AddAssign<&'a Unorm> for Unorm
source§fn add_assign(&mut self, other: &'a Unorm)
fn add_assign(&mut self, other: &'a Unorm)
Performs the
+=
operation. Read moresource§impl AddAssign<Unorm> for Unorm
impl AddAssign<Unorm> for Unorm
source§fn add_assign(&mut self, other: Unorm)
fn add_assign(&mut self, other: Unorm)
Performs the
+=
operation. Read moresource§impl<'a> MulAssign<&'a Unorm> for Unorm
impl<'a> MulAssign<&'a Unorm> for Unorm
source§fn mul_assign(&mut self, other: &'a Unorm)
fn mul_assign(&mut self, other: &'a Unorm)
Performs the
*=
operation. Read moresource§impl MulAssign<Unorm> for Unorm
impl MulAssign<Unorm> for Unorm
source§fn mul_assign(&mut self, other: Unorm)
fn mul_assign(&mut self, other: Unorm)
Performs the
*=
operation. Read moresource§impl Ord for Unorm
impl Ord for Unorm
source§impl PartialOrd<Unorm> for Unorm
impl PartialOrd<Unorm> for Unorm
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
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 moresource§impl<'a> SubAssign<&'a Unorm> for Unorm
impl<'a> SubAssign<&'a Unorm> for Unorm
source§fn sub_assign(&mut self, other: &'a Unorm)
fn sub_assign(&mut self, other: &'a Unorm)
Performs the
-=
operation. Read moresource§impl SubAssign<Unorm> for Unorm
impl SubAssign<Unorm> for Unorm
source§fn sub_assign(&mut self, other: Unorm)
fn sub_assign(&mut self, other: Unorm)
Performs the
-=
operation. Read more