Share settings
This commit is contained in:
parent
9520050038
commit
aac810ffb3
|
@ -0,0 +1,27 @@
|
|||
use clap::ValueEnum;
|
||||
|
||||
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, ValueEnum)]
|
||||
pub enum ColorType{
|
||||
Clut4,
|
||||
Clut8,
|
||||
Full16,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, ValueEnum)]
|
||||
pub enum ClutAlignment {
|
||||
None,
|
||||
Linear,
|
||||
Block
|
||||
}
|
||||
|
||||
#[allow(non_snake_case)]
|
||||
pub mod SemiTransparent {
|
||||
pub type Type = bool;
|
||||
pub const NAME:&'static str = "semi-trans";
|
||||
}
|
||||
|
||||
#[allow(non_snake_case)]
|
||||
pub mod TransparentPalette {
|
||||
pub type Type = bool;
|
||||
pub const NAME:&'static str = "";
|
||||
}
|
|
@ -1,3 +1,4 @@
|
|||
pub mod args;
|
||||
pub mod color_clut;
|
||||
pub mod color_full16;
|
||||
pub mod reduced_tim;
|
||||
|
|
|
@ -1,24 +1,11 @@
|
|||
use clap::{Args, ValueEnum};
|
||||
use image::{DynamicImage, io::Reader as ImageReader};
|
||||
use super::args::{ColorType, ClutAlignment, SemiTransparent, TransparentPalette};
|
||||
use super::color_clut::{IndexedImage, OutputType};
|
||||
use super::color_full16::{RgbaImage, RgbImage};
|
||||
use super::types::{Header, Color as PSXColor, PSXImageConverter};
|
||||
use clap::Args;
|
||||
use image::{DynamicImage, io::Reader as ImageReader};
|
||||
use std::io::{Cursor, Write};
|
||||
use tool_helper::{Error, Input};
|
||||
use super::types::{Header, Color as PSXColor, PSXImageConverter};
|
||||
|
||||
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, ValueEnum)]
|
||||
pub enum ColorType{
|
||||
Clut4,
|
||||
Clut8,
|
||||
Full16,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, ValueEnum)]
|
||||
pub enum ClutAlignment {
|
||||
None,
|
||||
Linear,
|
||||
Block
|
||||
}
|
||||
|
||||
#[derive(Args)]
|
||||
pub struct Arguments {
|
||||
|
@ -28,10 +15,11 @@ pub struct Arguments {
|
|||
#[clap(value_enum, value_parser, default_value_t=ClutAlignment::None)]
|
||||
clut_align: ClutAlignment,
|
||||
|
||||
#[clap(long="semi-trans", default_value_t=false)]
|
||||
semi_transparent: bool,
|
||||
#[clap(long="color-trans", default_value_t=false)]
|
||||
transparent_palette: bool
|
||||
#[clap(long=SemiTransparent::NAME, default_value_t=false)]
|
||||
semi_transparent: SemiTransparent::Type,
|
||||
|
||||
#[clap(long=TransparentPalette::NAME, default_value_t=false)]
|
||||
transparent_palette: TransparentPalette::Type
|
||||
}
|
||||
|
||||
fn modify_palette(mut image: IndexedImage, clut_align: ClutAlignment, semi_transparent: bool, transparent_palette: bool) -> IndexedImage {
|
||||
|
|
Loading…
Reference in New Issue