Skip to content

Commit

Permalink
Small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dcvz committed Jul 18, 2023
1 parent 61eabf8 commit 1900c03
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 6 deletions.
86 changes: 86 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ png = "0.17.9"
clap = { version = "4.1.12", features = ["derive"] }
anyhow = "1.0.72"
byteorder = "1.4.3"
num_enum = "0.6.1"
12 changes: 6 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ pub use image::png_image::PNGImage;

mod utils;

#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, TryFromPrimitive)]
pub enum ImageSize {
Bits4,
Bits4 = 0,
Bits8 = 1,
Bits16 = 2,
Bits32 = 3,
DD = 5,
}

impl ImageSize {
fn get_tlut_size(&self) -> usize {
pub fn get_tlut_size(&self) -> usize {
match self {
ImageSize::Bits4 => 0x10,
ImageSize::Bits8 => 0x100,
Expand All @@ -28,7 +28,7 @@ impl ImageSize {
}
}

#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, TryFromPrimitive)]
pub enum ImageFormat {
Rgba = 0,
Yuv = 1,
Expand All @@ -37,7 +37,7 @@ pub enum ImageFormat {
I = 4,
}

#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, TryFromPrimitive)]
pub enum ImageType {
I4,
I8,
Expand Down Expand Up @@ -80,7 +80,7 @@ impl ImageType {
}
}

#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, TryFromPrimitive)]
#[repr(u8)]
pub enum TextureLUT {
None = 0,
Expand Down

0 comments on commit 1900c03

Please sign in to comment.