pub struct Camera<'a> { /* private fields */ }Implementations§
Source§impl<'a> Camera<'a>
impl<'a> Camera<'a>
Sourcepub fn get_capture(&self, timeout_in_ms: i32) -> Result<Capture<'_>, Error>
pub fn get_capture(&self, timeout_in_ms: i32) -> Result<Capture<'_>, Error>
Reads a sensor capture into cap. Returns true if a capture was read, false if the read timed out.
Examples found in repository?
examples/open_device.rs (line 11)
3pub fn main() -> std::result::Result<(), Box<dyn std::error::Error>> {
4 let factory = Factory::new()?;
5 let device = factory.device_open(0)?;
6 let camera_config = DeviceConfiguration::builder()
7 .depth_mode(DepthMode::WFov2x2Binned)
8 .build();
9 let camera = device.start_cameras(&camera_config)?;
10
11 if let Ok(capture) = camera.get_capture(1000) {
12 let image = capture.get_color_image();
13 println!(
14 "format = {:?}, width = {}, height = {}, temparature = {}",
15 image.get_format(),
16 image.get_width_pixels(),
17 image.get_height_pixels(),
18 capture.get_temperature_c()
19 );
20 }
21
22 Ok(())
23}Sourcepub fn get_capture_wait_infinite(&self) -> Result<Capture<'_>, Error>
pub fn get_capture_wait_infinite(&self) -> Result<Capture<'_>, Error>
Reads a sensor capture into cap. Returns true if a capture was read, false if the read timed out.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Camera<'a>
impl<'a> RefUnwindSafe for Camera<'a>
impl<'a> !Send for Camera<'a>
impl<'a> !Sync for Camera<'a>
impl<'a> Unpin for Camera<'a>
impl<'a> UnwindSafe for Camera<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more