[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)
==================
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 */
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
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
=================================
</iframe>
</div>
-<hr class="footer"/><address class="footer"><small>Generated on Thu Dec 15 2011 06:54:38 for TurboJPEG by 
+<hr class="footer"/><address class="footer"><small>Generated on Sun Dec 18 2011 20:09:47 for TurboJPEG by 
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</iframe>
</div>
-<hr class="footer"/><address class="footer"><small>Generated on Thu Dec 15 2011 06:54:38 for TurboJPEG by 
+<hr class="footer"/><address class="footer"><small>Generated on Sun Dec 18 2011 20:09:47 for TurboJPEG by 
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</iframe>
</div>
-<hr class="footer"/><address class="footer"><small>Generated on Thu Dec 15 2011 06:54:38 for TurboJPEG by 
+<hr class="footer"/><address class="footer"><small>Generated on Sun Dec 18 2011 20:09:47 for TurboJPEG by 
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</iframe>
</div>
-<hr class="footer"/><address class="footer"><small>Generated on Thu Dec 15 2011 06:54:38 for TurboJPEG by 
+<hr class="footer"/><address class="footer"><small>Generated on Sun Dec 18 2011 20:09:47 for TurboJPEG by 
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
<br/>
  <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/>
+  <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"> </td><td class="mdescRight">Pixel formats. <a href="group___turbo_j_p_e_g.html#gac916144e26c3817ac514e64ae5d12e2a">More...</a><br/></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> </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> </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> </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> </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> </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> </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> </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> </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> </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>
</iframe>
</div>
-<hr class="footer"/><address class="footer"><small>Generated on Thu Dec 15 2011 06:54:38 for TurboJPEG by 
+<hr class="footer"/><address class="footer"><small>Generated on Sun Dec 18 2011 20:09:47 for TurboJPEG by 
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</iframe>
</div>
-<hr class="footer"/><address class="footer"><small>Generated on Thu Dec 15 2011 06:54:38 for TurboJPEG by 
+<hr class="footer"/><address class="footer"><small>Generated on Sun Dec 18 2011 20:09:47 for TurboJPEG by 
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</iframe>
</div>
-<hr class="footer"/><address class="footer"><small>Generated on Thu Dec 15 2011 06:54:38 for TurboJPEG by 
+<hr class="footer"/><address class="footer"><small>Generated on Sun Dec 18 2011 20:09:47 for TurboJPEG by 
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</iframe>
</div>
-<hr class="footer"/><address class="footer"><small>Generated on Thu Dec 15 2011 06:54:38 for TurboJPEG by 
+<hr class="footer"/><address class="footer"><small>Generated on Sun Dec 18 2011 20:09:47 for TurboJPEG by 
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</iframe>
</div>
-<hr class="footer"/><address class="footer"><small>Generated on Thu Dec 15 2011 06:54:38 for TurboJPEG by 
+<hr class="footer"/><address class="footer"><small>Generated on Sun Dec 18 2011 20:09:47 for TurboJPEG by 
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</iframe>
</div>
-<hr class="footer"/><address class="footer"><small>Generated on Thu Dec 15 2011 06:54:38 for TurboJPEG by 
+<hr class="footer"/><address class="footer"><small>Generated on Sun Dec 18 2011 20:09:47 for TurboJPEG by 
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
};
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[] = {
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;
}
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);
}
}
}
<!--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">
<!--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">
<!--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">
<A NAME="org.libjpegturbo.turbojpeg.TJ.NUMPF"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
<CODE>public static final 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">
<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 static final 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 static final 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 static final 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 static final 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 static final int</CODE></FONT></TD>
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#PF_BGRX">PF_BGRX</A></CODE></TD>
<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 static final 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 static final int</CODE></FONT></TD>
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#PF_RGBX">PF_RGBX</A></CODE></TD>
<!--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">
<!--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">
<!--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">
<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.
<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.
<!--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>
<!--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">
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static int</CODE></FONT></TD>
+<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html#PF_ABGR">PF_ABGR</A></B></CODE>
+
+<BR>
+ ABGR pixel format.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE>static int</CODE></FONT></TD>
+<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html#PF_ARGB">PF_ARGB</A></B></CODE>
+
+<BR>
+ ARGB pixel format.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE>static int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html#PF_BGR">PF_BGR</A></B></CODE>
<BR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static int</CODE></FONT></TD>
+<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html#PF_BGRA">PF_BGRA</A></B></CODE>
+
+<BR>
+ BGRA pixel format.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE>static int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html#PF_BGRX">PF_BGRX</A></B></CODE>
<BR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static int</CODE></FONT></TD>
+<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html#PF_RGBA">PF_RGBA</A></B></CODE>
+
+<BR>
+ RGBA pixel format.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE>static int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html#PF_RGBX">PF_RGBX</A></B></CODE>
<BR>
<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>
<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>
<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>
<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>
</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>
<!--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">
<!--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">
<!--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">
<!--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">
<!--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">
<!--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">
<!--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">
<!--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">
<!--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">
<!--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">
<!--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">
/**
* 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
/**
* 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;
/**
* (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;
/**
}
final private static int pixelSize[] = {
- 3, 3, 4, 4, 4, 4, 1
+ 3, 3, 4, 4, 4, 4, 1, 4, 4, 4, 4
};
}
final private static int redOffset[] = {
- 0, 2, 0, 2, 3, 1, 0
+ 0, 2, 0, 2, 3, 1, 0, 0, 2, 3, 1
};
}
final private static int greenOffset[] = {
- 1, 1, 1, 1, 2, 2, 0
+ 1, 1, 1, 1, 2, 2, 0, 1, 1, 2, 2
};
}
final private static int blueOffset[] = {
- 2, 0, 2, 0, 1, 3, 0
+ 2, 0, 2, 0, 1, 3, 0, 2, 0, 1, 3
};
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");
}
#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
#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
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;
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;
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;
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;
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;
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 {
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 &&
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 {
*
* 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.
*
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:
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;
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;
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;
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;
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())
* 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.
*
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 */
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:
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;
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;
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;
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;
* 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.
*
#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
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. */
*
* 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.
*
/* 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 */
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. */
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:
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:
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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:
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:
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:
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:
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:
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};
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;}
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);
}
}
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:
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;
}
/**
* The number of pixel formats
*/
-#define TJ_NUMPF 7
+#define TJ_NUMPF 11
/**
* Pixel formats
/**
* 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
};
/**
* 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.
* <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};
/**