From ff1b4e793d4de81eac6d97295f554b97fdc4360b Mon Sep 17 00:00:00 2001 From: Pierre Fenoll Date: Fri, 22 Oct 2021 17:17:38 +0200 Subject: [PATCH] bump dependency image to 0.23.14 from 0.21.3 Signed-off-by: Pierre Fenoll --- Cargo.toml | 2 +- examples/demo.rs | 4 +++- examples/live.rs | 4 ++-- src/appctx.rs | 2 +- src/framebuffer/draw.rs | 2 +- 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 9b0d4b9..364d4fc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,7 +18,7 @@ memmap2 = "0.5.0" rusttype = "0.8.2" evdev = "0.11.1" epoll = "4.1.0" -image = "0.21.3" +image = "0.23.14" line_drawing = "0.8.0" hlua = "0.4.1" aabb-quadtree = "0.1.0" diff --git a/examples/demo.rs b/examples/demo.rs index 2d41495..0523614 100644 --- a/examples/demo.rs +++ b/examples/demo.rs @@ -156,7 +156,9 @@ fn on_zoom_out(app: &mut appctx::ApplicationContext<'_>, _element: UIElementHand new_image.invert(); // Copy the resized image into the subimage - new_image.copy_from(&resized, CANVAS_REGION.width / 8, CANVAS_REGION.height / 8); + new_image + .copy_from(&resized, CANVAS_REGION.width / 8, CANVAS_REGION.height / 8) + .unwrap(); framebuffer.draw_image( new_image.as_rgb8().unwrap(), diff --git a/examples/live.rs b/examples/live.rs index 0e81954..be06c32 100644 --- a/examples/live.rs +++ b/examples/live.rs @@ -38,12 +38,12 @@ fn main() { ) .unwrap(); let mut writer = BufWriter::new(Vec::new()); - image::jpeg::JPEGEncoder::new(&mut writer) + image::jpeg::JpegEncoder::new(&mut writer) .encode( &*rgb888, DISPLAYWIDTH.into(), DISPLAYHEIGHT.into(), - image::ColorType::RGB(8), + image::ColorType::Rgb8, ) .unwrap(); diff --git a/src/appctx.rs b/src/appctx.rs index fcd030e..40217e2 100644 --- a/src/appctx.rs +++ b/src/appctx.rs @@ -233,7 +233,7 @@ impl<'a> ApplicationContext<'a> { let framebuffer = self.get_framebuffer_ref(); let draw_area = match img { image::DynamicImage::ImageRgb8(ref rgb) => framebuffer.draw_image(rgb, position), - other => framebuffer.draw_image(&other.to_rgb(), position), + other => framebuffer.draw_image(&other.to_rgb8(), position), }; let marker = match refresh { UIConstraintRefresh::Refresh | UIConstraintRefresh::RefreshAndWait => framebuffer diff --git a/src/framebuffer/draw.rs b/src/framebuffer/draw.rs index d631d48..de57ba8 100644 --- a/src/framebuffer/draw.rs +++ b/src/framebuffer/draw.rs @@ -14,7 +14,7 @@ impl<'a> framebuffer::FramebufferDraw for core::Framebuffer<'a> { let pixel_pos = pos + vec2(x as i32, y as i32); self.write_pixel( pixel_pos.cast().unwrap(), - color::RGB(pixel.data[0], pixel.data[1], pixel.data[2]), + color::RGB(pixel.0[0], pixel.0[1], pixel.0[2]), ); } mxcfb_rect {