new DataTexture( width, height ) → {DataTexture}

Description
Creates a DataTexture object
Parameters
Name Type Description
width number Width of texture in pixels
height number Height of texture in pixels
Returns

Members


width :number

Description
width of texture in pixels

height :number

Description
height of texture in pixels

channels :number

Description
number of color channels for texture (RGBA)
Details
number

4


Number :number

Description
Number of pixels per data element
Details
number

1


data :Uint8Array

Description
Uint8Array of texture image data

texture :WebglTexture

Description
WebglTexture that is initialized in the WebglContext

isInit :boolean

Description
Has the texture been initialized in the WebglContext

init

Description
initializes texture in WebglContext
Parameters
Name Type Description
gl WebglContext WebglContext

updatePixel

Parameters
Name Type Description
gl WebglContext WebglContext to update texture in
c Array Color to update pixel with in RGBA[0-1]
row number Row of pixel to update
column number Column of pixel to update

updatePixelId

Description
Update pixel with new data, id: 0 = (0,0), id:1 = (0,1),...etc
Parameters
Name Type Description
gl WebglContext WebglContext to update texture in
c number Color to update pixel with
id number Id to update

updateSubrect

Description
Update entire texture
Parameters
Name Type Description
gl WebglContext WebglContext to update texture in
c Array Colors to update rect with

getIdColor

Description
Gets current color for id in [r,g,b,a] format
Parameters
Name Type Description
id number
Returns
color in [r,g,b,a] format