Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
openni::VideoFrameRef Class Reference

#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 VideoModegetVideoMode () const
 
int getWidth () const
 
bool isValid () const
 
VideoFrameRefoperator= (const VideoFrameRef &other)
 
void release ()
 
 VideoFrameRef ()
 
 VideoFrameRef (const VideoFrameRef &other)
 
 ~VideoFrameRef ()
 

Private Member Functions

void setReference (OniFrame *pFrame)
 

Private Attributes

OniFramem_pFrame
 

Friends

class VideoStream
 

Detailed Description

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).

Definition at line 406 of file OpenNI.h.

Constructor & Destructor Documentation

openni::VideoFrameRef::VideoFrameRef ( )
inline

Default constructor. Creates a new empty VideoFrameRef object. This object will be invalid until initialized by a call to VideoStream::readFrame().

Definition at line 413 of file OpenNI.h.

openni::VideoFrameRef::~VideoFrameRef ( )
inline

Destroy this object and release the reference to the frame.

Definition at line 421 of file OpenNI.h.

openni::VideoFrameRef::VideoFrameRef ( const VideoFrameRef other)
inline

Copy constructor. Creates a new VideoFrameRef object. The newly created object will reference the same frame current object references.

Parameters
[in]otherAnother VideoFrameRef object.

Definition at line 431 of file OpenNI.h.

Member Function Documentation

OniFrame* openni::VideoFrameRef::_getFrame ( )
inline

Definition at line 607 of file OpenNI.h.

void openni::VideoFrameRef::_setFrame ( OniFrame pFrame)
inline

Definition at line 597 of file OpenNI.h.

int openni::VideoFrameRef::getCropOriginX ( ) const
inline

Indicates the X coordinate of the upper left corner of the crop window.

Returns
Distance of crop origin from left side of image, in pixels.

Definition at line 551 of file OpenNI.h.

int openni::VideoFrameRef::getCropOriginY ( ) const
inline

Indicates the Y coordinate of the upper left corner of the crop window.

Returns
Distance of crop origin from top of image, in pixels.

Definition at line 560 of file OpenNI.h.

bool openni::VideoFrameRef::getCroppingEnabled ( ) const
inline

Indicates whether cropping was enabled when the frame was produced.

Returns
true if cropping is enabled, false otherwise

Definition at line 542 of file OpenNI.h.

const void* openni::VideoFrameRef::getData ( ) const
inline

Getter function for the array of data pointed to by this object.

Returns
Pointer to the actual frame data array. Type of data pointed to can be determined according to the pixel format (can be obtained by calling getVideoMode()).

Definition at line 462 of file OpenNI.h.

int openni::VideoFrameRef::getDataSize ( ) const
inline

Getter function for the size of the data contained by this object. Useful primarily when allocating buffers.

Returns
Current size of data pointed to by this object, measured in bytes.

Definition at line 452 of file OpenNI.h.

int openni::VideoFrameRef::getFrameIndex ( ) const
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.

Returns
Index number for this frame.

Definition at line 512 of file OpenNI.h.

int openni::VideoFrameRef::getHeight ( ) const
inline

Gives the current height of this frame, measured in pixels. If cropping is enabled, this will be the length of the cropping window. If cropping is not enabled, then this will simply be equal to the Y resolution of the VideoMode used to produce this frame.

Definition at line 533 of file OpenNI.h.

SensorType openni::VideoFrameRef::getSensorType ( ) const
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.

Returns
The type of sensor used to produce this frame.

Definition at line 473 of file OpenNI.h.

int openni::VideoFrameRef::getStrideInBytes ( ) const
inline

Gives the length of one row of pixels, measured in bytes. Primarily useful for indexing the array which contains the data.

Returns
Stride of the array which contains the image for this frame, in bytes

Definition at line 570 of file OpenNI.h.

uint64_t openni::VideoFrameRef::getTimestamp ( ) const
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.

Returns
Timestamp of frame, measured in microseconds from an arbitrary zero

Definition at line 497 of file OpenNI.h.

const VideoMode& openni::VideoFrameRef::getVideoMode ( ) const
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.

Returns
Reference to the VideoMode assigned to this frame.

Definition at line 485 of file OpenNI.h.

int openni::VideoFrameRef::getWidth ( ) const
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.

Returns
Width of this frame in pixels.

Definition at line 523 of file OpenNI.h.

bool openni::VideoFrameRef::isValid ( ) const
inline

Check if this object references an actual frame.

Definition at line 578 of file OpenNI.h.

VideoFrameRef& openni::VideoFrameRef::operator= ( const VideoFrameRef other)
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.

Parameters
[in]otherAnother VideoFrameRef object.

Definition at line 441 of file OpenNI.h.

void openni::VideoFrameRef::release ( )
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.

Definition at line 587 of file OpenNI.h.

void openni::VideoFrameRef::setReference ( OniFrame pFrame)
inlineprivate

Definition at line 614 of file OpenNI.h.

Friends And Related Function Documentation

friend class VideoStream
friend

Definition at line 613 of file OpenNI.h.

Member Data Documentation

OniFrame* openni::VideoFrameRef::m_pFrame
private

Definition at line 621 of file OpenNI.h.


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


libfreenect
Author(s): Hector Martin, Josh Blake, Kyle Machulis, OpenKinect community
autogenerated on Thu Jun 6 2019 19:25:39