Author: akv
Date: 2012-10-28 21:42:15 +0100 (Sun, 28 Oct 2012)
New Revision: 4299
Modified:
branches/4175-enfuse/src/application.c
branches/4175-enfuse/src/application.h
branches/4175-enfuse/src/rs-actions.c
branches/4175-enfuse/src/rs-toolbox.c
branches/4175-enfuse/src/rs-toolbox.h
branches/4175-enfuse/src/ui.xml
Log:
Merged with trunk.
Modified: branches/4175-enfuse/src/application.c
===================================================================
--- branches/4175-enfuse/src/application.c 2012-10-28 20:39:54 UTC (rev
4298)
+++ branches/4175-enfuse/src/application.c 2012-10-28 20:42:15 UTC (rev
4299)
@@ -228,43 +228,6 @@
return(rs);
}
-void
-rs_white_black_point(RS_BLOB *rs)
-{
- if (rs->photo)
- {
- guint hist[4][256] = {{0,}};
- gint i = 0;
- gdouble black_threshold = 0.003; // Percent underexposed pixels
- gdouble white_threshold = 0.01; // Percent overexposed pixels
- gdouble blackpoint;
- gdouble whitepoint;
- guint total = 0;
-
- // calculate black point
- while(i < 256) {
- total += hist[R][i]+hist[G][i]+hist[B][i];
- if ((total/3) > ((250*250*3)/100*black_threshold))
- break;
- i++;
- }
- blackpoint = (gdouble) i / (gdouble) 255;
-
- // calculate white point
- i = 255;
- while(i) {
- total += hist[R][i]+hist[G][i]+hist[B][i];
- if ((total/3) > ((250*250*3)/100*white_threshold))
- break;
- i--;
- }
- whitepoint = (gdouble) i / (gdouble) 255;
-
-
rs_curve_widget_move_knot(RS_CURVE_WIDGET(rs->curve[rs->current_setting]),0,blackpoint,0.0);
-
rs_curve_widget_move_knot(RS_CURVE_WIDGET(rs->curve[rs->current_setting]),-1,whitepoint,1.0);
- }
-}
-
gboolean
test_dcp_profile(RSProfileFactory *factory, gchar *make_ascii, gchar
*model_ascii)
{
Modified: branches/4175-enfuse/src/application.h
===================================================================
--- branches/4175-enfuse/src/application.h 2012-10-28 20:39:54 UTC (rev
4298)
+++ branches/4175-enfuse/src/application.h 2012-10-28 20:42:15 UTC (rev
4299)
@@ -73,7 +73,6 @@
RSSettings *settings_buffer;
RSDcpFile *dcp_buffer;
RSIccProfile *icc_buffer;
- GtkWidget *curve[3];
gint current_setting;
RS_QUEUE *queue;
RSStore *store;
Modified: branches/4175-enfuse/src/rs-actions.c
===================================================================
--- branches/4175-enfuse/src/rs-actions.c 2012-10-28 20:39:54 UTC (rev
4298)
+++ branches/4175-enfuse/src/rs-actions.c 2012-10-28 20:42:15 UTC (rev
4299)
@@ -1493,6 +1493,12 @@
g_free(filename);
}
+ACTION(auto_adjust_curve_ends)
+{
+ GtkWidget *curve = rs_toolbox_get_curve(RS_TOOLBOX(rs->tools),
rs->current_setting);
+ rs_curve_auto_adjust_ends(curve);
+}
+
RADIOACTION(right_popup)
{
rs_preview_widget_set_snapshot(RS_PREVIEW_WIDGET(rs->preview), 1,
gtk_radio_action_get_current_value(radioaction));
@@ -1575,6 +1581,7 @@
{ "Flip", RS_STOCK_FLIP, _("Flip"), NULL, NULL, ACTION_CB(flip) },
{ "Mirror", RS_STOCK_MIRROR, _("Mirror"), NULL, NULL, ACTION_CB(mirror)
},
{ "Enfuse", NULL, _("Enfuse"), "<ctrl><alt>E", NULL, ACTION_CB(enfuse)
},
+ { "AutoAdjustCurveEnds", NULL, _("Auto adjust curve ends"),
"<control><shift>L", NULL, ACTION_CB(auto_adjust_curve_ends) },
/* View menu */
{ "PreviousPhoto", GTK_STOCK_GO_BACK, _("_Previous Photo"),
"<control>Left", NULL, ACTION_CB(previous_photo) },
Modified: branches/4175-enfuse/src/rs-toolbox.c
===================================================================
--- branches/4175-enfuse/src/rs-toolbox.c 2012-10-28 20:39:54 UTC (rev
4298)
+++ branches/4175-enfuse/src/rs-toolbox.c 2012-10-28 20:42:15 UTC (rev
4299)
@@ -1280,3 +1280,9 @@
for( i = 0 ; i < 3 ; i++)
rs_curve_set_highlight(RS_CURVE_WIDGET(toolbox->curve[i]),
rgb_value);
}
+
+extern GtkWidget *
+rs_toolbox_get_curve(RSToolbox *toolbox, gint setting)
+{
+ return toolbox->curve[setting];
+}
Modified: branches/4175-enfuse/src/rs-toolbox.h
===================================================================
--- branches/4175-enfuse/src/rs-toolbox.h 2012-10-28 20:39:54 UTC (rev
4298)
+++ branches/4175-enfuse/src/rs-toolbox.h 2012-10-28 20:42:15 UTC (rev
4299)
@@ -68,6 +68,8 @@
extern void
rs_toolbox_hover_value_updated(RSToolbox *toolbox, const guchar *rgb_value);
+extern GtkWidget *
+rs_toolbox_get_curve(RSToolbox *toolbox, gint setting);
G_END_DECLS
Modified: branches/4175-enfuse/src/ui.xml
===================================================================
--- branches/4175-enfuse/src/ui.xml 2012-10-28 20:39:54 UTC (rev 4298)
+++ branches/4175-enfuse/src/ui.xml 2012-10-28 20:42:15 UTC (rev 4299)
@@ -44,6 +44,7 @@
<menuitem action="Flip" />
<menuitem action="Mirror" />
<menuitem action="Enfuse" />
+ <menuitem action="AutoAdjustCurveEnds" />
</menu>
<menu action="ViewMenu">
<menuitem action="PreviousPhoto" />
_______________________________________________
Rawstudio-commit mailing list
[email protected]
http://rawstudio.org/cgi-bin/mailman/listinfo/rawstudio-commit