KudanAR - Android  1.6.0
ARExtractedCameraTexture Class Reference

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

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.

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

◆ getmSrcHeight()

float ARExtractedCameraTexture.getmSrcHeight ( )

Returns the source node's height.

Returns
The height of the source node, in pixels.

◆ getmSrcWidth()

float ARExtractedCameraTexture.getmSrcWidth ( )

Returns the source node's width.

Returns
The width of the source node, in pixels.

◆ getSrcNode()

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.

Returns
The Source Noce of the extracted camera texture.

◆ postRender()

void ARExtractedCameraTexture.postRender ( )

Method called just after rendering each frame.

Implements ARRendererListener.

◆ preRender()

void ARExtractedCameraTexture.preRender ( )

ARRendererListener interface method. Updates ARCameraBackgroundMaterials model view projection matrix.

Implements ARRendererListener.

◆ rendererDidPause()

void ARExtractedCameraTexture.rendererDidPause ( )

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

Implements ARRendererListener.

◆ rendererDidResume()

void ARExtractedCameraTexture.rendererDidResume ( )

Method called when the renderer resumes after being paused.

Implements ARRendererListener.

◆ setSrcHeight()

void ARExtractedCameraTexture.setSrcHeight ( float  srcHeight)

Sets the source node's height.

Parameters
srcHeightThe height to give the source node.

◆ setSrcNode()

void ARExtractedCameraTexture.setSrcNode ( ARNode  node)

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

Parameters
node

◆ setSrcWidth()

void ARExtractedCameraTexture.setSrcWidth ( float  srcWidth)

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: