feat: wire up image conversion pipeline and CLI
Add `convert.rs`: a SIMD nearest-color search and a rayon-parallel `nordify_pixels` function. Add `error.rs` with the `NordifyError` type. Rewrite `lib.rs` to expose `NordifyOptions`, `nordify_image`, and `nordify_file` as the public API. Rewrite `main.rs` to parse CLI arguments with `argh` and call into `lib.rs`. Add `argh` and `thiserror` as dependencies.
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
use thiserror::Error;
|
||||
|
||||
#[derive(Debug, Error)]
|
||||
pub enum NordifyError {
|
||||
#[error("failed to read or write image: {0}")]
|
||||
Image(#[from] image::ImageError),
|
||||
}
|
||||
|
||||
pub type Result<T> = std::result::Result<T, NordifyError>;
|
||||
Reference in New Issue
Block a user