|
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.Blur pulpcore.image.filter.Glow
public final class Glow
A Glow filter.
This Glow filter uses 3 parameters :
- amount : the amount of glow to be used. float value that could go from 0 to up to 2 depending on the effect
you're expecting to have. Default value is 0.5;
- radius : the radius of glow to be used. Default value is 3.
- quality : the rendering quality of the filter. A better quality needs more time to render. Default value is 3.
In some cases values below 3 should be OK (quality 1 is very poor though). Quality value more than 3 won't
really affect the rendering since this 3 fast blur are somehow equivalent to a real Gaussian Blur.
Example of use below that mimic the PS3 menu selection :
public void load() {
add(new FilledSprite(Colors.BLACK));
Glow glow = new Glow(0.8, 5);
Timeline timeline = new Timeline();
timeline.animate(glow.amount, 0.2, 0.8, 500, null, 0);
timeline.animate(glow.amount, 0.8, 0.2, 500, null, 500);
timeline.loopForever();
addTimeline(timeline);
CoreFont font = CoreFont.getSystemFont().tint(0xff80ff80);
Label lb = new Label(font, "An example of glowing text...", 20, 20);
lb.setFilter(glow);
add(lb);
}
Field Summary | |
---|---|
Fixed |
amount
The amount of glow to be used, typically from 0 to 8. |
Fields inherited from class pulpcore.image.filter.Blur |
---|
quality, radius |
Constructor Summary | |
---|---|
Glow()
Creates a Glow filter with a radius of 3, a quality of 3 and amount of 0,5. |
|
Glow(double amount)
Creates a Glow filter with the specified amount, a radius of 3 and a quality of 3. |
|
Glow(double amount,
int radius)
Creates a Glow filter with the specified amount and radius. |
|
Glow(double amount,
int radius,
int quality)
Creates a Glow filter with the specified amount, radius and quality. |
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. |
void |
update(int elapsedTime)
Updates the filter. |
Methods inherited from class pulpcore.image.filter.Blur |
---|
filter, getClampEdges, getHeight, getWidth, getX, getY, isOpaque, setClampEdges |
Methods inherited from class pulpcore.image.filter.Filter |
---|
filter, getInput, getOutput, isDirty, setDirty, setInput |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public final Fixed amount
Constructor Detail |
---|
public Glow()
public Glow(double amount)
public Glow(double amount, int radius)
public Glow(double amount, int radius, int quality)
Method Detail |
---|
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 Blur
public void update(int elapsedTime)
Filter
update
in class Blur
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 Blur
|
PulpCore | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |