xn::ImageGenerator Class Reference
C++ Reference to Application Programmer Interface (API) » Production Nodes Functionality

`#include <XnCppWrapper.h>`

Inheritance diagram for xn::ImageGenerator:
[legend]

## Public Member Functions

| ImageGenerator (XnNodeHandle hNode=NULL)
| ImageGenerator (const NodeWrapper &other)
XnStatus | Create (Context &context, Query *pQuery=NULL, EnumerationErrors *pErrors=NULL)
void | GetMetaData (ImageMetaData &metaData) const
const XnRGB24Pixel * | GetRGB24ImageMap () const
const XnYUV422DoublePixel * | GetYUV422ImageMap () const
const XnGrayscale8Pixel * | GetGrayscale8ImageMap () const
const XnGrayscale16Pixel * | GetGrayscale16ImageMap () const
const XnUInt8 * | GetImageMap () const
XnBool | IsPixelFormatSupported (XnPixelFormat Format) const
XnStatus | SetPixelFormat (XnPixelFormat Format)
XnPixelFormat | GetPixelFormat () const
XnStatus | RegisterToPixelFormatChange (StateChangedHandler handler, void *pCookie, XnCallbackHandle &hCallback)
void | UnregisterFromPixelFormatChange (XnCallbackHandle hCallback)
Public Member Functions inherited from xn::MapGenerator
| MapGenerator (XnNodeHandle hNode=NULL)
| MapGenerator (const NodeWrapper &other)
XnUInt32 | GetSupportedMapOutputModesCount () const
XnStatus | GetSupportedMapOutputModes (XnMapOutputMode *aModes, XnUInt32 &nCount) const
XnStatus | SetMapOutputMode (const XnMapOutputMode &OutputMode)
XnStatus | GetMapOutputMode (XnMapOutputMode &OutputMode) const
XnUInt32 | GetBytesPerPixel () const
XnStatus | RegisterToMapOutputModeChange (StateChangedHandler handler, void *pCookie, XnCallbackHandle &hCallback)
void | UnregisterFromMapOutputModeChange (XnCallbackHandle hCallback)
const CroppingCapability | GetCroppingCap () const
CroppingCapability | GetCroppingCap ()
GeneralIntCapability | GetBrightnessCap ()
GeneralIntCapability | GetContrastCap ()
GeneralIntCapability | GetHueCap ()
GeneralIntCapability | GetSaturationCap ()
GeneralIntCapability | GetSharpnessCap ()
GeneralIntCapability | GetGammaCap ()
GeneralIntCapability | GetWhiteBalanceCap ()
GeneralIntCapability | GetBacklightCompensationCap ()
GeneralIntCapability | GetGainCap ()
GeneralIntCapability | GetPanCap ()
GeneralIntCapability | GetTiltCap ()
GeneralIntCapability | GetRollCap ()
GeneralIntCapability | GetZoomCap ()
GeneralIntCapability | GetExposureCap ()
GeneralIntCapability | GetIrisCap ()
GeneralIntCapability | GetFocusCap ()
GeneralIntCapability | GetLowLightCompensationCap ()
AntiFlickerCapability | GetAntiFlickerCap ()
Public Member Functions inherited from xn::Generator
| Generator (XnNodeHandle hNode=NULL)
| Generator (const NodeWrapper &other)
XnStatus | StartGenerating ()
XnBool | IsGenerating () const
XnStatus | StopGenerating ()
XnStatus | RegisterToGenerationRunningChange (StateChangedHandler handler, void *pCookie, XnCallbackHandle &hCallback)
void | UnregisterFromGenerationRunningChange (XnCallbackHandle hCallback)
XnStatus | RegisterToNewDataAvailable (StateChangedHandler handler, void *pCookie, XnCallbackHandle &hCallback)
void | UnregisterFromNewDataAvailable (XnCallbackHandle hCallback)
XnBool | IsNewDataAvailable (XnUInt64 *pnTimestamp=NULL) const
XnStatus | WaitAndUpdateData ()
XnBool | IsDataNew () const
const void * | GetData ()
XnUInt32 | GetDataSize () const
XnUInt64 | GetTimestamp () const
XnUInt32 | GetFrameID () const
const MirrorCapability | GetMirrorCap () const
MirrorCapability | GetMirrorCap ()
const AlternativeViewPointCapability | GetAlternativeViewPointCap () const
AlternativeViewPointCapability | GetAlternativeViewPointCap ()
const FrameSyncCapability | GetFrameSyncCap () const
FrameSyncCapability | GetFrameSyncCap ()
Public Member Functions inherited from xn::ProductionNode
| ProductionNode (XnNodeHandle hNode=NULL)
| ProductionNode (const NodeWrapper &other)
NodeInfo | GetInfo () const
XnStatus | AddNeededNode (ProductionNode &needed)
XnStatus | RemoveNeededNode (ProductionNode &needed)
void | GetContext (Context &context) const
Context | GetContext () const
XnBool | IsCapabilitySupported (const XnChar *strCapabilityName) const
XnStatus | SetIntProperty (const XnChar *strName, XnUInt64 nValue)
XnStatus | SetRealProperty (const XnChar *strName, XnDouble dValue)
XnStatus | SetStringProperty (const XnChar *strName, const XnChar *strValue)
XnStatus | SetGeneralProperty (const XnChar *strName, XnUInt32 nBufferSize, const void *pBuffer)
XnStatus | GetIntProperty (const XnChar *strName, XnUInt64 &nValue) const
XnStatus | GetRealProperty (const XnChar *strName, XnDouble &dValue) const
XnStatus | GetStringProperty (const XnChar *strName, XnChar *csValue, XnUInt32 nBufSize) const
XnStatus | GetGeneralProperty (const XnChar *strName, XnUInt32 nBufferSize, void *pBuffer) const
XnStatus | LockForChanges (XnLockHandle *phLock)
void | UnlockForChanges (XnLockHandle hLock)
XnStatus | LockedNodeStartChanges (XnLockHandle hLock)
void | LockedNodeEndChanges (XnLockHandle hLock)
const ErrorStateCapability | GetErrorStateCap () const
ErrorStateCapability | GetErrorStateCap ()
GeneralIntCapability | GetGeneralIntCap (const XnChar *strCapability)
Public Member Functions inherited from xn::NodeWrapper
| NodeWrapper (XnNodeHandle hNode)
| NodeWrapper (const NodeWrapper &other)
NodeWrapper & | operator= (const NodeWrapper &other)
| ~NodeWrapper ()
| operator XnNodeHandle () const
XnNodeHandle | GetHandle () const
XnBool | operator== (const NodeWrapper &other)
XnBool | operator!= (const NodeWrapper &other)
XnBool | IsValid () const
const XnChar * | GetName () const
XnStatus | AddRef ()
void | Release ()
void | SetHandle (XnNodeHandle hNode)
void | TakeOwnership (XnNodeHandle hNode)

