com.jhlabs.image

Class ContrastFilter

Implemented Interfaces:
BufferedImageOp, 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

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.
String
toString()
protected float
transferFunction(float f)

Methods inherited from class com.jhlabs.image.TransferFilter

filter, filterRGB, getLUT, initialize, makeTable, transferFunction

Methods inherited from class com.jhlabs.image.PointFilter

filter, filterRGB, setDimensions

Methods inherited from class com.jhlabs.image.AbstractBufferedImageOp

clone, createCompatibleDestImage, getBounds2D, getPoint2D, getRGB, getRenderingHints, setRGB

Method Details

getBrightness

public float getBrightness()
Get the filter brightness.
Returns:
the brightness in the range 0 to 1

getContrast

public float getContrast()
Get the filter contrast.
Returns:
the contrast in the range 0 to 1

setBrightness

public void setBrightness(float brightness)
Set the filter brightness.
Parameters:
brightness - the brightness in the range 0 to 1

setContrast

public void setContrast(float contrast)
Set the filter contrast.
Parameters:
contrast - the contrast in the range 0 to 1

toString

public String toString()

transferFunction

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