Class CAAT.Module.Image.ImageProcessor.ImageProcessor
Defined in: ImageProcessor.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Method Attributes | Method Name and Description |
---|---|
applyIM(director, time)
Sets canvas pixels to be the applied effect.
|
|
clear(r, g, b, a)
Clear this ImageData object to the given color components.
|
|
createPattern(type)
Creates a pattern that will make this ImageProcessor object suitable as a fillStyle value.
|
|
Returns the offscreen canvas.
|
|
Get this ImageData.
|
|
grabPixels(image)
Grabs an image pixels.
|
|
initialize(width, height)
Initializes and creates an offscreen Canvas object.
|
|
makeArray(size, initValue)
Helper method to create an array.
|
|
makeArray2D(size, size2, initvalue)
Helper method to create a bidimensional array.
|
|
paint(director, time)
Paint this ImageProcessor object result.
|
Method Detail
applyIM(director, time)
Sets canvas pixels to be the applied effect. After process pixels, this method must be called
to show the result of such processing.
- Parameters:
- director
- {CAAT.Director}
- time
- {number}
- Returns:
- this
clear(r, g, b, a)
Clear this ImageData object to the given color components.
- Parameters:
- r
- {number} red color component 0..255.
- g
- {number} green color component 0..255.
- b
- {number} blue color component 0..255.
- a
- {number} alpha color component 0..255.
- Returns:
- this
createPattern(type)
Creates a pattern that will make this ImageProcessor object suitable as a fillStyle value.
This effect can be drawn too as an image by calling: canvas_context.drawImage methods.
- Parameters:
- type
- {string} the pattern type. if no value is supplied 'repeat' will be used.
- Returns:
- CanvasPattern.
{HTMLCanvasElement}
getCanvas()
Returns the offscreen canvas.
- Returns:
- {HTMLCanvasElement}
{ImageData}
getImageData()
Get this ImageData.
- Returns:
- {ImageData}
{ImageData}
grabPixels(image)
Grabs an image pixels.
- Parameters:
- image
- {HTMLImageElement}
- Returns:
- {ImageData} returns an ImageData object with the image representation or null in case the pixels can not be grabbed.
initialize(width, height)
Initializes and creates an offscreen Canvas object. It also creates an ImageData object and
initializes the internal bufferImage attribute to imageData's data.
- Parameters:
- width
- {number} canvas width.
- height
- {number} canvas height.
- Returns:
- this
{[]}
makeArray(size, initValue)
Helper method to create an array.
- Parameters:
- size
- {number} integer number of elements in the array.
- initValue
- {number} initial array values.
- Returns:
- {[]} an array of 'initialValue' elements.
{[]}
makeArray2D(size, size2, initvalue)
Helper method to create a bidimensional array.
- Parameters:
- size
- {number} number of array rows.
- size2
- {number} number of array columns.
- initvalue
- array initial values.
- Returns:
- {[]} a bidimensional array of 'initvalue' elements.
paint(director, time)
Paint this ImageProcessor object result.
- Parameters:
- director
- {CAAT.Director}.
- time
- {number} scene time.