diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-03-18 15:34:05 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-03-18 15:34:05 +0400 |
commit | b19155e76cca879724f7deae2cfd71d19f953229 (patch) | |
tree | fd9f377b847c3e299617ab6ed28609653e5cd72d /source/blender/editors/space_sequencer/sequencer_view.c | |
parent | 4c1d80bf86d112deef528d3737230452e3616839 (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_sequencer/sequencer_view.c')
-rw-r--r-- | source/blender/editors/space_sequencer/sequencer_view.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/source/blender/editors/space_sequencer/sequencer_view.c b/source/blender/editors/space_sequencer/sequencer_view.c index 7dcd3a70870..68428cd890f 100644 --- a/source/blender/editors/space_sequencer/sequencer_view.c +++ b/source/blender/editors/space_sequencer/sequencer_view.c @@ -31,6 +31,7 @@ #include "MEM_guardedalloc.h" +#include "BLI_math.h" #include "BLI_utildefines.h" #include "DNA_scene_types.h" @@ -66,6 +67,7 @@ typedef struct ImageSampleInfo { unsigned char col[4]; float colf[4]; + float linearcol[4]; unsigned char *colp; float *colfp; @@ -81,7 +83,8 @@ 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->colp, info->colfp, NULL, NULL); + info->x, info->y, info->colp, info->colfp, + info->linearcol, NULL, NULL); } } @@ -134,7 +137,10 @@ static void sample_apply(bContext *C, wmOperator *op, const wmEvent *event) info->colf[3] = (float)cp[3] / 255.0f; info->colfp = info->colf; - 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)); |