generic_camera

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.

Implementors§

source§

impl GenCam for GenCamDummy

Available on crate feature dummy only.