pub struct Cam {
pub inner_cam: InwardCam,
pub outer_right_cam: OutwardRightCam,
pub outer_left_cam: OutwardLeftCam,
pub both_outer_cams: BothOutwardCam,
/* private fields */
}
Expand description
Handle to the Camera service.
Fields§
§inner_cam: InwardCam
Inside-facing camera.
outer_right_cam: OutwardRightCam
Outside-facing right camera.
outer_left_cam: OutwardLeftCam
Outside-facing left camera.
both_outer_cams: BothOutwardCam
Both outside-facing cameras (mainly used for 3D photos).
Implementations§
source§impl Cam
impl Cam
sourcepub fn new() -> Result<Cam>
pub fn new() -> Result<Cam>
Initialize a new service handle.
§Notes
All cameras default to taking photos with ViewSize::TopLCD
and OutputFormat::Yuv422
.
Have a look at Camera::set_view_size()
and Camera::set_output_format()
to change these settings.
§Errors
This function will return an error if the service was unable to be initialized. Since this service requires no special or elevated permissions, errors are rare in practice.
§Example
use ctru::services::cam::Cam;
let cam = Cam::new()?;
sourcepub fn play_shutter_sound(&self, sound: ShutterSound) -> Result<()>
pub fn play_shutter_sound(&self, sound: ShutterSound) -> Result<()>
Play the specified sound based on the ShutterSound
argument
§Notes
Playing the shutter sound does not require a living handle to the Ndsp
service.
Volume will always be maxed out to ensure everyone within photo range can hear the picture being taken (as by Japanese law).
§Example
use ctru::services::cam::{Cam, ShutterSound};
let cam = Cam::new()?;
// We play the shutter sound on the console's speakers!
// (even though we aren't taking a photo :P)
cam.play_shutter_sound(ShutterSound::Normal);