diff options
author | dcommander <dcommander@632fc199-4ca6-4c93-a231-07263d6284db> | 2011-12-19 02:21:03 +0000 |
---|---|---|
committer | dcommander <dcommander@632fc199-4ca6-4c93-a231-07263d6284db> | 2011-12-19 02:21:03 +0000 |
commit | b0aceed6b43daf90ede8219785d90fe418a3de84 (patch) | |
tree | 2dd45bc176dbd84036eb777db076ed2a086d57c6 /tjunittest.c | |
parent | 842532c5814da36d0085ea56f23d6e647a7be703 (diff) |
Added new alpha channel colorspace constants/pixel formats, so applications can specify that they need the unused byte in a 4-component RGB output buffer set to 0xFF when decompressing.
git-svn-id: svn://svn.code.sf.net/p/libjpeg-turbo/code/trunk@732 632fc199-4ca6-4c93-a231-07263d6284db
Diffstat (limited to 'tjunittest.c')
-rw-r--r-- | tjunittest.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/tjunittest.c b/tjunittest.c index 3a57347..d14ec52 100644 --- a/tjunittest.c +++ b/tjunittest.c @@ -65,10 +65,11 @@ const char *subName[TJ_NUMSAMP]={"444", "422", "420", "GRAY", "440"}; const char *pixFormatStr[TJ_NUMPF]= { - "RGB", "BGR", "RGBX", "BGRX", "XBGR", "XRGB", "Grayscale" + "RGB", "BGR", "RGBX", "BGRX", "XBGR", "XRGB", "Grayscale", + "RGBA", "BGRA", "ABGR", "ARGB" }; -const int alphaOffset[TJ_NUMPF] = {-1, -1, 3, 3, 0, 0, -1}; +const int alphaOffset[TJ_NUMPF] = {-1, -1, -1, -1, -1, -1, -1, 3, 3, 0, 0}; const int _3byteFormats[]={TJPF_RGB, TJPF_BGR}; const int _4byteFormats[]={TJPF_RGBX, TJPF_BGRX, TJPF_XBGR, TJPF_XRGB}; @@ -76,7 +77,7 @@ const int _onlyGray[]={TJPF_GRAY}; const int _onlyRGB[]={TJPF_RGB}; enum {YUVENCODE=1, YUVDECODE}; -int yuv=0, alloc=0; +int yuv=0, alloc=0, alpha=0; int exitStatus=0; #define bailout() {exitStatus=-1; goto bailout;} @@ -511,6 +512,9 @@ void doTest(int w, int h, const int *formats, int nformats, int subsamp, flags); decompTest(dhandle, dstBuf, size, w, h, pf, basename, subsamp, flags); + if(pf>=TJPF_RGBX && pf<=TJPF_XRGB) + decompTest(dhandle, dstBuf, size, w, h, pf+(TJPF_RGBA-TJPF_RGBX), + basename, subsamp, flags); } } |