pub fn gamma_correction(
    photon_image: &mut PhotonImage,
    red: f32,
    green: f32,
    blue: f32
)
Expand description

Applies gamma correction to an image.

Arguments

  • photon_image - A PhotonImage that contains a view into the image.
  • red - Gamma value for red channel.
  • green - Gamma value for green channel.
  • blue - Gamma value for blue channel.

Example

// For example, to turn an image of type `PhotonImage` into a gamma corrected image:
use photon_rs::colour_spaces::gamma_correction;
use photon_rs::native::open_image;

let mut img = open_image("img.jpg").expect("File should open");
gamma_correction(&mut img, 2.2, 2.2, 2.2);