[gimp/goat-invasion: 62/526] app: add gimp_drawable_get_babl_format()



commit eeb8a15a514a35bd3f4857cdee4970fef94e1843
Author: Michael Natterer <mitch gimp org>
Date:   Fri Mar 16 00:01:34 2012 +0100

    app: add gimp_drawable_get_babl_format()

 app/core/gimpdrawable.c |    8 ++++++++
 app/core/gimpdrawable.h |    1 +
 2 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/app/core/gimpdrawable.c b/app/core/gimpdrawable.c
index 088d8e8..3c91194 100644
--- a/app/core/gimpdrawable.c
+++ b/app/core/gimpdrawable.c
@@ -1812,6 +1812,14 @@ gimp_drawable_fill_by_type (GimpDrawable *drawable,
   gimp_drawable_fill (drawable, pattern ? NULL : &color, pattern);
 }
 
+const Babl *
+gimp_drawable_get_babl_format (const GimpDrawable *drawable)
+{
+  g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), NULL);
+
+  return gimp_bpp_to_babl_format (gimp_drawable_bytes (drawable), TRUE);
+}
+
 gboolean
 gimp_drawable_has_alpha (const GimpDrawable *drawable)
 {
diff --git a/app/core/gimpdrawable.h b/app/core/gimpdrawable.h
index 7fd0353..c9c4c1a 100644
--- a/app/core/gimpdrawable.h
+++ b/app/core/gimpdrawable.h
@@ -222,6 +222,7 @@ void            gimp_drawable_fill_by_type       (GimpDrawable       *drawable,
                                                   GimpContext        *context,
                                                   GimpFillType        fill_type);
 
+const Babl    * gimp_drawable_get_babl_format    (const GimpDrawable *drawable);
 gboolean        gimp_drawable_has_alpha          (const GimpDrawable *drawable);
 GimpImageType   gimp_drawable_type               (const GimpDrawable *drawable);
 GimpImageType   gimp_drawable_type_with_alpha    (const GimpDrawable *drawable);



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