BlendMode
class BlendMode
|
Summary
Enum values | |
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Enum values
CLEAR
enum val CLEAR : BlendMode
Destination pixels covered by the source are cleared to 0.
αout=0
Cout=0
COLOR
enum val COLOR : BlendMode
Replaces hue and saturation of destination with hue and saturation of source, leaving luminosity unchanged.
COLOR_BURN
enum val COLOR_BURN : BlendMode
Makes destination darker to reflect source.
αout=αsrc+αdst−αsrc∗αdst
Cout={Cdst+Csrc∗(1−αdst)Cdst=αdstαdst∗(1−αsrc)Csrc=0αsrc∗(αdst−min(αdst,(αdst−Cdst)∗αsrc/Csrc))+Csrc∗(1−αdst)+αdst∗(1−αsrc)otherwise
COLOR_DODGE
enum val COLOR_DODGE : BlendMode
Makes destination brighter to reflect source.
αout=αsrc+αdst−αsrc∗αdst
Cout={Csrc∗(1−αdst)Cdst=0Csrc+αdst∗(1−αsrc)Csrc=αsrcαsrc∗min(αdst,Cdst∗αsrc/(αsrc−Csrc))+Csrc∗(1−αdst+αdst∗(1−αsrc)otherwise
DARKEN
enum val DARKEN : BlendMode
Retains the smallest component of the source and destination pixels.
αout=αsrc+αdst−αsrc∗αdst
Cout=(1−αdst)∗Csrc+(1−αsrc)∗Cdst+min(Csrc,Cdst)
DIFFERENCE
enum val DIFFERENCE : BlendMode
Subtracts darker from lighter with higher contrast.
αout=αsrc+αdst−αsrc∗αdst
Cout=Csrc+Cdst−2∗min(Csrc∗αdst,Cdst∗αsrc)
DST
enum val DST : BlendMode
The source pixels are discarded, leaving the destination intact.
αout=αdst
Cout=Cdst
DST_ATOP
enum val DST_ATOP : BlendMode
Discards the destination pixels that are not covered by source pixels. Draws remaining destination pixels over source pixels.
αout=αsrc
Cout=αsrc∗Cdst+(1−αdst)∗Csrc
DST_IN
enum val DST_IN : BlendMode
Keeps the destination pixels that cover source pixels, discards the remaining source and destination pixels.
αout=αsrc∗αdst
Cout=Cdst∗αsrc
DST_OUT
enum val DST_OUT : BlendMode
Keeps the destination pixels that are not covered by source pixels. Discards destination pixels that are covered by source pixels. Discards all source pixels.
αout=(1−αsrc)∗αdst
Cout=(1−αsrc)∗Cdst
DST_OVER
enum val DST_OVER : BlendMode
The source pixels are drawn behind the destination pixels.
αout=αdst+(1−αdst)∗αsrc
Cout=Cdst+(1−αdst)∗Csrc
EXCLUSION
enum val EXCLUSION : BlendMode
Subtracts darker from lighter with lower contrast.
αout=αsrc+αdst−αsrc∗αdst
Cout=Csrc+Cdst−2∗Csrc∗Cdst
HARD_LIGHT
enum val HARD_LIGHT : BlendMode
Makes destination lighter or darker, depending on source.
αout=αsrc+αdst−αsrc∗αdst
Cout={2∗Csrc∗CdstCsrc∗(1−αdst)+Cdst∗(1−αsrc)+2∗Csrc≤αsrcαsrc∗αdst−2∗(αdst−Cdst)∗(αsrc−Csrc)otherwise
HUE
enum val HUE : BlendMode
Replaces hue of destination with hue of source, leaving saturation and luminosity unchanged.
LIGHTEN
enum val LIGHTEN : BlendMode
Retains the largest component of the source and destination pixel.
αout=αsrc+αdst−αsrc∗αdst
Cout=(1−αdst)∗Csrc+(1−αsrc)∗Cdst+max(Csrc,Cdst)
LUMINOSITY
enum val LUMINOSITY : BlendMode
Replaces luminosity of destination with luminosity of source, leaving hue and saturation unchanged.
MODULATE
enum val MODULATE : BlendMode
Multiplies the source and destination pixels.
αout=αsrc∗αdst
Cout=Csrc∗Cdst
MULTIPLY
enum val MULTIPLY : BlendMode
Multiplies the source and destination pixels.
αout=αsrc+αdst−αsrc∗αdst
Cout=Csrc∗(1−αdst)+Cdst∗(1−αsrc)+(Csrc∗Cdst)
OVERLAY
enum val OVERLAY : BlendMode
Multiplies or screens the source and destination depending on the destination color.
αout=αsrc+αdst−αsrc∗αdst
Cout={2∗Csrc∗Cdst2∗Cdst<αdstαsrc∗αdst−2(αdst−Csrc)(αsrc−Cdst)otherwise
PLUS
enum val PLUS : BlendMode
Adds the source pixels to the destination pixels and saturates the result.
αout=max(0,min(αsrc+αdst,1))
Cout=max(0,min(Csrc+Cdst,1))
SATURATION
enum val SATURATION : BlendMode
Replaces saturation of destination saturation hue of source, leaving hue and luminosity unchanged.
SCREEN
enum val SCREEN : BlendMode
Adds the source and destination pixels, then subtracts the source pixels multiplied by the destination.
αout=αsrc+αdst−αsrc∗αdst
Cout=Csrc+Cdst−Csrc∗Cdst
SOFT_LIGHT
enum val SOFT_LIGHT : BlendMode
Makes destination lighter or darker, depending on source.
Where m={Cdst/αdstαdst>00otherwise
g={(16∗m∗m+4∗m)∗(m−1)+7∗m4∗Cdst≤αdst√m−motherwise
f={Cdst∗(αsrc+(2∗Csrc−αsrc)∗(1−m))2∗Csrc≤αsrcCdst∗αsrc+αdst∗(2∗Csrc−αsrc)∗gotherwise
αout=αsrc+αdst−αsrc∗αdst
SRC
enum val SRC : BlendMode
The source pixels replace the destination pixels.
αout=αsrc
Cout=Csrc
SRC_ATOP
enum val SRC_ATOP : BlendMode
Discards the source pixels that do not cover destination pixels. Draws remaining source pixels over destination pixels.
αout=αdst
Cout=αdst∗Csrc+(1−αsrc)∗Cdst
SRC_IN
enum val SRC_IN : BlendMode
Keeps the source pixels that cover the destination pixels, discards the remaining source and destination pixels.
αout=αsrc∗αdst
Cout=Csrc∗αdst
SRC_OUT
enum val SRC_OUT : BlendMode
Keeps the source pixels that do not cover destination pixels. Discards source pixels that cover destination pixels. Discards all destination pixels.
αout=(1−αdst)∗αsrc
Cout=(1−αdst)∗Csrc
SRC_OVER
enum val SRC_OVER : BlendMode
The source pixels are drawn over the destination pixels.
αout=αsrc+(1−αsrc)∗αdst
Cout=Csrc+(1−αsrc)∗Cdst
XOR
enum val XOR : BlendMode
Discards the source and destination pixels where source pixels cover destination pixels. Draws remaining source pixels.
αout=(1−αdst)∗αsrc+(1−αsrc)∗αdst
Cout=(1−αdst)∗Csrc+(1−αsrc)∗Cdst