Skip to content

Commit

Permalink
Merge pull request #74 from fenollp/upimage
Browse files Browse the repository at this point in the history
bump dependency image to 0.23.14 from 0.21.3
  • Loading branch information
LinusCDE committed Oct 23, 2021
2 parents b5a0ea1 + ff1b4e7 commit 6e5ce15
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 3 additions & 1 deletion examples/demo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
4 changes: 2 additions & 2 deletions examples/live.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
2 changes: 1 addition & 1 deletion src/appctx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/framebuffer/draw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 6e5ce15

Please sign in to comment.