changeset 6576:b8ed96e21f2c

{RGB,BGR}{1,4}
author michael
date Thu, 27 Jun 2002 17:35:37 +0000
parents 7622a58bbbe7
children aad616b63bed
files libmpcodecs/img_format.c libmpcodecs/img_format.h libmpcodecs/mp_image.h
diffstat 3 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/img_format.c	Thu Jun 27 16:43:05 2002 +0000
+++ b/libmpcodecs/img_format.c	Thu Jun 27 17:35:37 2002 +0000
@@ -4,11 +4,15 @@
 {
     switch(format)
     {
+	case IMGFMT_RGB1: return("RGB 1-bit");
+	case IMGFMT_RGB4: return("RGB 4-bit");
 	case IMGFMT_RGB8: return("RGB 8-bit");
 	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_BGR1: return("BGR 1-bit");
+	case IMGFMT_BGR4: return("BGR 4-bit");
 	case IMGFMT_BGR8: return("BGR 8-bit");
 	case IMGFMT_BGR15: return("BGR 15-bit");
 	case IMGFMT_BGR16: return("BGR 16-bit");
--- a/libmpcodecs/img_format.h	Thu Jun 27 16:43:05 2002 +0000
+++ b/libmpcodecs/img_format.h	Thu Jun 27 17:35:37 2002 +0000
@@ -6,6 +6,8 @@
 
 #define IMGFMT_RGB_MASK 0xFFFFFF00
 #define IMGFMT_RGB (('R'<<24)|('G'<<16)|('B'<<8))
+#define IMGFMT_RGB1  (IMGFMT_RGB|1)
+#define IMGFMT_RGB4  (IMGFMT_RGB|4)
 #define IMGFMT_RGB8  (IMGFMT_RGB|8)
 #define IMGFMT_RGB15 (IMGFMT_RGB|15)
 #define IMGFMT_RGB16 (IMGFMT_RGB|16)
@@ -14,6 +16,8 @@
 
 #define IMGFMT_BGR_MASK 0xFFFFFF00
 #define IMGFMT_BGR (('B'<<24)|('G'<<16)|('R'<<8))
+#define IMGFMT_BGR1 (IMGFMT_BGR|1)
+#define IMGFMT_BGR4 (IMGFMT_BGR|4)
 #define IMGFMT_BGR8 (IMGFMT_BGR|8)
 #define IMGFMT_BGR15 (IMGFMT_BGR|15)
 #define IMGFMT_BGR16 (IMGFMT_BGR|16)
--- a/libmpcodecs/mp_image.h	Thu Jun 27 16:43:05 2002 +0000
+++ b/libmpcodecs/mp_image.h	Thu Jun 27 17:35:37 2002 +0000
@@ -73,11 +73,13 @@
     mpi->num_planes=1;
     if( (out_fmt&IMGFMT_RGB_MASK) == IMGFMT_RGB ){
 	mpi->bpp=((out_fmt&255)+7)&(~7);
+	if(out_fmt==IMGFMT_RGB1) mpi->bpp=1;
 	return;
     }
     if( (out_fmt&IMGFMT_BGR_MASK) == IMGFMT_BGR ){
 	mpi->bpp=((out_fmt&255)+7)&(~7);
 	mpi->flags|=MP_IMGFLAG_SWAPPED;
+	if(out_fmt==IMGFMT_BGR1) mpi->bpp=1;
 	return;
     }
     mpi->flags|=MP_IMGFLAG_YUV;