Enum evegfx::display_list::options::BitmapFormat[][src]

#[repr(u8)]pub enum BitmapFormat {
    ARGB1555,
    L1,
    L4,
    L8,
    RGB332,
    ARGB2,
    ARGB4,
    RGB565,
    Text8x8,
    TextVGA,
    Bargraph,
    Paletted565,
    Paletted4444,
    Paletted8,
    L2,
    GLFormat,
}

Variants

ARGB1555
L1
L4
L8
RGB332
ARGB2
ARGB4
RGB565
Text8x8
TextVGA
Bargraph
Paletted565
Paletted4444
Paletted8
L2
GLFormat

Implementations

impl BitmapFormat[src]

pub fn minimum_stride(self, width: u32) -> u32[src]

Computes the most compact possible stride for an image of the given width (in pixels) in the associated bitmap format.

A bitmap might have a larger stride than returned by this function, whether due to its representation in memory having gaps or due to there being multiple "cells" associated with the bitmap, each of which is of the indicated width. In the latter case, you can multiply the minimum_stride result by the number of cells to find the true stride, assuming that the cells are stored compactly.

For bitmap formats with fewer than eight bits per pixel, the result is automatically padded to a round number of bytes, as expected by the display engine.

For the bitmap formats that are based on character cells rather than on pixels, the width should be given in character cells, and the result will be the minimum stride for that given number of character cells.

BitmapFormat::GLFormat is not supported for this method, because it's not a real format but rather just a marker that the format is specified as a BitmapExtFormat instead. BitmapFormat::GLFormat therefore always returns a stride of zero, as an invalid placeholder.

pub fn needs_ext_format(self) -> bool[src]

Returns true if the format requires an extended format to be specified and is therefore not self-sufficient.

If you intend to represent extended formats then you should use BitmapExtFormat instead. Converting a BitmapExtFormat to BitmapFormat will return a format which returns true from this method if the extended format doesn't correspond with one of the base formats.

Trait Implementations

impl Clone for BitmapFormat[src]

impl Copy for BitmapFormat[src]

impl From<BitmapExtFormat> for BitmapFormat[src]

impl PartialEq<BitmapFormat> for BitmapFormat[src]

impl StructuralPartialEq for BitmapFormat[src]

impl TryFrom<BitmapFormat> for BitmapExtFormat[src]

type Error = ()

The type returned in the event of a conversion error.

impl TryFrom<u8> for BitmapFormat[src]

type Error = TryFromPrimitiveError<Self>

The type returned in the event of a conversion error.

impl TryFromPrimitive for BitmapFormat[src]

type Primitive = u8

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.