Package com.jhlabs.image
Class BrushedMetalFilter
- java.lang.Object
-
- com.jhlabs.image.BrushedMetalFilter
-
- All Implemented Interfaces:
java.awt.image.BufferedImageOp
public class BrushedMetalFilter extends java.lang.Object implements java.awt.image.BufferedImageOpA filter which produces an image simulating brushed metal.
-
-
Constructor Summary
Constructors Constructor Description BrushedMetalFilter()Constructs a BrushedMetalFilter object.BrushedMetalFilter(int color, int radius, float amount, boolean monochrome, float shine)Constructs a BrushedMetalFilter object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidblur(int[] in, int[] out, int width, int radius)java.awt.image.BufferedImagecreateCompatibleDestImage(java.awt.image.BufferedImage src, java.awt.image.ColorModel dstCM)java.awt.image.BufferedImagefilter(java.awt.image.BufferedImage src, java.awt.image.BufferedImage dst)floatgetAmount()Get the amount of noise to add.java.awt.geom.Rectangle2DgetBounds2D(java.awt.image.BufferedImage src)intgetColor()Get the color of the metal.booleangetMonochrome()Get the type of noise to add.java.awt.geom.Point2DgetPoint2D(java.awt.geom.Point2D srcPt, java.awt.geom.Point2D dstPt)intgetRadius()Get the horizontal size of the blur.java.awt.RenderingHintsgetRenderingHints()floatgetShine()Get the amount of shine to add in the range 0..1.voidsetAmount(float amount)Set the amount of noise to add in the range 0..1.voidsetColor(int color)Set the color of the metal.voidsetMonochrome(boolean monochrome)Set the type of noise to add.voidsetRadius(int radius)Set the horizontal size of the blur.voidsetShine(float shine)Set the amount of shine to add to the range 0..1.java.lang.StringtoString()
-
-
-
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 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 add
-
-
Method Detail
-
filter
public java.awt.image.BufferedImage filter(java.awt.image.BufferedImage src, java.awt.image.BufferedImage dst)- Specified by:
filterin interfacejava.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, min-value 0, max-value 100+- 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, min-value 0, max-value 1- 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, min-value 0, max-value 1- 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:
createCompatibleDestImagein interfacejava.awt.image.BufferedImageOp
-
getBounds2D
public java.awt.geom.Rectangle2D getBounds2D(java.awt.image.BufferedImage src)
- Specified by:
getBounds2Din interfacejava.awt.image.BufferedImageOp
-
getPoint2D
public java.awt.geom.Point2D getPoint2D(java.awt.geom.Point2D srcPt, java.awt.geom.Point2D dstPt)- Specified by:
getPoint2Din interfacejava.awt.image.BufferedImageOp
-
getRenderingHints
public java.awt.RenderingHints getRenderingHints()
- Specified by:
getRenderingHintsin interfacejava.awt.image.BufferedImageOp
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-