Public Member Functions | Public Attributes | List of all members
CVCaptureComponentInstance Class Reference

#include <cvcapturecomponent.h>

Public Member Functions

 CVCaptureComponentInstance (EntityInstance &entity, Component &resource)
virtual ~CVCaptureComponentInstance ()
virtual bool init (utility::ErrorState &errorState) override
Signal< const CVFrameEvent & > * getFrameReceived ()
const CVCaptureDevicegetDevice () const
CVCaptureDevicegetDevice ()
- Public Member Functions inherited from ComponentInstance
 ComponentInstance (EntityInstance &entity, Component &resource)
virtual void update (double deltaTime)
nap::EntityInstancegetEntityInstance () const
nap::ComponentgetComponent () const
template<typename T >
T * getComponent () const
- Public Member Functions inherited from Object
 Object ()
virtual ~Object ()
virtual void onDestroy ()
 Object (Object &)=delete
Objectoperator= (const Object &)=delete
 Object (Object &&)=delete
Objectoperator= (Object &&)=delete

Public Attributes

Signal< const CVFrameEvent & > frameReceived
 Triggered when the component receives a new opencv frame. More...
- Public Attributes inherited from Object
std::string mID
 Property: 'mID' unique name of the object. Used as an identifier by the system. More...

Additional Inherited Members

- Static Public Member Functions inherited from Object
static bool isIDProperty (rtti::Instance &object, const rtti::Property &property)


Receives frame updates from a nap::CVCaptureDevice on the main application thread. The actual capture operation is handled by the nap::CVCaptureDevice on a background thread. Register to the 'frameReceived' signal to receive frame updates on the main processing thread.

Note that the frame that is forwarded to potential listeners is a reference. Do not modify the content of the frame! Changes will be forwarded to other listeners. To get an actual copy of the content of the frame call FrameEvent::clone(). Do this before performing any operation on the frame itself.

Inheritance diagram for CVCaptureComponentInstance:
Collaboration diagram for CVCaptureComponentInstance:

Constructor & Destructor Documentation

◆ CVCaptureComponentInstance()

CVCaptureComponentInstance ( EntityInstance entity,
Component resource 
entitythe entity this component belongs to.
resourcethe resource this instance was created from.

◆ ~CVCaptureComponentInstance()

virtual ~CVCaptureComponentInstance ( )

Member Function Documentation

◆ getDevice() [1/2]

CVCaptureDevice& getDevice ( )
the capture device this component receives frames from

◆ getDevice() [2/2]

const CVCaptureDevice& getDevice ( ) const
the capture device this component receives frames from

◆ getFrameReceived()

Signal<const CVFrameEvent&>* getFrameReceived ( )

Returns the signal that is called when a new frame is received.

the frame received signal.

◆ init()

virtual bool init ( utility::ErrorState errorState)

Initializes the capture component instance.

Reimplemented from ComponentInstance.

Member Data Documentation

◆ frameReceived

Signal<const CVFrameEvent&> frameReceived

Triggered when the component receives a new opencv frame.