Impact Acquire SDK .NET
RequestProvider Class Reference

A helper class that can be used to create a simple continuous acquisition from a device. More...

Public Member Functions

void acquisitionStart ()
 Starts a new continuous acquisition from the mv.impact.acquire.Device associated with this mv.impact.acquire.helper.RequestProvider.
 
void acquisitionStop ()
 Stops a continuous acquisition from the mv.impact.acquire.Device associated with this mv.impact.acquire.helper.RequestProvider.
 
 RequestProvider (Device device)
 Creates a new mv.impact.acquire.helper.RequestProvider instance.
 

Protected Member Functions

virtual IRequestBuffer createBuffer (int size, int alignment)
 Creates a new mv.impact.acquire.helper.IRequestBuffer instance to capture data into.
 

Properties

Device device [get]
 A reference to the mv.impact.acquire.Device associated with this mv.impact.acquire.helper.RequestProvider.
 

Events

RequestReadyEventHandler onRequestReady
 An event handler for events which are sent to all listeners each time a new mv.impact.acquire.Request became ready.
 

Detailed Description

A helper class that can be used to create a simple continuous acquisition from a device.

This class can be used to create a very simple continuous stream of images. Each time a mv.impact.acquire.Request becomes ready an event with an instance of mv.impact.acquire.helper.RequestReadyEventArgs will be raised.

Attention
To use this class it is crucial to understand that
When using this class an application must NOT call mv.impact.acquire.Request.unlock manually!

See ContinuousCaptureSimple.cs or mv.impact.acquire.helper.RequestReadyEventArgs for an example how to use this class.

Since
2.4.0
Examples
ContinuousCaptureSimple.cs.

Constructor & Destructor Documentation

◆ RequestProvider()

RequestProvider ( Device device)
inline

Creates a new mv.impact.acquire.helper.RequestProvider instance.

Parameters
[in]deviceA pointer to a mv.impact.acquire.Device object obtained from a mv.impact.acquire.DeviceManager object.

Member Function Documentation

◆ acquisitionStart()

void acquisitionStart ( )
inline

Starts a new continuous acquisition from the mv.impact.acquire.Device associated with this mv.impact.acquire.helper.RequestProvider.

Once this function has been called data will be captured continuously from the mv.impact.acquire.Device associated with this mv.impact.acquire.helper.RequestProvider. Each time a request is reported as being ready a new mv.impact.acquire.helper.RequestReadyEventArgs event is generated an forwarded to all listeners that have themselves registered to the mv.impact.acquire.helper.RequestProvider.onRequestReady event handler.

Examples
ContinuousCaptureSimple.cs.

◆ acquisitionStop()

void acquisitionStop ( )
inline

Stops a continuous acquisition from the mv.impact.acquire.Device associated with this mv.impact.acquire.helper.RequestProvider.

After stopping the continuous acquisition no mv.impact.acquire.helper.RequestReadyEventArgs events will be generated anymore.

Examples
ContinuousCaptureSimple.cs.

◆ createBuffer()

virtual IRequestBuffer createBuffer ( int size,
int alignment )
inlineprotectedvirtual

Creates a new mv.impact.acquire.helper.IRequestBuffer instance to capture data into.

This function can be overwritten to install a custom buffer allocator. The default implementation will create instances of mv.impact.acquire.helper.UserSuppliedHeapBuffer.

Attention
When overwriting this method be sure what you are doing. Memory that has been allocated by this function might end up in kernel space thus this memory must be pinned and should not be touched by the garbage collector! Also be sure you have an understanding about the concept of buffer alignment.
Returns
A new mv.impact.acquire.helper.IRequestBuffer instance.
Parameters
[in]sizeThe size of the user buffer to allocate in bytes.
[in]alignmentThe alignment of the user buffer in bits.

Property Documentation

◆ device

Device device
get

A reference to the mv.impact.acquire.Device associated with this mv.impact.acquire.helper.RequestProvider.

Note
While a continuous acquisition is running the device must NOT be closed.

Event Documentation

◆ onRequestReady

RequestReadyEventHandler onRequestReady

An event handler for events which are sent to all listeners each time a new mv.impact.acquire.Request became ready.

This event handler will fire mv.impact.acquire.helper.RequestReadyEventArgs events whenever a mv.impact.acquire.Request is reported as being ready by the device driver.