Added new alpha channel colorspace constants/pixel formats, so applications can specify that they need the unused byte in a 4-component RGB output buffer set to 0xFF when decompressing.
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@732 632fc199-4ca6-4c93-a231-07263d6284db
diff --git a/java/TJUnitTest.java b/java/TJUnitTest.java
index b732930..557a85a 100644
--- a/java/TJUnitTest.java
+++ b/java/TJUnitTest.java
@@ -58,11 +58,12 @@
};
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 @@
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 @@
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);
}
}
}
diff --git a/java/doc/allclasses-frame.html b/java/doc/allclasses-frame.html
index 0932734..a2b0499 100644
--- a/java/doc/allclasses-frame.html
+++ b/java/doc/allclasses-frame.html
@@ -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">
diff --git a/java/doc/allclasses-noframe.html b/java/doc/allclasses-noframe.html
index 0d20a31..e3c96ca 100644
--- a/java/doc/allclasses-noframe.html
+++ b/java/doc/allclasses-noframe.html
@@ -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">
diff --git a/java/doc/constant-values.html b/java/doc/constant-values.html
index a1dc69c..667e3ef 100644
--- a/java/doc/constant-values.html
+++ b/java/doc/constant-values.html
@@ -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 @@
<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">
@@ -149,12 +149,30 @@
<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>
@@ -173,6 +191,12 @@
<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>
diff --git a/java/doc/deprecated-list.html b/java/doc/deprecated-list.html
index 0e1ca19..8654476 100644
--- a/java/doc/deprecated-list.html
+++ b/java/doc/deprecated-list.html
@@ -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">
diff --git a/java/doc/help-doc.html b/java/doc/help-doc.html
index 94aadcc..9d609c3 100644
--- a/java/doc/help-doc.html
+++ b/java/doc/help-doc.html
@@ -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">
diff --git a/java/doc/index-all.html b/java/doc/index-all.html
index 38d328a..1589d6d 100644
--- a/java/doc/index-all.html
+++ b/java/doc/index-all.html
@@ -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 @@
<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 @@
<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.
diff --git a/java/doc/index.html b/java/doc/index.html
index 7d77dc3..8e6f370 100644
--- a/java/doc/index.html
+++ b/java/doc/index.html
@@ -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>
diff --git a/java/doc/org/libjpegturbo/turbojpeg/TJ.html b/java/doc/org/libjpegturbo/turbojpeg/TJ.html
index 756af3e..b3300e2 100644
--- a/java/doc/org/libjpegturbo/turbojpeg/TJ.html
+++ b/java/doc/org/libjpegturbo/turbojpeg/TJ.html
@@ -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 @@
<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>
@@ -195,6 +211,14 @@
<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>
@@ -219,6 +243,14 @@
<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>
@@ -538,7 +570,8 @@
<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 @@
<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 @@
<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 @@
<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 @@
</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>
diff --git a/java/doc/org/libjpegturbo/turbojpeg/TJCompressor.html b/java/doc/org/libjpegturbo/turbojpeg/TJCompressor.html
index de74d4f..ba5b1da 100644
--- a/java/doc/org/libjpegturbo/turbojpeg/TJCompressor.html
+++ b/java/doc/org/libjpegturbo/turbojpeg/TJCompressor.html
@@ -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">
diff --git a/java/doc/org/libjpegturbo/turbojpeg/TJCustomFilter.html b/java/doc/org/libjpegturbo/turbojpeg/TJCustomFilter.html
index e830e89..5a93ded 100644
--- a/java/doc/org/libjpegturbo/turbojpeg/TJCustomFilter.html
+++ b/java/doc/org/libjpegturbo/turbojpeg/TJCustomFilter.html
@@ -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">
diff --git a/java/doc/org/libjpegturbo/turbojpeg/TJDecompressor.html b/java/doc/org/libjpegturbo/turbojpeg/TJDecompressor.html
index c34abac..8eabb59 100644
--- a/java/doc/org/libjpegturbo/turbojpeg/TJDecompressor.html
+++ b/java/doc/org/libjpegturbo/turbojpeg/TJDecompressor.html
@@ -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">
diff --git a/java/doc/org/libjpegturbo/turbojpeg/TJScalingFactor.html b/java/doc/org/libjpegturbo/turbojpeg/TJScalingFactor.html
index febc69f..decf430 100644
--- a/java/doc/org/libjpegturbo/turbojpeg/TJScalingFactor.html
+++ b/java/doc/org/libjpegturbo/turbojpeg/TJScalingFactor.html
@@ -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">
diff --git a/java/doc/org/libjpegturbo/turbojpeg/TJTransform.html b/java/doc/org/libjpegturbo/turbojpeg/TJTransform.html
index a4ff5b8..b207637 100644
--- a/java/doc/org/libjpegturbo/turbojpeg/TJTransform.html
+++ b/java/doc/org/libjpegturbo/turbojpeg/TJTransform.html
@@ -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">
diff --git a/java/doc/org/libjpegturbo/turbojpeg/TJTransformer.html b/java/doc/org/libjpegturbo/turbojpeg/TJTransformer.html
index 75ddc3f..9e74a6e 100644
--- a/java/doc/org/libjpegturbo/turbojpeg/TJTransformer.html
+++ b/java/doc/org/libjpegturbo/turbojpeg/TJTransformer.html
@@ -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">
diff --git a/java/doc/org/libjpegturbo/turbojpeg/package-frame.html b/java/doc/org/libjpegturbo/turbojpeg/package-frame.html
index a63781e..50ede9f 100644
--- a/java/doc/org/libjpegturbo/turbojpeg/package-frame.html
+++ b/java/doc/org/libjpegturbo/turbojpeg/package-frame.html
@@ -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">
diff --git a/java/doc/org/libjpegturbo/turbojpeg/package-summary.html b/java/doc/org/libjpegturbo/turbojpeg/package-summary.html
index 55c74a3..d98f285 100644
--- a/java/doc/org/libjpegturbo/turbojpeg/package-summary.html
+++ b/java/doc/org/libjpegturbo/turbojpeg/package-summary.html
@@ -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">
diff --git a/java/doc/org/libjpegturbo/turbojpeg/package-tree.html b/java/doc/org/libjpegturbo/turbojpeg/package-tree.html
index 30997a6..319c1eb 100644
--- a/java/doc/org/libjpegturbo/turbojpeg/package-tree.html
+++ b/java/doc/org/libjpegturbo/turbojpeg/package-tree.html
@@ -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">
diff --git a/java/doc/overview-tree.html b/java/doc/overview-tree.html
index 37d8cd4..e3839ee 100644
--- a/java/doc/overview-tree.html
+++ b/java/doc/overview-tree.html
@@ -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">
diff --git a/java/doc/serialized-form.html b/java/doc/serialized-form.html
index 41175d6..39ec91f 100644
--- a/java/doc/serialized-form.html
+++ b/java/doc/serialized-form.html
@@ -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">
diff --git a/java/org/libjpegturbo/turbojpeg/TJ.java b/java/org/libjpegturbo/turbojpeg/TJ.java
index cd22ee0..5e0c0b7 100644
--- a/java/org/libjpegturbo/turbojpeg/TJ.java
+++ b/java/org/libjpegturbo/turbojpeg/TJ.java
@@ -109,7 +109,7 @@
/**
* 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 @@
/**
* 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 @@
* (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 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 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 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 private static int blueOffset[] = {
- 2, 0, 2, 0, 1, 3, 0
+ 2, 0, 2, 0, 1, 3, 0, 2, 0, 1, 3
};
diff --git a/java/org/libjpegturbo/turbojpeg/TJDecompressor.java b/java/org/libjpegturbo/turbojpeg/TJDecompressor.java
index 184061b..de6cacc 100644
--- a/java/org/libjpegturbo/turbojpeg/TJDecompressor.java
+++ b/java/org/libjpegturbo/turbojpeg/TJDecompressor.java
@@ -399,13 +399,18 @@
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");
}
diff --git a/java/org_libjpegturbo_turbojpeg_TJ.h b/java/org_libjpegturbo_turbojpeg_TJ.h
index 54479be..c892086 100644
--- a/java/org_libjpegturbo_turbojpeg_TJ.h
+++ b/java/org_libjpegturbo_turbojpeg_TJ.h
@@ -20,7 +20,7 @@
#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 @@
#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