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. | |
Interface for all streaming devices
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.
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.
Implemented in Stream.
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.
timeSpan | Time span to wait for (millisecond granularity). |
System.TimeoutException | Most common exception: timeSpan elapsed without receiving new image. |
Implemented in Stream.
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.
timeSpan | Time span to wait for (millisecond granularity). |
status | Variable to receive the status of this operation. |
Implemented in Stream.
void Stop | ( | ) |
bool TryAbort | ( | ) |
bool TryStop | ( | ) |
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.
OperationCanceledException | Abort was called while waiting. |
Implemented in Stream.
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.
status | Variable to receive the status of this operation. |
Implemented in Stream.
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.
timeSpan | Time span to wait for (millisecond granularity). |
TimeoutException | Most common exception: timeSpan elapsed without receiving new image. |
OperationCanceledException | Abort was called while waiting. |
Implemented in Stream.
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.
timeSpan | Time span to wait for (millisecond granularity). |
status | Variable to receive the status of this operation. |
Implemented in Stream.
|
get |
Gets whether the acquisition is currently active.
true
if the underlying device is acquiring data; false
if it is idle.
Implemented in Stream.