java.lang.Object
javafx.scene.effect.Effect
javafx.scene.effect.ColorAdjust
An effect that allows for per-pixel adjustments of hue, saturation,
brightness, and contrast.
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:
- Since:
- JavaFX 2.0
-
Property Summary
TypePropertyDescriptionfinal DoubleProperty
The brightness adjustment value.final DoubleProperty
The contrast adjustment value.final DoubleProperty
The hue adjustment value.final ObjectProperty<Effect>
The input for thisEffect
.final DoubleProperty
The saturation adjustment value. -
Constructor Summary
ConstructorDescriptionCreates 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. -
Method Summary
Modifier and TypeMethodDescriptionfinal DoubleProperty
The brightness adjustment value.final DoubleProperty
The contrast adjustment value.final double
Gets the value of thebrightness
property.final double
Gets the value of thecontrast
property.final double
getHue()
Gets the value of thehue
property.final Effect
getInput()
Gets the value of theinput
property.final double
Gets the value of thesaturation
property.final DoubleProperty
The hue adjustment value.final ObjectProperty<Effect>
The input for thisEffect
.final DoubleProperty
The saturation adjustment value.final void
setBrightness
(double value) Sets the value of thebrightness
property.final void
setContrast
(double value) Sets the value of thecontrast
property.final void
setHue
(double value) Sets the value of thehue
property.final void
Sets the value of theinput
property.final void
setSaturation
(double value) Sets the value of thesaturation
property.
-
Property Details
-
input
The input for thisEffect
. If set tonull
, or left unspecified, a graphical image of theNode
to which theEffect
is attached will be used as the input.- Default value:
- null
- See Also:
-
hue
The hue adjustment value.Min: -1.0 Max: +1.0 Default: 0.0 Identity: 0.0
- Default value:
- 0.0
- See Also:
-
saturation
The saturation adjustment value.Min: -1.0 Max: +1.0 Default: 0.0 Identity: 0.0
- Default value:
- 0.0
- See Also:
-
brightness
The brightness adjustment value.Min: -1.0 Max: +1.0 Default: 0.0 Identity: 0.0
- Default value:
- 0.0
- See Also:
-
contrast
The contrast adjustment value.Min: -1.0 Max: +1.0 Default: 0.0 Identity: 0.0
- Default value:
- 0.0
- See Also:
-
-
Constructor Details
-
ColorAdjust
public ColorAdjust()Creates a new instance of ColorAdjust with default parameters. -
ColorAdjust
public ColorAdjust(double hue, double saturation, double brightness, double contrast) Creates a new instance of ColorAdjust with the specified hue, saturation, brightness, and contrast.- Parameters:
hue
- the hue adjustment valuesaturation
- the saturation adjustment valuebrightness
- the brightness adjustment valuecontrast
- the contrast adjustment value- Since:
- JavaFX 2.1
-
-
Method Details
-
setInput
Sets the value of theinput
property.- Property description:
- The input for this
Effect
. If set tonull
, or left unspecified, a graphical image of theNode
to which theEffect
is attached will be used as the input. - Default value:
- null
- Parameters:
value
- the value for theinput
property- See Also:
-
getInput
Gets the value of theinput
property.- Property description:
- The input for this
Effect
. If set tonull
, or left unspecified, a graphical image of theNode
to which theEffect
is attached will be used as the input. - Default value:
- null
- Returns:
- the value of the
input
property - See Also:
-
inputProperty
The input for thisEffect
. If set tonull
, or left unspecified, a graphical image of theNode
to which theEffect
is attached will be used as the input.- Default value:
- null
- Returns:
- the
input
property - See Also:
-
setHue
public final void setHue(double value) Sets the value of thehue
property.- Property description:
- The hue adjustment value.
Min: -1.0 Max: +1.0 Default: 0.0 Identity: 0.0
- Default value:
- 0.0
- Parameters:
value
- the value for thehue
property- See Also:
-
getHue
public final double getHue()Gets the value of thehue
property.- Property description:
- The hue adjustment value.
Min: -1.0 Max: +1.0 Default: 0.0 Identity: 0.0
- Default value:
- 0.0
- Returns:
- the value of the
hue
property - See Also:
-
hueProperty
The hue adjustment value.Min: -1.0 Max: +1.0 Default: 0.0 Identity: 0.0
- Default value:
- 0.0
- Returns:
- the
hue
property - See Also:
-
setSaturation
public final void setSaturation(double value) Sets the value of thesaturation
property.- Property description:
- The saturation adjustment value.
Min: -1.0 Max: +1.0 Default: 0.0 Identity: 0.0
- Default value:
- 0.0
- Parameters:
value
- the value for thesaturation
property- See Also:
-
getSaturation
public final double getSaturation()Gets the value of thesaturation
property.- Property description:
- The saturation adjustment value.
Min: -1.0 Max: +1.0 Default: 0.0 Identity: 0.0
- Default value:
- 0.0
- Returns:
- the value of the
saturation
property - See Also:
-
saturationProperty
The saturation adjustment value.Min: -1.0 Max: +1.0 Default: 0.0 Identity: 0.0
- Default value:
- 0.0
- Returns:
- the
saturation
property - See Also:
-
setBrightness
public final void setBrightness(double value) Sets the value of thebrightness
property.- Property description:
- The brightness adjustment value.
Min: -1.0 Max: +1.0 Default: 0.0 Identity: 0.0
- Default value:
- 0.0
- Parameters:
value
- the value for thebrightness
property- See Also:
-
getBrightness
public final double getBrightness()Gets the value of thebrightness
property.- Property description:
- The brightness adjustment value.
Min: -1.0 Max: +1.0 Default: 0.0 Identity: 0.0
- Default value:
- 0.0
- Returns:
- the value of the
brightness
property - See Also:
-
brightnessProperty
The brightness adjustment value.Min: -1.0 Max: +1.0 Default: 0.0 Identity: 0.0
- Default value:
- 0.0
- Returns:
- the
brightness
property - See Also:
-
setContrast
public final void setContrast(double value) Sets the value of thecontrast
property.- Property description:
- The contrast adjustment value.
Min: -1.0 Max: +1.0 Default: 0.0 Identity: 0.0
- Default value:
- 0.0
- Parameters:
value
- the value for thecontrast
property- See Also:
-
getContrast
public final double getContrast()Gets the value of thecontrast
property.- Property description:
- The contrast adjustment value.
Min: -1.0 Max: +1.0 Default: 0.0 Identity: 0.0
- Default value:
- 0.0
- Returns:
- the value of the
contrast
property - See Also:
-
contrastProperty
The contrast adjustment value.Min: -1.0 Max: +1.0 Default: 0.0 Identity: 0.0
- Default value:
- 0.0
- Returns:
- the
contrast
property - See Also:
-