Package org.jdesktop.swingx.graphics
Enum Class BlendComposite.BlendingMode
java.lang.Object
java.lang.Enum<BlendComposite.BlendingMode>
org.jdesktop.swingx.graphics.BlendComposite.BlendingMode
- All Implemented Interfaces:
Serializable
,Comparable<BlendComposite.BlendingMode>
,Constable
- Enclosing class:
BlendComposite
A blending mode defines the compositing rule of a
BlendComposite
.-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionAdd
is the opposite ofSubtract
.TheAverage
blending mode produces an average of the source and blend colors.Keeps the blue channel from the blend image and the red and green channels from the base image.TheColor
blending mode applies the hue and saturation of the blend color to the base image while retaining the luminance of the base image.TheColor Burn
blending mode increases the contrast to darken the base color while reflecting the blend color.TheColor Dodge
blending mode is essentially the opposite ofColor Burn
.TheDarken
blend mode compares the color information for each pixel of the base and the blend color and applies the darker color as the result.TheDifference
blending mode highlights the differences between the blend layer and the base layer.TheExclusion
blending mode works very much likeDifference
but the contrast is lower.Keeps the green channel from the blend image and the red and blue channels from the base image.Hard Light
drastically lightens or darkens the base image depending on the brightness of the blend color.TheHue
blend mode applies the hue of the blend color to the base image while retaining the luminance and saturation of the base image.Inverse Color Burn
is the same asColor Burn
with the source and destination swapped.Inverse Color Dodge
is the same asColor Dodge
with the source and destination swapped.TheLighten
blending mode compares the color information for each pixel of the base and the blend color and applies the lighter color as the result.TheLuminosity
blending mode applies the luminosity (brightness) of the blend colors to the base image while retaining the hue and saturation of the base image.TheMultiply
blend mode multiplies the base color with the blend color.This one is the "opposite" of difference mode.TheOverlay
blending mode preserves the highlights and shadows of the base color while mixing the base color and the blend color.Keeps the red channel from the blend image and the green and blue channels from the base image.TheSaturation
blending mode applies the saturation of the blend color to the base image while retaining the hue and luminance of the base image.TheScreen
blending mode is the opposite of theMultiply
mode in that it multiples the inverse of the base color with the blend color.TheSoft Light
blend mode creates a subtle lighter or darker result depending on the brightness of the blend color.Similar toAVERAGE
, but more severely lightens or darkens the edge colors.TheSubtract
blend mode is similar toColor Burn
but instead of increasing contrast, it decreases brightness to darken the base color and reflect the blend color.Burns or dodges the colors by increasing or decreasing the contrast, depending on the blend color. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) abstract void
blend
(int[] src, int[] dst, int[] result) Blends the input colors into the result.static BlendComposite.BlendingMode
Returns the enum constant of this class with the specified name.static BlendComposite.BlendingMode[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
AVERAGE
TheAverage
blending mode produces an average of the source and blend colors. The image will push colors toward the middle, reducing the extremes. -
STAMP
Similar toAVERAGE
, but more severely lightens or darkens the edge colors. -
DARKEN
TheDarken
blend mode compares the color information for each pixel of the base and the blend color and applies the darker color as the result. Any pixels in the base image that are lighter than the blend color are replaced, and pixels that are darker are left unchanged. No part of the image will become lighter. -
MULTIPLY
TheMultiply
blend mode multiplies the base color with the blend color. The resulting color will always be darker, unless the blend color is white, which will result in no change. 100% opaque black multiplied with any color will result in black. As you overlay strokes of color with the Multiply blending mode, each stroke will result in darker and darker color. -
COLOR_BURN
TheColor Burn
blending mode increases the contrast to darken the base color while reflecting the blend color. The darker the blend color, the more intensely the color will be applied in the base image. White as the blend color produces no change. -
INVERSE_COLOR_BURN
Inverse Color Burn
is the same asColor Burn
with the source and destination swapped. -
SOFT_BURN
-
SUBTRACT
TheSubtract
blend mode is similar toColor Burn
but instead of increasing contrast, it decreases brightness to darken the base color and reflect the blend color. It is also similar to the Multiply blend mode, but produces a much more intense result. White as the blend color produces no change.This mode is also known as
Linear Burn
. -
LIGHTEN
TheLighten
blending mode compares the color information for each pixel of the base and the blend color and applies the lighter color as the result. Any pixels in the base image that are darker than the blend color are replaced, and pixels that are lighter are left unchanged. No part of the image will become darker. -
SCREEN
TheScreen
blending mode is the opposite of theMultiply
mode in that it multiples the inverse of the base color with the blend color. What this means is that your image will get lighter overall. In areas where the blend color is black, the base image will be unchanged, and in areas where the blend or base color is white, the result will be no change. Dark areas in the base image will become significantly lighter, and bright areas will become only slightly lighter. -
COLOR_DODGE
TheColor Dodge
blending mode is essentially the opposite ofColor Burn
. TheColor Dodge
blending mode decreases the contrast to brighten the base color while reflecting the blend color. The lighter the blend color, the more significant the color dodge effect will be making the result brighter, with less contrast, and tinted toward the blend color. Black as the blend color produces no change. -
INVERSE_COLOR_DODGE
Inverse Color Dodge
is the same asColor Dodge
with the source and destination swapped. -
SOFT_DODGE
-
ADD
-
OVERLAY
TheOverlay
blending mode preserves the highlights and shadows of the base color while mixing the base color and the blend color. It is a combination of theMultiply
andScreen
blending modes--multiplying the dark areas, and screening the light areas. A blend color of 50% gray has no effect on the base image. -
SOFT_LIGHT
TheSoft Light
blend mode creates a subtle lighter or darker result depending on the brightness of the blend color. Blend colors that are more than 50% brightness will lighten the base image and colors that are less than 50% brightness will darken the base image. Pure black will create a slightly darker result; pure white will create a slightly lighter result, and 50% gray will have no effect on the base image. -
HARD_LIGHT
Hard Light
drastically lightens or darkens the base image depending on the brightness of the blend color. The effect is more intense thanSoft Light
because the contrast is also increased. Blend colors that are more than 50% brightness will lighten the base image in the same way as the screen blending mode. Colors that are less than 50% brightness will darken the base image in the same way as the multiply blending mode. Pure black will result in black; pure white will create a white result, and 50% gray will have no effect on the base image. -
VIVID_LIGHT
Burns or dodges the colors by increasing or decreasing the contrast, depending on the blend color. If the blend color is lighter than 50% grey, the image is lightened by decreasing the contrast. If the blend color is darker than 50% grey, the image is darkened by increasing the contrast. -
LINEAR_LIGHT
-
PIN_LIGHT
-
HARD_MIX
-
REFLECT
-
GLOW
-
FREEZE
-
HEAT
-
DIFFERENCE
TheDifference
blending mode highlights the differences between the blend layer and the base layer. The more technical explanation is that the blend color is subtracted from the base color--or vice-versa, depending on the brightness--and the result is the difference between them. When white is the blend color, the base image is inverted. When black is the blend color, there is no change. -
EXCLUSION
TheExclusion
blending mode works very much likeDifference
but the contrast is lower. When white is the blend color, the base image is inverted. When black is the blend color, there is no change. -
HUE
TheHue
blend mode applies the hue of the blend color to the base image while retaining the luminance and saturation of the base image. It gives the base image a tinted effect where the tinting is darkest in areas of high saturation. Where the blend color is a shade of gray (0% saturation), the base image is desaturated and where the base image is gray, the Hue blending mode has no effect. -
SATURATION
TheSaturation
blending mode applies the saturation of the blend color to the base image while retaining the hue and luminance of the base image. Neutral tones (black, white, and gray) in the blend will desaturate the base image. Neutral areas in the base image will not be changed by the saturation blending mode. -
COLOR
TheColor
blending mode applies the hue and saturation of the blend color to the base image while retaining the luminance of the base image. Simply put, it colors the base image. Neutral blend colors will desaturate the base image. -
LUMINOSITY
TheLuminosity
blending mode applies the luminosity (brightness) of the blend colors to the base image while retaining the hue and saturation of the base image.Luminosity
is the opposite of theColor
blending mode. -
NEGATION
This one is the "opposite" of difference mode. Note that it is NOT difference mode inverted, because black and white return the same result, but colors between become brighter instead of darker. This mode can be used to invert parts of the base image, but NOT to compare two images. -
RED
Keeps the red channel from the blend image and the green and blue channels from the base image. -
GREEN
Keeps the green channel from the blend image and the red and blue channels from the base image. -
BLUE
Keeps the blue channel from the blend image and the red and green channels from the base image.
-
-
Constructor Details
-
BlendingMode
private BlendingMode()
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified nameNullPointerException
- if the argument is null
-
blend
abstract void blend(int[] src, int[] dst, int[] result) Blends the input colors into the result.- Parameters:
src
- the source RGBAdst
- the destination RGBAresult
- the result RGBA- Throws:
NullPointerException
- if any argument isnull
-