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§
sourcefn info_handle(&self) -> Option<AnyGenCamInfo>
fn info_handle(&self) -> Option<AnyGenCamInfo>
Get the GenCamInfo object, if available.
sourcefn camera_ready(&self) -> bool
fn camera_ready(&self) -> bool
Check if camera is ready.
sourcefn camera_name(&self) -> &str
fn camera_name(&self) -> &str
Get the camera name.
sourcefn list_properties(&self) -> Vec<Property>
fn list_properties(&self) -> Vec<Property>
Get optional capabilities of the camera.
sourcefn get_property(&self, name: GenCamCtrl) -> Option<&PropertyValue>
fn get_property(&self, name: GenCamCtrl) -> Option<&PropertyValue>
Get a property by name.
sourcefn set_property(
&mut self,
name: GenCamCtrl,
value: &PropertyValue,
) -> Result<()>
fn set_property( &mut self, name: GenCamCtrl, value: &PropertyValue, ) -> Result<()>
Set a property by name.
sourcefn get_property_auto(&self, name: GenCamCtrl) -> Result<bool>
fn get_property_auto(&self, name: GenCamCtrl) -> Result<bool>
Check if a property is in auto mode.
sourcefn set_property_auto(&mut self, name: GenCamCtrl, auto: bool) -> Result<()>
fn set_property_auto(&mut self, name: GenCamCtrl, auto: bool) -> Result<()>
Set a property to auto mode.
sourcefn cancel_capture(&self) -> Result<()>
fn cancel_capture(&self) -> Result<()>
Cancel an ongoing exposure.
sourcefn is_capturing(&self) -> bool
fn is_capturing(&self) -> bool
Check if the camera is currently capturing an image.
sourcefn capture(&self) -> Result<GenericImage<'_>>
fn capture(&self) -> Result<GenericImage<'_>>
Capture an image. This is a blocking call.
Raises a Message with the message "Not implemented" if unimplemented.
sourcefn start_exposure(&self) -> Result<()>
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).
sourcefn download_image(&self) -> Result<GenericImage<'_>>
fn download_image(&self) -> Result<GenericImage<'_>>
Download the image captured in GenCam::start_exposure.
sourcefn image_ready(&self) -> Result<bool>
fn image_ready(&self) -> Result<bool>
Get exposure status. This function is useful for checking if a non-blocking exposure has finished running.
sourcefn camera_state(&self) -> Result<GenCamState>
fn camera_state(&self) -> Result<GenCamState>
Get the camera state.
sourcefn get_exposure(&self) -> Result<Duration>
fn get_exposure(&self) -> Result<Duration>
Get camera exposure.
sourcefn set_exposure(&mut self, exposure: Duration) -> Result<Duration>
fn set_exposure(&mut self, exposure: Duration) -> Result<Duration>
Set camera exposure.