pub extern "C" fn __wasm_bindgen_generated_remove_channel(
    arg0: <PhotonImage as RefMutFromWasmAbi>::Abi,
    arg1: <usize as FromWasmAbi>::Abi,
    arg2: <u8 as FromWasmAbi>::Abi
) -> <() as ReturnWasmAbi>::Abi
Expand description

Set a certain channel to zero, thus removing the channel’s influence in the pixels’ final rendered colour.

Arguments

  • img - A PhotonImage.
  • channel - The channel to be removed; must be a usize from 0 to 2, with 0 representing Red, 1 representing Green, and 2 representing Blue.
  • min_filter - Minimum filter. Value between 0 and 255. Only remove the channel if the current pixel’s channel value is less than this minimum filter. To completely remove the channel, set this value to 255, to leave the channel as is, set to 0, and to set a channel to zero for a pixel whose red value is greater than 50, then channel would be 0 and min_filter would be 50.

Example

// For example, to remove the Red channel with a min_filter of 100:
use photon_rs::channels::remove_channel;
use photon_rs::native::open_image;

let mut img = open_image("img.jpg").expect("File should open");
remove_channel(&mut img, 0_usize, 100_u8);