CVB.Net 14.0
IAcquisition Interface Reference

Interface for all streaming devices More...

Inherits IDeviceInterface.

Inherited by Stream.

Public Member Functions

StreamImage GetSnapshot ()
 Acquires a single image and returns it. More...
 
StreamImage GetTimedSnapshot (UsTimeSpan timeSpan)
 Acquires a single image and returns it. More...
 
StreamImage GetTimedSnapshot (UsTimeSpan timeSpan, out WaitStatus status)
 Acquires a single image and returns it. More...
 
void Start ()
 Starts the acquisition of images.
 
StreamImage Wait ()
 Waits infinitely for the next acquired image and returns it. More...
 
StreamImage Wait (out WaitStatus status)
 Waits infinitely for the next acquired image and returns it. More...
 
StreamImage WaitFor (UsTimeSpan timeSpan)
 Waits for the given timeSpan for the next acquired image. More...
 
StreamImage WaitFor (UsTimeSpan timeSpan, out WaitStatus status)
 Waits for the given timeSpan for the next acquired image. More...
 
void Stop ()
 Stops the acquisition of images. More...
 
bool TryStop ()
 Tries to stop the acquisition of images. More...
 
void Abort ()
 Stops the acquisition of images immediately. More...
 
bool TryAbort ()
 Tries to stop the acquisition of images immediately. More...
 

Properties

bool IsRunning [get]
 Gets whether the acquisition is currently active. More...
 
- Properties inherited from IDeviceInterface
Device Parent [get]
 The Device this interface works on.
 

Detailed Description

Interface for all streaming devices

Member Function Documentation

◆ Abort()

void Abort ( )

Stops the acquisition of images immediately.

This stops the acquisition as fast as possible interrupting the ongoing operation. This might result in partially acquired images and either the OperationCanceledException being thrown or WaitStatus.Abort being signaled by the aborted method.

If the underlying driver does not support this, this call behaves as if Stop had been called.

Implemented in Stream.

◆ GetSnapshot()

StreamImage GetSnapshot ( )

Acquires a single image and returns it.

Waits infinitely for the image to be taken.

Attention: it is generally not possible to call this method while the acquisition has been started by Start.

Dispose the returned Image when not needed anymore!

By default the returned image content is only guaranteed to stay unchanged until the next call to this method; afterwards the returned image is normally disposed. Thus it is normally not save to use this image in a display.

Returns
Grabbed image.

Implemented in Stream.

◆ GetTimedSnapshot() [1/2]

StreamImage GetTimedSnapshot ( UsTimeSpan  timeSpan)

Acquires a single image and returns it.

Waits for the given timeSpan for the image to be taken.

Attention: it is generally not possible to call this method while the acquisition has been started by Start.

Dispose the returned Image when not needed anymore!

By default the returned image content is only guaranteed to stay unchanged until the next call to this method; afterwards the returned image is normally disposed. Thus it is normally not save to use this image in a display.

Parameters
timeSpanTime span to wait for (millisecond granularity).
Returns
Grabbed image.
Exceptions
System.TimeoutExceptionMost common exception: timeSpan elapsed without receiving new image.

Implemented in Stream.

◆ GetTimedSnapshot() [2/2]

StreamImage GetTimedSnapshot ( UsTimeSpan  timeSpan,
out WaitStatus  status 
)

Acquires a single image and returns it.

Waits for the given timeSpan for the image to be taken.

Attention: it is generally not possible to call this method while the acquisition has been started by Start.

Dispose the returned Image when not needed anymore!

By default the returned image content is only guaranteed to stay unchanged until the next call to this method; afterwards the returned image is normally disposed. Thus it is normally not save to use this image in a display.

This method does not throw an exception when timeSpan is exceeded; it will report this in the status with WaitStatus.Timeout. Other exceptions still might get thrown on error conditions.

Parameters
timeSpanTime span to wait for (millisecond granularity).
statusVariable to receive the status of this operation.
Returns
Grabbed image.

Implemented in Stream.

◆ Stop()

void Stop ( )

Stops the acquisition of images.

