pub struct BlpTexture {
pub header: BlpHeader,
pub content: BlpContent,
}Expand description
Parsed information from BLP file. The structure of the type strictly follows how the file is stored on the disk for easy encoding/decoding and further transformations.
Fields§
§header: BlpHeaderFile header containing metadata
content: BlpContentActual image data
Implementations§
Source§impl BlpImage
impl BlpImage
Sourcepub fn image_count(&self) -> usize
pub fn image_count(&self) -> usize
Get total amount of images encoded in the content
Sourcepub fn content_jpeg(&self) -> Option<&BlpJpeg>
pub fn content_jpeg(&self) -> Option<&BlpJpeg>
If the image is encoded jpeg, return the content
Sourcepub fn content_raw1(&self) -> Option<&BlpRaw1>
pub fn content_raw1(&self) -> Option<&BlpRaw1>
If the image is direct encoded with BLP1 format, return the content
Sourcepub fn content_raw3(&self) -> Option<&BlpRaw3>
pub fn content_raw3(&self) -> Option<&BlpRaw3>
If the image is direct encoded with raw3 BLP2 format, return the content
Sourcepub fn content_dxt1(&self) -> Option<&BlpDxtn>
pub fn content_dxt1(&self) -> Option<&BlpDxtn>
If the image is DXT1 encoded, return the content
Sourcepub fn content_dxt3(&self) -> Option<&BlpDxtn>
pub fn content_dxt3(&self) -> Option<&BlpDxtn>
If the image is DXT3 encoded, return the content
Sourcepub fn content_dxt5(&self) -> Option<&BlpDxtn>
pub fn content_dxt5(&self) -> Option<&BlpDxtn>
If the image is DXT5 encoded, return the content
Sourcepub fn compression_type(&self) -> CompressionType
pub fn compression_type(&self) -> CompressionType
Get the compression type used for this BLP image
Sourcepub fn alpha_bit_depth(&self) -> u8
pub fn alpha_bit_depth(&self) -> u8
Get the alpha bit depth for this BLP image
Sourcepub fn best_mipmap_for_size(&self, target_size: u32) -> usize
pub fn best_mipmap_for_size(&self, target_size: u32) -> usize
Find the best mipmap level for a target resolution. Returns the mipmap level closest to the target size.
Sourcepub fn mipmap_info(&self) -> Vec<MipMapInfo>
pub fn mipmap_info(&self) -> Vec<MipMapInfo>
Get information about all mipmap levels
Sourcepub fn estimated_file_size(&self) -> usize
pub fn estimated_file_size(&self) -> usize
Get total file size estimation (excluding external mipmaps)
Sourcepub fn compression_ratio(&self) -> f32
pub fn compression_ratio(&self) -> f32
Get compression efficiency (uncompressed size vs compressed size)
Trait Implementations§
Source§impl Ord for BlpImage
impl Ord for BlpImage
Source§impl PartialOrd for BlpImage
impl PartialOrd for BlpImage
impl Eq for BlpImage
impl StructuralPartialEq for BlpImage
Auto Trait Implementations§
impl Freeze for BlpImage
impl RefUnwindSafe for BlpImage
impl Send for BlpImage
impl Sync for BlpImage
impl Unpin for BlpImage
impl UnwindSafe for BlpImage
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
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>
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>
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