xn::DepthMetaData Class Reference
C++ Reference to Application Programmer Interface (API) » Meta-Data Objects (Frame Objects)

`#include <XnCppWrapper.h>`

Inheritance diagram for xn::DepthMetaData:
[legend]

## Public Member Functions

| DepthMetaData ()
void | InitFrom (const DepthMetaData &other)
XnStatus | InitFrom (const DepthMetaData &other, XnUInt32 nXRes, XnUInt32 nYRes, const XnDepthPixel *pExternalBuffer)
XnStatus | CopyFrom (const DepthMetaData &other)
XnStatus | ReAdjust (XnUInt32 nXRes, XnUInt32 nYRes, const XnDepthPixel *pExternalBuffer=NULL)
XnDepthPixel | ZRes () const
XnDepthPixel & | ZRes ()
const XnDepthPixel * | Data () const
const XnDepthPixel *& | Data ()
XnDepthPixel * | WritableData ()
const xn::DepthMap & | DepthMap () const
xn::DepthMap & | WritableDepthMap ()
const XnDepthPixel & | operator[] (XnUInt32 nIndex) const
const XnDepthPixel & | operator() (XnUInt32 x, XnUInt32 y) const
const XnDepthMetaData * | GetUnderlying () const
XnDepthMetaData * | GetUnderlying ()
Public Member Functions inherited from xn::MapMetaData
| MapMetaData (XnPixelFormat format, const XnUInt8 **ppData)
XnUInt32 | XRes () const
XnUInt32 & | XRes ()
XnUInt32 | YRes () const
XnUInt32 & | YRes ()
XnUInt32 | XOffset () const
XnUInt32 & | XOffset ()
XnUInt32 | YOffset () const
XnUInt32 & | YOffset ()
XnUInt32 | FullXRes () const
XnUInt32 & | FullXRes ()
XnUInt32 | FullYRes () const
XnUInt32 & | FullYRes ()
XnUInt32 | FPS () const
XnUInt32 & | FPS ()
XnPixelFormat | PixelFormat () const
const XnMapMetaData * | GetUnderlying () const
XnMapMetaData * | GetUnderlying ()
XnUInt32 | BytesPerPixel () const
XnStatus | AllocateData (XnUInt32 nXRes, XnUInt32 nYRes)
XnStatus | ReAdjust (XnUInt32 nXRes, XnUInt32 nYRes, const XnUInt8 *pExternalBuffer)
Public Member Functions inherited from xn::OutputMetaData
| OutputMetaData (const XnUInt8 **ppData)
virtual | ~OutputMetaData ()
XnUInt64 | Timestamp () const
XnUInt64 & | Timestamp ()
XnUInt32 | FrameID () const
XnUInt32 & | FrameID ()
XnUInt32 | DataSize () const
XnUInt32 & | DataSize ()
XnBool | IsDataNew () const
XnBool & | IsDataNew ()
const XnOutputMetaData * | GetUnderlying () const
XnOutputMetaData * | GetUnderlying ()
const XnUInt8 * | Data () const
const XnUInt8 *& | Data ()
XnUInt8 * | WritableData ()
XnStatus | AllocateData (XnUInt32 nBytes)
void | Free ()
XnStatus | MakeDataWritable ()

## Additional Inherited Members

Protected Member Functions inherited from xn::MapMetaData
XnPixelFormat & | PixelFormatImpl ()
Protected Attributes inherited from xn::OutputMetaData
XnUInt8 * | m_pAllocatedData

## Detailed Description

For saving the frame object (data and configuration) from the DepthGenerator node. This frameobject is a snapshot of the DepthGenerator's generated depth map and its associated configuration information at a certain point in time. This saved frame object provides fast and easy access to the DepthGenerator node's data and configuration information.

It is important to get a good understanding of the purpose and design of the OpenNI metadata objects. For a comprehensive overview of OpenNI metadata objects, see Frame Objects and Metadata Objects.

The DepthGenerator node generates depth data of the FOV. This is the Z-coordinate of the X-Y-Z coordinate of each point. The Z-axis is the distance, in millimeters from the sensor plane. A smaller depth value indicates a scene point that is a closer to the sensor, and a larger depth value indicates a scene point that is further away from the sensor. A zero depth value indicates that the DepthGenerator node did not succeed in obtaining a valid depth reading.

DepthMetaData's xn::DepthMetaData::Data() method provides the actual depth data. This method returns the pointer to the first depth pixel in the map.

The pixel format of depth map is XnDepthPixel, i.e. 16-bit values.

DepthMetaData provides the `ZRes` property to contain the depth resolution. This is the maximum value of a pixel (plus one).

DepthMetaData is similar to ImageMetaData; they are both metadata for a type of map.

## Constructor & Destructor Documentation

## DepthMetaData()

