public class GPUImageNormalBlendFilter extends GPUImageTwoInputFilter
D = C1 * C1a + C2 * C2a * (1 - C1a) where D is the resultant color, C1 is the color of the first element, C1a is the alpha of the first element, C2 is the second element color, C2a is the alpha of the second element. The destination alpha is calculated with:
Da = C1a + C2a * (1 - C1a) The resultant color is premultiplied with the alpha. To restore the color to the unmultiplied values, just divide by Da, the resultant alpha.
http://stackoverflow.com/questions/1724946/blend-mode-on-a-transparent-and-semi-transparent-background
For some reason Photoshop behaves D = C1 + C2 * C2a * (1 - C1a)
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
NORMAL_BLEND_FRAGMENT_SHADER |
NO_FILTER_FRAGMENT_SHADER, NO_FILTER_VERTEX_SHADER| Constructor and Description |
|---|
GPUImageNormalBlendFilter() |
getBitmap, onDestroy, onDrawArraysPre, onInit, onInitialized, recycleBitmap, setBitmap, setRotationconvertStreamToString, destroy, getAttribPosition, getAttribTextureCoordinate, getOutputHeight, getOutputWidth, getProgram, getUniformTexture, ifNeedInit, isInitialized, loadShader, onDraw, onOutputSizeChanged, runOnDraw, runPendingOnDrawTasks, setFloat, setFloatArray, setFloatVec2, setFloatVec3, setFloatVec4, setInteger, setPoint, setUniformMatrix3f, setUniformMatrix4fpublic static final java.lang.String NORMAL_BLEND_FRAGMENT_SHADER