[gimp/goat-invasion: 32/418] app: add macro GIMP_IMAGE_TYPE_FROM_BYTES() (ignoring indexed mode)



commit f876c73b333bfa817e49913d70e2b79fd0f97ebd
Author: Michael Natterer <mitch gimp org>
Date:   Wed Mar 14 23:06:53 2012 +0100

    app: add macro GIMP_IMAGE_TYPE_FROM_BYTES() (ignoring indexed mode)

 app/core/gimpimage.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/app/core/gimpimage.h b/app/core/gimpimage.h
index d64c8a7..b491fee 100644
--- a/app/core/gimpimage.h
+++ b/app/core/gimpimage.h
@@ -57,6 +57,10 @@
                                             (t) == GIMP_GRAY_IMAGE     ? 1 : \
                                             (t) == GIMP_INDEXEDA_IMAGE ? 2 : \
                                             (t) == GIMP_INDEXED_IMAGE  ? 1 : -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 :                        \



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