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§
sourcefn map_colors<Callback>(&self, f: Callback) -> DestPixelwhere
Callback: FnMut(SrcComponent) -> DestComponent,
fn map_colors<Callback>(&self, f: Callback) -> DestPixelwhere
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.
Object Safety§
This trait is not object safe.