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.

This commit is contained in:
DRC
2011-12-19 02:21:03 +00:00
parent 67420f1fa1
commit c1e4151607
48 changed files with 487 additions and 104 deletions

View File

@@ -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)
==================

View File

@@ -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
=================================

View File

@@ -81,7 +81,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
</iframe>
</div>
<hr class="footer"/><address class="footer"><small>Generated on Thu Dec 15 2011 06:54:38 for TurboJPEG by&#160;
<hr class="footer"/><address class="footer"><small>Generated on Sun Dec 18 2011 20:09:47 for TurboJPEG by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>

View File

@@ -80,7 +80,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
</iframe>
</div>
<hr class="footer"/><address class="footer"><small>Generated on Thu Dec 15 2011 06:54:38 for TurboJPEG by&#160;
<hr class="footer"/><address class="footer"><small>Generated on Sun Dec 18 2011 20:09:47 for TurboJPEG by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>

View File

@@ -113,7 +113,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
</iframe>
</div>
<hr class="footer"/><address class="footer"><small>Generated on Thu Dec 15 2011 06:54:38 for TurboJPEG by&#160;
<hr class="footer"/><address class="footer"><small>Generated on Sun Dec 18 2011 20:09:47 for TurboJPEG by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>

View File

@@ -113,7 +113,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
</iframe>
</div>
<hr class="footer"/><address class="footer"><small>Generated on Thu Dec 15 2011 06:54:38 for TurboJPEG by&#160;
<hr class="footer"/><address class="footer"><small>Generated on Sun Dec 18 2011 20:09:47 for TurboJPEG by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>

View File

@@ -135,7 +135,12 @@ Enumerations</h2></td></tr>
<br/>
&#160;&#160;<a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aaf6603b27147de47e212e75dac027b2af">TJPF_XBGR</a>,
<a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aadae996905efcfa3b42a0bb3bea7f9d84">TJPF_XRGB</a>,
<a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa5431b54b015337705f13118073711a1a">TJPF_GRAY</a>
<a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa5431b54b015337705f13118073711a1a">TJPF_GRAY</a>,
<a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa88d2e88fab67f6503cf972e14851cc12">TJPF_RGBA</a>,
<br/>
&#160;&#160;<a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aac037ff1845cf9b74bb81a3659c2b9fb4">TJPF_BGRA</a>,
<a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa1ba1a7f1631dbeaa49a0a85fc4a40081">TJPF_ABGR</a>,
<a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aae8f846ed9d9de99b6e1dfe448848765c">TJPF_ARGB</a>
<br/>
}</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Pixel formats. <a href="group___turbo_j_p_e_g.html#gac916144e26c3817ac514e64ae5d12e2a">More...</a><br/></td></tr>
@@ -537,24 +542,40 @@ Variables</h2></td></tr>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="ggac916144e26c3817ac514e64ae5d12e2aa83973bebb7e2dc6fa8bae89ff3f42e01"></a><!-- doxytag: member="TJPF_RGBX" ref="ggac916144e26c3817ac514e64ae5d12e2aa83973bebb7e2dc6fa8bae89ff3f42e01" args="" -->TJPF_RGBX</em>&nbsp;</td><td>
<p>RGBX pixel format. </p>
<p>The red, green, and blue components in the image are stored in 4-byte pixels in the order R, G, B from lowest to highest byte address within each pixel. </p>
<p>The red, green, and blue components in the image are stored in 4-byte pixels in the order R, G, B from lowest to highest byte address within each pixel. The X component is ignored when compressing and undefined when decompressing. </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="ggac916144e26c3817ac514e64ae5d12e2aa2a1fbf569ca79897eae886e3376ca4c8"></a><!-- doxytag: member="TJPF_BGRX" ref="ggac916144e26c3817ac514e64ae5d12e2aa2a1fbf569ca79897eae886e3376ca4c8" args="" -->TJPF_BGRX</em>&nbsp;</td><td>
<p>BGRX pixel format. </p>
<p>The red, green, and blue components in the image are stored in 4-byte pixels in the order B, G, R from lowest to highest byte address within each pixel. </p>
<p>The red, green, and blue components in the image are stored in 4-byte pixels in the order B, G, R from lowest to highest byte address within each pixel. The X component is ignored when compressing and undefined when decompressing. </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="ggac916144e26c3817ac514e64ae5d12e2aaf6603b27147de47e212e75dac027b2af"></a><!-- doxytag: member="TJPF_XBGR" ref="ggac916144e26c3817ac514e64ae5d12e2aaf6603b27147de47e212e75dac027b2af" args="" -->TJPF_XBGR</em>&nbsp;</td><td>
<p>XBGR pixel format. </p>
<p>The red, green, and blue components in the image are stored in 4-byte pixels in the order R, G, B from highest to lowest byte address within each pixel. </p>
<p>The red, green, and blue components in the image are stored in 4-byte pixels in the order R, G, B from highest to lowest byte address within each pixel. The X component is ignored when compressing and undefined when decompressing. </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="ggac916144e26c3817ac514e64ae5d12e2aadae996905efcfa3b42a0bb3bea7f9d84"></a><!-- doxytag: member="TJPF_XRGB" ref="ggac916144e26c3817ac514e64ae5d12e2aadae996905efcfa3b42a0bb3bea7f9d84" args="" -->TJPF_XRGB</em>&nbsp;</td><td>
<p>XRGB pixel format. </p>
<p>The red, green, and blue components in the image are stored in 4-byte pixels in the order B, G, R from highest to lowest byte address within each pixel. </p>
<p>The red, green, and blue components in the image are stored in 4-byte pixels in the order B, G, R from highest to lowest byte address within each pixel. The X component is ignored when compressing and undefined when decompressing. </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="ggac916144e26c3817ac514e64ae5d12e2aa5431b54b015337705f13118073711a1a"></a><!-- doxytag: member="TJPF_GRAY" ref="ggac916144e26c3817ac514e64ae5d12e2aa5431b54b015337705f13118073711a1a" args="" -->TJPF_GRAY</em>&nbsp;</td><td>
<p>Grayscale pixel format. </p>
<p>Each 1-byte pixel represents a luminance (brightness) level from 0 to 255. </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="ggac916144e26c3817ac514e64ae5d12e2aa88d2e88fab67f6503cf972e14851cc12"></a><!-- doxytag: member="TJPF_RGBA" ref="ggac916144e26c3817ac514e64ae5d12e2aa88d2e88fab67f6503cf972e14851cc12" args="" -->TJPF_RGBA</em>&nbsp;</td><td>
<p>RGBA pixel format. </p>
<p>This is the same as <a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa83973bebb7e2dc6fa8bae89ff3f42e01">TJPF_RGBX</a>, except that when decompressing, the X component is guaranteed to be 0xFF, which can be interpreted as an opaque alpha channel. </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="ggac916144e26c3817ac514e64ae5d12e2aac037ff1845cf9b74bb81a3659c2b9fb4"></a><!-- doxytag: member="TJPF_BGRA" ref="ggac916144e26c3817ac514e64ae5d12e2aac037ff1845cf9b74bb81a3659c2b9fb4" args="" -->TJPF_BGRA</em>&nbsp;</td><td>
<p>BGRA pixel format. </p>
<p>This is the same as <a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa2a1fbf569ca79897eae886e3376ca4c8">TJPF_BGRX</a>, except that when decompressing, the X component is guaranteed to be 0xFF, which can be interpreted as an opaque alpha channel. </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="ggac916144e26c3817ac514e64ae5d12e2aa1ba1a7f1631dbeaa49a0a85fc4a40081"></a><!-- doxytag: member="TJPF_ABGR" ref="ggac916144e26c3817ac514e64ae5d12e2aa1ba1a7f1631dbeaa49a0a85fc4a40081" args="" -->TJPF_ABGR</em>&nbsp;</td><td>
<p>ABGR pixel format. </p>
<p>This is the same as <a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aaf6603b27147de47e212e75dac027b2af">TJPF_XBGR</a>, except that when decompressing, the X component is guaranteed to be 0xFF, which can be interpreted as an opaque alpha channel. </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="ggac916144e26c3817ac514e64ae5d12e2aae8f846ed9d9de99b6e1dfe448848765c"></a><!-- doxytag: member="TJPF_ARGB" ref="ggac916144e26c3817ac514e64ae5d12e2aae8f846ed9d9de99b6e1dfe448848765c" args="" -->TJPF_ARGB</em>&nbsp;</td><td>
<p>ARGB pixel format. </p>
<p>This is the same as <a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aadae996905efcfa3b42a0bb3bea7f9d84">TJPF_XRGB</a>, except that when decompressing, the X component is guaranteed to be 0xFF, which can be interpreted as an opaque alpha channel. </p>
</td></tr>
</table>
</dd>
</dl>
@@ -1536,7 +1557,7 @@ If you choose option 1, <code>dstSizes[i]</code> should be set to the size of yo
</iframe>
</div>
<hr class="footer"/><address class="footer"><small>Generated on Thu Dec 15 2011 06:54:38 for TurboJPEG by&#160;
<hr class="footer"/><address class="footer"><small>Generated on Sun Dec 18 2011 20:09:47 for TurboJPEG by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>

