Skip to main content

save_rgba

Function save_rgba 

Source
pub fn save_rgba(
    path: impl AsRef<Path>,
    w: u32,
    h: u32,
    rgba: &[u8],
) -> Result<()>
Expand description

Save an RGBA8 buffer (top row first) to path.

The format comes from the extension: .png, .jpg/.jpeg, .bmp, .tga or .gif. An unknown or missing extension writes a BMP, which is what the engine always wrote before it could do anything else. Formats without an alpha channel (JPEG, BMP) get the colour only.