#include <OpenNI.h>
Public Member Functions | |
OniFrame * | _getFrame () |
void | _setFrame (OniFrame *pFrame) |
int | getCropOriginX () const |
int | getCropOriginY () const |
bool | getCroppingEnabled () const |
const void * | getData () const |
int | getDataSize () const |
int | getFrameIndex () const |
int | getHeight () const |
SensorType | getSensorType () const |
int | getStrideInBytes () const |
uint64_t | getTimestamp () const |
const VideoMode & | getVideoMode () const |
int | getWidth () const |
bool | isValid () const |
VideoFrameRef & | operator= (const VideoFrameRef &other) |
void | release () |
VideoFrameRef () | |
VideoFrameRef (const VideoFrameRef &other) | |
~VideoFrameRef () | |
Private Member Functions | |
void | setReference (OniFrame *pFrame) |
Private Attributes | |
OniFrame * | m_pFrame |
Friends | |
class | VideoStream |
The VideoFrameRef class encapsulates a single video frame - the output of a VideoStream at a specific time. The data contained will be a single frame of color, IR, or depth video, along with associated meta data.
An object of type VideoFrameRef does not actually hold the data of the frame, but only a reference to it. The reference can be released by destroying the VideoFrameRef object, or by calling the release() method. The actual data of the frame is freed when the last reference to it is released.
The usual way to obtain VideoFrameRef objects is by a call to VideoStream.:readFrame().
All data references by a VideoFrameRef is stored as a primitive array of pixels. Each pixel will be of a type according to the configured pixel format (see VideoMode).
|
inline |
Default constructor. Creates a new empty VideoFrameRef object. This object will be invalid until initialized by a call to VideoStream::readFrame().
|
inline |
|
inline |
Copy constructor. Creates a new VideoFrameRef object. The newly created object will reference the same frame current object references.
[in] | other | Another VideoFrameRef object. |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Getter function for the array of data pointed to by this object.
|
inline |
|
inline |
Frames are provided sequential frame ID numbers by the sensor that produced them. If frame synchronization has been enabled for a device via Device::setDepthColorSyncEnabled(), then frame numbers for corresponding frames of depth and color are guaranteed to match.
If frame synchronization is not enabled, then there is no guarantee of matching frame indexes between VideoStreams. In the latter case, applications should use timestamps instead of frame indexes to align frames in time.
|
inline |
|
inline |
Getter function for the sensor type used to produce this frame. Used to determine whether this is an IR, Color or Depth frame. See the SensorType enumeration for all possible return values from this function.
|
inline |
|
inline |
Provides a timestamp for the frame. The 'zero' point for this stamp is implementation specific, but all streams from the same device are guaranteed to use the same zero. This value can therefore be used to compute time deltas between frames from the same device, regardless of whether they are from the same stream.
|
inline |
Returns a reference to the VideoMode object assigned to this frame. This object describes the video mode the sensor was configured to when the frame was produced and can be used to determine the pixel format and resolution of the data. It will also provide the frame rate that the sensor was running at when it recorded this frame.
|
inline |
Gives the current width of this frame, measured in pixels. If cropping is enabled, this will be the width of the cropping window. If cropping is not enabled, then this will simply be equal to the X resolution of the VideoMode used to produce this frame.
|
inline |
|
inline |
Make this VideoFrameRef object reference the same frame that the other
frame references. If this object referenced another frame before calling this method, the previous frame will be released.
[in] | other | Another VideoFrameRef object. |
|
inline |
Release the reference to the frame. Once this method is called, the object becomes invalid, and no method should be called other than the assignment operator, or passing this object to a VideoStream::readFrame() call.
|
inlineprivate |
|
friend |