imageproc::definitions

Trait Clamp

Source
pub trait Clamp<T> {
    // Required method
    fn clamp(x: T) -> Self;
}
Expand description

A type to which we can clamp a value of type T. Implementations are not required to handle NaNs gracefully.

Required Methods§

Source

fn clamp(x: T) -> Self

Clamp x to a valid value for this type.

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 Clamp<f32> for f32

Source§

impl Clamp<f32> for u8

Source§

fn clamp(x: f32) -> u8

Source§

impl Clamp<f32> for u16

Source§

impl Clamp<f64> for f64

Source§

impl Clamp<f64> for u8

Source§

fn clamp(x: f64) -> u8

Source§

impl Clamp<f64> for u16

Source§

impl Clamp<i8> for i8

Source§

fn clamp(x: i8) -> i8

Source§

impl Clamp<i16> for i16

Source§

impl Clamp<i16> for u8

Source§

fn clamp(x: i16) -> u8

Source§

impl Clamp<i32> for i16

Source§

impl Clamp<i32> for i32

Source§

impl Clamp<i32> for u8

Source§

fn clamp(x: i32) -> u8

Source§

impl Clamp<i32> for u16

Source§

impl Clamp<i64> for i64

Source§

impl Clamp<u8> for u8

Source§

fn clamp(x: u8) -> u8

Source§

impl Clamp<u16> for u8

Source§

fn clamp(x: u16) -> u8

Source§

impl Clamp<u16> for u16

Source§

impl Clamp<u32> for u8

Source§

fn clamp(x: u32) -> u8

Source§

impl Clamp<u32> for u32

Source§

impl Clamp<u64> for u64

Implementors§