Enum evegfx::display_list::options::BitmapFormat [−][src]
Variants
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]
fn clone(&self) -> BitmapFormat
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for BitmapFormat
[src]
impl From<BitmapExtFormat> for BitmapFormat
[src]
fn from(ext: BitmapExtFormat) -> Self
[src]
impl PartialEq<BitmapFormat> for BitmapFormat
[src]
fn eq(&self, other: &BitmapFormat) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl StructuralPartialEq for BitmapFormat
[src]
impl TryFrom<BitmapFormat> for BitmapExtFormat
[src]
type Error = ()
The type returned in the event of a conversion error.
fn try_from(fmt: BitmapFormat) -> Result<Self, ()>
[src]
impl TryFrom<u8> for BitmapFormat
[src]
type Error = TryFromPrimitiveError<Self>
The type returned in the event of a conversion error.
fn try_from(number: u8) -> Result<Self, TryFromPrimitiveError<Self>>
[src]
impl TryFromPrimitive for BitmapFormat
[src]
type Primitive = u8
const NAME: &'static str
[src]
fn try_from_primitive(
number: Self::Primitive
) -> Result<Self, TryFromPrimitiveError<Self>>
[src]
number: Self::Primitive
) -> Result<Self, TryFromPrimitiveError<Self>>
Auto Trait Implementations
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,