net.sourceforge.jiu.color.adjustment
Class Contrast
java.lang.Object
net.sourceforge.jiu.ops.Operation
net.sourceforge.jiu.ops.ImageToImageOperation
net.sourceforge.jiu.ops.LookupTableOperation
net.sourceforge.jiu.color.adjustment.Contrast
- public class Contrast
- extends LookupTableOperation
Adjusts the contrast of an image.
The amount of adjustment is given to the constructor as a percentage value between -100 and 100.
-100 will make the resulting image middle-gray, 0 will leave it unchanged, 100 will map it to
the eight corners of the color cube.
Usage example
This code snippet will reduce image
's contrast by 40 percent.
Contrast contrast = new Contrast();
contrast.setInputImage(image);
contrast.setContrast(-40);
contrast.process();
PixelImage adjustedImage = contrast.getOutputImage();
- Author:
- Marco Schmidt
Method Summary |
int |
getContrast()
Returns the contrast adjustment value associated with this opperation.
|
void |
process()
This method does the actual work of the operation.
|
void |
setContrast(int newContrast)
Sets the value for contrast adjustment to be used within this operation. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Contrast
public Contrast()
getContrast
public int getContrast()
- Returns the contrast adjustment value associated with this opperation.
The value lies between -100 and 100 (including both values).
- Returns:
- contrast adjustment
- See Also:
setContrast(int)
process
public void process()
throws MissingParameterException,
WrongParameterException
- Description copied from class:
Operation
- This method does the actual work of the operation.
It must be called after all parameters have been given to the operation object.
- Overrides:
process
in class LookupTableOperation
- Throws:
MissingParameterException
WrongParameterException
setContrast
public void setContrast(int newContrast)
- Sets the value for contrast adjustment to be used within this operation.
- Parameters:
newContrast
- new contrast, between -100 and 100 (including both values)
- Throws:
IllegalArgumentException
- if the new contrast value is not in the above mentioned interval- See Also:
getContrast()
Copyright © 2000, 2001, 2002, 2003, 2004 Marco Schmidt