diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2008-02-18 18:21:59 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2008-02-18 18:21:59 +0300 |
commit | 331559d5859644d1ef0e7ce04a7aefd73ff47452 (patch) | |
tree | f56820c9dd755642206f44e63bdcbc2efc98523b /source/blender/nodes/intern/CMP_nodes | |
parent | 314736eeb4bb52b5043e7c6441131ae9700905d4 (diff) |
Bugfix for defocus node gamma correct. It applied gamma correct to
a premul image but that doesn't work correct. Now it depremuls and
premuls again around the gamma correction. Better solution might be
possible, but this gives compatible results.
Diffstat (limited to 'source/blender/nodes/intern/CMP_nodes')
-rw-r--r-- | source/blender/nodes/intern/CMP_nodes/CMP_defocus.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_defocus.c b/source/blender/nodes/intern/CMP_nodes/CMP_defocus.c index 866bf406d1e..f8be69d8092 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_defocus.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_defocus.c @@ -798,16 +798,22 @@ static void node_composit_exec_defocus(void *data, bNode *node, bNodeStack **in, // ok, process old = img; if (nqd->gamco) { - // gamma correct, blender func is simplified, fixed value & RGBA only, should make user param + // gamma correct, blender func is simplified, fixed value & RGBA only, + // should make user param. also depremul and premul afterwards, gamma + // correction can't work with premul alpha old = dupalloc_compbuf(img); + premul_compbuf(old, 1); gamma_correct_compbuf(old, 0); + premul_compbuf(old, 0); } new = alloc_compbuf(old->x, old->y, old->type, 1); defocus_blur(node, new, old, zbuf_use, in[1]->vec[0]*nqd->scale); if (nqd->gamco) { + premul_compbuf(new, 1); gamma_correct_compbuf(new, 1); + premul_compbuf(new, 0); free_compbuf(old); } if(node->exec & NODE_BREAK) { |