Trait generic_camera::GenCam

source ·
pub trait GenCam: Send + Debug {
Show 20 methods // Required methods fn info_handle(&self) -> Option<AnyGenCamInfo>; fn vendor(&self) -> &str; fn camera_ready(&self) -> bool; fn camera_name(&self) -> &str; fn list_properties(&self) -> Vec<Property>; fn get_property(&self, name: GenCamCtrl) -> Option<&PropertyValue>; fn set_property( &mut self, name: GenCamCtrl, value: &PropertyValue, ) -> Result<()>; fn get_property_auto(&self, name: GenCamCtrl) -> Result<bool>; fn set_property_auto(&mut self, name: GenCamCtrl, auto: bool) -> Result<()>; fn cancel_capture(&self) -> Result<()>; fn is_capturing(&self) -> bool; fn capture(&self) -> Result<GenericImage<'_>>; fn start_exposure(&self) -> Result<()>; fn download_image(&self) -> Result<GenericImage<'_>>; fn image_ready(&self) -> Result<bool>; fn camera_state(&self) -> Result<GenCamState>; fn get_exposure(&self) -> Result<Duration>; fn set_exposure(&mut self, exposure: Duration) -> Result<Duration>; fn set_roi(&mut self, roi: &GenCamRoi) -> Result<&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 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) -> Vec<Property>

Get optional capabilities of the camera.

source

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

Get a property by name.

source

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

Set a property by name.

source

fn get_property_auto(&self, name: GenCamCtrl) -> Result<bool>

Check if a property is in auto mode.

source

fn set_property_auto(&mut self, name: GenCamCtrl, auto: bool) -> Result<()>

Set a property to auto mode.

source

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

Cancel an ongoing exposure.

source

fn is_capturing(&self) -> bool

Check if the camera is currently capturing an image.

source

fn capture(&self) -> Result<GenericImage<'_>>

Capture an image. This is a blocking call.

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

source

fn start_exposure(&self) -> Result<()>

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(&self) -> Result<GenericImage<'_>>

Download the image captured in GenCam::start_exposure.

source

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

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

source

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

Get the camera state.

source

fn get_exposure(&self) -> Result<Duration>

Get camera exposure.

source

fn set_exposure(&mut self, exposure: Duration) -> Result<Duration>

Set camera exposure.

source

fn set_roi(&mut self, roi: &GenCamRoi) -> Result<&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§