View File

@@ -69,7 +69,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
</iframe>
</div>
<hr class="footer"/><address class="footer"><small>Generated on Thu Dec 15 2011 06:54:38 for TurboJPEG by&#160;
<hr class="footer"/><address class="footer"><small>Generated on Sun Dec 18 2011 20:09:47 for TurboJPEG by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>

View File

@@ -72,7 +72,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
</iframe>
</div>
<hr class="footer"/><address class="footer"><small>Generated on Thu Dec 15 2011 06:54:38 for TurboJPEG by&#160;
<hr class="footer"/><address class="footer"><small>Generated on Sun Dec 18 2011 20:09:47 for TurboJPEG by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>

View File

@@ -165,7 +165,7 @@ Data Fields</h2></td></tr>
</iframe>
</div>
<hr class="footer"/><address class="footer"><small>Generated on Thu Dec 15 2011 06:54:38 for TurboJPEG by&#160;
<hr class="footer"/><address class="footer"><small>Generated on Sun Dec 18 2011 20:09:47 for TurboJPEG by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>

View File

@@ -127,7 +127,7 @@ Data Fields</h2></td></tr>
</iframe>
</div>
<hr class="footer"/><address class="footer"><small>Generated on Thu Dec 15 2011 06:54:38 for TurboJPEG by&#160;
<hr class="footer"/><address class="footer"><small>Generated on Sun Dec 18 2011 20:09:47 for TurboJPEG by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>

View File

@@ -191,7 +191,7 @@ Data Fields</h2></td></tr>
</iframe>
</div>
<hr class="footer"/><address class="footer"><small>Generated on Thu Dec 15 2011 06:54:38 for TurboJPEG by&#160;
<hr class="footer"/><address class="footer"><small>Generated on Sun Dec 18 2011 20:09:47 for TurboJPEG by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>

View File

@@ -58,11 +58,12 @@ public class TJUnitTest {
};
private final static String pixFormatStr[] = {
"RGB", "BGR", "RGBX", "BGRX", "XBGR", "XRGB", "Grayscale"
"RGB", "BGR", "RGBX", "BGRX", "XBGR", "XRGB", "Grayscale",
"RGBA", "BGRA", "ABGR", "ARGB"
};
private final static int alphaOffset[] = {
-1, -1, 3, 3, 0, 0, -1
-1, -1, -1, -1, -1, -1, -1, 3, 3, 0, 0
};
private final static int _3byteFormats[] = {
@@ -112,12 +113,16 @@ public class TJUnitTest {
else
return TJ.PF_RGBX;
case BufferedImage.TYPE_INT_RGB:
case BufferedImage.TYPE_INT_ARGB:
case BufferedImage.TYPE_INT_ARGB_PRE:
if(byteOrder == ByteOrder.BIG_ENDIAN)
return TJ.PF_XRGB;
else
return TJ.PF_BGRX;
case BufferedImage.TYPE_INT_ARGB:
case BufferedImage.TYPE_INT_ARGB_PRE:
if(byteOrder == ByteOrder.BIG_ENDIAN)
return TJ.PF_ARGB;
else
return TJ.PF_BGRA;
}
return 0;
}
@@ -769,6 +774,9 @@ public class TJUnitTest {
size = compTest(tjc, dstBuf, w, h, pf, baseName, subsamp, 100,
flags);
decompTest(tjd, dstBuf, size, w, h, pf, baseName, subsamp, flags);
if(pf >= TJ.PF_RGBX && pf <= TJ.PF_XRGB && !bi)
decompTest(tjd, dstBuf, size, w, h, pf + (TJ.PF_RGBA - TJ.PF_RGBX),
baseName, subsamp, flags);
}
}
}

View File

@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_29) on Thu Dec 15 07:00:40 CST 2011 -->
<!-- Generated by javadoc (build 1.6.0_29) on Sun Dec 18 20:09:44 CST 2011 -->
<TITLE>
All Classes
</TITLE>
<META NAME="date" CONTENT="2011-12-15">
<META NAME="date" CONTENT="2011-12-18">
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">

View File

@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_29) on Thu Dec 15 07:00:40 CST 2011 -->
<!-- Generated by javadoc (build 1.6.0_29) on Sun Dec 18 20:09:44 CST 2011 -->
<TITLE>
All Classes
</TITLE>
<META NAME="date" CONTENT="2011-12-15">
<META NAME="date" CONTENT="2011-12-18">
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">

View File

@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_29) on Thu Dec 15 07:00:40 CST 2011 -->
<!-- Generated by javadoc (build 1.6.0_29) on Sun Dec 18 20:09:44 CST 2011 -->
<TITLE>
Constant Field Values
</TITLE>
<META NAME="date" CONTENT="2011-12-15">
<META NAME="date" CONTENT="2011-12-18">
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
@@ -140,7 +140,7 @@ org.libjpegturbo.*</FONT></TH>
<A NAME="org.libjpegturbo.turbojpeg.TJ.NUMPF"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
<CODE>public&nbsp;static&nbsp;final&nbsp;int</CODE></FONT></TD>
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#NUMPF">NUMPF</A></CODE></TD>
<TD ALIGN="right"><CODE>7</CODE></TD>
<TD ALIGN="right"><CODE>11</CODE></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<A NAME="org.libjpegturbo.turbojpeg.TJ.NUMSAMP"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
@@ -149,12 +149,30 @@ org.libjpegturbo.*</FONT></TH>
<TD ALIGN="right"><CODE>5</CODE></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<A NAME="org.libjpegturbo.turbojpeg.TJ.PF_ABGR"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
<CODE>public&nbsp;static&nbsp;final&nbsp;int</CODE></FONT></TD>
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#PF_ABGR">PF_ABGR</A></CODE></TD>
<TD ALIGN="right"><CODE>9</CODE></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<A NAME="org.libjpegturbo.turbojpeg.TJ.PF_ARGB"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
<CODE>public&nbsp;static&nbsp;final&nbsp;int</CODE></FONT></TD>
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#PF_ARGB">PF_ARGB</A></CODE></TD>
<TD ALIGN="right"><CODE>10</CODE></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<A NAME="org.libjpegturbo.turbojpeg.TJ.PF_BGR"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
<CODE>public&nbsp;static&nbsp;final&nbsp;int</CODE></FONT></TD>
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#PF_BGR">PF_BGR</A></CODE></TD>
<TD ALIGN="right"><CODE>1</CODE></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<A NAME="org.libjpegturbo.turbojpeg.TJ.PF_BGRA"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
<CODE>public&nbsp;static&nbsp;final&nbsp;int</CODE></FONT></TD>
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#PF_BGRA">PF_BGRA</A></CODE></TD>
<TD ALIGN="right"><CODE>8</CODE></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<A NAME="org.libjpegturbo.turbojpeg.TJ.PF_BGRX"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
<CODE>public&nbsp;static&nbsp;final&nbsp;int</CODE></FONT></TD>
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#PF_BGRX">PF_BGRX</A></CODE></TD>
@@ -173,6 +191,12 @@ org.libjpegturbo.*</FONT></TH>
<TD ALIGN="right"><CODE>0</CODE></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<A NAME="org.libjpegturbo.turbojpeg.TJ.PF_RGBA"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
<CODE>public&nbsp;static&nbsp;final&nbsp;int</CODE></FONT></TD>
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#PF_RGBA">PF_RGBA</A></CODE></TD>
<TD ALIGN="right"><CODE>7</CODE></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<A NAME="org.libjpegturbo.turbojpeg.TJ.PF_RGBX"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
<CODE>public&nbsp;static&nbsp;final&nbsp;int</CODE></FONT></TD>
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#PF_RGBX">PF_RGBX</A></CODE></TD>

View File

@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_29) on Thu Dec 15 07:00:40 CST 2011 -->
<!-- Generated by javadoc (build 1.6.0_29) on Sun Dec 18 20:09:44 CST 2011 -->
<TITLE>
Deprecated List
</TITLE>
<META NAME="date" CONTENT="2011-12-15">
<META NAME="date" CONTENT="2011-12-18">
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">

View File

@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_29) on Thu Dec 15 07:00:40 CST 2011 -->
<!-- Generated by javadoc (build 1.6.0_29) on Sun Dec 18 20:09:44 CST 2011 -->
<TITLE>
API Help
</TITLE>
<META NAME="date" CONTENT="2011-12-15">
<META NAME="date" CONTENT="2011-12-18">
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">

View File

