pub struct AcquisitionBuffer { /* private fields */ }
Expand description
Buffer that is used by the camera to transfer images to the host system.
The AcquisitionBuffer is the primary way to communicate with the camera while it is actively acquiring images. It is generated when the image acquisition is started and destroyed when the image acquisition is stopped.
Important difference to the C/C++ xiAPI: The AcquisitionBuffer temporarily consumes the Camera during acquisition, to prevent any interactions that may change parameters that are fixed while the image acquisition is running. Trying to change an parameter that is not changeable during acquisition is therefore an error at compile time (as opposed to runtime in C/C++).
Implementations§
Source§impl AcquisitionBuffer
impl AcquisitionBuffer
Sourcepub fn stop_acquisition(self) -> Result<Camera, XI_RETURN>
pub fn stop_acquisition(self) -> Result<Camera, XI_RETURN>
Stop the image acquisition.
This function consumes the acquisition buffer and returns the contained camera. All resources acquired when creating this AcquisitionBuffer using Camera::start_acquisition() will be freed again.
When this is called, the camera will stop acquiring images and images previously acquired but not retrieved from the acquisition buffer can no longer be accessed.
Sourcepub fn next_image<'a, T>(
&'a self,
timeout: Option<u32>,
) -> Result<Image<'a, T>, XI_RETURN>
pub fn next_image<'a, T>( &'a self, timeout: Option<u32>, ) -> Result<Image<'a, T>, XI_RETURN>
Get the next image.
Returns an Image which refers to memory in this AcquisitionBuffer. The image will have a reference with the same lifetime as the AcquisitionBuffer making sure that it is always “safe” to use (However, it may still be overwritten in unsafe buffer mode).
Sourcepub fn software_trigger(&mut self) -> Result<(), XI_RETURN>
pub fn software_trigger(&mut self) -> Result<(), XI_RETURN>
Send a software trigger signal to the camera.
Trigger source has to be set to XI_TRG_SOFTWARE for this to take effect
§Examples
let mut cam = xiapi::open_device(None)?;
cam.set_trg_source(xiapi_sys::XI_TRG_SOURCE::XI_TRG_SOFTWARE)?;
let mut acq_buffer = cam.start_acquisition()?;
acq_buffer.software_trigger()?;
let img = acq_buffer.next_image::<u8>(None)?;
Trait Implementations§
impl Send for AcquisitionBuffer
Auto Trait Implementations§
impl Freeze for AcquisitionBuffer
impl RefUnwindSafe for AcquisitionBuffer
impl !Sync for AcquisitionBuffer
impl Unpin for AcquisitionBuffer
impl UnwindSafe for AcquisitionBuffer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more