[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [47677] branches/soc-2011-tomato: Merging r47674 through r47676 from trunk into soc-2011-tomato

Sergey Sharybin sergey.vfx at gmail.com
Sun Jun 10 14:37:42 CEST 2012


Revision: 47677
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=47677
Author:   nazgul
Date:     2012-06-10 12:37:41 +0000 (Sun, 10 Jun 2012)
Log Message:
-----------
Merging r47674 through r47676 from trunk into soc-2011-tomato

Revision Links:
--------------
    http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=47674
    http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=47676

Modified Paths:
--------------
    branches/soc-2011-tomato/source/blender/blenkernel/intern/colortools.c
    branches/soc-2011-tomato/source/blender/editors/interface/interface_draw.c
    branches/soc-2011-tomato/source/blender/editors/space_image/image_ops.c
    branches/soc-2011-tomato/source/blender/makesdna/DNA_color_types.h
    branches/soc-2011-tomato/source/blender/makesrna/intern/rna_color.c

Removed Paths:
-------------
    branches/soc-2011-tomato/release/scripts/presets/camera/Nikon_D35.py.diff

Property Changed:
----------------
    branches/soc-2011-tomato/
    branches/soc-2011-tomato/source/blender/editors/interface/interface.c
    branches/soc-2011-tomato/source/blender/editors/space_outliner/


Property changes on: branches/soc-2011-tomato
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/ge_harmony:42255,42279-42282,42286,42302,42338,42349,42616,42620,42698-42699,42739,42753,42773-42774,42832,44568,44597-44598,44793-44794
/branches/soc-2011-cucumber:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/vgroup_modifiers:38694-39989
/trunk/blender:36831-47673
   + /branches/ge_harmony:42255,42279-42282,42286,42302,42338,42349,42616,42620,42698-42699,42739,42753,42773-42774,42832,44568,44597-44598,44793-44794
/branches/soc-2011-cucumber:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/vgroup_modifiers:38694-39989
/trunk/blender:36831-47676

Deleted: branches/soc-2011-tomato/release/scripts/presets/camera/Nikon_D35.py.diff
===================================================================
--- branches/soc-2011-tomato/release/scripts/presets/camera/Nikon_D35.py.diff	2012-06-10 12:35:47 UTC (rev 47676)
+++ branches/soc-2011-tomato/release/scripts/presets/camera/Nikon_D35.py.diff	2012-06-10 12:37:41 UTC (rev 47677)
@@ -1,7 +0,0 @@
---- /dev/null
-+++ b/release/scripts/presets/camera/Nikon_D35.py
-@@ -0,0 +1,4 @@
-+import bpy
-+bpy.context.object.data.sensor_width = 36.0
-+bpy.context.object.data.sensor_height = 23.9
-+bpy.context.object.data.sensor_fit = 'HORIZONTAL'

Modified: branches/soc-2011-tomato/source/blender/blenkernel/intern/colortools.c
===================================================================
--- branches/soc-2011-tomato/source/blender/blenkernel/intern/colortools.c	2012-06-10 12:35:47 UTC (rev 47676)
+++ branches/soc-2011-tomato/source/blender/blenkernel/intern/colortools.c	2012-06-10 12:37:41 UTC (rev 47677)
@@ -910,7 +910,7 @@
 	return bin;
 }
 
-DO_INLINE void save_sample_line(Scopes *scopes, const int idx, const float fx, const float rgb[3], const float ycc[3])
+static void save_sample_line(Scopes *scopes, const int idx, const float fx, const float rgb[3], const float ycc[3])
 {
 	float yuv[3];
 
@@ -953,9 +953,9 @@
 	double div, divl;
 	float *rf = NULL;
 	unsigned char *rc = NULL;
-	unsigned int *bin_r, *bin_g, *bin_b, *bin_lum;
+	unsigned int *bin_lum, *bin_r, *bin_g, *bin_b, *bin_a;
 	int savedlines, saveline;
-	float rgb[3], ycc[3], luma;
+	float rgba[4], ycc[3], luma;
 	int ycc_mode = -1;
 	const short is_float = (ibuf->rect_float != NULL);
 
@@ -987,11 +987,12 @@
 			break;
 	}
 
-	/* temp table to count pix value for histo */
-	bin_r = MEM_callocN(256 * sizeof(unsigned int), "temp historgram bins");
-	bin_g = MEM_callocN(256 * sizeof(unsigned int), "temp historgram bins");
-	bin_b = MEM_callocN(256 * sizeof(unsigned int), "temp historgram bins");
-	bin_lum = MEM_callocN(256 * sizeof(unsigned int), "temp historgram bins");
+	/* temp table to count pix value for histogram */
+	bin_r     = MEM_callocN(256 * sizeof(unsigned int), "temp historgram bins");
+	bin_g     = MEM_callocN(256 * sizeof(unsigned int), "temp historgram bins");
+	bin_b     = MEM_callocN(256 * sizeof(unsigned int), "temp historgram bins");
+	bin_a = MEM_callocN(256 * sizeof(unsigned int), "temp historgram bins");
+	bin_lum   = MEM_callocN(256 * sizeof(unsigned int), "temp historgram bins");
 
 	/* convert to number of lines with logarithmic scale */
 	scopes->sample_lines = (scopes->accuracy * 0.01f) * (scopes->accuracy * 0.01f) * ibuf->y;
