#include <OpenNI.h>
List of all members.
Classes |
class | NewFrameListener |
Public Member Functions |
| VideoStream () |
| ~VideoStream () |
Status | addNewFrameListener (NewFrameListener *pListener) |
Status | create (const Device &device, SensorType sensorType) |
void | destroy () |
CameraSettings * | getCameraSettings () |
bool | getCropping (int *pOriginX, int *pOriginY, int *pWidth, int *pHeight) const |
float | getHorizontalFieldOfView () const |
int | getMaxPixelValue () const |
int | getMinPixelValue () const |
bool | getMirroringEnabled () const |
Status | getProperty (int propertyId, void *data, int *dataSize) const |
template<class T > |
Status | getProperty (int propertyId, T *value) const |
const SensorInfo & | getSensorInfo () const |
float | getVerticalFieldOfView () const |
VideoMode | getVideoMode () const |
Status | invoke (int commandId, void *data, int dataSize) |
template<class T > |
Status | invoke (int commandId, const T &value) |
bool | isCommandSupported (int commandId) const |
bool | isCroppingSupported () const |
bool | isPropertySupported (int propertyId) const |
bool | isValid () const |
Status | readFrame (VideoFrameRef *pFrame) |
void | removeNewFrameListener (NewFrameListener *pListener) |
Status | resetCropping () |
Status | setCropping (int originX, int originY, int width, int height) |
Status | setMirroringEnabled (bool isEnabled) |
Status | setProperty (int propertyId, const void *data, int dataSize) |
template<class T > |
Status | setProperty (int propertyId, const T &value) |
Status | setVideoMode (const VideoMode &videoMode) |
Status | start () |
void | stop () |
Friends |
class | Device |
Constructor & Destructor Documentation
Default constructor. Creates a new, non-valid VideoStream object. The object created will be invalid until its create() function is called with a valid Device.
Member Function Documentation
Adds a new Listener to recieve this VideoStream onNewFrame event. See VideoStream::NewFrameListener for more information on implementing an event driven frame reading architecture.
- Parameters:
-
- Returns:
- Status code indicating success or failure of the operation.
Creates a stream of frames from a specific sensor type of a specific device. You must supply a reference to a Device that supplies the sensor type requested. You can use Device::hasSensor() to check whether a given sensor is available on your target device before calling create().
- Parameters:
-
[in] | device | A reference to the Device you want to create the stream on. |
[in] | sensorType | The type of sensor the stream should produce data from. |
- Returns:
- Status code indicating success or failure for this operation.
Destroy this stream. This function is currently called automatically by the destructor, but it is considered a best practice for applications to manually call this function on any VideoStream that they call create() for.
Gets an object through which several camera settings can be configured.
- Returns:
- NULL if the stream doesn't support camera settings.
Obtains the current cropping settings for this stream.
- Parameters:
-
[out] | pOriginX | X coordinate of the upper left corner of the cropping window |
[out] | pOriginY | Y coordinate of the upper left corner of the cropping window |
[out] | pWidth | Horizontal width of the cropping window, in pixels |
[out] | pHeight | Vertical width of the cropping window, in pixels returns true if cropping is currently enabled, false if it is not. |
Gets the horizontal field of view of frames received from this stream.
- Returns:
- Horizontal field of view, in radians.
Provides the maximum possible value for pixels obtained by this stream. This is most useful for getting the maximum possible value of depth streams.
- Returns:
- Maximum possible pixel value.
Provides the smallest possible value for pixels obtains by this VideoStream. This is most useful for getting the minimum possible value that will be reported by a depth stream.
- Returns:
- Minimum possible pixel value that can come from this stream.
Check whether mirroring is currently turned on for this stream.
- Returns:
- true if mirroring is currently enabled, false otherwise.
General function for obtaining the value of stream specific properties. There are convenience functions available for all commonly used properties, so it is not expected that applications will make direct use of the getProperty function very often.
- Parameters:
-
[in] | propertyId | The numerical ID of the property to be queried. |
[out] | data | Place to store the value of the property. |
[in,out] | dataSize | IN: Size of the buffer passed in the data argument. OUT: the actual written size. |
- Returns:
- Status code indicating success or failure of this operation.
Function for getting the value from a property using an arbitrary output type. There are convenience functions available for all commonly used properties, so it is not expected that applications will make direct use of this function very often.
- Template Parameters:
-
[in] | T Data type of the value to be read. |
- Parameters:
-
[in] | propertyId | The numerical ID of the property to be read. |
[in,out] | value | Pointer to a place to store the value read from the property. |
- Returns:
- Status code indicating success or failure of this operation.
Provides the SensorInfo object associated with the sensor that is producing this VideoStream. Note that this function will return NULL if the stream has not yet been initialized with the create() function.
SensorInfo is useful primarily as a means of learning which video modes are valid for this VideoStream.
- Returns:
- Reference to the SensorInfo object associated with the sensor providing this stream.
Gets the vertical field of view of frames received from this stream.
- Returns:
- Vertical field of view, in radians.
Get the current video mode information for this video stream. This includes its resolution, fps and stream format.
- Returns:
- Current video mode information for this video stream.
Invokes a command that takes an arbitrary data type as its input. It is not expected that application code will need this function frequently, as all commonly used properties have higher level functions provided.
- Parameters:
-
[in] | commandId | Numerical code of the property to be invoked. |
[in] | data | Data to be passed to the property. |
[in] | dataSize | size of the buffer passed in data . |
- Returns:
- Status code indicating success or failure of this operation.
Invokes a command that takes an arbitrary data type as its input. It is not expected that application code will need this function frequently, as all commonly used properties have higher level functions provided.
- Template Parameters:
-
[in] | T Type of data to be passed to the property. |
- Parameters:
-
[in] | commandId | Numerical code of the property to be invoked. |
[in] | value | Data to be passed to the property. |
- Returns:
- Status code indicating success or failure of this operation.
Checks if a specific command is supported by the video stream.
- Parameters:
-
[in] | commandId | Command to be checked. |
- Returns:
- true if the command is supported, false otherwise.
Checks whether this stream supports cropping.
- Returns:
- true if the stream supports cropping, false if it does not.
Checks if a specific property is supported by the video stream.
- Parameters:
-
[in] | propertyId | Property to be checked. |
- Returns:
- true if the property is supported, false otherwise.
Checks to see if this object has been properly initialized and currently points to a valid stream.
- Returns:
- true if this object has been previously initialized, false otherwise.
Read the next frame from this video stream, delivered as a VideoFrameRef. This is the primary method for manually obtaining frames of video data. If no new frame is available, the call will block until one is available. To avoid blocking, use VideoStream::Listener to implement an event driven architecture. Another alternative is to use OpenNI::waitForAnyStream() to wait for new frames from several streams.
- Parameters:
-
[out] | pFrame | Pointer to a VideoFrameRef object to hold the reference to the new frame. |
- Returns:
- Status code to indicated success or failure of this function.
Removes a Listener from this video stream list. The listener removed will no longer receive new frame events from this stream.
- Parameters:
-
[in] | pListener | Pointer to the listener object to be removed. |
Disables cropping.
- Returns:
- Status code indicating success or failure of this operation.
Changes the cropping settings for this stream. You can use the isCroppingSupported() function to make sure cropping is supported before calling this function.
- Parameters:
-
[in] | originX | New X coordinate of the upper left corner of the cropping window. |
[in] | originY | New Y coordinate of the upper left corner of the cropping window. |
[in] | width | New horizontal width for the cropping window, in pixels. |
[in] | height | New vertical height for the cropping window, in pixels. |
- Returns:
- Status code indicating success or failure of this operation.
Enable or disable mirroring for this stream.
- Parameters:
-
[in] | isEnabled | true to enable mirroring, false to disable it. |
- Returns:
- Status code indicating the success or failure of this operation.
General function for setting the value of stream specific properties. There are convenience functions available for all commonly used properties, so it is not expected that applications will make direct use of the setProperty function very often.
- Parameters:
-
[in] | propertyId | The numerical ID of the property to be set. |
[in] | data | Place to store the data to be written to the property. |
[in] | dataSize | Size of the data to be written to the property. |
- Returns:
- Status code indicating success or failure of this operation.
Function for setting a value of a stream property using an arbitrary input type. There are convenience functions available for all commonly used properties, so it is not expected that applications will make direct use of this function very often.
- Template Parameters:
-
[in] | T Data type of the value to be passed to the property. |
- Parameters:
-
[in] | propertyId | The numerical ID of the property to be set. |
[in] | value | Data to be sent to the property. |
- Returns:
- Status code indicating success or failure of this operation.
Changes the current video mode of this stream. Recommended practice is to use Device::getSensorInfo(), and then SensorInfo::getSupportedVideoModes() to obtain a list of valid video mode settings for this stream. Then, pass a valid VideoMode to setVideoMode to ensure correct operation.
- Parameters:
-
[in] | videoMode | Desired new video mode for this stream. returns Status code indicating success or failure of this operation. |
Starts data generation from this video stream.
Stops data generation from this video stream.
Friends And Related Function Documentation
The documentation for this class was generated from the following file: