Function photon_rs::channels::alter_channels
source · pub fn alter_channels(img: &mut PhotonImage, r_amt: i16, g_amt: i16, b_amt: i16)
Expand description
Increment all 3 channels’ values by adding an amt to each channel per pixel.
Arguments
img
- A PhotonImage.r_amt
- The amount to increment/decrement the Red channel by.g_amt
- The amount to increment/decrement the Green channel by.b_amt
- The amount to increment/decrement the Blue channel by.
Example
// For example, to increase the values of the Red channel by 10, the Green channel by 20,
// and the Blue channel by 50:
use photon_rs::channels::alter_channels;
use photon_rs::native::open_image;
let mut img = open_image("img.jpg").expect("File should open");
alter_channels(&mut img, 10_i16, 20_i16, 50_i16);