[babl] add babl_format_get_model



commit 63c48d1826edf164a5cd5124dc04c64b7e4ffbfa
Author: Ãyvind KolÃs <pippin gimp org>
Date:   Thu Apr 26 01:17:41 2012 +0200

    add babl_format_get_model

 babl/babl-format.c |   12 ++++++++++++
 babl/babl.h        |    5 +++++
 2 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/babl/babl-format.c b/babl/babl-format.c
index 7f43911..0a7a840 100644
--- a/babl/babl-format.c
+++ b/babl/babl-format.c
@@ -653,4 +653,16 @@ babl_set_user_data (const Babl *cbabl, void *data)
     }
 }
 
+const Babl *
+babl_format_get_model (const Babl *format)
+{
+  if (format->class_type == BABL_FORMAT)
+    {
+      return (Babl*)format->format.model;
+    }
+  return NULL;
+}
+
 BABL_CLASS_IMPLEMENT (format)
+
+
diff --git a/babl/babl.h b/babl/babl.h
index 5e6cf42..c1c5e9d 100644
--- a/babl/babl.h
+++ b/babl/babl.h
@@ -105,6 +105,11 @@ int          babl_format_has_alpha             (const Babl *format);
 int          babl_format_get_bytes_per_pixel   (const Babl *format);
 
 /**
+ * Return the model used for constructing the format.
+ */
+const Babl * babl_format_get_model             (const Babl *format);
+
+/**
  * Returns the number of components for the given @format.
  */
 int          babl_format_get_n_components      (const Babl *format);



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