Function lodepng::encode_memory [] [src]

pub fn encode_memory<PixelType: Copy>(
    image: &[PixelType],
    w: usize,
    h: usize,
    colortype: ColorType,
    bitdepth: c_uint
) -> Result<Vec<u8>, Error>

Converts raw pixel data into a PNG image in memory. The colortype and bitdepth of the output PNG image cannot be chosen, they are automatically determined by the colortype, bitdepth and content of the input pixel data.

Note: for 16-bit per channel colors, needs big endian format like PNG does.