Nuitrack  1.11.2
3D Skeleton Tracking Middleware
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Properties Events Groups Pages
tdv::nuitrack::ColorSensor Class Reference

Represents the interface to the capabilities of the Nuitrack Color Sensor module. More...

#include <ColorSensor.h>

Inherits HeaderOnlyAPI_Module.

Public Types

typedef std::shared_ptr
< ColorSensor
Ptr
 Smart pointer to access the ColorSensor instance. More...
 
typedef std::function< void(RGBFrame::Ptr)> OnNewFrame
 The callback type of the new color frame request. More...
 

Public Member Functions

 ColorSensor (NuitrackModule *pimpl)
 
const OutputMode getOutputMode () const
 Returns output mode of color sensor.
 
uint64_t connectOnNewFrame (const OnNewFrame &callback)
 Add a callback for the new color frame request. More...
 
void disconnectOnNewFrame (uint64_t handler)
 Remove a callback of the new color frame request. More...
 
RGBFrame::Ptr getColorFrame ()
 Returns smart pointer to the last available RGBFrame.
 
bool canUpdate () const
 
virtual uint64_t getTimestamp ()
 Returns the last processed data timestamp in microseconds. More...
 

Static Public Member Functions

static ColorSensor::Ptr create ()
 Create the ColorSensor module object. More...
 

Detailed Description

Represents the interface to the capabilities of the Nuitrack Color Sensor module.

To enable the module, you must create an instance of this class. To create the instance, use a special named constructor ColorSensor::create. This instance is called ColorSensor module object. To receive the new color frames, add an ColorSensor::OnNewFrame callback to the module object with ColorSensor::connectOnNewFrame method.

Member Typedef Documentation

typedef std::function<void (RGBFrame::Ptr)> tdv::nuitrack::ColorSensor::OnNewFrame

The callback type of the new color frame request.

See Also
tdv::nuitrack::RGBFrame
connectOnNewFrame
typedef std::shared_ptr<ColorSensor> tdv::nuitrack::ColorSensor::Ptr

Smart pointer to access the ColorSensor instance.

See Also
create

Constructor & Destructor Documentation

tdv::nuitrack::ColorSensor::ColorSensor ( NuitrackModule *  pimpl)
inline
Warning
For internal use only.

Member Function Documentation

uint64_t tdv::nuitrack::ColorSensor::connectOnNewFrame ( const OnNewFrame callback)
inline

Add a callback for the new color frame request.

Parameters
[in]callbackCallback to be invoked at the new color frame request.
Returns
Callback ID. You can use it to remove the callback.
See Also
disconnectOnNewFrame
static ColorSensor::Ptr tdv::nuitrack::ColorSensor::create ( )
inlinestatic

Create the ColorSensor module object.

Returns
Smart pointer to a new ColorSensor instance.
Note
Do not call this method twice. Instead, use the previously received ColorSensor::Ptr.
void tdv::nuitrack::ColorSensor::disconnectOnNewFrame ( uint64_t  handler)
inline

Remove a callback of the new color frame request.

Parameters
[in]handlerID of the previously added callback.
See Also
connectOnNewFrame
virtual uint64_t tdv::nuitrack::ColorSensor::getTimestamp ( )
inlinevirtual

Returns the last processed data timestamp in microseconds.

Returns timestamp corresponding to the last available color frame.

Note
The exact meaning of this value depends on the depth provider.