[4] The TurboJPEG Java classes now throw unchecked idiomatic exceptions
(IllegalArgumentException, IllegalStateException) for unrecoverable errors
-caused by incorrect API usage.
+caused by incorrect API usage, and those classes throw a new checked exception
+type (TJException) for errors that are passed through from the C library.
1.4.1
org/libjpegturbo/turbojpeg/TJCompressor
org/libjpegturbo/turbojpeg/TJCustomFilter
org/libjpegturbo/turbojpeg/TJDecompressor
+ org/libjpegturbo/turbojpeg/TJException
org/libjpegturbo/turbojpeg/TJScalingFactor
org/libjpegturbo/turbojpeg/TJTransform
org/libjpegturbo/turbojpeg/TJTransformer
org/libjpegturbo/turbojpeg/TJCompressor.java \
org/libjpegturbo/turbojpeg/TJCustomFilter.java \
org/libjpegturbo/turbojpeg/TJDecompressor.java \
+ org/libjpegturbo/turbojpeg/TJException.java \
org/libjpegturbo/turbojpeg/TJScalingFactor.java \
org/libjpegturbo/turbojpeg/TJTransform.java \
org/libjpegturbo/turbojpeg/TJTransformer.java \
org/libjpegturbo/turbojpeg/TJCompressor.class \
org/libjpegturbo/turbojpeg/TJCustomFilter.class \
org/libjpegturbo/turbojpeg/TJDecompressor.class \
+ org/libjpegturbo/turbojpeg/TJException.class \
org/libjpegturbo/turbojpeg/TJLoader.class \
org/libjpegturbo/turbojpeg/TJScalingFactor.class \
org/libjpegturbo/turbojpeg/TJTransform.class \
/*
- * Copyright (C)2011-2012, 2014 D. R. Commander. All Rights Reserved.
+ * Copyright (C)2011-2012, 2014-2015 D. R. Commander. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
public void customFilter(ShortBuffer coeffBuffer, Rectangle bufferRegion,
Rectangle planeRegion, int componentIndex,
int transformIndex, TJTransform transform)
- throws Exception {
+ throws TJException {
for (int i = 0; i < bufferRegion.width * bufferRegion.height; i++) {
coeffBuffer.put(i, (short)(-coeffBuffer.get(i)));
}
<li><a href="org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg" target="classFrame">TJCompressor</a></li>
<li><a href="org/libjpegturbo/turbojpeg/TJCustomFilter.html" title="interface in org.libjpegturbo.turbojpeg" target="classFrame"><i>TJCustomFilter</i></a></li>
<li><a href="org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg" target="classFrame">TJDecompressor</a></li>
+<li><a href="org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg" target="classFrame">TJException</a></li>
<li><a href="org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg" target="classFrame">TJScalingFactor</a></li>
<li><a href="org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg" target="classFrame">TJTransform</a></li>
<li><a href="org/libjpegturbo/turbojpeg/TJTransformer.html" title="class in org.libjpegturbo.turbojpeg" target="classFrame">TJTransformer</a></li>
<li><a href="org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</a></li>
<li><a href="org/libjpegturbo/turbojpeg/TJCustomFilter.html" title="interface in org.libjpegturbo.turbojpeg"><i>TJCustomFilter</i></a></li>
<li><a href="org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></li>
+<li><a href="org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></li>
<li><a href="org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg">TJScalingFactor</a></li>
<li><a href="org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</a></li>
<li><a href="org/libjpegturbo/turbojpeg/TJTransformer.html" title="class in org.libjpegturbo.turbojpeg">TJTransformer</a></li>
source image stored in <code>yuvImage</code> with the newly created
instance.</div>
</dd>
+<dt><a href="./org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">TJException</span></a> - Exception in <a href="./org/libjpegturbo/turbojpeg/package-summary.html">org.libjpegturbo.turbojpeg</a></dt>
+<dd> </dd>
+<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJException.html#TJException()">TJException()</a></span> - Constructor for exception org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></dt>
+<dd> </dd>
+<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJException.html#TJException(java.lang.String,%20java.lang.Throwable)">TJException(String, Throwable)</a></span> - Constructor for exception org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></dt>
+<dd> </dd>
+<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJException.html#TJException(java.lang.String)">TJException(String)</a></span> - Constructor for exception org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></dt>
+<dd> </dd>
+<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJException.html#TJException(java.lang.Throwable)">TJException(Throwable)</a></span> - Constructor for exception org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></dt>
+<dd> </dd>
<dt><a href="./org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">TJScalingFactor</span></a> - Class in <a href="./org/libjpegturbo/turbojpeg/package-summary.html">org.libjpegturbo.turbojpeg</a></dt>
<dd>
<div class="block">Fractional scaling factor</div>
<h4>bufSize</h4>
<pre>public static int bufSize(int width,
int height,
- int jpegSubsamp)
- throws java.lang.Exception</pre>
+ int jpegSubsamp)</pre>
<div class="block">Returns the maximum size of the buffer (in bytes) required to hold a JPEG
image with the given width, height, and level of chrominance subsampling.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>width</code> - the width (in pixels) of the JPEG image</dd><dd><code>height</code> - the height (in pixels) of the JPEG image</dd><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>)</dd>
<dt><span class="strong">Returns:</span></dt><dd>the maximum size of the buffer (in bytes) required to hold a JPEG
- image with the given width, height, and level of chrominance subsampling.</dd>
-<dt><span class="strong">Throws:</span></dt>
-<dd><code>java.lang.Exception</code></dd></dl>
+ image with the given width, height, and level of chrominance subsampling.</dd></dl>
</li>
</ul>
<a name="bufSizeYUV(int, int, int, int)">
<pre>public static int bufSizeYUV(int width,
int pad,
int height,
- int subsamp)
- throws java.lang.Exception</pre>
+ int subsamp)</pre>
<div class="block">Returns the size of the buffer (in bytes) required to hold a YUV planar
image with the given width, height, and level of chrominance subsampling.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>width</code> - the width (in pixels) of the YUV image</dd><dd><code>pad</code> - the width of each line in each plane of the image is padded to
the nearest multiple of this number of bytes (must be a power of 2.)</dd><dd><code>height</code> - the height (in pixels) of the YUV image</dd><dd><code>subsamp</code> - the level of chrominance subsampling used in the YUV
image (one of <a href="../../../org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><code>TJ.SAMP_*</code></a>)</dd>
<dt><span class="strong">Returns:</span></dt><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.</dd>
-<dt><span class="strong">Throws:</span></dt>
-<dd><code>java.lang.Exception</code></dd></dl>
+ image with the given width, height, and level of chrominance subsampling.</dd></dl>
</li>
</ul>
<a name="bufSizeYUV(int, int, int)">
<pre>@Deprecated
public static int bufSizeYUV(int width,
int height,
- int subsamp)
- throws java.lang.Exception</pre>
+ int subsamp)</pre>
<div class="block"><span class="strong">Deprecated.</span> <i>Use <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#bufSizeYUV(int,%20int,%20int,%20int)"><code>bufSizeYUV(int, int, int, int)</code></a> instead.</i></div>
-<dl><dt><span class="strong">Throws:</span></dt>
-<dd><code>java.lang.Exception</code></dd></dl>
</li>
</ul>
<a name="planeSizeYUV(int, int, int, int, int)">
int width,
int stride,
int height,
- int subsamp)
- throws java.lang.Exception</pre>
+ int subsamp)</pre>
<div class="block">Returns the size of the buffer (in bytes) required to hold a YUV image
plane with the given parameters.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>componentID</code> - ID number of the image plane (0 = Y, 1 = U/Cb,
height of the whole image, not the plane height.</dd><dd><code>subsamp</code> - the level of chrominance subsampling used in the YUV
image (one of <a href="../../../org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><code>TJ.SAMP_*</code></a>)</dd>
<dt><span class="strong">Returns:</span></dt><dd>the size of the buffer (in bytes) required to hold a YUV planar
- image with the given parameters.</dd>
-<dt><span class="strong">Throws:</span></dt>
-<dd><code>java.lang.Exception</code></dd></dl>
+ image with the given parameters.</dd></dl>
</li>
</ul>
<a name="planeWidth(int, int, int)">
<h4>planeWidth</h4>
<pre>public static int planeWidth(int componentID,
int width,
- int subsamp)
- throws java.lang.Exception</pre>
+ int subsamp)</pre>
<div class="block">Returns the plane width of a YUV image plane with the given parameters.
Refer to <a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg"><code>YUVImage</code></a> for a description of plane width.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>componentID</code> - ID number of the image plane (0 = Y, 1 = U/Cb,
2 = V/Cr)</dd><dd><code>width</code> - width (in pixels) of the YUV image</dd><dd><code>subsamp</code> - the level of chrominance subsampling used in the YUV image
(one of <a href="../../../org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><code>TJ.SAMP_*</code></a>)</dd>
-<dt><span class="strong">Returns:</span></dt><dd>the plane width of a YUV image plane with the given parameters.</dd>
-<dt><span class="strong">Throws:</span></dt>
-<dd><code>java.lang.Exception</code></dd></dl>
+<dt><span class="strong">Returns:</span></dt><dd>the plane width of a YUV image plane with the given parameters.</dd></dl>
</li>
</ul>
<a name="planeHeight(int, int, int)">
<h4>planeHeight</h4>
<pre>public static int planeHeight(int componentID,
int height,
- int subsamp)
- throws java.lang.Exception</pre>
+ int subsamp)</pre>
<div class="block">Returns the plane height of a YUV image plane with the given parameters.
Refer to <a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg"><code>YUVImage</code></a> for a description of plane height.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>componentID</code> - ID number of the image plane (0 = Y, 1 = U/Cb,
2 = V/Cr)</dd><dd><code>height</code> - height (in pixels) of the YUV image</dd><dd><code>subsamp</code> - the level of chrominance subsampling used in the YUV image
(one of <a href="../../../org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><code>TJ.SAMP_*</code></a>)</dd>
-<dt><span class="strong">Returns:</span></dt><dd>the plane height of a YUV image plane with the given parameters.</dd>
-<dt><span class="strong">Throws:</span></dt>
-<dd><code>java.lang.Exception</code></dd></dl>
+<dt><span class="strong">Returns:</span></dt><dd>the plane height of a YUV image plane with the given parameters.</dd></dl>
</li>
</ul>
<a name="getScalingFactors()">
<ul class="blockListLast">
<li class="blockList">
<h4>getScalingFactors</h4>
-<pre>public static <a href="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg">TJScalingFactor</a>[] getScalingFactors()
- throws java.lang.Exception</pre>
+<pre>public static <a href="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg">TJScalingFactor</a>[] getScalingFactors()</pre>
<div class="block">Returns a list of fractional scaling factors that the JPEG decompressor in
this implementation of TurboJPEG supports.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>a list of fractional scaling factors that the JPEG decompressor in
- this implementation of TurboJPEG supports.</dd>
-<dt><span class="strong">Throws:</span></dt>
-<dd><code>java.lang.Exception</code></dd></dl>
+ this implementation of TurboJPEG supports.</dd></dl>
</li>
</ul>
</li>
<li class="blockList">
<h4>TJCompressor</h4>
<pre>public TJCompressor()
- throws java.lang.Exception</pre>
+ throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
<div class="block">Create a TurboJPEG compressor instance.</div>
<dl><dt><span class="strong">Throws:</span></dt>
-<dd><code>java.lang.Exception</code></dd></dl>
+<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
</li>
</ul>
<a name="TJCompressor(byte[], int, int, int, int, int, int)">
int pitch,
int height,
int pixelFormat)
- throws java.lang.Exception</pre>
+ throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
<div class="block">Create a TurboJPEG compressor instance and associate the uncompressed
source image stored in <code>srcImage</code> with the newly created
instance.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>srcImage</code> - see <a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[],%20int,%20int,%20int,%20int,%20int,%20int)"><code>setSourceImage(byte[], int, int, int, int, int, int)</code></a> for description</dd><dd><code>x</code> - see <a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[],%20int,%20int,%20int,%20int,%20int,%20int)"><code>setSourceImage(byte[], int, int, int, int, int, int)</code></a> for description</dd><dd><code>y</code> - see <a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[],%20int,%20int,%20int,%20int,%20int,%20int)"><code>setSourceImage(byte[], int, int, int, int, int, int)</code></a> for description</dd><dd><code>width</code> - see <a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[],%20int,%20int,%20int,%20int,%20int,%20int)"><code>setSourceImage(byte[], int, int, int, int, int, int)</code></a> for description</dd><dd><code>pitch</code> - see <a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[],%20int,%20int,%20int,%20int,%20int,%20int)"><code>setSourceImage(byte[], int, int, int, int, int, int)</code></a> for description</dd><dd><code>height</code> - see <a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[],%20int,%20int,%20int,%20int,%20int,%20int)"><code>setSourceImage(byte[], int, int, int, int, int, int)</code></a> for description</dd><dd><code>pixelFormat</code> - pixel format of the source image (one of
<a href="../../../org/libjpegturbo/turbojpeg/TJ.html#PF_RGB"><code>TJ.PF_*</code></a>)</dd>
<dt><span class="strong">Throws:</span></dt>
-<dd><code>java.lang.Exception</code></dd></dl>
+<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
</li>
</ul>
<a name="TJCompressor(byte[], int, int, int, int)">
int pitch,
int height,
int pixelFormat)
- throws java.lang.Exception</pre>
+ throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
<div class="block"><span class="strong">Deprecated.</span> <i>Use
<a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#TJCompressor(byte[],%20int,%20int,%20int,%20int,%20int,%20int)"><code>TJCompressor(byte[], int, int, int, int, int, int)</code></a> instead.</i></div>
<dl><dt><span class="strong">Throws:</span></dt>
-<dd><code>java.lang.Exception</code></dd></dl>
+<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
</li>
</ul>
<a name="TJCompressor(java.awt.image.BufferedImage, int, int, int, int)">
int y,
int width,
int height)
- throws java.lang.Exception</pre>
+ throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
<div class="block">Create a TurboJPEG compressor instance and associate the uncompressed
source image stored in <code>srcImage</code> with the newly created
instance.</div>
<a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage,%20int,%20int,%20int,%20int)"><code>setSourceImage(BufferedImage, int, int, int, int)</code></a> for description</dd><dd><code>height</code> - see
<a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage,%20int,%20int,%20int,%20int)"><code>setSourceImage(BufferedImage, int, int, int, int)</code></a> for description</dd>
<dt><span class="strong">Throws:</span></dt>
-<dd><code>java.lang.Exception</code></dd></dl>
+<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
</li>
</ul>
</li>
int pitch,
int height,
int pixelFormat)
- throws java.lang.Exception</pre>
+ throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
<div class="block">Associate an uncompressed RGB, grayscale, or CMYK source image with this
compressor instance.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>srcImage</code> - image buffer containing RGB, grayscale, or CMYK pixels to
which the JPEG or YUV image should be compressed/encoded</dd><dd><code>pixelFormat</code> - pixel format of the source image (one of
<a href="../../../org/libjpegturbo/turbojpeg/TJ.html#PF_RGB"><code>TJ.PF_*</code></a>)</dd>
<dt><span class="strong">Throws:</span></dt>
-<dd><code>java.lang.Exception</code></dd></dl>
+<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
</li>
</ul>
<a name="setSourceImage(byte[], int, int, int, int)">
int pitch,
int height,
int pixelFormat)
- throws java.lang.Exception</pre>
+ throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
<div class="block"><span class="strong">Deprecated.</span> <i>Use
<a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[],%20int,%20int,%20int,%20int,%20int,%20int)"><code>setSourceImage(byte[], int, int, int, int, int, int)</code></a> instead.</i></div>
<dl><dt><span class="strong">Throws:</span></dt>
-<dd><code>java.lang.Exception</code></dd></dl>
+<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
</li>
</ul>
<a name="setSourceImage(java.awt.image.BufferedImage, int, int, int, int)">
int y,
int width,
int height)
- throws java.lang.Exception</pre>
+ throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
<div class="block">Associate an uncompressed RGB or grayscale source image with this
compressor instance.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>srcImage</code> - a <code>BufferedImage</code> instance containing RGB or
which the JPEG or YUV image should be compressed/encoded (0 = use the
height of the source image)</dd>
<dt><span class="strong">Throws:</span></dt>
-<dd><code>java.lang.Exception</code></dd></dl>
+<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
</li>
</ul>
<a name="setSourceImage(org.libjpegturbo.turbojpeg.YUVImage)">
<li class="blockList">
<h4>setSourceImage</h4>
<pre>public void setSourceImage(<a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a> srcImage)
- throws java.lang.Exception</pre>
+ throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
<div class="block">Associate an uncompressed YUV planar source image with this compressor
instance.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>srcImage</code> - YUV planar image to be compressed. This image is not
modified.</dd>
<dt><span class="strong">Throws:</span></dt>
-<dd><code>java.lang.Exception</code></dd></dl>
+<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
</li>
</ul>
<a name="setSubsamp(int)">
<h4>compress</h4>
<pre>public void compress(byte[] dstBuf,
int flags)
- throws java.lang.Exception</pre>
+ throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
<div class="block">Compress the uncompressed source image associated with this compressor
instance and output a JPEG image to the given destination buffer.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>dstBuf</code> - buffer that will receive the JPEG image. Use
subsampling.</dd><dd><code>flags</code> - the bitwise OR of one or more of
<a href="../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_BOTTOMUP"><code>TJ.FLAG_*</code></a></dd>
<dt><span class="strong">Throws:</span></dt>
-<dd><code>java.lang.Exception</code></dd></dl>
+<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
</li>
</ul>
<a name="compress(int)">
<li class="blockList">
<h4>compress</h4>
<pre>public byte[] compress(int flags)
- throws java.lang.Exception</pre>
+ throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
<div class="block">Compress the uncompressed source image associated with this compressor
instance and return a buffer containing a JPEG image.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>flags</code> - the bitwise OR of one or more of
<dt><span class="strong">Returns:</span></dt><dd>a buffer containing a JPEG image. The length of this buffer will
not be equal to the size of the JPEG image. Use <a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#getCompressedSize()"><code>getCompressedSize()</code></a> to obtain the size of the JPEG image.</dd>
<dt><span class="strong">Throws:</span></dt>
-<dd><code>java.lang.Exception</code></dd></dl>
+<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
</li>
</ul>
<a name="compress(java.awt.image.BufferedImage, byte[], int)">
public void compress(java.awt.image.BufferedImage srcImage,
byte[] dstBuf,
int flags)
- throws java.lang.Exception</pre>
+ throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
<div class="block"><span class="strong">Deprecated.</span> <i>Use
<a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage,%20int,%20int,%20int,%20int)"><code>setSourceImage(BufferedImage, int, int, int, int)</code></a> and
<a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#compress(byte[],%20int)"><code>compress(byte[], int)</code></a> instead.</i></div>
<dl><dt><span class="strong">Throws:</span></dt>
-<dd><code>java.lang.Exception</code></dd></dl>
+<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
</li>
</ul>
<a name="compress(java.awt.image.BufferedImage, int)">
<pre>@Deprecated
public byte[] compress(java.awt.image.BufferedImage srcImage,
int flags)
- throws java.lang.Exception</pre>
+ throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
<div class="block"><span class="strong">Deprecated.</span> <i>Use
<a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage,%20int,%20int,%20int,%20int)"><code>setSourceImage(BufferedImage, int, int, int, int)</code></a> and
<a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#compress(int)"><code>compress(int)</code></a> instead.</i></div>
<dl><dt><span class="strong">Throws:</span></dt>
-<dd><code>java.lang.Exception</code></dd></dl>
+<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
</li>
</ul>
<a name="encodeYUV(org.libjpegturbo.turbojpeg.YUVImage, int)">
<h4>encodeYUV</h4>
<pre>public void encodeYUV(<a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a> dstImage,
int flags)
- throws java.lang.Exception</pre>
+ throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
<div class="block">Encode the uncompressed source image associated with this compressor
instance into a YUV planar image and store it in the given
<code>YUVImage</code> instance. This method uses the accelerated color
image</dd><dd><code>flags</code> - the bitwise OR of one or more of
<a href="../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_BOTTOMUP"><code>TJ.FLAG_*</code></a></dd>
<dt><span class="strong">Throws:</span></dt>
-<dd><code>java.lang.Exception</code></dd></dl>
+<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
</li>
</ul>
<a name="encodeYUV(byte[], int)">
<pre>@Deprecated
public void encodeYUV(byte[] dstBuf,
int flags)
- throws java.lang.Exception</pre>
+ throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
<div class="block"><span class="strong">Deprecated.</span> <i>Use <a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(org.libjpegturbo.turbojpeg.YUVImage,%20int)"><code>encodeYUV(YUVImage, int)</code></a> instead.</i></div>
<dl><dt><span class="strong">Throws:</span></dt>
-<dd><code>java.lang.Exception</code></dd></dl>
+<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
</li>
</ul>
<a name="encodeYUV(int, int)">
<h4>encodeYUV</h4>
<pre>public <a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a> encodeYUV(int pad,
int flags)
- throws java.lang.Exception</pre>
+ throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
<div class="block">Encode the uncompressed source image associated with this compressor
instance into a unified YUV planar image buffer and return a
<code>YUVImage</code> instance containing the encoded image. This method
<a href="../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_BOTTOMUP"><code>TJ.FLAG_*</code></a></dd>
<dt><span class="strong">Returns:</span></dt><dd>a YUV planar image.</dd>
<dt><span class="strong">Throws:</span></dt>
-<dd><code>java.lang.Exception</code></dd></dl>
+<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
</li>
</ul>
<a name="encodeYUV(int[], int)">
<h4>encodeYUV</h4>
<pre>public <a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a> encodeYUV(int[] strides,
int flags)
- throws java.lang.Exception</pre>
+ throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
<div class="block">Encode the uncompressed source image associated with this compressor
instance into separate Y, U (Cb), and V (Cr) image planes and return a
<code>YUVImage</code> instance containing the encoded image planes. This
<a href="../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_BOTTOMUP"><code>TJ.FLAG_*</code></a></dd>
<dt><span class="strong">Returns:</span></dt><dd>a YUV planar image.</dd>
<dt><span class="strong">Throws:</span></dt>
-<dd><code>java.lang.Exception</code></dd></dl>
+<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
</li>
</ul>
<a name="encodeYUV(int)">
<h4>encodeYUV</h4>
<pre>@Deprecated
public byte[] encodeYUV(int flags)
- throws java.lang.Exception</pre>
+ throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
<div class="block"><span class="strong">Deprecated.</span> <i>Use <a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(int,%20int)"><code>encodeYUV(int, int)</code></a> instead.</i></div>
<dl><dt><span class="strong">Throws:</span></dt>
-<dd><code>java.lang.Exception</code></dd></dl>
+<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
</li>
</ul>
<a name="encodeYUV(java.awt.image.BufferedImage, byte[], int)">
public void encodeYUV(java.awt.image.BufferedImage srcImage,
byte[] dstBuf,
int flags)
- throws java.lang.Exception</pre>
+ throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
<div class="block"><span class="strong">Deprecated.</span> <i>Use
<a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage,%20int,%20int,%20int,%20int)"><code>setSourceImage(BufferedImage, int, int, int, int)</code></a> and
<a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(byte[],%20int)"><code>encodeYUV(byte[], int)</code></a> instead.</i></div>
<dl><dt><span class="strong">Throws:</span></dt>
-<dd><code>java.lang.Exception</code></dd></dl>
+<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
</li>
</ul>
<a name="encodeYUV(java.awt.image.BufferedImage, int)">
<pre>@Deprecated
public byte[] encodeYUV(java.awt.image.BufferedImage srcImage,
int flags)
- throws java.lang.Exception</pre>
+ throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
<div class="block"><span class="strong">Deprecated.</span> <i>Use
<a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage,%20int,%20int,%20int,%20int)"><code>setSourceImage(BufferedImage, int, int, int, int)</code></a> and
<a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(int,%20int)"><code>encodeYUV(int, int)</code></a> instead.</i></div>
<dl><dt><span class="strong">Throws:</span></dt>
-<dd><code>java.lang.Exception</code></dd></dl>
+<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
</li>
</ul>
<a name="getCompressedSize()">
<li class="blockList">
<h4>close</h4>
<pre>public void close()
- throws java.io.IOException</pre>
+ throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
<div class="block">Free the native structures associated with this compressor instance.</div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dt><strong>Specified by:</strong></dt>
<dd><code>close</code> in interface <code>java.lang.AutoCloseable</code></dd>
<dt><span class="strong">Throws:</span></dt>
-<dd><code>java.io.IOException</code></dd></dl>
+<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
</li>
</ul>
<a name="finalize()">
int componentID,
int transformID,
<a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</a> transform)
- throws java.lang.Exception</pre>
+ throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
<div class="block">A callback function that can be used to modify the DCT coefficients after
they are losslessly transformed but before they are transcoded to a new
JPEG image. This allows for custom filters or other transformations to be
transform in the <code>transforms</code> array that was passed to <a href="../../../org/libjpegturbo/turbojpeg/TJTransformer.html#transform(byte[][],%20org.libjpegturbo.turbojpeg.TJTransform[],%20int)"><code>TJTransformer.transform()</code></a>.</dd><dd><code>transform</code> - a <a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg"><code>TJTransform</code></a> instance that specifies the
parameters and/or cropping region for this transform</dd>
<dt><span class="strong">Throws:</span></dt>
-<dd><code>java.lang.Exception</code></dd></dl>
+<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
</li>
</ul>
</li>
<div class="subNav">
<ul class="navList">
<li><a href="../../../org/libjpegturbo/turbojpeg/TJCustomFilter.html" title="interface in org.libjpegturbo.turbojpeg"><span class="strong">Prev Class</span></a></li>
-<li><a href="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">Next Class</span></a></li>
+<li><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?org/libjpegturbo/turbojpeg/TJDecompressor.html" target="_top">Frames</a></li>
<li class="blockList">
<h4>TJDecompressor</h4>
<pre>public TJDecompressor()
- throws java.lang.Exception</pre>
+ throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
<div class="block">Create a TurboJPEG decompresssor instance.</div>
<dl><dt><span class="strong">Throws:</span></dt>
-<dd><code>java.lang.Exception</code></dd></dl>
+<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
</li>
</ul>
<a name="TJDecompressor(byte[])">
<li class="blockList">
<h4>TJDecompressor</h4>
<pre>public TJDecompressor(byte[] jpegImage)
- throws java.lang.Exception</pre>
+ throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
<div class="block">Create a TurboJPEG decompressor instance and associate the JPEG source
image stored in <code>jpegImage</code> with the newly created instance.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>jpegImage</code> - JPEG image buffer (size of the JPEG image is assumed to
be the length of the array.) This buffer is not modified.</dd>
<dt><span class="strong">Throws:</span></dt>
-<dd><code>java.lang.Exception</code></dd></dl>
+<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
</li>
</ul>
<a name="TJDecompressor(byte[], int)">
<h4>TJDecompressor</h4>
<pre>public TJDecompressor(byte[] jpegImage,
int imageSize)
- throws java.lang.Exception</pre>
+ throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
<div class="block">Create a TurboJPEG decompressor instance and associate the JPEG source
image of length <code>imageSize</code> bytes stored in
<code>jpegImage</code> with the newly created instance.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>jpegImage</code> - JPEG image buffer. This buffer is not modified.</dd><dd><code>imageSize</code> - size of the JPEG image (in bytes)</dd>
<dt><span class="strong">Throws:</span></dt>
-<dd><code>java.lang.Exception</code></dd></dl>
+<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
</li>
</ul>
<a name="TJDecompressor(org.libjpegturbo.turbojpeg.YUVImage)">
<li class="blockList">
<h4>TJDecompressor</h4>
<pre>public TJDecompressor(<a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a> yuvImage)
- throws java.lang.Exception</pre>
+ throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
<div class="block">Create a TurboJPEG decompressor instance and associate the YUV planar
source image stored in <code>yuvImage</code> with the newly created
instance.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>yuvImage</code> - <a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg"><code>YUVImage</code></a> instance containing a YUV planar
image to be decoded. This image is not modified.</dd>
<dt><span class="strong">Throws:</span></dt>
-<dd><code>java.lang.Exception</code></dd></dl>
+<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
</li>
</ul>
</li>
<h4>setSourceImage</h4>
<pre>public void setSourceImage(byte[] jpegImage,
int imageSize)
- throws java.lang.Exception</pre>
+ throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
<div class="block">Associate the JPEG image of length <code>imageSize</code> bytes stored in
<code>jpegImage</code> with this decompressor instance. This image will
be used as the source image for subsequent decompress operations.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>jpegImage</code> - JPEG image buffer. This buffer is not modified.</dd><dd><code>imageSize</code> - size of the JPEG image (in bytes)</dd>
<dt><span class="strong">Throws:</span></dt>
-<dd><code>java.lang.Exception</code></dd></dl>
+<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
</li>
</ul>
<a name="setJPEGImage(byte[], int)">
<pre>@Deprecated
public void setJPEGImage(byte[] jpegImage,
int imageSize)
- throws java.lang.Exception</pre>
+ throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
<div class="block"><span class="strong">Deprecated.</span> <i>Use <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#setSourceImage(byte[],%20int)"><code>setSourceImage(byte[], int)</code></a> instead.</i></div>
<dl><dt><span class="strong">Throws:</span></dt>
-<dd><code>java.lang.Exception</code></dd></dl>
+<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
</li>
</ul>
<a name="setSourceImage(org.libjpegturbo.turbojpeg.YUVImage)">
<ul class="blockList">
<li class="blockList">
<h4>setSourceImage</h4>
-<pre>public void setSourceImage(<a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a> srcImage)
- throws java.lang.Exception</pre>
+<pre>public void setSourceImage(<a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a> srcImage)</pre>
<div class="block">Associate the specified YUV planar source image with this decompressor
instance. Subsequent decompress operations will decode this image into an
RGB or grayscale destination image.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>srcImage</code> - <a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg"><code>YUVImage</code></a> instance containing a YUV planar image to
- be decoded. This image is not modified.</dd>
-<dt><span class="strong">Throws:</span></dt>
-<dd><code>java.lang.Exception</code></dd></dl>
+ be decoded. This image is not modified.</dd></dl>
</li>
</ul>
<a name="getWidth()">
<li class="blockList">
<h4>getScaledWidth</h4>
<pre>public int getScaledWidth(int desiredWidth,
- int desiredHeight)
- throws java.lang.Exception</pre>
+ int desiredHeight)</pre>
<div class="block">Returns the width of the largest scaled-down image that the TurboJPEG
decompressor can generate without exceeding the desired image width and
height.</div>
the scaled image size.)</dd>
<dt><span class="strong">Returns:</span></dt><dd>the width of the largest scaled-down image that the TurboJPEG
decompressor can generate without exceeding the desired image width and
- height.</dd>
-<dt><span class="strong">Throws:</span></dt>
-<dd><code>java.lang.Exception</code></dd></dl>
+ height.</dd></dl>
</li>
</ul>
<a name="getScaledHeight(int, int)">
<li class="blockList">
<h4>getScaledHeight</h4>
<pre>public int getScaledHeight(int desiredWidth,
- int desiredHeight)
- throws java.lang.Exception</pre>
+ int desiredHeight)</pre>
<div class="block">Returns the height of the largest scaled-down image that the TurboJPEG
decompressor can generate without exceeding the desired image width and
height.</div>
the scaled image size.)</dd>
<dt><span class="strong">Returns:</span></dt><dd>the height of the largest scaled-down image that the TurboJPEG
decompressor can generate without exceeding the desired image width and
- height.</dd>
-<dt><span class="strong">Throws:</span></dt>
-<dd><code>java.lang.Exception</code></dd></dl>
+ height.</dd></dl>
</li>
</ul>
<a name="decompress(byte[], int, int, int, int, int, int, int)">
int desiredHeight,
int pixelFormat,
int flags)
- throws java.lang.Exception</pre>
+ throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
<div class="block">Decompress the JPEG source image or decode the YUV source image associated
with this decompressor instance and output a grayscale, RGB, or CMYK image
to the given destination buffer.</div>
<a href="../../../org/libjpegturbo/turbojpeg/TJ.html#PF_RGB"><code>TJ.PF_*</code></a>)</dd><dd><code>flags</code> - the bitwise OR of one or more of
<a href="../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_BOTTOMUP"><code>TJ.FLAG_*</code></a></dd>
<dt><span class="strong">Throws:</span></dt>
-<dd><code>java.lang.Exception</code></dd></dl>
+<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
</li>
</ul>
<a name="decompress(byte[], int, int, int, int, int)">
int desiredHeight,
int pixelFormat,
int flags)
- throws java.lang.Exception</pre>
+ throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
<div class="block"><span class="strong">Deprecated.</span> <i>Use
<a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[],%20int,%20int,%20int,%20int,%20int,%20int,%20int)"><code>decompress(byte[], int, int, int, int, int, int, int)</code></a> instead.</i></div>
<dl><dt><span class="strong">Throws:</span></dt>
-<dd><code>java.lang.Exception</code></dd></dl>
+<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
</li>
</ul>
<a name="decompress(int, int, int, int, int)">
int desiredHeight,
int pixelFormat,
int flags)
- throws java.lang.Exception</pre>
+ throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
<div class="block">Decompress the JPEG source image associated with this decompressor
instance and return a buffer containing the decompressed image.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>desiredWidth</code> - see
<a href="../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_BOTTOMUP"><code>TJ.FLAG_*</code></a></dd>
<dt><span class="strong">Returns:</span></dt><dd>a buffer containing the decompressed image.</dd>
<dt><span class="strong">Throws:</span></dt>
-<dd><code>java.lang.Exception</code></dd></dl>
+<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
</li>
</ul>
<a name="decompressToYUV(org.libjpegturbo.turbojpeg.YUVImage, int)">
<h4>decompressToYUV</h4>
<pre>public void decompressToYUV(<a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a> dstImage,
int flags)
- throws java.lang.Exception</pre>
+ throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
<div class="block">Decompress the JPEG source image associated with this decompressor
instance into a YUV planar image and store it in the given
<code>YUVImage</code> instance. This method performs JPEG decompression
source image.</dd><dd><code>flags</code> - the bitwise OR of one or more of
<a href="../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_BOTTOMUP"><code>TJ.FLAG_*</code></a></dd>
<dt><span class="strong">Throws:</span></dt>
-<dd><code>java.lang.Exception</code></dd></dl>
+<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
</li>
</ul>
<a name="decompressToYUV(byte[], int)">
<pre>@Deprecated
public void decompressToYUV(byte[] dstBuf,
int flags)
- throws java.lang.Exception</pre>
+ throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
<div class="block"><span class="strong">Deprecated.</span> <i>Use <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(org.libjpegturbo.turbojpeg.YUVImage,%20int)"><code>decompressToYUV(YUVImage, int)</code></a> instead.</i></div>
<dl><dt><span class="strong">Throws:</span></dt>
-<dd><code>java.lang.Exception</code></dd></dl>
+<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
</li>
</ul>
<a name="decompressToYUV(int, int[], int, int)">
int[] strides,
int desiredHeight,
int flags)
- throws java.lang.Exception</pre>
+ throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
<div class="block">Decompress the JPEG source image associated with this decompressor
instance into a set of Y, U (Cb), and V (Cr) image planes and return a
<code>YUVImage</code> instance containing the decompressed image planes.
<a href="../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_BOTTOMUP"><code>TJ.FLAG_*</code></a></dd>
<dt><span class="strong">Returns:</span></dt><dd>a YUV planar image.</dd>
<dt><span class="strong">Throws:</span></dt>
-<dd><code>java.lang.Exception</code></dd></dl>
+<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
</li>
</ul>
<a name="decompressToYUV(int, int, int, int)">
int pad,
int desiredHeight,
int flags)
- throws java.lang.Exception</pre>
+ throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
<div class="block">Decompress the JPEG source image associated with this decompressor
instance into a unified YUV planar image buffer and return a
<code>YUVImage</code> instance containing the decompressed image. This
<a href="../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_BOTTOMUP"><code>TJ.FLAG_*</code></a></dd>
<dt><span class="strong">Returns:</span></dt><dd>a YUV planar image.</dd>
<dt><span class="strong">Throws:</span></dt>
-<dd><code>java.lang.Exception</code></dd></dl>
+<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
</li>
</ul>
<a name="decompressToYUV(int)">
<h4>decompressToYUV</h4>
<pre>@Deprecated
public byte[] decompressToYUV(int flags)
- throws java.lang.Exception</pre>
+ throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
<div class="block"><span class="strong">Deprecated.</span> <i>Use <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(int,%20int,%20int,%20int)"><code>decompressToYUV(int, int, int, int)</code></a> instead.</i></div>
<dl><dt><span class="strong">Throws:</span></dt>
-<dd><code>java.lang.Exception</code></dd></dl>
+<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
</li>
</ul>
<a name="decompress(int[], int, int, int, int, int, int, int)">
int desiredHeight,
int pixelFormat,
int flags)
- throws java.lang.Exception</pre>
+ throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
<div class="block">Decompress the JPEG source image or decode the YUV source image associated
with this decompressor instance and output a grayscale, RGB, or CMYK image
to the given destination buffer.</div>
<a href="../../../org/libjpegturbo/turbojpeg/TJ.html#PF_RGB"><code>TJ.PF_*</code></a>)</dd><dd><code>flags</code> - the bitwise OR of one or more of
<a href="../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_BOTTOMUP"><code>TJ.FLAG_*</code></a></dd>
<dt><span class="strong">Throws:</span></dt>
-<dd><code>java.lang.Exception</code></dd></dl>
+<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
</li>
</ul>
<a name="decompress(java.awt.image.BufferedImage, int)">
<h4>decompress</h4>
<pre>public void decompress(java.awt.image.BufferedImage dstImage,
int flags)
- throws java.lang.Exception</pre>
+ throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
<div class="block">Decompress the JPEG source image or decode the YUV source image associated
with this decompressor instance and output a decompressed/decoded image to
the given <code>BufferedImage</code> instance.</div>
height of the YUV image.</dd><dd><code>flags</code> - the bitwise OR of one or more of
<a href="../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_BOTTOMUP"><code>TJ.FLAG_*</code></a></dd>
<dt><span class="strong">Throws:</span></dt>
-<dd><code>java.lang.Exception</code></dd></dl>
+<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
</li>
</ul>
<a name="decompress(int, int, int, int)">
int desiredHeight,
int bufferedImageType,
int flags)
- throws java.lang.Exception</pre>
+ throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
<div class="block">Decompress the JPEG source image or decode the YUV source image associated
with this decompressor instance and return a <code>BufferedImage</code>
instance containing the decompressed/decoded image.</div>
<dt><span class="strong">Returns:</span></dt><dd>a <code>BufferedImage</code> instance containing the
decompressed/decoded image.</dd>
<dt><span class="strong">Throws:</span></dt>
-<dd><code>java.lang.Exception</code></dd></dl>
+<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
</li>
</ul>
<a name="close()">
<li class="blockList">
<h4>close</h4>
<pre>public void close()
- throws java.io.IOException</pre>
+ throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
<div class="block">Free the native structures associated with this decompressor instance.</div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dt><strong>Specified by:</strong></dt>
<dd><code>close</code> in interface <code>java.lang.AutoCloseable</code></dd>
<dt><span class="strong">Throws:</span></dt>
-<dd><code>java.io.IOException</code></dd></dl>
+<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
</li>
</ul>
<a name="finalize()">
<div class="subNav">
<ul class="navList">
<li><a href="../../../org/libjpegturbo/turbojpeg/TJCustomFilter.html" title="interface in org.libjpegturbo.turbojpeg"><span class="strong">Prev Class</span></a></li>
-<li><a href="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">Next Class</span></a></li>
+<li><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?org/libjpegturbo/turbojpeg/TJDecompressor.html" target="_top">Frames</a></li>
--- /dev/null
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<!-- NewPage -->
+<html lang="en">
+<head>
+<title>TJException</title>
+<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
+</head>
+<body>
+<script type="text/javascript"><!--
+ if (location.href.indexOf('is-external=true') == -1) {
+ parent.document.title="TJException";
+ }
+//-->
+</script>
+<noscript>
+<div>JavaScript is disabled on your browser.</div>
+</noscript>
+<!-- ========= START OF TOP NAVBAR ======= -->
+<div class="topNav"><a name="navbar_top">
+<!-- -->
+</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
+<!-- -->
+</a>
+<ul class="navList" title="Navigation">
+<li><a href="../../../org/libjpegturbo/turbojpeg/package-summary.html">Package</a></li>
+<li class="navBarCell1Rev">Class</li>
+<li><a href="package-tree.html">Tree</a></li>
+<li><a href="../../../deprecated-list.html">Deprecated</a></li>
+<li><a href="../../../index-all.html">Index</a></li>
+<li><a href="../../../help-doc.html">Help</a></li>
+</ul>
+</div>
+<div class="subNav">
+<ul class="navList">
+<li><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">Prev Class</span></a></li>
+<li><a href="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">Next Class</span></a></li>
+</ul>
+<ul class="navList">
+<li><a href="../../../index.html?org/libjpegturbo/turbojpeg/TJException.html" target="_top">Frames</a></li>
+<li><a href="TJException.html" target="_top">No Frames</a></li>
+</ul>
+<ul class="navList" id="allclasses_navbar_top">
+<li><a href="../../../allclasses-noframe.html">All Classes</a></li>
+</ul>
+<div>
+<script type="text/javascript"><!--
+ allClassesLink = document.getElementById("allclasses_navbar_top");
+ if(window==top) {
+ allClassesLink.style.display = "block";
+ }
+ else {
+ allClassesLink.style.display = "none";
+ }
+ //-->
+</script>
+</div>
+<div>
+<ul class="subNavList">
+<li>Summary: </li>
+<li>Nested | </li>
+<li>Field | </li>
+<li><a href="#constructor_summary">Constr</a> | </li>
+<li><a href="#methods_inherited_from_class_java.lang.Throwable">Method</a></li>
+</ul>
+<ul class="subNavList">
+<li>Detail: </li>
+<li>Field | </li>
+<li><a href="#constructor_detail">Constr</a> | </li>
+<li>Method</li>
+</ul>
+</div>
+<a name="skip-navbar_top">
+<!-- -->
+</a></div>
+<!-- ========= END OF TOP NAVBAR ========= -->
+<!-- ======== START OF CLASS DATA ======== -->
+<div class="header">
+<div class="subTitle">org.libjpegturbo.turbojpeg</div>
+<h2 title="Class TJException" class="title">Class TJException</h2>
+</div>
+<div class="contentContainer">
+<ul class="inheritance">
+<li>java.lang.Object</li>
+<li>
+<ul class="inheritance">
+<li>java.lang.Throwable</li>
+<li>
+<ul class="inheritance">
+<li>java.lang.Exception</li>
+<li>
+<ul class="inheritance">
+<li>java.io.IOException</li>
+<li>
+<ul class="inheritance">
+<li>org.libjpegturbo.turbojpeg.TJException</li>
+</ul>
+</li>
+</ul>
+</li>
+</ul>
+</li>
+</ul>
+</li>
+</ul>
+<div class="description">
+<ul class="blockList">
+<li class="blockList">
+<dl>
+<dt>All Implemented Interfaces:</dt>
+<dd>java.io.Serializable</dd>
+</dl>
+<hr>
+<br>
+<pre>public class <span class="strong">TJException</span>
+extends java.io.IOException</pre>
+<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../serialized-form.html#org.libjpegturbo.turbojpeg.TJException">Serialized Form</a></dd></dl>
+</li>
+</ul>
+</div>
+<div class="summary">
+<ul class="blockList">
+<li class="blockList">
+<!-- ======== CONSTRUCTOR SUMMARY ======== -->
+<ul class="blockList">
+<li class="blockList"><a name="constructor_summary">
+<!-- -->
+</a>
+<h3>Constructor Summary</h3>
+<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
+<caption><span>Constructors</span><span class="tabEnd"> </span></caption>
+<tr>
+<th class="colOne" scope="col">Constructor and Description</th>
+</tr>
+<tr class="altColor">
+<td class="colOne"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJException.html#TJException()">TJException</a></strong>()</code> </td>
+</tr>
+<tr class="rowColor">
+<td class="colOne"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJException.html#TJException(java.lang.String)">TJException</a></strong>(java.lang.String message)</code> </td>
+</tr>
+<tr class="altColor">
+<td class="colOne"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJException.html#TJException(java.lang.String,%20java.lang.Throwable)">TJException</a></strong>(java.lang.String message,
+ java.lang.Throwable cause)</code> </td>
+</tr>
+<tr class="rowColor">
+<td class="colOne"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJException.html#TJException(java.lang.Throwable)">TJException</a></strong>(java.lang.Throwable cause)</code> </td>
+</tr>
+</table>
+</li>
+</ul>
+<!-- ========== METHOD SUMMARY =========== -->
+<ul class="blockList">
+<li class="blockList"><a name="method_summary">
+<!-- -->
+</a>
+<h3>Method Summary</h3>
+<ul class="blockList">
+<li class="blockList"><a name="methods_inherited_from_class_java.lang.Throwable">
+<!-- -->
+</a>
+<h3>Methods inherited from class java.lang.Throwable</h3>
+<code>addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString</code></li>
+</ul>
+<ul class="blockList">
+<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
+<!-- -->
+</a>
+<h3>Methods inherited from class java.lang.Object</h3>
+<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait</code></li>
+</ul>
+</li>
+</ul>
+</li>
+</ul>
+</div>
+<div class="details">
+<ul class="blockList">
+<li class="blockList">
+<!-- ========= CONSTRUCTOR DETAIL ======== -->
+<ul class="blockList">
+<li class="blockList"><a name="constructor_detail">
+<!-- -->
+</a>
+<h3>Constructor Detail</h3>
+<a name="TJException()">
+<!-- -->
+</a>
+<ul class="blockList">
+<li class="blockList">
+<h4>TJException</h4>
+<pre>public TJException()</pre>
+</li>
+</ul>
+<a name="TJException(java.lang.String, java.lang.Throwable)">
+<!-- -->
+</a>
+<ul class="blockList">
+<li class="blockList">
+<h4>TJException</h4>
+<pre>public TJException(java.lang.String message,
+ java.lang.Throwable cause)</pre>
+</li>
+</ul>
+<a name="TJException(java.lang.String)">
+<!-- -->
+</a>
+<ul class="blockList">
+<li class="blockList">
+<h4>TJException</h4>
+<pre>public TJException(java.lang.String message)</pre>
+</li>
+</ul>
+<a name="TJException(java.lang.Throwable)">
+<!-- -->
+</a>
+<ul class="blockListLast">
+<li class="blockList">
+<h4>TJException</h4>
+<pre>public TJException(java.lang.Throwable cause)</pre>
+</li>
+</ul>
+</li>
+</ul>
+</li>
+</ul>
+</div>
+</div>
+<!-- ========= END OF CLASS DATA ========= -->
+<!-- ======= START OF BOTTOM NAVBAR ====== -->
+<div class="bottomNav"><a name="navbar_bottom">
+<!-- -->
+</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
+<!-- -->
+</a>
+<ul class="navList" title="Navigation">
+<li><a href="../../../org/libjpegturbo/turbojpeg/package-summary.html">Package</a></li>
+<li class="navBarCell1Rev">Class</li>
+<li><a href="package-tree.html">Tree</a></li>
+<li><a href="../../../deprecated-list.html">Deprecated</a></li>
+<li><a href="../../../index-all.html">Index</a></li>
+<li><a href="../../../help-doc.html">Help</a></li>
+</ul>
+</div>
+<div class="subNav">
+<ul class="navList">
+<li><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">Prev Class</span></a></li>
+<li><a href="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">Next Class</span></a></li>
+</ul>
+<ul class="navList">
+<li><a href="../../../index.html?org/libjpegturbo/turbojpeg/TJException.html" target="_top">Frames</a></li>
+<li><a href="TJException.html" target="_top">No Frames</a></li>
+</ul>
+<ul class="navList" id="allclasses_navbar_bottom">
+<li><a href="../../../allclasses-noframe.html">All Classes</a></li>
+</ul>
+<div>
+<script type="text/javascript"><!--
+ allClassesLink = document.getElementById("allclasses_navbar_bottom");
+ if(window==top) {
+ allClassesLink.style.display = "block";
+ }
+ else {
+ allClassesLink.style.display = "none";
+ }
+ //-->
+</script>
+</div>
+<div>
+<ul class="subNavList">
+<li>Summary: </li>
+<li>Nested | </li>
+<li>Field | </li>
+<li><a href="#constructor_summary">Constr</a> | </li>
+<li><a href="#methods_inherited_from_class_java.lang.Throwable">Method</a></li>
+</ul>
+<ul class="subNavList">
+<li>Detail: </li>
+<li>Field | </li>
+<li><a href="#constructor_detail">Constr</a> | </li>
+<li>Method</li>
+</ul>
+</div>
+<a name="skip-navbar_bottom">
+<!-- -->
+</a></div>
+<!-- ======== END OF BOTTOM NAVBAR ======= -->
+</body>
+</html>
</div>
<div class="subNav">
<ul class="navList">
-<li><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">Prev Class</span></a></li>
+<li><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
</div>
<div class="subNav">
<ul class="navList">
-<li><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">Prev Class</span></a></li>
+<li><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
int h,
int op,
int options,
- <a href="../../../org/libjpegturbo/turbojpeg/TJCustomFilter.html" title="interface in org.libjpegturbo.turbojpeg">TJCustomFilter</a> cf)
- throws java.lang.Exception</pre>
+ <a href="../../../org/libjpegturbo/turbojpeg/TJCustomFilter.html" title="interface in org.libjpegturbo.turbojpeg">TJCustomFilter</a> cf)</pre>
<div class="block">Create a new lossless transform instance with the given parameters.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - the left boundary of the cropping region. This must be evenly
divisible by the MCU block width (see <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#getMCUWidth(int)"><code>TJ.getMCUWidth(int)</code></a>)</dd><dd><code>y</code> - the upper boundary of the cropping region. This must be evenly
<code>x</code>).</dd><dd><code>h</code> - the height of the cropping region. Setting this to 0 is the
equivalent of setting it to (height of the source JPEG image -
<code>y</code>).</dd><dd><code>op</code> - one of the transform operations (<code>OP_*</code>)</dd><dd><code>options</code> - the bitwise OR of one or more of the transform options
- (<code>OPT_*</code>)</dd><dd><code>cf</code> - an instance of an object that implements the <a href="../../../org/libjpegturbo/turbojpeg/TJCustomFilter.html" title="interface in org.libjpegturbo.turbojpeg"><code>TJCustomFilter</code></a> interface, or null if no custom filter is needed</dd>
-<dt><span class="strong">Throws:</span></dt>
-<dd><code>java.lang.Exception</code></dd></dl>
+ (<code>OPT_*</code>)</dd><dd><code>cf</code> - an instance of an object that implements the <a href="../../../org/libjpegturbo/turbojpeg/TJCustomFilter.html" title="interface in org.libjpegturbo.turbojpeg"><code>TJCustomFilter</code></a> interface, or null if no custom filter is needed</dd></dl>
</li>
</ul>
<a name="TJTransform(java.awt.Rectangle, int, int, org.libjpegturbo.turbojpeg.TJCustomFilter)">
<pre>public TJTransform(java.awt.Rectangle r,
int op,
int options,
- <a href="../../../org/libjpegturbo/turbojpeg/TJCustomFilter.html" title="interface in org.libjpegturbo.turbojpeg">TJCustomFilter</a> cf)
- throws java.lang.Exception</pre>
+ <a href="../../../org/libjpegturbo/turbojpeg/TJCustomFilter.html" title="interface in org.libjpegturbo.turbojpeg">TJCustomFilter</a> cf)</pre>
<div class="block">Create a new lossless transform instance with the given parameters.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>r</code> - a <code>Rectangle</code> instance that specifies the cropping
region. See <a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html#TJTransform(int,%20int,%20int,%20int,%20int,%20int,%20org.libjpegturbo.turbojpeg.TJCustomFilter)"><code>TJTransform(int, int, int, int, int, int, TJCustomFilter)</code></a> for more
detail.</dd><dd><code>op</code> - one of the transform operations (<code>OP_*</code>)</dd><dd><code>options</code> - the bitwise OR of one or more of the transform options
- (<code>OPT_*</code>)</dd><dd><code>cf</code> - an instance of an object that implements the <a href="../../../org/libjpegturbo/turbojpeg/TJCustomFilter.html" title="interface in org.libjpegturbo.turbojpeg"><code>TJCustomFilter</code></a> interface, or null if no custom filter is needed</dd>
-<dt><span class="strong">Throws:</span></dt>
-<dd><code>java.lang.Exception</code></dd></dl>
+ (<code>OPT_*</code>)</dd><dd><code>cf</code> - an instance of an object that implements the <a href="../../../org/libjpegturbo/turbojpeg/TJCustomFilter.html" title="interface in org.libjpegturbo.turbojpeg"><code>TJCustomFilter</code></a> interface, or null if no custom filter is needed</dd></dl>
</li>
</ul>
</li>
<li class="blockList">
<h4>TJTransformer</h4>
<pre>public TJTransformer()
- throws java.lang.Exception</pre>
+ throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
<div class="block">Create a TurboJPEG lossless transformer instance.</div>
<dl><dt><span class="strong">Throws:</span></dt>
-<dd><code>java.lang.Exception</code></dd></dl>
+<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
</li>
</ul>
<a name="TJTransformer(byte[])">
<li class="blockList">
<h4>TJTransformer</h4>
<pre>public TJTransformer(byte[] jpegImage)
- throws java.lang.Exception</pre>
+ throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
<div class="block">Create a TurboJPEG lossless transformer instance and associate the JPEG
image stored in <code>jpegImage</code> with the newly created instance.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>jpegImage</code> - JPEG image buffer (size of the JPEG image is assumed to
be the length of the array.) This buffer is not modified.</dd>
<dt><span class="strong">Throws:</span></dt>
-<dd><code>java.lang.Exception</code></dd></dl>
+<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
</li>
</ul>
<a name="TJTransformer(byte[], int)">
<h4>TJTransformer</h4>
<pre>public TJTransformer(byte[] jpegImage,
int imageSize)
- throws java.lang.Exception</pre>
+ throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
<div class="block">Create a TurboJPEG lossless transformer instance and associate the JPEG
image of length <code>imageSize</code> bytes stored in
<code>jpegImage</code> with the newly created instance.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>jpegImage</code> - JPEG image buffer. This buffer is not modified.</dd><dd><code>imageSize</code> - size of the JPEG image (in bytes)</dd>
<dt><span class="strong">Throws:</span></dt>
-<dd><code>java.lang.Exception</code></dd></dl>
+<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
</li>
</ul>
</li>
<pre>public void transform(byte[][] dstBufs,
<a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</a>[] transforms,
int flags)
- throws java.lang.Exception</pre>
+ throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
<div class="block">Losslessly transform the JPEG image associated with this transformer
instance into one or more JPEG images stored in the given destination
buffers. Lossless transforms work by moving the raw coefficients from one
corresponding transformed output image</dd><dd><code>flags</code> - the bitwise OR of one or more of
<a href="../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_BOTTOMUP"><code>TJ.FLAG_*</code></a></dd>
<dt><span class="strong">Throws:</span></dt>
-<dd><code>java.lang.Exception</code></dd></dl>
+<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
</li>
</ul>
<a name="transform(org.libjpegturbo.turbojpeg.TJTransform[], int)">
<h4>transform</h4>
<pre>public <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a>[] transform(<a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</a>[] transforms,
int flags)
- throws java.lang.Exception</pre>
+ throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
<div class="block">Losslessly transform the JPEG image associated with this transformer
instance and return an array of <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg"><code>TJDecompressor</code></a> instances, each of
which has a transformed JPEG image associated with it.</div>
<dt><span class="strong">Returns:</span></dt><dd>an array of <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg"><code>TJDecompressor</code></a> instances, each of
which has a transformed JPEG image associated with it.</dd>
<dt><span class="strong">Throws:</span></dt>
-<dd><code>java.lang.Exception</code></dd></dl>
+<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
</li>
</ul>
<a name="getTransformedSizes()">
<pre>public YUVImage(int width,
int[] strides,
int height,
- int subsamp)
- throws java.lang.Exception</pre>
+ int subsamp)</pre>
<div class="block">Create a new <code>YUVImage</code> instance backed by separate image
planes, and allocate memory for the image planes.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>width</code> - width (in pixels) of the YUV image</dd><dd><code>strides</code> - an array of integers, each specifying the number of bytes
strides for all planes will be set to their respective plane widths. When
using this constructor, the stride for each plane must be equal to or
greater than the plane width.</dd><dd><code>height</code> - height (in pixels) of the YUV image</dd><dd><code>subsamp</code> - the level of chrominance subsampling to be used in the YUV
- image (one of <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#SAMP_444"><code>TJ.SAMP_*</code></a>)</dd>
-<dt><span class="strong">Throws:</span></dt>
-<dd><code>java.lang.Exception</code></dd></dl>
+ image (one of <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#SAMP_444"><code>TJ.SAMP_*</code></a>)</dd></dl>
</li>
</ul>
<a name="YUVImage(int, int, int, int)">
<pre>public YUVImage(int width,
int pad,
int height,
- int subsamp)
- throws java.lang.Exception</pre>
+ int subsamp)</pre>
<div class="block">Create a new <code>YUVImage</code> instance backed by a unified image
buffer, and allocate memory for the image buffer.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>width</code> - width (in pixels) of the YUV image</dd><dd><code>pad</code> - Each line of each plane in the YUV image buffer will be padded
to this number of bytes (must be a power of 2.)</dd><dd><code>height</code> - height (in pixels) of the YUV image</dd><dd><code>subsamp</code> - the level of chrominance subsampling to be used in the YUV
- image (one of <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#SAMP_444"><code>TJ.SAMP_*</code></a>)</dd>
-<dt><span class="strong">Throws:</span></dt>
-<dd><code>java.lang.Exception</code></dd></dl>
+ image (one of <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#SAMP_444"><code>TJ.SAMP_*</code></a>)</dd></dl>
</li>
</ul>
<a name="YUVImage(byte[][], int[], int, int[], int, int)">
int width,
int[] strides,
int height,
- int subsamp)
- throws java.lang.Exception</pre>
+ int subsamp)</pre>
<div class="block">Create a new <code>YUVImage</code> instance from a set of existing image
planes.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>planes</code> - an array of buffers representing the Y, U (Cb), and V (Cr)
to each plane or to specify that this <code>YUVImage</code> instance is a
subregion of a larger image (in which case, <code>strides[i]</code> should
be set to the plane width of plane <code>i</code> in the larger image.)</dd><dd><code>height</code> - height (in pixels) of the new YUV image (or subregion)</dd><dd><code>subsamp</code> - the level of chrominance subsampling used in the YUV
- image (one of <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#SAMP_444"><code>TJ.SAMP_*</code></a>)</dd>
-<dt><span class="strong">Throws:</span></dt>
-<dd><code>java.lang.Exception</code></dd></dl>
+ image (one of <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#SAMP_444"><code>TJ.SAMP_*</code></a>)</dd></dl>
</li>
</ul>
<a name="YUVImage(byte[], int, int, int, int)">
int width,
int pad,
int height,
- int subsamp)
- throws java.lang.Exception</pre>
+ int subsamp)</pre>
<div class="block">Create a new <code>YUVImage</code> instance from an existing unified image
buffer.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>yuvImage</code> - image buffer that contains or will contain YUV planar
of the image format.)</dd><dd><code>width</code> - width (in pixels) of the YUV image</dd><dd><code>pad</code> - the line padding used in the YUV image buffer. For
instance, if each line in each plane of the buffer is padded to the
nearest multiple of 4 bytes, then <code>pad</code> should be set to 4.</dd><dd><code>height</code> - height (in pixels) of the YUV image</dd><dd><code>subsamp</code> - the level of chrominance subsampling used in the YUV
- image (one of <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#SAMP_444"><code>TJ.SAMP_*</code></a>)</dd>
-<dt><span class="strong">Throws:</span></dt>
-<dd><code>java.lang.Exception</code></dd></dl>
+ image (one of <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#SAMP_444"><code>TJ.SAMP_*</code></a>)</dd></dl>
</li>
</ul>
</li>
int width,
int[] strides,
int height,
- int subsamp)
- throws java.lang.Exception</pre>
+ int subsamp)</pre>
<div class="block">Assign a set of image planes to this <code>YUVImage</code> instance.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>planes</code> - an array of buffers representing the Y, U (Cb), and V (Cr)
image planes (or just the Y plane, if the image is grayscale.) These
to each plane or to specify that this <code>YUVImage</code> image is a
subregion of a larger image (in which case, <code>strides[i]</code> should
be set to the plane width of plane <code>i</code> in the larger image.)</dd><dd><code>height</code> - height (in pixels) of the YUV image (or subregion)</dd><dd><code>subsamp</code> - the level of chrominance subsampling used in the YUV
- image (one of <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#SAMP_444"><code>TJ.SAMP_*</code></a>)</dd>
-<dt><span class="strong">Throws:</span></dt>
-<dd><code>java.lang.Exception</code></dd></dl>
+ image (one of <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#SAMP_444"><code>TJ.SAMP_*</code></a>)</dd></dl>
</li>
</ul>
<a name="setBuf(byte[], int, int, int, int)">
int width,
int pad,
int height,
- int subsamp)
- throws java.lang.Exception</pre>
+ int subsamp)</pre>
<div class="block">Assign a unified image buffer to this <code>YUVImage</code> instance.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>yuvImage</code> - image buffer that contains or will contain YUV planar
image data. Use <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#bufSizeYUV(int,%20int,%20int,%20int)"><code>TJ.bufSizeYUV(int, int, int, int)</code></a> to determine the minimum size for
of the image format.)</dd><dd><code>width</code> - width (in pixels) of the YUV image</dd><dd><code>pad</code> - the line padding used in the YUV image buffer. For
instance, if each line in each plane of the buffer is padded to the
nearest multiple of 4 bytes, then <code>pad</code> should be set to 4.</dd><dd><code>height</code> - height (in pixels) of the YUV image</dd><dd><code>subsamp</code> - the level of chrominance subsampling used in the YUV
- image (one of <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#SAMP_444"><code>TJ.SAMP_*</code></a>)</dd>
-<dt><span class="strong">Throws:</span></dt>
-<dd><code>java.lang.Exception</code></dd></dl>
+ image (one of <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#SAMP_444"><code>TJ.SAMP_*</code></a>)</dd></dl>
</li>
</ul>
<a name="getWidth()">
<ul class="blockListLast">
<li class="blockList">
<h4>getSize</h4>
-<pre>public int getSize()
- throws java.lang.Exception</pre>
+<pre>public int getSize()</pre>
<div class="block">Returns the size (in bytes) of the YUV image buffer (if this image is
stored in a unified buffer rather than separate image planes.)</div>
-<dl><dt><span class="strong">Returns:</span></dt><dd>the size (in bytes) of the YUV image buffer</dd>
-<dt><span class="strong">Throws:</span></dt>
-<dd><code>java.lang.Exception</code></dd></dl>
+<dl><dt><span class="strong">Returns:</span></dt><dd>the size (in bytes) of the YUV image buffer</dd></dl>
</li>
</ul>
</li>
<li><a href="TJTransformer.html" title="class in org.libjpegturbo.turbojpeg" target="classFrame">TJTransformer</a></li>
<li><a href="YUVImage.html" title="class in org.libjpegturbo.turbojpeg" target="classFrame">YUVImage</a></li>
</ul>
+<h2 title="Exceptions">Exceptions</h2>
+<ul title="Exceptions">
+<li><a href="TJException.html" title="class in org.libjpegturbo.turbojpeg" target="classFrame">TJException</a></li>
+</ul>
</div>
</body>
</html>
</tbody>
</table>
</li>
+<li class="blockList">
+<table class="packageSummary" border="0" cellpadding="3" cellspacing="0" summary="Exception Summary table, listing exceptions, and an explanation">
+<caption><span>Exception Summary</span><span class="tabEnd"> </span></caption>
+<tr>
+<th class="colFirst" scope="col">Exception</th>
+<th class="colLast" scope="col">Description</th>
+</tr>
+<tbody>
+<tr class="altColor">
+<td class="colFirst"><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></td>
+<td class="colLast"> </td>
+</tr>
+</tbody>
+</table>
+</li>
</ul>
</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
</li>
</ul>
</li>
+<li type="circle">java.lang.Throwable (implements java.io.Serializable)
+<ul>
+<li type="circle">java.lang.Exception
+<ul>
+<li type="circle">java.io.IOException
+<ul>
+<li type="circle">org.libjpegturbo.turbojpeg.<a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">TJException</span></a></li>
+</ul>
+</li>
+</ul>
+</li>
+</ul>
+</li>
<li type="circle">org.libjpegturbo.turbojpeg.<a href="../../../org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">TJ</span></a></li>
<li type="circle">org.libjpegturbo.turbojpeg.<a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">TJCompressor</span></a> (implements java.io.Closeable)</li>
<li type="circle">org.libjpegturbo.turbojpeg.<a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">TJDecompressor</span></a> (implements java.io.Closeable)
</li>
</ul>
</li>
+<li type="circle">java.lang.Throwable (implements java.io.Serializable)
+<ul>
+<li type="circle">java.lang.Exception
+<ul>
+<li type="circle">java.io.IOException
+<ul>
+<li type="circle">org.libjpegturbo.turbojpeg.<a href="org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">TJException</span></a></li>
+</ul>
+</li>
+</ul>
+</li>
+</ul>
+</li>
<li type="circle">org.libjpegturbo.turbojpeg.<a href="org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">TJ</span></a></li>
<li type="circle">org.libjpegturbo.turbojpeg.<a href="org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">TJCompressor</span></a> (implements java.io.Closeable)</li>
<li type="circle">org.libjpegturbo.turbojpeg.<a href="org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">TJDecompressor</span></a> (implements java.io.Closeable)
<li class="blockList">
<h2 title="Package">Package org.libjpegturbo.turbojpeg</h2>
<ul class="blockList">
+<li class="blockList"><a name="org.libjpegturbo.turbojpeg.TJException">
+<!-- -->
+</a>
+<h3>Class <a href="org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">org.libjpegturbo.turbojpeg.TJException</a> extends java.io.IOException implements Serializable</h3>
+<dl class="nameValue">
+<dt>serialVersionUID:</dt>
+<dd>1L</dd>
+</dl>
+</li>
<li class="blockList"><a name="org.libjpegturbo.turbojpeg.TJTransform">
<!-- -->
</a>
/*
* Copyright (C)2011-2013 D. R. Commander. All Rights Reserved.
+ * Copyright (C)2015 Viktor Szathmáry. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* @return the maximum size of the buffer (in bytes) required to hold a JPEG
* image with the given width, height, and level of chrominance subsampling.
*/
- public static native int bufSize(int width, int height, int jpegSubsamp)
- throws Exception;
+ public static native int bufSize(int width, int height, int jpegSubsamp);
/**
* Returns the size of the buffer (in bytes) required to hold a YUV planar
* image with the given width, height, and level of chrominance subsampling.
*/
public static native int bufSizeYUV(int width, int pad, int height,
- int subsamp)
- throws Exception;
+ int subsamp);
/**
* @deprecated Use {@link #bufSizeYUV(int, int, int, int)} instead.
*/
@Deprecated
- public static native int bufSizeYUV(int width, int height, int subsamp)
- throws Exception;
+ public static native int bufSizeYUV(int width, int height, int subsamp);
/**
* Returns the size of the buffer (in bytes) required to hold a YUV image
* image with the given parameters.
*/
public static native int planeSizeYUV(int componentID, int width, int stride,
- int height, int subsamp)
- throws Exception;
+ int height, int subsamp);
/**
* Returns the plane width of a YUV image plane with the given parameters.
*
* @return the plane width of a YUV image plane with the given parameters.
*/
- public static native int planeWidth(int componentID, int width, int subsamp)
- throws Exception;
+ public static native int planeWidth(int componentID, int width, int subsamp);
/**
* Returns the plane height of a YUV image plane with the given parameters.
* @return the plane height of a YUV image plane with the given parameters.
*/
public static native int planeHeight(int componentID, int height,
- int subsamp)
- throws Exception;
+ int subsamp);
/**
* Returns a list of fractional scaling factors that the JPEG decompressor in
* @return a list of fractional scaling factors that the JPEG decompressor in
* this implementation of TurboJPEG supports.
*/
- public static native TJScalingFactor[] getScalingFactors()
- throws Exception;
+ public static native TJScalingFactor[] getScalingFactors();
static {
TJLoader.load();
/*
* Copyright (C)2011-2015 D. R. Commander. All Rights Reserved.
+ * Copyright (C)2015 Viktor Szathmáry. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
/**
* Create a TurboJPEG compressor instance.
*/
- public TJCompressor() throws Exception {
+ public TJCompressor() throws TJException {
init();
}
* {@link TJ#PF_RGB TJ.PF_*})
*/
public TJCompressor(byte[] srcImage, int x, int y, int width, int pitch,
- int height, int pixelFormat) throws Exception {
+ int height, int pixelFormat) throws TJException {
setSourceImage(srcImage, x, y, width, pitch, height, pixelFormat);
}
*/
@Deprecated
public TJCompressor(byte[] srcImage, int width, int pitch, int height,
- int pixelFormat) throws Exception {
+ int pixelFormat) throws TJException {
setSourceImage(srcImage, width, pitch, height, pixelFormat);
}
* {@link #setSourceImage(BufferedImage, int, int, int, int)} for description
*/
public TJCompressor(BufferedImage srcImage, int x, int y, int width,
- int height) throws Exception {
+ int height) throws TJException {
setSourceImage(srcImage, x, y, width, height);
}
*/
public void setSourceImage(byte[] srcImage, int x, int y, int width,
int pitch, int height, int pixelFormat)
- throws Exception {
+ throws TJException {
if (handle == 0) init();
if (srcImage == null || x < 0 || y < 0 || width < 1 || height < 1 ||
pitch < 0 || pixelFormat < 0 || pixelFormat >= TJ.NUMPF)
*/
@Deprecated
public void setSourceImage(byte[] srcImage, int width, int pitch,
- int height, int pixelFormat) throws Exception {
+ int height, int pixelFormat) throws TJException {
setSourceImage(srcImage, 0, 0, width, pitch, height, pixelFormat);
srcX = srcY = -1;
}
* height of the source image)
*/
public void setSourceImage(BufferedImage srcImage, int x, int y, int width,
- int height) throws Exception {
+ int height) throws TJException {
if (handle == 0) init();
if (srcImage == null || x < 0 || y < 0 || width < 0 || height < 0)
throw new IllegalArgumentException("Invalid argument in setSourceImage()");
* @param srcImage YUV planar image to be compressed. This image is not
* modified.
*/
- public void setSourceImage(YUVImage srcImage) throws Exception {
+ public void setSourceImage(YUVImage srcImage) throws TJException {
if (handle == 0) init();
if (srcImage == null)
throw new IllegalArgumentException("Invalid argument in setSourceImage()");
* @param flags the bitwise OR of one or more of
* {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*}
*/
- public void compress(byte[] dstBuf, int flags) throws Exception {
+ public void compress(byte[] dstBuf, int flags) throws TJException {
if (dstBuf == null || flags < 0)
throw new IllegalArgumentException("Invalid argument in compress()");
if (srcBuf == null && srcBufInt == null && srcYUVImage == null)
* not be equal to the size of the JPEG image. Use {@link
* #getCompressedSize} to obtain the size of the JPEG image.
*/
- public byte[] compress(int flags) throws Exception {
+ public byte[] compress(int flags) throws TJException {
checkSourceImage();
byte[] buf = new byte[TJ.bufSize(srcWidth, srcHeight, subsamp)];
compress(buf, flags);
*/
@Deprecated
public void compress(BufferedImage srcImage, byte[] dstBuf, int flags)
- throws Exception {
+ throws TJException {
setSourceImage(srcImage, 0, 0, 0, 0);
compress(dstBuf, flags);
}
* {@link #compress(int)} instead.
*/
@Deprecated
- public byte[] compress(BufferedImage srcImage, int flags) throws Exception {
+ public byte[] compress(BufferedImage srcImage, int flags)
+ throws TJException {
setSourceImage(srcImage, 0, 0, 0, 0);
return compress(flags);
}
* @param flags the bitwise OR of one or more of
* {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*}
*/
- public void encodeYUV(YUVImage dstImage, int flags) throws Exception {
+ public void encodeYUV(YUVImage dstImage, int flags) throws TJException {
if (dstImage == null || flags < 0)
throw new IllegalArgumentException("Invalid argument in encodeYUV()");
if (srcBuf == null && srcBufInt == null)
* @deprecated Use {@link #encodeYUV(YUVImage, int)} instead.
*/
@Deprecated
- public void encodeYUV(byte[] dstBuf, int flags) throws Exception {
+ public void encodeYUV(byte[] dstBuf, int flags) throws TJException {
if(dstBuf == null)
throw new IllegalArgumentException("Invalid argument in encodeYUV()");
checkSourceImage();
*
* @return a YUV planar image.
*/
- public YUVImage encodeYUV(int pad, int flags) throws Exception {
+ public YUVImage encodeYUV(int pad, int flags) throws TJException {
checkSourceImage();
checkSubsampling();
if(pad < 1 || ((pad & (pad - 1)) != 0))
*
* @return a YUV planar image.
*/
- public YUVImage encodeYUV(int[] strides, int flags) throws Exception {
+ public YUVImage encodeYUV(int[] strides, int flags) throws TJException {
checkSourceImage();
checkSubsampling();
YUVImage yuvImage = new YUVImage(srcWidth, strides, srcHeight, subsamp);
* @deprecated Use {@link #encodeYUV(int, int)} instead.
*/
@Deprecated
- public byte[] encodeYUV(int flags) throws Exception {
+ public byte[] encodeYUV(int flags) throws TJException {
checkSourceImage();
checkSubsampling();
YUVImage yuvImage = new YUVImage(srcWidth, 4, srcHeight, subsamp);
*/
@Deprecated
public void encodeYUV(BufferedImage srcImage, byte[] dstBuf, int flags)
- throws Exception {
+ throws TJException {
setSourceImage(srcImage, 0, 0, 0, 0);
encodeYUV(dstBuf, flags);
}
* {@link #encodeYUV(int, int)} instead.
*/
@Deprecated
- public byte[] encodeYUV(BufferedImage srcImage, int flags) throws Exception {
+ public byte[] encodeYUV(BufferedImage srcImage, int flags)
+ throws TJException {
setSourceImage(srcImage, 0, 0, 0, 0);
return encodeYUV(flags);
}
* Free the native structures associated with this compressor instance.
*/
@Override
- public void close() throws IOException {
+ public void close() throws TJException {
if (handle != 0)
destroy();
}
protected void finalize() throws Throwable {
try {
close();
- } catch(Exception e) {
+ } catch(TJException e) {
} finally {
super.finalize();
}
};
- private native void init() throws Exception;
+ private native void init() throws TJException;
- private native void destroy() throws IOException;
+ private native void destroy() throws TJException;
// JPEG size in bytes is returned
+ @Deprecated
private native int compress(byte[] srcBuf, int width, int pitch,
int height, int pixelFormat, byte[] dstBuf, int jpegSubsamp, int jpegQual,
- int flags) throws Exception; // deprecated
+ int flags) throws TJException;
private native int compress(byte[] srcBuf, int x, int y, int width,
int pitch, int height, int pixelFormat, byte[] dstBuf, int jpegSubsamp,
- int jpegQual, int flags) throws Exception;
+ int jpegQual, int flags) throws TJException;
+ @Deprecated
private native int compress(int[] srcBuf, int width, int stride,
int height, int pixelFormat, byte[] dstBuf, int jpegSubsamp, int jpegQual,
- int flags) throws Exception; // deprecated
+ int flags) throws TJException;
private native int compress(int[] srcBuf, int x, int y, int width,
int stride, int height, int pixelFormat, byte[] dstBuf, int jpegSubsamp,
- int jpegQual, int flags) throws Exception;
+ int jpegQual, int flags) throws TJException;
private native int compressFromYUV(byte[][] srcPlanes, int[] srcOffsets,
int width, int[] srcStrides, int height, int subsamp, byte[] dstBuf,
int jpegQual, int flags)
- throws Exception;
+ throws TJException;
+ @Deprecated
private native void encodeYUV(byte[] srcBuf, int width, int pitch,
int height, int pixelFormat, byte[] dstBuf, int subsamp, int flags)
- throws Exception; // deprecated
+ throws TJException;
private native void encodeYUV(byte[] srcBuf, int x, int y, int width,
int pitch, int height, int pixelFormat, byte[][] dstPlanes,
int[] dstOffsets, int[] dstStrides, int subsamp, int flags)
- throws Exception;
+ throws TJException;
+ @Deprecated
private native void encodeYUV(int[] srcBuf, int width, int stride,
int height, int pixelFormat, byte[] dstBuf, int subsamp, int flags)
- throws Exception; // deprecated
+ throws TJException;
private native void encodeYUV(int[] srcBuf, int x, int y, int width,
int srcStride, int height, int pixelFormat, byte[][] dstPlanes,
int[] dstOffsets, int[] dstStrides, int subsamp, int flags)
- throws Exception;
+ throws TJException;
static {
TJLoader.load();
void customFilter(ShortBuffer coeffBuffer, Rectangle bufferRegion,
Rectangle planeRegion, int componentID, int transformID,
TJTransform transform)
- throws Exception;
+ throws TJException;
}
/*
* Copyright (C)2011-2015 D. R. Commander. All Rights Reserved.
+ * Copyright (C)2015 Viktor Szathmáry. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
/**
* Create a TurboJPEG decompresssor instance.
*/
- public TJDecompressor() throws Exception {
+ public TJDecompressor() throws TJException {
init();
}
* @param jpegImage JPEG image buffer (size of the JPEG image is assumed to
* be the length of the array.) This buffer is not modified.
*/
- public TJDecompressor(byte[] jpegImage) throws Exception {
+ public TJDecompressor(byte[] jpegImage) throws TJException {
init();
setSourceImage(jpegImage, jpegImage.length);
}
*
* @param imageSize size of the JPEG image (in bytes)
*/
- public TJDecompressor(byte[] jpegImage, int imageSize) throws Exception {
+ public TJDecompressor(byte[] jpegImage, int imageSize) throws TJException {
init();
setSourceImage(jpegImage, imageSize);
}
* @param yuvImage {@link YUVImage} instance containing a YUV planar
* image to be decoded. This image is not modified.
*/
- public TJDecompressor(YUVImage yuvImage) throws Exception {
+ public TJDecompressor(YUVImage yuvImage) throws TJException {
init();
setSourceImage(yuvImage);
}
* @param imageSize size of the JPEG image (in bytes)
*/
public void setSourceImage(byte[] jpegImage, int imageSize)
- throws Exception {
+ throws TJException {
if (jpegImage == null || imageSize < 1)
throw new IllegalArgumentException("Invalid argument in setSourceImage()");
jpegBuf = jpegImage;
* @deprecated Use {@link #setSourceImage(byte[], int)} instead.
*/
@Deprecated
- public void setJPEGImage(byte[] jpegImage, int imageSize) throws Exception {
+ public void setJPEGImage(byte[] jpegImage, int imageSize)
+ throws TJException {
setSourceImage(jpegImage, imageSize);
}
* @param srcImage {@link YUVImage} instance containing a YUV planar image to
* be decoded. This image is not modified.
*/
- public void setSourceImage(YUVImage srcImage) throws Exception {
+ public void setSourceImage(YUVImage srcImage) {
if (srcImage == null)
throw new IllegalArgumentException("Invalid argument in setSourceImage()");
yuvImage = srcImage;
* decompressor can generate without exceeding the desired image width and
* height.
*/
- public int getScaledWidth(int desiredWidth, int desiredHeight)
- throws Exception {
+ public int getScaledWidth(int desiredWidth, int desiredHeight) {
if (jpegWidth < 1 || jpegHeight < 1)
throw new IllegalStateException(NO_ASSOC_ERROR);
if (desiredWidth < 0 || desiredHeight < 0)
* decompressor can generate without exceeding the desired image width and
* height.
*/
- public int getScaledHeight(int desiredWidth, int desiredHeight)
- throws Exception {
+ public int getScaledHeight(int desiredWidth, int desiredHeight) {
if (jpegWidth < 1 || jpegHeight < 1)
throw new IllegalStateException(NO_ASSOC_ERROR);
if (desiredWidth < 0 || desiredHeight < 0)
*/
public void decompress(byte[] dstBuf, int x, int y, int desiredWidth,
int pitch, int desiredHeight, int pixelFormat,
- int flags) throws Exception {
+ int flags) throws TJException {
if (jpegBuf == null && yuvImage == null)
throw new IllegalStateException(NO_ASSOC_ERROR);
if (dstBuf == null || x < 0 || y < 0 || pitch < 0 ||
@Deprecated
public void decompress(byte[] dstBuf, int desiredWidth, int pitch,
int desiredHeight, int pixelFormat, int flags)
- throws Exception {
+ throws TJException {
decompress(dstBuf, 0, 0, desiredWidth, pitch, desiredHeight, pixelFormat,
flags);
}
* @return a buffer containing the decompressed image.
*/
public byte[] decompress(int desiredWidth, int pitch, int desiredHeight,
- int pixelFormat, int flags) throws Exception {
+ int pixelFormat, int flags) throws TJException {
if (pitch < 0 ||
(yuvImage == null && (desiredWidth < 0 || desiredHeight < 0)) ||
pixelFormat < 0 || pixelFormat >= TJ.NUMPF || flags < 0)
* @param flags the bitwise OR of one or more of
* {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*}
*/
- public void decompressToYUV(YUVImage dstImage, int flags) throws Exception {
+ public void decompressToYUV(YUVImage dstImage, int flags)
+ throws TJException {
if (jpegBuf == null)
throw new IllegalStateException(NO_ASSOC_ERROR);
if (dstImage == null || flags < 0)
* @deprecated Use {@link #decompressToYUV(YUVImage, int)} instead.
*/
@Deprecated
- public void decompressToYUV(byte[] dstBuf, int flags) throws Exception {
+ public void decompressToYUV(byte[] dstBuf, int flags) throws TJException {
YUVImage dstImage = new YUVImage(dstBuf, jpegWidth, 4, jpegHeight,
jpegSubsamp);
decompressToYUV(dstImage, flags);
*/
public YUVImage decompressToYUV(int desiredWidth, int[] strides,
int desiredHeight,
- int flags) throws Exception {
+ int flags) throws TJException {
if (flags < 0)
throw new IllegalArgumentException("Invalid argument in decompressToYUV()");
if (jpegWidth < 1 || jpegHeight < 1 || jpegSubsamp < 0)
* @return a YUV planar image.
*/
public YUVImage decompressToYUV(int desiredWidth, int pad, int desiredHeight,
- int flags) throws Exception {
+ int flags) throws TJException {
if (flags < 0)
throw new IllegalArgumentException("Invalid argument in decompressToYUV()");
if (jpegWidth < 1 || jpegHeight < 1 || jpegSubsamp < 0)
* @deprecated Use {@link #decompressToYUV(int, int, int, int)} instead.
*/
@Deprecated
- public byte[] decompressToYUV(int flags) throws Exception {
+ public byte[] decompressToYUV(int flags) throws TJException {
YUVImage dstImage = new YUVImage(jpegWidth, 4, jpegHeight, jpegSubsamp);
decompressToYUV(dstImage, flags);
return dstImage.getBuf();
*/
public void decompress(int[] dstBuf, int x, int y, int desiredWidth,
int stride, int desiredHeight, int pixelFormat,
- int flags) throws Exception {
+ int flags) throws TJException {
if (jpegBuf == null && yuvImage == null)
throw new IllegalStateException(NO_ASSOC_ERROR);
if (dstBuf == null || x < 0 || y < 0 || stride < 0 ||
* @param flags the bitwise OR of one or more of
* {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*}
*/
- public void decompress(BufferedImage dstImage, int flags) throws Exception {
+ public void decompress(BufferedImage dstImage, int flags)
+ throws TJException {
if (dstImage == null || flags < 0)
throw new IllegalArgumentException("Invalid argument in decompress()");
int desiredWidth = dstImage.getWidth();
*/
public BufferedImage decompress(int desiredWidth, int desiredHeight,
int bufferedImageType, int flags)
- throws Exception {
+ throws TJException {
if ((yuvImage == null && (desiredWidth < 0 || desiredHeight < 0)) ||
flags < 0)
throw new IllegalArgumentException("Invalid argument in decompress()");
* Free the native structures associated with this decompressor instance.
*/
@Override
- public void close() throws IOException {
+ public void close() throws TJException {
if (handle != 0)
destroy();
}
protected void finalize() throws Throwable {
try {
close();
- } catch(Exception e) {
+ } catch(TJException e) {
} finally {
super.finalize();
}
};
- private native void init() throws Exception;
+ private native void init() throws TJException;
- private native void destroy() throws IOException;
+ private native void destroy() throws TJException;
private native void decompressHeader(byte[] srcBuf, int size)
- throws Exception;
+ throws TJException;
+ @Deprecated
private native void decompress(byte[] srcBuf, int size, byte[] dstBuf,
int desiredWidth, int pitch, int desiredHeight, int pixelFormat, int flags)
- throws Exception; // deprecated
+ throws TJException;
private native void decompress(byte[] srcBuf, int size, byte[] dstBuf, int x,
int y, int desiredWidth, int pitch, int desiredHeight, int pixelFormat,
- int flags) throws Exception;
+ int flags) throws TJException;
+ @Deprecated
private native void decompress(byte[] srcBuf, int size, int[] dstBuf,
int desiredWidth, int stride, int desiredHeight, int pixelFormat,
- int flags) throws Exception; // deprecated
+ int flags) throws TJException;
private native void decompress(byte[] srcBuf, int size, int[] dstBuf, int x,
int y, int desiredWidth, int stride, int desiredHeight, int pixelFormat,
- int flags) throws Exception;
+ int flags) throws TJException;
+ @Deprecated
private native void decompressToYUV(byte[] srcBuf, int size, byte[] dstBuf,
- int flags) throws Exception; // deprecated
+ int flags) throws TJException;
private native void decompressToYUV(byte[] srcBuf, int size,
byte[][] dstPlanes, int[] dstOffsets, int desiredWidth, int[] dstStrides,
- int desiredheight, int flags) throws Exception;
+ int desiredheight, int flags) throws TJException;
private native void decodeYUV(byte[][] srcPlanes, int[] srcOffsets,
int[] srcStrides, int subsamp, byte[] dstBuf, int x, int y, int width,
- int pitch, int height, int pixelFormat, int flags) throws Exception;
+ int pitch, int height, int pixelFormat, int flags) throws TJException;
private native void decodeYUV(byte[][] srcPlanes, int[] srcOffsets,
int[] srcStrides, int subsamp, int[] dstBuf, int x, int y, int width,
- int stride, int height, int pixelFormat, int flags) throws Exception;
+ int stride, int height, int pixelFormat, int flags) throws TJException;
static {
TJLoader.load();
--- /dev/null
+/*
+ * Copyright (C)2015 Viktor Szathmáry. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * - Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * - Neither the name of the libjpeg-turbo Project nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS",
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package org.libjpegturbo.turbojpeg;
+
+import java.io.IOException;
+
+public class TJException extends IOException {
+
+ private static final long serialVersionUID = 1L;
+
+ public TJException() {
+ super();
+ }
+
+ public TJException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ public TJException(String message) {
+ super(message);
+ }
+
+ public TJException(Throwable cause) {
+ super(cause);
+ }
+
+}
/*
* Copyright (C)2011 D. R. Commander. All Rights Reserved.
+ * Copyright (C)2015 Viktor Szathmáry. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* TJCustomFilter} interface, or null if no custom filter is needed
*/
public TJTransform(int x, int y, int w, int h, int op, int options,
- TJCustomFilter cf) throws Exception {
+ TJCustomFilter cf) {
super(x, y, w, h);
this.op = op;
this.options = options;
* TJCustomFilter} interface, or null if no custom filter is needed
*/
public TJTransform(Rectangle r, int op, int options,
- TJCustomFilter cf) throws Exception {
+ TJCustomFilter cf) {
super(r);
this.op = op;
this.options = options;
/*
* Copyright (C)2011, 2013-2015 D. R. Commander. All Rights Reserved.
+ * Copyright (C)2015 Viktor Szathmáry. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
/**
* Create a TurboJPEG lossless transformer instance.
*/
- public TJTransformer() throws Exception {
+ public TJTransformer() throws TJException {
init();
}
* @param jpegImage JPEG image buffer (size of the JPEG image is assumed to
* be the length of the array.) This buffer is not modified.
*/
- public TJTransformer(byte[] jpegImage) throws Exception {
+ public TJTransformer(byte[] jpegImage) throws TJException {
init();
setSourceImage(jpegImage, jpegImage.length);
}
*
* @param imageSize size of the JPEG image (in bytes)
*/
- public TJTransformer(byte[] jpegImage, int imageSize) throws Exception {
+ public TJTransformer(byte[] jpegImage, int imageSize) throws TJException {
init();
setSourceImage(jpegImage, imageSize);
}
* {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*}
*/
public void transform(byte[][] dstBufs, TJTransform[] transforms,
- int flags) throws Exception {
+ int flags) throws TJException {
if (jpegBuf == null)
throw new IllegalStateException("JPEG buffer not initialized");
transformedSizes = transform(jpegBuf, jpegBufSize, dstBufs, transforms,
* {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*}
*/
public TJDecompressor[] transform(TJTransform[] transforms, int flags)
- throws Exception {
+ throws TJException {
byte[][] dstBufs = new byte[transforms.length][];
if (jpegWidth < 1 || jpegHeight < 1)
throw new IllegalStateException("JPEG buffer not initialized");
return transformedSizes;
}
- private native void init() throws Exception;
+ private native void init() throws TJException;
private native int[] transform(byte[] srcBuf, int srcSize, byte[][] dstBufs,
- TJTransform[] transforms, int flags) throws Exception;
+ TJTransform[] transforms, int flags) throws TJException;
static {
TJLoader.load();
/*
* Copyright (C)2014 D. R. Commander. All Rights Reserved.
+ * Copyright (C)2015 Viktor Szathmáry. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* @param subsamp the level of chrominance subsampling to be used in the YUV
* image (one of {@link TJ#SAMP_444 TJ.SAMP_*})
*/
- public YUVImage(int width, int[] strides, int height, int subsamp)
- throws Exception {
+ public YUVImage(int width, int[] strides, int height, int subsamp) {
setBuf(null, null, width, strides, height, subsamp, true);
}
* @param subsamp the level of chrominance subsampling to be used in the YUV
* image (one of {@link TJ#SAMP_444 TJ.SAMP_*})
*/
- public YUVImage(int width, int pad, int height, int subsamp)
- throws Exception {
+ public YUVImage(int width, int pad, int height, int subsamp) {
setBuf(new byte[TJ.bufSizeYUV(width, pad, height, subsamp)], width, pad,
height, subsamp);
}
* image (one of {@link TJ#SAMP_444 TJ.SAMP_*})
*/
public YUVImage(byte[][] planes, int[] offsets, int width, int[] strides,
- int height, int subsamp) throws Exception {
+ int height, int subsamp) {
setBuf(planes, offsets, width, strides, height, subsamp, false);
}
* image (one of {@link TJ#SAMP_444 TJ.SAMP_*})
*/
public YUVImage(byte[] yuvImage, int width, int pad, int height,
- int subsamp) throws Exception {
+ int subsamp) {
setBuf(yuvImage, width, pad, height, subsamp);
}
* image (one of {@link TJ#SAMP_444 TJ.SAMP_*})
*/
public void setBuf(byte[][] planes, int[] offsets, int width, int strides[],
- int height, int subsamp) throws Exception {
+ int height, int subsamp) {
setBuf(planes, offsets, width, strides, height, subsamp, false);
}
private void setBuf(byte[][] planes, int[] offsets, int width, int strides[],
- int height, int subsamp, boolean alloc) throws Exception {
+ int height, int subsamp, boolean alloc) {
if ((planes == null && !alloc) || width < 1 || height < 1 || subsamp < 0 ||
subsamp >= TJ.NUMSAMP)
throw new IllegalArgumentException("Invalid argument in YUVImage::setBuf()");
* image (one of {@link TJ#SAMP_444 TJ.SAMP_*})
*/
public void setBuf(byte[] yuvImage, int width, int pad, int height,
- int subsamp) throws Exception {
+ int subsamp) {
if (yuvImage == null || width < 1 || pad < 1 || ((pad & (pad - 1)) != 0) ||
height < 1 || subsamp < 0 || subsamp >= TJ.NUMSAMP)
throw new IllegalArgumentException("Invalid argument in YUVImage::setBuf()");
*
* @return the size (in bytes) of the YUV image buffer
*/
- public int getSize() throws Exception {
+ public int getSize() {
if (yuvPlanes == null || yuvSubsamp < 0 || yuvSubsamp >= TJ.NUMSAMP)
throw new IllegalStateException(NO_ASSOC_ERROR);
int nc = (yuvSubsamp == TJ.SAMP_GRAY ? 1 : 3);
goto bailout; \
}
-#define _throwio(msg) _throw(msg, "java/io/IOException")
-
-#define _throwtj() _throw(tjGetErrorStr(), "java/lang/Exception")
+#define _throwtj() _throw(tjGetErrorStr(), "org/libjpegturbo/turbojpeg/TJException")
#define _throwarg(msg) _throw(msg, "java/lang/IllegalArgumentException")
(JNIEnv *env, jclass cls, jint width, jint height, jint jpegSubsamp)
{
jint retval=(jint)tjBufSize(width, height, jpegSubsamp);
- if(retval==-1) _throwtj();
+ if(retval==-1) _throwarg(tjGetErrorStr());
bailout:
return retval;
(JNIEnv *env, jclass cls, jint width, jint pad, jint height, jint subsamp)
{
jint retval=(jint)tjBufSizeYUV2(width, pad, height, subsamp);
- if(retval==-1) _throwtj();
+ if(retval==-1) _throwarg(tjGetErrorStr());
bailout:
return retval;
{
jint retval=(jint)tjPlaneSizeYUV(componentID, width, stride, height,
subsamp);
- if(retval==-1) _throwtj();
+ if(retval==-1) _throwarg(tjGetErrorStr());
bailout:
return retval;
(JNIEnv *env, jclass cls, jint componentID, jint width, jint subsamp)
{
jint retval=(jint)tjPlaneWidth(componentID, width, subsamp);
- if(retval==-1) _throwtj();
+ if(retval==-1) _throwarg(tjGetErrorStr());
bailout:
return retval;
(JNIEnv *env, jclass cls, jint componentID, jint height, jint subsamp)
{
jint retval=(jint)tjPlaneHeight(componentID, height, subsamp);
- if(retval==-1) _throwtj();
+ if(retval==-1) _throwarg(tjGetErrorStr());
bailout:
return retval;
int pw=tjPlaneWidth(i, width, subsamp);
if(planeSize<0 || pw<0)
- _throwtj();
+ _throwarg(tjGetErrorStr());
if(srcOffsets[i]<0)
_throwarg("Invalid argument in compressFromYUV()");
int pw=tjPlaneWidth(i, width, subsamp);
if(planeSize<0 || pw<0)
- _throwtj();
+ _throwarg(tjGetErrorStr());
if(dstOffsets[i]<0)
_throwarg("Invalid argument in encodeYUV()");
gethandle();
- if(tjDestroy(handle)==-1) _throwio(tjGetErrorStr());
+ if(tjDestroy(handle)==-1) _throwtj();
(*env)->SetLongField(env, obj, _fid, 0);
bailout:
jobjectArray sfjava=NULL;
if((sf=tjGetScalingFactors(&n))==NULL || n==0)
- _throwtj();
+ _throwarg(tjGetErrorStr());
bailif0(sfcls=(*env)->FindClass(env, "org/libjpegturbo/turbojpeg/TJScalingFactor"));
bailif0(sfjava=(jobjectArray)(*env)->NewObjectArray(env, n, sfcls, 0));
if(height==0) height=jpegHeight;
sf=tjGetScalingFactors(&nsf);
if(!sf || nsf<1)
- _throwtj();
+ _throwarg(tjGetErrorStr());
for(i=0; i<nsf; i++)
{
scaledWidth=TJSCALED(jpegWidth, sf[i]);
int pw=tjPlaneWidth(i, scaledWidth, jpegSubsamp);
if(planeSize<0 || pw<0)
- _throwtj();
+ _throwarg(tjGetErrorStr());
if(dstOffsets[i]<0)
_throwarg("Invalid argument in decompressToYUV()");
int pw=tjPlaneWidth(i, width, subsamp);
if(planeSize<0 || pw<0)
- _throwtj();
+ _throwarg(tjGetErrorStr());
if(srcOffsets[i]<0)
_throwarg("Invalid argument in decodeYUV()");