Class BrushedMetalFilter

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

public class BrushedMetalFilter extends Object implements BufferedImageOp
A filter which produces an image simulating brushed metal.
  • 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

    • filter

      public BufferedImage filter(BufferedImage src, BufferedImage dst)
      Specified by:
      filter in interface BufferedImageOp
    • 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

      public int getRadius()
      Get the horizontal size of the blur.
      Returns:
      the radius of the blur in the horizontal direction
      See Also:
    • 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

      public float getAmount()
      Get the amount of noise to add.
      Returns:
      the amount of noise
      See Also:
    • 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

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

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

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

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

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

      public BufferedImage createCompatibleDestImage(BufferedImage src, ColorModel dstCM)
      Specified by:
      createCompatibleDestImage in interface BufferedImageOp
    • getBounds2D

      public Rectangle2D getBounds2D(BufferedImage src)
      Specified by:
      getBounds2D in interface BufferedImageOp
    • getPoint2D

      public Point2D getPoint2D(Point2D srcPt, Point2D dstPt)
      Specified by:
      getPoint2D in interface BufferedImageOp
    • getRenderingHints

      public RenderingHints getRenderingHints()
      Specified by:
      getRenderingHints in interface BufferedImageOp
    • toString

      public String toString()
      Overrides:
      toString in class Object