Skip to main content

GenCam

Trait GenCam 

Source
pub trait GenCam: Send + Debug {
Show 17 methods // Required methods fn info_handle(&self) -> Option<AnyGenCamInfo>; fn info(&self) -> GenCamResult<&GenCamDescriptor>; fn vendor(&self) -> &str; fn camera_ready(&self) -> bool; fn camera_name(&self) -> &str; fn list_properties(&self) -> &HashMap<GenCamCtrl, Property>; fn get_property( &self, name: GenCamCtrl, ) -> GenCamResult<(PropertyValue, bool)>; fn set_property( &mut self, name: GenCamCtrl, value: &PropertyValue, auto: bool, ) -> GenCamResult<()>; fn cancel_capture(&self) -> GenCamResult<()>; fn is_capturing(&self) -> bool; fn capture(&mut self) -> GenCamResult<GenericImageRef<'_>>; fn start_exposure(&mut self) -> GenCamResult<()>; fn download_image(&mut self) -> GenCamResult<GenericImageRef<'_>>; fn image_ready(&self) -> GenCamResult<bool>; fn camera_state(&self) -> GenCamResult<GenCamState>; fn set_roi(&mut self, roi: &GenCamRoi) -> GenCamResult<&GenCamRoi>; fn get_roi(&self) -> &GenCamRoi;
}
Expand description

Trait for controlling the camera. This trait is intended to be applied to a non-clonable object that is used to capture images and can not be shared across threads.

Required Methods§

Source

fn info_handle(&self) -> Option<AnyGenCamInfo>

Get the GenCamInfo object, if available.

Source

fn info(&self) -> GenCamResult<&GenCamDescriptor>

Get the camera descriptor.

Source

fn vendor(&self) -> &str

Get the camera vendor.

Source

fn camera_ready(&self) -> bool

Check if camera is ready.

Source

fn camera_name(&self) -> &str

Get the camera name.

Source

fn list_properties(&self) -> &HashMap<GenCamCtrl, Property>

Get optional capabilities of the camera.

Source

fn get_property(&self, name: GenCamCtrl) -> GenCamResult<(PropertyValue, bool)>

Get a property by name.

Source

fn set_property( &mut self, name: GenCamCtrl, value: &PropertyValue, auto: bool, ) -> GenCamResult<()>

Set a property by name.

Source

fn cancel_capture(&self) -> GenCamResult<()>

Cancel an ongoing exposure.

Source

fn is_capturing(&self) -> bool

Check if the camera is currently capturing an image.

Source

fn capture(&mut self) -> GenCamResult<GenericImageRef<'_>>

Capture an image. This is a blocking call.

Raises a Message with the message "Not implemented" if unimplemented.

Source

fn start_exposure(&mut self) -> GenCamResult<()>

Start an exposure and return. This function does NOT block, but may not return immediately (e.g. if the camera is busy).

Source

fn download_image(&mut self) -> GenCamResult<GenericImageRef<'_>>

Download the image captured in GenCam::start_exposure.

Source

fn image_ready(&self) -> GenCamResult<bool>

Get exposure status. This function is useful for checking if a non-blocking exposure has finished running.

Source

fn camera_state(&self) -> GenCamResult<GenCamState>

Get the camera state.

Source

fn set_roi(&mut self, roi: &GenCamRoi) -> GenCamResult<&GenCamRoi>

Set the image region of interest (ROI).

§Arguments
  • roi - The region of interest.

Note:

  • The region of interest is defined in the binned pixel space.
  • Setting all values to 0 will set the ROI to the full detector size.
§Returns

The region of interest that was set, or error.

Source

fn get_roi(&self) -> &GenCamRoi

Get the region of interest.

§Returns
  • The region of interest.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl GenCam for GenCamDummy

Available on crate feature dummy only.