[][src]Function photon_rs::monochrome::monochrome

pub fn monochrome(
    photon_image: &mut PhotonImage,
    r_offset: u32,
    g_offset: u32,
    b_offset: u32
)

Apply a monochrome effect of a certain colour.

It does so by averaging the R, G, and B values of a pixel, and then adding a separate value to that averaged value for each channel to produce a tint.

Arguments

  • photon_image - A PhotonImage.
  • r_offset - The value to add to the Red channel per pixel.
  • g_offset - The value to add to the Green channel per pixel.
  • b_offset - The value to add to the Blue channel per pixel.

Example

// For example, to apply a monochrome effect to an image:
use photon::monochrome;
monochrome::monochroma(&mut img, 40, 50, 100);