Class CAAT.Module.Image.ImageProcessor.IMBumpMapping
Extends
CAAT.Module.Image.ImageProcessor.ImageProcessor.
Defined in: IMBumpMapping.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Method Attributes | Method Name and Description |
---|---|
applyIM(director, time)
Applies the bump effect and makes it visible on the canvas surface.
|
|
<private> |
Create a phong image to apply bump effect.
|
drawColored(dstPixels)
Generates a bump image.
|
|
initialize(image, radius)
Initialize the bump image processor.
|
|
<private> |
prepareBump(image, radius)
Initializes internal bump effect data.
|
setLightColors(colors_rgb_array)
Sets lights color.
|
|
setLightPosition(lightIndex, x, y)
Set a light position.
|
|
soften(bump)
Soften source images extracted data on prepareBump method.
|
- Methods borrowed from class CAAT.Module.Image.ImageProcessor.ImageProcessor:
- clear, createPattern, getCanvas, getImageData, grabPixels, makeArray, makeArray2D, paint
Method Detail
applyIM(director, time)
Applies the bump effect and makes it visible on the canvas surface.
- Parameters:
- director
- {CAAT.Director}
- time
- {number}
<private>
calculatePhong()
Create a phong image to apply bump effect.
drawColored(dstPixels)
Generates a bump image.
- Parameters:
- dstPixels
- {ImageData.data} destinarion pixel array to store the calculated image.
initialize(image, radius)
Initialize the bump image processor.
- Parameters:
- image
- {HTMLImageElement} source image to bump.
- radius
- {number} light radius.
<private>
prepareBump(image, radius)
Initializes internal bump effect data.
- Parameters:
- image
- {HTMLImageElement}
- radius
- {number} lights radius.
setLightColors(colors_rgb_array)
Sets lights color.
- Parameters:
- colors_rgb_array
- an array of arrays. Each internal array has three integers defining an RGB color. ie: [ [ 255,0,0 ], [ 0,255,0 ] ]
- Returns:
- this
setLightPosition(lightIndex, x, y)
Set a light position.
- Parameters:
- lightIndex
- {number} light index to position.
- x
- {number} light x coordinate.
- y
- {number} light y coordinate.
- Returns:
- this
soften(bump)
Soften source images extracted data on prepareBump method.
- Parameters:
- bump
- bidimensional array of black and white source image version.
- Returns:
- bidimensional array with softened version of source image's b&w representation.