pub trait ConvertOnce<I, O> {
// Required method
fn convert_once(self, input: I) -> O;
}Expand description
Represents types that can convert a value from one type to another at least once.
Required Methods§
Sourcefn convert_once(self, input: I) -> O
fn convert_once(self, input: I) -> O
Convert an input value of type I to a value of type O, while consuming itself.
The conversion may produce values outside the typical range of O.
use palette::{
Xyz, Srgb,
convert::ConvertOnce,
};
let matrix = Xyz::matrix_from_rgb();
let rgb = Srgb::new(0.8f32, 0.3, 0.3).into_linear();
let xyz = matrix.convert_once(rgb);Implementations on Foreign Types§
Source§impl<T, I, O> ConvertOnce<I, O> for &T
impl<T, I, O> ConvertOnce<I, O> for &T
fn convert_once(self, input: I) -> O
Implementors§
impl<E, L, S, T> ConvertOnce<Luma<S, E>, Luma<Linear<S>, L>> for IntoLinearLut<E, L, <S as LumaStandard>::TransferFn, T>
impl<E, L, S, T> ConvertOnce<Rgb<S, E>, Rgb<Linear<S>, L>> for IntoLinearLut<E, L, <S as RgbStandard>::TransferFn, T>
impl<L, E, S, T> ConvertOnce<Luma<Linear<S>, L>, Luma<S, E>> for FromLinearLut<L, E, <S as LumaStandard>::TransferFn, T>where
L: GammaLutInput,
E: GammaLutOutput,
T: LutType<<E as GammaLutOutput>::TableValue>,
<T as LutType<<E as GammaLutOutput>::TableValue>>::Table: Sized,
S: LumaStandard,
impl<L, E, S, T> ConvertOnce<Rgb<Linear<S>, L>, Rgb<S, E>> for FromLinearLut<L, E, <S as RgbStandard>::TransferFn, T>where
L: GammaLutInput,
E: GammaLutOutput,
T: LutType<<E as GammaLutOutput>::TableValue>,
<T as LutType<<E as GammaLutOutput>::TableValue>>::Table: Sized,
S: RgbStandard,
impl<T, I, O> ConvertOnce<I, O> for Box<T>where
T: ConvertOnce<I, O>,
Available on crate feature
alloc only.