pub struct RawBmp<'a> { /* private fields */ }
Expand description
Low-level access to BMP image data.
This struct can be used to access the image data in a BMP file at a lower level than with the
Bmp
struct. It doesn’t do automatic color conversion and doesn’t apply the color
table, if it is present in the BMP file. For images with a color table the iterator returned by
pixels
will instead return the color indices, that can be looked up manually
using the ColorTable
struct.
Implementations§
source§impl<'a> RawBmp<'a>
impl<'a> RawBmp<'a>
sourcepub fn from_slice(bytes: &'a [u8]) -> Result<Self, ParseError>
pub fn from_slice(bytes: &'a [u8]) -> Result<Self, ParseError>
Create a bitmap object from a byte slice.
The created object keeps a shared reference to the input and does not dynamically allocate memory.
sourcepub const fn color_table(&self) -> Option<&ColorTable<'a>>
pub const fn color_table(&self) -> Option<&ColorTable<'a>>
Returns the color table associated with the image.
sourcepub const fn image_data(&self) -> &'a [u8]
pub const fn image_data(&self) -> &'a [u8]
Returns a slice containing the raw image data.
sourcepub fn pixels(&self) -> RawPixels<'_> ⓘ
pub fn pixels(&self) -> RawPixels<'_> ⓘ
Returns an iterator over the raw pixels in the image.
The iterator returns the raw pixel colors as u32
values. To automatically convert the
raw values into embedded_graphics
color types use Bmp::pixels
instead.
Trait Implementations§
source§impl<'a> Ord for RawBmp<'a>
impl<'a> Ord for RawBmp<'a>
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
source§impl<'a> PartialEq<RawBmp<'a>> for RawBmp<'a>
impl<'a> PartialEq<RawBmp<'a>> for RawBmp<'a>
source§impl<'a> PartialOrd<RawBmp<'a>> for RawBmp<'a>
impl<'a> PartialOrd<RawBmp<'a>> for RawBmp<'a>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more