This stops the acquisition gracefully letting the ongoing operation finish. The drawback of this might be that this call may take indefinite time if Wait() is used and no images are sent by the device.

Implemented in Stream.

◆ TryAbort()

bool TryAbort ( )

Tries to stop the acquisition of images immediately.

Like Abort it stops as fast as possible with the same implications. This variant does not throw exceptions exception ObjectDisposedExceptions.

Returns
true on success; false on error.

Implemented in Stream.

◆ TryStop()

bool TryStop ( )

Tries to stop the acquisition of images.

Like Stop it tries to halt gracefully with the same implications. This variant does not throw exceptions exception ObjectDisposedExceptions.

Returns
true on success; false on error.

Implemented in Stream.

◆ Wait() [1/2]

StreamImage Wait ( )

Waits infinitely for the next acquired image and returns it.

Attention: it is generally not safe to call the wait method from different threads on the same object!

Dispose the returned Image when not needed anymore!

By default the returned image content is only guaranteed to stay unchanged until the next call to this method; afterwards the returned image is normally disposed. Thus it is normally not save to use this image in a display.

The returned image is not necessary the newest. If more images where acquired since the last call to this method, the content is the oldest not collected image buffer by default.

Returns
Grabbed image.
Exceptions
OperationCanceledExceptionAbort was called while waiting.

Implemented in Stream.

◆ Wait() [2/2]

StreamImage Wait ( out WaitStatus  status)

Waits infinitely for the next acquired image and returns it.

Attention: it is generally not safe to call the wait method from different threads on the same object!

Dispose the returned Image when not needed anymore!

By default the returned image content is only guaranteed to stay unchanged until the next call to this method; afterwards the returned image is normally disposed. Thus it is normally not save to use this image in a display.

The returned image is not necessary the newest. If more images where acquired since the last call to this method, the content is the oldest not collected image buffer by default.

This method does not throw an exception when the operation was Aborted; it will report this in the status with WaitStatus.Abort. Other exceptions still might get thrown on error conditions.

Parameters
statusVariable to receive the status of this operation.
Returns
Grabbed image.

Implemented in Stream.

◆ WaitFor() [1/2]

StreamImage WaitFor ( UsTimeSpan  timeSpan)

Waits for the given timeSpan for the next acquired image.

Attention: it is generally not safe to call the wait method from different threads on the same object!

Dispose the returned Image when not needed anymore!

By default the returned image content is only guaranteed to stay unchanged until the next call to this method; afterwards the returned image is normally disposed. Thus it is normally not save to use this image in a display.

The returned image is not necessary the newest. If more images where acquired since the last call to this method, the content is the oldest not collected image buffer by default.

Parameters
timeSpanTime span to wait for (millisecond granularity).
Returns
Grabbed image.
Exceptions
TimeoutExceptionMost common exception: timeSpan elapsed without receiving new image.
OperationCanceledExceptionAbort was called while waiting.

Implemented in Stream.

◆ WaitFor() [2/2]

StreamImage WaitFor ( UsTimeSpan  timeSpan,
out WaitStatus  status 
)

Waits for the given timeSpan for the next acquired image.

Attention: it is generally not safe to call the wait method from different threads on the same object!

Dispose the returned Image when not needed anymore!

By default the returned image content is only guaranteed to stay unchanged until the next call to this method; afterwards the returned image is normally disposed. Thus it is normally not save to use this image in a display.

The returned image is not necessary the newest. If more images where acquired since the last call to this method, the content is the oldest not collected image buffer by default.

This method does not throw an exception when the operation was Aborted or did time out; it will report this in the status with WaitStatus.Abort and WaitStatus.Timeout respectively. Other exceptions still might get thrown on error conditions.

Parameters
timeSpanTime span to wait for (millisecond granularity).
statusVariable to receive the status of this operation.
Returns
Grabbed image.

Implemented in Stream.

Property Documentation

◆ IsRunning

bool IsRunning
get

Gets whether the acquisition is currently active.

true if the underlying device is acquiring data; false if it is idle.

Implemented in Stream.