![]() |
KudanAR - iOS
1.6.0
|
#import <ARTexture.h>
Inherits NSObject.
Inherited by ARPlayableTexture, and ARTextureCube.
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 Types | |
enum | ARTextureFilter { ARTextureFilterNearest, ARTextureFilterLinear } |
Protected Attributes | |
NSData * | _rawImage |
Properties | |
GLuint | textureID |
unsigned long | width |
unsigned long | height |
BOOL | isPowerOfTwo |
ARTextureFilter | minificationFilter |
ARTextureFilter | magnificationFilter |
An ARTexture is a class representing a 2D texture. Textures cannot exceed 2048x2048 pixels in size.
Textures are typically used for images to decorate 3D models, but in reality they can be used to store many different kinds of data on the GPU.
|
protected |
- (void) generateTexture |
Generates a new texture on the GPU using the texture ID.
- (instancetype) initWithEmpty |
Create an empty texture to be loaded with an image later.
Example of use:
- (instancetype) initWithUIImage: | (UIImage *) | image |
- (void) loadTextureFromUIImage: | (UIImage *) | image | |
reverseLines: | (BOOL) | reverseLines | |
Loads image data, sets image width and height, sets pixel format, and stores it in the rawImage property.
image | Image to generate texture from. |
reverseLines | Whether 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.
- (void) uploadTexture |
Allocate memory on the GPU to the texture and upload texture data to it.
|
protected |
The raw image data, in bytes. This data is in the RGBA format.
|
readwritenonatomicassign |
The height of the texture, in pixels.
|
readwritenonatomicassign |
Whether or not this texture is a "Power of Two" texture. A texture is "Power of Two" if and only if its width and height are both some power of 2 (64, 128, 256, 1024, etc). While it is not a problem if a texture is not "Power of Two", there are some features of OpenGL that can only be used with "Power of Two" textures.
|
readwritenonatomicassign |
The filtering type used for magnification. ARTextureFilterLinear is recommended for less aliasing. Magnification is a type of reconstruction filter where sparse data is interpolated to fill gaps.
|
readwritenonatomicassign |
The filtering type used for minification. ARTextureFilterLinear is recommended for less aliasing. Minification is a type of anti-aliasing, where texture samples exist at a higher frequency than required for the sample frequency needed for texture fill.
|
readwritenonatomicassign |
The texture's handle in OpenGL. This is a reference to the texture and allows access to it on the GPU.
|
readwritenonatomicassign |
The width of the texture, in pixels.