changeset 12996:147df4568b71

missing 32bit RGBA variants and some cleanup
author michael
date Wed, 11 Aug 2004 01:41:43 +0000
parents 2e2493e9b04b
children aa59d6df0280
files libmpcodecs/img_format.c libmpcodecs/img_format.h
diffstat 2 files changed, 24 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/img_format.c	Tue Aug 10 23:56:03 2004 +0000
+++ b/libmpcodecs/img_format.c	Wed Aug 11 01:41:43 2004 +0000
@@ -11,7 +11,7 @@
 	case IMGFMT_RGB15: return("RGB 15-bit");
 	case IMGFMT_RGB16: return("RGB 16-bit");
 	case IMGFMT_RGB24: return("RGB 24-bit");
-	case IMGFMT_RGB32: return("RGB 32-bit");
+//	case IMGFMT_RGB32: return("RGB 32-bit");
 	case IMGFMT_BGR1: return("BGR 1-bit");
 	case IMGFMT_BGR4: return("BGR 4-bit");
 	case IMGFMT_BG4B: return("BGR 4-bit per byte");
@@ -19,7 +19,11 @@
 	case IMGFMT_BGR15: return("BGR 15-bit");
 	case IMGFMT_BGR16: return("BGR 16-bit");
 	case IMGFMT_BGR24: return("BGR 24-bit");
-	case IMGFMT_BGR32: return("BGR 32-bit");
+//	case IMGFMT_BGR32: return("BGR 32-bit");
+	case IMGFMT_ABGR: return("ABGR");
+	case IMGFMT_BGRA: return("BGRA");
+	case IMGFMT_ARGB: return("ARGB");
+	case IMGFMT_RGBA: return("RGBA");
 	case IMGFMT_YVU9: return("Planar YVU9");
 	case IMGFMT_IF09: return("Planar IF09");
 	case IMGFMT_YV12: return("Planar YV12");
--- a/libmpcodecs/img_format.h	Tue Aug 10 23:56:03 2004 +0000
+++ b/libmpcodecs/img_format.h	Wed Aug 11 01:41:43 2004 +0000
@@ -8,7 +8,7 @@
 #define IMGFMT_RGB (('R'<<24)|('G'<<16)|('B'<<8))
 #define IMGFMT_RGB1  (IMGFMT_RGB|1)
 #define IMGFMT_RGB4  (IMGFMT_RGB|4)
-#define IMGFMT_RG4B  (IMGFMT_RGB|4|128) // RGB4 with 1 pixel per byte
+#define IMGFMT_RGB4_CHAR  (IMGFMT_RGB|4|128) // RGB4 with 1 pixel per byte
 #define IMGFMT_RGB8  (IMGFMT_RGB|8)
 #define IMGFMT_RGB15 (IMGFMT_RGB|15)
 #define IMGFMT_RGB16 (IMGFMT_RGB|16)
@@ -19,13 +19,29 @@
 #define IMGFMT_BGR (('B'<<24)|('G'<<16)|('R'<<8))
 #define IMGFMT_BGR1 (IMGFMT_BGR|1)
 #define IMGFMT_BGR4 (IMGFMT_BGR|4)
-#define IMGFMT_BG4B (IMGFMT_BGR|4|128) // BGR4 with 1 pixel per byte
+#define IMGFMT_BGR4_CHAR (IMGFMT_BGR|4|128) // BGR4 with 1 pixel per byte
 #define IMGFMT_BGR8 (IMGFMT_BGR|8)
 #define IMGFMT_BGR15 (IMGFMT_BGR|15)
 #define IMGFMT_BGR16 (IMGFMT_BGR|16)
 #define IMGFMT_BGR24 (IMGFMT_BGR|24)
 #define IMGFMT_BGR32 (IMGFMT_BGR|32)
 
+#ifdef WORDS_BIGENDIAN
+#define IMGFMT_ABGR IMGFMT_RGB32
+#define IMGFMT_BGRA (IMGFMT_RGB32|64)
+#define IMGFMT_ARGB IMGFMT_BGR32
+#define IMGFMT_RGBA (IMGFMT_BGR32|64)
+#else
+#define IMGFMT_ABGR (IMGFMT_BGR32|64)
+#define IMGFMT_BGRA IMGFMT_BGR32
+#define IMGFMT_ARGB (IMGFMT_RGB32|64)
+#define IMGFMT_RGBA IMGFMT_RGB32
+#endif
+
+/* old names for compatibility */
+#define IMGFMT_RG4B  IMGFMT_RGB4_CHAR
+#define IMGFMT_BG4B  IMGFMT_BGR4_CHAR
+
 #define IMGFMT_IS_RGB(fmt) (((fmt)&IMGFMT_RGB_MASK)==IMGFMT_RGB)
 #define IMGFMT_IS_BGR(fmt) (((fmt)&IMGFMT_BGR_MASK)==IMGFMT_BGR)