com.jhlabs.image
Class BrushedMetalFilter

java.lang.Object
  extended by com.jhlabs.image.BrushedMetalFilter
All Implemented Interfaces:
java.awt.image.BufferedImageOp

public class BrushedMetalFilter
extends java.lang.Object
implements java.awt.image.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
 void blur(int[] in, int[] out, int width, int radius)
           
 java.awt.image.BufferedImage createCompatibleDestImage(java.awt.image.BufferedImage src, java.awt.image.ColorModel dstCM)
           
 java.awt.image.BufferedImage filter(java.awt.image.BufferedImage src, java.awt.image.BufferedImage dst)
           
 float getAmount()
          Get the amount of noise to add.
 java.awt.geom.Rectangle2D getBounds2D(java.awt.image.BufferedImage src)
           
 int getColor()
          Get the color of the metal.
 boolean getMonochrome()
          Get the type of noise to add.
 java.awt.geom.Point2D getPoint2D(java.awt.geom.Point2D srcPt, java.awt.geom.Point2D dstPt)
           
 int getRadius()
          Get the horizontal size of the blur.
 java.awt.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.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

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 Detail

filter

public java.awt.image.BufferedImage filter(java.awt.image.BufferedImage src,
                                           java.awt.image.BufferedImage dst)
Specified by:
filter in interface java.awt.image.BufferedImageOp

blur

public void blur(int[] in,
                 int[] out,
                 int width,
                 int radius)

setRadius

public void setRadius(int radius)
Set the horizontal size of the blur.

Parameters:
radius - the radius of the blur in the horizontal direction
See Also:
getRadius()

getRadius

public int getRadius()
Get the horizontal size of the blur.

Returns:
the radius of the blur in the horizontal direction
See Also:
setRadius(int)

setAmount

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

Parameters:
amount - the amount of noise
See Also:
getAmount()

getAmount

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

Returns:
the amount of noise
See Also:
setAmount(float)

setShine

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

Parameters:
shine - the amount of shine
See Also:
getShine()

getShine

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

Returns:
the amount of shine
See Also:
setShine(float)

setColor

public void setColor(int color)
Set the color of the metal.

Parameters:
color - the color in ARGB form
See Also:
getColor()

getColor

public int getColor()
Get the color of the metal.

Returns:
the color in ARGB form
See Also:
setColor(int)

setMonochrome

public void setMonochrome(boolean monochrome)
Set the type of noise to add.

Parameters:
monochrome - true for monochrome noise
See Also:
getMonochrome()

getMonochrome

public boolean getMonochrome()
Get the type of noise to add.

Returns:
true for monochrome noise
See Also:
setMonochrome(boolean)

createCompatibleDestImage

public java.awt.image.BufferedImage createCompatibleDestImage(java.awt.image.BufferedImage src,
                                                              java.awt.image.ColorModel dstCM)
Specified by:
createCompatibleDestImage in interface java.awt.image.BufferedImageOp

getBounds2D

public java.awt.geom.Rectangle2D getBounds2D(java.awt.image.BufferedImage src)
Specified by:
getBounds2D in interface java.awt.image.BufferedImageOp

getPoint2D

public java.awt.geom.Point2D getPoint2D(java.awt.geom.Point2D srcPt,
                                        java.awt.geom.Point2D dstPt)
Specified by:
getPoint2D in interface java.awt.image.BufferedImageOp

getRenderingHints

public java.awt.RenderingHints getRenderingHints()
Specified by:
getRenderingHints in interface java.awt.image.BufferedImageOp

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object