Re-work TJBUFSIZE() to take into account the level of chrominance subsampling
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@668 632fc199-4ca6-4c93-a231-07263d6284db
This commit is contained in:
@@ -682,7 +682,7 @@ public class TJUnitTest {
|
||||
byte[] dstBuf;
|
||||
|
||||
if(yuv == YUVENCODE) dstBuf = new byte[TJ.bufSizeYUV(w, h, subsamp)];
|
||||
else dstBuf = new byte[TJ.bufSize(w, h)];
|
||||
else dstBuf = new byte[TJ.bufSize(w, h, subsamp)];
|
||||
|
||||
try {
|
||||
tjc = new TJCompressor();
|
||||
@@ -726,7 +726,7 @@ public class TJUnitTest {
|
||||
if(h % 100 == 0)
|
||||
System.out.format("%04d x %04d\b\b\b\b\b\b\b\b\b\b\b", w, h);
|
||||
srcBuf = new byte[w * h * 4];
|
||||
jpegBuf = new byte[TJ.bufSize(w, h)];
|
||||
jpegBuf = new byte[TJ.bufSize(w, h, TJ.SAMP_444)];
|
||||
Arrays.fill(srcBuf, (byte)0);
|
||||
for(i = 0; i < w * h; i++) {
|
||||
srcBuf[i * 4] = pixels[i % 9][0];
|
||||
@@ -739,7 +739,7 @@ public class TJUnitTest {
|
||||
tjc.compress(jpegBuf, 0);
|
||||
|
||||
srcBuf = new byte[h * w * 4];
|
||||
jpegBuf = new byte[TJ.bufSize(h, w)];
|
||||
jpegBuf = new byte[TJ.bufSize(h, w, TJ.SAMP_444)];
|
||||
for(i = 0; i < h * w; i++) {
|
||||
if(i % 2 == 0) srcBuf[i * 4] =
|
||||
srcBuf[i * 4 + 1] = srcBuf[i * 4 + 2] = (byte)0xFF;
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
<!--NewPage-->
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<!-- Generated by javadoc (build 1.6.0_24) on Fri Apr 01 20:49:05 CDT 2011 -->
|
||||
<!-- Generated by javadoc (build 1.6.0_26) on Mon Jul 11 21:40:35 CDT 2011 -->
|
||||
<TITLE>
|
||||
All Classes
|
||||
</TITLE>
|
||||
|
||||
<META NAME="date" CONTENT="2011-04-01">
|
||||
<META NAME="date" CONTENT="2011-07-11">
|
||||
|
||||
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
|
||||
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
<!--NewPage-->
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<!-- Generated by javadoc (build 1.6.0_24) on Fri Apr 01 20:49:05 CDT 2011 -->
|
||||
<!-- Generated by javadoc (build 1.6.0_26) on Mon Jul 11 21:40:35 CDT 2011 -->
|
||||
<TITLE>
|
||||
All Classes
|
||||
</TITLE>
|
||||
|
||||
<META NAME="date" CONTENT="2011-04-01">
|
||||
<META NAME="date" CONTENT="2011-07-11">
|
||||
|
||||
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
|
||||
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
<!--NewPage-->
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<!-- Generated by javadoc (build 1.6.0_24) on Fri Apr 01 20:49:05 CDT 2011 -->
|
||||
<!-- Generated by javadoc (build 1.6.0_26) on Mon Jul 11 21:40:35 CDT 2011 -->
|
||||
<TITLE>
|
||||
Constant Field Values
|
||||
</TITLE>
|
||||
|
||||
<META NAME="date" CONTENT="2011-04-01">
|
||||
<META NAME="date" CONTENT="2011-07-11">
|
||||
|
||||
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
|
||||
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
<!--NewPage-->
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<!-- Generated by javadoc (build 1.6.0_24) on Fri Apr 01 20:49:05 CDT 2011 -->
|
||||
<!-- Generated by javadoc (build 1.6.0_26) on Mon Jul 11 21:40:35 CDT 2011 -->
|
||||
<TITLE>
|
||||
Deprecated List
|
||||
</TITLE>
|
||||
|
||||
<META NAME="date" CONTENT="2011-04-01">
|
||||
<META NAME="date" CONTENT="2011-07-11">
|
||||
|
||||
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
|
||||
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
<!--NewPage-->
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<!-- Generated by javadoc (build 1.6.0_24) on Fri Apr 01 20:49:05 CDT 2011 -->
|
||||
<!-- Generated by javadoc (build 1.6.0_26) on Mon Jul 11 21:40:35 CDT 2011 -->
|
||||
<TITLE>
|
||||
API Help
|
||||
</TITLE>
|
||||
|
||||
<META NAME="date" CONTENT="2011-04-01">
|
||||
<META NAME="date" CONTENT="2011-07-11">
|
||||
|
||||
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
|
||||
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
<!--NewPage-->
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<!-- Generated by javadoc (build 1.6.0_24) on Fri Apr 01 20:49:05 CDT 2011 -->
|
||||
<!-- Generated by javadoc (build 1.6.0_26) on Mon Jul 11 21:40:35 CDT 2011 -->
|
||||
<TITLE>
|
||||
Index
|
||||
</TITLE>
|
||||
|
||||
<META NAME="date" CONTENT="2011-04-01">
|
||||
<META NAME="date" CONTENT="2011-07-11">
|
||||
|
||||
<LINK REL ="stylesheet" TYPE="text/css" HREF="./stylesheet.css" TITLE="Style">
|
||||
|
||||
@@ -80,10 +80,11 @@ function windowTitle()
|
||||
<A NAME="_B_"><!-- --></A><H2>
|
||||
<B>B</B></H2>
|
||||
<DL>
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJ.html#bufSize(int, int)"><B>bufSize(int, int)</B></A> -
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJ.html#bufSize(int, int, int)"><B>bufSize(int, int, int)</B></A> -
|
||||
Static method in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</A>
|
||||
<DD>Returns the maximum size of the buffer (in bytes) required to hold a JPEG
|
||||
image with the given width and height.
|
||||
image with the given width and height, and level of chrominance
|
||||
subsampling.
|
||||
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJ.html#bufSizeYUV(int, int, int)"><B>bufSizeYUV(int, int, int)</B></A> -
|
||||
Static method in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</A>
|
||||
<DD>Returns the size of the buffer (in bytes) required to hold a YUV planar
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<!--NewPage-->
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<!-- Generated by javadoc on Fri Apr 01 20:49:05 CDT 2011-->
|
||||
<!-- Generated by javadoc on Mon Jul 11 21:40:35 CDT 2011-->
|
||||
<TITLE>
|
||||
Generated Documentation (Untitled)
|
||||
</TITLE>
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
<!--NewPage-->
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<!-- Generated by javadoc (build 1.6.0_24) on Fri Apr 01 20:49:04 CDT 2011 -->
|
||||
<!-- Generated by javadoc (build 1.6.0_26) on Mon Jul 11 21:40:35 CDT 2011 -->
|
||||
<TITLE>
|
||||
TJ
|
||||
</TITLE>
|
||||
|
||||
<META NAME="date" CONTENT="2011-04-01">
|
||||
<META NAME="date" CONTENT="2011-07-11">
|
||||
|
||||
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
|
||||
|
||||
@@ -309,12 +309,14 @@ TurboJPEG utility class (cannot be instantiated)
|
||||
<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#bufSize(int, int)">bufSize</A></B>(int width,
|
||||
int height)</CODE>
|
||||
<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html#bufSize(int, int, int)">bufSize</A></B>(int width,
|
||||
int height,
|
||||
int jpegSubsamp)</CODE>
|
||||
|
||||
<BR>
|
||||
Returns the maximum size of the buffer (in bytes) required to hold a JPEG
|
||||
image with the given width and height.</TD>
|
||||
image with the given width and height, and level of chrominance
|
||||
subsampling.</TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||||
@@ -821,20 +823,24 @@ public static int <B>getBlueOffset</B>(int pixelFormat)
|
||||
</DL>
|
||||
<HR>
|
||||
|
||||
<A NAME="bufSize(int, int)"><!-- --></A><H3>
|
||||
<A NAME="bufSize(int, int, int)"><!-- --></A><H3>
|
||||
bufSize</H3>
|
||||
<PRE>
|
||||
public static int <B>bufSize</B>(int width,
|
||||
int height)
|
||||
int height,
|
||||
int jpegSubsamp)
|
||||
throws java.lang.Exception</PRE>
|
||||
<DL>
|
||||
<DD>Returns the maximum size of the buffer (in bytes) required to hold a JPEG
|
||||
image with the given width and height.
|
||||
image with the given width and height, and level of chrominance
|
||||
subsampling.
|
||||
<P>
|
||||
<DD><DL>
|
||||
<DT><B>Parameters:</B><DD><CODE>width</CODE> - the width (in pixels) of the JPEG image<DD><CODE>height</CODE> - the height (in pixels) of the JPEG image
|
||||
<DT><B>Parameters:</B><DD><CODE>width</CODE> - the width (in pixels) of the JPEG image<DD><CODE>height</CODE> - the height (in pixels) of the JPEG image<DD><CODE>jpegSubsamp</CODE> - the level of chrominance subsampling to be used when
|
||||
generating the JPEG image (one of <A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><CODE>TJ.SAMP_*</CODE></A>)
|
||||
<DT><B>Returns:</B><DD>the maximum size of the buffer (in bytes) required to hold a JPEG
|
||||
image with the given width and height
|
||||
image with the given width and height, and level of chrominance
|
||||
subsampling
|
||||
<DT><B>Throws:</B>
|
||||
<DD><CODE>java.lang.Exception</CODE></DL>
|
||||
</DD>
|
||||
@@ -854,7 +860,7 @@ public static int <B>bufSizeYUV</B>(int width,
|
||||
<P>
|
||||
<DD><DL>
|
||||
<DT><B>Parameters:</B><DD><CODE>width</CODE> - the width (in pixels) of the YUV image<DD><CODE>height</CODE> - the height (in pixels) of the YUV image<DD><CODE>subsamp</CODE> - the level of chrominance subsampling used in the YUV
|
||||
image
|
||||
image (one of <A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><CODE>TJ.SAMP_*</CODE></A>)
|
||||
<DT><B>Returns:</B><DD>the size of the buffer (in bytes) required to hold a YUV planar
|
||||
image with the given width, height, and level of chrominance subsampling
|
||||
<DT><B>Throws:</B>
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
<!--NewPage-->
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<!-- Generated by javadoc (build 1.6.0_24) on Fri Apr 01 20:49:05 CDT 2011 -->
|
||||
<!-- Generated by javadoc (build 1.6.0_26) on Mon Jul 11 21:40:35 CDT 2011 -->
|
||||
<TITLE>
|
||||
TJCompressor
|
||||
</TITLE>
|
||||
|
||||
<META NAME="date" CONTENT="2011-04-01">
|
||||
<META NAME="date" CONTENT="2011-07-11">
|
||||
|
||||
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
|
||||
|
||||
@@ -421,7 +421,7 @@ public void <B>compress</B>(byte[] dstBuf,
|
||||
<P>
|
||||
<DD><DL>
|
||||
<DT><B>Parameters:</B><DD><CODE>dstBuf</CODE> - buffer which will receive the JPEG image. Use
|
||||
<A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html#bufSize(int, int)"><CODE>TJ.bufSize(int, int)</CODE></A> to determine the maximum size for this buffer based on
|
||||
<A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html#bufSize(int, int, int)"><CODE>TJ.bufSize(int, int, int)</CODE></A> to determine the maximum size for this buffer based on
|
||||
the image width and height.<DD><CODE>flags</CODE> - the bitwise OR of one or more of <A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><CODE>TJ.FLAG_*</CODE></A>
|
||||
<DT><B>Throws:</B>
|
||||
<DD><CODE>java.lang.Exception</CODE></DL>
|
||||
@@ -462,7 +462,7 @@ public void <B>compress</B>(java.awt.image.BufferedImage srcImage,
|
||||
<DD><DL>
|
||||
<DT><B>Parameters:</B><DD><CODE>srcImage</CODE> - a <code>BufferedImage</code> instance containing RGB or
|
||||
grayscale pixels to be compressed<DD><CODE>dstBuf</CODE> - buffer which will receive the JPEG image. Use
|
||||
<A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html#bufSize(int, int)"><CODE>TJ.bufSize(int, int)</CODE></A> to determine the maximum size for this buffer based on
|
||||
<A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html#bufSize(int, int, int)"><CODE>TJ.bufSize(int, int, int)</CODE></A> to determine the maximum size for this buffer based on
|
||||
the image width and height.<DD><CODE>flags</CODE> - the bitwise OR of one or more of <A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><CODE>TJ.FLAG_*</CODE></A>
|
||||
<DT><B>Throws:</B>
|
||||
<DD><CODE>java.lang.Exception</CODE></DL>
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
<!--NewPage-->
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<!-- Generated by javadoc (build 1.6.0_24) on Fri Apr 01 20:49:05 CDT 2011 -->
|
||||
<!-- Generated by javadoc (build 1.6.0_26) on Mon Jul 11 21:40:35 CDT 2011 -->
|
||||
<TITLE>
|
||||
TJDecompressor
|
||||
</TITLE>
|
||||
|
||||
<META NAME="date" CONTENT="2011-04-01">
|
||||
<META NAME="date" CONTENT="2011-07-11">
|
||||
|
||||
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
|
||||
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
<!--NewPage-->
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<!-- Generated by javadoc (build 1.6.0_24) on Fri Apr 01 20:49:05 CDT 2011 -->
|
||||
<!-- Generated by javadoc (build 1.6.0_26) on Mon Jul 11 21:40:35 CDT 2011 -->
|
||||
<TITLE>
|
||||
TJScalingFactor
|
||||
</TITLE>
|
||||
|
||||
<META NAME="date" CONTENT="2011-04-01">
|
||||
<META NAME="date" CONTENT="2011-07-11">
|
||||
|
||||
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
|
||||
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
<!--NewPage-->
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<!-- Generated by javadoc (build 1.6.0_24) on Fri Apr 01 20:49:05 CDT 2011 -->
|
||||
<!-- Generated by javadoc (build 1.6.0_26) on Mon Jul 11 21:40:35 CDT 2011 -->
|
||||
<TITLE>
|
||||
TJTransform
|
||||
</TITLE>
|
||||
|
||||
<META NAME="date" CONTENT="2011-04-01">
|
||||
<META NAME="date" CONTENT="2011-07-11">
|
||||
|
||||
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
|
||||
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
<!--NewPage-->
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<!-- Generated by javadoc (build 1.6.0_24) on Fri Apr 01 20:49:05 CDT 2011 -->
|
||||
<!-- Generated by javadoc (build 1.6.0_26) on Mon Jul 11 21:40:35 CDT 2011 -->
|
||||
<TITLE>
|
||||
TJTransformer
|
||||
</TITLE>
|
||||
|
||||
<META NAME="date" CONTENT="2011-04-01">
|
||||
<META NAME="date" CONTENT="2011-07-11">
|
||||
|
||||
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
|
||||
|
||||
@@ -313,7 +313,7 @@ public void <B>transform</B>(byte[][] dstBufs,
|
||||
<DD><DL>
|
||||
<DT><B>Parameters:</B><DD><CODE>dstBufs</CODE> - an array of image buffers. <code>dstbufs[i]</code> will
|
||||
receive a JPEG image that has been transformed using the parameters in
|
||||
<code>transforms[i]</code>. Use <A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html#bufSize(int, int)"><CODE>TJ.bufSize(int, int)</CODE></A> to determine the
|
||||
<code>transforms[i]</code>. Use <A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html#bufSize(int, int, int)"><CODE>TJ.bufSize(int, int, int)</CODE></A> to determine the
|
||||
maximum size for each buffer based on the cropped width and height.<DD><CODE>transforms</CODE> - an array of <A HREF="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg"><CODE>TJTransform</CODE></A> instances, each of
|
||||
which specifies the transform parameters and/or cropping region for the
|
||||
corresponding transformed output image<DD><CODE>flags</CODE> - the bitwise OR of one or more of <A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><CODE>TJ.FLAG_*</CODE></A>
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
<!--NewPage-->
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<!-- Generated by javadoc (build 1.6.0_24) on Fri Apr 01 20:49:05 CDT 2011 -->
|
||||
<!-- Generated by javadoc (build 1.6.0_26) on Mon Jul 11 21:40:35 CDT 2011 -->
|
||||
<TITLE>
|
||||
org.libjpegturbo.turbojpeg
|
||||
</TITLE>
|
||||
|
||||
<META NAME="date" CONTENT="2011-04-01">
|
||||
<META NAME="date" CONTENT="2011-07-11">
|
||||
|
||||
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
|
||||
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
<!--NewPage-->
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<!-- Generated by javadoc (build 1.6.0_24) on Fri Apr 01 20:49:05 CDT 2011 -->
|
||||
<!-- Generated by javadoc (build 1.6.0_26) on Mon Jul 11 21:40:35 CDT 2011 -->
|
||||
<TITLE>
|
||||
org.libjpegturbo.turbojpeg
|
||||
</TITLE>
|
||||
|
||||
<META NAME="date" CONTENT="2011-04-01">
|
||||
<META NAME="date" CONTENT="2011-07-11">
|
||||
|
||||
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
|
||||
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
<!--NewPage-->
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<!-- Generated by javadoc (build 1.6.0_24) on Fri Apr 01 20:49:05 CDT 2011 -->
|
||||
<!-- Generated by javadoc (build 1.6.0_26) on Mon Jul 11 21:40:35 CDT 2011 -->
|
||||
<TITLE>
|
||||
org.libjpegturbo.turbojpeg Class Hierarchy
|
||||
</TITLE>
|
||||
|
||||
<META NAME="date" CONTENT="2011-04-01">
|
||||
<META NAME="date" CONTENT="2011-07-11">
|
||||
|
||||
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
|
||||
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
<!--NewPage-->
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<!-- Generated by javadoc (build 1.6.0_24) on Fri Apr 01 20:49:05 CDT 2011 -->
|
||||
<!-- Generated by javadoc (build 1.6.0_26) on Mon Jul 11 21:40:35 CDT 2011 -->
|
||||
<TITLE>
|
||||
Class Hierarchy
|
||||
</TITLE>
|
||||
|
||||
<META NAME="date" CONTENT="2011-04-01">
|
||||
<META NAME="date" CONTENT="2011-07-11">
|
||||
|
||||
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
|
||||
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
<!--NewPage-->
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<!-- Generated by javadoc (build 1.6.0_24) on Fri Apr 01 20:49:05 CDT 2011 -->
|
||||
<!-- Generated by javadoc (build 1.6.0_26) on Mon Jul 11 21:40:35 CDT 2011 -->
|
||||
<TITLE>
|
||||
Serialized Form
|
||||
</TITLE>
|
||||
|
||||
<META NAME="date" CONTENT="2011-04-01">
|
||||
<META NAME="date" CONTENT="2011-07-11">
|
||||
|
||||
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
|
||||
|
||||
|
||||
@@ -271,16 +271,21 @@ final public class TJ {
|
||||
|
||||
/**
|
||||
* Returns the maximum size of the buffer (in bytes) required to hold a JPEG
|
||||
* image with the given width and height.
|
||||
* image with the given width and height, and level of chrominance
|
||||
* subsampling.
|
||||
*
|
||||
* @param width the width (in pixels) of the JPEG image
|
||||
*
|
||||
* @param height the height (in pixels) of the JPEG image
|
||||
*
|
||||
* @param jpegSubsamp the level of chrominance subsampling to be used when
|
||||
* generating the JPEG image (one of {@link TJ TJ.SAMP_*})
|
||||
*
|
||||
* @return the maximum size of the buffer (in bytes) required to hold a JPEG
|
||||
* image with the given width and height
|
||||
* image with the given width and height, and level of chrominance
|
||||
* subsampling
|
||||
*/
|
||||
public native static int bufSize(int width, int height)
|
||||
public native static int bufSize(int width, int height, int jpegSubsamp)
|
||||
throws Exception;
|
||||
|
||||
/**
|
||||
@@ -292,7 +297,7 @@ final public class TJ {
|
||||
* @param height the height (in pixels) of the YUV image
|
||||
*
|
||||
* @param subsamp the level of chrominance subsampling used in the YUV
|
||||
* image
|
||||
* image (one of {@link TJ TJ.SAMP_*})
|
||||
*
|
||||
* @return the size of the buffer (in bytes) required to hold a YUV planar
|
||||
* image with the given width, height, and level of chrominance subsampling
|
||||
|
||||
@@ -160,7 +160,7 @@ public class TJCompressor {
|
||||
public byte[] compress(int flags) throws Exception {
|
||||
if(srcWidth < 1 || srcHeight < 1)
|
||||
throw new Exception(NO_ASSOC_ERROR);
|
||||
byte[] buf = new byte[TJ.bufSize(srcWidth, srcHeight)];
|
||||
byte[] buf = new byte[TJ.bufSize(srcWidth, srcHeight, subsamp)];
|
||||
compress(buf, flags);
|
||||
return buf;
|
||||
}
|
||||
@@ -249,7 +249,7 @@ public class TJCompressor {
|
||||
public byte[] compress(BufferedImage srcImage, int flags) throws Exception {
|
||||
int width = srcImage.getWidth();
|
||||
int height = srcImage.getHeight();
|
||||
byte[] buf = new byte[TJ.bufSize(width, height)];
|
||||
byte[] buf = new byte[TJ.bufSize(width, height, subsamp)];
|
||||
compress(srcImage, buf, flags);
|
||||
return buf;
|
||||
}
|
||||
|
||||
@@ -123,7 +123,7 @@ public class TJTransformer extends TJDecompressor {
|
||||
if(transforms[i].width != 0) w = transforms[i].width;
|
||||
if(transforms[i].height != 0) h = transforms[i].height;
|
||||
}
|
||||
dstBufs[i] = new byte[TJ.bufSize(w, h)];
|
||||
dstBufs[i] = new byte[TJ.bufSize(w, h, jpegSubsamp)];
|
||||
}
|
||||
TJDecompressor[] tjd = new TJDecompressor[transforms.length];
|
||||
transform(dstBufs, transforms, flags);
|
||||
|
||||
@@ -50,10 +50,10 @@ extern "C" {
|
||||
/*
|
||||
* Class: org_libjpegturbo_turbojpeg_TJ
|
||||
* Method: bufSize
|
||||
* Signature: (II)I
|
||||
* Signature: (III)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_org_libjpegturbo_turbojpeg_TJ_bufSize
|
||||
(JNIEnv *, jclass, jint, jint);
|
||||
(JNIEnv *, jclass, jint, jint, jint);
|
||||
|
||||
/*
|
||||
* Class: org_libjpegturbo_turbojpeg_TJ
|
||||
@@ -66,7 +66,7 @@ JNIEXPORT jint JNICALL Java_org_libjpegturbo_turbojpeg_TJ_bufSizeYUV
|
||||
/*
|
||||
* Class: org_libjpegturbo_turbojpeg_TJ
|
||||
* Method: getScalingFactors
|
||||
* Signature: ()[Lorg/libjpegturbo/turbojpeg/TJ/ScalingFactor;
|
||||
* Signature: ()[Lorg/libjpegturbo/turbojpeg/TJScalingFactor;
|
||||
*/
|
||||
JNIEXPORT jobjectArray JNICALL Java_org_libjpegturbo_turbojpeg_TJ_getScalingFactors
|
||||
(JNIEnv *, jclass);
|
||||
|
||||
Reference in New Issue
Block a user