[Rawstudio-commit] r3010 - branches/rawstudio-ng-color/plugins/colorspace-transform

Klaus Post klauspost at gmail.com
Sat Jan 16 18:23:12 CET 2010


Author: post
Date: 2010-01-16 18:23:12 +0100 (Sat, 16 Jan 2010)
New Revision: 3010

Modified:
   branches/rawstudio-ng-color/plugins/colorspace-transform/colorspace_transform.c
Log:
CS transform: Fix 8 bit gamma rounding and only print debug info if actually converting.

Modified: branches/rawstudio-ng-color/plugins/colorspace-transform/colorspace_transform.c
===================================================================
--- branches/rawstudio-ng-color/plugins/colorspace-transform/colorspace_transform.c	2010-01-16 17:06:34 UTC (rev 3009)
+++ branches/rawstudio-ng-color/plugins/colorspace-transform/colorspace_transform.c	2010-01-16 17:23:12 UTC (rev 3010)
@@ -99,8 +99,6 @@
 	RSColorSpace *output_space = rs_filter_param_get_object_with_type(RS_FILTER_PARAM(request), "colorspace", RS_TYPE_COLOR_SPACE);
 
 
-	printf("\033[33m16 input_space: %s\033[0m\n", (input_space) ? G_OBJECT_TYPE_NAME(input_space) : "none");
-	printf("\033[33m16 output_space: %s\n\033[0m", (output_space) ? G_OBJECT_TYPE_NAME(output_space) : "none");
 	if (input_space && output_space)
 	{
 		output = rs_image16_copy(input, FALSE);
@@ -108,6 +106,8 @@
 		if (convert_colorspace16(colorspace_transform, input, output, input_space, output_space))
 		{
 			/* Image was converted */
+			printf("\033[33m16 input_space: %s\033[0m\n", (input_space) ? G_OBJECT_TYPE_NAME(input_space) : "none");
+			printf("\033[33m16 output_space: %s\n\033[0m", (output_space) ? G_OBJECT_TYPE_NAME(output_space) : "none");
 			response = rs_filter_response_clone(previous_response);
 			g_object_unref(previous_response);
 			rs_filter_response_set_image(response, output);
@@ -124,7 +124,6 @@
 	}
 	else
 	{
-		g_debug("No conversion done");
 		return previous_response;
 	}
 
@@ -352,7 +351,7 @@
 			nd = rs_1d_function_evaluate(output_gamma, nd);
 
 			/* 8 bit output */
-			gint res = (gint) (nd*255.0);
+			gint res = (gint) (nd*255.0 + 0.5f);
 			_CLAMP255(res);
 			table8[i] = res;
 		}




More information about the Rawstudio-commit mailing list