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.
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.