1use crate::types::BlpVersion;
2use thiserror::Error;
3
4#[derive(Debug, Error)]
6pub enum Error {
7 #[error("BLP supports width up to 65,535, the width: {0}")]
9 WidthTooHigh(u32),
10 #[error("BLP supports height up to 65,535, the width: {0}")]
12 HeightTooHigh(u32),
13 #[error("External mipmaps are not supported for the version {0}")]
15 ExternalMipmapsNotSupported(BlpVersion),
16 #[error("Invalid offset {offset} for mipmap {mipmap}, filled bytes {filled}")]
18 InvalidOffset {
19 mipmap: usize,
21 offset: usize,
23 filled: usize,
25 },
26 #[error("Size of mipmap {mipmap} in header {in_header} doesn't match actual {actual}")]
28 InvalidMipmapSize {
29 mipmap: usize,
31 in_header: usize,
33 actual: usize,
35 },
36 #[error("Failed to proceed {0}, due: {1}")]
38 FileSystem(std::path::PathBuf, std::io::Error),
39 #[error("Name of root file is malformed: {0}")]
41 FileNameInvalid(std::path::PathBuf),
42}