public class BrushedMetalFilter extends Object implements BufferedImageOp
Modifier and Type | Field and Description |
---|---|
private float |
amount |
private int |
color |
private boolean |
monochrome |
private int |
radius |
private Random |
randomNumbers |
private float |
shine |
Constructor and Description |
---|
BrushedMetalFilter()
Constructs a BrushedMetalFilter object.
|
BrushedMetalFilter(int color,
int radius,
float amount,
boolean monochrome,
float shine)
Constructs a BrushedMetalFilter object.
|
Modifier and Type | Method and Description |
---|---|
void |
blur(int[] in,
int[] out,
int width,
int radius) |
private static int |
clamp(int c) |
BufferedImage |
createCompatibleDestImage(BufferedImage src,
ColorModel dstCM) |
BufferedImage |
filter(BufferedImage src,
BufferedImage dst) |
float |
getAmount()
Get the amount of noise to add.
|
Rectangle2D |
getBounds2D(BufferedImage src) |
int |
getColor()
Get the color of the metal.
|
boolean |
getMonochrome()
Get the type of noise to add.
|
Point2D |
getPoint2D(Point2D srcPt,
Point2D dstPt) |
int |
getRadius()
Get the horizontal size of the blur.
|
RenderingHints |
getRenderingHints() |
float |
getShine()
Get the amount of shine to add in the range 0..1.
|
private static int |
mod(int a,
int b)
Return a mod b.
|
private int |
random(int x) |
void |
setAmount(float amount)
Set the amount of noise to add in the range 0..1.
|
void |
setColor(int color)
Set the color of the metal.
|
void |
setMonochrome(boolean monochrome)
Set the type of noise to add.
|
void |
setRadius(int radius)
Set the horizontal size of the blur.
|
private void |
setRGB(BufferedImage image,
int x,
int y,
int width,
int height,
int[] pixels)
A convenience method for setting ARGB pixels in an image.
|
void |
setShine(float shine)
Set the amount of shine to add to the range 0..1.
|
String |
toString() |
private int radius
private float amount
private int color
private float shine
private boolean monochrome
private Random randomNumbers
public BrushedMetalFilter()
public BrushedMetalFilter(int color, int radius, float amount, boolean monochrome, float shine)
color
- an int specifying the metal colorradius
- an int specifying the blur sizeamount
- a float specifying the amount of texturemonochrome
- a boolean -- true for monochrome textureshine
- a float specifying the shine to addpublic BufferedImage filter(BufferedImage src, BufferedImage dst)
filter
in interface BufferedImageOp
private int random(int x)
private static int clamp(int c)
private static int mod(int a, int b)
a
- the dividendb
- the divisorpublic void blur(int[] in, int[] out, int width, int radius)
public void setRadius(int radius)
radius
- the radius of the blur in the horizontal directiongetRadius()
public int getRadius()
setRadius(int)
public void setAmount(float amount)
amount
- the amount of noisegetAmount()
public float getAmount()
setAmount(float)
public void setShine(float shine)
shine
- the amount of shinegetShine()
public float getShine()
setShine(float)
public void setColor(int color)
color
- the color in ARGB formgetColor()
public int getColor()
setColor(int)
public void setMonochrome(boolean monochrome)
monochrome
- true for monochrome noisegetMonochrome()
public boolean getMonochrome()
setMonochrome(boolean)
public BufferedImage createCompatibleDestImage(BufferedImage src, ColorModel dstCM)
createCompatibleDestImage
in interface BufferedImageOp
public Rectangle2D getBounds2D(BufferedImage src)
getBounds2D
in interface BufferedImageOp
public Point2D getPoint2D(Point2D srcPt, Point2D dstPt)
getPoint2D
in interface BufferedImageOp
public RenderingHints getRenderingHints()
getRenderingHints
in interface BufferedImageOp
private void setRGB(BufferedImage image, int x, int y, int width, int height, int[] pixels)
WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses