KudanAR - Android
ARCameraStream Class Reference
+ Inheritance diagram for ARCameraStream:
+ Collaboration diagram for ARCameraStream:

Public Member Functions

void setCameraTransform (float[]transform)
 
float[] getCameraTransform ()
 
ARTexture getTexture ()
 
void setTexture (ARTexture texture)
 
ARCameraTextureMaterial getMaterial ()
 
void setMaterial (ARCameraTextureMaterial material)
 
 ARCameraStream ()
 
void setSurfaceTexture (SurfaceTexture surfaceTexture)
 
void onPreviewFrame (final byte[] data, Camera arg1)
 
void initialise ()
 
void start ()
 
void stop ()
 
int getWidth ()
 
int getHeight ()
 
void rotateCameraPreview (int degrees)
 
void addListener (ARCameraStreamListener listener)
 
void removeListener (ARCameraStreamListener listener)
 
void notifyListenersUpdateFrame (final byte[] data)
 

Static Public Member Functions

static ARCameraStream getInstance ()
 

Data Fields

ARView mArView
 

Detailed Description

A manager class for handling the camera stream. It has default camera stream dimensions of 640*480.

Constructor & Destructor Documentation

ARCameraStream ( )
inline

Initialises the camera stream. This is handled automatically.

Member Function Documentation

void addListener ( ARCameraStreamListener  listener)
inline

Add ARCameraStreamListener to list of listeners.

Parameters
listener
float [] getCameraTransform ( )
inline

Returns the transform of the camera associated with the ARCameraStream as a float array.

Returns
The camera transform of the ARCameraStream.
int getHeight ( )
inline

Returns the height of the camera image.

Example of use:

int imageHeight = ARCameraStream.getInstance().getHeight();
Returns
The height of the camera image, in pixels.
static ARCameraStream getInstance ( )
inlinestatic

Gets the instance of the camera stream singleton. The ARCameraStream is initialised when this is first called.

Returns
The singleton instance of the ARCameraStream.
ARCameraTextureMaterial getMaterial ( )
inline

Return the texture material of ARCameraStream.

Returns
ARCameraTextureMaterial
ARTexture getTexture ( )
inline

Returns the texture of the ARCameraStream.

Returns
The texture of the current ARCameraStream frame.
int getWidth ( )
inline

Returns the width of the camera image.

Returns
The width of the camera image, in pixels.
void initialise ( )
inline

Initialises ARCameraStream.

void notifyListenersUpdateFrame ( final byte[]  data)
inline

Notifies listeners that new frame has been received. Sends camera frame to listeners.

Parameters
dataCamera preview frame.
void onPreviewFrame ( final byte[]  data,
Camera  arg1 
)
inline

Android camera interface method for receiving a camera preview frame.

Parameters
dataAn array of bytes representing the image frame.
arg1Reference to the camera.
void removeListener ( ARCameraStreamListener  listener)
inline

Remove ARCameraStreamListener from list of listeners.

Parameters
listener
void setCameraTransform ( float[]  transform)
inline

Sets the camera transform of the ARCameraStream. Used to transform from 2d coodinates to texture coordinates.

Example of use:

float[] cameraTransform = mCameraSurfaceTexture.getTransformMatrix(m);
ARCameraStream.getInstance().setCameraTransform(cameraTransform);
Parameters
transformThe float array to set the camera's transform with.
void setMaterial ( ARCameraTextureMaterial  material)
inline

Set ARCameraStream's ARCameraTextureMaterial.

Parameters
material
void setSurfaceTexture ( SurfaceTexture  surfaceTexture)
inline

Sets SurfaceTexture for ARCameraStream. This is the texture used for the camera preview.

Parameters
surfaceTextureThe SurfaceTexture for ARCameraStream.
void setTexture ( ARTexture  texture)
inline

Set the ARCameraStream texture which is updated each frame.

Parameters
texture
void start ( )
inline

Starts the camera stream. This is handled automatically when the ARActivity enters the foreground. This method sets up the camera texture that is drawn to the screen.

void stop ( )
inline

Stops the camera stream input and releases the camera. This is handled automatically when the user leaves the ARActivity.


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