BlendModeCompat
public
final
enum
BlendModeCompat
extends Enum<BlendModeCompat>
java.lang.Object | ||
↳ | java.lang.Enum<androidx.core.graphics.BlendModeCompat> | |
↳ | androidx.core.graphics.BlendModeCompat |
Compat version of BlendMode
, usages of BlendModeCompat
will
map to PorterDuff.Mode
wherever possible
Summary
Enum values | |
---|---|
BlendModeCompat |
CLEAR
|
BlendModeCompat |
COLOR
Replaces hue and saturation of destination with hue and saturation of source, leaving luminosity unchanged. |
BlendModeCompat |
COLOR_BURN
|
BlendModeCompat |
COLOR_DODGE
|
BlendModeCompat |
DARKEN
|
BlendModeCompat |
DIFFERENCE
|
BlendModeCompat |
DST
|
BlendModeCompat |
DST_ATOP
|
BlendModeCompat |
DST_IN
|
BlendModeCompat |
DST_OUT
|
BlendModeCompat |
DST_OVER
|
BlendModeCompat |
EXCLUSION
|
BlendModeCompat |
HARD_LIGHT
|
BlendModeCompat |
HUE
Replaces hue of destination with hue of source, leaving saturation and luminosity unchanged. |
BlendModeCompat |
LIGHTEN
|
BlendModeCompat |
LUMINOSITY
Replaces luminosity of destination with luminosity of source, leaving hue and saturation unchanged. |
BlendModeCompat |
MODULATE
|
BlendModeCompat |
MULTIPLY
|
BlendModeCompat |
OVERLAY
|
BlendModeCompat |
PLUS
|
BlendModeCompat |
SATURATION
Replaces saturation of destination saturation hue of source, leaving hue and luminosity unchanged. |
BlendModeCompat |
SCREEN
|
BlendModeCompat |
SOFT_LIGHT
|
BlendModeCompat |
SRC
|
BlendModeCompat |
SRC_ATOP
|
BlendModeCompat |
SRC_IN
|
BlendModeCompat |
SRC_OUT
|
BlendModeCompat |
SRC_OVER
|
BlendModeCompat |
XOR
|
Public methods | |
---|---|
static
BlendModeCompat
|
valueOf(String name)
|
static
final
BlendModeCompat[]
|
values()
|
Inherited methods | |
---|---|
Enum values
CLEAR
public static final BlendModeCompat CLEAR
\(\alpha_{out} = 0\)
\(C_{out} = 0\)
COLOR
public static final BlendModeCompat COLOR
Replaces hue and saturation of destination with hue and saturation of source, leaving luminosity unchanged.
COLOR_BURN
public static final BlendModeCompat 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 BlendModeCompat COLOR_DODGE
\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 BlendModeCompat 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 BlendModeCompat 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 BlendModeCompat DST
\(\alpha_{out} = \alpha_{dst}\)
\(C_{out} = C_{dst}\)
DST_ATOP
public static final BlendModeCompat DST_ATOP
\(\alpha_{out} = \alpha_{src}\)
\(C_{out} = \alpha_{src} * C_{dst} + (1 - \alpha_{dst}) * C_{src}\)
DST_IN
public static final BlendModeCompat DST_IN
\(\alpha_{out} = \alpha_{src} * \alpha_{dst}\)
\(C_{out} = C_{dst} * \alpha_{src}\)
DST_OUT
public static final BlendModeCompat DST_OUT
\(\alpha_{out} = (1 - \alpha_{src}) * \alpha_{dst}\)
\(C_{out} = (1 - \alpha_{src}) * C_{dst}\)
DST_OVER
public static final BlendModeCompat DST_OVER
\(\alpha_{out} = \alpha_{dst} + (1 - \alpha_{dst}) * \alpha_{src}\)
\(C_{out} = C_{dst} + (1 - \alpha_{dst}) * C_{src}\)
EXCLUSION
public static final BlendModeCompat 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 BlendModeCompat 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 BlendModeCompat HUE
Replaces hue of destination with hue of source, leaving saturation and luminosity unchanged.
LIGHTEN
public static final BlendModeCompat 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 BlendModeCompat LUMINOSITY
Replaces luminosity of destination with luminosity of source, leaving hue and saturation unchanged.
MODULATE
public static final BlendModeCompat MODULATE
\(\alpha_{out} = \alpha_{src} * \alpha_{dst}\)
\(C_{out} = C_{src} * C_{dst}\)
MULTIPLY
public static final BlendModeCompat 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 BlendModeCompat 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 BlendModeCompat 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 BlendModeCompat SATURATION
Replaces saturation of destination saturation hue of source, leaving hue and luminosity unchanged.
SCREEN
public static final BlendModeCompat 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 BlendModeCompat 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 BlendModeCompat SRC
\(\alpha_{out} = \alpha_{src}\)
\(C_{out} = C_{src}\)
SRC_ATOP
public static final BlendModeCompat SRC_ATOP
\(\alpha_{out} = \alpha_{dst}\)
\(C_{out} = \alpha_{dst} * C_{src} + (1 - \alpha_{src}) * C_{dst}\)
SRC_IN
public static final BlendModeCompat SRC_IN
\(\alpha_{out} = \alpha_{src} * \alpha_{dst}\)
\(C_{out} = C_{src} * \alpha_{dst}\)
SRC_OUT
public static final BlendModeCompat SRC_OUT
\(\alpha_{out} = (1 - \alpha_{dst}) * \alpha_{src}\)
\(C_{out} = (1 - \alpha_{dst}) * C_{src}\)
SRC_OVER
public static final BlendModeCompat SRC_OVER
\(\alpha_{out} = \alpha_{src} + (1 - \alpha_{src}) * \alpha_{dst}\)
\(C_{out} = C_{src} + (1 - \alpha_{src}) * C_{dst}\)
XOR
public static final BlendModeCompat 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
valueOf
public static BlendModeCompat valueOf (String name)
Parameters | |
---|---|
name |
String |
Returns | |
---|---|
BlendModeCompat |
Content and code samples on this page are subject to the licenses described in the Content License. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2020-09-30 UTC.