diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-09-22 18:13:34 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-09-22 18:13:34 +0400 |
commit | 9387d46772e3abcd9cfff611008b611a18ca05a9 (patch) | |
tree | 54d2c77a22051cc5853feeeb7fb14bbeeff51f76 /source | |
parent | 9f901f642264d8597cc0651c34628215cded798e (diff) |
bugfix [#23948] Alpha from images inside compositor is gone
also fix memory leak.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenlib/intern/math_color.c | 2 | ||||
-rw-r--r-- | source/blender/nodes/intern/CMP_nodes/CMP_image.c | 7 |
2 files changed, 6 insertions, 3 deletions
diff --git a/source/blender/blenlib/intern/math_color.c b/source/blender/blenlib/intern/math_color.c index 787e126a42b..2b6a091cc8d 100644 --- a/source/blender/blenlib/intern/math_color.c +++ b/source/blender/blenlib/intern/math_color.c @@ -393,6 +393,7 @@ void srgb_to_linearrgb_rgba_rgba_buf(float *col_to, float *col_from, int tot) { while(tot--) { srgb_to_linearrgb_v3_v3(col_to, col_from); + col_to[3]= col_from[3]; col_to += 4; col_from += 4; } @@ -402,6 +403,7 @@ void linearrgb_to_srgb_rgba_rgba_buf(float *col_to, float *col_from, int tot) { while(tot--) { linearrgb_to_srgb_v3_v3(col_to, col_from); + col_to[3]= col_from[3]; col_to += 4; col_from += 4; } diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_image.c b/source/blender/nodes/intern/CMP_nodes/CMP_image.c index 266060c5cc5..9309d2939db 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_image.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_image.c @@ -82,7 +82,7 @@ static CompBuf *node_composit_get_image(RenderData *rd, Image *ima, ImageUser *i rect= ibuf->rect_float; } else { - rect= MEM_mallocN(sizeof(float) * 4 * ibuf->x * ibuf->y, "node_composit_get_image"); + rect= MEM_mapallocN(sizeof(float) * 4 * ibuf->x * ibuf->y, "node_composit_get_image"); srgb_to_linearrgb_rgba_rgba_buf(rect, ibuf->rect_float, ibuf->x * ibuf->y); alloc= TRUE; } @@ -92,7 +92,7 @@ static CompBuf *node_composit_get_image(RenderData *rd, Image *ima, ImageUser *i rect= ibuf->rect_float; } else { - rect= MEM_mallocN(sizeof(float) * 4 * ibuf->x * ibuf->y, "node_composit_get_image"); + rect= MEM_mapallocN(sizeof(float) * 4 * ibuf->x * ibuf->y, "node_composit_get_image"); linearrgb_to_srgb_rgba_rgba_buf(rect, ibuf->rect_float, ibuf->x * ibuf->y); alloc= TRUE; } @@ -109,8 +109,9 @@ static CompBuf *node_composit_get_image(RenderData *rd, Image *ima, ImageUser *i } else { /* we put imbuf copy on stack, cbuf knows rect is from other ibuf when freed! */ - stackbuf= alloc_compbuf(ibuf->x, ibuf->y, type, alloc); + stackbuf= alloc_compbuf(ibuf->x, ibuf->y, type, FALSE); stackbuf->rect= rect; + stackbuf->malloc= alloc; } /*code to respect the premul flag of images; I'm |