ARWrapper
Provides a C++ wrapper around ARToolKit and exposes a C and JNI API
|
Base class for different video source implementations. More...
#include <VideoSource.h>
Public Member Functions | |
virtual | ~VideoSource () |
int | getError () |
bool | isOpen () |
Returns true if the video source is open. More... | |
bool | isRunning () |
Returns true if the video source is open and ready to be queried. More... | |
void | configure (const char *vconf, const char *cparaName, const char *cparaBuff, size_t cparaBuffLen) |
Sets initial parameters which will be used when the video source is opened. More... | |
ARParamLT * | getCameraParameters () |
Returns the camera parameters for the video source. More... | |
int | getVideoWidth () |
Returns the width of the video in pixels. More... | |
int | getVideoHeight () |
Returns the height of the video in pixels. More... | |
AR_PIXEL_FORMAT | getPixelFormat () |
Returns the pixel format of the video. More... | |
virtual const char * | getName ()=0 |
Returns the name of this video source variation. More... | |
virtual bool | open ()=0 |
Opens the video source. More... | |
virtual bool | close ()=0 |
Closes the video source. More... | |
virtual bool | captureFrame ()=0 |
Asks the video source to capture a frame. More... | |
ARUint8 * | getFrame () |
Returns the current frame. More... | |
int | getFrameStamp () |
Returns the current frame stamp. More... | |
bool | updateTexture (Color *buffer) |
Populates the provided color buffer with the current video frame. More... | |
bool | fastPath () |
bool | updateTexture32 (uint32_t *buffer) |
void | updateTextureGL (int textureID) |
Updates the specified OpenGL texture with the current video frame. More... | |
Static Public Member Functions | |
static VideoSource * | newVideoSource () |
Returns the correct VideoSource subclass for use on the current platform. More... | |
Protected Types | |
enum | DeviceState { DEVICE_CLOSED, DEVICE_OPEN, DEVICE_GETTING_READY, DEVICE_RUNNING } |
Protected Member Functions | |
void | setError (int error) |
VideoSource () | |
The constructor is not public because instances are created using a factory method. More... | |
Protected Attributes | |
DeviceState | deviceState |
Current state of the video device. More... | |
char * | cameraParam |
Camera parameter filename. More... | |
char * | cameraParamBuffer |
size_t | cameraParamBufferLen |
ARParamLT * | cparamLT |
Camera paramaters. More... | |
char * | videoConfiguration |
Video configuration string. More... | |
int | videoWidth |
Width of the video frame in pixels. More... | |
int | videoHeight |
Height of the video frame in pixels. More... | |
AR_PIXEL_FORMAT | pixelFormat |
Pixel format from ARToolKit enumeration. More... | |
int | m_fastPath |
GLenum | glPixIntFormat |
GLenum | glPixFormat |
GLenum | glPixType |
ARUint8 * | frameBuffer |
Pointer to latest frame. Set by concrete subclass to point to frame data. More... | |
ARUint8 * | frameBuffer2 |
For bi-planar formats, pointer to plane 2 of latest frame. Set by concrete subclass to point to frame data. More... | |
int | frameStamp |
Latest framestamp. Incremented in the concrete subclass when a new frame arrives. More... | |
int | m_error |
Base class for different video source implementations.
A video source provides video frames to the ARToolKit tracking module. Video sources contain information about the video, such as size and pixel format, camera parameters for distortion compensation, as well as the raw video data itself. Different video source implementations are required to provide a standard interface for video input, even though different platforms handle video input quite differently.
|
protected |
|
protected |
The constructor is not public because instances are created using a factory method.
|
virtual |
|
pure virtual |
Asks the video source to capture a frame.
This method must be provided by the subclass.
Implemented in AndroidVideoSource, and ARToolKitVideoSource.
|
pure virtual |
Closes the video source.
This method must be provided by the subclass.
Implemented in AndroidVideoSource, and ARToolKitVideoSource.
void VideoSource::configure | ( | const char * | vconf, |
const char * | cparaName, | ||
const char * | cparaBuff, | ||
size_t | cparaBuffLen | ||
) |
Sets initial parameters which will be used when the video source
is opened.
bool VideoSource::fastPath | ( | ) |
ARParamLT * VideoSource::getCameraParameters | ( | ) |
Returns the camera parameters for the video source.
int VideoSource::getError | ( | ) |
ARUint8 * VideoSource::getFrame | ( | ) |
Returns the current frame.
int VideoSource::getFrameStamp | ( | ) |
Returns the current frame stamp.
If the returned value has changed since the last time this function was called, then the caller can assume a new frame is available.
|
pure virtual |
Returns the name of this video source variation.
This method must be provided by the subclass.
Implemented in AndroidVideoSource, and ARToolKitVideoSource.
AR_PIXEL_FORMAT VideoSource::getPixelFormat | ( | ) |
Returns the pixel format of the video.
int VideoSource::getVideoHeight | ( | ) |
Returns the height of the video in pixels.
int VideoSource::getVideoWidth | ( | ) |
Returns the width of the video in pixels.
bool VideoSource::isOpen | ( | ) |
Returns true if the video source is open.
bool VideoSource::isRunning | ( | ) |
Returns true if the video source is open and ready to be queried.
|
static |
Returns the correct VideoSource subclass for use on the current platform.
|
pure virtual |
Opens the video source.
This method must be provided by the subclass.
Implemented in AndroidVideoSource, and ARToolKitVideoSource.
|
protected |
bool VideoSource::updateTexture | ( | Color * | buffer | ) |
Populates the provided color buffer with the current video frame.
buffer | The color buffer to populate with frame data |
bool VideoSource::updateTexture32 | ( | uint32_t * | buffer | ) |
void VideoSource::updateTextureGL | ( | int | textureID | ) |
Updates the specified OpenGL texture with the current video frame.
textureID | The OpenGL texture ID to which the video frame should be uploaded |
|
protected |
Camera parameter filename.
|
protected |
|
protected |
|
protected |
Camera paramaters.
|
protected |
Current state of the video device.
|
protected |
Pointer to latest frame. Set by concrete subclass to point to frame data.
|
protected |
For bi-planar formats, pointer to plane 2 of latest frame. Set by concrete subclass to point to frame data.
|
protected |
Latest framestamp. Incremented in the concrete subclass when a new frame arrives.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Pixel format from ARToolKit enumeration.
|
protected |
Video configuration string.
|
protected |
Height of the video frame in pixels.
|
protected |
Width of the video frame in pixels.