public class BrightnessContrastFilter extends RGBImageFilter
-2.0,..,0.0,..,2.0
.
A value of 0.0
means no change.
Negative values will make the pixels darker.
Maximum negative value (-2
) will make all filtered pixels black.
Positive values will make the pixels brighter.
Maximum positive value (2
) will make all filtered pixels white.
For contrast, the valid range is -1.0,..,0.0,..,1.0
.
A value of 0.0
means no change.
Negative values will reduce contrast.
Maximum negative value (-1
) will make all filtered pixels grey
(no contrast).
Positive values will increase contrast.
Maximum positive value (1
) will make all filtered pixels primary
colors (either black, white, cyan, magenta, yellow, red, blue or green).canFilterIndexColorModel, newmodel, origmodel
consumer
COMPLETESCANLINES, IMAGEABORTED, IMAGEERROR, RANDOMPIXELORDER, SINGLEFRAME, SINGLEFRAMEDONE, SINGLEPASS, STATICIMAGEDONE, TOPDOWNLEFTRIGHT
Constructor and Description |
---|
BrightnessContrastFilter()
Creates a BrightnessContrastFilter with default values
(
brightness=0.3, contrast=0.3 ). |
BrightnessContrastFilter(float pBrightness,
float pContrast)
Creates a BrightnessContrastFilter with the given values for brightness
and contrast.
|
Modifier and Type | Method and Description |
---|---|
int |
filterRGB(int pX,
int pY,
int pARGB)
Filters one pixel, adjusting brightness and contrast according to this
filter.
|
filterIndexColorModel, filterRGBPixels, setColorModel, setPixels, setPixels, substituteColorModel
clone, getFilterInstance, imageComplete, resendTopDownLeftRight, setDimensions, setHints, setProperties
public BrightnessContrastFilter()
brightness=0.3, contrast=0.3
).
This will slightly increase both brightness and contrast.public BrightnessContrastFilter(float pBrightness, float pContrast)
-2.0,..,0.0,..,2.0
.
A value of 0.0
means no change.
Negative values will make the pixels darker.
Maximum negative value (-2
) will make all filtered pixels black.
Positive values will make the pixels brighter.
Maximum positive value (2
) will make all filtered pixels white.
For contrast, the valid range is -1.0,..,0.0,..,1.0
.
A value of 0.0
means no change.
Negative values will reduce contrast.
Maximum negative value (-1
) will make all filtered pixels grey
(no contrast).
Positive values will increase contrast.
Maximum positive value (1
) will make all filtered pixels primary
colors (either black, white, cyan, magenta, yellow, red, blue or green).pBrightness
- adjust the brightness of the image, in the range
-2.0,..,0.0,..,2.0
.pContrast
- adjust the contrast of the image, in the range
-1.0,..,0.0,..,1.0
.public int filterRGB(int pX, int pY, int pARGB)
filterRGB
in class RGBImageFilter
pX
- xpY
- ypARGB
- pixel value in default color spaceCopyright © 2015. All Rights Reserved.