pub struct Capture<'a> { /* private fields */ }Implementations§
Source§impl<'a> Capture<'a>
impl<'a> Capture<'a>
pub fn new(factory: &'a Factory) -> Result<Capture<'a>, Error>
👎Deprecated since 0.2: Factory::capture_create
Sourcepub fn get_color_image(&self) -> Image<'_>
pub fn get_color_image(&self) -> Image<'_>
Get the color image associated with the capture
Examples found in repository?
examples/open_device.rs (line 12)
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_depth_image(&self) -> Image<'_>
pub fn get_depth_image(&self) -> Image<'_>
Get the depth image associated with the capture
Sourcepub fn get_ir_image(&self) -> Image<'_>
pub fn get_ir_image(&self) -> Image<'_>
Get the IR image associated with the capture
Sourcepub fn set_color_image(&mut self, color_image: &Image<'_>)
pub fn set_color_image(&mut self, color_image: &Image<'_>)
Set / add a color image to the capture
Sourcepub fn set_depth_image(&mut self, depth_image: &Image<'_>)
pub fn set_depth_image(&mut self, depth_image: &Image<'_>)
Set / add a depth image to the capture
Sourcepub fn set_ir_image(&mut self, ir_image: &Image<'_>)
pub fn set_ir_image(&mut self, ir_image: &Image<'_>)
Set / add an IR image to the capture
Sourcepub fn set_temperature_c(&mut self, temperature_c: f32)
pub fn set_temperature_c(&mut self, temperature_c: f32)
Set the temperature associated with the capture in Celsius.
Sourcepub fn get_temperature_c(&self) -> f32
pub fn get_temperature_c(&self) -> f32
Get temperature (in Celsius) associated with the capture.
Examples found in repository?
examples/open_device.rs (line 18)
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}Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Capture<'a>
impl<'a> RefUnwindSafe for Capture<'a>
impl<'a> !Send for Capture<'a>
impl<'a> !Sync for Capture<'a>
impl<'a> Unpin for Capture<'a>
impl<'a> UnwindSafe for Capture<'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