## Detailed Description

Purpose: The ImageGenerator node generates color image maps of various formats.

Usage: Instantiate the class and create an image generator node

Data output: Image maps

Overview:

The ImageGenerator node generates color image maps of various formats, such as the RGB24 image format. Call its SetPixelFormat() method to set the image format to be generated.

The other important function here is GetMetaData(), which, as in other generator nodes, gets the image frame object, through which you can access all the properties and the actual data of the saved frame.

## Constructor & Destructor Documentation

## ImageGenerator() [1/2]

xn::ImageGenerator::ImageGenerator | ( | XnNodeHandle | hNode = NULL | ) |

inline

Ctor

Parameters

  [in] | hNode | Node handle

## ImageGenerator() [2/2]

xn::ImageGenerator::ImageGenerator | ( | const NodeWrapper & | other | ) |

inline

## Member Function Documentation

## Create()

XnStatus xn::ImageGenerator::Create | ( | Context & | context,
|  | Query * | pQuery = NULL,
|  | EnumerationErrors * | pErrors = NULL )

inline

Creates and initializes an ImageGenerator node from available production node alternatives.

For full details and usage, see create_method.

## GetGrayscale16ImageMap()

const XnGrayscale16Pixel * xn::ImageGenerator::GetGrayscale16ImageMap | ( |  | ) | const

inline

Gets the current Grayscale16 image-map. This map is updated after a call to xnWaitAndUpdateData(). It is assumed that the node is currently in Grayscale16 pixel format. For full details and usage, see xnGetGrayscale16ImageMap

## GetGrayscale8ImageMap()

