|
JIU 0.14.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.jiu.ops.Operation
net.sourceforge.jiu.ops.ImageToImageOperation
net.sourceforge.jiu.ops.LookupTableOperation
net.sourceforge.jiu.color.adjustment.Brightness
public class Brightness
Adjusts the brightness of an image.
The brightness change is specified as a percentage value between -100 and 100. -100 will make the resulting image black, 0 will leave it unchanged, 100 will make it white.
If all you want is to create a new image with adjusted brightness from the image data of an existing image, simply use the static helper method:
PixelImage adjustedImage = Brightness.adjust(inputImage, 30);This leaves the original image inputImage unchanged and allocates a second image object which is here assigned to the variable adjustedImage.
If you want more control over parameters, create your own Brightness object. You can then reuse image objects, e.g. to write the adjusted image data to the original image object:
Brightness brightness = new Brightness(); brightness.setInputImage(image); brightness.setOutputImage(image); brightness.setBrightness(30); brightness.process(); // at this point, image will contain the adjusted image data, // the original data wil be overwritten
Constructor Summary | |
---|---|
Brightness()
|
Method Summary | |
---|---|
static PixelImage |
adjust(PixelImage input,
int percentage)
This static helper method is more simple to use when all you need are the standard options. |
void |
process()
This method does the actual work of the operation. |
void |
setBrightness(int newBrightness)
Sets the brightness adjustment value in percent (between -100 and 100). |
Methods inherited from class net.sourceforge.jiu.ops.LookupTableOperation |
---|
getNumTables, getTable, prepareImages, setNumTables, setTable, setTables |
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 |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Brightness()
Method Detail |
---|
public static PixelImage adjust(PixelImage input, int percentage)
input
- the image to work onpercentage
- brightness modification, from -100 to 100
public void process() throws MissingParameterException, WrongParameterException
Operation
process
in class LookupTableOperation
MissingParameterException
- if any mandatory parameter was not given to the operation
WrongParameterException
- if at least one of the input parameters was
not initialized appropriately (values out of the valid interval, etc.)public void setBrightness(int newBrightness)
newBrightness
- the amount of change to be applied to the brightness of the input image
IllegalArgumentException
- if the argument is smaller than -100 or larger than 100
|
JIU 0.14.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |