com.jhlabs.image

Class BrushedMetalFilter

Implemented Interfaces:
BufferedImageOp

public class BrushedMetalFilter
extends java.lang.Object
implements BufferedImageOp

A filter which produces an image simulating brushed metal.

Constructor Summary

BrushedMetalFilter()
Constructs a BrushedMetalFilter object.
BrushedMetalFilter(int color, int radius, float amount, boolean monochrome, float shine)
Constructs a BrushedMetalFilter object.

Method Summary

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.
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.
void
setShine(float shine)
Set the amount of shine to add to the range 0..1.
String
toString()

Constructor Details

BrushedMetalFilter

public BrushedMetalFilter()
Constructs a BrushedMetalFilter object.

BrushedMetalFilter

public BrushedMetalFilter(int color,
                          int radius,
                          float amount,
                          boolean monochrome,
                          float shine)
Constructs a BrushedMetalFilter object.
Parameters:
color - an int specifying the metal color
radius - an int specifying the blur size
amount - a float specifying the amount of texture
monochrome - a boolean -- true for monochrome texture
shine - a float specifying the shine to add

Method Details

createCompatibleDestImage

public BufferedImage createCompatibleDestImage(BufferedImage src,
                                               ColorModel dstCM)

filter

public BufferedImage filter(BufferedImage src,
                            BufferedImage dst)

getAmount

public float getAmount()
Get the amount of noise to add.
Returns:
the amount of noise

getBounds2D

public Rectangle2D getBounds2D(BufferedImage src)

getColor

public int getColor()
Get the color of the metal.
Returns:
the color in ARGB form

getMonochrome

public boolean getMonochrome()
Get the type of noise to add.
Returns:
true for monochrome noise

getPoint2D

public Point2D getPoint2D(Point2D srcPt,
                          Point2D dstPt)

getRadius

public int getRadius()
Get the horizontal size of the blur.
Returns:
the radius of the blur in the horizontal direction

getRenderingHints

public RenderingHints getRenderingHints()

getShine

public float getShine()
Get the amount of shine to add in the range 0..1.
Returns:
the amount of shine

setAmount

public void setAmount(float amount)
Set the amount of noise to add in the range 0..1.
Parameters:
amount - the amount of noise

setColor

public void setColor(int color)
Set the color of the metal.
Parameters:
color - the color in ARGB form

setMonochrome

public void setMonochrome(boolean monochrome)
Set the type of noise to add.
Parameters:
monochrome - true for monochrome noise

setRadius

public void setRadius(int radius)
Set the horizontal size of the blur.
Parameters:
radius - the radius of the blur in the horizontal direction

setShine

public void setShine(float shine)
Set the amount of shine to add to the range 0..1.
Parameters:
shine - the amount of shine

toString

public String toString()