pub(crate) fn encode_memory<PixelType: Copy + Pixel>(
    raster: &Raster<PixelType>,
    colortype: ColorType,
    bitdepth: u32,
) -> Result<Vec<u8>, Error> {
    Ok(rustimpl::lodepng_encode_memory(
        raster.as_u8_slice(),
        raster.width(),
        raster.height(),
        colortype,
        bitdepth,
    )?)
}
/// 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.
///
/// * `image`: The raw pixel data to encode. The size of this buffer should be `w` * `h` * (bytes per pixel), bytes per pixel depends on colortype and bitdepth.
/// * `w`: width of the raw pixel data in pixels.
/// * `h`: height of the raw pixel data in pixels.
/// * `colortype`: the color type of the raw input image. See `ColorType`.
/// * `bitdepth`: the bit depth of the raw input image. 1, 2, 4, 8 or 16. Typically 8.
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.

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

`image`: The raw pixel data to encode. The size of this buffer should be `w` * `h` * (bytes per pixel), bytes per pixel depends on colortype and bitdepth.
`w`: width of the raw pixel data in pixels.
`h`: height of the raw pixel data in pixels.
`colortype`: the color type of the raw input image.
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 . for 16 - bit per channel colors needs big endian format like PNG does . ` image ` : The raw pixel data to encode . The size of this buffer should be ` w ` * ` h ` * ( bytes per pixel ) bytes per pixel depends on colortype and bitdepth . ` w ` : width of the raw pixel data in pixels . ` h ` : height of the raw pixel data in pixels . ` colortype ` : the color type of the raw input image .
pub(crate) fn encode_memory<PixelType: Copy + Pixel>(
    raster: &Raster<PixelType>,
    colortype: ColorType,
    bitdepth: u32,
) -> Result<Vec<u8>, Error> {
    Ok(rustimpl::lodepng_encode_memory(
        raster.as_u8_slice(),
        raster.width(),
        raster.height(),
        colortype,
        bitdepth,
    )?)
}
pub ( crate ) fn encode_memory < PixelType : Copy + Pixel > ( raster : & Raster < PixelType > , colortype : ColorType , bitdepth : u32 , ) -> Result < Vec < u8 > , Error > { Ok ( rustimpl :: lodepng_encode_memory ( raster . as_u8_slice ( ) , raster . width ( ) , raster . height ( ) , colortype , bitdepth , ) ? ) }
Converts raw pixel data into a PNG image in memory.
Converts raw pixel data into a PNG image in memory .
raster
&Raster<PixelType>
colortype
ColorType
bitdepth
u32