Browse Source

Requested changes

Use calculated buffer size over comment.
Use tuple structs for input on Cam::set_detail_size
pull/65/head
Steve Cook 2 years ago
parent
commit
46d78e2cd9
  1. 2
      ctru-rs/examples/camera-image.rs
  2. 14
      ctru-rs/src/services/cam.rs

2
ctru-rs/examples/camera-image.rs

@ -7,7 +7,7 @@ use ctru::Gfx; @@ -7,7 +7,7 @@ use ctru::Gfx;
const WIDTH: usize = 400;
const HEIGHT: usize = 240;
const BUF_SIZE: usize = 384000; // WIDTH * HEIGHT * 2 * 2; First '* 2' is for 2 bytes per pixel, second is for 3D layer.
const BUF_SIZE: usize = WIDTH * HEIGHT * 2 * 2;
const WAIT_TIMEOUT: i64 = 300000000;

14
ctru-rs/src/services/cam.rs

@ -654,10 +654,8 @@ pub trait Camera { @@ -654,10 +654,8 @@ pub trait Camera {
&mut self,
width: i16,
height: i16,
crop_x0: i16,
crop_y0: i16,
crop_x1: i16,
crop_y1: i16,
crop_0: (i16, i16),
crop_1: (i16, i16),
context: CamContext,
) -> crate::Result<()> {
unsafe {
@ -665,10 +663,10 @@ pub trait Camera { @@ -665,10 +663,10 @@ pub trait Camera {
self.camera_as_raw(),
width,
height,
crop_x0,
crop_y0,
crop_x1,
crop_y1,
crop_0.0,
crop_0.1,
crop_1.0,
crop_1.1,
context.bits(),
);
if r < 0 {

Loading…
Cancel
Save