![]() |
KudanAR - Android
1.6.0
|
Inherits PreviewCallback.
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 () |
Public Attributes | |
ARView | mArView |
A manager class for handling the camera stream. It has default camera stream dimensions of 640*480.
ARCameraStream.ARCameraStream | ( | ) |
Initialises the camera stream. This is handled automatically.
void ARCameraStream.addListener | ( | ARCameraStreamListener | listener | ) |
Add ARCameraStreamListener to list of listeners.
listener |
float [] ARCameraStream.getCameraTransform | ( | ) |
Returns the transform of the camera associated with the ARCameraStream as a float array.
int ARCameraStream.getHeight | ( | ) |
Returns the height of the camera image.
Example of use:
int imageHeight = ARCameraStream.getInstance().getHeight();
|
static |
Gets the instance of the camera stream singleton. The ARCameraStream is initialised when this is first called.
ARCameraTextureMaterial ARCameraStream.getMaterial | ( | ) |
Return the texture material of ARCameraStream.
ARTexture ARCameraStream.getTexture | ( | ) |
Returns the texture of the ARCameraStream.
int ARCameraStream.getWidth | ( | ) |
Returns the width of the camera image.
void ARCameraStream.initialise | ( | ) |
Initialises ARCameraStream.
void ARCameraStream.notifyListenersUpdateFrame | ( | final byte[] | data | ) |
Notifies listeners that new frame has been received. Sends camera frame to listeners.
data | Camera preview frame. |
void ARCameraStream.onPreviewFrame | ( | final byte[] | data, |
Camera | arg1 | ||
) |
Android camera interface method for receiving a camera preview frame.
data | An array of bytes representing the image frame. |
arg1 | Reference to the camera. |
void ARCameraStream.removeListener | ( | ARCameraStreamListener | listener | ) |
Remove ARCameraStreamListener from list of listeners.
listener |
void ARCameraStream.setCameraTransform | ( | float[] | transform | ) |
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);
transform | The float array to set the camera's transform with. |
void ARCameraStream.setMaterial | ( | ARCameraTextureMaterial | material | ) |
Set ARCameraStream's ARCameraTextureMaterial.
material |
void ARCameraStream.setSurfaceTexture | ( | SurfaceTexture | surfaceTexture | ) |
Sets SurfaceTexture for ARCameraStream. This is the texture used for the camera preview.
surfaceTexture | The SurfaceTexture for ARCameraStream. |
void ARCameraStream.setTexture | ( | ARTexture | texture | ) |
Set the ARCameraStream texture which is updated each frame.
texture |
void ARCameraStream.start | ( | ) |
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 ARCameraStream.stop | ( | ) |
Stops the camera stream input and releases the camera. This is handled automatically when the user leaves the ARActivity.