|
PulpCore | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object pulpcore.image.filter.Filter pulpcore.image.filter.Superimpose
public final class Superimpose
The Superimpose filter allows to superimpose an image over a sprite. This filter uses 3 parameters: - An image that will be superimposed over the filtered sprite. This image can be a different size of the Sprite. - the position (through x and y attributes) of the image. Coordinate are relative to the upper-left pixel position of the filtered sprite. Default values are 0,0 - an alpha value applied on the superimposed image. Default value is 255 (no fading). Each of this value can move from -255 to 255. Higher values will be clamped. The alpha channel of the original image is not affected by the filter.
Field Summary | |
---|---|
Int |
alpha
Fading applied to the superimposed image, from 0 to 255. |
Int |
x
The x offset of the superimposed image. |
Int |
y
The y offset of the superimposed image. |
Constructor Summary | |
---|---|
Superimpose()
Creates the Superimpose filter with no image. |
|
Superimpose(CoreImage image)
Creates the superimpose filter with the specified image. |
|
Superimpose(CoreImage image,
int x,
int y)
Creates a Superimpose filter with the specified parameters. |
|
Superimpose(CoreImage image,
int x,
int y,
int alpha)
Creates a Superimpose filter with the specified parameters. |
Method Summary | |
---|---|
Filter |
copy()
Creates a copy of the Filter for another Sprite to use. |
protected void |
filter(CoreImage src,
CoreImage dst)
Performs this filter on the input image onto the specified output image. |
int |
getHeight()
Gets the height of the output of this filter. |
CoreImage |
getImage()
Image accessors. |
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. |
void |
setImage(CoreImage image)
Image accessors |
void |
update(int elapsedTime)
Updates the filter. |
Methods inherited from class pulpcore.image.filter.Filter |
---|
filter, getInput, getOutput, isDirty, isOpaque, setDirty, setInput |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public final Int alpha
public final Int x
public final Int y
Constructor Detail |
---|
public Superimpose()
public Superimpose(CoreImage image)
image
- Image to superimpose to the filtered Sprite.public Superimpose(CoreImage image, int x, int y)
image
- Image to superimpose to the filtered Sprite.x
- position X relative to the sprite.y
- position Y relative to the sprite.public Superimpose(CoreImage image, int x, int y, int alpha)
image
- Image to superimpose to the filtered Sprite.x
- X offset (relative to the upper-left point of the filtered sprite).y
- Y offset (relative to the upper-left point of the filtered sprite).alpha
- amount of fading applied to the superimposed image, from 0 to 255.Method Detail |
---|
public CoreImage getImage()
public void setImage(CoreImage image)
image
- The superimposed image to apply to this filter.public Filter copy()
Filter
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; }
copy
in class Filter
public void update(int elapsedTime)
Filter
update
in class Filter
public int getHeight()
Filter
getHeight
in class Filter
public int getWidth()
Filter
getWidth
in class Filter
public int getX()
Filter
getX
in class Filter
public int getY()
Filter
getY
in class Filter
protected void filter(CoreImage src, CoreImage dst)
Filter
This method is called from Filter.getOutput()
if Filter.isDirty()
returns true.
The output image will be the same dimensions as
(Filter.getWidth()
x Filter.getHeight()
. Implementors must ensure
that every pixel in output
is drawn.
filter
in class Filter
|
PulpCore | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |