Camera

Struct Camera 

Source
pub struct Camera<T: RegisterIo> { /* private fields */ }
Expand description

Camera facade combining a nodemap with a transport implementing RegisterIo.

Implementations§

Source§

impl<T: RegisterIo> Camera<T>

Source

pub fn new(transport: T, nodemap: NodeMap) -> Self

Create a new camera wrapper from a transport and a nodemap.

Source

pub fn transport(&self) -> &T

Return a reference to the underlying transport.

Source

pub fn transport_mut(&mut self) -> &mut T

Return a mutable reference to the underlying transport.

Source

pub fn nodemap(&self) -> &NodeMap

Access the nodemap metadata.

Source

pub fn nodemap_mut(&mut self) -> &mut NodeMap

Mutable access to the nodemap.

Source

pub fn enum_entries(&self, name: &str) -> Result<Vec<String>, GenicamError>

List available entries for an enumeration feature.

Source

pub fn get(&self, name: &str) -> Result<String, GenicamError>

Retrieve a feature value as a string using the nodemap type to format it.

Source

pub fn set(&mut self, name: &str, value: &str) -> Result<(), GenicamError>

Set a feature value using a string representation.

Source

pub fn set_exposure_time_us(&mut self, value: f64) -> Result<(), GenicamError>

Convenience wrapper for exposure time features expressed in microseconds.

Source

pub fn set_gain_db(&mut self, value: f64) -> Result<(), GenicamError>

Convenience wrapper for gain features expressed in decibel.

Source

pub async fn time_calibrate( &mut self, samples: usize, interval_ms: u64, ) -> Result<(), GenicamError>

Capture device/host timestamp pairs and fit a mapping model.

Source

pub fn map_dev_ts(&self, dev_ticks: u64) -> SystemTime

Map device tick counters to host time using the fitted model.

Source

pub fn time_sync(&self) -> &TimeSync

Inspect the timestamp synchroniser state.

Source

pub fn time_reset(&mut self) -> Result<(), GenicamError>

Reset the device timestamp counter when supported by the camera.

Source

pub fn acquisition_start(&mut self) -> Result<(), GenicamError>

Trigger acquisition start via the SFNC command feature.

Source

pub fn acquisition_stop(&mut self) -> Result<(), GenicamError>

Trigger acquisition stop via the SFNC command feature.

Source

pub fn configure_chunks( &mut self, cfg: &ChunkConfig, ) -> Result<(), GenicamError>

Configure chunk mode and enable the requested selectors.

Source

pub async fn configure_events( &mut self, local_ip: Ipv4Addr, port: u16, enable_ids: &[&str], ) -> Result<(), GenicamError>

Configure the GVCP message channel and enable delivery of the requested events.

Source

pub fn configure_stream_multicast( &mut self, stream_idx: u32, group: Ipv4Addr, port: u16, ) -> Result<(), GenicamError>

Configure the stream channel for multicast delivery.

Source

pub async fn open_event_stream( &self, local_ip: Ipv4Addr, port: u16, ) -> Result<EventStream, GenicamError>

Open a GVCP event stream bound to the provided local endpoint.

Trait Implementations§

Source§

impl<T: Debug + RegisterIo> Debug for Camera<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<T> !Freeze for Camera<T>

§

impl<T> !RefUnwindSafe for Camera<T>

§

impl<T> Send for Camera<T>
where T: Send,

§

impl<T> !Sync for Camera<T>

§

impl<T> Unpin for Camera<T>
where T: Unpin,

§

impl<T> UnwindSafe for Camera<T>
where T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more