pub fn padding_uniform(
img: &PhotonImage,
padding: u32,
padding_rgba: Rgba,
) -> PhotonImageExpand description
Apply uniform padding around 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 around a PhotonImage:
use photon_rs::transform::padding_uniform;
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_uniform(&img, 10_u32, rgba);