[gimp/goat-invasion: 32/412] app: add macro GIMP_IMAGE_TYPE_FROM_BYTES() (ignoring indexed mode)
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/goat-invasion: 32/412] app: add macro GIMP_IMAGE_TYPE_FROM_BYTES() (ignoring indexed mode)
- Date: Tue, 3 Apr 2012 09:35:48 +0000 (UTC)
commit c47ec310c17b5b8da9870cf3cafe2860ad662f21
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]