pub struct BlpHeader {
pub version: BlpVersion,
pub content: BlpContentTag,
pub flags: BlpFlags,
pub width: u32,
pub height: u32,
pub mipmap_locator: MipmapLocator,
}Expand description
BLP file header structure
Fields§
§version: BlpVersionBLP format version
content: BlpContentTagContent encoding type
flags: BlpFlagsVersion-specific flags
width: u32Image width in pixels
height: u32Image height in pixels
mipmap_locator: MipmapLocatorMipmap location information
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 alpha_type(&self) -> Option<AlphaType>
pub fn alpha_type(&self) -> Option<AlphaType>
Get the alpha type for BLP2 format, if available
Sourcepub fn validate_for_wow_version(
&self,
wow_version: WowVersion,
) -> Result<(), String>
pub fn validate_for_wow_version( &self, wow_version: WowVersion, ) -> Result<(), String>
Validate the BLP header for compatibility with a specific WoW version
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§
impl Eq for BlpHeader
Source§impl Ord for BlpHeader
impl Ord for BlpHeader
1.21.0 (const: unstable) · Source§fn 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
Source§impl PartialOrd for BlpHeader
impl PartialOrd 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 UnsafeUnpin 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().