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

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 ()
 
- Public Member Functions inherited from ARRenderTargetTexture
 ARRenderTargetTexture (int width, int height)
 
ARTexture2D getTexture ()
 
void bind ()
 
void create ()
 
void draw ()
 
int getWidth ()
 
int getHeight ()
 
- Public Member Functions inherited from ARRenderTarget
 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 ()
 
void create ()
 
void bind ()
 
void draw ()
 
List< ARViewPortgetViewPorts ()
 
void addViewPort (ARViewPort viewPort)
 
Bitmap screenshot (int width, int height)
 

Additional Inherited Members

- Protected Attributes inherited from ARRenderTarget
int mFramebufferID
 

Detailed Description

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);

Constructor & Destructor Documentation

ARExtractedCameraTexture ( int  width,
int  height 
)
inline

Initialises the texture with the given dimensions. Overall resolution doesn't have to match the aspect ratio of srcWidth:srcHeight.

Parameters
widthThe width of the extracted texture. Maximum width 2048. Recommended width 512 for balance between performance and quality.
heightThe height of the extracted texture. Maximum width 2048. Recommended height 512 for balance between performance and quality.

Member Function Documentation

float getmSrcHeight ( )
inline

Returns the source node's height.

Returns
The height of the source node, in pixels.
float getmSrcWidth ( )
inline

Returns the source node's width.

Returns
The width of the source node, in pixels.
ARNode getSrcNode ( )
inline

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.

Returns
The Source Noce of the extracted camera texture.
void postRender ( )
inline

Method called just after rendering each frame.

Implements ARRendererListener.

void preRender ( )
inline

ARRendererListener interface method. Updates ARCameraBackgroundMaterials model view projection matrix.

Implements ARRendererListener.

void rendererDidPause ( )
inline

Method called when the renderer has been paused. This can be used to shut down other subsystems.

Implements ARRendererListener.

void rendererDidResume ( )
inline

Method called when the renderer resumes after being paused.

Implements ARRendererListener.

void setSrcHeight ( float  srcHeight)
inline

Sets the source node's height.

Parameters
srcHeightThe height to give the source node.
void setSrcNode ( ARNode  node)
inline

Sets source node which defines the region of the camera image the texture should be extracted from.

Parameters
node
void setSrcWidth ( float  srcWidth)
inline

Sets the source node's width.

Parameters
srcWidthThe width to give the source node.

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