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

Modified Files:
        README-processing.txt dcraw_api.cc dcraw_indi.c ufraw.pod 
        ufraw_developer.c ufraw_preview.c 
Log Message:
Fix bugs #379-#381: Add bilinear interpolation and progress bars for the 
FUJIFILM X-Trans sensors and replace 'Bayer pattern' by 'Color filter array'. 
Thanks goes to Frank Markesteijn for patches and ideas.

Index: ufraw_developer.c
===================================================================
RCS file: /cvsroot/ufraw/ufraw/ufraw_developer.c,v
retrieving revision 1.93
retrieving revision 1.94
diff -u -d -r1.93 -r1.94
--- ufraw_developer.c   1 Jan 2014 06:00:23 -0000       1.93
+++ ufraw_developer.c   25 Aug 2014 13:00:18 -0000      1.94
@@ -608,8 +608,8 @@
     for (c = 0; c < d->colors; c++)
         max = MAX(max, ufnumber_array_value(chanMul, c));
     d->max = 0x10000 / max;
-    /* rgbWB is used in dcraw_finalized_interpolation() before the Bayer
-     * Interpolation. It is normalized to guaranty that values do not
+    /* rgbWB is used in dcraw_finalized_interpolation() before the color filter
+     * array interpolation. It is normalized to guarantee that values do not
      * exceed 0xFFFF */
     for (c = 0; c < d->colors; c++)
         d->rgbWB[c] = ufnumber_array_value(chanMul, c) *  d->max *

Index: dcraw_indi.c
===================================================================
RCS file: /cvsroot/ufraw/ufraw/dcraw_indi.c,v
retrieving revision 1.117
retrieving revision 1.118
diff -u -d -r1.117 -r1.118
--- dcraw_indi.c        26 Jul 2014 03:30:10 -0000      1.117
+++ dcraw_indi.c        25 Aug 2014 13:00:18 -0000      1.118
@@ -624,6 +624,8 @@
     drv  = (float(*)[TS][TS])(buffer + TS * TS * (ndir * 6 + 6));
     homo = (char(*)[TS][TS])(buffer + TS * TS * (ndir * 10 + 6));
 
+    progress(PROGRESS_INTERPOLATE, -height);
+
     /* Map a green hexagon around each non-green pixel and vice versa:      */
     for (row = 0; row < 3; row++)
         for (col = 0; col < 3; col++)
@@ -668,7 +670,8 @@
             }
         }
 
-    for (top = 3; top < height - 19; top += TS - 16)
+    for (top = 3; top < height - 19; top += TS - 16) {
+        progress(PROGRESS_INTERPOLATE, TS - 16);
         for (left = 3; left < width - 19; left += TS - 16) {
             mrow = MIN(top + TS, height - 3);
             mcol = MIN(left + TS, width - 3);
@@ -824,6 +827,8 @@
                     FORC3 image[(row + top)*width + col + left][c] = avg[c] / 
avg[3];
                 }
         }
+    }
+
     free(buffer);
 }
 

Index: ufraw.pod
===================================================================
RCS file: /cvsroot/ufraw/ufraw/ufraw.pod,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- ufraw.pod   3 Feb 2013 18:01:15 -0000       1.24
+++ ufraw.pod   25 Aug 2014 13:00:18 -0000      1.25
@@ -198,7 +198,7 @@
 
 =item --interpolation=ahd|vng|four-color|ppg|bilinear
 
-Interpolation algorithm to use when converting from the Bayer-pattern
+Interpolation algorithm to use when converting from the color filter array
 to normal RGB values. AHD (Adaptive Homogeneity Directed) interpolation
 is the best, but also the slowest. VNG (Variable Number Gradients)
 is second best and a bit faster. Bilinear is the simplest yet fastest

