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 more
sourceimpl Debug for FormatDesc
impl Debug for FormatDesc
sourceimpl Hash for FormatDesc
impl Hash for FormatDesc
sourceimpl Ord for FormatDesc
impl Ord for FormatDesc
sourceimpl PartialEq<FormatDesc> for FormatDesc
impl PartialEq<FormatDesc> for FormatDesc
sourcefn eq(&self, other: &FormatDesc) -> bool
fn eq(&self, other: &FormatDesc) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &FormatDesc) -> bool
fn ne(&self, other: &FormatDesc) -> bool
This method tests for !=
.
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>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
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 · 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 more
impl 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 T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more