Imaging Control 4 C++ Library 1.0.0
Loading...
Searching...
No Matches
Sink Class Referenceabstract

Abstract base class for sinks. More...

Inheritance diagram for Sink:
QueueSink SnapSink

Public Types

enum class  SinkMode { Run = c_interface::IC4_SINK_MODE_RUN , Pause = c_interface::IC4_SINK_MODE_PAUSE }
 Defines the possible sink modes. More...
 

Public Member Functions

bool setSinkMode (SinkMode mode, Error &err=Error::Default()) noexcept
 Sets the sink mode for a sink.
 
SinkMode sinkMode () const noexcept
 Gets the current sink mode of a sink.
 
bool isAttached () const noexcept
 Checks whether a sink is currently attached to a Grabber as part of a data stream.
 
virtual SinkType sinkType () const noexcept=0
 Returns the type of this sink.
 

Detailed Description

Abstract base class for sinks.

Sink objects provide programmatic access to the image data acquired from video capture devices.

There are multiple sink types available:

  • A QueueSink is recommended when a program needs to process all or most images received from the device.
  • A SnapSink can be used to capture images or short image sequences on demand.

To create a sink object, use its creation function, e.g. QueueSink::create() or SnapSink::create().

A sink is connected to a video capture device using the Grabber::streamSetup() function.

Member Enumeration Documentation

◆ SinkMode

enum class SinkMode
strong

Defines the possible sink modes.

Enumerator
Run 

The sink is operational.

Pause 

The sink is paused, immediately returning all image buffers it receives to the device to the device driver.

Member Function Documentation

◆ isAttached()

bool isAttached ( ) const
inlinenoexcept

Checks whether a sink is currently attached to a Grabber as part of a data stream.

Returns
true, if the sink is currently attached to a Grabber, otherwise false.

◆ setSinkMode()

bool setSinkMode ( SinkMode  mode,
Error err = Error::Default() 
)
inlinenoexcept

Sets the sink mode for a sink.

Parameters
[in]modeThe new sink mode
[out]errReference to an error handler. See Error Handling for details.
Returns
true on success, otherwise false.
Check the err output parameter for error code and error message.

◆ sinkMode()

SinkMode sinkMode ( ) const
inlinenoexcept

Gets the current sink mode of a sink.

Returns
The current sink mode

◆ sinkType()

virtual SinkType sinkType ( ) const
pure virtualnoexcept

Returns the type of this sink.

Returns
The type of this sink

Implemented in QueueSink, and SnapSink.