pub struct BmpEncoder<'a, W>where
W: 'a,{ /* private fields */ }Expand description
The representation of a BMP encoder.
Implementations§
Source§impl<'a, W> BmpEncoder<'a, W>where
W: Write + 'a,
impl<'a, W> BmpEncoder<'a, W>where
W: Write + 'a,
Sourcepub fn new(w: &'a mut W) -> BmpEncoder<'a, W>
pub fn new(w: &'a mut W) -> BmpEncoder<'a, W>
Create a new encoder that writes its output to w.
Sourcepub fn encode(
&mut self,
image: &[u8],
width: u32,
height: u32,
c: ColorType,
) -> Result<(), ImageError>
pub fn encode( &mut self, image: &[u8], width: u32, height: u32, c: ColorType, ) -> Result<(), ImageError>
Encodes the image image that has dimensions width and height and ColorType 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: ColorType,
palette: Option<&[[u8; 3]]>,
) -> Result<(), ImageError>
pub fn encode_with_palette( &mut self, image: &[u8], width: u32, height: u32, c: ColorType, palette: Option<&[[u8; 3]]>, ) -> Result<(), ImageError>
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().
Trait Implementations§
Source§impl<'a, W> ImageEncoder for BmpEncoder<'a, W>where
W: Write,
impl<'a, W> ImageEncoder for BmpEncoder<'a, W>where
W: Write,
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> IntoResult<T> for T
impl<T> IntoResult<T> for T
type Err = Infallible
fn into_result(self) -> Result<T, <T as IntoResult<T>>::Err>
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<Target, Original> VectorizedInto<Target> for Originalwhere
Target: VectorizedFrom<Original>,
impl<Target, Original> VectorizedInto<Target> for Originalwhere
Target: VectorizedFrom<Original>,
Source§fn vectorized_into(self) -> Target
fn vectorized_into(self) -> Target
Performs the conversion.