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

pub extern "C" fn __wasm_bindgen_generated_monochrome(
    arg0: <PhotonImage as RefMutFromWasmAbi>::Abi,
    arg1: <u32 as FromWasmAbi>::Abi,
    arg2: <u32 as FromWasmAbi>::Abi,
    arg3: <u32 as FromWasmAbi>::Abi
) -> <() as ReturnWasmAbi>::Abi

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);