@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_29) on Thu Dec 15 07:00:40 CST 2011 -->
<!-- Generated by javadoc (build 1.6.0_29) on Sun Dec 18 20:09:44 CST 2011 -->
<TITLE>
Index
</TITLE>
<META NAME="date" CONTENT="2011-12-15">
<META NAME="date" CONTENT="2011-12-18">
<LINK REL ="stylesheet" TYPE="text/css" HREF="./stylesheet.css" TITLE="Style">
@@ -404,9 +404,18 @@ Variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojp
<A NAME="_P_"><!-- --></A><H2>
<B>P</B></H2>
<DL>
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJ.html#PF_ABGR"><B>PF_ABGR</B></A> -
Static variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</A>
<DD>ABGR pixel format.
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJ.html#PF_ARGB"><B>PF_ARGB</B></A> -
Static variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</A>
<DD>ARGB pixel format.
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJ.html#PF_BGR"><B>PF_BGR</B></A> -
Static variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</A>
<DD>BGR pixel format.
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJ.html#PF_BGRA"><B>PF_BGRA</B></A> -
Static variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</A>
<DD>BGRA pixel format.
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJ.html#PF_BGRX"><B>PF_BGRX</B></A> -
Static variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</A>
<DD>BGRX pixel format.
@@ -416,6 +425,9 @@ Static variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJ.html#PF_RGB"><B>PF_RGB</B></A> -
Static variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</A>
<DD>RGB pixel format.
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJ.html#PF_RGBA"><B>PF_RGBA</B></A> -
Static variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</A>
<DD>RGBA pixel format.
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJ.html#PF_RGBX"><B>PF_RGBX</B></A> -
Static variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</A>
<DD>RGBX pixel format.

View File

@@ -2,7 +2,7 @@
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc on Thu Dec 15 07:00:40 CST 2011-->
<!-- Generated by javadoc on Sun Dec 18 20:09:44 CST 2011-->
<TITLE>
Generated Documentation (Untitled)
</TITLE>

View File

@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_29) on Thu Dec 15 07:00:40 CST 2011 -->
<!-- Generated by javadoc (build 1.6.0_29) on Sun Dec 18 20:09:44 CST 2011 -->
<TITLE>
TJ
</TITLE>
<META NAME="date" CONTENT="2011-12-15">
<META NAME="date" CONTENT="2011-12-18">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
@@ -187,6 +187,22 @@ TurboJPEG utility class (cannot be instantiated)
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html#PF_ABGR">PF_ABGR</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ABGR pixel format.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html#PF_ARGB">PF_ARGB</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ARGB pixel format.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html#PF_BGR">PF_BGR</A></B></CODE>
<BR>
@@ -195,6 +211,14 @@ TurboJPEG utility class (cannot be instantiated)
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html#PF_BGRA">PF_BGRA</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;BGRA pixel format.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html#PF_BGRX">PF_BGRX</A></B></CODE>
<BR>
@@ -219,6 +243,14 @@ TurboJPEG utility class (cannot be instantiated)
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html#PF_RGBA">PF_RGBA</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RGBA pixel format.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html#PF_RGBX">PF_RGBX</A></B></CODE>
<BR>
@@ -538,7 +570,8 @@ public static final int <B>PF_RGBX</B></PRE>
<DL>
<DD>RGBX pixel format. The red, green, and blue components in the image are
stored in 4-byte pixels in the order R, G, B from lowest to highest byte
address within each pixel.
address within each pixel. The X component is ignored when compressing
and undefined when decompressing.
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.PF_RGBX">Constant Field Values</A></DL>
@@ -552,7 +585,8 @@ public static final int <B>PF_BGRX</B></PRE>
<DL>
<DD>BGRX pixel format. The red, green, and blue components in the image are
stored in 4-byte pixels in the order B, G, R from lowest to highest byte
address within each pixel.
address within each pixel. The X component is ignored when compressing
and undefined when decompressing.
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.PF_BGRX">Constant Field Values</A></DL>
@@ -566,7 +600,8 @@ public static final int <B>PF_XBGR</B></PRE>
<DL>
<DD>XBGR pixel format. The red, green, and blue components in the image are
stored in 4-byte pixels in the order R, G, B from highest to lowest byte
address within each pixel.
address within each pixel. The X component is ignored when compressing
and undefined when decompressing.
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.PF_XBGR">Constant Field Values</A></DL>
@@ -580,7 +615,8 @@ public static final int <B>PF_XRGB</B></PRE>
<DL>
<DD>XRGB pixel format. The red, green, and blue components in the image are
stored in 4-byte pixels in the order B, G, R from highest to lowest byte
address within each pixel.
address within each pixel. The X component is ignored when compressing
and undefined when decompressing.
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.PF_XRGB">Constant Field Values</A></DL>
@@ -600,6 +636,62 @@ public static final int <B>PF_GRAY</B></PRE>
</DL>
<HR>
<A NAME="PF_RGBA"><!-- --></A><H3>
PF_RGBA</H3>
<PRE>
public static final int <B>PF_RGBA</B></PRE>
<DL>
<DD>RGBA pixel format. This is the same as <A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html#PF_RGBX"><CODE>PF_RGBX</CODE></A>, except that when
decompressing, the X byte is guaranteed to be 0xFF, which can be
interpreted as an opaque alpha channel.
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.PF_RGBA">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="PF_BGRA"><!-- --></A><H3>
PF_BGRA</H3>
<PRE>
public static final int <B>PF_BGRA</B></PRE>
<DL>
<DD>BGRA pixel format. This is the same as <A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html#PF_BGRX"><CODE>PF_BGRX</CODE></A>, except that when
decompressing, the X byte is guaranteed to be 0xFF, which can be
interpreted as an opaque alpha channel.
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.PF_BGRA">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="PF_ABGR"><!-- --></A><H3>
PF_ABGR</H3>
<PRE>
public static final int <B>PF_ABGR</B></PRE>
<DL>
<DD>ABGR pixel format. This is the same as <A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html#PF_XBGR"><CODE>PF_XBGR</CODE></A>, except that when
decompressing, the X byte is guaranteed to be 0xFF, which can be
interpreted as an opaque alpha channel.
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.PF_ABGR">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="PF_ARGB"><!-- --></A><H3>
PF_ARGB</H3>
<PRE>
public static final int <B>PF_ARGB</B></PRE>
<DL>
<DD>ARGB pixel format. This is the same as <A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html#PF_XRGB"><CODE>PF_XRGB</CODE></A>, except that when
decompressing, the X byte is guaranteed to be 0xFF, which can be
interpreted as an opaque alpha channel.
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.PF_ARGB">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="FLAG_BOTTOMUP"><!-- --></A><H3>
FLAG_BOTTOMUP</H3>
<PRE>

View File

@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_29) on Thu Dec 15 07:00:40 CST 2011 -->
<!-- Generated by javadoc (build 1.6.0_29) on Sun Dec 18 20:09:44 CST 2011 -->
<TITLE>
TJCompressor
</TITLE>
<META NAME="date" CONTENT="2011-12-15">
<META NAME="date" CONTENT="2011-12-18">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">

View File

@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_29) on Thu Dec 15 07:00:40 CST 2011 -->
<!-- Generated by javadoc (build 1.6.0_29) on Sun Dec 18 20:09:44 CST 2011 -->
<TITLE>
TJCustomFilter
</TITLE>
<META NAME="date" CONTENT="2011-12-15">
<META NAME="date" CONTENT="2011-12-18">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">

View File

@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_29) on Thu Dec 15 07:00:40 CST 2011 -->
<!-- Generated by javadoc (build 1.6.0_29) on Sun Dec 18 20:09:44 CST 2011 -->
<TITLE>
TJDecompressor
</TITLE>
<META NAME="date" CONTENT="2011-12-15">
<META NAME="date" CONTENT="2011-12-18">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">

View File

@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_29) on Thu Dec 15 07:00:40 CST 2011 -->
<!-- Generated by javadoc (build 1.6.0_29) on Sun Dec 18 20:09:44 CST 2011 -->
<TITLE>
TJScalingFactor
</TITLE>
<META NAME="date" CONTENT="2011-12-15">
<META NAME="date" CONTENT="2011-12-18">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">

View File

@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_29) on Thu Dec 15 07:00:40 CST 2011 -->
<!-- Generated by javadoc (build 1.6.0_29) on Sun Dec 18 20:09:44 CST 2011 -->
<TITLE>
TJTransform
</TITLE>
<META NAME="date" CONTENT="2011-12-15">
<META NAME="date" CONTENT="2011-12-18">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">

View File

@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_29) on Thu Dec 15 07:00:40 CST 2011 -->
<!-- Generated by javadoc (build 1.6.0_29) on Sun Dec 18 20:09:44 CST 2011 -->
<TITLE>
TJTransformer
</TITLE>
<META NAME="date" CONTENT="2011-12-15">
<META NAME="date" CONTENT="2011-12-18">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">

View File

