RGBA=RGBX, BGRA=BGRX, ABGR=XBGR, ARGB=XRGB
This commit is contained in:
3
bmp.h
3
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" {
|
||||
|
||||
8
jpegut.c
8
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)
|
||||
|
||||
14
jpgtest.c
14
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;
|
||||
|
||||
Reference in New Issue
Block a user