Skip to main content

Trait tauri::Pixel

pub trait Pixel: Copy + Into<f64> {
    fn from_f64(f: f64) -> Self;

    fn cast<P>(self) -> P
    where
        P: Pixel,
    { ... }
}

Expand description

A pixel definition. Must be created from a f64 value.

Required methods#

fn from_f64(f: f64) -> Self#

Creates the pixel from the f64 value.

Provided methods#

fn cast<P>(self) -> P where P: Pixel,#

Casts a pixel.

Implementations on Foreign Types#

impl Pixel for i16#

pub fn from_f64(f: f64) -> i16#

impl Pixel for u16#

pub fn from_f64(f: f64) -> u16#

impl Pixel for f32#

pub fn from_f64(f: f64) -> f32#

impl Pixel for u32#

pub fn from_f64(f: f64) -> u32#

impl Pixel for u8#

pub fn from_f64(f: f64) -> u8#

impl Pixel for f64#

pub fn from_f64(f: f64) -> f64#

impl Pixel for i8#

pub fn from_f64(f: f64) -> i8#

impl Pixel for i32#

pub fn from_f64(f: f64) -> i32#

Implementors#