Class Index | File Index

Classes


Class JSC3D.Texture

Texture This class implements texture which describes the surface details for a mesh.
Defined in: jsc3d.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
JSC3D.Texture(name, onready)
Field Summary
Field Attributes Field Name and Description
 
Whether the texture contains tranparent pixels.
 
Height of the texture in pixels.
 
Name of the texture.
 
A callback function that will be invoked immediately as the texture is ready.
 
URL of the image source of the texture.
 
Width of the texture in pixels.
Method Summary
Method Attributes Method Name and Description
 
createFromImage(image, useMipmap)
Extract texture data from an exsisting image.
 
createFromUrl(imageUrl, useMipmap)
Load an image and extract texture data from it.
 
Generate mip-map pyramid for the texture.
 
See if this texture contains texel data.
 
See if this texture has mip-maps.
Class Detail
JSC3D.Texture(name, onready)
Parameters:
name
onready
Field Detail
hasTransparency
Whether the texture contains tranparent pixels. Read only.

height
Height of the texture in pixels. Read only.

name
Name of the texture.

onready
A callback function that will be invoked immediately as the texture is ready.

srcUrl
URL of the image source of the texture. Read only.

width
Width of the texture in pixels. Read only.
Method Detail
createFromImage(image, useMipmap)
Extract texture data from an exsisting image.
Parameters:
{Image} image
image as datasource of the texture.
{Boolean} useMipmap
set true to generate mip-maps; false(default) not to generate mip-maps.

createFromUrl(imageUrl, useMipmap)
Load an image and extract texture data from it.
Parameters:
{String} imageUrl
where to load the image.
{Boolean} useMipmap
set true to generate mip-maps; false(default) not to generate mip-maps.

generateMipmaps()
Generate mip-map pyramid for the texture.

{Boolean} hasData()
See if this texture contains texel data.
Returns:
{Boolean} true if it has texel data; false if not.

{Boolean} hasMipmap()
See if this texture has mip-maps.
Returns:
{Boolean} true if it has mip-maps; false if not.

Documentation generated by JsDoc Toolkit 2.1.0 on Thu Nov 20 2014 00:20:57 GMT+0800 (CST)