[go: up one dir, main page]

Cast

Trait Cast 

Source
pub trait Cast {
    type Output;

    // Required methods
    fn cast_rgb_u8(x: [u8; 3]) -> Self::Output;
    fn cast_rgb_u16(x: [u16; 3]) -> Self::Output;
    fn cast_rgb_f32(x: [f32; 3]) -> Self::Output;
    fn cast_rgba_u8(x: [u8; 4]) -> Self::Output;
    fn cast_rgba_u16(x: [u16; 4]) -> Self::Output;
    fn cast_rgba_f32(x: [f32; 4]) -> Self::Output;
}
Available on crate feature utils only.
Expand description

Trait for types which describe casting behaviour.

Required Associated Types§

Source

type Output

Output type.

Required Methods§

Source

fn cast_rgb_u8(x: [u8; 3]) -> Self::Output

Cast from RGB u8.

Source

fn cast_rgb_u16(x: [u16; 3]) -> Self::Output

Cast from RGB u16.

Source

fn cast_rgb_f32(x: [f32; 3]) -> Self::Output

Cast from RGB f32.

Source

fn cast_rgba_u8(x: [u8; 4]) -> Self::Output

Cast from RGBA u8.

Source

fn cast_rgba_u16(x: [u16; 4]) -> Self::Output

Cast from RGBA u16.

Source

fn cast_rgba_f32(x: [f32; 4]) -> Self::Output

Cast from RGBA f32.

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.

Implementors§