pub struct Image<'a> { /* private fields */ }Implementations§
Source§impl<'a> Image<'a>
impl<'a> Image<'a>
Sourcepub fn with_format(
factory: &'a Factory,
format: ImageFormat,
width_pixels: i32,
height_pixels: i32,
stride_bytes: i32,
) -> Result<Image<'a>, Error>
👎Deprecated since 0.2: Factory::image_create
pub fn with_format( factory: &'a Factory, format: ImageFormat, width_pixels: i32, height_pixels: i32, stride_bytes: i32, ) -> Result<Image<'a>, Error>
Create a blank image
Sourcepub fn with_buffer(
factory: &'a Factory,
format: ImageFormat,
width_pixels: i32,
height_pixels: i32,
stride_bytes: i32,
buffer: *mut u8,
buffer_size: usize,
buffer_release_cb: Option<MemoryDestroyCallback>,
buffer_release_cb_context: *mut (),
) -> Result<Image<'a>, Error>
👎Deprecated since 0.2: Factory::image_create_from_buffer
pub fn with_buffer( factory: &'a Factory, format: ImageFormat, width_pixels: i32, height_pixels: i32, stride_bytes: i32, buffer: *mut u8, buffer_size: usize, buffer_release_cb: Option<MemoryDestroyCallback>, buffer_release_cb_context: *mut (), ) -> Result<Image<'a>, Error>
Create an image from a pre-allocated buffer
Sourcepub fn get_buffer(&self) -> *const u8
pub fn get_buffer(&self) -> *const u8
Get the image buffer
Sourcepub fn get_mut_buffer(&mut self) -> *mut u8
pub fn get_mut_buffer(&mut self) -> *mut u8
Get the mutable image buffer
Sourcepub fn get_format(&self) -> ImageFormat
pub fn get_format(&self) -> ImageFormat
Get the image format of the image
Examples found in repository?
examples/open_device.rs (line 15)
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_width_pixels(&self) -> i32
pub fn get_width_pixels(&self) -> i32
Get the image width in pixels
Examples found in repository?
examples/open_device.rs (line 16)
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_height_pixels(&self) -> i32
pub fn get_height_pixels(&self) -> i32
Get the image height in pixels
Examples found in repository?
examples/open_device.rs (line 17)
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_stride_bytes(&self) -> i32
pub fn get_stride_bytes(&self) -> i32
Get the image stride in bytes
Sourcepub fn get_device_timestamp_usec(&self) -> u64
pub fn get_device_timestamp_usec(&self) -> u64
Get the image’s device timestamp in microseconds
Sourcepub fn get_system_timestamp_nsec(&self) -> u64
pub fn get_system_timestamp_nsec(&self) -> u64
Get the image’s system timestamp in nanoseconds
Sourcepub fn get_exposure_usec(&self) -> u64
pub fn get_exposure_usec(&self) -> u64
Get the image exposure time in microseconds
Sourcepub fn get_white_balance(&self) -> u32
pub fn get_white_balance(&self) -> u32
Get the image white balance in Kelvin (color images only)
Sourcepub fn get_iso_speed(&self) -> u32
pub fn get_iso_speed(&self) -> u32
Get the image’s ISO speed (color images only)
Sourcepub fn set_device_timestamp_usec(&mut self, timestamp: u64)
pub fn set_device_timestamp_usec(&mut self, timestamp: u64)
Set the image’s device timestamp in microseconds
Sourcepub fn set_system_timestamp_nsec(&mut self, timestamp: u64)
pub fn set_system_timestamp_nsec(&mut self, timestamp: u64)
Set the image’s system timestamp in nanoseconds
Sourcepub fn set_exposure_usec(&mut self, exposure: u64)
pub fn set_exposure_usec(&mut self, exposure: u64)
Set the image exposure time in microseconds
Sourcepub fn set_white_balance(&mut self, white_balance: u32)
pub fn set_white_balance(&mut self, white_balance: u32)
Set the image white balance in Kelvin (color images only)
Sourcepub fn set_iso_speed(&mut self, iso_speed: u32)
pub fn set_iso_speed(&mut self, iso_speed: u32)
Set the image’s ISO speed (color images only)
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Image<'a>
impl<'a> RefUnwindSafe for Image<'a>
impl<'a> !Send for Image<'a>
impl<'a> !Sync for Image<'a>
impl<'a> Unpin for Image<'a>
impl<'a> UnwindSafe for Image<'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