Run clut code
This commit is contained in:
@@ -9,4 +9,5 @@ edition = "2021"
|
||||
clap = {version = "*", features = ["derive"]}
|
||||
image = "*"
|
||||
paste = "*"
|
||||
png = "*"
|
||||
tool_helper = {path = "../tool_helper"}
|
@@ -9,7 +9,7 @@ mod types;
|
||||
mod color_full16;
|
||||
|
||||
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, ValueEnum)]
|
||||
pub enum ColorDepth {
|
||||
pub enum ColorType{
|
||||
Clut4,
|
||||
Clut8,
|
||||
Full16,
|
||||
@@ -18,7 +18,7 @@ pub enum ColorDepth {
|
||||
#[derive(Args)]
|
||||
pub struct Arguments {
|
||||
#[clap(arg_enum, value_parser)]
|
||||
color_depth: ColorDepth
|
||||
color_depth: ColorType
|
||||
}
|
||||
|
||||
|
||||
@@ -49,9 +49,13 @@ fn convert_full16(input: Input, output: Output) -> Result<(), Error> {
|
||||
}
|
||||
}
|
||||
|
||||
fn convert_palette_based(_: Input, _: Output, _: ColorType) -> Result<(), Error> {
|
||||
Err(Error::from_text("Not implemented yet".to_owned()))
|
||||
}
|
||||
|
||||
pub fn convert(args: Arguments, input: Input, output: Output) -> Result<(), Error> {
|
||||
match args.color_depth {
|
||||
ColorDepth::Full16 => convert_full16(input, output),
|
||||
_ => Err(Error::not_implemented("Converting anything else then full16")),
|
||||
ColorType::Full16 => convert_full16(input, output),
|
||||
_ => convert_palette_based(input, output, args.color_depth),
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user