[gimp] app: use gimp_rgba_set, get_pixel() instead of babl_process() directly



commit 7ec6c48636466e3e19ef6e09d08ea9c07bb25c1e
Author: Michael Natterer <mitch gimp org>
Date:   Tue Apr 3 16:25:31 2012 +0200

    app: use gimp_rgba_set,get_pixel() instead of babl_process() directly

 app/core/gimpcontext.c  |   16 ++++------------
 app/core/gimppickable.c |    4 +---
 2 files changed, 5 insertions(+), 15 deletions(-)
---
diff --git a/app/core/gimpcontext.c b/app/core/gimpcontext.c
index d54130a..04ea972 100644
--- a/app/core/gimpcontext.c
+++ b/app/core/gimpcontext.c
@@ -2223,9 +2223,7 @@ gimp_context_get_foreground_pixel (GimpContext *context,
   g_return_if_fail (pixel_format != NULL);
   g_return_if_fail (pixel != NULL);
 
-  babl_process (babl_fish (babl_format ("R'G'B'A double"),
-                           pixel_format),
-                &context->foreground, pixel, 1);
+  gimp_rgba_get_pixel (&context->foreground, pixel_format, pixel);
 }
 
 void
@@ -2250,9 +2248,7 @@ gimp_context_set_foreground_pixel (GimpContext   *context,
   g_return_if_fail (pixel_format != NULL);
   g_return_if_fail (pixel != NULL);
 
-  babl_process (babl_fish (pixel_format,
-                           babl_format ("R'G'B'A double")),
-                pixel, &color, 1);
+  gimp_rgba_set_pixel (&color, pixel_format, pixel);
 
   gimp_context_set_foreground (context, &color);
 }
@@ -2305,9 +2301,7 @@ gimp_context_get_background_pixel (GimpContext *context,
   g_return_if_fail (pixel_format != NULL);
   g_return_if_fail (pixel != NULL);
 
-  babl_process (babl_fish (babl_format ("R'G'B'A double"),
-                           pixel_format),
-                &context->background, pixel, 1);
+  gimp_rgba_get_pixel (&context->background, pixel_format, pixel);
 }
 
 void
@@ -2332,9 +2326,7 @@ gimp_context_set_background_pixel (GimpContext   *context,
   g_return_if_fail (pixel_format != NULL);
   g_return_if_fail (pixel != NULL);
 
-  babl_process (babl_fish (pixel_format,
-                           babl_format ("R'G'B'A double")),
-                pixel, &color, 1);
+  gimp_rgba_set_pixel (&color, pixel_format, pixel);
 
   gimp_context_set_background (context, &color);
 }
diff --git a/app/core/gimppickable.c b/app/core/gimppickable.c
index 78c2209..138a69b 100644
--- a/app/core/gimppickable.c
+++ b/app/core/gimppickable.c
@@ -184,9 +184,7 @@ gimp_pickable_get_color_at (GimpPickable *pickable,
   if (! gimp_pickable_get_pixel_at (pickable, x, y, pixel))
     return FALSE;
 
-  babl_process (babl_fish (gimp_pickable_get_format (pickable),
-                           babl_format ("R'G'B'A double")),
-                pixel, color, 1);
+  gimp_rgba_set_pixel (color, gimp_pickable_get_format (pickable), pixel);
 
   return TRUE;
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]