1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
//! Parser for World of Warcraft BLP (texture) files.
//!
//! This crate provides support for reading and writing BLP texture files used in
//! World of Warcraft and Warcraft III. BLP is Blizzard's proprietary texture format
//! that supports various compression methods including JPEG compression, palettized
//! images, and DXT compression.
//!
//! # Supported Versions
//!
//! - **BLP0** - Used in Warcraft III ROC Beta builds
//! - **BLP1** - Common in Warcraft III TFT (versions 1.12.1+)
//! - **BLP2** - Used in World of Warcraft (versions 1.12.1 through 5.4.8)
//!
//! # Supported Encodings
//!
//! - **RAW1** - Palettized images with 256 colors
//! - **RAW3** - Uncompressed RGBA bitmaps
//! - **JPEG** - JPEG compressed images
//! - **DXTn** - S3TC compression algorithms (BLP2 only)
//!
//! # Examples
//!
//! ## Loading a BLP file
//!
//! ```no_run
//! use wow_blp::{parser::load_blp, convert::blp_to_image};
//!
//! let blp_file = load_blp("texture.blp").expect("Failed to load BLP");
//! let mipmap_level = 0;
//! let image = blp_to_image(&blp_file, mipmap_level).expect("Failed to convert");
//! ```
//!
//! ## Saving an image as BLP
//!
//! ```no_run
//! use image::DynamicImage;
//! use wow_blp::{
//! convert::{image_to_blp, BlpTarget, BlpOldFormat, AlphaBits, FilterType},
//! encode::save_blp,
//! };
//!
//! # let image = DynamicImage::new_rgba8(256, 256);
//! let make_mipmaps = true;
//! let target = BlpTarget::Blp1(BlpOldFormat::Raw1 {
//! alpha_bits: AlphaBits::Bit1,
//! });
//! let blp = image_to_blp(image, make_mipmaps, target, FilterType::Nearest)
//! .expect("Failed to convert");
//! save_blp(&blp, "output.blp").expect("Failed to save");
//! ```
/// Conversion utilities to/from DynamicImage
/// Encoding BLP format into stream of bytes
/// Decoding BLP format from raw bytes
/// Utilities for mipmaps filename generation
/// Defines structure of parsed BLP file
pub use *;