@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_29) on Thu Dec 15 07:00:40 CST 2011 -->
<!-- Generated by javadoc (build 1.6.0_29) on Sun Dec 18 20:09:44 CST 2011 -->
<TITLE>
org.libjpegturbo.turbojpeg
</TITLE>
<META NAME="date" CONTENT="2011-12-15">
<META NAME="date" CONTENT="2011-12-18">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">

View File

@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_29) on Thu Dec 15 07:00:40 CST 2011 -->
<!-- Generated by javadoc (build 1.6.0_29) on Sun Dec 18 20:09:44 CST 2011 -->
<TITLE>
org.libjpegturbo.turbojpeg
</TITLE>
<META NAME="date" CONTENT="2011-12-15">
<META NAME="date" CONTENT="2011-12-18">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">

View File

@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_29) on Thu Dec 15 07:00:40 CST 2011 -->
<!-- Generated by javadoc (build 1.6.0_29) on Sun Dec 18 20:09:44 CST 2011 -->
<TITLE>
org.libjpegturbo.turbojpeg Class Hierarchy
</TITLE>
<META NAME="date" CONTENT="2011-12-15">
<META NAME="date" CONTENT="2011-12-18">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">

View File

@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_29) on Thu Dec 15 07:00:40 CST 2011 -->
<!-- Generated by javadoc (build 1.6.0_29) on Sun Dec 18 20:09:44 CST 2011 -->
<TITLE>
Class Hierarchy
</TITLE>
<META NAME="date" CONTENT="2011-12-15">
<META NAME="date" CONTENT="2011-12-18">
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">

View File

@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_29) on Thu Dec 15 07:00:40 CST 2011 -->
<!-- Generated by javadoc (build 1.6.0_29) on Sun Dec 18 20:09:44 CST 2011 -->
<TITLE>
Serialized Form
</TITLE>
<META NAME="date" CONTENT="2011-12-15">
<META NAME="date" CONTENT="2011-12-18">
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">

View File

@@ -109,7 +109,7 @@ final public class TJ {
/**
* The number of pixel formats
*/
final public static int NUMPF = 7;
final public static int NUMPF = 11;
/**
* RGB pixel format. The red, green, and blue components in the image are
* stored in 3-byte pixels in the order R, G, B from lowest to highest byte
@@ -125,25 +125,29 @@ final public class TJ {
/**
* RGBX pixel format. The red, green, and blue components in the image are
* stored in 4-byte pixels in the order R, G, B from lowest to highest byte
* address within each pixel.
* address within each pixel. The X component is ignored when compressing
* and undefined when decompressing.
*/
final public static int PF_RGBX = 2;
/**
* BGRX pixel format. The red, green, and blue components in the image are
* stored in 4-byte pixels in the order B, G, R from lowest to highest byte
* address within each pixel.
* address within each pixel. The X component is ignored when compressing
* and undefined when decompressing.
*/
final public static int PF_BGRX = 3;
/**
* XBGR pixel format. The red, green, and blue components in the image are
* stored in 4-byte pixels in the order R, G, B from highest to lowest byte
* address within each pixel.
* address within each pixel. The X component is ignored when compressing
* and undefined when decompressing.
*/
final public static int PF_XBGR = 4;
/**
* XRGB pixel format. The red, green, and blue components in the image are
* stored in 4-byte pixels in the order B, G, R from highest to lowest byte
* address within each pixel.
* address within each pixel. The X component is ignored when compressing
* and undefined when decompressing.
*/
final public static int PF_XRGB = 5;
/**
@@ -151,6 +155,30 @@ final public class TJ {
* (brightness) level from 0 to 255.
*/
final public static int PF_GRAY = 6;
/**
* RGBA pixel format. This is the same as {@link #PF_RGBX}, except that when
* decompressing, the X byte is guaranteed to be 0xFF, which can be
* interpreted as an opaque alpha channel.
*/
final public static int PF_RGBA = 7;
/**
* BGRA pixel format. This is the same as {@link #PF_BGRX}, except that when
* decompressing, the X byte is guaranteed to be 0xFF, which can be
* interpreted as an opaque alpha channel.
*/
final public static int PF_BGRA = 8;
/**
* ABGR pixel format. This is the same as {@link #PF_XBGR}, except that when
* decompressing, the X byte is guaranteed to be 0xFF, which can be
* interpreted as an opaque alpha channel.
*/
final public static int PF_ABGR = 9;
/**
* ARGB pixel format. This is the same as {@link #PF_XRGB}, except that when
* decompressing, the X byte is guaranteed to be 0xFF, which can be
* interpreted as an opaque alpha channel.
*/
final public static int PF_ARGB = 10;
/**
@@ -167,7 +195,7 @@ final public class TJ {
}
final private static int pixelSize[] = {
3, 3, 4, 4, 4, 4, 1
3, 3, 4, 4, 4, 4, 1, 4, 4, 4, 4
};
@@ -189,7 +217,7 @@ final public class TJ {
}
final private static int redOffset[] = {
0, 2, 0, 2, 3, 1, 0
0, 2, 0, 2, 3, 1, 0, 0, 2, 3, 1
};
@@ -211,7 +239,7 @@ final public class TJ {
}
final private static int greenOffset[] = {
1, 1, 1, 1, 2, 2, 0
1, 1, 1, 1, 2, 2, 0, 1, 1, 2, 2
};
@@ -233,7 +261,7 @@ final public class TJ {
}
final private static int blueOffset[] = {
2, 0, 2, 0, 1, 3, 0
2, 0, 2, 0, 1, 3, 0, 2, 0, 1, 3
};

View File

@@ -399,13 +399,18 @@ public class TJDecompressor {
pixelFormat = TJ.PF_RGBX;
intPixels = true; break;
case BufferedImage.TYPE_INT_RGB:
case BufferedImage.TYPE_INT_ARGB:
case BufferedImage.TYPE_INT_ARGB_PRE:
if(byteOrder == ByteOrder.BIG_ENDIAN)
pixelFormat = TJ.PF_XRGB;
else
pixelFormat = TJ.PF_BGRX;
intPixels = true; break;
case BufferedImage.TYPE_INT_ARGB:
case BufferedImage.TYPE_INT_ARGB_PRE:
if(byteOrder == ByteOrder.BIG_ENDIAN)
pixelFormat = TJ.PF_ARGB;
else
pixelFormat = TJ.PF_BGRA;
intPixels = true; break;
default:
throw new Exception("Unsupported BufferedImage format");
}

View File

@@ -20,7 +20,7 @@ extern "C" {
#undef org_libjpegturbo_turbojpeg_TJ_SAMP_440
#define org_libjpegturbo_turbojpeg_TJ_SAMP_440 4L
#undef org_libjpegturbo_turbojpeg_TJ_NUMPF
#define org_libjpegturbo_turbojpeg_TJ_NUMPF 7L
#define org_libjpegturbo_turbojpeg_TJ_NUMPF 11L
#undef org_libjpegturbo_turbojpeg_TJ_PF_RGB
#define org_libjpegturbo_turbojpeg_TJ_PF_RGB 0L
#undef org_libjpegturbo_turbojpeg_TJ_PF_BGR
@@ -35,6 +35,14 @@ extern "C" {
#define org_libjpegturbo_turbojpeg_TJ_PF_XRGB 5L
#undef org_libjpegturbo_turbojpeg_TJ_PF_GRAY
#define org_libjpegturbo_turbojpeg_TJ_PF_GRAY 6L
#undef org_libjpegturbo_turbojpeg_TJ_PF_RGBA
#define org_libjpegturbo_turbojpeg_TJ_PF_RGBA 7L
#undef org_libjpegturbo_turbojpeg_TJ_PF_BGRA
#define org_libjpegturbo_turbojpeg_TJ_PF_BGRA 8L
#undef org_libjpegturbo_turbojpeg_TJ_PF_ABGR
#define org_libjpegturbo_turbojpeg_TJ_PF_ABGR 9L
#undef org_libjpegturbo_turbojpeg_TJ_PF_ARGB
#define org_libjpegturbo_turbojpeg_TJ_PF_ARGB 10L
#undef org_libjpegturbo_turbojpeg_TJ_FLAG_BOTTOMUP
#define org_libjpegturbo_turbojpeg_TJ_FLAG_BOTTOMUP 2L
#undef org_libjpegturbo_turbojpeg_TJ_FLAG_FORCEMMX

View File

@@ -225,6 +225,7 @@ rgb_ycc_convert (j_compress_ptr cinfo,
num_rows);
break;
case JCS_EXT_RGBX:
case JCS_EXT_RGBA:
extrgbx_ycc_convert_internal(cinfo, input_buf, output_buf, output_row,
num_rows);
break;
@@ -233,14 +234,17 @@ rgb_ycc_convert (j_compress_ptr cinfo,
num_rows);
break;
case JCS_EXT_BGRX:
case JCS_EXT_BGRA:
extbgrx_ycc_convert_internal(cinfo, input_buf, output_buf, output_row,
num_rows);
break;
case JCS_EXT_XBGR:
case JCS_EXT_ABGR:
extxbgr_ycc_convert_internal(cinfo, input_buf, output_buf, output_row,
num_rows);
break;
case JCS_EXT_XRGB:
case JCS_EXT_ARGB:
extxrgb_ycc_convert_internal(cinfo, input_buf, output_buf, output_row,
num_rows);
break;
@@ -270,6 +274,7 @@ rgb_gray_convert (j_compress_ptr cinfo,
num_rows);
break;
case JCS_EXT_RGBX:
case JCS_EXT_RGBA:
extrgbx_gray_convert_internal(cinfo, input_buf, output_buf, output_row,
num_rows);
break;
@@ -278,14 +283,17 @@ rgb_gray_convert (j_compress_ptr cinfo,
num_rows);
break;
case JCS_EXT_BGRX:
case JCS_EXT_BGRA:
extbgrx_gray_convert_internal(cinfo, input_buf, output_buf, output_row,
num_rows);
break;
case JCS_EXT_XBGR:
case JCS_EXT_ABGR:
extxbgr_gray_convert_internal(cinfo, input_buf, output_buf, output_row,
num_rows);
break;
case JCS_EXT_XRGB:
case JCS_EXT_ARGB:
extxrgb_gray_convert_internal(cinfo, input_buf, output_buf, output_row,
num_rows);
break;
@@ -458,6 +466,10 @@ jinit_color_converter (j_compress_ptr cinfo)
case JCS_EXT_BGRX:
case JCS_EXT_XBGR:
case JCS_EXT_XRGB:
case JCS_EXT_RGBA:
case JCS_EXT_BGRA:
case JCS_EXT_ABGR:
case JCS_EXT_ARGB:
if (cinfo->input_components != rgb_pixelsize[cinfo->in_color_space])
ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);
break;
@@ -492,7 +504,11 @@ jinit_color_converter (j_compress_ptr cinfo)
cinfo->in_color_space == JCS_EXT_BGR ||
cinfo->in_color_space == JCS_EXT_BGRX ||
cinfo->in_color_space == JCS_EXT_XBGR ||
cinfo->in_color_space == JCS_EXT_XRGB) {
cinfo->in_color_space == JCS_EXT_XRGB ||
cinfo->in_color_space == JCS_EXT_RGBA ||
cinfo->in_color_space == JCS_EXT_BGRA ||
cinfo->in_color_space == JCS_EXT_ABGR ||
cinfo->in_color_space == JCS_EXT_ARGB) {
if (jsimd_can_rgb_gray())
cconvert->pub.color_convert = jsimd_rgb_gray_convert;
else {
@@ -512,6 +528,10 @@ jinit_color_converter (j_compress_ptr cinfo)
case JCS_EXT_BGRX:
case JCS_EXT_XBGR:
case JCS_EXT_XRGB:
case JCS_EXT_RGBA:
case JCS_EXT_BGRA:
case JCS_EXT_ABGR:
case JCS_EXT_ARGB:
if (cinfo->num_components != 3)
ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
if (cinfo->in_color_space == cinfo->jpeg_color_space &&
@@ -530,7 +550,11 @@ jinit_color_converter (j_compress_ptr cinfo)
cinfo->in_color_space == JCS_EXT_BGR ||
cinfo->in_color_space == JCS_EXT_BGRX ||
cinfo->in_color_space == JCS_EXT_XBGR ||
cinfo->in_color_space == JCS_EXT_XRGB) {
cinfo->in_color_space == JCS_EXT_XRGB ||
cinfo->in_color_space == JCS_EXT_RGBA ||
cinfo->in_color_space == JCS_EXT_BGRA ||
cinfo->in_color_space == JCS_EXT_ABGR ||
cinfo->in_color_space == JCS_EXT_ARGB) {
if (jsimd_can_rgb_ycc())
cconvert->pub.color_convert = jsimd_rgb_ycc_convert;
else {

View File

@@ -3,7 +3,7 @@
*
* Copyright (C) 1991-1998, Thomas G. Lane.
* Modified 2003-2008 by Guido Vollbeding.
* Copyright (C) 2009-2010, D. R. Commander.
* Copyright (C) 2009-2011, D. R. Commander.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@@ -398,6 +398,10 @@ jpeg_default_colorspace (j_compress_ptr cinfo)
case JCS_EXT_BGRX:
case JCS_EXT_XBGR:
case JCS_EXT_XRGB:
case JCS_EXT_RGBA:
case JCS_EXT_BGRA:
case JCS_EXT_ABGR:
case JCS_EXT_ARGB:
jpeg_set_colorspace(cinfo, JCS_YCbCr);
break;
case JCS_YCbCr:

View File

@@ -224,6 +224,7 @@ ycc_rgb_convert (j_decompress_ptr cinfo,
num_rows);
break;
case JCS_EXT_RGBX:
case JCS_EXT_RGBA:
ycc_extrgbx_convert_internal(cinfo, input_buf, input_row, output_buf,
num_rows);
break;
@@ -232,14 +233,17 @@ ycc_rgb_convert (j_decompress_ptr cinfo,
num_rows);
break;
case JCS_EXT_BGRX:
case JCS_EXT_BGRA:
ycc_extbgrx_convert_internal(cinfo, input_buf, input_row, output_buf,
num_rows);
break;
case JCS_EXT_XBGR:
case JCS_EXT_ABGR:
ycc_extxbgr_convert_internal(cinfo, input_buf, input_row, output_buf,
num_rows);
break;
case JCS_EXT_XRGB:
case JCS_EXT_ARGB:
ycc_extxrgb_convert_internal(cinfo, input_buf, input_row, output_buf,
num_rows);
break;
@@ -316,6 +320,7 @@ gray_rgb_convert (j_decompress_ptr cinfo,
num_rows);
break;
case JCS_EXT_RGBX:
case JCS_EXT_RGBA:
gray_extrgbx_convert_internal(cinfo, input_buf, input_row, output_buf,
num_rows);
break;
@@ -324,14 +329,17 @@ gray_rgb_convert (j_decompress_ptr cinfo,
num_rows);
break;
case JCS_EXT_BGRX:
case JCS_EXT_BGRA:
gray_extbgrx_convert_internal(cinfo, input_buf, input_row, output_buf,
num_rows);
break;
case JCS_EXT_XBGR:
case JCS_EXT_ABGR:
gray_extxbgr_convert_internal(cinfo, input_buf, input_row, output_buf,
num_rows);
break;
case JCS_EXT_XRGB:
case JCS_EXT_ARGB:
gray_extxrgb_convert_internal(cinfo, input_buf, input_row, output_buf,
num_rows);
break;
@@ -471,6 +479,10 @@ jinit_color_deconverter (j_decompress_ptr cinfo)
case JCS_EXT_BGRX:
case JCS_EXT_XBGR:
case JCS_EXT_XRGB:
case JCS_EXT_RGBA:
case JCS_EXT_BGRA:
case JCS_EXT_ABGR:
case JCS_EXT_ARGB:
cinfo->out_color_components = rgb_pixelsize[cinfo->out_color_space];
if (cinfo->jpeg_color_space == JCS_YCbCr) {
if (jsimd_can_ycc_rgb())

View File

@@ -2,7 +2,7 @@
* jdmaster.c
*
* Copyright (C) 1991-1997, Thomas G. Lane.
* Copyright (C) 2009-2010, D. R. Commander.
* Copyright (C) 2009-2011, D. R. Commander.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@@ -57,7 +57,11 @@ use_merged_upsample (j_decompress_ptr cinfo)
cinfo->out_color_space != JCS_EXT_BGR &&
cinfo->out_color_space != JCS_EXT_BGRX &&
cinfo->out_color_space != JCS_EXT_XBGR &&
cinfo->out_color_space != JCS_EXT_XRGB) ||
cinfo->out_color_space != JCS_EXT_XRGB &&
cinfo->out_color_space != JCS_EXT_RGBA &&
cinfo->out_color_space != JCS_EXT_BGRA &&
cinfo->out_color_space != JCS_EXT_ABGR &&
cinfo->out_color_space != JCS_EXT_ARGB) ||
cinfo->out_color_components != rgb_pixelsize[cinfo->out_color_space])
return FALSE;
/* and it only handles 2h1v or 2h2v sampling ratios */
@@ -209,6 +213,10 @@ jpeg_calc_output_dimensions (j_decompress_ptr cinfo)
case JCS_EXT_BGRX:
case JCS_EXT_XBGR:
case JCS_EXT_XRGB:
case JCS_EXT_RGBA:
case JCS_EXT_BGRA:
case JCS_EXT_ABGR:
case JCS_EXT_ARGB:
cinfo->out_color_components = rgb_pixelsize[cinfo->out_color_space];
break;
case JCS_YCbCr:

View File

@@ -329,6 +329,7 @@ h2v1_merged_upsample (j_decompress_ptr cinfo,
output_buf);
break;
case JCS_EXT_RGBX:
case JCS_EXT_RGBA:
extrgbx_h2v1_merged_upsample_internal(cinfo, input_buf, in_row_group_ctr,
output_buf);
break;
@@ -337,14 +338,17 @@ h2v1_merged_upsample (j_decompress_ptr cinfo,
output_buf);
break;
case JCS_EXT_BGRX:
case JCS_EXT_BGRA:
extbgrx_h2v1_merged_upsample_internal(cinfo, input_buf, in_row_group_ctr,
output_buf);
break;
case JCS_EXT_XBGR:
case JCS_EXT_ABGR:
extxbgr_h2v1_merged_upsample_internal(cinfo, input_buf, in_row_group_ctr,
output_buf);
break;
case JCS_EXT_XRGB:
case JCS_EXT_ARGB:
extxrgb_h2v1_merged_upsample_internal(cinfo, input_buf, in_row_group_ctr,
output_buf);
break;
@@ -371,6 +375,7 @@ h2v2_merged_upsample (j_decompress_ptr cinfo,
output_buf);
break;
case JCS_EXT_RGBX:
case JCS_EXT_RGBA:
extrgbx_h2v2_merged_upsample_internal(cinfo, input_buf, in_row_group_ctr,
output_buf);
break;
@@ -379,14 +384,17 @@ h2v2_merged_upsample (j_decompress_ptr cinfo,
output_buf);
break;
case JCS_EXT_BGRX:
case JCS_EXT_BGRA:
extbgrx_h2v2_merged_upsample_internal(cinfo, input_buf, in_row_group_ctr,
output_buf);
break;
case JCS_EXT_XBGR:
case JCS_EXT_ABGR:
extxbgr_h2v2_merged_upsample_internal(cinfo, input_buf, in_row_group_ctr,
output_buf);
break;
case JCS_EXT_XRGB:
case JCS_EXT_ARGB:
extxrgb_h2v2_merged_upsample_internal(cinfo, input_buf, in_row_group_ctr,
output_buf);
break;

View File

@@ -2,7 +2,7 @@
* jmorecfg.h
*
* Copyright (C) 1991-1997, Thomas G. Lane.
* Copyright (C) 2009, D. R. Commander.
* Copyright (C) 2009, 2011, D. R. Commander.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@@ -313,7 +313,7 @@ typedef int boolean;
#define RGB_BLUE 2 /* Offset of Blue */
#define RGB_PIXELSIZE 3 /* JSAMPLEs per RGB scanline element */
#define JPEG_NUMCS 12
#define JPEG_NUMCS 16
#define EXT_RGB_RED 0
#define EXT_RGB_GREEN 1
@@ -347,22 +347,26 @@ typedef int boolean;
static const int rgb_red[JPEG_NUMCS] = {
-1, -1, RGB_RED, -1, -1, -1, EXT_RGB_RED, EXT_RGBX_RED,
EXT_BGR_RED, EXT_BGRX_RED, EXT_XBGR_RED, EXT_XRGB_RED
EXT_BGR_RED, EXT_BGRX_RED, EXT_XBGR_RED, EXT_XRGB_RED,
EXT_RGBX_RED, EXT_BGRX_RED, EXT_XBGR_RED, EXT_XRGB_RED
};
static const int rgb_green[JPEG_NUMCS] = {
-1, -1, RGB_GREEN, -1, -1, -1, EXT_RGB_GREEN, EXT_RGBX_GREEN,
EXT_BGR_GREEN, EXT_BGRX_GREEN, EXT_XBGR_GREEN, EXT_XRGB_GREEN
EXT_BGR_GREEN, EXT_BGRX_GREEN, EXT_XBGR_GREEN, EXT_XRGB_GREEN,
EXT_RGBX_GREEN, EXT_BGRX_GREEN, EXT_XBGR_GREEN, EXT_XRGB_GREEN
};
static const int rgb_blue[JPEG_NUMCS] = {
-1, -1, RGB_BLUE, -1, -1, -1, EXT_RGB_BLUE, EXT_RGBX_BLUE,
EXT_BGR_BLUE, EXT_BGRX_BLUE, EXT_XBGR_BLUE, EXT_XRGB_BLUE
EXT_BGR_BLUE, EXT_BGRX_BLUE, EXT_XBGR_BLUE, EXT_XRGB_BLUE,
EXT_RGBX_BLUE, EXT_BGRX_BLUE, EXT_XBGR_BLUE, EXT_XRGB_BLUE
};
static const int rgb_pixelsize[JPEG_NUMCS] = {
-1, -1, RGB_PIXELSIZE, -1, -1, -1, EXT_RGB_PIXELSIZE, EXT_RGBX_PIXELSIZE,
EXT_BGR_PIXELSIZE, EXT_BGRX_PIXELSIZE, EXT_XBGR_PIXELSIZE, EXT_XRGB_PIXELSIZE
EXT_BGR_PIXELSIZE, EXT_BGRX_PIXELSIZE, EXT_XBGR_PIXELSIZE, EXT_XRGB_PIXELSIZE,
EXT_RGBX_PIXELSIZE, EXT_BGRX_PIXELSIZE, EXT_XBGR_PIXELSIZE, EXT_XRGB_PIXELSIZE
};
/* Definitions for speed-related optimizations. */

View File

@@ -3,7 +3,7 @@
*
* Copyright (C) 1991-1998, Thomas G. Lane.
* Modified 2002-2009 by Guido Vollbeding.
* Copyright (C) 2009-2010, D. R. Commander.
* Copyright (C) 2009-2011, D. R. Commander.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@@ -211,12 +211,13 @@ struct jpeg_marker_struct {
/* Known color spaces. */
#define JCS_EXTENSIONS 1
#define JCS_ALPHA_EXTENSIONS 1
typedef enum {
JCS_UNKNOWN, /* error/unspecified */
JCS_GRAYSCALE, /* monochrome */
JCS_RGB, /* red/green/blue as specified by the RGB_RED, RGB_GREEN,
RGB_BLUE, and RGB_PIXELSIZE macros */
RGB_BLUE, and RGB_PIXELSIZE macros */
JCS_YCbCr, /* Y/Cb/Cr (also known as YUV) */
JCS_CMYK, /* C/M/Y/K */
JCS_YCCK, /* Y/Cb/Cr/K */
@@ -225,7 +226,18 @@ typedef enum {
JCS_EXT_BGR, /* blue/green/red */
JCS_EXT_BGRX, /* blue/green/red/x */
JCS_EXT_XBGR, /* x/blue/green/red */
JCS_EXT_XRGB /* x/red/green/blue */
JCS_EXT_XRGB, /* x/red/green/blue */
/* When out_color_space it set to JCS_EXT_RGBX, JCS_EXT_BGRX,
JCS_EXT_XBGR, or JCS_EXT_XRGB 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. Use
the following colorspace constants to ensure that the X byte is set
to 0xFF, so that it can be interpreted as an opaque alpha
channel. */
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 */
} J_COLOR_SPACE;
/* DCT/IDCT algorithm options. */

View File

@@ -189,18 +189,22 @@ jsimd_rgb_ycc_convert (j_compress_ptr cinfo,
neonfct=jsimd_extrgb_ycc_convert_neon;
break;
case JCS_EXT_RGBX:
case JCS_EXT_RGBA:
neonfct=jsimd_extrgbx_ycc_convert_neon;
break;
case JCS_EXT_BGR:
neonfct=jsimd_extbgr_ycc_convert_neon;
break;
case JCS_EXT_BGRX:
case JCS_EXT_BGRA:
neonfct=jsimd_extbgrx_ycc_convert_neon;
break;
case JCS_EXT_XBGR:
case JCS_EXT_ABGR:
neonfct=jsimd_extxbgr_ycc_convert_neon;
break;
case JCS_EXT_XRGB:
case JCS_EXT_ARGB:
neonfct=jsimd_extxrgb_ycc_convert_neon;
break;
default:
@@ -233,18 +237,22 @@ jsimd_ycc_rgb_convert (j_decompress_ptr cinfo,
neonfct=jsimd_ycc_extrgb_convert_neon;
break;
case JCS_EXT_RGBX:
case JCS_EXT_RGBA:
neonfct=jsimd_ycc_extrgbx_convert_neon;
break;
case JCS_EXT_BGR:
neonfct=jsimd_ycc_extbgr_convert_neon;
break;
case JCS_EXT_BGRX:
case JCS_EXT_BGRA:
neonfct=jsimd_ycc_extbgrx_convert_neon;
break;
case JCS_EXT_XBGR:
case JCS_EXT_ABGR:
neonfct=jsimd_ycc_extxbgr_convert_neon;
break;
case JCS_EXT_XRGB:
case JCS_EXT_ARGB:
neonfct=jsimd_ycc_extxrgb_convert_neon;
break;
default:

View File

@@ -142,6 +142,7 @@ jsimd_rgb_ycc_convert (j_compress_ptr cinfo,
mmxfct=jsimd_extrgb_ycc_convert_mmx;
break;
case JCS_EXT_RGBX:
case JCS_EXT_RGBA:
sse2fct=jsimd_extrgbx_ycc_convert_sse2;
mmxfct=jsimd_extrgbx_ycc_convert_mmx;
break;
@@ -150,14 +151,17 @@ jsimd_rgb_ycc_convert (j_compress_ptr cinfo,
mmxfct=jsimd_extbgr_ycc_convert_mmx;
break;
case JCS_EXT_BGRX:
case JCS_EXT_BGRA:
sse2fct=jsimd_extbgrx_ycc_convert_sse2;
mmxfct=jsimd_extbgrx_ycc_convert_mmx;
break;
case JCS_EXT_XBGR:
case JCS_EXT_ABGR:
sse2fct=jsimd_extxbgr_ycc_convert_sse2;
mmxfct=jsimd_extxbgr_ycc_convert_mmx;
break;
case JCS_EXT_XRGB:
case JCS_EXT_ARGB:
sse2fct=jsimd_extxrgb_ycc_convert_sse2;
mmxfct=jsimd_extxrgb_ycc_convert_mmx;
break;
@@ -191,6 +195,7 @@ jsimd_rgb_gray_convert (j_compress_ptr cinfo,
mmxfct=jsimd_extrgb_gray_convert_mmx;
break;
case JCS_EXT_RGBX:
case JCS_EXT_RGBA:
sse2fct=jsimd_extrgbx_gray_convert_sse2;
mmxfct=jsimd_extrgbx_gray_convert_mmx;
break;
@@ -199,14 +204,17 @@ jsimd_rgb_gray_convert (j_compress_ptr cinfo,
mmxfct=jsimd_extbgr_gray_convert_mmx;
break;
case JCS_EXT_BGRX:
case JCS_EXT_BGRA:
sse2fct=jsimd_extbgrx_gray_convert_sse2;
mmxfct=jsimd_extbgrx_gray_convert_mmx;
break;
case JCS_EXT_XBGR:
case JCS_EXT_ABGR:
sse2fct=jsimd_extxbgr_gray_convert_sse2;
mmxfct=jsimd_extxbgr_gray_convert_mmx;
break;
case JCS_EXT_XRGB:
case JCS_EXT_ARGB:
sse2fct=jsimd_extxrgb_gray_convert_sse2;
mmxfct=jsimd_extxrgb_gray_convert_mmx;
break;
@@ -240,6 +248,7 @@ jsimd_ycc_rgb_convert (j_decompress_ptr cinfo,
mmxfct=jsimd_ycc_extrgb_convert_mmx;
break;
case JCS_EXT_RGBX:
case JCS_EXT_RGBA:
sse2fct=jsimd_ycc_extrgbx_convert_sse2;
mmxfct=jsimd_ycc_extrgbx_convert_mmx;
break;
@@ -248,14 +257,17 @@ jsimd_ycc_rgb_convert (j_decompress_ptr cinfo,
mmxfct=jsimd_ycc_extbgr_convert_mmx;
break;
case JCS_EXT_BGRX:
case JCS_EXT_BGRA:
sse2fct=jsimd_ycc_extbgrx_convert_sse2;
mmxfct=jsimd_ycc_extbgrx_convert_mmx;
break;
case JCS_EXT_XBGR:
case JCS_EXT_ABGR:
sse2fct=jsimd_ycc_extxbgr_convert_sse2;
mmxfct=jsimd_ycc_extxbgr_convert_mmx;
break;
case JCS_EXT_XRGB:
case JCS_EXT_ARGB:
sse2fct=jsimd_ycc_extxrgb_convert_sse2;
mmxfct=jsimd_ycc_extxrgb_convert_mmx;
break;
@@ -532,6 +544,7 @@ jsimd_h2v2_merged_upsample (j_decompress_ptr cinfo,
mmxfct=jsimd_h2v2_extrgb_merged_upsample_mmx;
break;
case JCS_EXT_RGBX:
case JCS_EXT_RGBA:
sse2fct=jsimd_h2v2_extrgbx_merged_upsample_sse2;
mmxfct=jsimd_h2v2_extrgbx_merged_upsample_mmx;
break;
@@ -540,14 +553,17 @@ jsimd_h2v2_merged_upsample (j_decompress_ptr cinfo,
mmxfct=jsimd_h2v2_extbgr_merged_upsample_mmx;
break;
case JCS_EXT_BGRX:
case JCS_EXT_BGRA:
sse2fct=jsimd_h2v2_extbgrx_merged_upsample_sse2;
mmxfct=jsimd_h2v2_extbgrx_merged_upsample_mmx;
break;
case JCS_EXT_XBGR:
case JCS_EXT_ABGR:
sse2fct=jsimd_h2v2_extxbgr_merged_upsample_sse2;
mmxfct=jsimd_h2v2_extxbgr_merged_upsample_mmx;
break;
case JCS_EXT_XRGB:
case JCS_EXT_ARGB:
sse2fct=jsimd_h2v2_extxrgb_merged_upsample_sse2;
mmxfct=jsimd_h2v2_extxrgb_merged_upsample_mmx;
break;
@@ -582,6 +598,7 @@ jsimd_h2v1_merged_upsample (j_decompress_ptr cinfo,
mmxfct=jsimd_h2v1_extrgb_merged_upsample_mmx;
break;
case JCS_EXT_RGBX:
case JCS_EXT_RGBA:
sse2fct=jsimd_h2v1_extrgbx_merged_upsample_sse2;
mmxfct=jsimd_h2v1_extrgbx_merged_upsample_mmx;
break;
@@ -590,14 +607,17 @@ jsimd_h2v1_merged_upsample (j_decompress_ptr cinfo,
mmxfct=jsimd_h2v1_extbgr_merged_upsample_mmx;
break;
case JCS_EXT_BGRX:
case JCS_EXT_BGRA:
sse2fct=jsimd_h2v1_extbgrx_merged_upsample_sse2;
mmxfct=jsimd_h2v1_extbgrx_merged_upsample_mmx;
break;
case JCS_EXT_XBGR:
case JCS_EXT_ABGR:
sse2fct=jsimd_h2v1_extxbgr_merged_upsample_sse2;
mmxfct=jsimd_h2v1_extxbgr_merged_upsample_mmx;
break;
case JCS_EXT_XRGB:
case JCS_EXT_ARGB:
sse2fct=jsimd_h2v1_extxrgb_merged_upsample_sse2;
mmxfct=jsimd_h2v1_extxrgb_merged_upsample_mmx;
break;

View File

@@ -93,18 +93,22 @@ jsimd_rgb_ycc_convert (j_compress_ptr cinfo,
sse2fct=jsimd_extrgb_ycc_convert_sse2;
break;
case JCS_EXT_RGBX:
case JCS_EXT_RGBA:
sse2fct=jsimd_extrgbx_ycc_convert_sse2;
break;
case JCS_EXT_BGR:
sse2fct=jsimd_extbgr_ycc_convert_sse2;
break;
case JCS_EXT_BGRX:
case JCS_EXT_BGRA:
sse2fct=jsimd_extbgrx_ycc_convert_sse2;
break;
case JCS_EXT_XBGR:
case JCS_EXT_ABGR:
sse2fct=jsimd_extxbgr_ycc_convert_sse2;
break;
case JCS_EXT_XRGB:
case JCS_EXT_ARGB:
sse2fct=jsimd_extxrgb_ycc_convert_sse2;
break;
default:
@@ -128,18 +132,22 @@ jsimd_rgb_gray_convert (j_compress_ptr cinfo,
sse2fct=jsimd_extrgb_gray_convert_sse2;
break;
case JCS_EXT_RGBX:
case JCS_EXT_RGBA:
sse2fct=jsimd_extrgbx_gray_convert_sse2;
break;
case JCS_EXT_BGR:
sse2fct=jsimd_extbgr_gray_convert_sse2;
break;
case JCS_EXT_BGRX:
case JCS_EXT_BGRA:
sse2fct=jsimd_extbgrx_gray_convert_sse2;
break;
case JCS_EXT_XBGR:
case JCS_EXT_ABGR:
sse2fct=jsimd_extxbgr_gray_convert_sse2;
break;
case JCS_EXT_XRGB:
case JCS_EXT_ARGB:
sse2fct=jsimd_extxrgb_gray_convert_sse2;
break;
default:
@@ -163,18 +171,22 @@ jsimd_ycc_rgb_convert (j_decompress_ptr cinfo,
sse2fct=jsimd_ycc_extrgb_convert_sse2;
break;
case JCS_EXT_RGBX:
case JCS_EXT_RGBA:
sse2fct=jsimd_ycc_extrgbx_convert_sse2;
break;
case JCS_EXT_BGR:
sse2fct=jsimd_ycc_extbgr_convert_sse2;
break;
case JCS_EXT_BGRX:
case JCS_EXT_BGRA:
sse2fct=jsimd_ycc_extbgrx_convert_sse2;
break;
case JCS_EXT_XBGR:
case JCS_EXT_ABGR:
sse2fct=jsimd_ycc_extxbgr_convert_sse2;
break;
case JCS_EXT_XRGB:
case JCS_EXT_ARGB:
sse2fct=jsimd_ycc_extxrgb_convert_sse2;
break;
default:
@@ -373,18 +385,22 @@ jsimd_h2v2_merged_upsample (j_decompress_ptr cinfo,
sse2fct=jsimd_h2v2_extrgb_merged_upsample_sse2;
break;
case JCS_EXT_RGBX:
case JCS_EXT_RGBA:
sse2fct=jsimd_h2v2_extrgbx_merged_upsample_sse2;
break;
case JCS_EXT_BGR:
sse2fct=jsimd_h2v2_extbgr_merged_upsample_sse2;
break;
case JCS_EXT_BGRX:
case JCS_EXT_BGRA:
sse2fct=jsimd_h2v2_extbgrx_merged_upsample_sse2;
break;
case JCS_EXT_XBGR:
case JCS_EXT_ABGR:
sse2fct=jsimd_h2v2_extxbgr_merged_upsample_sse2;
break;
case JCS_EXT_XRGB:
case JCS_EXT_ARGB:
sse2fct=jsimd_h2v2_extxrgb_merged_upsample_sse2;
break;
default:
@@ -409,18 +425,22 @@ jsimd_h2v1_merged_upsample (j_decompress_ptr cinfo,
sse2fct=jsimd_h2v1_extrgb_merged_upsample_sse2;
break;
case JCS_EXT_RGBX:
case JCS_EXT_RGBA:
sse2fct=jsimd_h2v1_extrgbx_merged_upsample_sse2;
break;
case JCS_EXT_BGR:
sse2fct=jsimd_h2v1_extbgr_merged_upsample_sse2;
break;
case JCS_EXT_BGRX:
case JCS_EXT_BGRA:
sse2fct=jsimd_h2v1_extbgrx_merged_upsample_sse2;
break;
case JCS_EXT_XBGR:
case JCS_EXT_ABGR:
sse2fct=jsimd_h2v1_extxbgr_merged_upsample_sse2;
break;
case JCS_EXT_XRGB:
case JCS_EXT_ARGB:
sse2fct=jsimd_h2v1_extxrgb_merged_upsample_sse2;
break;
default:

View File

@@ -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);
}
}

View File

@@ -147,12 +147,16 @@ static int setCompDefaults(struct jpeg_compress_struct *cinfo,
case TJPF_BGR:
cinfo->in_color_space=JCS_EXT_BGR; break;
case TJPF_RGBX:
case TJPF_RGBA:
cinfo->in_color_space=JCS_EXT_RGBX; break;
case TJPF_BGRX:
case TJPF_BGRA:
cinfo->in_color_space=JCS_EXT_BGRX; break;
case TJPF_XRGB:
case TJPF_ARGB:
cinfo->in_color_space=JCS_EXT_XRGB; break;
case TJPF_XBGR:
case TJPF_ABGR:
cinfo->in_color_space=JCS_EXT_XBGR; break;
#else
case TJPF_RGB:
@@ -213,20 +217,28 @@ static int setDecompDefaults(struct jpeg_decompress_struct *dinfo,
dinfo->out_color_space=JCS_EXT_XRGB; break;
case TJPF_XBGR:
dinfo->out_color_space=JCS_EXT_XBGR; break;
#if JCS_ALPHA_EXTENSIONS==1
case TJPF_RGBA:
dinfo->out_color_space=JCS_EXT_RGBA; break;
case TJPF_BGRA:
dinfo->out_color_space=JCS_EXT_BGRA; break;
case TJPF_ARGB:
dinfo->out_color_space=JCS_EXT_ARGB; break;
case TJPF_ABGR:
dinfo->out_color_space=JCS_EXT_ABGR; break;
#endif
#else
case TJPF_RGB:
if(RGB_RED==0 && RGB_GREEN==1 && RGB_BLUE==2 && RGB_PIXELSIZE==3)
{
dinfo->out_color_space=JCS_RGB; break;
}
#endif
default:
_throw("Unsupported pixel format");
#endif
}
#if JCS_EXTENSIONS!=1
bailout:
#endif
return retval;
}

View File

@@ -113,7 +113,7 @@ static const int tjMCUHeight[TJ_NUMSAMP] = {8, 8, 16, 8, 16};
/**
* The number of pixel formats
*/
#define TJ_NUMPF 7
#define TJ_NUMPF 11
/**
* Pixel formats
@@ -135,32 +135,60 @@ enum TJPF
/**
* RGBX pixel format. The red, green, and blue components in the image are
* stored in 4-byte pixels in the order R, G, B from lowest to highest byte
* address within each pixel.
* address within each pixel. The X component is ignored when compressing
* and undefined when decompressing.
*/
TJPF_RGBX,
/**
* BGRX pixel format. The red, green, and blue components in the image are
* stored in 4-byte pixels in the order B, G, R from lowest to highest byte
* address within each pixel.
* address within each pixel. The X component is ignored when compressing
* and undefined when decompressing.
*/
TJPF_BGRX,
/**
* XBGR pixel format. The red, green, and blue components in the image are
* stored in 4-byte pixels in the order R, G, B from highest to lowest byte
* address within each pixel.
* address within each pixel. The X component is ignored when compressing
* and undefined when decompressing.
*/
TJPF_XBGR,
/**
* XRGB pixel format. The red, green, and blue components in the image are
* stored in 4-byte pixels in the order B, G, R from highest to lowest byte
* address within each pixel.
* address within each pixel. The X component is ignored when compressing
* and undefined when decompressing.
*/
TJPF_XRGB,
/**
* Grayscale pixel format. Each 1-byte pixel represents a luminance
* (brightness) level from 0 to 255.
*/
TJPF_GRAY
TJPF_GRAY,
/**
* RGBA pixel format. This is the same as @ref TJPF_RGBX, except that when
* decompressing, the X component is guaranteed to be 0xFF, which can be
* interpreted as an opaque alpha channel.
*/
TJPF_RGBA,
/**
* BGRA pixel format. This is the same as @ref TJPF_BGRX, except that when
* decompressing, the X component is guaranteed to be 0xFF, which can be
* interpreted as an opaque alpha channel.
*/
TJPF_BGRA,
/**
* ABGR pixel format. This is the same as @ref TJPF_XBGR, except that when
* decompressing, the X component is guaranteed to be 0xFF, which can be
* interpreted as an opaque alpha channel.
*/
TJPF_ABGR,
/**
* ARGB pixel format. This is the same as @ref TJPF_XRGB, except that when
* decompressing, the X component is guaranteed to be 0xFF, which can be
* interpreted as an opaque alpha channel.
*/
TJPF_ARGB
};
/**
@@ -169,7 +197,7 @@ enum TJPF
* instance, if a pixel of format TJ_BGRX is stored in <tt>char pixel[]</tt>,
* then the red component will be <tt>pixel[tjRedOffset[TJ_BGRX]]</tt>.
*/
static const int tjRedOffset[TJ_NUMPF] = {0, 2, 0, 2, 3, 1, 0};
static const int tjRedOffset[TJ_NUMPF] = {0, 2, 0, 2, 3, 1, 0, 0, 2, 3, 1};
/**
* Green offset (in bytes) for a given pixel format. This specifies the number
* of bytes that the green component is offset from the start of the pixel.
@@ -177,19 +205,19 @@ static const int tjRedOffset[TJ_NUMPF] = {0, 2, 0, 2, 3, 1, 0};
* <tt>char pixel[]</tt>, then the green component will be
* <tt>pixel[tjGreenOffset[TJ_BGRX]]</tt>.
*/
static const int tjGreenOffset[TJ_NUMPF] = {1, 1, 1, 1, 2, 2, 0};
static const int tjGreenOffset[TJ_NUMPF] = {1, 1, 1, 1, 2, 2, 0, 1, 1, 2, 2};
/**
* Blue offset (in bytes) for a given pixel format. This specifies the number
* of bytes that the Blue component is offset from the start of the pixel. For
* instance, if a pixel of format TJ_BGRX is stored in <tt>char pixel[]</tt>,
* then the blue component will be <tt>pixel[tjBlueOffset[TJ_BGRX]]</tt>.
*/
static const int tjBlueOffset[TJ_NUMPF] = {2, 0, 2, 0, 1, 3, 0};
static const int tjBlueOffset[TJ_NUMPF] = {2, 0, 2, 0, 1, 3, 0, 2, 0, 1, 3};
/**
* Pixel size (in bytes) for a given pixel format.
*/
static const int tjPixelSize[TJ_NUMPF] = {3, 3, 4, 4, 4, 4, 1};
static const int tjPixelSize[TJ_NUMPF] = {3, 3, 4, 4, 4, 4, 1, 4, 4, 4, 4};
/**