From 28458168638e8fe5122bcf03ede5148fcdd3d271 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 17 Aug 2012 13:00:11 +0000 Subject: HDR color picking was not working for node space --- source/blender/editors/space_image/image_ops.c | 2 +- source/blender/editors/space_node/node_view.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'source/blender/editors') diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index 9e16f984e09..b969d898882 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -1975,7 +1975,7 @@ int ED_space_image_color_sample(SpaceImage *sima, ARegion *ar, int mval[2], floa if (ibuf->rect_float) { fp = (ibuf->rect_float + (ibuf->channels) * (y * ibuf->x + x)); - if (ibuf->profile == IB_PROFILE_LINEAR_RGB) { + if (ELEM(ibuf->profile, IB_PROFILE_LINEAR_RGB, IB_PROFILE_NONE)) { linearrgb_to_srgb_v3_v3(r_col, fp); } else { diff --git a/source/blender/editors/space_node/node_view.c b/source/blender/editors/space_node/node_view.c index 79ca10fd7b4..27b57885b2b 100644 --- a/source/blender/editors/space_node/node_view.c +++ b/source/blender/editors/space_node/node_view.c @@ -383,8 +383,8 @@ int ED_space_node_color_sample(SpaceNode *snode, ARegion *ar, int mval[2], float if (ibuf->rect_float) { fp = (ibuf->rect_float + (ibuf->channels) * (y * ibuf->x + x)); - - if (ibuf->profile == IB_PROFILE_LINEAR_RGB) { + /* IB_PROFILE_NONE is default but infact its linear */ + if (ELEM(ibuf->profile, IB_PROFILE_LINEAR_RGB, IB_PROFILE_NONE)) { linearrgb_to_srgb_v3_v3(r_col, fp); } else { @@ -437,7 +437,7 @@ static void sample_apply(bContext *C, wmOperator *op, wmEvent *event) if (fx >= 0.0f && fy >= 0.0f && fx < 1.0f && fy < 1.0f) { float *fp; - char *cp; + unsigned char *cp; int x = (int)(fx * ibuf->x), y = (int)(fy * ibuf->y); CLAMP(x, 0, ibuf->x - 1); @@ -449,7 +449,7 @@ static void sample_apply(bContext *C, wmOperator *op, wmEvent *event) info->channels = ibuf->channels; if (ibuf->rect) { - cp = (char *)(ibuf->rect + y * ibuf->x + x); + cp = (unsigned char *)(ibuf->rect + y * ibuf->x + x); info->col[0] = cp[0]; info->col[1] = cp[1]; -- cgit v1.2.3