Function photon_rs::filters::__wasm_bindgen_generated_filter
source · pub extern "C" fn __wasm_bindgen_generated_filter(
arg0: <PhotonImage as RefMutFromWasmAbi>::Abi,
arg1: <str as RefFromWasmAbi>::Abi
) -> <() as ReturnWasmAbi>::Abi
Expand description
Apply a filter to an image. Over 20 filters are available. The filters are as follows:
- oceanic: Add an aquamarine-tinted hue to an image.
- islands: Aquamarine tint.
- marine: Add a green/blue mixed hue to an image.
- seagreen: Dark green hue, with tones of blue.
- flagblue: Royal blue tint
- liquid: Blue-inspired tint.
- diamante: Custom filter with a blue/turquoise tint.
- radio: Fallout-style radio effect.
- twenties: Slight-blue tinted historical effect.
- rosetint: Rose-tinted filter.
- mauve: Purple-infused filter.
- bluechrome: Blue monochrome effect.
- vintage: Vintage filter with a red tint.
- perfume: Increase the blue channel, with moderate increases in the Red and Green channels.
- serenity: Custom filter with an increase in the Blue channel’s values.
Arguments
img
- A PhotonImage.filter_name
- The filter’s name. Choose from the selection above, eg: “oceanic”
Example
// For example, to add a filter called "vintage" to an image:
use photon_rs::filters::filter;
use photon_rs::native::open_image;
let mut img = open_image("img.jpg").expect("File should open");
filter(&mut img, "vintage");