BlendMode
public
final
enum
BlendMode
extends Enum<BlendMode>
java.lang.Object | ||
↳ | java.lang.Enum<android.graphics.BlendMode> | |
↳ | android.graphics.BlendMode |
Summary
Enum values | |
---|---|
BlendMode |
CLEAR
|
BlendMode |
COLOR
|
BlendMode |
COLOR_BURN
|
BlendMode |
COLOR_DODGE
|
BlendMode |
DARKEN
|
BlendMode |
DIFFERENCE
|
BlendMode |
DST
|
BlendMode |
DST_ATOP
|
BlendMode |
DST_IN
|
BlendMode |
DST_OUT
|
BlendMode |
DST_OVER
|
BlendMode |
EXCLUSION
|
BlendMode |
HARD_LIGHT
|
BlendMode |
HUE
|
BlendMode |
LIGHTEN
|
BlendMode |
LUMINOSITY
|
BlendMode |
MODULATE
|
BlendMode |
MULTIPLY
|
BlendMode |
OVERLAY
|
BlendMode |
PLUS
|
BlendMode |
SATURATION
|
BlendMode |
SCREEN
|
BlendMode |
SOFT_LIGHT
|
BlendMode |
SRC
|
BlendMode |
SRC_ATOP
|
BlendMode |
SRC_IN
|
BlendMode |
SRC_OUT
|
BlendMode |
SRC_OVER
|
BlendMode |
XOR
|
Public methods | |
---|---|
static
BlendMode
|
valueOf(String name)
|
static
final
BlendMode[]
|
values()
|
Inherited methods | |
---|---|
Enum values
CLEAR
public static final BlendMode CLEAR
\(\alpha_{out} = 0\)
\(C_{out} = 0\)
COLOR
public static final BlendMode COLOR
COLOR_BURN
public static final BlendMode COLOR_BURN
\(\alpha_{out} = \alpha_{src} + \alpha_{dst} - \alpha_{src} * \alpha_{dst}\)
\begin{equation} C_{out} = \begin{cases} C_{dst} + C_{src}*(1 - \alpha_{dst}) & C_{dst} = \alpha_{dst} \\ \alpha_{dst}*(1 - \alpha_{src}) & C_{src} = 0 \\ \alpha_{src}*(\alpha_{dst} - min(\alpha_{dst}, (\alpha_{dst} - C_{dst})*\alpha_{src}/C_{src})) + C_{src} * (1 - \alpha_{dst}) + \alpha_{dst}*(1-\alpha_{src}) & otherwise \end{cases} \end{equation}
COLOR_DODGE
public static final BlendMode COLOR_DODGE
\(\alpha_{out} = \alpha_{src} + \alpha_{dst} - \alpha_{src} * \alpha_{dst}\)
\begin{equation} C_{out} = \begin{cases} C_{src} * (1 - \alpha_{dst}) & C_{dst} = 0 \\ C_{src} + \alpha_{dst}*(1 - \alpha_{src}) & C_{src} = \alpha_{src} \\ \alpha_{src} * min(\alpha_{dst}, C_{dst} * \alpha_{src}/(\alpha_{src} - C_{src})) + C_{src} *(1 - \alpha_{dst} + \alpha_{dst}*(1 - \alpha_{src}) & otherwise \end{cases} \end{equation}
DARKEN
public static final BlendMode DARKEN
\(\alpha_{out} = \alpha_{src} + \alpha_{dst} - \alpha_{src} * \alpha_{dst}\)
\(C_{out} = (1 - \alpha_{dst}) * C_{src} + (1 - \alpha_{src}) * C_{dst} + min(C_{src}, C_{dst})\)
DIFFERENCE
public static final BlendMode DIFFERENCE
\begin{equation} \alpha_{out} = \alpha_{src} + \alpha_{dst} - \alpha_{src} * \alpha_{dst} \end{equation}
\begin{equation} C_{out} = C_{src} + C_{dst} - 2 * min(C_{src} * \alpha_{dst}, C_{dst} * \alpha_{src}) \end{equation}
DST
public static final BlendMode DST
\(\alpha_{out} = \alpha_{dst}\)
\(C_{out} = C_{dst}\)
DST_ATOP
public static final BlendMode DST_ATOP
\(\alpha_{out} = \alpha_{src}\)
\(C_{out} = \alpha_{src} * C_{dst} + (1 - \alpha_{dst}) * C_{src}\)
DST_IN
public static final BlendMode DST_IN
\(\alpha_{out} = \alpha_{src} * \alpha_{dst}\)
\(C_{out} = C_{dst} * \alpha_{src}\)
DST_OUT
public static final BlendMode DST_OUT
\(\alpha_{out} = (1 - \alpha_{src}) * \alpha_{dst}\)
\(C_{out} = (1 - \alpha_{src}) * C_{dst}\)
DST_OVER
public static final BlendMode DST_OVER
\(\alpha_{out} = \alpha_{dst} + (1 - \alpha_{dst}) * \alpha_{src}\)
\(C_{out} = C_{dst} + (1 - \alpha_{dst}) * C_{src}\)
EXCLUSION
public static final BlendMode EXCLUSION
\begin{equation} \alpha_{out} = \alpha_{src} + \alpha_{dst} - \alpha_{src} * \alpha_{dst} \end{equation}
\begin{equation} C_{out} = C_{src} + C_{dst} - 2 * C_{src} * C_{dst} \end{equation}
HARD_LIGHT
public static final BlendMode HARD_LIGHT
\(\alpha_{out} = \alpha_{src} + \alpha_{dst} - \alpha_{src} * \alpha_{dst}\)
\begin{equation} C_{out} = \begin{cases} 2*C_{src}*C_{dst} & C_{src}*(1-\alpha_{dst}) + C_{dst}*(1-\alpha_{src}) + 2*C_{src} \leq \alpha_{src} \\ \alpha_{src}*\alpha_{dst}- 2*(\alpha_{dst} - C_{dst})*(\alpha_{src} - C_{src}) & otherwise \end{cases} \end{equation}
HUE
public static final BlendMode HUE
LIGHTEN
public static final BlendMode LIGHTEN
\(\alpha_{out} = \alpha_{src} + \alpha_{dst} - \alpha_{src} * \alpha_{dst}\)
\(C_{out} = (1 - \alpha_{dst}) * C_{src} + (1 - \alpha_{src}) * C_{dst} + max(C_{src}, C_{dst})\)
LUMINOSITY
public static final BlendMode LUMINOSITY
MODULATE
public static final BlendMode MODULATE
\(\alpha_{out} = \alpha_{src} * \alpha_{dst}\)
\(C_{out} = C_{src} * C_{dst}\)
MULTIPLY
public static final BlendMode MULTIPLY
\(\alpha_{out} = \alpha_{src} + \alpha_{dst} - \alpha_{src} * \alpha_{dst}\)
\(C_{out} = C_{src} * (1 - \alpha_{dst}) + C_{dst} * (1 - \alpha_{src}) + (C_{src} * C_{dst})\)
OVERLAY
public static final BlendMode OVERLAY
\(\alpha_{out} = \alpha_{src} + \alpha_{dst} - \alpha_{src} * \alpha_{dst}\)
\(\begin{equation} C_{out} = \begin{cases} 2 * C_{src} * C_{dst} & 2 * C_{dst} \lt \alpha_{dst} \\ \alpha_{src} * \alpha_{dst} - 2 (\alpha_{dst} - C_{src}) (\alpha_{src} - C_{dst}) & otherwise \end{cases} \end{equation}\)
PLUS
public static final BlendMode PLUS
\(\alpha_{out} = max(0, min(\alpha_{src} + \alpha_{dst}, 1))\)
\(C_{out} = max(0, min(C_{src} + C_{dst}, 1))\)
SATURATION
public static final BlendMode SATURATION
SCREEN
public static final BlendMode SCREEN
\(\alpha_{out} = \alpha_{src} + \alpha_{dst} - \alpha_{src} * \alpha_{dst}\)
\(C_{out} = C_{src} + C_{dst} - C_{src} * C_{dst}\)
SOFT_LIGHT
public static final BlendMode SOFT_LIGHT
Where \begin{equation} m = \begin{cases} C_{dst} / \alpha_{dst} & \alpha_{dst} \gt 0 \\ 0 & otherwise \end{cases} \end{equation}
\begin{equation} g = \begin{cases} (16 * m * m + 4 * m) * (m - 1) + 7 * m & 4 * C_{dst} \leq \alpha_{dst} \\ \sqrt m - m & otherwise \end{cases} \end{equation}
\begin{equation} f = \begin{cases} C_{dst} * (\alpha_{src} + (2 * C_{src} - \alpha_{src}) * (1 - m)) & 2 * C_{src} \leq \alpha_{src} \\ C_{dst} * \alpha_{src} + \alpha_{dst} * (2 * C_{src} - \alpha_{src}) * g & otherwise \end{cases} \end{equation}
\begin{equation} \alpha_{out} = \alpha_{src} + \alpha_{dst} - \alpha_{src} * \alpha_{dst} \end{equation} \begin{equation} C_{out} = C_{src} / \alpha_{dst} + C_{dst} / \alpha_{src} + f \end{equation}
SRC
public static final BlendMode SRC
\(\alpha_{out} = \alpha_{src}\)
\(C_{out} = C_{src}\)
SRC_ATOP
public static final BlendMode SRC_ATOP
\(\alpha_{out} = \alpha_{dst}\)
\(C_{out} = \alpha_{dst} * C_{src} + (1 - \alpha_{src}) * C_{dst}\)
SRC_IN
public static final BlendMode SRC_IN
\(\alpha_{out} = \alpha_{src} * \alpha_{dst}\)
\(C_{out} = C_{src} * \alpha_{dst}\)
SRC_OUT
public static final BlendMode SRC_OUT
\(\alpha_{out} = (1 - \alpha_{dst}) * \alpha_{src}\)
\(C_{out} = (1 - \alpha_{dst}) * C_{src}\)
SRC_OVER
public static final BlendMode SRC_OVER
\(\alpha_{out} = \alpha_{src} + (1 - \alpha_{src}) * \alpha_{dst}\)
\(C_{out} = C_{src} + (1 - \alpha_{src}) * C_{dst}\)
XOR
public static final BlendMode XOR
\(\alpha_{out} = (1 - \alpha_{dst}) * \alpha_{src} + (1 - \alpha_{src}) * \alpha_{dst}\)
\(C_{out} = (1 - \alpha_{dst}) * C_{src} + (1 - \alpha_{src}) * C_{dst}\)
Public methods
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2024-09-03 UTC.