KudanAR - iOS
ARExtractedCameraTexture Class Reference

#import <ARExtractedCameraTexture.h>

+ Inheritance diagram for ARExtractedCameraTexture:
+ Collaboration diagram for ARExtractedCameraTexture:

Instance Methods

(instancetype) - initWithWidth:height:
 
- Instance Methods inherited from ARRenderTarget
(void) - addViewPort:
 
(void) - addViewPort:zOrder:
 
(void) - removeViewPort:
 
(void) - clearViewPorts
 
(ARViewPort *) - createDefaultViewPort
 
(void) - addDelegate:
 
(UIImage *) - screenshot
 
(BOOL) - checkFBO
 
(void) - bindBuffer
 
(void) - bindCaptureBuffer
 
(void) - draw
 
(void) - drawForCapture
 
- Instance Methods inherited from <ARRendererDelegate>
(void) - rendererPreRender
 
(void) - rendererPostRender
 
(void) - rendererDidPause
 
(void) - rendererDidResume
 

Properties

ARNodesrcNode
 
float srcWidth
 
float srcHeight
 
- Properties inherited from ARRenderTargetTexture
ARTexturetexture
 
- Properties inherited from ARRenderTarget
NSArray * viewPorts
 
NSUInteger numberOfViewPorts
 
float width
 
float height
 
NSArray * delegates
 
NSInteger priority
 
BOOL hasDepth
 
BOOL hasStencil
 
BOOL manualDraw
 
NSDictionary * captureColourToNode
 
BOOL touchEventReceived
 
CGPoint touchPoint
 

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 = [[ARImageTrackable alloc] initWithBundledFile:@"example.jpg"];
ARExtractedCameraTexture *cameraTexture = [[ARExtractedCameraTexture alloc] initWithWidth:512 height:512];
cameraTexture.srcNode = [ARNode nodeWithName:@"camera texture source node"];
cameraTexture.srcWidth = trackable.width;
cameraTexture.srcHeight = trackable.height;
[trackable.world addChild:extracted.srcNode];

Example of use for Markerless tracking:

ARExtractedCameraTexture *cameraTexture = [[ARExtractedCameraTexture alloc] initWithWidth:512 height:512];
cameraTexture.srcNode = [ARNode nodeWithName:@"camera texture source node"];;
cameraTexture.srcWidth = 100;
cameraTexture.srcHeight = 100;

Method Documentation

- (instancetype) initWithWidth: (float)  width
height: (float)  height 

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

Example of use:

ARExtractedCameraTexture *cameraTexture = [[ARExtractedCameraTexture alloc] initWithWidth:512 height:512];
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.

Implements ARRenderTargetTexture.

Property Documentation

- (float) srcHeight
readwritenonatomicassign

The height in the coordinate space of the source node that determines the Y-axis boundaries of the texture.

- (ARNode*) srcNode
readwritenonatomicassign

The node which defines the region of the camera image the texture should be extracted from. Move this node around by adding to the area of interest (e.g the world of a trackable). Can be reparented to your own nodes.

- (float) srcWidth
readwritenonatomicassign

The width in the coordinate space of the source node that determines the X-axis boundaries of the texture.


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