Author: abrander
Date: 2010-02-12 22:22:00 +0100 (Fri, 12 Feb 2010)
New Revision: 3178

Modified:
   trunk/plugins/dcp/dcp.c
   trunk/plugins/dcp/dcp.h
Log:
Simply relay premultipliers in RSDcp if no DCP profile is used.

Modified: trunk/plugins/dcp/dcp.c
===================================================================
--- trunk/plugins/dcp/dcp.c     2010-02-12 21:19:15 UTC (rev 3177)
+++ trunk/plugins/dcp/dcp.c     2010-02-12 21:22:00 UTC (rev 3178)
@@ -153,15 +153,14 @@
                        NULL);
 
                RS_xy_COORD whitepoint;
-               RS_VECTOR3 pre_mul;
                /* This is messy, but we're essentially converting from 
warmth/tint to cameraneutral */
-        pre_mul.x = (1.0+warmth)*(2.0-tint);
-        pre_mul.y = 1.0;
-        pre_mul.z = (1.0-warmth)*(2.0-tint);
+        dcp->pre_mul.x = (1.0+warmth)*(2.0-tint);
+        dcp->pre_mul.y = 1.0;
+        dcp->pre_mul.z = (1.0-warmth)*(2.0-tint);
                RS_VECTOR3 neutral;
-               neutral.x = 1.0 / CLAMP(pre_mul.x, 0.001, 100.00);
-               neutral.y = 1.0 / CLAMP(pre_mul.y, 0.001, 100.00);
-               neutral.z = 1.0 / CLAMP(pre_mul.z, 0.001, 100.00);
+               neutral.x = 1.0 / CLAMP(dcp->pre_mul.x, 0.001, 100.00);
+               neutral.y = 1.0 / CLAMP(dcp->pre_mul.y, 0.001, 100.00);
+               neutral.z = 1.0 / CLAMP(dcp->pre_mul.z, 0.001, 100.00);
                gfloat max = vector3_max(&neutral);
                neutral.x = neutral.x / max;
                neutral.y = neutral.y / max;
@@ -410,9 +409,10 @@
        if (!dcp->use_profile)
        {
                gfloat premul[4] = {1.0, 1.0, 1.0, 1.0};
-               premul[0] = 1.0 / dcp->camera_white.x;
-               premul[1] = 1.0 / dcp->camera_white.y;
-               premul[2] = 1.0 / dcp->camera_white.z;
+               premul[0] = dcp->pre_mul.x;
+               premul[1] = dcp->pre_mul.y;
+               premul[2] = dcp->pre_mul.z;
+
                rs_filter_param_set_float4(RS_FILTER_PARAM(request_clone), 
"premul", premul);
        }
 

Modified: trunk/plugins/dcp/dcp.h
===================================================================
--- trunk/plugins/dcp/dcp.h     2010-02-12 21:19:15 UTC (rev 3177)
+++ trunk/plugins/dcp/dcp.h     2010-02-12 21:22:00 UTC (rev 3178)
@@ -55,6 +55,7 @@
        gfloat channelmixer_green;
        gfloat channelmixer_blue;
 
+       RS_VECTOR3 pre_mul;
        RS_xy_COORD white_xy;
 
        gint nknots;


_______________________________________________
Rawstudio-commit mailing list
[email protected]
http://rawstudio.org/cgi-bin/mailman/listinfo/rawstudio-commit

Reply via email to