Skip to main content

Primitive

Trait Primitive 

Source
pub trait Primitive:
    Copy
    + NumCast
    + Num
    + PartialOrd<Self>
    + Clone
    + Bounded {
    const DEFAULT_MAX_VALUE: Self;
    const DEFAULT_MIN_VALUE: Self;
}
Expand description

The type of each channel in a pixel. For example, this can be u8, u16, f32.

Required Associated Constants§

Source

const DEFAULT_MAX_VALUE: Self

The maximum value for this type of primitive within the context of color. For floats, the maximum is 1.0, whereas the integer types inherit their usual maximum values.

Source

const DEFAULT_MIN_VALUE: Self

The minimum value for this type of primitive within the context of color. For floats, the minimum is 0.0, whereas the integer types inherit their usual minimum values.

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 Primitive for f32

Source§

const DEFAULT_MAX_VALUE: Self = 1.0

Source§

const DEFAULT_MIN_VALUE: Self = 0.0

Source§

impl Primitive for f64

Source§

const DEFAULT_MAX_VALUE: Self = 1.0

Source§

const DEFAULT_MIN_VALUE: Self = 0.0

Source§

impl Primitive for i8

Source§

const DEFAULT_MAX_VALUE: Self = Self::MAX

Source§

const DEFAULT_MIN_VALUE: Self = Self::MIN

Source§

impl Primitive for i16

Source§

const DEFAULT_MAX_VALUE: Self = Self::MAX

Source§

const DEFAULT_MIN_VALUE: Self = Self::MIN

Source§

impl Primitive for i32

Source§

const DEFAULT_MAX_VALUE: Self = Self::MAX

Source§

const DEFAULT_MIN_VALUE: Self = Self::MIN

Source§

impl Primitive for i64

Source§

const DEFAULT_MAX_VALUE: Self = Self::MAX

Source§

const DEFAULT_MIN_VALUE: Self = Self::MIN

Source§

impl Primitive for isize

Source§

const DEFAULT_MAX_VALUE: Self = Self::MAX

Source§

const DEFAULT_MIN_VALUE: Self = Self::MIN

Source§

impl Primitive for u8

Source§

const DEFAULT_MAX_VALUE: Self = Self::MAX

Source§

const DEFAULT_MIN_VALUE: Self = 0

Source§

impl Primitive for u16

Source§

const DEFAULT_MAX_VALUE: Self = Self::MAX

Source§

const DEFAULT_MIN_VALUE: Self = 0

Source§

impl Primitive for u32

Source§

const DEFAULT_MAX_VALUE: Self = Self::MAX

Source§

const DEFAULT_MIN_VALUE: Self = 0

Source§

impl Primitive for u64

Source§

const DEFAULT_MAX_VALUE: Self = Self::MAX

Source§

const DEFAULT_MIN_VALUE: Self = 0

Source§

impl Primitive for usize

Source§

const DEFAULT_MAX_VALUE: Self = Self::MAX

Source§

const DEFAULT_MIN_VALUE: Self = 0

Implementors§