|
PulpCore | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object pulpcore.image.filter.Filter
public abstract class Filter
Base class for image filters. Subclasses override the
filter(pulpcore.image.CoreImage, pulpcore.image.CoreImage)
method.
Sprite.setFilter(pulpcore.image.filter.Filter)
Constructor Summary | |
---|---|
Filter()
|
Method Summary | |
---|---|
abstract Filter |
copy()
Creates a copy of the Filter for another Sprite to use. |
CoreImage |
filter(CoreImage input)
Performs this filter on the input image onto a newly created output image. |
protected abstract void |
filter(CoreImage input,
CoreImage output)
Performs this filter on the input image onto the specified output image. |
int |
getHeight()
Gets the height of the output of this filter. |
CoreImage |
getInput()
|
CoreImage |
getOutput()
Gets the filtered output image. |
int |
getWidth()
Gets the width of the output of this filter. |
int |
getX()
Gets the x offset the output image should display relative to the input. |
int |
getY()
Gets the y offset the output image should display relative to the input. |
boolean |
isDirty()
|
boolean |
isOpaque()
Returns true if the output of this filter is opaque. |
void |
setDirty()
|
void |
setInput(CoreImage input)
Sets the filter input. |
void |
update(int elapsedTime)
Updates the filter. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Filter()
Method Detail |
---|
public int getX()
public int getY()
public int getWidth()
public int getHeight()
public boolean isOpaque()
public void update(int elapsedTime)
protected abstract void filter(CoreImage input, CoreImage output)
This method is called from getOutput()
if isDirty()
returns true.
The output image will be the same dimensions as
(getWidth()
x getHeight()
. Implementors must ensure
that every pixel in output
is drawn.
public abstract Filter copy()
This method is used by the Sprite class. Most apps will not need to call this method.
Subclasses should bind all properties of the cloned object using bindWithInverse(). For example, for the HSBAdjust filter:
public Filter copy() { HSBAdjust copy = new HSBAdjust(); copy.hue.bindWithInverse(hue); copy.brightness.bindWithInverse(brightness); copy.saturation.bindWithInverse(saturation); return copy; }
public final CoreImage filter(CoreImage input)
public final void setInput(CoreImage input)
public final CoreImage getInput()
public final CoreImage getOutput()
public final boolean isDirty()
public final void setDirty()
|
PulpCore | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |