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

`#include <XnCppWrapper.h>`

Inheritance diagram for xn::ImageMetaData:
[legend]

## Public Member Functions

| ImageMetaData ()
void | InitFrom (const ImageMetaData &other)
XnStatus | InitFrom (const ImageMetaData &other, XnUInt32 nXRes, XnUInt32 nYRes, XnPixelFormat format, const XnUInt8 *pExternalBuffer)
XnStatus | AllocateData (XnUInt32 nXRes, XnUInt32 nYRes, XnPixelFormat format)
XnStatus | CopyFrom (const ImageMetaData &other)
XnStatus | ReAdjust (XnUInt32 nXRes, XnUInt32 nYRes, XnPixelFormat format, const XnUInt8 *pExternalBuffer=NULL)
XnPixelFormat | PixelFormat () const
XnPixelFormat & | PixelFormat ()
XnUInt8 * | WritableData ()
const XnRGB24Pixel * | RGB24Data () const
const XnRGB24Pixel *& | RGB24Data ()
XnRGB24Pixel * | WritableRGB24Data ()
const XnYUV422DoublePixel * | YUV422Data () const
const XnYUV422DoublePixel *& | YUV422Data ()
XnYUV422DoublePixel * | WritableYUV422Data ()
const XnGrayscale8Pixel * | Grayscale8Data () const
const XnGrayscale8Pixel *& | Grayscale8Data ()
XnGrayscale8Pixel * | WritableGrayscale8Data ()
const XnGrayscale16Pixel * | Grayscale16Data () const
const XnGrayscale16Pixel *& | Grayscale16Data ()
XnGrayscale16Pixel * | WritableGrayscale16Data ()
const xn::ImageMap & | ImageMap () const
xn::ImageMap & | WritableImageMap ()
const xn::RGB24Map & | RGB24Map () const
xn::RGB24Map & | WritableRGB24Map ()
const xn::Grayscale8Map & | Grayscale8Map () const
xn::Grayscale8Map & | WritableGrayscale8Map ()
const xn::Grayscale16Map & | Grayscale16Map () const
xn::Grayscale16Map & | WritableGrayscale16Map ()
const XnImageMetaData * | GetUnderlying () const
XnImageMetaData * | 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 ImageMetaData object provides a number of different methods to get the image as a different format. You must use the 'Get Data' method most appropriate for the data format of the latest available frame. For example, if you requested the ImageGenerator node to generate RGB24 format you must use the RGB24Data() method to get the data.

Each of the 'Get Data' methods gets the image as a pointer to the first pixel in the image map. From the address of that first pixel you can access all the pixels.

Depending on the format, the pixels are different in size. This means that image maps are a different size.

## Constructor & Destructor Documentation

## ImageMetaData()

xn::ImageMetaData::ImageMetaData | ( |  | ) |

inline

## Member Function Documentation

## AllocateData()

XnStatus xn::ImageMetaData::AllocateData | ( | XnUInt32 | nXRes,
|  | XnUInt32 | nYRes,
|  | XnPixelFormat | format )

inline

Allocates a writable buffer. If a previous buffer was allocated it will be freed (or reused if possible).

Parameters

  [in] | nXRes | Requested number of columns in the map
  [in] | nYRes | Requested number of rows in the map
  [in] | format | Requested pixel format

## CopyFrom()

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

inline

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

Parameters

  [in] | other | source object

## GetUnderlying() [1/2]

XnImageMetaData * xn::ImageMetaData::GetUnderlying | ( |  | ) |

inline

Gets the C object that is wrapped by this object.

## GetUnderlying() [2/2]

const XnImageMetaData * xn::ImageMetaData::GetUnderlying | ( |  | ) | const

inline

Gets the C object that is wrapped by this object.

## Grayscale16Data() [1/2]

const XnGrayscale16Pixel *& xn::ImageMetaData::Grayscale16Data | ( |  | ) |

inline

Gets a pointer to the first pixel of the image in Grayscale16 format. Grayscale16 represents each pixel as a 16-bit (2-byte) gray scale.

## Grayscale16Data() [2/2]

const XnGrayscale16Pixel * xn::ImageMetaData::Grayscale16Data | ( |  | ) | const

inline

Gets a pointer to the first pixel of the image in Grayscale16 format. Grayscale16 represents each pixel as a 16-bit (2-byte) gray scale.

## Grayscale16Map()

const xn::Grayscale16Map & xn::ImageMetaData::Grayscale16Map | ( |  | ) | const

inline

Gets a light wrapper object wrapping the frame's image map as Grayscale16 format.

## Grayscale8Data() [1/2]

const XnGrayscale8Pixel *& xn::ImageMetaData::Grayscale8Data | ( |  | ) |

inline

Gets a pointer to the first pixel of the image in Grayscale8 format. Grayscale8 represents each pixel as an 8-bit (1-byte) gray scale.

## Grayscale8Data() [2/2]

const XnGrayscale8Pixel * xn::ImageMetaData::Grayscale8Data | ( |  | ) | const

inline

Gets a pointer to the first pixel of the image in Grayscale8 format. Grayscale8 represents each pixel as an 8-bit (1 byte) gray scale.

## Grayscale8Map()

const xn::Grayscale8Map & xn::ImageMetaData::Grayscale8Map | ( |  | ) | const

inline

Gets a light wrapper object wrapping the image map as Grayscale8 format.

## ImageMap()

const xn::ImageMap & xn::ImageMetaData::ImageMap | ( |  | ) | const

inline

Gets a light object wrapping the image map.

## InitFrom() [1/2]

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

inline

Shallow-copies an ImageMetaData 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::ImageMetaData::InitFrom | ( | const ImageMetaData & | other,
|  | XnUInt32 | nXRes,
|  | XnUInt32 | nYRes,
|  | XnPixelFormat | format,
|  | const XnUInt8 * | pExternalBuffer )

inline

Shallow copies another ImageMetaData object, and then readjusts it.

Parameters

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

## PixelFormat() [1/2]

XnPixelFormat & xn::ImageMetaData::PixelFormat | ( |  | ) |

inline

Gets the frame's pixel color format used in this image map. This is the format of the frame object saved in this object.

Remarks

Knowing the pixel format of the image map helps you to enumerate over the map and process its data.

## PixelFormat() [2/2]

XnPixelFormat xn::ImageMetaData::PixelFormat | ( |  | ) | const

inline

Gets the frame's pixel color format used in this image map. This is the format of the frame object saved in this object.

Remarks

Knowing the pixel format of the image map helps you to enumerate over the map and process its data.

Reimplemented from xn::MapMetaData.

## ReAdjust()

XnStatus xn::ImageMetaData::ReAdjust | ( | XnUInt32 | nXRes,
|  | XnUInt32 | nYRes,
|  | XnPixelFormat | format,
|  | const XnUInt8 * | pExternalBuffer = NULL )

inline

Parameters

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

## RGB24Data() [1/2]

const XnRGB24Pixel *& xn::ImageMetaData::RGB24Data | ( |  | ) |

inline

Gets a pointer to the first pixel of the image in RGB24 format. RGB24 format represents each pixel as one byte for red, one byte for green, and one byte for blue.

## RGB24Data() [2/2]

const XnRGB24Pixel * xn::ImageMetaData::RGB24Data | ( |  | ) | const

inline

Gets a pointer to the first pixel of the image in RGB24 format. RGB24 format represents each pixel as one byte for red, one byte for green, and one byte for blue.

## RGB24Map()

const xn::RGB24Map & xn::ImageMetaData::RGB24Map | ( |  | ) | const

inline

Gets a light wrapper object for wrapping the image map as RGB24 format. RGB24 format represents each pixel as one byte for red, one byte for green, and one byte for blue.

## WritableData()

XnUInt8 * xn::ImageMetaData::WritableData | ( |  | ) |

inline

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

## WritableGrayscale16Data()

XnGrayscale16Pixel * xn::ImageMetaData::WritableGrayscale16Data | ( |  | ) |

inline

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

## WritableGrayscale16Map()

xn::Grayscale16Map & xn::ImageMetaData::WritableGrayscale16Map | ( |  | ) |

inline

Gets a light object wrapping the writable image-map

## WritableGrayscale8Data()

XnGrayscale8Pixel * xn::ImageMetaData::WritableGrayscale8Data | ( |  | ) |

inline

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

## WritableGrayscale8Map()

xn::Grayscale8Map & xn::ImageMetaData::WritableGrayscale8Map | ( |  | ) |

inline

Gets a light object wrapping the writable image-map

## WritableImageMap()

xn::ImageMap & xn::ImageMetaData::WritableImageMap | ( |  | ) |

inline

Gets a light object wrapping the writable image-map

## WritableRGB24Data()

XnRGB24Pixel * xn::ImageMetaData::WritableRGB24Data | ( |  | ) |

inline

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

## WritableRGB24Map()

xn::RGB24Map & xn::ImageMetaData::WritableRGB24Map | ( |  | ) |

inline

Gets a light object wrapping the writable image-map

## WritableYUV422Data()

XnYUV422DoublePixel * xn::ImageMetaData::WritableYUV422Data | ( |  | ) |

inline

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

## YUV422Data() [1/2]

const XnYUV422DoublePixel *& xn::ImageMetaData::YUV422Data | ( |  | ) |

inline

Gets a pointer to the first pixel of the image in YUV422 format. YUV422 is a type of compression with a single Y byte followed by a U byte, then another Y byte and then a V byte: YUY'V. These four values represent two pixels: YUV and Y'UV.

## YUV422Data() [2/2]

const XnYUV422DoublePixel * xn::ImageMetaData::YUV422Data | ( |  | ) | const

inline

Gets a pointer to the first pixel of the image in YUV422 format. YUV422 is a type of compression with a single Y byte followed by a U byte, then another Y byte and then a V byte: YUY'V. These four values represent two pixels: YUV and Y'UV.

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

- XnCppWrapper.h