Skip to main content

CicpPixelCast

Trait CicpPixelCast 

Source
pub(crate) trait CicpPixelCast<FromColor>
where Self: Pixel + SealedPixelWithColorType<TransformableSubpixel = <Self as Pixel>::Subpixel>, FromColor: Pixel + SealedPixelWithColorType<TransformableSubpixel = <FromColor as Pixel>::Subpixel>, Self::Subpixel: ColorComponentForCicp + FromPrimitive<FromColor::Subpixel>, FromColor::Subpixel: ColorComponentForCicp,
{ }
Expand description

Color types that can be converted by CicpRgb::cast_pixels.

This is a utility to avoid dealing with lots of bounds everywhere. In the actual implementation we avoid the concrete pixel types and care just about the layout (as a runtime property) and the channel type to be promotable into a float for normalization. If the pixels have layouts that are convertible with intra-channel numerics we instead try and promote the channels via Primitive instead.

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.

Implementors§

Source§

impl<FromColor, IntoColor> CicpPixelCast<FromColor> for IntoColor
where IntoColor: Pixel + SealedPixelWithColorType<TransformableSubpixel = IntoColor::Subpixel>, FromColor: Pixel + SealedPixelWithColorType<TransformableSubpixel = FromColor::Subpixel>, IntoColor::Subpixel: ColorComponentForCicp + FromPrimitive<FromColor::Subpixel>, FromColor::Subpixel: ColorComponentForCicp,