Trait ComponentMap
trait ComponentMap<DestPixel, SrcComponent, DestComponent>
Applying operation to every component
use *;
# let pixel = RGBnew;
let inverted = pixel.map;
// For simple math there are Add/Sub/Mul implementations:
let halved = pixel.map;
let doubled = pixel * 2;
Required Methods
fn map<Callback>(self: &Self, f: Callback) -> DestPixel where Callback: FnMut(SrcComponent) -> DestComponentConvenience function (equivalent of
self.iter().map().collect()) for applying the same formula to every component.Note that it returns the pixel directly, not an Interator.
Implementors
impl<T: Copy, B> ComponentMap for Bgra<T>impl<T: Copy, B> ComponentMap for GrayAlpha<T>impl<T: Copy, B> ComponentMap for Grb<T>impl<T: Copy, B> ComponentMap for Bgr<T>impl<T: Copy, B> ComponentMap for Rgba<T>impl<T: Copy, B> ComponentMap for Gray<T>impl<T: Copy, B> ComponentMap for Argb<T>impl<T: Copy, B> ComponentMap for Rgb<T>impl<T: Copy, B> ComponentMap for Abgr<T>