Trait image::color::FromPrimitive

source ·
pub trait FromPrimitive<Component> {
    // Required method
    fn from_primitive(component: Component) -> Self;
}
Expand description

Convert from one pixel component type to another. For example, convert from u8 to f32 pixel values.

Required Methods§

source

fn from_primitive(component: Component) -> Self

Converts from any pixel component type to this type.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl FromPrimitive<f32> for u8

source§

fn from_primitive(float: f32) -> Self

source§

impl FromPrimitive<f32> for u16

source§

fn from_primitive(float: f32) -> Self

source§

impl FromPrimitive<u8> for f32

source§

fn from_primitive(int: u8) -> Self

source§

impl FromPrimitive<u8> for u16

source§

fn from_primitive(c8: u8) -> Self

source§

impl FromPrimitive<u16> for f32

source§

fn from_primitive(int: u16) -> Self

source§

impl FromPrimitive<u16> for u8

source§

fn from_primitive(c16: u16) -> Self

Implementors§