Index: ufraw_preview.c
===================================================================
RCS file: /cvsroot/ufraw/ufraw/ufraw_preview.c,v
retrieving revision 1.375
retrieving revision 1.376
diff -u -d -r1.375 -r1.376
--- ufraw_preview.c     25 Aug 2014 11:30:17 -0000      1.375
+++ ufraw_preview.c     25 Aug 2014 13:00:18 -0000      1.376
@@ -521,7 +521,7 @@
 static int zoom_to_scale(double zoom)
 {
     /* Try to setup for shrink instead of resize because of speed.
-     * We only round down to guaranty that scale-to-fit actually fits.
+     * We only round down to guarantee that scale-to-fit actually fits.
      */
     int percent = zoom;
     int mul = 100 / percent;
@@ -4419,11 +4419,13 @@
                       GTK_ICON_SIZE_LARGE_TOOLBAR);
     gtk_container_add(GTK_CONTAINER(event_box), icon);
     gtk_table_attach(table, event_box, 0, 1, 0, 1, 0, 0, 0, 0);
-    gtk_widget_set_tooltip_text(event_box, _("Bayer pattern interpolation"));
+    gtk_widget_set_tooltip_text(event_box, _("Color filter array 
interpolation"));
     combo = GTK_COMBO_BOX(uf_combo_box_new_text());
     if (data->UF->HaveFilters) {
         if (data->UF->IsXTrans) {
-            uf_combo_box_append_text(combo, _("X-Trans interpolation (slow!)"),
+            uf_combo_box_append_text(combo, _("Bilinear interpolation (fast)"),
+                                     (void*)bilinear_interpolation);
+            uf_combo_box_append_text(combo, _("X-Trans interpolation (slow)"),
                                      (void*)xtrans_interpolation);
         } else if (data->UF->colors == 4) {
             uf_combo_box_append_text(combo, _("VNG four color interpolation"),
@@ -4450,7 +4452,7 @@
         g_signal_connect_after(G_OBJECT(combo), "changed",
                                G_CALLBACK(combo_update_simple), 
(gpointer)ufraw_first_phase);
     } else {
-        gtk_combo_box_append_text(combo, _("No Bayer pattern"));
+        gtk_combo_box_append_text(combo, _("No color filter array"));
         gtk_combo_box_set_active(combo, 0);
         gtk_widget_set_sensitive(GTK_WIDGET(combo), FALSE);
     }

Index: dcraw_api.cc
===================================================================
RCS file: /cvsroot/ufraw/ufraw/dcraw_api.cc,v
retrieving revision 1.96
retrieving revision 1.97
diff -u -d -r1.96 -r1.97
--- dcraw_api.cc        25 Aug 2014 11:30:17 -0000      1.96
+++ dcraw_api.cc        25 Aug 2014 13:00:18 -0000      1.97
@@ -744,7 +744,7 @@
 
         /* It might be better to report an error here: */
         /* (dcraw also forbids AHD for Fuji rotated images) */
-        if (h->filters == 9)
+        if (h->filters == 9 && interpolation != dcraw_bilinear_interpolation)
             interpolation = dcraw_xtrans_interpolation;
         if (interpolation == dcraw_ahd_interpolation && h->colors > 3)
             interpolation = dcraw_vng_interpolation;
@@ -761,7 +761,7 @@
         } else
             memcpy(f->image, h->raw.image, h->height * h->width * 
sizeof(dcraw_image_type));
         int smoothPasses = 1;
-        if (interpolation == dcraw_bilinear_interpolation)
+        if (interpolation == dcraw_bilinear_interpolation && (h->filters == 1 
|| h->filters > 1000))
             lin_interpolate_INDI(f->image, ff, f->width, f->height, cl, d, h);
 #ifdef ENABLE_INTERP_NONE
         else if (interpolation == dcraw_none_interpolation)

Index: README-processing.txt
===================================================================
RCS file: /cvsroot/ufraw/ufraw/README-processing.txt,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- README-processing.txt       1 Mar 2010 01:50:50 -0000       1.24
+++ README-processing.txt       25 Aug 2014 13:00:18 -0000      1.25
@@ -11,7 +11,7 @@
 the expense of readability.  This document is not a HOWTO.
 
 This document assumes that the reader is generally familiar with computer
-image processing, and understands the issues surrounding Bayer arrays,
+image processing, and understands the issues surrounding color filter arrays,
 white balance, and color management.
 
 == References


------------------------------------------------------------------------------
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
ufraw-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ufraw-cvs

Reply via email to