pub extern "C" fn __wasm_bindgen_generated_padding_top(
    arg0: <PhotonImage as RefFromWasmAbi>::Abi,
    arg1: <u32 as FromWasmAbi>::Abi,
    arg2: <Rgba as FromWasmAbi>::Abi
) -> <PhotonImage as ReturnWasmAbi>::Abi
Expand description

Apply padding on the left side of the PhotonImage A padded PhotonImage is returned.

Arguments

  • img - A PhotonImage. See the PhotonImage struct for details.
  • padding - The amount of padding to be applied to the PhotonImage.
  • padding_rgba - Tuple containing the RGBA code for padding color.

Example

// For example, to apply a padding of 10 pixels on the top of a PhotonImage:
use photon_rs::transform::padding_top;
use photon_rs::native::open_image;
use photon_rs::Rgba;

let mut img = open_image("img.jpg").expect("File should open");
let rgba = Rgba::new(200_u8, 100_u8, 150_u8, 255_u8);
padding_top(&img, 10_u32, rgba);