com.jhlabs.image
Class ContrastFilter

java.lang.Object
  extended by com.jhlabs.image.AbstractBufferedImageOp
      extended by com.jhlabs.image.PointFilter
          extended by com.jhlabs.image.TransferFilter
              extended by com.jhlabs.image.ContrastFilter
All Implemented Interfaces:
java.awt.image.BufferedImageOp, java.lang.Cloneable

public class ContrastFilter
extends TransferFilter

A filter to change the brightness and contrast of an image.


Field Summary
 
Fields inherited from class com.jhlabs.image.TransferFilter
bTable, gTable, initialized, rTable
 
Fields inherited from class com.jhlabs.image.PointFilter
canFilterIndexColorModel
 
Constructor Summary
ContrastFilter()
           
 
Method Summary
 float getBrightness()
          Get the filter brightness.
 float getContrast()
          Get the filter contrast.
 void setBrightness(float brightness)
          Set the filter brightness.
 void setContrast(float contrast)
          Set the filter contrast.
 java.lang.String toString()
           
protected  float transferFunction(float f)
           
 
Methods inherited from class com.jhlabs.image.TransferFilter
filter, filterRGB, getLUT, initialize, makeTable
 
Methods inherited from class com.jhlabs.image.PointFilter
setDimensions
 
Methods inherited from class com.jhlabs.image.AbstractBufferedImageOp
clone, createCompatibleDestImage, getBounds2D, getPoint2D, getRenderingHints, getRGB, setRGB
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ContrastFilter

public ContrastFilter()
Method Detail

transferFunction

protected float transferFunction(float f)
Overrides:
transferFunction in class TransferFilter

setBrightness

public void setBrightness(float brightness)
Set the filter brightness.

Parameters:
brightness - the brightness in the range 0 to 1
See Also:
getBrightness()

getBrightness

public float getBrightness()
Get the filter brightness.

Returns:
the brightness in the range 0 to 1
See Also:
setBrightness(float)

setContrast

public void setContrast(float contrast)
Set the filter contrast.

Parameters:
contrast - the contrast in the range 0 to 1
See Also:
getContrast()

getContrast

public float getContrast()
Get the filter contrast.

Returns:
the contrast in the range 0 to 1
See Also:
setContrast(float)

toString

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