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:
Type | Property and Description |
---|---|
DoubleProperty |
brightness
The brightness adjustment value.
|
DoubleProperty |
contrast
The contrast adjustment value.
|
DoubleProperty |
hue
The hue adjustment value.
|
ObjectProperty<Effect> |
input
The input for this
Effect . |
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()
The brightness adjustment value.
|
DoubleProperty |
contrastProperty()
The contrast adjustment value.
|
double |
getBrightness()
Gets the value of the property brightness.
|
double |
getContrast()
Gets the value of the property contrast.
|
double |
getHue()
Gets the value of the property hue.
|
Effect |
getInput()
Gets the value of the property input.
|
double |
getSaturation()
Gets the value of the property saturation.
|
DoubleProperty |
hueProperty()
The hue adjustment value.
|
ObjectProperty<Effect> |
inputProperty()
The input for this
Effect . |
DoubleProperty |
saturationProperty()
The saturation adjustment value.
|
void |
setBrightness(double value)
Sets the value of the property brightness.
|
void |
setContrast(double value)
Sets the value of the property contrast.
|
void |
setHue(double value)
Sets the value of the property hue.
|
void |
setInput(Effect value)
Sets the value of the property input.
|
void |
setSaturation(double value)
Sets the value of the property saturation.
|
public final ObjectProperty<Effect> inputProperty
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.getInput()
,
setInput(Effect)
public final DoubleProperty hueProperty
Min: -1.0 Max: +1.0 Default: 0.0 Identity: 0.0
getHue()
,
setHue(double)
public final DoubleProperty saturationProperty
Min: -1.0 Max: +1.0 Default: 0.0 Identity: 0.0
getSaturation()
,
setSaturation(double)
public final DoubleProperty brightnessProperty
Min: -1.0 Max: +1.0 Default: 0.0 Identity: 0.0
getBrightness()
,
setBrightness(double)
public final DoubleProperty contrastProperty
Min: -1.0 Max: +1.0 Default: 0.0 Identity: 0.0
getContrast()
,
setContrast(double)
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 valuepublic final void setInput(Effect value)
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.public final Effect getInput()
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.public final ObjectProperty<Effect> inputProperty()
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.getInput()
,
setInput(Effect)
public final void setHue(double value)
Min: -1.0 Max: +1.0 Default: 0.0 Identity: 0.0
public final double getHue()
Min: -1.0 Max: +1.0 Default: 0.0 Identity: 0.0
public final DoubleProperty hueProperty()
Min: -1.0 Max: +1.0 Default: 0.0 Identity: 0.0
getHue()
,
setHue(double)
public final void setSaturation(double value)
Min: -1.0 Max: +1.0 Default: 0.0 Identity: 0.0
public final double getSaturation()
Min: -1.0 Max: +1.0 Default: 0.0 Identity: 0.0
public final DoubleProperty saturationProperty()
Min: -1.0 Max: +1.0 Default: 0.0 Identity: 0.0
getSaturation()
,
setSaturation(double)
public final void setBrightness(double value)
Min: -1.0 Max: +1.0 Default: 0.0 Identity: 0.0
public final double getBrightness()
Min: -1.0 Max: +1.0 Default: 0.0 Identity: 0.0
public final DoubleProperty brightnessProperty()
Min: -1.0 Max: +1.0 Default: 0.0 Identity: 0.0
getBrightness()
,
setBrightness(double)
public final void setContrast(double value)
Min: -1.0 Max: +1.0 Default: 0.0 Identity: 0.0
public final double getContrast()
Min: -1.0 Max: +1.0 Default: 0.0 Identity: 0.0
public final DoubleProperty contrastProperty()
Min: -1.0 Max: +1.0 Default: 0.0 Identity: 0.0
getContrast()
,
setContrast(double)
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 2008, 2017, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.