master
John Lauer Update 5 file(s) a64f6ba 2mo ago
//! Native harness for the brand tile pipeline: `cargo run -p pup-identity --example tilepack -- <render.rgba> <render_px> <out_dir>`
//! writes <out_dir>/tile-<size>.png for every ICO size (the exact bytes the ICO carries) plus tile.ico.
fn main() {
    let a: Vec<String> = std::env::args().collect();
    let (src, render, out) = (&a[1], a[2].parse::<u32>().unwrap(), &a[3]);
    let rgba = std::fs::read(src).unwrap(); std::fs::create_dir_all(out).unwrap();
    for sz in pup_identity::TILE_SIZES { let px = pup_identity::brand_downscale(&rgba, render, sz); std::fs::write(format!("{out}/tile-{sz}.png"), pup_identity::png_encode_rgba(&px, sz, sz)).unwrap(); }
    std::fs::write(format!("{out}/tile.ico"), pup_identity::ico_from_render(&rgba, render)).unwrap();
    println!("ok");
}