#[repr(u32)]pub enum ScalarType {
Float32 = 1,
Float16 = 12,
Unsigned32 = 2,
Signed32 = 3,
Unsigned16 = 4,
Signed16 = 5,
Unsigned8 = 6,
Signed8 = 7,
}Expand description
The scalar type of pixel channel data.
This enum represents the data type of individual channel values as specified by the ndspy format constants.
Variants§
Float32 = 1
32-bit IEEE 754 floating point (f32)
Float16 = 12
16-bit IEEE 754 floating point (f16/half)
Unsigned32 = 2
32-bit unsigned integer (u32)
Signed32 = 3
32-bit signed integer (i32)
Unsigned16 = 4
16-bit unsigned integer (u16)
Signed16 = 5
16-bit signed integer (i16)
Unsigned8 = 6
8-bit unsigned integer (u8)
Signed8 = 7
8-bit signed integer (i8)
Implementations§
Source§impl ScalarType
impl ScalarType
Sourcepub fn from_ndspy_type(type_: u32) -> Option<ScalarType>
pub fn from_ndspy_type(type_: u32) -> Option<ScalarType>
Create a ScalarType from an ndspy type constant. Returns None for unknown type values.
Sourcepub const fn size_bytes(self) -> usize
pub const fn size_bytes(self) -> usize
Returns the size in bytes of this scalar type.
Trait Implementations§
Source§impl Clone for ScalarType
impl Clone for ScalarType
Source§fn clone(&self) -> ScalarType
fn clone(&self) -> ScalarType
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ScalarType
Source§impl Debug for ScalarType
impl Debug for ScalarType
Source§impl Default for ScalarType
impl Default for ScalarType
Source§fn default() -> ScalarType
fn default() -> ScalarType
Returns the “default value” for a type. Read more
impl Eq for ScalarType
Source§impl Hash for ScalarType
impl Hash for ScalarType
Source§impl PartialEq for ScalarType
impl PartialEq for ScalarType
impl StructuralPartialEq for ScalarType
Auto Trait Implementations§
impl Freeze for ScalarType
impl RefUnwindSafe for ScalarType
impl Send for ScalarType
impl Sync for ScalarType
impl Unpin for ScalarType
impl UnsafeUnpin for ScalarType
impl UnwindSafe for ScalarType
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