![]() |
KudanAR - Android
1.6.0
|
Inherits ARRenderTargetTexture, and ARRendererListener.
Public Member Functions | |
float | getmSrcHeight () |
float | getmSrcWidth () |
void | setSrcWidth (float srcWidth) |
void | setSrcHeight (float srcHeight) |
void | setSrcNode (ARNode node) |
ARNode | getSrcNode () |
ARExtractedCameraTexture (int width, int height) | |
void | preRender () |
void | postRender () |
void | rendererDidPause () |
void | rendererDidResume () |
![]() | |
ARRenderTargetTexture (int width, int height) | |
ARTexture2D | getTexture () |
void | bind () |
void | create () |
void | draw () |
int | getWidth () |
int | getHeight () |
![]() | |
ARRenderTarget () | |
void | setPriority (int priority) |
int | getPriority () |
void | setShouldClear (boolean shouldClear) |
boolean | getShouldClear () |
void | setShouldClearDepth (boolean shouldClearDepth) |
boolean | getShouldClearDepth () |
void | clear () |
void | setCamera (ARCamera camera) |
ARCamera | getCamera () |
List< ARViewPort > | getViewPorts () |
void | addViewPort (ARViewPort viewPort) |
Bitmap | screenshot (int width, int height) |
Additional Inherited Members | |
![]() | |
int | mFramebufferID |
The ARExtractedCameraTexture is a texture that takes its data directly from the camera stream. This can be used during rendering to deform the camera texture.
Example of use for Marker tracking:
ARImageTrackable imageTrackable = new ARImageTrackable(); imageTrackable.loadFromAsset("example.jpg"); ARExtractedCameraTexture cameraTexture = new ARExtractedCameraTexture(512, 512);
cameraTexture.setSrcNode(new ARNode()); cameraTexture.setSrcWidth(imageTrackable.getWidth()); cameraTexture.setSrcHeight(imageTrackablegetHheight());
imageTrackable.getWorld().addChild(cameraTexture.getSrcNode());
Example of use for Markerless tracking:
ARExtractedCameraTexture cameraTexture = new ARExtractedCameraTexture(512, 512);
cameraTexture.setSrcNode(new ARNode()); cameraTexture.setSrcWidth(100); cameraTexture.setSrcHeight(100);
ARExtractedCameraTexture.ARExtractedCameraTexture | ( | int | width, |
int | height | ||
) |
Initialises the texture with the given dimensions. Overall resolution doesn't have to match the aspect ratio of srcWidth:srcHeight.
width | The width of the extracted texture. Maximum width 2048. Recommended width 512 for balance between performance and quality. |
height | The height of the extracted texture. Maximum width 2048. Recommended height 512 for balance between performance and quality. |
float ARExtractedCameraTexture.getmSrcHeight | ( | ) |
Returns the source node's height.
float ARExtractedCameraTexture.getmSrcWidth | ( | ) |
Returns the source node's width.
ARNode ARExtractedCameraTexture.getSrcNode | ( | ) |
Gets the source node of the extracted camera texture. This node defines the region of the camera image the texture should be extracted from. Move this node around by adding it to the area of interest (e.g the world of a trackable). Can be re-parented to your own nodes.
void ARExtractedCameraTexture.postRender | ( | ) |
Method called just after rendering each frame.
Implements ARRendererListener.
void ARExtractedCameraTexture.preRender | ( | ) |
ARRendererListener interface method. Updates ARCameraBackgroundMaterials model view projection matrix.
Implements ARRendererListener.
void ARExtractedCameraTexture.rendererDidPause | ( | ) |
Method called when the renderer has been paused. This can be used to shut down other subsystems.
Implements ARRendererListener.
void ARExtractedCameraTexture.rendererDidResume | ( | ) |
Method called when the renderer resumes after being paused.
Implements ARRendererListener.
void ARExtractedCameraTexture.setSrcHeight | ( | float | srcHeight | ) |
Sets the source node's height.
srcHeight | The height to give the source node. |
void ARExtractedCameraTexture.setSrcNode | ( | ARNode | node | ) |
Sets source node which defines the region of the camera image the texture should be extracted from.
node |
void ARExtractedCameraTexture.setSrcWidth | ( | float | srcWidth | ) |
Sets the source node's width.
srcWidth | The width to give the source node. |