image

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 = 1f32

Source§

const DEFAULT_MIN_VALUE: Self = 0f32

Source§

impl Primitive for f64

Source§

const DEFAULT_MAX_VALUE: Self = 1f64

Source§

const DEFAULT_MIN_VALUE: Self = 0f64

Source§

impl Primitive for i8

Source§

const DEFAULT_MAX_VALUE: Self = 127i8

Source§

const DEFAULT_MIN_VALUE: Self = -128i8

Source§

impl Primitive for i16

Source§

const DEFAULT_MAX_VALUE: Self = 32_767i16

Source§

const DEFAULT_MIN_VALUE: Self = -32_768i16

Source§

impl Primitive for i32

Source§

const DEFAULT_MAX_VALUE: Self = 2_147_483_647i32

Source§

const DEFAULT_MIN_VALUE: Self = -2_147_483_648i32

Source§

impl Primitive for i64

Source§

const DEFAULT_MAX_VALUE: Self = 9_223_372_036_854_775_807i64

Source§

const DEFAULT_MIN_VALUE: Self = -9_223_372_036_854_775_808i64

Source§

impl Primitive for isize

Source§

const DEFAULT_MAX_VALUE: Self = 2_147_483_647isize

Source§

const DEFAULT_MIN_VALUE: Self = -2_147_483_648isize

Source§

impl Primitive for u8

Source§

const DEFAULT_MAX_VALUE: Self = 255u8

Source§

const DEFAULT_MIN_VALUE: Self = 0u8

Source§

impl Primitive for u16

Source§

const DEFAULT_MAX_VALUE: Self = 65_535u16

Source§

const DEFAULT_MIN_VALUE: Self = 0u16

Source§

impl Primitive for u32

Source§

const DEFAULT_MAX_VALUE: Self = 4_294_967_295u32

Source§

const DEFAULT_MIN_VALUE: Self = 0u32

Source§

impl Primitive for u64

Source§

const DEFAULT_MAX_VALUE: Self = 18_446_744_073_709_551_615u64

Source§

const DEFAULT_MIN_VALUE: Self = 0u64

Source§

impl Primitive for usize

Source§

const DEFAULT_MAX_VALUE: Self = 4_294_967_295usize

Source§

const DEFAULT_MIN_VALUE: Self = 0usize

Implementors§