Trait cameraunit::CameraUnit
source · pub trait CameraUnit: CameraInfo {
Show 29 methods
// Required methods
fn get_vendor(&self) -> &str;
fn capture_image(&self) -> Result<DynamicSerialImage, Error>;
fn start_exposure(&self) -> Result<(), Error>;
fn download_image(&self) -> Result<DynamicSerialImage, Error>;
fn image_ready(&self) -> Result<bool, Error>;
fn set_exposure(&mut self, _exposure: Duration) -> Result<Duration, Error>;
fn get_exposure(&self) -> Duration;
fn set_roi(&mut self, roi: &ROI) -> Result<&ROI, Error>;
fn set_bpp(&mut self, bpp: PixelBpp) -> Result<PixelBpp, Error>;
fn get_bpp(&self) -> PixelBpp;
fn get_roi(&self) -> &ROI;
// Provided methods
fn get_handle(&self) -> Option<&dyn Any> { ... }
fn get_gain(&self) -> f32 { ... }
fn get_gain_raw(&self) -> i64 { ... }
fn set_gain(&mut self, _gain: f32) -> Result<f32, Error> { ... }
fn set_gain_raw(&mut self, _gain: i64) -> Result<i64, Error> { ... }
fn get_offset(&self) -> i32 { ... }
fn set_offset(&mut self, _offset: i32) -> Result<i32, Error> { ... }
fn get_min_exposure(&self) -> Result<Duration, Error> { ... }
fn get_max_exposure(&self) -> Result<Duration, Error> { ... }
fn get_min_gain(&self) -> Result<i64, Error> { ... }
fn get_max_gain(&self) -> Result<i64, Error> { ... }
fn set_shutter_open(&mut self, _open: bool) -> Result<bool, Error> { ... }
fn get_shutter_open(&self) -> Result<bool, Error> { ... }
fn set_flip(&mut self, _x: bool, _y: bool) -> Result<(), Error> { ... }
fn get_flip(&self) -> (bool, bool) { ... }
fn get_bin_x(&self) -> u32 { ... }
fn get_bin_y(&self) -> u32 { ... }
fn get_status(&self) -> String { ... }
}
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 get_vendor(&self) -> &str
fn get_vendor(&self) -> &str
Get the camera vendor.
sourcefn capture_image(&self) -> Result<DynamicSerialImage, Error>
fn capture_image(&self) -> Result<DynamicSerialImage, Error>
Capture an image.
Raises a Message
with the message "Not implemented"
if unimplemented.
sourcefn start_exposure(&self) -> Result<(), Error>
fn start_exposure(&self) -> Result<(), Error>
Start an exposure and return. This function does NOT block.
sourcefn download_image(&self) -> Result<DynamicSerialImage, Error>
fn download_image(&self) -> Result<DynamicSerialImage, Error>
Download the image captured in CameraUnit::start_exposure
.
sourcefn image_ready(&self) -> Result<bool, Error>
fn image_ready(&self) -> Result<bool, Error>
Get exposure status. This function is useful for checking if a non-blocking exposure has finished running.
sourcefn get_exposure(&self) -> Duration
fn get_exposure(&self) -> Duration
Provided Methods§
sourcefn get_handle(&self) -> Option<&dyn Any>
fn get_handle(&self) -> Option<&dyn Any>
Get a handle to the internal camera. This is intended to be used for development purposes, as (presumably FFI and unsafe) internal calls are abstracted away from the user.
Defaults to None
if unimplemented.
sourcefn get_gain(&self) -> f32
fn get_gain(&self) -> f32
Get the current gain (in percentage units).
Defaults to 0.0
if unimplemented.
sourcefn get_gain_raw(&self) -> i64
fn get_gain_raw(&self) -> i64
Get the current gain (in raw values).
Defaults to 0
if unimplemented.
sourcefn set_gain(&mut self, _gain: f32) -> Result<f32, Error>
fn set_gain(&mut self, _gain: f32) -> Result<f32, Error>
Set the gain (in percentage units).
Raises a Message
with the message "Not implemented"
if unimplemented.
sourcefn set_gain_raw(&mut self, _gain: i64) -> Result<i64, Error>
fn set_gain_raw(&mut self, _gain: i64) -> Result<i64, Error>
Set the gain (in raw values).
Raises a Message
with the message "Not implemented"
if unimplemented.
sourcefn get_offset(&self) -> i32
fn get_offset(&self) -> i32
Get the current pixel offset.
Defaults to 0
if unimplemented.
sourcefn set_offset(&mut self, _offset: i32) -> Result<i32, Error>
fn set_offset(&mut self, _offset: i32) -> Result<i32, Error>
Set the pixel offset.
Raises a GeneralError
with the message "Not implemented"
if unimplemented.
sourcefn get_min_exposure(&self) -> Result<Duration, Error>
fn get_min_exposure(&self) -> Result<Duration, Error>
Get the minimum exposure time.
Raises a Message
with the message "Not implemented"
if unimplemented.
sourcefn get_max_exposure(&self) -> Result<Duration, Error>
fn get_max_exposure(&self) -> Result<Duration, Error>
Get the maximum exposure time.
Raises a Message
with the message "Not implemented"
if unimplemented.
sourcefn get_min_gain(&self) -> Result<i64, Error>
fn get_min_gain(&self) -> Result<i64, Error>
Get the minimum gain (in raw units).
Raises a Message
with the message "Not implemented"
if unimplemented.
sourcefn get_max_gain(&self) -> Result<i64, Error>
fn get_max_gain(&self) -> Result<i64, Error>
Get the maximum gain (in raw units).
Raises a Message
with the message "Not implemented"
if unimplemented.
sourcefn set_shutter_open(&mut self, _open: bool) -> Result<bool, Error>
fn set_shutter_open(&mut self, _open: bool) -> Result<bool, Error>
Set the shutter to open (always/when exposing).
Raises a Message
with the message "Not implemented"
if unimplemented.
sourcefn get_shutter_open(&self) -> Result<bool, Error>
fn get_shutter_open(&self) -> Result<bool, Error>
Get the shutter state.
Raises a Message
with the message "Not implemented"
if unimplemented.
sourcefn set_flip(&mut self, _x: bool, _y: bool) -> Result<(), Error>
fn set_flip(&mut self, _x: bool, _y: bool) -> Result<(), Error>
Flip the image along X and/or Y axes.
Raises a Message
with the message "Not implemented"
if unimplemented.
sourcefn get_flip(&self) -> (bool, bool)
fn get_flip(&self) -> (bool, bool)
Check if the image is flipped along X and/or Y axes.
Defaults to (false, false)
if unimplemented.
sourcefn get_status(&self) -> String
fn get_status(&self) -> String
Get the current operational status of the camera.
Defaults to "Not implemented"
if unimplemented.