Anti Flicker Capability
C Reference » Production Nodes Functionality » Map Generator

## Functions

XN_C_API XnStatus XN_C_DECL | xnSetPowerLineFrequency (XnNodeHandle hGenerator, XnPowerLineFrequency nFrequency)
XN_C_API XnPowerLineFrequency XN_C_DECL | xnGetPowerLineFrequency (XnNodeHandle hGenerator)
XN_C_API XnStatus XN_C_DECL | xnRegisterToPowerLineFrequencyChange (XnNodeHandle hGenerator, XnStateChangedHandler handler, void *pCookie, XnCallbackHandle *phCallback)
XN_C_API void XN_C_DECL | xnUnregisterFromPowerLineFrequencyChange (XnNodeHandle hGenerator, XnCallbackHandle hCallback)

## Detailed Description

The Anti Flicker capability (XN_CAPABILITY_ANTI_FLICKER) allows a Map Generator to time its frames in such a way that no flickering will take place due to electric light frequencies.

## Function Documentation

## xnGetPowerLineFrequency()

XN_C_API XnPowerLineFrequency XN_C_DECL xnGetPowerLineFrequency | ( | XnNodeHandle | hGenerator | ) |

Gets the power line frequency.

Parameters

  hGenerator | [in] A handle to the instance.

Returns
  (XnUInt32)-1 if node does not support this capability

## xnRegisterToPowerLineFrequencyChange()

XN_C_API XnStatus XN_C_DECL xnRegisterToPowerLineFrequencyChange | ( | XnNodeHandle | hGenerator,
|  | XnStateChangedHandler | handler,
|  | void * | pCookie,
|  | XnCallbackHandle * | phCallback )

Registers a callback function to power line frequency changes.

Parameters

  hGenerator | [in] A handle to the instance.
  handler | [in] A pointer to a function that will be called when power line frequency changes.
  pCookie | [in] A user cookie that will be passed to the callback function.
  phCallback | [out] Optional. Will be filled with a handle to be passed to xnUnregisterFromPowerLineFrequencyChange().

## xnSetPowerLineFrequency()

XN_C_API XnStatus XN_C_DECL xnSetPowerLineFrequency | ( | XnNodeHandle | hGenerator,
|  | XnPowerLineFrequency | nFrequency )

Sets the power line frequency: 50 Hz, 60 Hz, or 0 to turn off anti-flicker.

Parameters

  hGenerator | [in] A handle to the instance.
  nFrequency | [in] The frequency to be used.

## xnUnregisterFromPowerLineFrequencyChange()

XN_C_API void XN_C_DECL xnUnregisterFromPowerLineFrequencyChange | ( | XnNodeHandle | hGenerator,
|  | XnCallbackHandle | hCallback )

Unregisters a callback function which was registered using xnRegisterToPowerLineFrequencyChange().

Parameters

  hGenerator | [in] A handle to the instance.
  hCallback | [in] The handle to the callback returned from xnRegisterToPowerLineFrequencyChange().