[][src]Function photon_rs::channels::__wasm_bindgen_generated_selective_hue_rotate

pub extern "C" fn __wasm_bindgen_generated_selective_hue_rotate(
    arg0: <PhotonImage as RefMutFromWasmAbi>::Abi,
    arg1: <Rgb as FromWasmAbi>::Abi,
    arg2: <f32 as FromWasmAbi>::Abi
) -> <() as ReturnWasmAbi>::Abi

Selective hue rotation.

Only rotate the hue of a pixel if its RGB values are within a specified range. This function only rotates a pixel's hue to another if it is visually similar to the colour specified. For example, if a user wishes all pixels that are blue to be changed to red, they can selectively specify only the blue pixels to be changed.

Arguments

  • img - A PhotonImage.
  • ref_color - The RGB value of the reference color (to be compared to)
  • degrees - The amount of degrees to hue rotate by.

Example

// For example, to only rotate the pixels that are of RGB value RGB{20, 40, 60}:
let ref_color = Rgb{20, 40, 60};
photon::channels::selective_hue_rotate(&mut img, ref_color, 180);