pub struct BlpHeader {
pub version: BlpVersion,
pub content: BlpContentTag,
pub flags: BlpFlags,
pub width: u32,
pub height: u32,
pub mipmap_locator: MipmapLocator,
}
Fields§
§version: BlpVersion
§content: BlpContentTag
§flags: BlpFlags
§width: u32
§height: u32
§mipmap_locator: MipmapLocator
Implementations§
Source§impl BlpHeader
impl BlpHeader
Sourcepub fn mipmaps_count(&self) -> usize
pub fn mipmaps_count(&self) -> usize
Calculate needed count of mipmaps for the defined size
Sourcepub fn has_mipmaps(&self) -> bool
pub fn has_mipmaps(&self) -> bool
Returns ‘true’ if the header defines that the image has mipmaps
Sourcepub fn mipmap_size(&self, i: usize) -> (u32, u32)
pub fn mipmap_size(&self, i: usize) -> (u32, u32)
Return expected size of mipmap for the given mipmap level. 0 level means original image.
Sourcepub fn mipmap_pixels(&self, i: usize) -> u32
pub fn mipmap_pixels(&self, i: usize) -> u32
Return expected count of pixels in mipmap at the level i. 0 level means original image.
Sourcepub fn alpha_bits(&self) -> u32
pub fn alpha_bits(&self) -> u32
Return alpha bits count in encoding
Sourcepub fn internal_mipmaps(&self) -> Option<([u32; 16], [u32; 16])>
pub fn internal_mipmaps(&self) -> Option<([u32; 16], [u32; 16])>
Return offsets and sizes of internal mipmaps. For external returns None
Sourcepub fn size(version: BlpVersion) -> usize
pub fn size(version: BlpVersion) -> usize
Get size of header in bytes. Doesn’t count jpeg header or color map.
Trait Implementations§
Source§impl Ord for BlpHeader
impl Ord for BlpHeader
Source§impl PartialOrd for BlpHeader
impl PartialOrd for BlpHeader
impl Eq for BlpHeader
impl StructuralPartialEq for BlpHeader
Auto Trait Implementations§
impl Freeze for BlpHeader
impl RefUnwindSafe for BlpHeader
impl Send for BlpHeader
impl Sync for BlpHeader
impl Unpin for BlpHeader
impl UnwindSafe for BlpHeader
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian()
.