Home Reference Source
public class | source

AbstractTexture

Extends:

GLBoostObject → AbstractTexture

Indirect Subclass:

PhinaTexture

This is the abstract class for all texture classes. Don't use this class directly.

Constructor Summary

Public Constructor
public

constructor(glBoostContext: *)

The constructor of PointLight class.

Member Summary

Public Members
public get

glTextureResource: *: nullliteral | existentialtypeparam

get the WebGL texture resource within this class.

public get

height: *

public set
public get
public get
public set
public get
public set
public get

width: *

Private Members
private
private
private

Method Summary

Public Methods
public

getPixelValueAt(x: number, y: number, argByteArray: Uint8Array): Vector4

Origin is left bottom

public
public
public

setUp(textureUnitIndex: *): boolean

bind the texture.

public

tearDown(textureUnitIndex: *)

unbind the texture.

Private Methods
private

get a value nearest power of two.

private

_getResizedCanvas(image: *): *

private

check whether or not this texture size is power of two.

private

Inherited Summary

From class GLBoostObject
public static
private static
private static
public get
public get
public get

Return the simple class-specific number.

public get
public get
public get
public get
public get
public get
public set
private
private
private
private
private
private
private
private
private
private
public
public
public
public

Return instance name.

public
private

_copy(instance: *)

private

Public Constructors

public constructor(glBoostContext: *) source

The constructor of PointLight class. Do not construct this class directly.

  • @param {HTMLCanvas|string} canvas canvas or canvas' id string.

Override:

GLBoostObject#constructor

Params:

NameTypeAttributeDescription
glBoostContext *

Public Members

public get glTextureResource: *: nullliteral | existentialtypeparam source

get the WebGL texture resource within this class.

Return:

*

WebGL texture resouce.

public get height: * source

public set textureUnitIndex: * source

public get textureUnitIndex: * source

public get toMultiplyAlphaToColorPreviously: * source

public set toMultiplyAlphaToColorPreviously: * source

public get uvTransform: * source

public set uvTransform: * source

public get width: * source

Private Members

private _textureUnitIndex: number source

private _toMultiplyAlphaToColorPreviously: boolean source

private _uvTransform: * source

Public Methods

public getPixelValueAt(x: number, y: number, argByteArray: Uint8Array): Vector4 source

Origin is left bottom

Params:

NameTypeAttributeDescription
x number

horizontal pixel position (0 is left)

y number

virtical pixel position (0 is bottom)

argByteArray Uint8Array

Pixel Data as Uint8Array

Return:

Vector4

Pixel Value in Vector4

public getTexturePixelData(): * source

Return:

*

public readyForDiscard() source

Override:

GLBoostObject#readyForDiscard

public setUp(textureUnitIndex: *): boolean source

bind the texture. It calls bindTexture on WebGL only if it has WebGL texture. Otherwise it returns false without doing anything.

Params:

NameTypeAttributeDescription
textureUnitIndex *

Return:

boolean

public tearDown(textureUnitIndex: *) source

unbind the texture.

Params:

NameTypeAttributeDescription
textureUnitIndex *

Private Methods

private _getNearestPowerOfTwo(x: number): number source

get a value nearest power of two.

Params:

NameTypeAttributeDescription
x number

texture size.

Return:

number

a value nearest power of two.

private _getResizedCanvas(image: *): * source

Params:

NameTypeAttributeDescription
image *

Return:

*

private _isPowerOfTwo(x: number): boolean source

check whether or not this texture size is power of two.

Params:

NameTypeAttributeDescription
x number

texture size.

Return:

boolean

check whether or not the size x is power of two.

private _isPowerOfTwoTexture(): * source

Return:

*