Function photon_rs::transform::padding_bottom
source · pub fn padding_bottom(
img: &PhotonImage,
padding: u32,
padding_rgba: Rgba
) -> PhotonImage
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 bottom of a PhotonImage:
use photon_rs::transform::padding_bottom;
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_bottom(&img, 10_u32, rgba);