rgb

Trait ColorComponentMap

source
pub trait ColorComponentMap<DestPixel, SrcComponent, DestComponent> {
    // Provided methods
    fn map_colors<Callback>(&self, f: Callback) -> DestPixel
       where Callback: FnMut(SrcComponent) -> DestComponent { ... }
    fn map_c<Callback>(&self, f: Callback) -> DestPixel
       where Callback: FnMut(SrcComponent) -> DestComponent { ... }
}
Expand description

Same as ComponentMap, but doesn’t change the alpha channel (if there’s any alpha).

Provided Methods§

source

fn map_colors<Callback>(&self, f: Callback) -> DestPixel
where Callback: FnMut(SrcComponent) -> DestComponent,

Convenience function for applying the same formula to every rgb/gray component, but skipping the alpha component.

Note that it returns the pixel directly, not an Interator.

source

fn map_c<Callback>(&self, f: Callback) -> DestPixel
where Callback: FnMut(SrcComponent) -> DestComponent,

👎Deprecated: renamed to map_colors

Alias of map_colors

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<T: Copy, A: Copy, B> ColorComponentMap<GrayAlpha_v08<B, A>, T, B> for GrayAlpha<T, A>

source§

impl<T: Copy, A: Copy, B> ColorComponentMap<Abgr<B, A>, T, B> for Abgr<T, A>

source§

impl<T: Copy, A: Copy, B> ColorComponentMap<Argb<B, A>, T, B> for Argb<T, A>

source§

impl<T: Copy, A: Copy, B> ColorComponentMap<Bgra<B, A>, T, B> for Bgra<T, A>

source§

impl<T: Copy, A: Copy, B> ColorComponentMap<Rgba<B, A>, T, B> for Rgba<T, A>

source§

impl<T: Copy, B> ColorComponentMap<Gray_v08<B>, T, B> for Gray<T>

source§

impl<T: Copy, B> ColorComponentMap<Bgr<B>, T, B> for Bgr<T>

source§

impl<T: Copy, B> ColorComponentMap<Grb<B>, T, B> for Grb<T>

source§

impl<T: Copy, B> ColorComponentMap<Rgb<B>, T, B> for Rgb<T>