Struct gfx_hal::format::FormatDesc
source · Expand description
Description of a format.
Fields
bits: u16
Total number of bits.
- Depth/Stencil formats are opaque formats, where the total number of bits is unknown. A dummy value is used for these formats instead (sum of depth and stencil bits). For copy operations, the number of bits of the corresponding aspect should be used.
- The total number can be larger than the sum of individual format bits
(
color
,alpha
,depth
andstencil
) for packed formats. - For compressed formats, this denotes the number of bits per block.
dim: (u8, u8)
Dimensions (width, height) of the texel blocks.
packed: bool
The format representation depends on the endianness of the platform.
- On little-endian systems, the actual oreder of components is reverse of what a surface type specifies.
aspects: Aspects
Format aspects
Implementations
sourceimpl FormatDesc
impl FormatDesc
sourcepub fn is_compressed(&self) -> bool
pub fn is_compressed(&self) -> bool
Check if the format is compressed.
Trait Implementations
sourceimpl Clone for FormatDesc
impl Clone for FormatDesc
sourcefn clone(&self) -> FormatDesc
fn clone(&self) -> FormatDesc
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for FormatDesc
impl Debug for FormatDesc
sourceimpl Hash for FormatDesc
impl Hash for FormatDesc
sourceimpl Ord for FormatDesc
impl Ord for FormatDesc
sourcefn cmp(&self, other: &FormatDesc) -> Ordering
fn cmp(&self, other: &FormatDesc) -> Ordering
1.21.0 · sourcefn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialEq<FormatDesc> for FormatDesc
impl PartialEq<FormatDesc> for FormatDesc
sourcefn eq(&self, other: &FormatDesc) -> bool
fn eq(&self, other: &FormatDesc) -> bool
sourceimpl PartialOrd<FormatDesc> for FormatDesc
impl PartialOrd<FormatDesc> for FormatDesc
sourcefn partial_cmp(&self, other: &FormatDesc) -> Option<Ordering>
fn partial_cmp(&self, other: &FormatDesc) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
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 moreimpl Copy for FormatDesc
impl Eq for FormatDesc
impl StructuralEq for FormatDesc
impl StructuralPartialEq for FormatDesc
Auto Trait Implementations
impl RefUnwindSafe for FormatDesc
impl Send for FormatDesc
impl Sync for FormatDesc
impl Unpin for FormatDesc
impl UnwindSafe for FormatDesc
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more