Function photon_rs::effects::tint

source ·
pub fn tint(
    photon_image: &mut PhotonImage,
    r_offset: u32,
    g_offset: u32,
    b_offset: u32
)
Expand description

Tint an image by adding an offset to averaged RGB channel values.

Arguments

  • img - A PhotonImage that contains a view into the image.
  • r_offset - The amount the R channel should be incremented by.
  • g_offset - The amount the G channel should be incremented by.
  • b_offset - The amount the B channel should be incremented by.

Example

// For example, to tint an image of type `PhotonImage`:
use photon_rs::effects::tint;
use photon_rs::native::open_image;

let mut img = open_image("img.jpg").expect("File should open");
tint(&mut img, 10_u32, 20_u32, 15_u32);