//use image_similarity::descriptors::dct::DCT;
use image_similarity::descriptors::{DCT, Descriptor};
use image_similarity::store::DescriptorStore;
use log::info;
use clap::Parser;

#[derive(Parser)]
#[command(version, about, long_about = None)]
struct Cfg {
	/// Path to the image
	path: String,
	/// Try to output the images to terminal with viuer
	#[arg(short, long, default_value_t=false)]
	show_images: bool,
	distance: usize,
}

fn main() {
	env_logger::init();

	let desc = DCT::new().with_quality(95);

	let cfg = Cfg::parse();

	let img = image::open(cfg.path)
		.expect("Unable to open file");

	let phash: u64 = desc.describe(&img);
	let _store =
		DescriptorStore::new(Box::new(desc))
		.with_file("dct50.messagepack");
	info!("Phash integer:\n{phash}");
	info!("Phash binary:\n{phash:064b}");
}