Browse Source

Update CAM example

pull/107/head
Andrea Ciliberti 2 years ago
parent
commit
bcfd0fd84c
  1. 8
      ctru-rs/examples/camera-image.rs

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

@ -1,5 +1,5 @@
use ctru::prelude::*; use ctru::prelude::*;
use ctru::services::cam::{Cam, CamOutputFormat, CamShutterSoundType, CamSize, Camera}; use ctru::services::cam::{Cam, OutputFormat, ShutterSound, ViewSize, Camera};
use ctru::services::gfx::Screen; use ctru::services::gfx::Screen;
use ctru::services::gspgpu::FramebufferFormat; use ctru::services::gspgpu::FramebufferFormat;
@ -37,10 +37,10 @@ fn main() {
let camera = &mut cam.outer_right_cam; let camera = &mut cam.outer_right_cam;
camera camera
.set_view_size(CamSize::CTR_TOP_LCD) .set_view_size(ViewSize::TopLCD)
.expect("Failed to set camera size"); .expect("Failed to set camera size");
camera camera
.set_output_format(CamOutputFormat::RGB_565) .set_output_format(OutputFormat::Rgb565)
.expect("Failed to set camera output format"); .expect("Failed to set camera output format");
camera camera
.set_noise_filter(true) .set_noise_filter(true)
@ -83,7 +83,7 @@ fn main() {
) )
.expect("Failed to take picture"); .expect("Failed to take picture");
cam.play_shutter_sound(CamShutterSoundType::NORMAL) cam.play_shutter_sound(ShutterSound::Normal)
.expect("Failed to play shutter sound"); .expect("Failed to play shutter sound");
rotate_image_to_screen( rotate_image_to_screen(

Loading…
Cancel
Save