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>,java.lang.constant.Constable
- Enclosing class:
- BlendComposite
A blending mode defines the compositing rule of a
BlendComposite.- Author:
- Romain Guy omain.guy@mac.com, Karl Schaefer (support and additional modes)
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionAddis the opposite ofSubtract.TheAverageblending 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.TheColorblending mode applies the hue and saturation of the blend color to the base image while retaining the luminance of the base image.TheColor Burnblending mode increases the contrast to darken the base color while reflecting the blend color.TheColor Dodgeblending mode is essentially the opposite ofColor Burn.TheDarkenblend mode compares the color information for each pixel of the base and the blend color and applies the darker color as the result.TheDifferenceblending mode highlights the differences between the blend layer and the base layer.TheExclusionblending mode works very much likeDifferencebut the contrast is lower.a freeze effect - try it out!a glowing effectKeeps the green channel from the blend image and the red and blue channels from the base image.Hard Lightdrastically lightens or darkens the base image depending on the brightness of the blend color.a hard-mix effect - try it out!a heat effect - try it out!TheHueblend mode applies the hue of the blend color to the base image while retaining the luminance and saturation of the base image.Inverse Color Burnis the same asColor Burnwith the source and destination swapped.Inverse Color Dodgeis the same asColor Dodgewith the source and destination swapped.TheLightenblending mode compares the color information for each pixel of the base and the blend color and applies the lighter color as the result.a linear light effect - try it out!TheLuminosityblending mode applies the luminosity (brightness) of the blend colors to the base image while retaining the hue and saturation of the base image.TheMultiplyblend mode multiplies the base color with the blend color.This one is the "opposite" of difference mode.TheOverlayblending mode preserves the highlights and shadows of the base color while mixing the base color and the blend color.a pin-light effect - try it out!Keeps the red channel from the blend image and the green and blue channels from the base image.REFLECT blend mode can be used for adding shiny objects or areas of light.TheSaturationblending mode applies the saturation of the blend color to the base image while retaining the hue and luminance of the base image.TheScreenblending mode is the opposite of theMultiplymode in that it multiples the inverse of the base color with the blend color.burning darkens an imageDodging lightens an imageTheSoft Lightblend 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.TheSubtractblend mode is similar toColor Burnbut 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. -
Method Summary
Modifier and TypeMethodDescriptionstatic BlendComposite.BlendingModeReturns 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
TheAverageblending 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
TheDarkenblend 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
TheMultiplyblend 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 Burnblending 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 Burnis the same asColor Burnwith the source and destination swapped. -
SOFT_BURN
burning darkens an imageDodging an image is the same as burning its negative (and vice versa).
-
SUBTRACT
TheSubtractblend mode is similar toColor Burnbut 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
TheLightenblending 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
TheScreenblending mode is the opposite of theMultiplymode 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 Dodgeblending mode is essentially the opposite ofColor Burn. TheColor Dodgeblending 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 Dodgeis the same asColor Dodgewith the source and destination swapped. -
SOFT_DODGE
Dodging lightens an imageDodging an image is the same as burning its negative (and vice versa).
-
ADD
-
OVERLAY
TheOverlayblending mode preserves the highlights and shadows of the base color while mixing the base color and the blend color. It is a combination of theMultiplyandScreenblending 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 Lightblend 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 Lightdrastically lightens or darkens the base image depending on the brightness of the blend color. The effect is more intense thanSoft Lightbecause 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
a linear light effect - try it out! -
PIN_LIGHT
a pin-light effect - try it out! -
HARD_MIX
a hard-mix effect - try it out! -
REFLECT
REFLECT blend mode can be used for adding shiny objects or areas of light. -
GLOW
a glowing effect -
FREEZE
a freeze effect - try it out! -
HEAT
a heat effect - try it out! -
DIFFERENCE
TheDifferenceblending 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
TheExclusionblending mode works very much likeDifferencebut 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
TheHueblend 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
TheSaturationblending 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
TheColorblending 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
TheLuminosityblending mode applies the luminosity (brightness) of the blend colors to the base image while retaining the hue and saturation of the base image.Luminosityis the opposite of theColorblending 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.
-
-
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
-