Struct BmpEncoder
pub struct BmpEncoder<'a, W: 'a> { /* private fields */ }
The representation of a BMP encoder.
Implementations
impl<'a, W: Write + 'a> BmpEncoder<'a, W>
fn new(w: &'a mut W) -> SelfCreate a new encoder that writes its output to
w.fn encode(&mut self, image: &[u8], width: u32, height: u32, c: ExtendedColorType) -> ImageResult<()>Encodes the image
imagethat has dimensionswidthandheightandExtendedColorTypec.Panics
Panics if
width * height * c.bytes_per_pixel() != image.len().fn encode_with_palette(&mut self, image: &[u8], width: u32, height: u32, color_type: ExtendedColorType, palette: Option<&[[u8; 3]]>) -> ImageResult<()>Same as
encode, but allow a palette to be passed in. Thepaletteis ignored for color types other than Luma/Luma-with-alpha.Panics
Panics if
width * height * c.bytes_per_pixel() != image.len().
Trait Implementations
impl<W: Write> ImageEncoder for BmpEncoder<'_, W>
fn write_image(self, buf: &[u8], width: u32, height: u32, color_type: ExtendedColorType) -> ImageResult<()>