[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [60582] trunk/blender/source/blender/ editors/space_image/image_draw.c: Fix #36980: Color space issue when displaying pixel color in a render

Sergey Sharybin sergey.vfx at gmail.com
Mon Oct 7 10:06:19 CEST 2013


Revision: 60582
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=60582
Author:   nazgul
Date:     2013-10-07 08:06:19 +0000 (Mon, 07 Oct 2013)
Log Message:
-----------
Fix #36980: Color space issue when displaying pixel color in a render

HSV values were calculated from a linear space color, which is
not so much useful and correct. Now RGB(A) buffers will use
color managed color for HSV values.

Still not sure which color to use for HSV when there's only one
channel in a buffer. This part left unchanged for now.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/space_image/image_draw.c

Modified: trunk/blender/source/blender/editors/space_image/image_draw.c
===================================================================
--- trunk/blender/source/blender/editors/space_image/image_draw.c	2013-10-07 07:53:36 UTC (rev 60581)
+++ trunk/blender/source/blender/editors/space_image/image_draw.c	2013-10-07 08:06:19 UTC (rev 60582)
@@ -358,14 +358,8 @@
 		dx += BLF_width(blf_mono_font, str);
 	}
 	else if (channels >= 3) {
-		if (fp) {
-			rgb_to_hsv(fp[0], fp[1], fp[2], &hue, &sat, &val);
-			rgb_to_yuv(fp[0], fp[1], fp[2], &lum, &u, &v);
-		}
-		else if (cp) {
-			rgb_to_hsv((float)cp[0] / 255.0f, (float)cp[1] / 255.0f, (float)cp[2] / 255.0f, &hue, &sat, &val);
-			rgb_to_yuv((float)cp[0] / 255.0f, (float)cp[1] / 255.0f, (float)cp[2] / 255.0f, &lum, &u, &v);
-		}
+		rgb_to_hsv(finalcol[0], finalcol[1], finalcol[2], &hue, &sat, &val);
+		rgb_to_yuv(finalcol[0], finalcol[1], finalcol[2], &lum, &u, &v);
 
 		BLI_snprintf(str, sizeof(str), "H:%-.4f", hue);
 		BLF_position(blf_mono_font, dx, 0.3f * UI_UNIT_X, 0);




More information about the Bf-blender-cvs mailing list