pub struct Device<'a> { /* private fields */ }Implementations§
Source§impl Device<'_>
impl Device<'_>
Sourcepub fn start_cameras(
&self,
configuration: &DeviceConfiguration,
) -> Result<Camera<'_>, Error>
pub fn start_cameras( &self, configuration: &DeviceConfiguration, ) -> Result<Camera<'_>, Error>
Starts the K4A device’s cameras
Examples found in repository?
examples/open_device.rs (line 9)
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_serialnum(&self) -> Result<String, Error>
pub fn get_serialnum(&self) -> Result<String, Error>
Get the K4A device serial number
Sourcepub fn get_color_control(
&self,
command: ColorControlCommand,
) -> Result<(ColorControlMode, i32), Error>
pub fn get_color_control( &self, command: ColorControlCommand, ) -> Result<(ColorControlMode, i32), Error>
Get the K4A color sensor control value
Sourcepub fn set_color_control(
&mut self,
command: ColorControlCommand,
mode: ColorControlMode,
value: i32,
) -> Result<(), Error>
pub fn set_color_control( &mut self, command: ColorControlCommand, mode: ColorControlMode, value: i32, ) -> Result<(), Error>
Set the K4A color sensor control value
pub fn get_color_control_capabilities( &self, command: ColorControlCommand, ) -> Result<ColorControlCapabilities, Error>
Sourcepub fn get_raw_calibration(&self) -> Result<Vec<u8>, Error>
pub fn get_raw_calibration(&self) -> Result<Vec<u8>, Error>
Get the raw calibration blob for the entire K4A device.
Sourcepub fn get_calibration(
&self,
depth_mode: DepthMode,
color_resolution: ColorResolution,
) -> Result<Calibration<'_>, Error>
pub fn get_calibration( &self, depth_mode: DepthMode, color_resolution: ColorResolution, ) -> Result<Calibration<'_>, Error>
Get the camera calibration for the entire K4A device, which is used for all transformation functions.
Sourcepub fn is_sync_connected(&self) -> Result<(bool, bool), Error>
pub fn is_sync_connected(&self) -> Result<(bool, bool), Error>
Get the device jack status for the synchronization connectors
Sourcepub fn is_sync_in_connected(&self) -> Result<bool, Error>
pub fn is_sync_in_connected(&self) -> Result<bool, Error>
Get the device jack status for the synchronization in connector
Sourcepub fn is_sync_out_connected(&self) -> Result<bool, Error>
pub fn is_sync_out_connected(&self) -> Result<bool, Error>
Get the device jack status for the synchronization out connector
Sourcepub fn get_version(&self) -> Result<HardwareVersion, Error>
pub fn get_version(&self) -> Result<HardwareVersion, Error>
Get the version numbers of the K4A subsystems’ firmware
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Device<'a>
impl<'a> RefUnwindSafe for Device<'a>
impl<'a> !Send for Device<'a>
impl<'a> !Sync for Device<'a>
impl<'a> Unpin for Device<'a>
impl<'a> UnwindSafe for Device<'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