2020-02-01 20:39:28 -05:00
|
|
|
|
package d2render
|
2020-01-31 23:18:11 -05:00
|
|
|
|
|
|
|
|
|
type CompositeMode int
|
|
|
|
|
|
|
|
|
|
const (
|
|
|
|
|
// Regular alpha blending
|
|
|
|
|
// c_out = c_src + c_dst × (1 - α_src)
|
2020-02-01 21:51:49 -05:00
|
|
|
|
CompositeModeSourceOver = CompositeMode(1)
|
2020-01-31 23:18:11 -05:00
|
|
|
|
|
|
|
|
|
// c_out = 0
|
2020-02-01 21:51:49 -05:00
|
|
|
|
CompositeModeClear = CompositeMode(2)
|
2020-01-31 23:18:11 -05:00
|
|
|
|
|
|
|
|
|
// c_out = c_src
|
2020-02-01 21:51:49 -05:00
|
|
|
|
CompositeModeCopy = CompositeMode(3)
|
2020-01-31 23:18:11 -05:00
|
|
|
|
|
|
|
|
|
// c_out = c_dst
|
2020-02-01 21:51:49 -05:00
|
|
|
|
CompositeModeDestination = CompositeMode(4)
|
2020-01-31 23:18:11 -05:00
|
|
|
|
|
|
|
|
|
// c_out = c_src × (1 - α_dst) + c_dst
|
2020-02-01 21:51:49 -05:00
|
|
|
|
CompositeModeDestinationOver = CompositeMode(5)
|
2020-01-31 23:18:11 -05:00
|
|
|
|
|
|
|
|
|
// c_out = c_src × α_dst
|
2020-02-01 21:51:49 -05:00
|
|
|
|
CompositeModeSourceIn = CompositeMode(6)
|
2020-01-31 23:18:11 -05:00
|
|
|
|
|
|
|
|
|
// c_out = c_dst × α_src
|
2020-02-01 21:51:49 -05:00
|
|
|
|
CompositeModeDestinationIn = CompositeMode(7)
|
2020-01-31 23:18:11 -05:00
|
|
|
|
|
|
|
|
|
// c_out = c_src × (1 - α_dst)
|
2020-02-01 21:51:49 -05:00
|
|
|
|
CompositeModeSourceOut = CompositeMode(8)
|
2020-01-31 23:18:11 -05:00
|
|
|
|
|
|
|
|
|
// c_out = c_dst × (1 - α_src)
|
2020-02-01 21:51:49 -05:00
|
|
|
|
CompositeModeDestinationOut = CompositeMode(9)
|
2020-01-31 23:18:11 -05:00
|
|
|
|
|
|
|
|
|
// c_out = c_src × α_dst + c_dst × (1 - α_src)
|
2020-02-01 21:51:49 -05:00
|
|
|
|
CompositeModeSourceAtop = CompositeMode(10)
|
2020-01-31 23:18:11 -05:00
|
|
|
|
|
|
|
|
|
// c_out = c_src × (1 - α_dst) + c_dst × α_src
|
2020-02-01 21:51:49 -05:00
|
|
|
|
CompositeModeDestinationAtop = CompositeMode(11)
|
2020-01-31 23:18:11 -05:00
|
|
|
|
|
|
|
|
|
// c_out = c_src × (1 - α_dst) + c_dst × (1 - α_src)
|
2020-02-01 21:51:49 -05:00
|
|
|
|
CompositeModeXor = CompositeMode(12)
|
2020-01-31 23:18:11 -05:00
|
|
|
|
|
|
|
|
|
// Sum of source and destination (a.k.a. 'plus' or 'additive')
|
|
|
|
|
// c_out = c_src + c_dst
|
2020-02-01 21:51:49 -05:00
|
|
|
|
CompositeModeLighter = CompositeMode(13)
|
2020-01-31 23:18:11 -05:00
|
|
|
|
)
|