Function photon_rs::channels::alter_red_channel
source · pub fn alter_red_channel(photon_image: &mut PhotonImage, amt: i16)
Expand description
Increment or decrement every pixel’s Red channel by a constant.
Arguments
img
- A PhotonImage. See the PhotonImage struct for details.amt
- The amount to increment or decrement the channel’s value by for that pixel.
Example
// For example, to increase the Red channel for all pixels by 10:
use photon_rs::channels::alter_red_channel;
use photon_rs::native::open_image;
let mut img = open_image("img.jpg").expect("File should open");
alter_red_channel(&mut img, 10_i16);