KudanAR - iOS  1.6.0
ARExtractedCameraTexture Class Reference

#import <ARExtractedCameraTexture.h>

Inherits ARRenderTargetTexture, and <ARRendererDelegate>.

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 type of render target that takes its data directly from the camera stream and renders to a texture. This essentially takes a portion of the camera stream and applies it to a mesh. This mesh can then be manipulated, moved, even deformed, to create some unique visuals.

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

◆ initWithWidth:height:

- (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. The offset node's position is half the width and height, meaning the centre of the node is in the middle of the texture.

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.

Reimplemented from ARRenderTargetTexture.

Property Documentation

◆ srcHeight

- (float) srcHeight
readwritenonatomicassign

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

◆ srcNode

- (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 it to the area of interest (e.g the world of a trackable). Can be reparented to your own nodes.

◆ srcWidth

- (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 files:
ARExtractedCameraTexture::srcNode
ARNode * srcNode
Definition: ARExtractedCameraTexture.h:39
ARExtractedCameraTexture::srcHeight
float srcHeight
Definition: ARExtractedCameraTexture.h:49
ARImageTrackable
Definition: ARImageTrackable.h:12
ARExtractedCameraTexture::srcWidth
float srcWidth
Definition: ARExtractedCameraTexture.h:44
ARNode
Definition: ARNode.h:19
ARRenderTarget::height
float height
Definition: ARRenderTarget.h:48
ARExtractedCameraTexture
Definition: ARExtractedCameraTexture.h:33