xn::DepthMetaData::DepthMetaData | ( |  | ) |

inline

Ctor.

## Member Function Documentation

## CopyFrom()

XnStatus xn::DepthMetaData::CopyFrom | ( | const DepthMetaData & | other | ) |

inline

Performs a deep-copy of another metadata object (including duplication of the data buffer).

Parameters

  [in] | other | source object

## Data() [1/2]

const XnDepthPixel *& xn::DepthMetaData::Data | ( |  | ) |

inline

Returns the depth map.

Remarks

This method returns a pointer to the first depth pixel in the map. The depth map is implemented as a row-major order compact layout of pixels in the map.

The pixel format of the map is XnDepthPixel, i.e. 16-bit integer values.

This method is reimplemented from the xn::OutputMetaData class.

## Data() [2/2]

const XnDepthPixel * xn::DepthMetaData::Data | ( |  | ) | const

inline

Returns the depth map.

Remarks

This method returns a pointer to the first depth pixel in the map. The depth map is implemented as a row-major order compact layout of pixels in the map.

The pixel format of the map is XnDepthPixel, i.e. 16-bit integer values.

This method is reimplemented from the xn::OutputMetaData class.

## DepthMap()

const xn::DepthMap & xn::DepthMetaData::DepthMap | ( |  | ) | const

inline

Gets a light object wrapping the depth map

## GetUnderlying() [1/2]

XnDepthMetaData * xn::DepthMetaData::GetUnderlying | ( |  | ) |

inline

Gets the C object that is wrapped by this object.

## GetUnderlying() [2/2]

const XnDepthMetaData * xn::DepthMetaData::GetUnderlying | ( |  | ) | const

inline

Gets the C object that is wrapped by this object.

## InitFrom() [1/2]

void xn::DepthMetaData::InitFrom | ( | const DepthMetaData & | other | ) |

inline

Shallow-Copies a DepthMetaData object.

Parameters

  [in] | other | source object.

Remarks
  Note that the data buffer is not copied, and that both object will point to the same buffer.

## InitFrom() [2/2]

XnStatus xn::DepthMetaData::InitFrom | ( | const DepthMetaData & | other,
|  | XnUInt32 | nXRes,
|  | XnUInt32 | nYRes,
|  | const XnDepthPixel * | pExternalBuffer )

inline

Shallow copies another DepthMetaData object, and then readjustsit.

Parameters

  [in] | other | Source object
  [in] | nXRes | Requested number of columns in the map
  [in] | nYRes | Requested number of rows in the map
  [in] | pExternalBuffer | Optional. An external buffer matching requested resolution. If NULL, A buffer will be allocated.

## operator()()

const XnDepthPixel & xn::DepthMetaData::operator() | ( | XnUInt32 | x,
|  | XnUInt32 | y ) const

inline

Gets the value of a single pixel of the frame map by its X and Y coordinates.

Parameters

  [in] | x | X-coordinate of the pixel in the map
  [in] | y | Y-coordinate of the pixel in the map

## operator[]()

const XnDepthPixel & xn::DepthMetaData::operator[] | ( | XnUInt32 | nIndex | ) | const

inline

Gets the value of a single pixel of the frame map by its index in the array.

Parameters

  [in] | nIndex | The index of the pixel in the buffer.

## ReAdjust()

XnStatus xn::DepthMetaData::ReAdjust | ( | XnUInt32 | nXRes,
|  | XnUInt32 | nYRes,
|  | const XnDepthPixel * | pExternalBuffer = NULL )

inline

Changes dimensions of the pixel-map.

Parameters

  [in] | nXRes | Number of columns in the map
  [in] | nYRes | Number of rows in the map
  [in] | pExternalBuffer | Optional. An external buffer to be used. If NULL is passed, a buffer will be allocated.

## WritableData()

XnDepthPixel * xn::DepthMetaData::WritableData | ( |  | ) |

inline

Gets a pointer to the writable buffer (see Frame Objects and Metadata Objects).

## WritableDepthMap()

xn::DepthMap & xn::DepthMetaData::WritableDepthMap | ( |  | ) |

inline

Gets a light object wrapping the writable depth map

## ZRes() [1/2]

XnDepthPixel & xn::DepthMetaData::ZRes | ( |  | ) |

inline

Gets the maximum depth (depth resolution) that the DepthGenerator node can produce. This is the same as the resolution of the depth axis (i.e., DepthGenerator::GetDeviceMaxDepth() + 1).

## ZRes() [2/2]

XnDepthPixel xn::DepthMetaData::ZRes | ( |  | ) | const

inline

Gets the maximum depth (depth resolution) that the DepthGenerator node can produce. This is the same as the resolution of the depth axis (i.e., DepthGenerator::GetDeviceMaxDepth() + 1).

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

- XnCppWrapper.h