Browse Source

Rename methods for accuracy

pull/65/head
Steve Cook 2 years ago
parent
commit
6f77099394
  1. 3
      ctru-rs/examples/camera-image.rs
  2. 19
      ctru-rs/src/services/cam.rs

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

@ -36,11 +36,9 @@ fn main() { @@ -36,11 +36,9 @@ fn main() {
camera
.set_view_size(CamSize::CTR_TOP_LCD)
.expect("Failed to set camera size");
camera
.set_output_format(CamOutputFormat::RGB_565)
.expect("Failed to set camera output format");
camera
.set_noise_filter(true)
.expect("Failed to enable noise filter");
@ -50,7 +48,6 @@ fn main() { @@ -50,7 +48,6 @@ fn main() {
camera
.set_auto_white_balance(true)
.expect("Failed to enable auto white balance");
camera
.set_trimming(false)
.expect("Failed to disable trimming");

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

@ -308,7 +308,7 @@ pub trait Camera { @@ -308,7 +308,7 @@ pub trait Camera {
}
}
fn is_trimming(&self) -> crate::Result<bool> {
fn is_trimming_enabled(&self) -> crate::Result<bool> {
unsafe {
let mut trimming = false;
let r = ctru_sys::CAMU_IsTrimming(&mut trimming, self.port_as_raw());
@ -447,14 +447,14 @@ pub trait Camera { @@ -447,14 +447,14 @@ pub trait Camera {
}
}
fn is_auto_exposure(&self) -> crate::Result<bool> {
fn is_auto_exposure_enabled(&self) -> crate::Result<bool> {
unsafe {
let mut is_auto_exposure = false;
let r = ctru_sys::CAMU_IsAutoExposure(&mut is_auto_exposure, self.camera_as_raw());
let mut enabled = false;
let r = ctru_sys::CAMU_IsAutoExposure(&mut enabled, self.camera_as_raw());
if r < 0 {
Err(r.into())
} else {
Ok(is_auto_exposure)
Ok(enabled)
}
}
}
@ -470,15 +470,14 @@ pub trait Camera { @@ -470,15 +470,14 @@ pub trait Camera {
}
}
fn is_auto_white_balance(&self) -> crate::Result<bool> {
fn is_auto_white_balance_enabled(&self) -> crate::Result<bool> {
unsafe {
let mut is_auto_white_balance = false;
let r =
ctru_sys::CAMU_IsAutoWhiteBalance(&mut is_auto_white_balance, self.camera_as_raw());
let mut enabled = false;
let r = ctru_sys::CAMU_IsAutoWhiteBalance(&mut enabled, self.camera_as_raw());
if r < 0 {
Err(r.into())
} else {
Ok(is_auto_white_balance)
Ok(enabled)
}
}
}

Loading…
Cancel
Save