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
sourceimpl<'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<'_>ⓘNotable traits for RawPixels<'_>impl Iterator for RawPixels<'_> type Item = RawPixel;
pub fn pixels(&self) -> RawPixels<'_>ⓘNotable traits for RawPixels<'_>impl Iterator for RawPixels<'_> type Item = RawPixel;
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
sourceimpl<'a> Ord for RawBmp<'a>
impl<'a> Ord for RawBmp<'a>
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
sourceimpl<'a> PartialOrd<RawBmp<'a>> for RawBmp<'a>
impl<'a> PartialOrd<RawBmp<'a>> for RawBmp<'a>
sourcefn partial_cmp(&self, other: &RawBmp<'a>) -> Option<Ordering>
fn partial_cmp(&self, other: &RawBmp<'a>) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more