diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2025-02-18 09:56:13 -0500 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2025-02-18 09:56:13 -0500 |
commit | d173617ee23b179ed7e9926d124eaa41b855e071 (patch) | |
tree | 474663e68a3e4b33230556679fddba6240ef698c /src/main.rs | |
parent | c404a0a02915e4f6d329d7667ed30b8519b8a964 (diff) | |
download | kd-forest-d173617ee23b179ed7e9926d124eaa41b855e071.tar.xz |
Update deps
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/main.rs b/src/main.rs index c139ee8..d24ac84 100644 --- a/src/main.rs +++ b/src/main.rs @@ -13,7 +13,7 @@ use crate::frontier::Frontier; use clap::{ArgAction, CommandFactory, Parser, ValueEnum}; use clap::error::ErrorKind; -use image::{self, ColorType, ImageEncoder, ImageError, Rgba, RgbaImage}; +use image::{self, ExtendedColorType, ImageEncoder, ImageError, Rgba, RgbaImage}; use image::codecs::png::{CompressionType, FilterType, PngEncoder}; use rand::{self, SeedableRng}; @@ -193,12 +193,6 @@ impl From<io::Error> for AppError { } } -impl From<rand::Error> for AppError { - fn from(err: rand::Error) -> Self { - Self::RuntimeError(Box::new(err)) - } -} - /// Result type for this app. type AppResult<T> = Result<T, AppError>; @@ -391,7 +385,7 @@ impl App { self.paint_on(colors, ImageFrontier::<C>::new(&img)) } FrontierArg::Min => { - let rng = Pcg64::from_rng(&mut self.rng)?; + let rng = Pcg64::from_rng(&mut self.rng); self.paint_on(colors, MinFrontier::<C, _>::new(rng, width, height, x0, y0)) } FrontierArg::Mean => { @@ -410,7 +404,7 @@ impl App { let writer = BufWriter::new(stdout.lock()); let encoder = PngEncoder::new_with_quality(writer, CompressionType::Fast, FilterType::NoFilter); - encoder.write_image(image, image.width(), image.height(), ColorType::Rgba8)?; + encoder.write_image(image, image.width(), image.height(), ExtendedColorType::Rgba8)?; Ok(()) } |