Skip to content
Snippets Groups Projects
main.rs 673 B
Newer Older
Louis's avatar
Louis committed
mod cli_args;
mod commands;
mod format;
mod utils;

use clap::Parser;
use image::{GenericImage, Rgba, SubImage};

use crate::cli_args::Args;
use crate::format::{load_image, Format};

#[derive(Clone, Copy)]
struct SpriteData<'a, T: GenericImage> {
	pub data: SubImage<&'a T>,
	#[allow(dead_code)]
	pub x: u32,
	#[allow(dead_code)]
	pub y: u32,
	pub tx: u32,
	pub ty: u32,
	#[allow(dead_code)]
	pub width: u32,
	#[allow(dead_code)]
	pub height: u32,
}

pub type OutputFormat = image::ImageBuffer<Rgba<u8>, Vec<u8>>;

fn main() -> anyhow::Result<(), anyhow::Error> {
	env_logger::Builder::from_env("LOG_LEVEL").init();
	let args: Args = Args::parse();
	args.run()?;
	Ok(())
}