pub struct BmpEncoder<'a, W: 'a> {
    writer: &'a mut W,
}Expand description
The representation of a BMP encoder.
Fields§
§writer: &'a mut WImplementations§
Source§impl<'a, W: Write + 'a> BmpEncoder<'a, W>
 
impl<'a, W: Write + 'a> BmpEncoder<'a, W>
Sourcepub fn encode(
    &mut self,
    image: &[u8],
    width: u32,
    height: u32,
    c: ExtendedColorType,
) -> ImageResult<()>
 
pub fn encode( &mut self, image: &[u8], width: u32, height: u32, c: ExtendedColorType, ) -> ImageResult<()>
Encodes the image image that has dimensions width and height and ExtendedColorType c.
§Panics
Panics if width * height * c.bytes_per_pixel() != image.len().
Sourcepub fn encode_with_palette(
    &mut self,
    image: &[u8],
    width: u32,
    height: u32,
    c: ExtendedColorType,
    palette: Option<&[[u8; 3]]>,
) -> ImageResult<()>
 
pub fn encode_with_palette( &mut self, image: &[u8], width: u32, height: u32, c: ExtendedColorType, palette: Option<&[[u8; 3]]>, ) -> ImageResult<()>
Same as encode, but allow a palette to be passed in. The palette is ignored for color
types other than Luma/Luma-with-alpha.
§Panics
Panics if width * height * c.bytes_per_pixel() != image.len().
fn encode_rgb( &mut self, image: &[u8], width: u32, height: u32, row_pad_size: u32, bytes_per_pixel: u32, ) -> Result<()>
fn encode_rgba( &mut self, image: &[u8], width: u32, height: u32, row_pad_size: u32, bytes_per_pixel: u32, ) -> Result<()>
fn encode_gray( &mut self, image: &[u8], width: u32, height: u32, row_pad_size: u32, bytes_per_pixel: u32, palette: Option<&[[u8; 3]]>, ) -> Result<()>
fn write_row_pad(&mut self, row_pad_size: u32) -> Result<()>
Trait Implementations§
Source§impl<W: Write> ImageEncoder for BmpEncoder<'_, W>
 
impl<W: Write> ImageEncoder for BmpEncoder<'_, W>
Source§fn write_image(
    self,
    buf: &[u8],
    width: u32,
    height: u32,
    color_type: ExtendedColorType,
) -> ImageResult<()>
 
fn write_image( self, buf: &[u8], width: u32, height: u32, color_type: ExtendedColorType, ) -> ImageResult<()>
Writes all the bytes in an image to the encoder. Read more
Source§fn set_icc_profile(
    &mut self,
    icc_profile: Vec<u8>,
) -> Result<(), UnsupportedError>
 
fn set_icc_profile( &mut self, icc_profile: Vec<u8>, ) -> Result<(), UnsupportedError>
Set the ICC profile to use for the image. Read more
Auto Trait Implementations§
impl<'a, W> Freeze for BmpEncoder<'a, W>
impl<'a, W> RefUnwindSafe for BmpEncoder<'a, W>where
    W: RefUnwindSafe,
impl<'a, W> Send for BmpEncoder<'a, W>where
    W: Send,
impl<'a, W> Sync for BmpEncoder<'a, W>where
    W: Sync,
impl<'a, W> Unpin for BmpEncoder<'a, W>
impl<'a, W> !UnwindSafe for BmpEncoder<'a, W>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
    T: ?Sized,
 
impl<T> BorrowMut<T> for Twhere
    T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
 
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
 
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
 
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts 
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
 
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts 
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more