[gimp/goat-invasion: 445/526] app: remove the remaining image_type macro junk from gimpimage.h



commit 95987bf28b95fecbe4937c5048ee83e5a171d43e
Author: Michael Natterer <mitch gimp org>
Date:   Sat Apr 7 02:50:50 2012 +0200

    app: remove the remaining image_type macro junk from gimpimage.h

 app/core/gimpimage.h     |   33 +--------------------------------
 app/core/gimpimagefile.c |    9 ++++++---
 2 files changed, 7 insertions(+), 35 deletions(-)
---
diff --git a/app/core/gimpimage.h b/app/core/gimpimage.h
index 9c9064b..aaf3259 100644
--- a/app/core/gimpimage.h
+++ b/app/core/gimpimage.h
@@ -22,38 +22,7 @@
 #include "gimpviewable.h"
 
 
-#define GIMP_IMAGE_TYPE_WITH_ALPHA(t)     (((t) == GIMP_RGB_IMAGE ||         \
-                                            (t) == GIMP_RGBA_IMAGE) ?        \
-                                           GIMP_RGBA_IMAGE :                 \
-                                           ((t) == GIMP_GRAY_IMAGE ||        \
-                                            (t) == GIMP_GRAYA_IMAGE) ?       \
-                                           GIMP_GRAYA_IMAGE :                \
-                                           ((t) == GIMP_INDEXED_IMAGE ||     \
-                                            (t) == GIMP_INDEXEDA_IMAGE) ?    \
-                                           GIMP_INDEXEDA_IMAGE : -1)
-#define GIMP_IMAGE_TYPE_FROM_BYTES(b)      ((b) == 4 ? GIMP_RGBA_IMAGE  :    \
-                                            (b) == 3 ? GIMP_RGB_IMAGE   :    \
-                                            (b) == 2 ? GIMP_GRAYA_IMAGE :    \
-                                            (b) == 1 ? GIMP_GRAY_IMAGE : -1)
-#define GIMP_IMAGE_TYPE_BASE_TYPE(t)      (((t) == GIMP_RGB_IMAGE ||         \
-                                            (t) == GIMP_RGBA_IMAGE) ?        \
-                                           GIMP_RGB :                        \
-                                           ((t) == GIMP_GRAY_IMAGE ||        \
-                                            (t) == GIMP_GRAYA_IMAGE) ?       \
-                                           GIMP_GRAY :                       \
-                                           ((t) == GIMP_INDEXED_IMAGE ||     \
-                                            (t) == GIMP_INDEXEDA_IMAGE) ?    \
-                                           GIMP_INDEXED : -1)
-
-#define GIMP_IMAGE_TYPE_FROM_BASE_TYPE(b)  ((b) == GIMP_RGB ?                \
-                                            GIMP_RGB_IMAGE :                 \
-                                            (b) == GIMP_GRAY ?               \
-                                            GIMP_GRAY_IMAGE :                \
-                                            (b) == GIMP_INDEXED ?            \
-                                            GIMP_INDEXED_IMAGE : -1)
-
-
-#define GIMP_IMAGE_ACTIVE_PARENT           ((gpointer) 1)
+#define GIMP_IMAGE_ACTIVE_PARENT ((gpointer) 1)
 
 
 #define GIMP_TYPE_IMAGE            (gimp_image_get_type ())
diff --git a/app/core/gimpimagefile.c b/app/core/gimpimagefile.c
index 5f80aae..13256cd 100644
--- a/app/core/gimpimagefile.c
+++ b/app/core/gimpimagefile.c
@@ -34,6 +34,8 @@
 
 #include "config/gimpcoreconfig.h"
 
+#include "gegl/gimp-gegl-utils.h"
+
 #include "gimp.h"
 #include "gimpcontainer.h"
 #include "gimpcontext.h"
@@ -972,15 +974,16 @@ gimp_thumbnail_set_info_from_image (GimpThumbnail *thumbnail,
                                     GimpImage     *image)
 {
   GimpEnumDesc  *desc;
+  const Babl    *format;
   GimpImageType  type;
 
   /*  peek the thumbnail to make sure that mtime and filesize are set  */
   gimp_thumbnail_peek_image (thumbnail);
 
-  type = GIMP_IMAGE_TYPE_FROM_BASE_TYPE (gimp_image_base_type (image));
+  format = gimp_image_get_layer_format (image,
+                                        gimp_image_has_alpha (image));
 
-  if (gimp_image_has_alpha (image))
-    type = GIMP_IMAGE_TYPE_WITH_ALPHA (type);
+  type = gimp_babl_format_get_image_type (format);
 
   desc = gimp_enum_get_desc (g_type_class_peek (GIMP_TYPE_IMAGE_TYPE), type);
 



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