Skip to main content

PixelComponent

Trait PixelComponent 

pub trait PixelComponent:
    Copy
    + Send
    + Sync
    + 'static {
    // Required methods
    fn to_f64(self) -> f64;
    fn from_f64(value: f64) -> Self;
}
Expand description

Scalar component supported by generic CPU image kernels.

Required Methods§

fn to_f64(self) -> f64

Converts a scalar into the kernel accumulator representation.

fn from_f64(value: f64) -> Self

Converts a finite accumulator value back into the scalar dtype.

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§

§

impl PixelComponent for f32

§

fn to_f64(self) -> f64

§

fn from_f64(value: f64) -> f32

§

impl PixelComponent for f64

§

fn to_f64(self) -> f64

§

fn from_f64(value: f64) -> f64

§

impl PixelComponent for u8

§

fn to_f64(self) -> f64

§

fn from_f64(value: f64) -> u8

§

impl PixelComponent for u16

§

fn to_f64(self) -> f64

§

fn from_f64(value: f64) -> u16

Implementors§