KudanAR - iOS
ARTexture Class Reference

#import <ARTexture.h>

+ Inheritance diagram for ARTexture:
+ Collaboration diagram for ARTexture:

Instance Methods

(instancetype) - initWithUIImage:
 
(instancetype) - initWithEmpty
 
(instancetype) - initWithExistingTextureID:
 
(void) - generateTexture
 
(void) - uploadTexture
 
(void) - loadTextureFromUIImage:reverseLines:
 
(void) - uploadBGRATexture:width:height:
 
(void) - uploadBGRATextureSub:width:height:
 
(BOOL) - preRender
 
(void) - postRender
 

Protected Attributes

NSData * _rawImage
 

Properties

unsigned textureID
 
unsigned long width
 
unsigned long height
 
BOOL isPowerOfTwo
 
ARTextureFilter minificationFilter
 
ARTextureFilter magnificationFilter
 

Detailed Description

An ARTexture is a class representing a 2D texture. Textures cannot exceed 2048x2048 pixels in size.

Method Documentation

- (void) generateTexture

Generates texture names using texure id.

- (instancetype) initWithEmpty

Create an empty texture to be loaded with an image later.

Example of use:

ARTexture *texture = [[ARTexture alloc] initWithEmpty];
- (instancetype) initWithUIImage: (UIImage *)  image

Create a texture from a UIImage.

Example of use:

ARTexture *texture = [[ARTexture alloc] initWithUIImage:[UIImage imageNamed:@"example.jpg"]];
Parameters
imageThe UIImage to create the texture from.
- (void) loadTextureFromUIImage: (UIImage *)  image
reverseLines: (BOOL)  reverseLines 

Loads image data into rawimage, sets image width and height, sets pixel format.

Parameters
imageImage to generate texture from.
reverseLinesWhether to read pixels from top(YES) or bottom.
- (void) postRender

Method called just after this texture has been used in rendering.

- (BOOL) preRender

Method called just before this texture is rendered.

Returns
BOOL Whether or not to proceed with rendering.
- (void) uploadTexture

Uploads texture to OpenGL.

Property Documentation

- (unsigned long) height
readwritenonatomicassign

The height of the texture, in pixels.

- (ARTextureFilter) magnificationFilter
readwritenonatomicassign

The filtering type used for magnification. ARTextureFilterLinear is recommended for less aliasing.

- (ARTextureFilter) minificationFilter
readwritenonatomicassign

The filtering type used for minification. ARTextureFilterLinear is recommended for less aliasing.

- (unsigned) textureID
readwritenonatomicassign

Texture name in OpenGL.

- (unsigned long) width
readwritenonatomicassign

The width of the texture, in pixels.


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