Fix T51308: Bright/Contrast Doesn't respect Pre-multiplied Alpha
authorSergey Sharybin <sergey.vfx@gmail.com>
Mon, 22 May 2017 15:12:13 +0000 (17:12 +0200)
committerSergey Sharybin <sergey.vfx@gmail.com>
Mon, 22 May 2017 15:15:45 +0000 (17:15 +0200)
commit8cc4c3da8cbe8da197928fa821e140f4b2615c4c
treecde2eb40138570d46f68cae8e10d5d5bb4103fd9
parent849e77b1f957b25ac9223a3dc510e234f4467fd1
Fix T51308: Bright/Contrast Doesn't respect Pre-multiplied Alpha

Brightness/contrast node was changing color but did not modify alpha
or ensured colors are premultiplied on the output. This was giving
artifacts later on unless alpha was manually converted.

Compositor is supposed to work in premultiplied alpha (except of
some really corner cases) so it makes sense to ensure premultiplied
alpha after brightness/contrast node.

This is now done as an option enabled by default, so we:

(a) Keep compatibility with old files.
(b) Have correct behavior for newly created files.

Later on we can get rid of this option.
source/blender/compositor/nodes/COM_BrightnessNode.cpp
source/blender/compositor/operations/COM_BrightnessOperation.cpp
source/blender/compositor/operations/COM_BrightnessOperation.h
source/blender/editors/space_node/drawnode.c
source/blender/makesrna/intern/rna_nodetree.c
source/blender/nodes/NOD_static_types.h
source/blender/nodes/composite/nodes/node_composite_brightness.c