Class Filter
Base class that all filters should inherit from.
Methods
void
applyFilter
(
ctx
,
x
,
y
,
width
,
height
,
targetCtx
,
targetX
,
targetY
)
Applies the filter to the specified context.
- Parameters:
-
ctx
<object>
The 2D context to use as the source.
-
x
<object>
The x position to use for the source rect.
-
y
<object>
The y position to use for the source rect.
-
width
<object>
The width to use for the source rect.
-
height
<object>
The height to use for the source rect.
-
targetCtx
<object>
Optional. The 2D context to draw the result to. Defaults to the context passed to ctx.
-
targetX
<object>
Optional. The x position to draw the result to. Defaults to the value passed to x.
-
targetY
<object>
Optional. The y position to draw the result to. Defaults to the value passed to y.
- Returns:
void
Filter
clone
(
)
Returns a clone of this Filter instance.
- Returns:
Filter
- A clone of the current Filter instance.
Rectangle
getBounds
(
)
Returns a rectangle with values indicating the margins required to draw the filter.
For example, a filter that will extend the drawing area 4 pixels to the left, and 7 pixels to the right
(but no pixels up or down) would return a rectangle with (x=-4, y=0, width=11, height=0).
- Returns:
Rectangle
- a rectangle object indicating the margins required to draw the filter.
protected
void
initialize
(
)
Initialization method.
String
toString
(
)
Returns a string representation of this object.
- Returns:
String
- a string representation of the instance.