Run clut code

This commit is contained in:
jaby 2022-09-23 22:35:55 +02:00
parent 90a00b892a
commit a6945d0758
3 changed files with 11 additions and 6 deletions

View File

@ -5,6 +5,6 @@ test_cpp_out: always
@echo "Planschbecken" | ./../cpp_out/target/x86_64-unknown-linux-musl/release/cpp_out --name Dino -o "Test_Planschbecken.hpp"
test_jaby_engine_fconv: always
@./../jaby_engine_fconv/target/x86_64-unknown-linux-musl/release/jaby_engine_fconv -o Test_Planschi.bin Test_PNG.PNG simple-tim full16
# @./../jaby_engine_fconv/target/x86_64-unknown-linux-musl/release/jaby_engine_fconv -o Test_Planschi.bin Test_PNG.PNG simple-tim full16
@./../jaby_engine_fconv/target/x86_64-unknown-linux-musl/release/jaby_engine_fconv -o Test_Planschi.bin Test_PNG_pal.PNG simple-tim clut8
always: ;

View File

@ -9,4 +9,5 @@ edition = "2021"
clap = {version = "*", features = ["derive"]}
image = "*"
paste = "*"
png = "*"
tool_helper = {path = "../tool_helper"}

View File

@ -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),
}
}