pub struct MipChain {
pub base_width: u32,
pub base_height: u32,
pub channels: u32,
pub levels: Vec<MipLevel>,
}Expand description
Describes the full mip chain for a texture.
Fields§
§base_width: u32Base width of the texture (level 0).
base_height: u32Base height of the texture (level 0).
channels: u32Number of channels per pixel.
levels: Vec<MipLevel>Individual mip level descriptors.
Implementations§
Source§impl MipChain
impl MipChain
Sourcepub fn compute(
base_width: u32,
base_height: u32,
channels: u32,
max_levels: Option<u32>,
) -> Self
pub fn compute( base_width: u32, base_height: u32, channels: u32, max_levels: Option<u32>, ) -> Self
Compute the full mip chain for a texture with given dimensions.
Generates levels down to 1x1 unless max_levels limits the count.
Sourcepub fn level_count(&self) -> u32
pub fn level_count(&self) -> u32
Total number of mip levels in the chain.
Sourcepub fn total_size(&self) -> usize
pub fn total_size(&self) -> usize
Total size in bytes for the entire mip chain.
Sourcepub fn is_single_level(&self) -> bool
pub fn is_single_level(&self) -> bool
Check whether the chain includes only a single level (no mips).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MipChain
impl RefUnwindSafe for MipChain
impl Send for MipChain
impl Sync for MipChain
impl Unpin for MipChain
impl UnsafeUnpin for MipChain
impl UnwindSafe for MipChain
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more