pub extern "C" fn __wasm_bindgen_generated_tint(
    arg0: <PhotonImage as RefMutFromWasmAbi>::Abi,
    arg1: <u32 as FromWasmAbi>::Abi,
    arg2: <u32 as FromWasmAbi>::Abi,
    arg3: <u32 as FromWasmAbi>::Abi
) -> <() as ReturnWasmAbi>::Abi
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);