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



commit e73f7e05e348edf8a38050e211b70bbfacb324b8
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]