const XnGrayscale8Pixel * xn::ImageGenerator::GetGrayscale8ImageMap | ( |  | ) | const

inline

Gets the current Grayscale8 image-map. This map is updated after a call to xnWaitAndUpdateData(). It is assumed that the node is currently in Grayscale8 pixel format. For full details and usage, see xnGetGrayscale8ImageMap

## GetImageMap()

const XnUInt8 * xn::ImageGenerator::GetImageMap | ( |  | ) | const

inline

Gets the current image-map as a byte buffer. For full details, see xnGetImageMap().

## GetMetaData()

void xn::ImageGenerator::GetMetaData | ( | ImageMetaData & | metaData | ) | const

inline

Gets the image generator node's latest frame object, saving it in the xn::ImageMetaData object. This frame object is a snapshot of the generated image map data and its associated configuration information at a certain point in time. This saved frame object provides fast and easy access to the image generator node's data and configuration information.

Parameters

  [out] | metaData | Structure to be filled with the frame object.

Remarks:

This method is central in the use of the ImageGenerator node. Once the ImageGenerator node is generating data, after each 'Update Data' call, the application calls this method to get the node's frame object, which contains the data and all its associated properties.

## GetPixelFormat()

XnPixelFormat xn::ImageGenerator::GetPixelFormat | ( |  | ) | const

inline

Gets the current pixel color format. This is the format set using xn::ImageGenerator node::SetPixelFormat().

Remarks

To get the pixel format of the saved frame - in the frameobject - use the appropriate method of the node's associated xn::ImageMetaData object.

## GetRGB24ImageMap()

const XnRGB24Pixel * xn::ImageGenerator::GetRGB24ImageMap | ( |  | ) | const

inline

Gets the current RGB24 image-map. This map is updated after a call to xnWaitAndUpdateData(). It is assumed that the node is currently in RGB24 pixel format. For full details and usage, see xnGetRGB24ImageMap

## GetYUV422ImageMap()

const XnYUV422DoublePixel * xn::ImageGenerator::GetYUV422ImageMap | ( |  | ) | const

inline

Gets the current YUV422 image-map. This map is updated after a call to xnWaitAndUpdateData(). It is assumed that the node is currently in YUV422 pixel format. For full details and usage, see xnGetYUV422ImageMap

## IsPixelFormatSupported()

XnBool xn::ImageGenerator::IsPixelFormatSupported | ( | XnPixelFormat | Format | ) | const

inline

Returns whether the ImageGenerator node supports a specific pixel color format for the image map.

Parameters

  [in] | Format | The format to check for.

Remarks

Use this method before setting the pixel format for the next frame to be generated.

## RegisterToPixelFormatChange()

XnStatus xn::ImageGenerator::RegisterToPixelFormatChange | ( | StateChangedHandler | handler,
|  | void * | pCookie,
|  | XnCallbackHandle & | hCallback )

inline

Registers an event handler for the 'Pixel Format Change' event.

Parameters

  [in] | handler | Callback function to be invoked when the event is raised.
  [in] | pCookie | User's cookie, to be delivered to the callback.
  [out] | hCallback | Handle to the callback to be used for unregistering it.

For full details and usage of the parameters, see Registering to Events.

## SetPixelFormat()

XnStatus xn::ImageGenerator::SetPixelFormat | ( | XnPixelFormat | Format | ) |

inline

Sets the ImageGenerator node's current 'pixel color' format. This format is used for generating the next frame.

Parameters

  [in] | Format | The format to set.

Remarks

As an example of a pixel color format, the RGB24 image format has one byte for red, one byte for green, and one byte for blue.

When reading the generated data you must use the appropriate 'get' function, e.g., call RGB24Data() to read data generated as the RGB24Data format.

It is the user responsibility to check first if the pixel format is supported by calling xn::ImageGenerator::IsPixelFormatSupported().

## UnregisterFromPixelFormatChange()

void xn::ImageGenerator::UnregisterFromPixelFormatChange | ( | XnCallbackHandle | hCallback | ) |

inline

Unregisters the event handler for the 'Pixel Format Change' event.

Parameters

  [in] | hCallback | Handle received from registration.

For full details and usage of the parameter, see Unregistering from Events .

The documentation for this class was generated from the following file:

- XnCppWrapper.h