@@ -1038,27 +1039,28 @@
 
 			if (is_float) {
 				if (use_color_management)
-					linearrgb_to_srgb_v3_v3(rgb, rf);
+					linearrgb_to_srgb_v3_v3(rgba, rf);
 				else
-					copy_v3_v3(rgb, rf);
+					copy_v3_v3(rgba, rf);
+				rgba[3] = rf[3];
 			}
 			else {
-				for (c = 0; c < 3; c++)
-					rgb[c] = rc[c] * INV_255;
+				for (c = 0; c < 4; c++)
+					rgba[c] = rc[c] * INV_255;
 			}
 
 			/* we still need luma for histogram */
-			luma = rgb_to_luma(rgb);
+			luma = rgb_to_luma(rgba);
 
 			/* check for min max */
 			if (ycc_mode == -1) {
 				for (c = 0; c < 3; c++) {
-					if (rgb[c] < scopes->minmax[c][0]) scopes->minmax[c][0] = rgb[c];
-					if (rgb[c] > scopes->minmax[c][1]) scopes->minmax[c][1] = rgb[c];
+					if (rgba[c] < scopes->minmax[c][0]) scopes->minmax[c][0] = rgba[c];
+					if (rgba[c] > scopes->minmax[c][1]) scopes->minmax[c][1] = rgba[c];
 				}
 			}
 			else {
-				rgb_to_ycc(rgb[0], rgb[1], rgb[2], &ycc[0], &ycc[1], &ycc[2], ycc_mode);
+				rgb_to_ycc(rgba[0], rgba[1], rgba[2], &ycc[0], &ycc[1], &ycc[2], ycc_mode);
 				for (c = 0; c < 3; c++) {
 					ycc[c] *= INV_255;
 					if (ycc[c] < scopes->minmax[c][0]) scopes->minmax[c][0] = ycc[c];
@@ -1066,16 +1068,17 @@
 				}
 			}
 			/* increment count for histo*/
-			bin_r[get_bin_float(rgb[0])] += 1;
-			bin_g[get_bin_float(rgb[1])] += 1;
-			bin_b[get_bin_float(rgb[2])] += 1;
 			bin_lum[get_bin_float(luma)] += 1;
+			bin_r[get_bin_float(rgba[0])] += 1;
+			bin_g[get_bin_float(rgba[1])] += 1;
+			bin_b[get_bin_float(rgba[2])] += 1;
+			bin_a[get_bin_float(rgba[3])] += 1;
 
 			/* save sample if needed */
 			if (saveline) {
 				const float fx = (float)x / (float)ibuf->x;
 				const int idx = 2 * (ibuf->x * savedlines + x);
-				save_sample_line(scopes, idx, fx, rgb, ycc);
+				save_sample_line(scopes, idx, fx, rgba, ycc);
 			}
 
 			rf += ibuf->channels;
@@ -1089,27 +1092,26 @@
 	n = 0;
 	nl = 0;
 	for (x = 0; x < 256; x++) {
-		if (bin_r[x] > n)
-			n = bin_r[x];
-		if (bin_g[x] > n)
-			n = bin_g[x];
-		if (bin_b[x] > n)
-			n = bin_b[x];
-		if (bin_lum[x] > nl)
-			nl = bin_lum[x];
+		if (bin_lum[x] > nl) nl = bin_lum[x];
+		if (bin_r[x]   > n) n = bin_r[x];
+		if (bin_g[x]   > n) n = bin_g[x];
+		if (bin_b[x]   > n) n = bin_b[x];
+		if (bin_a[x]   > n) n = bin_a[x];
 	}
 	div = 1.0 / (double)n;
 	divl = 1.0 / (double)nl;
 	for (x = 0; x < 256; x++) {
+		scopes->hist.data_luma[x] = bin_lum[x] * divl;
 		scopes->hist.data_r[x] = bin_r[x] * div;
 		scopes->hist.data_g[x] = bin_g[x] * div;
 		scopes->hist.data_b[x] = bin_b[x] * div;
-		scopes->hist.data_luma[x] = bin_lum[x] * divl;
+		scopes->hist.data_a[x] = bin_a[x] * div;
 	}
+	MEM_freeN(bin_lum);
 	MEM_freeN(bin_r);
 	MEM_freeN(bin_g);
 	MEM_freeN(bin_b);
-	MEM_freeN(bin_lum);
+	MEM_freeN(bin_a);
 
 	scopes->ok = 1;
 }


