Skip to main content

ImageDataType

Trait ImageDataType 

Source
pub trait ImageDataType:
    Sealed
    + Pod
    + Copy
    + Default
    + 'static
    + Debug
    + PartialEq
    + Send
    + Sync {
    const DATA_TYPE_ID: DataTypeTag;

    // Required methods
    fn from_f64(f: f64) -> Self;
    fn to_f64(self) -> f64;
}
Expand description

Image data type trait. Implementors must be “bag-of-bits” types with no padding, guaranteed by the bytemuck::Pod bound.

Required Associated Constants§

Source

const DATA_TYPE_ID: DataTypeTag

ID of this data type. Different types must have different values.

Required Methods§

Source

fn from_f64(f: f64) -> Self

Source

fn to_f64(self) -> f64

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl ImageDataType for f32

Source§

const DATA_TYPE_ID: DataTypeTag = DataTypeTag::F32

Source§

fn from_f64(f: f64) -> f32

Source§

fn to_f64(self) -> f64

Source§

impl ImageDataType for f64

Source§

const DATA_TYPE_ID: DataTypeTag = DataTypeTag::F64

Source§

fn from_f64(f: f64) -> f64

Source§

fn to_f64(self) -> f64

Source§

impl ImageDataType for i8

Source§

const DATA_TYPE_ID: DataTypeTag = DataTypeTag::I8

Source§

fn from_f64(f: f64) -> i8

Source§

fn to_f64(self) -> f64

Source§

impl ImageDataType for i16

Source§

const DATA_TYPE_ID: DataTypeTag = DataTypeTag::I16

Source§

fn from_f64(f: f64) -> i16

Source§

fn to_f64(self) -> f64

Source§

impl ImageDataType for i32

Source§

const DATA_TYPE_ID: DataTypeTag = DataTypeTag::I32

Source§

fn from_f64(f: f64) -> i32

Source§

fn to_f64(self) -> f64

Source§

impl ImageDataType for u8

Source§

const DATA_TYPE_ID: DataTypeTag = DataTypeTag::U8

Source§

fn from_f64(f: f64) -> u8

Source§

fn to_f64(self) -> f64

Source§

impl ImageDataType for u16

Source§

const DATA_TYPE_ID: DataTypeTag = DataTypeTag::U16

Source§

fn from_f64(f: f64) -> u16

Source§

fn to_f64(self) -> f64

Source§

impl ImageDataType for u32

Source§

const DATA_TYPE_ID: DataTypeTag = DataTypeTag::U32

Source§

fn from_f64(f: f64) -> u32

Source§

fn to_f64(self) -> f64

Implementors§