gimp r25641 - in trunk: . app/core app/gegl app/tools app/widgets
- From: neo svn gnome org
- To: svn-commits-list gnome org
- Subject: gimp r25641 - in trunk: . app/core app/gegl app/tools app/widgets
- Date: Sun, 11 May 2008 15:48:22 +0100 (BST)
Author: neo
Date: Sun May 11 14:48:22 2008
New Revision: 25641
URL: http://svn.gnome.org/viewvc/gimp?rev=25641&view=rev
Log:
2008-05-11 Sven Neumann <sven gimp org>
* app/core/gimpcurve.[ch]: renamed gimp_curve_map() to
gimp_curve_map_value(). Added new function
gimp_curve_map_pixels()
which will allow for better optimization.
* app/gegl/gimpoperationcurves.c
(gimp_operation_curves_process):
use gimp_curve_map_pixels().
* app/tools/gimpcurvestool.c
* app/widgets/gimpcurveview.c: follow API change.
Modified:
trunk/ChangeLog
trunk/app/core/gimpcurve.c
trunk/app/core/gimpcurve.h
trunk/app/gegl/gimpoperationcurves.c
trunk/app/tools/gimpcurvestool.c
trunk/app/widgets/gimpcurveview.c
Modified: trunk/app/core/gimpcurve.c
==============================================================================
--- trunk/app/core/gimpcurve.c (original)
+++ trunk/app/core/gimpcurve.c Sun May 11 14:48:22 2008
@@ -661,8 +661,8 @@
}
gdouble
-gimp_curve_map (GimpCurve *curve,
- gdouble value)
+gimp_curve_map_value (GimpCurve *curve,
+ gdouble value)
{
g_return_val_if_fail (GIMP_IS_CURVE (curve), 0.0);
@@ -684,6 +684,41 @@
}
void
+gimp_curve_map_pixels (GimpCurve *curve_all,
+ GimpCurve *curve_red,
+ GimpCurve *curve_green,
+ GimpCurve *curve_blue,
+ GimpCurve *curve_alpha,
+ gfloat *src,
+ gfloat *dest,
+ glong samples)
+{
+ g_return_if_fail (GIMP_IS_CURVE (curve_all));
+ g_return_if_fail (GIMP_IS_CURVE (curve_red));
+ g_return_if_fail (GIMP_IS_CURVE (curve_green));
+ g_return_if_fail (GIMP_IS_CURVE (curve_blue));
+ g_return_if_fail (GIMP_IS_CURVE (curve_alpha));
+
+ while (samples--)
+ {
+ dest[0] = gimp_curve_map_value (curve_all,
+ gimp_curve_map_value (curve_red,
+ src[0]));
+ dest[1] = gimp_curve_map_value (curve_all,
+ gimp_curve_map_value (curve_green,
+ src[1]));
+ dest[2] = gimp_curve_map_value (curve_all,
+ gimp_curve_map_value (curve_blue,
+ src[2]));
+ /* don't apply the overall curve to the alpha channel */
+ dest[3] = gimp_curve_map_value (curve_alpha, src[3]);
+
+ src += 4;
+ dest += 4;
+ }
+}
+
+void
gimp_curve_get_uchar (GimpCurve *curve,
gint n_samples,
guchar *samples)
Modified: trunk/app/core/gimpcurve.h
==============================================================================
--- trunk/app/core/gimpcurve.h (original)
+++ trunk/app/core/gimpcurve.h Sun May 11 14:48:22 2008
@@ -87,8 +87,17 @@
gdouble x,
gdouble y);
-gdouble gimp_curve_map (GimpCurve *curve,
+gdouble gimp_curve_map_value (GimpCurve *curve,
gdouble value);
+void gimp_curve_map_pixels (GimpCurve *curve_all,
+ GimpCurve *curve_red,
+ GimpCurve *curve_green,
+ GimpCurve *curve_blue,
+ GimpCurve *curve_alpha,
+ gfloat *src,
+ gfloat *dest,
+ glong samples);
+
void gimp_curve_get_uchar (GimpCurve *curve,
gint n_samples,
Modified: trunk/app/gegl/gimpoperationcurves.c
==============================================================================
--- trunk/app/gegl/gimpoperationcurves.c (original)
+++ trunk/app/gegl/gimpoperationcurves.c Sun May 11 14:48:22 2008
@@ -91,26 +91,11 @@
if (! config)
return FALSE;
- while (samples--)
- {
- gint channel;
-
- for (channel = 0; channel < 4; channel++)
- {
- gdouble value;
-
- value = gimp_curve_map (config->curve[channel + 1], src[channel]);
-
- /* don't apply the overall curve to the alpha channel */
- if (channel != ALPHA_PIX)
- value = gimp_curve_map (config->curve[0], value);
-
- dest[channel] = value;
- }
-
- src += 4;
- dest += 4;
- }
+ gimp_curve_map_pixels (config->curve[0],
+ config->curve[1],
+ config->curve[2],
+ config->curve[3],
+ config->curve[4], src, dest, samples);
return TRUE;
}
Modified: trunk/app/tools/gimpcurvestool.c
==============================================================================
--- trunk/app/tools/gimpcurvestool.c (original)
+++ trunk/app/tools/gimpcurvestool.c Sun May 11 14:48:22 2008
@@ -257,7 +257,7 @@
closest);
gimp_curve_set_point (curve, closest,
- value, gimp_curve_map (curve, value));
+ value, gimp_curve_map_value (curve, value));
}
else if (state & GDK_CONTROL_MASK)
{
@@ -275,7 +275,7 @@
closest);
gimp_curve_set_point (curve, closest,
- value, gimp_curve_map (curve, value));
+ value, gimp_curve_map_value (curve, value));
}
}
Modified: trunk/app/widgets/gimpcurveview.c
==============================================================================
--- trunk/app/widgets/gimpcurveview.c (original)
+++ trunk/app/widgets/gimpcurveview.c Sun May 11 14:48:22 2008
@@ -370,7 +370,7 @@
gdk_cairo_set_source_color (cr, &style->text[GTK_STATE_NORMAL]);
x = 0.0;
- y = 1.0 - gimp_curve_map (view->curve, 0.0);
+ y = 1.0 - gimp_curve_map_value (view->curve, 0.0);
cairo_move_to (cr,
border + (gdouble) width * x,
@@ -379,7 +379,7 @@
for (i = 1; i < 256; i++)
{
x = (gdouble) i / 255.0;
- y = 1.0 - gimp_curve_map (view->curve, x);
+ y = 1.0 - gimp_curve_map_value (view->curve, x);
cairo_line_to (cr,
border + (gdouble) width * x,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]