Property changes on: branches/soc-2011-tomato/source/blender/editors/interface/interface.c
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/ge_candy/source/blender/editors/interface/interface.c:45070-46163
/branches/ge_harmony/source/blender/editors/interface/interface.c:42255,42279-42282,42286,42302,42338,42349,42616,42620,42698-42699,42739,42753,42773-42774,42832,44568,44597-44598,44793-44794
/branches/soc-2011-cucumber/source/blender/editors/interface/interface.c:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/vgroup_modifiers/source/blender/editors/interface/interface.c:38694-39989
/trunk/blender/source/blender/editors/interface/interface.c:36831-47673
   + /branches/ge_candy/source/blender/editors/interface/interface.c:45070-46163
/branches/ge_harmony/source/blender/editors/interface/interface.c:42255,42279-42282,42286,42302,42338,42349,42616,42620,42698-42699,42739,42753,42773-42774,42832,44568,44597-44598,44793-44794
/branches/soc-2011-cucumber/source/blender/editors/interface/interface.c:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/vgroup_modifiers/source/blender/editors/interface/interface.c:38694-39989
/trunk/blender/source/blender/editors/interface/interface.c:36831-47676

Modified: branches/soc-2011-tomato/source/blender/editors/interface/interface_draw.c
===================================================================
--- branches/soc-2011-tomato/source/blender/editors/interface/interface_draw.c	2012-06-10 12:35:47 UTC (rev 47676)
+++ branches/soc-2011-tomato/source/blender/editors/interface/interface_draw.c	2012-06-10 12:37:41 UTC (rev 47677)
@@ -754,8 +754,12 @@
 		fdrawline(rect.xmin + (i / 4.f) * w, rect.ymin, rect.xmin + (i / 4.f) * w, rect.ymax);
 	}
 	
-	if (hist->mode == HISTO_MODE_LUMA)
+	if (hist->mode == HISTO_MODE_LUMA) {
 		histogram_draw_one(1.0, 1.0, 1.0, 0.75, rect.xmin, rect.ymin, w, h, hist->data_luma, res, is_line);
+	}
+	else if (hist->mode == HISTO_MODE_ALPHA) {
+		histogram_draw_one(1.0, 1.0, 1.0, 0.75, rect.xmin, rect.ymin, w, h, hist->data_a, res, is_line);
+	}
 	else {
 		if (hist->mode == HISTO_MODE_RGB || hist->mode == HISTO_MODE_R)
 			histogram_draw_one(1.0, 0.0, 0.0, 0.75, rect.xmin, rect.ymin, w, h, hist->data_r, res, is_line);

Modified: branches/soc-2011-tomato/source/blender/editors/space_image/image_ops.c
===================================================================
--- branches/soc-2011-tomato/source/blender/editors/space_image/image_ops.c	2012-06-10 12:35:47 UTC (rev 47676)
+++ branches/soc-2011-tomato/source/blender/editors/space_image/image_ops.c	2012-06-10 12:37:41 UTC (rev 47677)
@@ -2150,7 +2150,7 @@
 		y = (int)(0.5f + y1 + (float)i * (y2 - y1) / 255.0f);
 		
 		if (x < 0 || y < 0 || x >= ibuf->x || y >= ibuf->y) {
-			hist->data_luma[i] = hist->data_r[i] = hist->data_g[i] = hist->data_b[i] = 0.0f;
+			hist->data_luma[i] = hist->data_r[i] = hist->data_g[i] = hist->data_b[i] = hist->data_a[i] = 0.0f;
 		}
 		else {
 			if (ibuf->rect_float) {
@@ -2161,17 +2161,19 @@
 				else
 					copy_v3_v3(rgb, fp);
 
-				hist->data_r[i] = rgb[0];
-				hist->data_g[i] = rgb[1];
-				hist->data_b[i] = rgb[2];
-				hist->data_luma[i] = rgb_to_luma(rgb);
+				hist->data_luma[i]  = rgb_to_luma(rgb);
+				hist->data_r[i]     = rgb[0];
+				hist->data_g[i]     = rgb[1];
+				hist->data_b[i]     = rgb[2];
+				hist->data_a[i]     = fp[3];
 			}
 			else if (ibuf->rect) {
 				cp = (unsigned char *)(ibuf->rect + y * ibuf->x + x);
-				hist->data_r[i] = (float)cp[0] / 255.0f;
-				hist->data_g[i] = (float)cp[1] / 255.0f;
-				hist->data_b[i] = (float)cp[2] / 255.0f;
-				hist->data_luma[i] = (float)rgb_to_luma_byte(cp) / 255.0f;
+				hist->data_luma[i]  = (float)rgb_to_luma_byte(cp) / 255.0f;
+				hist->data_r[i]     = (float)cp[0] / 255.0f;
+				hist->data_g[i]     = (float)cp[1] / 255.0f;
+				hist->data_b[i]     = (float)cp[2] / 255.0f;
+				hist->data_a[i]     = (float)cp[3] / 255.0f;

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list