#![allow(clippy::unnecessary_debug_formatting, clippy::uninlined_format_args)]
use dotmax::image::{auto_threshold, load_svg_from_path, pixels_to_braille};
use std::path::Path;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let svg_path = Path::new("tests/fixtures/svg/dark_bg_light_content.svg");
println!("=== SVG Manual Test ===");
println!("File: {}", svg_path.display());
println!();
let img = load_svg_from_path(svg_path, 160, 96)?;
let binary = auto_threshold(&img);
let grid = pixels_to_braille(&binary, 80, 24)?;
println!("Rendered output:");
for y in 0..grid.height() {
for x in 0..grid.width() {
print!("{}", grid.get_char(x, y));
}
println!();
}
println!();
let mut filled = 0;
let mut empty = 0;
for y in 0..grid.height() {
for x in 0..grid.width() {
let ch = grid.get_char(x, y);
if ch != ' ' && ch != '\u{2800}' {
filled += 1;
} else {
empty += 1;
}
}
}
let total = filled + empty;
let filled_pct = (filled * 100) / total;
println!(
"Stats: {} filled, {} empty ({}% filled)",
filled, empty, filled_pct
);
println!();
println!("Can you see the content clearly? (The text 'Omni-Booth' should be visible)");
Ok(())
}