pub type ImageRawLE<'a, C> = ImageRaw<'a, C, LittleEndian>;
Expand description

Image with little endian data.

Aliased Type§

struct ImageRawLE<'a, C> { /* private fields */ }

Implementations

source§

impl<'a, C, BO> ImageRaw<'a, C, BO>
where C: PixelColor + From<<C as PixelColor>::Raw>, BO: ByteOrder,

source

pub const fn new(data: &'a [u8], width: u32) -> Self

Creates a new image.

Only the width of the image needs to be specified. The height of the image will be calculated based on the length of the given image data. If the length of the image data isn’t an integer multiple of the data length for a single row the last partial row will be ignored.

Trait Implementations

source§

impl<C, BO> OriginDimensions for ImageRaw<'_, C, BO>
where C: PixelColor + From<<C as PixelColor>::Raw>, BO: ByteOrder,

source§

fn size(&self) -> Size

Returns the size of the bounding box.
source§

impl<'a, C, BO> Eq for ImageRaw<'a, C, BO>
where C: PixelColor + From<<C as PixelColor>::Raw> + Eq, BO: ByteOrder + Eq,

source§

impl<'a, C, BO> StructuralEq for ImageRaw<'a, C, BO>
where C: PixelColor + From<<C as PixelColor>::Raw>, BO: ByteOrder,

source§

impl<'a, C, BO> Clone for ImageRaw<'a, C, BO>
where C: PixelColor + From<<C as PixelColor>::Raw> + Clone, BO: ByteOrder + Clone,

source§

fn clone(&self) -> ImageRaw<'a, C, BO>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'a, C, BO> Debug for ImageRaw<'a, C, BO>
where C: PixelColor + From<<C as PixelColor>::Raw> + Debug, BO: ByteOrder + Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'a, C, BO> Copy for ImageRaw<'a, C, BO>
where C: PixelColor + From<<C as PixelColor>::Raw> + Copy, BO: ByteOrder + Copy,

source§

impl<'a, C, BO> PartialOrd for ImageRaw<'a, C, BO>

source§

fn partial_cmp(&self, other: &ImageRaw<'a, C, BO>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<'a, C, BO> PartialEq for ImageRaw<'a, C, BO>
where C: PixelColor + From<<C as PixelColor>::Raw> + PartialEq, BO: ByteOrder + PartialEq,

source§

fn eq(&self, other: &ImageRaw<'a, C, BO>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<'a, C, BO> ImageDrawable for ImageRaw<'a, C, BO>
where C: PixelColor + From<<C as PixelColor>::Raw>, BO: ByteOrder, RawDataSlice<'a, C::Raw, BO>: IntoIterator<Item = C::Raw>,

§

type Color = C

The color type.
source§

fn draw<D>(&self, target: &mut D) -> Result<(), D::Error>
where D: DrawTarget<Color = C>,

Draws the entire image to the target. Read more
source§

fn draw_sub_image<D>( &self, target: &mut D, area: &Rectangle ) -> Result<(), D::Error>
where D: DrawTarget<Color = Self::Color>,

Draws a part of the image to the target. Read more
source§

impl<'a, C, BO> GetPixel for ImageRaw<'a, C, BO>
where C: PixelColor + From<<C as PixelColor>::Raw>, BO: ByteOrder, RawDataSlice<'a, C::Raw, BO>: IntoIterator<Item = C::Raw>,

§

type Color = C

The color type.
source§

fn pixel(&self, p: Point) -> Option<Self::Color>

Gets the color of a pixel. Read more
source§

impl<'a, C, BO> StructuralPartialEq for ImageRaw<'a, C, BO>
where C: PixelColor + From<<C as PixelColor>::Raw>, BO: ByteOrder,

source§

impl<'a, C, BO> Ord for ImageRaw<'a, C, BO>
where C: PixelColor + From<<C as PixelColor>::Raw> + Ord, BO: ByteOrder + Ord,

source§

fn cmp(&self, other: &ImageRaw<'a, C, BO>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl<'a, C, BO> Hash for ImageRaw<'a, C, BO>
where C: PixelColor + From<<C as PixelColor>::Raw> + Hash, BO: ByteOrder + Hash,

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more