From 035aac43b013ef6375398c938f9148e528e44b86 Mon Sep 17 00:00:00 2001 From: DRC Date: Sat, 19 Feb 2011 18:10:05 +0000 Subject: [PATCH] RGBA=RGBX, BGRA=BGRX, ABGR=XBGR, ARGB=XRGB git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@418 632fc199-4ca6-4c93-a231-07263d6284db --- bmp.h | 3 ++- jpegut.c | 8 ++++---- jpgtest.c | 14 +++++++------- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/bmp.h b/bmp.h index 437d327..055b1ee 100644 --- a/bmp.h +++ b/bmp.h @@ -1,5 +1,6 @@ /* Copyright (C)2004 Landmark Graphics Corporation * Copyright (C)2005 Sun Microsystems, Inc. + * Copyright (C)2011 D. R. Commander * * This library is free software and may be redistributed and/or modified under * the terms of the wxWindows Library License, Version 3.1 or (at your option) @@ -19,7 +20,7 @@ #define __BMP_H__ #define BMPPIXELFORMATS 6 -enum BMPPIXELFORMAT {BMP_RGB=0, BMP_RGBA, BMP_BGR, BMP_BGRA, BMP_ABGR, BMP_ARGB}; +enum BMPPIXELFORMAT {BMP_RGB=0, BMP_RGBX, BMP_BGR, BMP_BGRX, BMP_XBGR, BMP_XRGB}; #ifdef __cplusplus extern "C" { diff --git a/jpegut.c b/jpegut.c index 9714b61..31db1d0 100644 --- a/jpegut.c +++ b/jpegut.c @@ -358,12 +358,12 @@ void gentestjpeg(tjhandle hnd, unsigned char *jpegbuf, unsigned long *size, if(flags&TJ_BGR) { if(ps==3) pixformat="BGR"; - else {if(flags&TJ_ALPHAFIRST) pixformat="ABGR"; else pixformat="BGRA";} + else {if(flags&TJ_ALPHAFIRST) pixformat="XBGR"; else pixformat="BGRX";} } else { if(ps==3) pixformat="RGB"; - else {if(flags&TJ_ALPHAFIRST) pixformat="ARGB"; else pixformat="RGBA";} + else {if(flags&TJ_ALPHAFIRST) pixformat="XRGB"; else pixformat="RGBX";} } if(ps==1) pixformat="Grayscale"; if(yuv==YUVENCODE) @@ -423,12 +423,12 @@ void _gentestbmp(tjhandle hnd, unsigned char *jpegbuf, unsigned long jpegsize, if(flags&TJ_BGR) { if(ps==3) pixformat="BGR"; - else {if(flags&TJ_ALPHAFIRST) pixformat="ABGR"; else pixformat="BGRA";} + else {if(flags&TJ_ALPHAFIRST) pixformat="XBGR"; else pixformat="BGRX";} } else { if(ps==3) pixformat="RGB"; - else {if(flags&TJ_ALPHAFIRST) pixformat="ARGB"; else pixformat="RGBA";} + else {if(flags&TJ_ALPHAFIRST) pixformat="XRGB"; else pixformat="RGBX";} } if(ps==1) pixformat="Grayscale"; if(yuv==YUVDECODE) diff --git a/jpgtest.c b/jpgtest.c index 318f9bf..ced97fb 100644 --- a/jpgtest.c +++ b/jpgtest.c @@ -41,7 +41,7 @@ const int _flags[BMPPIXELFORMATS]={0, 0, TJ_BGR, TJ_BGR, const int _rindex[BMPPIXELFORMATS]={0, 0, 2, 2, 3, 1}; const int _gindex[BMPPIXELFORMATS]={1, 1, 1, 1, 2, 2}; const int _bindex[BMPPIXELFORMATS]={2, 2, 0, 0, 1, 3}; -const char *_pfname[]={"RGB", "RGBA", "BGR", "BGRA", "ABGR", "ARGB"}; +const char *_pfname[]={"RGB", "RGBX", "BGR", "BGRX", "XBGR", "XRGB"}; const char *_subnamel[NUMSUBOPT]={"4:4:4", "4:2:2", "4:2:0", "GRAY"}; const char *_subnames[NUMSUBOPT]={"444", "422", "420", "GRAY"}; const int _hsf[NUMSUBOPT]={1, 2, 2, 1}; @@ -439,8 +439,8 @@ void usage(char *progname) printf("-tile = Test performance of the codec when the image is encoded as separate\n"); printf(" tiles of varying sizes.\n"); printf("-forcemmx, -forcesse, -forcesse2, -forcesse3 =\n"); - printf(" Force MMX, SSE, or SSE2 code paths in TurboJPEG codec\n"); - printf("-rgb, -bgr, -rgba, -bgra, -abgr, -argb =\n"); + printf(" Force MMX, SSE, SSE2, or SSE3 code paths in the underlying codec\n"); + printf("-rgb, -bgr, -rgbx, -bgrx, -xbgr, -xrgb =\n"); printf(" Test the specified color conversion path in the codec (default: BGR)\n"); printf("-fastupsample = Use fast, inaccurate upsampling code to perform 4:2:2 and 4:2:0\n"); printf(" YUV decoding in libjpeg decompressor\n"); @@ -533,11 +533,11 @@ int main(int argc, char *argv[]) fastupsample=1; } if(!stricmp(argv[i], "-rgb")) pf=BMP_RGB; - if(!stricmp(argv[i], "-rgba")) pf=BMP_RGBA; + if(!stricmp(argv[i], "-rgbx")) pf=BMP_RGBX; if(!stricmp(argv[i], "-bgr")) pf=BMP_BGR; - if(!stricmp(argv[i], "-bgra")) pf=BMP_BGRA; - if(!stricmp(argv[i], "-abgr")) pf=BMP_ABGR; - if(!stricmp(argv[i], "-argb")) pf=BMP_ARGB; + if(!stricmp(argv[i], "-bgrx")) pf=BMP_BGRX; + if(!stricmp(argv[i], "-xbgr")) pf=BMP_XBGR; + if(!stricmp(argv[i], "-xrgb")) pf=BMP_XRGB; if(!stricmp(argv[i], "-bottomup")) bu=1; if(!stricmp(argv[i], "-quiet")) quiet=1; if(!stricmp(argv[i], "-qq")) quiet=2; -- 2.40.0