Update of /cvsroot/ufraw/ufraw
In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv27973

Modified Files:
      Tag: dcraw-original-branch
        dcraw.cc 
Log Message:
dcraw original 9.21 (1.465).

Index: dcraw.cc
===================================================================
RCS file: /cvsroot/ufraw/ufraw/dcraw.cc,v
retrieving revision 1.1.2.133
retrieving revision 1.1.2.134
diff -u -d -r1.1.2.133 -r1.1.2.134
--- dcraw.cc    15 Jun 2014 01:55:11 -0000      1.1.2.133
+++ dcraw.cc    29 Jun 2014 03:10:10 -0000      1.1.2.134
@@ -378,7 +378,7 @@
   float **A, *b, *c, *d, *x, *y;
   int i, j;
 
-  A = (void *) calloc (((2*len + 4)*sizeof **A + sizeof *A), 2*len);
+  A = (float **) calloc (((2*len + 4)*sizeof **A + sizeof *A), 2*len);
   if (!A) return;
   A[0] = (float *) (A + 2*len);
   for (i = 1; i < 2*len; i++)
@@ -3876,8 +3876,8 @@
     { 0.310, 0.316, 9.0 },             // Neutral 3.5
     { 0.310, 0.316, 3.1 } };           // Black
   double gmb_cam[NSQ][4], gmb_xyz[NSQ][3];
-  double inverse[NSQ][3], cam_xyz[4][3], num;
-  int c, i, j, k, sq, row, col, count[4];
+  double inverse[NSQ][3], cam_xyz[4][3], balance[4], num;
+  int c, i, j, k, sq, row, col, pass, count[4];
 
   memset (gmb_cam, 0, sizeof gmb_cam);
   for (sq=0; sq < NSQ; sq++) {
@@ -3886,7 +3886,8 @@
       for (col=cut[sq][2]; col < cut[sq][2]+cut[sq][0]; col++) {
        c = FC(row,col);
        if (c >= colors) c -= 2;
-       gmb_cam[sq][c] += BAYER(row,col);
+       gmb_cam[sq][c] += BAYER2(row,col);
+       BAYER2(row,col) = black + (BAYER2(row,col)-black)/2;
        count[c]++;
       }
     FORCC gmb_cam[sq][c] = gmb_cam[sq][c]/count[c] - black;
@@ -3896,11 +3897,16 @@
                (1 - gmb_xyY[sq][0] - gmb_xyY[sq][1]) / gmb_xyY[sq][1];
   }
   pseudoinverse (gmb_xyz, inverse, NSQ);
-  for (raw_color = i=0; i < colors; i++)
-    for (j=0; j < 3; j++)
-      for (cam_xyz[i][j] = k=0; k < NSQ; k++)
-       cam_xyz[i][j] += gmb_cam[k][i] * inverse[k][j];
-  cam_xyz_coeff (rgb_cam, cam_xyz);
+  for (pass=0; pass < 2; pass++) {
+    for (raw_color = i=0; i < colors; i++)
+      for (j=0; j < 3; j++)
+       for (cam_xyz[i][j] = k=0; k < NSQ; k++)
+         cam_xyz[i][j] += gmb_cam[k][i] * inverse[k][j];
+    cam_xyz_coeff (rgb_cam, cam_xyz);
+    FORCC balance[c] = pre_mul[c] * gmb_cam[20][c];
+    for (sq=0; sq < NSQ; sq++)
+      FORCC gmb_cam[sq][c] *= balance[c];
+  }
   if (verbose) {
     printf ("    { \"%s %s\", %d,\n\t{", make, model, black);
     num = 10000 / (cam_xyz[1][0] + cam_xyz[1][1] + cam_xyz[1][2]);


------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
ufraw-cvs mailing list
ufraw-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ufraw-cvs

Reply via email to