Enum GlobalCompositeOperation
- java.lang.Object
-
- java.lang.Enum<GlobalCompositeOperation>
-
- org.pepstock.charba.client.dom.enums.GlobalCompositeOperation
-
- All Implemented Interfaces:
Serializable
,Comparable<GlobalCompositeOperation>
,Key
public enum GlobalCompositeOperation extends Enum<GlobalCompositeOperation> implements Key
Identifying which of the compositing or blending mode operations to use.- Author:
- Andrea "Stock" Stocchero
-
-
Enum Constant Summary
Enum Constants Enum Constant Description COLOR
Preserves the luma of the bottom layer, while adopting the hue and chroma of the top layer.COLOR_BURN
Divides the inverted bottom layer by the top layer, and then inverts the result.COLOR_DODGE
Divides the bottom layer by the inverted top layer.COPY
Only the new shape is shown.DARKEN
Retains the darkest pixels of both layers.DESTINATION_ATOP
The existing canvas is only kept where it overlaps the new shape.
The new shape is drawn behind the canvas content.DESTINATION_IN
The existing canvas content is kept where both the new shape and existing canvas content overlap.
Everything else is made transparent.DESTINATION_OUT
The existing content is kept where it doesn't overlap the new shape.DESTINATION_OVER
New shapes are drawn behind the existing canvas content.DIFFERENCE
Subtracts the bottom layer from the top layer or the other way round to always get a positive value.EXCLUSION
Like difference, but with lower contrast.HARD_LIGHT
A combination of multiply and screen like overlay, but with top and bottom layer swapped.HUE
Preserves the luma and chroma of the bottom layer, while adopting the hue of the top layer.LIGHTEN
Retains the lightest pixels of both layers.LIGHTER
Where both shapes overlap the color is determined by adding color values.LUMINOSITY
Preserves the hue and chroma of the bottom layer, while adopting the luma of the top layer.MULTIPLY
The pixels of the top layer are multiplied with the corresponding pixel of the bottom layer.
A darker picture is the result.OVERLAY
A combination of multiply and screen.
Dark parts on the base layer become darker, and light parts become lighter.SATURATION
Preserves the luma and hue of the bottom layer, while adopting the chroma of the top layer.SCREEN
The pixels are inverted, multiplied, and inverted again.
A lighter picture is the result (opposite of multiply)SOFT_LIGHT
A softer version of hard-light.
Pure black or white does not result in pure black or white.SOURCE_ATOP
The new shape is only drawn where it overlaps the existing canvas content.SOURCE_IN
The new shape is drawn only where both the new shape and the destination canvas overlap.
Everything else is made transparent.SOURCE_OUT
The new shape is drawn where it doesn't overlap the existing canvas content.SOURCE_OVER
This is the default setting and draws new shapes on top of the existing canvas content.XOR
Shapes are made transparent where both overlap and drawn normal everywhere else.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
value()
Returns the name value of propertystatic GlobalCompositeOperation
valueOf(String name)
Returns the enum constant of this type with the specified name.static GlobalCompositeOperation[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
SOURCE_OVER
public static final GlobalCompositeOperation SOURCE_OVER
This is the default setting and draws new shapes on top of the existing canvas content.
-
SOURCE_IN
public static final GlobalCompositeOperation SOURCE_IN
The new shape is drawn only where both the new shape and the destination canvas overlap.
Everything else is made transparent.
-
SOURCE_OUT
public static final GlobalCompositeOperation SOURCE_OUT
The new shape is drawn where it doesn't overlap the existing canvas content.
-
SOURCE_ATOP
public static final GlobalCompositeOperation SOURCE_ATOP
The new shape is only drawn where it overlaps the existing canvas content.
-
DESTINATION_OVER
public static final GlobalCompositeOperation DESTINATION_OVER
New shapes are drawn behind the existing canvas content.
-
DESTINATION_IN
public static final GlobalCompositeOperation DESTINATION_IN
The existing canvas content is kept where both the new shape and existing canvas content overlap.
Everything else is made transparent.
-
DESTINATION_OUT
public static final GlobalCompositeOperation DESTINATION_OUT
The existing content is kept where it doesn't overlap the new shape.
-
DESTINATION_ATOP
public static final GlobalCompositeOperation DESTINATION_ATOP
The existing canvas is only kept where it overlaps the new shape.
The new shape is drawn behind the canvas content.
-
LIGHTER
public static final GlobalCompositeOperation LIGHTER
Where both shapes overlap the color is determined by adding color values.
-
COPY
public static final GlobalCompositeOperation COPY
Only the new shape is shown.
-
XOR
public static final GlobalCompositeOperation XOR
Shapes are made transparent where both overlap and drawn normal everywhere else.
-
MULTIPLY
public static final GlobalCompositeOperation MULTIPLY
The pixels of the top layer are multiplied with the corresponding pixel of the bottom layer.
A darker picture is the result.
-
SCREEN
public static final GlobalCompositeOperation SCREEN
The pixels are inverted, multiplied, and inverted again.
A lighter picture is the result (opposite of multiply)
-
OVERLAY
public static final GlobalCompositeOperation OVERLAY
A combination of multiply and screen.
Dark parts on the base layer become darker, and light parts become lighter.
-
DARKEN
public static final GlobalCompositeOperation DARKEN
Retains the darkest pixels of both layers.
-
LIGHTEN
public static final GlobalCompositeOperation LIGHTEN
Retains the lightest pixels of both layers.
-
COLOR_DODGE
public static final GlobalCompositeOperation COLOR_DODGE
Divides the bottom layer by the inverted top layer.
-
COLOR_BURN
public static final GlobalCompositeOperation COLOR_BURN
Divides the inverted bottom layer by the top layer, and then inverts the result.
-
HARD_LIGHT
public static final GlobalCompositeOperation HARD_LIGHT
A combination of multiply and screen like overlay, but with top and bottom layer swapped.
-
SOFT_LIGHT
public static final GlobalCompositeOperation SOFT_LIGHT
A softer version of hard-light.
Pure black or white does not result in pure black or white.
-
DIFFERENCE
public static final GlobalCompositeOperation DIFFERENCE
Subtracts the bottom layer from the top layer or the other way round to always get a positive value.
-
EXCLUSION
public static final GlobalCompositeOperation EXCLUSION
Like difference, but with lower contrast.
-
HUE
public static final GlobalCompositeOperation HUE
Preserves the luma and chroma of the bottom layer, while adopting the hue of the top layer.
-
SATURATION
public static final GlobalCompositeOperation SATURATION
Preserves the luma and hue of the bottom layer, while adopting the chroma of the top layer.
-
COLOR
public static final GlobalCompositeOperation COLOR
Preserves the luma of the bottom layer, while adopting the hue and chroma of the top layer.
-
LUMINOSITY
public static final GlobalCompositeOperation LUMINOSITY
Preserves the hue and chroma of the bottom layer, while adopting the luma of the top layer.
-
-
Method Detail
-
values
public static GlobalCompositeOperation[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (GlobalCompositeOperation c : GlobalCompositeOperation.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static GlobalCompositeOperation valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
-