pub mod types;

use super::args::{ColorType, Point};
use std::io::Write;
use types::Header;
use tool_helper::{Error, Input};

pub type Arguments = super::args::Arguments;

pub fn convert(args: Arguments, input: Input, output: &mut dyn Write) -> Result<(), Error> {
    let mut header_conv = Header::default();
    match args.color_depth {
        ColorType::Full16 => super::convert_full16(&mut header_conv, input, output, Point::default()),
        _                 => super::convert_palette_based(&mut header_conv, input, output, Point::default(), Point::default(), args.color_depth, args.clut_align, args.semi_transparent, args.transparent_palette),
    }
}