Class HueSaturationValue
- java.lang.Object
-
- net.sourceforge.jiu.ops.Operation
-
- net.sourceforge.jiu.ops.ImageToImageOperation
-
- net.sourceforge.jiu.color.adjustment.HueSaturationValue
-
- All 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
.- Since:
- 0.5.0
- Author:
- Marco Schmidt
-
-
Field Summary
Fields Modifier and Type Field Description private float
hue
private boolean
modifyHue
private float
sMult
private boolean
sNegative
private float
vMult
private boolean
vNegative
-
Fields inherited from interface net.sourceforge.jiu.data.RGBIndex
INDEX_BLUE, INDEX_GREEN, INDEX_RED
-
-
Constructor Summary
Constructors Constructor Description HueSaturationValue()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
adjust(int[] orig, int[] adjusted, float maxSample)
void
process()
This method does the actual work of the operation.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, removeProgressListener, setAbort, setProgress, setProgress
-
-
-
-
Method Detail
-
adjust
private final void adjust(int[] orig, int[] adjusted, float maxSample)
-
process
private void process(Paletted8Image in, Paletted8Image out)
-
process
private void process(RGBIntegerImage in, RGBIntegerImage out)
-
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 classOperation
- Throws:
MissingParameterException
- if any mandatory parameter was not given to the operationWrongParameterException
- if at least one of the input parameters was not initialized appropriately (values out of the valid interval, etc.)
-
setHueSaturationValue
public void setHueSaturationValue(int hue, int saturation, int value)
Set the values for the adjustment of hue, saturation and value (brightness). Saturation and value must be from the interval -100 to 100 (also seesetSaturationValue(int, int)
). Hue must be from the interval 0 to 359.- Parameters:
hue
- the hue to be used for the complete image, between 0 and 359saturation
- change of saturation, between -100 and 100value
- change of saturation, between -100 and 100- Throws:
IllegalArgumentException
- if one of the arguments does not stay within the valid interval
-
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 100value
- change of saturation, between -100 and 100- Throws:
IllegalArgumentException
- if one of the two arguments does not stay within the -100 .. 100 interval
-
setSv
private void setSv(int saturation, int value)
-
-