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§
sourcefn info_handle(&self) -> Option<AnyGenCamInfo>
fn info_handle(&self) -> Option<AnyGenCamInfo>
Get the GenCamInfo
object, if available.
sourcefn info(&self) -> GenCamResult<&GenCamDescriptor>
fn info(&self) -> GenCamResult<&GenCamDescriptor>
Get the camera descriptor.
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) -> &HashMap<GenCamCtrl, Property>
fn list_properties(&self) -> &HashMap<GenCamCtrl, Property>
Get optional capabilities of the camera.
sourcefn get_property(&self, name: GenCamCtrl) -> GenCamResult<(PropertyValue, bool)>
fn get_property(&self, name: GenCamCtrl) -> GenCamResult<(PropertyValue, bool)>
Get a property by name.
sourcefn set_property(
&mut self,
name: GenCamCtrl,
value: &PropertyValue,
auto: bool,
) -> GenCamResult<()>
fn set_property( &mut self, name: GenCamCtrl, value: &PropertyValue, auto: bool, ) -> GenCamResult<()>
Set a property by name.
sourcefn cancel_capture(&self) -> GenCamResult<()>
fn cancel_capture(&self) -> GenCamResult<()>
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(&mut self) -> GenCamResult<GenericImageRef<'_>>
fn capture(&mut self) -> GenCamResult<GenericImageRef<'_>>
Capture an image. This is a blocking call.
Raises a Message
with the message "Not implemented"
if unimplemented.
sourcefn start_exposure(&mut self) -> GenCamResult<()>
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).
sourcefn download_image(&mut self) -> GenCamResult<GenericImageRef<'_>>
fn download_image(&mut self) -> GenCamResult<GenericImageRef<'_>>
Download the image captured in GenCam::start_exposure
.
sourcefn image_ready(&self) -> GenCamResult<bool>
fn image_ready(&self) -> GenCamResult<bool>
Get exposure status. This function is useful for checking if a non-blocking exposure has finished running.
sourcefn camera_state(&self) -> GenCamResult<GenCamState>
fn camera_state(&self) -> GenCamResult<GenCamState>
Get the camera state.
sourcefn set_roi(&mut self, roi: &GenCamRoi) -> GenCamResult<&GenCamRoi>
fn set_roi(&mut self, roi: &GenCamRoi) -> GenCamResult<&GenCamRoi>
Implementors§
impl GenCam for GenCamDummy
dummy
only.