net.sourceforge.jiu.color.adjustment

Class HueSaturationValue

Implemented Interfaces:
RGBIndex

public class HueSaturationValue
extends ImageToImageOperation
implements RGBIndex

Adjusts saturation and value of a color image, optionally hue as well.

Supported image types: RGBIntegerImage, Paletted8Image.

Author:
Marco Schmidt
Since:
0.5.0

Field Summary

private float
hue
private boolean
modifyHue
private float
sMult
private boolean
sNegative
private float
vMult
private boolean
vNegative

Fields inherited from class net.sourceforge.jiu.ops.ImageToImageOperation

canInAndOutBeEqual, inputImage, outputImage

Fields inherited from class net.sourceforge.jiu.ops.Operation

abort, progressListeners

Fields inherited from interface net.sourceforge.jiu.data.RGBIndex

INDEX_BLUE, INDEX_GREEN, INDEX_RED

Method Summary

private void
adjust(int[] orig, int[] adjusted, float maxSample)
void
process()
private void
process(Paletted8Image in, Paletted8Image out)
private void
process(RGBIntegerImage in, RGBIntegerImage out)
void
setHueSaturationValue(int hue, int saturation, int value)
Set the values for the adjustment of hue, saturation and value (brightness).
void
setSaturationValue(int saturation, int value)
Set the amount of change to saturation and value (brightness) for this operation, between -100 and 100.
private void
setSv(int saturation, int value)

Methods inherited from class net.sourceforge.jiu.ops.ImageToImageOperation

canInputAndOutputBeEqual, ensureImagesHaveSameResolution, ensureInputImageIsAvailable, ensureOutputImageResolution, getInputImage, getOutputImage, setCanInputAndOutputBeEqual, setInputImage, setOutputImage

Methods inherited from class net.sourceforge.jiu.ops.Operation

addProgressListener, addProgressListeners, getAbort, process, removeProgressListener, setAbort, setProgress, setProgress

Field Details

hue

private float hue

modifyHue

private boolean modifyHue

sMult

private float sMult

sNegative

private boolean sNegative

vMult

private float vMult

vNegative

private boolean vNegative

Method Details

adjust

private final void adjust(int[] orig,
                          int[] adjusted,
                          float maxSample)

process

public void process()
            throws MissingParameterException,
                   WrongParameterException
Overrides:
process in interface Operation

process

private void process(Paletted8Image in,
                     Paletted8Image out)

process

private void process(RGBIntegerImage in,
                     RGBIntegerImage out)

setHueSaturationValue

public void setHueSaturationValue(int hue,
                                  int saturation,
                                  int value)
Parameters:
hue - the hue to be used for the complete image, between 0 and 359
saturation - change of saturation, between -100 and 100
value - change of saturation, between -100 and 100

setSaturationValue

public void setSaturationValue(int saturation,
                               int value)
Set the amount of change to saturation and value (brightness) for this operation, between -100 and 100. Calling this method also tells the operation not to modify the hue of the image.
Parameters:
saturation - change of saturation, between -100 and 100
value - change of saturation, between -100 and 100

setSv

private void setSv(int saturation,
                   int value)