Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2013-03-18 15:34:05 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2013-03-18 15:34:05 +0400
commitb19155e76cca879724f7deae2cfd71d19f953229 (patch)
treefd9f377b847c3e299617ab6ed28609653e5cd72d /source/blender/editors/space_node/node_view.c
parent4c1d80bf86d112deef528d3737230452e3616839 (diff)
Fix #34672: Image sampling line didn't use color management for byte buffers
This makes it so sample line (for all image editor, sequencer and compositor) displaying managed color for byte buffers as well. It was simply not implemented before.
Diffstat (limited to 'source/blender/editors/space_node/node_view.c')
-rw-r--r--source/blender/editors/space_node/node_view.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/source/blender/editors/space_node/node_view.c b/source/blender/editors/space_node/node_view.c
index a8e84e0a0e5..a2fa7d3caf6 100644
--- a/source/blender/editors/space_node/node_view.c
+++ b/source/blender/editors/space_node/node_view.c
@@ -56,6 +56,7 @@
#include "MEM_guardedalloc.h"
+#include "IMB_colormanagement.h"
#include "IMB_imbuf.h"
#include "IMB_imbuf_types.h"
@@ -335,6 +336,7 @@ typedef struct ImageSampleInfo {
unsigned char col[4];
float colf[4];
+ float linearcol[4];
int z;
float zf;
@@ -353,7 +355,7 @@ static void sample_draw(const bContext *C, ARegion *ar, void *arg_info)
if (info->draw) {
ED_image_draw_info(scene, ar, info->color_manage, FALSE, info->channels,
- info->x, info->y, info->col, info->colf,
+ info->x, info->y, info->col, info->colf, info->linearcol,
info->zp, info->zfp);
}
}
@@ -469,7 +471,10 @@ static void sample_apply(bContext *C, wmOperator *op, const wmEvent *event)
info->colf[2] = (float)cp[2] / 255.0f;
info->colf[3] = (float)cp[3] / 255.0f;
- info->color_manage = FALSE;
+ copy_v4_v4(info->linearcol, info->colf);
+ IMB_colormanagement_colorspace_to_scene_linear_v4(info->linearcol, false, ibuf->rect_colorspace);
+
+ info->color_manage = TRUE;
}
if (ibuf->rect_float) {
fp = (ibuf->rect_float + (ibuf->channels) * (y * ibuf->x + x));