diff options
Diffstat (limited to 'source/blender/nodes/composite')
4 files changed, 20 insertions, 29 deletions
diff --git a/source/blender/nodes/composite/node_composite_tree.c b/source/blender/nodes/composite/node_composite_tree.c index e1510f9f813..c9960df1345 100644 --- a/source/blender/nodes/composite/node_composite_tree.c +++ b/source/blender/nodes/composite/node_composite_tree.c @@ -33,6 +33,7 @@ #include <stdio.h> #include "DNA_anim_types.h" +#include "DNA_color_types.h" #include "DNA_scene_types.h" #include "DNA_node_types.h" @@ -693,7 +694,9 @@ static void ntreeCompositExecTreeOld(bNodeTree *ntree, RenderData *rd, int do_pr void *COM_linker_hack = NULL; -void ntreeCompositExecTree(bNodeTree *ntree, RenderData *rd, int rendering, int do_preview) +void ntreeCompositExecTree(bNodeTree *ntree, RenderData *rd, int rendering, int do_preview, + const ColorManagedViewSettings *view_settings, + const ColorManagedDisplaySettings *display_settings) { #ifdef WITH_COMPOSITOR #ifdef WITH_COMPOSITOR_LEGACY @@ -704,10 +707,11 @@ void ntreeCompositExecTree(bNodeTree *ntree, RenderData *rd, int rendering, int else #endif { - COM_execute(rd, ntree, rendering); + COM_execute(rd, ntree, rendering, view_settings, display_settings); } #else (void)ntree, (void)rd, (void)rendering, (void)do_preview; + (void)view_settings, (void)display_settings; #endif (void)do_preview; diff --git a/source/blender/nodes/composite/node_composite_util.c b/source/blender/nodes/composite/node_composite_util.c index 2277c5a2836..8f01408d8c7 100644 --- a/source/blender/nodes/composite/node_composite_util.c +++ b/source/blender/nodes/composite/node_composite_util.c @@ -146,7 +146,7 @@ CompBuf *get_cropped_compbuf(rcti *drect, float *rectf, int rectx, int recty, in if (disprect.xmin>= disprect.xmax) return NULL; if (disprect.ymin>= disprect.ymax) return NULL; - cbuf= alloc_compbuf(BLI_RCT_SIZE_X(&disprect), BLI_RCT_SIZE_Y(&disprect), type, 1); + cbuf= alloc_compbuf(BLI_rcti_size_x(&disprect), BLI_rcti_size_y(&disprect), type, 1); outfp= cbuf->rect; rectf += type*(disprect.ymin*rectx + disprect.xmin); dx= type*cbuf->x; @@ -606,6 +606,9 @@ static CompBuf *generate_procedural_preview(CompBuf *cbuf, int newx, int newy) return outbuf; } +/* OCIO_TODO: this function is only used by legacy compositor system only, which would likely be removed soon, + * keep check for old color management flag for now + */ void generate_preview(void *data, bNode *node, CompBuf *stackbuf) { RenderData *rd= data; diff --git a/source/blender/nodes/composite/nodes/node_composite_image.c b/source/blender/nodes/composite/nodes/node_composite_image.c index 96a92055ca9..9f3874560ac 100644 --- a/source/blender/nodes/composite/nodes/node_composite_image.c +++ b/source/blender/nodes/composite/nodes/node_composite_image.c @@ -282,6 +282,8 @@ static void cmp_node_image_update(bNodeTree *ntree, bNode *node) cmp_node_image_verify_outputs(ntree, node); } +#ifdef WITH_COMPOSITOR_LEGACY + /* float buffer from the image with matching color management */ float *node_composit_get_float_buffer(RenderData *rd, ImBuf *ibuf, int *alloc) { @@ -290,40 +292,25 @@ float *node_composit_get_float_buffer(RenderData *rd, ImBuf *ibuf, int *alloc) *alloc= FALSE; + /* OCIO_TODO: this is a part of legacy compositor system, don't bother with porting this code + * to new color management system since this code would likely be simply removed soon + */ if (rd->color_mgt_flag & R_COLOR_MANAGEMENT) { - if (ibuf->profile != IB_PROFILE_NONE) { - rect= ibuf->rect_float; - } - else { - rect= MEM_mapallocN(sizeof(float) * 4 * ibuf->x * ibuf->y, "node_composit_get_image"); - - IMB_buffer_float_from_float(rect, ibuf->rect_float, - 4, IB_PROFILE_LINEAR_RGB, IB_PROFILE_SRGB, predivide, - ibuf->x, ibuf->y, ibuf->x, ibuf->x); - - *alloc= TRUE; - } + rect= ibuf->rect_float; } else { - if (ibuf->profile == IB_PROFILE_NONE) { - rect= ibuf->rect_float; - } - else { - rect= MEM_mapallocN(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"); - IMB_buffer_float_from_float(rect, ibuf->rect_float, - 4, IB_PROFILE_SRGB, IB_PROFILE_LINEAR_RGB, predivide, - ibuf->x, ibuf->y, ibuf->x, ibuf->x); + IMB_buffer_float_from_float(rect, ibuf->rect_float, + 4, IB_PROFILE_SRGB, IB_PROFILE_LINEAR_RGB, predivide, + ibuf->x, ibuf->y, ibuf->x, ibuf->x); *alloc= TRUE; - } } return rect; } -#ifdef WITH_COMPOSITOR_LEGACY - /* note: this function is used for multilayer too, to ensure uniform * handling with BKE_image_get_ibuf() */ static CompBuf *node_composit_get_image(RenderData *rd, Image *ima, ImageUser *iuser) diff --git a/source/blender/nodes/composite/nodes/node_composite_outputFile.c b/source/blender/nodes/composite/nodes/node_composite_outputFile.c index 2d9b9348668..656e2a72c03 100644 --- a/source/blender/nodes/composite/nodes/node_composite_outputFile.c +++ b/source/blender/nodes/composite/nodes/node_composite_outputFile.c @@ -267,9 +267,6 @@ static void exec_output_file_singlelayer(RenderData *rd, bNode *node, bNodeStack ibuf->rect_float = cbuf->rect; ibuf->dither = rd->dither_intensity; - if (rd->color_mgt_flag & R_COLOR_MANAGEMENT) - ibuf->profile = IB_PROFILE_LINEAR_RGB; - /* get full path */ BLI_join_dirfile(path, FILE_MAX, nimf->base_path, sockdata->path); BKE_makepicstring(filename, path, bmain->name, rd->cfra, format->imtype, (rd->scemode & R_EXTENSION), TRUE); |