pub fn adjust_contrast(photon_image: &mut PhotonImage, contrast: f32)
Expand description

Adjust the contrast of an image by a factor.

Arguments

  • photon_image - A PhotonImage that contains a view into the image.
  • contrast - An f32 factor used to adjust contrast. Between [-255.0, 255.0]. The algorithm will clamp results if passed factor is out of range.

Example

use photon_rs::effects::adjust_contrast;
use photon_rs::native::open_image;

let mut img = open_image("img.jpg").expect("File should open");
adjust_contrast(&mut img, 30_f32);