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

`#include <XnCppWrapper.h>`

Inheritance diagram for xn::MirrorCapability:
[legend]

## Public Member Functions

| MirrorCapability (XnNodeHandle hNode)
| MirrorCapability (const NodeWrapper &node)
XnStatus | SetMirror (XnBool bMirror)
XnBool | IsMirrored () const
XnStatus | RegisterToMirrorChange (StateChangedHandler handler, void *pCookie, XnCallbackHandle &hCallback)
void | UnregisterFromMirrorChange (XnCallbackHandle hCallback)
Public Member Functions inherited from xn::Capability
| Capability (XnNodeHandle hNode)
| Capability (const NodeWrapper &node)
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: Applying the MirrorCapability to a node allows enabling the Mirroring mode on a per node basis. Compare this with enabling the Global Mirror, which applies mirroring to any node supporting the Mirroring capability. To understand mirroring see the Overview below.

Usage: Do not instantiate directly. Instead, use Generator::GetMirrorCap() to obtain an instance.

Remarks:

When you stand facing the sensor device, and the image is processed directly, the sensor "sees" your left hand at your right-hand side, and your right hand at your left-hand side.

If your movements are used to control an avatar, and that avatar is facing you then the avatar on the screen is opposite: your right hand is facing the left of the avatar on the screen, and your left hand is facing the right of the avatar.

The effect of applying and enabling the Mirroring capability on a node makes all the data replace right with left, and left with right.

Thus, if mirroring is disabled (default), then when you raise your right hand, the avatar on the screen opposite you correspondingly also raises its own right hand, this being to the left of yourself.

If mirroring is enabled, when you raise your right hand on the screen the avatar opposite you mirrors you by raising its hand on your right, which is the avatar's left hand.

Enabling mirroring is useful when the avatar is facing the player. Disabling mirroring is useful when the player sees the avatar from behind (for example in third person shooters or to see yourself kicking a football).

Changing the GlobalMirror flag affects mirroring in all existing nodes and in all nodes to be created in the future - see Context::SetGlobalMirror().

Event: 'Mirror Change'

Signals that the holder node's mirror configuration has been changed (also see Configuration Change Events).

Use RegisterToMirrorChange() and UnregisterFromMirrorChange() for using this event.

Calling the SetMirror() method raises this event.

## Constructor & Destructor Documentation

## MirrorCapability() [1/2]

xn::MirrorCapability::MirrorCapability | ( | XnNodeHandle | hNode | ) |

inline

## MirrorCapability() [2/2]

xn::MirrorCapability::MirrorCapability | ( | const NodeWrapper & | node | ) |

inline

## Member Function Documentation

## IsMirrored()

XnBool xn::MirrorCapability::IsMirrored | ( |  | ) | const

inline

Gets the current mirroring configuration of the holder node. This configuration is used for generating the next frame.

## RegisterToMirrorChange()

XnStatus xn::MirrorCapability::RegisterToMirrorChange | ( | StateChangedHandler | handler,
|  | void * | pCookie,
|  | XnCallbackHandle & | hCallback )

inline

Registers an event handler for the 'Mirror 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.

## SetMirror()

XnStatus xn::MirrorCapability::SetMirror | ( | XnBool | bMirror | ) |

inline

Sets the current mirror configuration of the holder node, enabling or disabling mirroring. This configuration is used for generating the next frame.

Parameters

  [in] | bMirror | TRUE for mirroring output, FALSE otherwise.

## UnregisterFromMirrorChange()

void xn::MirrorCapability::UnregisterFromMirrorChange | ( | XnCallbackHandle | hCallback | ) |

inline

Unregisters the event handler for the 'Mirror 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