Trait ColorComponentMap

trait ColorComponentMap<DestPixel, SrcComponent, DestComponent>

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

Import via use rgb::prelude::*; instead of directly.

Provided Methods

fn map_colors<Callback>(self: &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.

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

Alias of map_colors

Implementors