From: DRC Date: Mon, 19 Dec 2011 02:21:03 +0000 (+0000) Subject: Added new alpha channel colorspace constants/pixel formats, so applications can speci... X-Git-Tag: 1.2.0~30 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=67ce3b2352fe1f7511edbfed74ec6960e41e97dc;p=libjpeg-turbo 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+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@732 632fc199-4ca6-4c93-a231-07263d6284db --- diff --git a/ChangeLog.txt b/ChangeLog.txt index 0776105..083a0a4 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -14,6 +14,11 @@ valgrind. See http://crbug.com/72399 for more information. [3] Added a compile-time macro (LIBJPEG_TURBO_VERSION) that can be used to check the version of libjpeg-turbo against which an application was compiled. +[4] Added new RGBA/BGRA/ABGR/ARGB colorspace extension constants (libjpeg API) +and pixel formats (TurboJPEG API), which allow applications to specify that, +when decompressing to a 4-component RGB buffer, the unused byte should be set +to 0xFF so that it can be interpreted as an opaque alpha channel. + 1.1.90 (1.2 beta1) ================== diff --git a/README-turbo.txt b/README-turbo.txt index b1ed218..8b18d4c 100755 --- a/README-turbo.txt +++ b/README-turbo.txt @@ -210,7 +210,7 @@ Colorspace Extensions libjpeg-turbo includes extensions that allow JPEG images to be compressed directly from (and decompressed directly to) buffers that use BGR, BGRX, -RGBX, XBGR, and XRGB pixel ordering. This is implemented with six new +RGBX, XBGR, and XRGB pixel ordering. This is implemented with ten new colorspace constants: JCS_EXT_RGB /* red/green/blue */ @@ -219,6 +219,10 @@ colorspace constants: JCS_EXT_BGRX /* blue/green/red/x */ JCS_EXT_XBGR /* x/blue/green/red */ JCS_EXT_XRGB /* x/red/green/blue */ + JCS_EXT_RGBA /* red/green/blue/alpha */ + JCS_EXT_BGRA /* blue/green/red/alpha */ + JCS_EXT_ABGR /* alpha/blue/green/red */ + JCS_EXT_ARGB /* alpha/red/green/blue */ Setting cinfo.in_color_space (compression) or cinfo.out_color_space (decompression) to one of these values will cause libjpeg-turbo to read the @@ -233,6 +237,18 @@ time with: At run time, attempting to use these extensions with a version of libjpeg that doesn't support them will result in a "Bogus input colorspace" error. +When using the RGBX, BGRX, XBGR, and XRGB colorspaces during decompression, the +X byte is undefined, and in order to ensure the best performance, libjpeg-turbo +can set that byte to whatever value it wishes. If an application expects the X +byte to be used as an alpha channel, then it should use JCS_EXT_RGBA, +JCS_EXT_BGRA, JCS_EXT_ABGR, or JCS_EXT_ARGB. When these colorspace constants +are used, the X byte is guaranteed to be 0xFF, which is interpreted as opaque. + +Your application can check for the existence of the alpha channel colorspace +extensions at compile time with: + + #ifdef JCS_ALPHA_EXTENSIONS + ================================= libjpeg v7 and v8 API/ABI support ================================= diff --git a/doc/html/annotated.html b/doc/html/annotated.html index a089c5a..b7d3b54 100644 --- a/doc/html/annotated.html +++ b/doc/html/annotated.html @@ -81,7 +81,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); -