pub enum Norm {
UNorm,
SNorm,
}Expand description
A normalised format’s rule (module docs, Tier C): how unityrs reads a
Mesh’s integer of that format as a float.
Variants§
UNorm
UNorm, and the byte colour formats: v / (2^n - 1), in [0, 1].
SNorm
SNorm: max(v / (2^(n-1) - 1), -1), in [-1, 1].
Implementations§
Source§impl Norm
impl Norm
Sourcepub fn value(self, code: StructCode, raw: i64) -> f64
pub fn value(self, code: StructCode, raw: i64) -> f64
The float an integer raw of code normalises to, by the
Vulkan and Direct3D rule (module docs): for an 8-bit SNorm, -128
and -127 give -1.0, 0 gives 0.0 and 127 gives 1.0; for an 8-bit
UNorm, 255 gives 1.0. Each value is the correctly rounded
quotient of two integers an f64 holds exactly.
Trait Implementations§
impl Copy for Norm
impl Eq for Norm
impl StructuralPartialEq for Norm
Auto Trait Implementations§
impl Forget for Norm
impl Freeze for Norm
impl Move for Norm
impl RefUnwindSafe for Norm
impl Send for Norm
impl Sync for Norm
impl Unpin for Norm
impl UnsafeUnpin for Norm
impl UnwindSafe for Norm
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more