public class ColorAdjust extends Effect
Example:
ColorAdjust colorAdjust = new ColorAdjust();
colorAdjust.setContrast(0.1);
colorAdjust.setHue(-0.05);
colorAdjust.setBrightness(0.1);
colorAdjust.setSaturation(0.2);
Image image = new Image("boat.jpg");
ImageView imageView = new ImageView(image);
imageView.setFitWidth(200);
imageView.setPreserveRatio(true);
imageView.setEffect(colorAdjust);
The code above applied on this image:
produces the following:
Effect.EffectInputChangeListener, Effect.EffectInputProperty
Modifier and Type | Field and Description |
---|---|
private DoubleProperty |
brightness
The brightness adjustment value.
|
private DoubleProperty |
contrast
The contrast adjustment value.
|
private DoubleProperty |
hue
The hue adjustment value.
|
private ObjectProperty<Effect> |
input
The input for this
Effect . |
private DoubleProperty |
saturation
The saturation adjustment value.
|
Constructor and Description |
---|
ColorAdjust()
Creates a new instance of ColorAdjust with default parameters.
|
ColorAdjust(double hue,
double saturation,
double brightness,
double contrast)
Creates a new instance of ColorAdjust with the specified hue, saturation,
brightness, and contrast.
|
Modifier and Type | Method and Description |
---|---|
DoubleProperty |
brightnessProperty() |
DoubleProperty |
contrastProperty() |
double |
getBrightness() |
double |
getContrast() |
double |
getHue() |
Effect |
getInput() |
double |
getSaturation() |
DoubleProperty |
hueProperty() |
(package private) boolean |
impl_checkChainContains(Effect e) |
Effect |
impl_copy()
Deprecated.
This is an internal API that is not intended for use and will be removed in the next version
|
(package private) ColorAdjust |
impl_createImpl() |
BaseBounds |
impl_getBounds(BaseBounds bounds,
BaseTransform tx,
Node node,
BoundsAccessor boundsAccessor)
Deprecated.
This is an internal API that is not intended for use and will be removed in the next version
|
(package private) void |
impl_update() |
ObjectProperty<Effect> |
inputProperty() |
DoubleProperty |
saturationProperty() |
void |
setBrightness(double value) |
void |
setContrast(double value) |
void |
setHue(double value) |
void |
setInput(Effect value) |
void |
setSaturation(double value) |
effectBoundsChanged, getInputBounds, getKernelSize, getShadowBounds, impl_containsCycles, impl_effectDirtyProperty, impl_getImpl, impl_isEffectDirty, impl_sync, markDirty, transformBounds
private ObjectProperty<Effect> input
Effect
.
If set to null
, or left unspecified, a graphical image of
the Node
to which the Effect
is attached will be
used as the input.private DoubleProperty hue
Min: -1.0 Max: +1.0 Default: 0.0 Identity: 0.0
private DoubleProperty saturation
Min: -1.0 Max: +1.0 Default: 0.0 Identity: 0.0
private DoubleProperty brightness
Min: -1.0 Max: +1.0 Default: 0.0 Identity: 0.0
private DoubleProperty contrast
Min: -1.0 Max: +1.0 Default: 0.0 Identity: 0.0
public ColorAdjust()
public ColorAdjust(double hue, double saturation, double brightness, double contrast)
hue
- the hue adjustment valuesaturation
- the saturation adjustment valuebrightness
- the brightness adjustment valuecontrast
- the contrast adjustment valueColorAdjust impl_createImpl()
impl_createImpl
in class Effect
public final void setInput(Effect value)
public final Effect getInput()
public final ObjectProperty<Effect> inputProperty()
boolean impl_checkChainContains(Effect e)
impl_checkChainContains
in class Effect
public final void setHue(double value)
public final double getHue()
public final DoubleProperty hueProperty()
public final void setSaturation(double value)
public final double getSaturation()
public final DoubleProperty saturationProperty()
public final void setBrightness(double value)
public final double getBrightness()
public final DoubleProperty brightnessProperty()
public final void setContrast(double value)
public final double getContrast()
public final DoubleProperty contrastProperty()
void impl_update()
impl_update
in class Effect
@Deprecated public BaseBounds impl_getBounds(BaseBounds bounds, BaseTransform tx, Node node, BoundsAccessor boundsAccessor)
Effect
impl_getBounds
in class Effect