- All Implemented Interfaces:
Serializable
,Comparable<BlendMode>
,Constable
,BlendFunction
BlendMode is an enum of several prebuilt
BlendFunction
s.-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionRandom chance of using color of top pixel based on alpha as the probability.Takes the max value of each channel for the destination pixel; alpha, red, green, blue.Adds the top and bottom pixels together ignoring alpha.Transparent ifalpha < 255
(bottom pixel used).Takes the RGB channel values from 0 to 1 of each pixel in the top layer and multiples them with the values for the corresponding pixel from the bottom layer.No blending happens.Blends top onto bottom based on alpha of top pixel. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Method called to set the color of the pixel at pixelIndex.static BlendMode
Returns the enum constant of this class with the specified name.static BlendMode[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NO_BLENDING
No blending happens. Top pixel is used. -
MASK
Transparent ifalpha < 255
(bottom pixel used). -
NORMAL
Blends top onto bottom based on alpha of top pixel. -
DISSOLVE
Random chance of using color of top pixel based on alpha as the probability. An alpha of 127 would be a 50% chance of using the top pixel. -
LINEAR_DODGE
Adds the top and bottom pixels together ignoring alpha. -
MULTIPLY
Takes the RGB channel values from 0 to 1 of each pixel in the top layer and multiples them with the values for the corresponding pixel from the bottom layer. -
LIGHTEN
Takes the max value of each channel for the destination pixel; alpha, red, green, blue.
-
-
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
-
set
Description copied from interface:BlendFunction
Method called to set the color of the pixel at pixelIndex.- Specified by:
set
in interfaceBlendFunction
- Parameters:
pixels
- the array of pixelspixelIndex
- the index of the destination pixel to modifycolor
- theColor
of the top pixel being applied
-