diff --git a/ctru-rs/examples/camera-image.rs b/ctru-rs/examples/camera-image.rs index c65d6b1..c321919 100644 --- a/ctru-rs/examples/camera-image.rs +++ b/ctru-rs/examples/camera-image.rs @@ -34,7 +34,7 @@ fn main() { let camera = &mut cam.outer_right_cam; camera - .set_size(CamSize::CTR_TOP_LCD) + .set_view_size(CamSize::CTR_TOP_LCD) .expect("Failed to set camera size"); camera @@ -108,14 +108,12 @@ fn main() { // but the image would need to be rotated 90 degrees. fn convert_image_to_rgb8(img: &[u8], x: usize, y: usize, width: usize, height: usize) -> Vec { let mut rgb8 = vec![0u8; img.len()]; - let mut draw_x; - let mut draw_y; for j in 0..height { for i in 0..width { // Y-coordinate of where to draw in the frame buffer - draw_y = y + height - j; + let draw_y = y + height - j; // X-coordinate of where to draw in the frame buffer - draw_x = x + i; + let draw_x = x + i; // Initial index of where to draw in the frame buffer based on y and x coordinates let draw_index = (draw_y + draw_x * height) * 3; diff --git a/ctru-rs/src/services/cam.rs b/ctru-rs/src/services/cam.rs index 42f2a42..e564810 100644 --- a/ctru-rs/src/services/cam.rs +++ b/ctru-rs/src/services/cam.rs @@ -521,7 +521,7 @@ pub trait Camera { } } - fn set_size(&mut self, size: CamSize) -> crate::Result<()> { + fn set_view_size(&mut self, size: CamSize) -> crate::Result<()> { unsafe { let r = ctru_sys::CAMU_SetSize(self.camera_as_raw(), size.bits(), ctru_sys::CONTEXT_A); if r < 0 {