Update of /cvsroot/ufraw/ufraw
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv13635

Modified Files:
        ufraw.h ufraw_preview.c ufraw_ufraw.c ufraw_ui.h 
Log Message:
Move despeckle's channel-select logic to ufraw_preview.
Clear channel-select when changing page.
Patch by Frank Van Maarseveen.


Index: ufraw.h
===================================================================
RCS file: /cvsroot/ufraw/ufraw/ufraw.h,v
retrieving revision 1.135
retrieving revision 1.136
diff -u -d -r1.135 -r1.136
--- ufraw.h     10 Nov 2009 03:33:55 -0000      1.135
+++ ufraw.h     11 Nov 2009 02:09:23 -0000      1.136
@@ -295,7 +295,6 @@
     int hotpixels;
     gboolean mark_hotpixels;
     unsigned raw_multiplier;
-    int channel_select;
 } ufraw_data;
 
 extern const conf_data conf_default;

Index: ufraw_ui.h
===================================================================
RCS file: /cvsroot/ufraw/ufraw/ufraw_ui.h,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- ufraw_ui.h  10 Nov 2009 03:33:55 -0000      1.30
+++ ufraw_ui.h  11 Nov 2009 02:09:24 -0000      1.31
@@ -117,6 +117,7 @@
     GtkAdjustment *DespecklePassesAdj[3];
     GtkToggleButton *DespeckleLockChannelsButton;
     GtkToggleButton *ChannelSelectButton[3];
+    int ChannelSelect;
 #ifdef HAVE_LENSFUN
     /* The GtkEntry with camera maker/model name */
     GtkWidget *CameraModel;

Index: ufraw_ufraw.c
===================================================================
RCS file: /cvsroot/ufraw/ufraw/ufraw_ufraw.c,v
retrieving revision 1.214
retrieving revision 1.215
diff -u -d -r1.214 -r1.215
--- ufraw_ufraw.c       10 Nov 2009 06:22:16 -0000      1.214
+++ ufraw_ufraw.c       11 Nov 2009 02:09:24 -0000      1.215
@@ -251,7 +251,6 @@
     uf->modifier = NULL;
     uf->lanczos_func = NULL;
 #endif
-    uf->channel_select = -1;
     ufraw_message(UFRAW_SET_LOG, "ufraw_open: w:%d h:%d curvesize:%d\n",
            raw->width, raw->height, raw->toneCurveSize);
 
@@ -735,7 +734,6 @@
 int ufraw_convert_image(ufraw_data *uf)
 {
     uf->mark_hotpixels = FALSE;
-    uf->channel_select = -1;
     ufraw_developer_prepare(uf, file_developer);
     ufraw_convert_image_raw(uf, ufraw_raw_phase);
     ufraw_convert_image_first(uf, ufraw_first_phase);
@@ -1588,14 +1586,6 @@
             for (yy = 0; yy < area.height; yy++, dest += out->rowstride,
                                src += in->rowstride) {
                 develop(dest, (void *)src, uf->developer, 8, area.width);
-               if (uf->channel_select >= 0) {
-                   int xx;
-                   guint8 *p = dest;
-                   for (xx = 0; xx < area.width; xx++, p += out->depth) {
-                       guint8 px = p[uf->channel_select];
-                       p[0] = p[1] = p[2] = px;
-                   }
-               }
             }
             break;
 

Index: ufraw_preview.c
===================================================================
RCS file: /cvsroot/ufraw/ufraw/ufraw_preview.c,v
retrieving revision 1.305
retrieving revision 1.306
diff -u -d -r1.305 -r1.306
--- ufraw_preview.c     10 Nov 2009 06:22:16 -0000      1.305
+++ ufraw_preview.c     11 Nov 2009 02:09:23 -0000      1.306
@@ -590,6 +590,13 @@
        guint8 *p8 = pixies + yy*rowstride;
        memcpy(p8, displayPixies + yy*displayImage->rowstride,
                width*displayImage->depth);
+       if (data->ChannelSelect >= 0) {
+           guint8 *p = p8;
+           for (xx = 0; xx < width; xx++, p += 3) {
+               guint8 px = p[data->ChannelSelect];
+               p[0] = p[1] = p[2] = px;
+           }
+       }
        guint8 *p8working = workingPixies + yy*workingImage->rowstride;
        for (xx=x; xx<x+width; xx++, p8+=3, p8working+=workingImage->depth) {
            if ( data->SpotDraw &&
@@ -2726,20 +2733,20 @@
            update_scales(data);
        }
     } else if (valuep==(void*)data->ChannelSelectButton) {
-       if (data->UF->channel_select >= -1) {
+       if (data->ChannelSelect >= -1) {
            int i, b = 0;
            while (data->ChannelSelectButton[b] != button)
                ++b;
            if (gtk_toggle_button_get_active(button)) {
                /* ignore generated events, for render_preview() */
-               data->UF->channel_select = -2;
+               data->ChannelSelect = -2;
                for (i = 0; i < data->UF->colors; ++i)
                    if (i != b)
                        gtk_toggle_button_set_active(
                                data->ChannelSelectButton[i], FALSE);
-               data->UF->channel_select = b;
+               data->ChannelSelect = b;
            } else {
-               data->UF->channel_select = -1;
+               data->ChannelSelect = -1;
            }
            ufraw_invalidate_layer(data->UF, ufraw_develop_phase);
            render_preview(data);
@@ -3924,6 +3931,9 @@
     preview_data *data = get_preview_data(notebook);
     if (data->FreezeDialog==TRUE) return;
 
+    if (data->ChannelSelect >= 0)
+       gtk_toggle_button_set_active(
+               data->ChannelSelectButton[data->ChannelSelect], FALSE);
     GtkWidget *event_box =
            gtk_widget_get_ancestor(data->PreviewWidget, GTK_TYPE_EVENT_BOX);
     if ( page_num==data->PageNumSpot ||
@@ -4552,6 +4562,7 @@
                G_CALLBACK(toggle_button_update), data->ChannelSelectButton);
        gtk_table_attach(table, button, 6 + i, 6 + i + 1, 0, 1, 0, 0, 0, 0);
     }
+    data->ChannelSelect = -1;
 
     /* Parameters */
     label = gtk_label_new(_("Window size:"));


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
ufraw-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ufraw-cvs

Reply via email to