(ChangeLog update forthcoming)
- Prefix all function names with "tj3" and remove version suffixes from
function names. (Future API overhauls will increment the prefix to
"tj4", etc., thus retaining backward API/ABI compatibility without
versioning each individual function.)
- Replace stateless boolean flags (including TJ*FLAG_ARITHMETIC and
TJ*FLAG_LOSSLESS, which were never released) with stateful integer
parameters, the value of which persists between function calls.
* Use parameters for the JPEG quality and subsampling as well, in
order to eliminate the awkwardness of specifying function arguments
that weren't relevant for lossless compression.
* tj3DecompressHeader() now stores all relevant information about the
JPEG image, including the width, height, subsampling type, entropy
coding type, etc. in parameters rather than returning that
information in its arguments.
* TJ*FLAG_LIMITSCANS has been reimplemented as an integer parameter
(TJ*PARAM_SCANLIMIT) that allows the number of scans to be
specified.
- Use the const keyword for all pointer arguments to unmodified
buffers, as well as for both dimensions of 2D pointers. Addresses
#395.
- Use size_t rather than unsigned long to represent buffer sizes, since
unsigned long is a 32-bit type on Windows. Addresses #24.
- Return 0 from all buffer size functions if an error occurs, rather
than awkwardly trying to return -1 in an unsigned data type.
- Implement 12-bit and 16-bit data precision using dedicated
compression, decompression, and image I/O functions/methods.
* Suffix the names of all data-precision-specific functions with 8,
12, or 16.
* Because the YUV functions are intended to be used for video, they
are currently only implemented with 8-bit data precision, but they
can be expanded to 12-bit data precision in the future, if
necessary.
* Extend TJUnitTest and TJBench to test 12-bit and 16-bit data
precision, using a new -precision option.
* Add appropriate regression tests for all of the above to the 'test'
target.
* Extend tjbenchtest to test 12-bit and 16-bit data precision, and
add separate 'tjtest12' and 'tjtest16' targets.
* BufferedImage I/O in the Java API is currently limited to 8-bit
data precision, since the BufferedImage class does not
straightforwardly support higher data precisions.
* Extend the PPM reader to convert 12-bit and 16-bit PBMPLUS files
to grayscale or CMYK pixels, as it already does for 8-bit files.
- Properly accommodate lossless JPEG using dedicated parameters
(TJ*PARAM_LOSSLESS, TJ*PARAM_LOSSLESSPSV, and TJ*PARAM_LOSSLESSPT),
rather than using a flag and awkwardly repurposing the JPEG quality.
Update TJBench to properly reflect whether a JPEG image is lossless.
- Re-organize the TJBench usage screen.
- Update the Java docs using Java 11, to improve the formatting and
eliminate HTML frames.
- Use the accurate integer DCT algorithm by default for both
compression and decompression, since the "fast" algorithm is a legacy
feature, it does not pass the ISO compliance tests, and it is not
actually faster on modern x86 CPUs.
* Remove the -accuratedct option from TJBench and TJExample.
- Re-implement the 'tjtest' target using a CMake script that enables
the appropriate tests, depending on the data precision and whether or
not the Java API is part of the build.
- Consolidate the C and Java versions of tjbenchtest into one script.
- Consolidate the C and Java versions of tjexampletest into one script.
- Combine all initialization functions into a single function
(tj3Init()) that accepts an integer parameter specifying the
subsystems to initialize.
- Enable decompression scaling explicitly, using a new function/method
(tj3SetScalingFactor()/TJDecompressor.setScalingFactor()), rather
than implicitly using awkward "desired width"/"desired height"
parameters.
- Introduce a new macro/constant (TJUNSCALED/TJ.UNSCALED) that maps to
a scaling factor of 1/1.
- Implement partial image decompression, using a new function/method
(tj3SetCroppingRegion()/TJDecompressor.setCroppingRegion()) and
TJBench option (-crop). Extend tjbenchtest to test the new feature.
Addresses #1.
- Allow the JPEG colorspace to be specified explicitly when
compressing, using a new parameter (TJ*PARAM_COLORSPACE). This
allows JPEG images with the RGB and CMYK colorspaces to be created.
- Remove the error/difference image feature from TJBench. Identical
images to the ones that TJBench created can be generated using
ImageMagick with
'magick composite <original_image> <output_image> -compose difference <diff_image>'
- Handle JPEG images with unknown subsampling types. TJ*PARAM_SUBSAMP
is set to TJ*SAMP_UNKNOWN (== -1) for such images, but they can still
be decompressed fully into packed-pixel images or losslessly
transformed (with the exception of lossless cropping.) They cannot
be partially decompressed or decompressed into planar YUV images.
Note also that TJBench, due to its lack of support for imperfect
transforms, requires that the subsampling type be known when
rotating, flipping, or transversely transposing an image. Addresses
#436
- The Java version of TJBench now has identical functionality to the C
version. This was accomplished by (somewhat hackishly) calling the
TurboJPEG C image I/O functions through JNI and copying the pixels
between the C heap and the Java heap.
- Add parameters (TJ*PARAM_RESTARTROWS and TJ*PARAM_RESTARTBLOCKS) and
a TJBench option (-restart) to allow the restart marker interval to
be specified when compressing. Eliminate the undocumented TJ_RESTART
environment variable.
- Add a parameter (TJ*PARAM_OPTIMIZE), a transform option
(TJ*OPT_OPTIMIZE), and a TJBench option (-optimize) to allow
optimized baseline Huffman coding to be specified when compressing.
Eliminate the undocumented TJ_OPTIMIZE environment variable.
- Add parameters (TJ*PARAM_XDENSITY, TJ*PARAM_DENSITY, and
TJ*DENSITYUNITS) to allow the pixel density to be specified when
compressing or saving a Windows BMP image and to be queried when
decompressing or loading a Windows BMP image. Addresses #77.
- Refactor the fuzz targets to use the new API.
* Extend decompression coverage to 12-bit and 16-bit data precision.
* Replace the awkward cjpeg12 and cjpeg16 targets with proper
TurboJPEG-based compress12, compress12-lossless, and
compress16-lossless targets
- Fix innocuous UBSan warnings uncovered by the new fuzzers.
- Implement previous versions of the TurboJPEG API by wrapping the new
functions (tested by running the 2.1.x versions of TJBench, via
tjbenchtest, and TJUnitTest against the new implementation.)
* Remove all JNI functions for deprecated Java methods and implement
the deprecated methods using pure Java wrappers. It should be
understood that backward API compatibility in Java applies only to
the Java classes and that one cannot mix and match a JAR file from
one version of libjpeg-turbo with a JNI library from another
version.
- tj3Destroy() now silently accepts a NULL handle.
- tj3Alloc() and tj3Free() now return/accept void pointers, as malloc()
and free() do.
- The image I/O functions now accept a TurboJPEG instance handle, which
is used to transmit/receive parameters and to receive error
information.
Closes #517
1126 lines
50 KiB
HTML
1126 lines
50 KiB
HTML
<!DOCTYPE HTML>
|
|
<!-- NewPage -->
|
|
<html lang="en">
|
|
<head>
|
|
<!-- Generated by javadoc -->
|
|
<title>TJCompressor</title>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
|
|
<link rel="stylesheet" type="text/css" href="../../../jquery/jquery-ui.min.css" title="Style">
|
|
<link rel="stylesheet" type="text/css" href="../../../jquery-ui.overrides.css" title="Style">
|
|
<script type="text/javascript" src="../../../script.js"></script>
|
|
<script type="text/javascript" src="../../../jquery/jszip/dist/jszip.min.js"></script>
|
|
<script type="text/javascript" src="../../../jquery/jszip-utils/dist/jszip-utils.min.js"></script>
|
|
<!--[if IE]>
|
|
<script type="text/javascript" src="../../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script>
|
|
<![endif]-->
|
|
<script type="text/javascript" src="../../../jquery/jquery-3.6.0.min.js"></script>
|
|
<script type="text/javascript" src="../../../jquery/jquery-ui.min.js"></script>
|
|
</head>
|
|
<body>
|
|
<script type="text/javascript"><!--
|
|
try {
|
|
if (location.href.indexOf('is-external=true') == -1) {
|
|
parent.document.title="TJCompressor";
|
|
}
|
|
}
|
|
catch(err) {
|
|
}
|
|
//-->
|
|
var data = {"i0":10,"i1":10,"i2":10,"i3":42,"i4":42,"i5":10,"i6":10,"i7":42,"i8":42,"i9":10,"i10":42,"i11":10,"i12":10,"i13":10,"i14":10,"i15":42,"i16":10,"i17":10,"i18":10,"i19":10,"i20":10,"i21":42};
|
|
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"],32:["t6","Deprecated Methods"]};
|
|
var altColor = "altColor";
|
|
var rowColor = "rowColor";
|
|
var tableTab = "tableTab";
|
|
var activeTableTab = "activeTableTab";
|
|
var pathtoroot = "../../../";
|
|
var useModuleDirectories = true;
|
|
loadScripts(document, 'script');</script>
|
|
<noscript>
|
|
<div>JavaScript is disabled on your browser.</div>
|
|
</noscript>
|
|
<header role="banner">
|
|
<nav role="navigation">
|
|
<div class="fixedNav">
|
|
<!-- ========= START OF TOP NAVBAR ======= -->
|
|
<div class="topNav"><a id="navbar.top">
|
|
<!-- -->
|
|
</a>
|
|
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
|
|
<a id="navbar.top.firstrow">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="navList" title="Navigation">
|
|
<li><a href="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" id="allclasses_navbar_top">
|
|
<li><a href="../../../allclasses.html">All Classes</a></li>
|
|
</ul>
|
|
<ul class="navListSearch">
|
|
<li><label for="search">SEARCH:</label>
|
|
<input type="text" id="search" value="search" disabled="disabled">
|
|
<input type="reset" id="reset" value="reset" disabled="disabled">
|
|
</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>
|
|
<noscript>
|
|
<div>JavaScript is disabled on your browser.</div>
|
|
</noscript>
|
|
</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="#method.summary">Method</a></li>
|
|
</ul>
|
|
<ul class="subNavList">
|
|
<li>Detail: </li>
|
|
<li>Field | </li>
|
|
<li><a href="#constructor.detail">Constr</a> | </li>
|
|
<li><a href="#method.detail">Method</a></li>
|
|
</ul>
|
|
</div>
|
|
<a id="skip.navbar.top">
|
|
<!-- -->
|
|
</a></div>
|
|
<!-- ========= END OF TOP NAVBAR ========= -->
|
|
</div>
|
|
<div class="navPadding"> </div>
|
|
<script type="text/javascript"><!--
|
|
$('.navPadding').css('padding-top', $('.fixedNav').css("height"));
|
|
//-->
|
|
</script>
|
|
</nav>
|
|
</header>
|
|
<!-- ======== START OF CLASS DATA ======== -->
|
|
<main role="main">
|
|
<div class="header">
|
|
<div class="subTitle"><span class="packageLabelInType">Package</span> <a href="package-summary.html">org.libjpegturbo.turbojpeg</a></div>
|
|
<h2 title="Class TJCompressor" class="title">Class TJCompressor</h2>
|
|
</div>
|
|
<div class="contentContainer">
|
|
<ul class="inheritance">
|
|
<li>java.lang.Object</li>
|
|
<li>
|
|
<ul class="inheritance">
|
|
<li>org.libjpegturbo.turbojpeg.TJCompressor</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<div class="description">
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<dl>
|
|
<dt>All Implemented Interfaces:</dt>
|
|
<dd><code>java.io.Closeable</code>, <code>java.lang.AutoCloseable</code></dd>
|
|
</dl>
|
|
<hr>
|
|
<pre>public class <span class="typeNameLabel">TJCompressor</span>
|
|
extends java.lang.Object
|
|
implements java.io.Closeable</pre>
|
|
<div class="block">TurboJPEG compressor</div>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
<div class="summary">
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
|
|
<section>
|
|
<ul class="blockList">
|
|
<li class="blockList"><a id="constructor.summary">
|
|
<!-- -->
|
|
</a>
|
|
<h3>Constructor Summary</h3>
|
|
<table class="memberSummary">
|
|
<caption><span>Constructors</span><span class="tabEnd"> </span></caption>
|
|
<tr>
|
|
<th class="colFirst" scope="col">Constructor</th>
|
|
<th class="colLast" scope="col">Description</th>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="#%3Cinit%3E()">TJCompressor</a></span>()</code></th>
|
|
<td class="colLast">
|
|
<div class="block">Create a TurboJPEG compressor instance.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="#%3Cinit%3E(byte%5B%5D,int,int,int,int,int,int)">TJCompressor</a></span>​(byte[] srcImage,
|
|
int x,
|
|
int y,
|
|
int width,
|
|
int pitch,
|
|
int height,
|
|
int pixelFormat)</code></th>
|
|
<td class="colLast">
|
|
<div class="block">Create a TurboJPEG compressor instance and associate the 8-bit-per-sample
|
|
packed-pixel source image stored in <code>srcImage</code> with the newly
|
|
created instance.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="#%3Cinit%3E(java.awt.image.BufferedImage,int,int,int,int)">TJCompressor</a></span>​(java.awt.image.BufferedImage srcImage,
|
|
int x,
|
|
int y,
|
|
int width,
|
|
int height)</code></th>
|
|
<td class="colLast">
|
|
<div class="block">Create a TurboJPEG compressor instance and associate the 8-bit-per-sample
|
|
packed-pixel source image stored in <code>srcImage</code> with the newly
|
|
created instance.</div>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</li>
|
|
</ul>
|
|
</section>
|
|
<!-- ========== METHOD SUMMARY =========== -->
|
|
<section>
|
|
<ul class="blockList">
|
|
<li class="blockList"><a id="method.summary">
|
|
<!-- -->
|
|
</a>
|
|
<h3>Method Summary</h3>
|
|
<table class="memberSummary">
|
|
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </span></span><span id="t6" class="tableTab"><span><a href="javascript:show(32);">Deprecated Methods</a></span><span class="tabEnd"> </span></span></caption>
|
|
<tr>
|
|
<th class="colFirst" scope="col">Modifier and Type</th>
|
|
<th class="colSecond" scope="col">Method</th>
|
|
<th class="colLast" scope="col">Description</th>
|
|
</tr>
|
|
<tr id="i0" class="altColor">
|
|
<td class="colFirst"><code>void</code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#close()">close</a></span>()</code></th>
|
|
<td class="colLast">
|
|
<div class="block">Free the native structures associated with this compressor instance.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i1" class="rowColor">
|
|
<td class="colFirst"><code>byte[]</code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#compress()">compress</a></span>()</code></th>
|
|
<td class="colLast">
|
|
<div class="block">Compress the packed-pixel or planar YUV source image associated with this
|
|
compressor instance and return a buffer containing a JPEG image.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i2" class="altColor">
|
|
<td class="colFirst"><code>void</code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#compress(byte%5B%5D)">compress</a></span>​(byte[] dstBuf)</code></th>
|
|
<td class="colLast">
|
|
<div class="block">Compress the packed-pixel or planar YUV source image associated with this
|
|
compressor instance and output a JPEG image to the given destination
|
|
buffer.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i3" class="rowColor">
|
|
<td class="colFirst"><code>void</code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#compress(byte%5B%5D,int)">compress</a></span>​(byte[] dstBuf,
|
|
int flags)</code></th>
|
|
<td class="colLast">
|
|
<div class="block"><span class="deprecatedLabel">Deprecated.</span>
|
|
<div class="deprecationComment">Use <a href="#set(int,int)"><code>set()</code></a> and <a href="#compress(byte%5B%5D)"><code>compress(byte[])</code></a> instead.</div>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i4" class="altColor">
|
|
<td class="colFirst"><code>byte[]</code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#compress(int)">compress</a></span>​(int flags)</code></th>
|
|
<td class="colLast">
|
|
<div class="block"><span class="deprecatedLabel">Deprecated.</span>
|
|
<div class="deprecationComment">Use <a href="#set(int,int)"><code>set()</code></a> and <a href="#compress()"><code>compress()</code></a> instead.</div>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i5" class="rowColor">
|
|
<td class="colFirst"><code><a href="YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a></code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#encodeYUV(int)">encodeYUV</a></span>​(int align)</code></th>
|
|
<td class="colLast">
|
|
<div class="block">Encode the 8-bit-per-sample packed-pixel source image associated with this
|
|
compressor instance into an 8-bit-per-sample unified planar YUV image and
|
|
return a <a href="YUVImage.html" title="class in org.libjpegturbo.turbojpeg"><code>YUVImage</code></a> instance containing the encoded image.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i6" class="altColor">
|
|
<td class="colFirst"><code><a href="YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a></code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#encodeYUV(int%5B%5D)">encodeYUV</a></span>​(int[] strides)</code></th>
|
|
<td class="colLast">
|
|
<div class="block">Encode the 8-bit-per-sample packed-pixel source image associated with this
|
|
compressor instance into separate 8-bit-per-sample Y, U (Cb), and V (Cr)
|
|
image planes and return a <a href="YUVImage.html" title="class in org.libjpegturbo.turbojpeg"><code>YUVImage</code></a> instance containing the encoded
|
|
image planes.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i7" class="rowColor">
|
|
<td class="colFirst"><code><a href="YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a></code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#encodeYUV(int%5B%5D,int)">encodeYUV</a></span>​(int[] strides,
|
|
int flags)</code></th>
|
|
<td class="colLast">
|
|
<div class="block"><span class="deprecatedLabel">Deprecated.</span>
|
|
<div class="deprecationComment">Use <a href="#set(int,int)"><code>set()</code></a> and <a href="#encodeYUV(int%5B%5D)"><code>encodeYUV(int[])</code></a> instead.</div>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i8" class="altColor">
|
|
<td class="colFirst"><code><a href="YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a></code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#encodeYUV(int,int)">encodeYUV</a></span>​(int align,
|
|
int flags)</code></th>
|
|
<td class="colLast">
|
|
<div class="block"><span class="deprecatedLabel">Deprecated.</span>
|
|
<div class="deprecationComment">Use <a href="#set(int,int)"><code>set()</code></a> and <a href="#encodeYUV(int)"><code>encodeYUV(int)</code></a> instead.</div>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i9" class="rowColor">
|
|
<td class="colFirst"><code>void</code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#encodeYUV(org.libjpegturbo.turbojpeg.YUVImage)">encodeYUV</a></span>​(<a href="YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a> dstImage)</code></th>
|
|
<td class="colLast">
|
|
<div class="block">Encode the 8-bit-per-sample packed-pixel source image associated with this
|
|
compressor instance into an 8-bit-per-sample planar YUV image and store it
|
|
in the given <a href="YUVImage.html" title="class in org.libjpegturbo.turbojpeg"><code>YUVImage</code></a> instance.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i10" class="altColor">
|
|
<td class="colFirst"><code>void</code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#encodeYUV(org.libjpegturbo.turbojpeg.YUVImage,int)">encodeYUV</a></span>​(<a href="YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a> dstImage,
|
|
int flags)</code></th>
|
|
<td class="colLast">
|
|
<div class="block"><span class="deprecatedLabel">Deprecated.</span>
|
|
<div class="deprecationComment">Use <a href="#set(int,int)"><code>set()</code></a> and <a href="#encodeYUV(org.libjpegturbo.turbojpeg.YUVImage)"><code>encodeYUV(YUVImage)</code></a>
|
|
instead.</div>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i11" class="rowColor">
|
|
<td class="colFirst"><code>protected void</code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#finalize()">finalize</a></span>()</code></th>
|
|
<td class="colLast"> </td>
|
|
</tr>
|
|
<tr id="i12" class="altColor">
|
|
<td class="colFirst"><code>int</code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#get(int)">get</a></span>​(int param)</code></th>
|
|
<td class="colLast">
|
|
<div class="block">Get the value of a compression parameter.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i13" class="rowColor">
|
|
<td class="colFirst"><code>int</code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getCompressedSize()">getCompressedSize</a></span>()</code></th>
|
|
<td class="colLast">
|
|
<div class="block">Returns the size of the image (in bytes) generated by the most recent
|
|
compress operation.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i14" class="altColor">
|
|
<td class="colFirst"><code>void</code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#set(int,int)">set</a></span>​(int param,
|
|
int value)</code></th>
|
|
<td class="colLast">
|
|
<div class="block">Set the value of a compression parameter.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i15" class="rowColor">
|
|
<td class="colFirst"><code>void</code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setJPEGQuality(int)">setJPEGQuality</a></span>​(int quality)</code></th>
|
|
<td class="colLast">
|
|
<div class="block"><span class="deprecatedLabel">Deprecated.</span>
|
|
<div class="deprecationComment">Use
|
|
<code><a href="#set(int,int)"><code>set</code></a>(<a href="TJ.html#PARAM_QUALITY"><code>TJ.PARAM_QUALITY</code></a>, ...)</code> instead.</div>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i16" class="altColor">
|
|
<td class="colFirst"><code>void</code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setSourceImage(byte%5B%5D,int,int,int,int,int,int)">setSourceImage</a></span>​(byte[] srcImage,
|
|
int x,
|
|
int y,
|
|
int width,
|
|
int pitch,
|
|
int height,
|
|
int pixelFormat)</code></th>
|
|
<td class="colLast">
|
|
<div class="block">Associate an 8-bit-per-sample packed-pixel RGB, grayscale, or CMYK source
|
|
image with this compressor instance.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i17" class="rowColor">
|
|
<td class="colFirst"><code>void</code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setSourceImage(java.awt.image.BufferedImage,int,int,int,int)">setSourceImage</a></span>​(java.awt.image.BufferedImage srcImage,
|
|
int x,
|
|
int y,
|
|
int width,
|
|
int height)</code></th>
|
|
<td class="colLast">
|
|
<div class="block">Associate an 8-bit-per-pixel packed-pixel RGB or grayscale source image
|
|
with this compressor instance.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i18" class="altColor">
|
|
<td class="colFirst"><code>void</code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setSourceImage(org.libjpegturbo.turbojpeg.YUVImage)">setSourceImage</a></span>​(<a href="YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a> srcImage)</code></th>
|
|
<td class="colLast">
|
|
<div class="block">Associate an 8-bit-per-sample planar YUV source image with this compressor
|
|
instance.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i19" class="rowColor">
|
|
<td class="colFirst"><code>void</code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setSourceImage12(short%5B%5D,int,int,int,int,int,int)">setSourceImage12</a></span>​(short[] srcImage,
|
|
int x,
|
|
int y,
|
|
int width,
|
|
int pitch,
|
|
int height,
|
|
int pixelFormat)</code></th>
|
|
<td class="colLast">
|
|
<div class="block">Associate a 12-bit-per-sample packed-pixel RGB, grayscale, or CMYK source
|
|
image with this compressor instance.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i20" class="altColor">
|
|
<td class="colFirst"><code>void</code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setSourceImage16(short%5B%5D,int,int,int,int,int,int)">setSourceImage16</a></span>​(short[] srcImage,
|
|
int x,
|
|
int y,
|
|
int width,
|
|
int pitch,
|
|
int height,
|
|
int pixelFormat)</code></th>
|
|
<td class="colLast">
|
|
<div class="block">Associate a 16-bit-per-sample packed-pixel RGB, grayscale, or CMYK source
|
|
image with this compressor instance.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i21" class="rowColor">
|
|
<td class="colFirst"><code>void</code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setSubsamp(int)">setSubsamp</a></span>​(int subsamp)</code></th>
|
|
<td class="colLast">
|
|
<div class="block"><span class="deprecatedLabel">Deprecated.</span>
|
|
<div class="deprecationComment">Use
|
|
<code><a href="#set(int,int)"><code>set</code></a>(<a href="TJ.html#PARAM_SUBSAMP"><code>TJ.PARAM_SUBSAMP</code></a>, ...)</code> instead.</div>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<ul class="blockList">
|
|
<li class="blockList"><a id="methods.inherited.from.class.java.lang.Object">
|
|
<!-- -->
|
|
</a>
|
|
<h3>Methods inherited from class java.lang.Object</h3>
|
|
<code>clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</section>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
<div class="details">
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<!-- ========= CONSTRUCTOR DETAIL ======== -->
|
|
<section>
|
|
<ul class="blockList">
|
|
<li class="blockList"><a id="constructor.detail">
|
|
<!-- -->
|
|
</a>
|
|
<h3>Constructor Detail</h3>
|
|
<a id="<init>()">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>TJCompressor</h4>
|
|
<pre>public TJCompressor()
|
|
throws <a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
|
|
<div class="block">Create a TurboJPEG compressor instance.</div>
|
|
<dl>
|
|
<dt><span class="throwsLabel">Throws:</span></dt>
|
|
<dd><code><a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a id="<init>(byte[],int,int,int,int,int,int)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>TJCompressor</h4>
|
|
<pre>public TJCompressor​(byte[] srcImage,
|
|
int x,
|
|
int y,
|
|
int width,
|
|
int pitch,
|
|
int height,
|
|
int pixelFormat)
|
|
throws <a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
|
|
<div class="block">Create a TurboJPEG compressor instance and associate the 8-bit-per-sample
|
|
packed-pixel source image stored in <code>srcImage</code> with the newly
|
|
created instance.</div>
|
|
<dl>
|
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
|
<dd><code>srcImage</code> - see <a href="#setSourceImage(byte%5B%5D,int,int,int,int,int,int)"><code>setSourceImage(byte[], int, int, int, int, int, int)</code></a> for description</dd>
|
|
<dd><code>x</code> - see <a href="#setSourceImage(byte%5B%5D,int,int,int,int,int,int)"><code>setSourceImage(byte[], int, int, int, int, int, int)</code></a> for description</dd>
|
|
<dd><code>y</code> - see <a href="#setSourceImage(byte%5B%5D,int,int,int,int,int,int)"><code>setSourceImage(byte[], int, int, int, int, int, int)</code></a> for description</dd>
|
|
<dd><code>width</code> - see <a href="#setSourceImage(byte%5B%5D,int,int,int,int,int,int)"><code>setSourceImage(byte[], int, int, int, int, int, int)</code></a> for description</dd>
|
|
<dd><code>pitch</code> - see <a href="#setSourceImage(byte%5B%5D,int,int,int,int,int,int)"><code>setSourceImage(byte[], int, int, int, int, int, int)</code></a> for description</dd>
|
|
<dd><code>height</code> - see <a href="#setSourceImage(byte%5B%5D,int,int,int,int,int,int)"><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="TJ.html#PF_RGB"><code>TJ.PF_*</code></a>)</dd>
|
|
<dt><span class="throwsLabel">Throws:</span></dt>
|
|
<dd><code><a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a id="<init>(java.awt.image.BufferedImage,int,int,int,int)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockListLast">
|
|
<li class="blockList">
|
|
<h4>TJCompressor</h4>
|
|
<pre>public TJCompressor​(java.awt.image.BufferedImage srcImage,
|
|
int x,
|
|
int y,
|
|
int width,
|
|
int height)
|
|
throws <a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
|
|
<div class="block">Create a TurboJPEG compressor instance and associate the 8-bit-per-sample
|
|
packed-pixel source image stored in <code>srcImage</code> with the newly
|
|
created instance.</div>
|
|
<dl>
|
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
|
<dd><code>srcImage</code> - see
|
|
<a href="#setSourceImage(java.awt.image.BufferedImage,int,int,int,int)"><code>setSourceImage(BufferedImage, int, int, int, int)</code></a> for description</dd>
|
|
<dd><code>x</code> - see
|
|
<a href="#setSourceImage(java.awt.image.BufferedImage,int,int,int,int)"><code>setSourceImage(BufferedImage, int, int, int, int)</code></a> for description</dd>
|
|
<dd><code>y</code> - see
|
|
<a href="#setSourceImage(java.awt.image.BufferedImage,int,int,int,int)"><code>setSourceImage(BufferedImage, int, int, int, int)</code></a> for description</dd>
|
|
<dd><code>width</code> - see
|
|
<a href="#setSourceImage(java.awt.image.BufferedImage,int,int,int,int)"><code>setSourceImage(BufferedImage, int, int, int, int)</code></a> for description</dd>
|
|
<dd><code>height</code> - see
|
|
<a href="#setSourceImage(java.awt.image.BufferedImage,int,int,int,int)"><code>setSourceImage(BufferedImage, int, int, int, int)</code></a> for description</dd>
|
|
<dt><span class="throwsLabel">Throws:</span></dt>
|
|
<dd><code><a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</section>
|
|
<!-- ============ METHOD DETAIL ========== -->
|
|
<section>
|
|
<ul class="blockList">
|
|
<li class="blockList"><a id="method.detail">
|
|
<!-- -->
|
|
</a>
|
|
<h3>Method Detail</h3>
|
|
<a id="setSourceImage(byte[],int,int,int,int,int,int)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>setSourceImage</h4>
|
|
<pre class="methodSignature">public void setSourceImage​(byte[] srcImage,
|
|
int x,
|
|
int y,
|
|
int width,
|
|
int pitch,
|
|
int height,
|
|
int pixelFormat)
|
|
throws <a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
|
|
<div class="block">Associate an 8-bit-per-sample packed-pixel RGB, grayscale, or CMYK source
|
|
image with this compressor instance.</div>
|
|
<dl>
|
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
|
<dd><code>srcImage</code> - buffer containing a packed-pixel RGB, grayscale, or CMYK
|
|
source image to be compressed or encoded. This buffer is not modified.</dd>
|
|
<dd><code>x</code> - x offset (in pixels) of the region in the source image from which
|
|
the JPEG or YUV image should be compressed/encoded</dd>
|
|
<dd><code>y</code> - y offset (in pixels) of the region in the source image from which
|
|
the JPEG or YUV image should be compressed/encoded</dd>
|
|
<dd><code>width</code> - width (in pixels) of the region in the source image from
|
|
which the JPEG or YUV image should be compressed/encoded</dd>
|
|
<dd><code>pitch</code> - bytes per row in the source image. Normally this should be
|
|
<code>width * <a href="TJ.html#getPixelSize(int)"><code>TJ.getPixelSize</code></a>(pixelFormat)</code>,
|
|
if the source image is unpadded. (Setting this parameter to 0 is the
|
|
equivalent of setting it to <code>width *
|
|
<a href="TJ.html#getPixelSize(int)"><code>TJ.getPixelSize</code></a>(pixelFormat)</code>.) However,
|
|
you can also use this parameter to specify the row alignment/padding of
|
|
the source image, to skip rows, or to compress/encode a JPEG or YUV image
|
|
from a specific region of a larger source image.</dd>
|
|
<dd><code>height</code> - height (in pixels) of the region in the source image from
|
|
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="TJ.html#PF_RGB"><code>TJ.PF_*</code></a>)</dd>
|
|
<dt><span class="throwsLabel">Throws:</span></dt>
|
|
<dd><code><a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a id="setSourceImage12(short[],int,int,int,int,int,int)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>setSourceImage12</h4>
|
|
<pre class="methodSignature">public void setSourceImage12​(short[] srcImage,
|
|
int x,
|
|
int y,
|
|
int width,
|
|
int pitch,
|
|
int height,
|
|
int pixelFormat)
|
|
throws <a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
|
|
<div class="block">Associate a 12-bit-per-sample packed-pixel RGB, grayscale, or CMYK source
|
|
image with this compressor instance. Note that 12-bit-per-sample
|
|
packed-pixel source images can only be compressed into 12-bit-per-sample
|
|
JPEG images.</div>
|
|
<dl>
|
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
|
<dd><code>srcImage</code> - buffer containing a packed-pixel RGB, grayscale, or CMYK
|
|
source image to be compressed. This buffer is not modified.</dd>
|
|
<dd><code>x</code> - x offset (in pixels) of the region in the source image from which
|
|
the JPEG image should be compressed</dd>
|
|
<dd><code>y</code> - y offset (in pixels) of the region in the source image from which
|
|
the JPEG image should be compressed</dd>
|
|
<dd><code>width</code> - width (in pixels) of the region in the source image from
|
|
which the JPEG image should be compressed</dd>
|
|
<dd><code>pitch</code> - samples per row in the source image. Normally this should be
|
|
<code>width * <a href="TJ.html#getPixelSize(int)"><code>TJ.getPixelSize</code></a>(pixelFormat)</code>,
|
|
if the source image is unpadded. (Setting this parameter to 0 is the
|
|
equivalent of setting it to <code>width *
|
|
<a href="TJ.html#getPixelSize(int)"><code>TJ.getPixelSize</code></a>(pixelFormat)</code>.) However,
|
|
you can also use this parameter to specify the row alignment/padding of
|
|
the source image, to skip rows, or to compress a JPEG image from a
|
|
specific region of a larger source image.</dd>
|
|
<dd><code>height</code> - height (in pixels) of the region in the source image from
|
|
which the JPEG image should be compressed</dd>
|
|
<dd><code>pixelFormat</code> - pixel format of the source image (one of
|
|
<a href="TJ.html#PF_RGB"><code>TJ.PF_*</code></a>)</dd>
|
|
<dt><span class="throwsLabel">Throws:</span></dt>
|
|
<dd><code><a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a id="setSourceImage16(short[],int,int,int,int,int,int)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>setSourceImage16</h4>
|
|
<pre class="methodSignature">public void setSourceImage16​(short[] srcImage,
|
|
int x,
|
|
int y,
|
|
int width,
|
|
int pitch,
|
|
int height,
|
|
int pixelFormat)
|
|
throws <a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
|
|
<div class="block">Associate a 16-bit-per-sample packed-pixel RGB, grayscale, or CMYK source
|
|
image with this compressor instance. Note that 16-bit-per-sample
|
|
packed-pixel source images can only be compressed into 16-bit-per-sample
|
|
lossless JPEG images.</div>
|
|
<dl>
|
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
|
<dd><code>srcImage</code> - buffer containing a packed-pixel RGB, grayscale, or CMYK
|
|
source image to be compressed. This buffer is not modified.</dd>
|
|
<dd><code>x</code> - x offset (in pixels) of the region in the source image from which
|
|
the JPEG image should be compressed</dd>
|
|
<dd><code>y</code> - y offset (in pixels) of the region in the source image from which
|
|
the JPEG image should be compressed</dd>
|
|
<dd><code>width</code> - width (in pixels) of the region in the source image from
|
|
which the JPEG image should be compressed</dd>
|
|
<dd><code>pitch</code> - samples per row in the source image. Normally this should be
|
|
<code>width * <a href="TJ.html#getPixelSize(int)"><code>TJ.getPixelSize</code></a>(pixelFormat)</code>,
|
|
if the source image is unpadded. (Setting this parameter to 0 is the
|
|
equivalent of setting it to <code>width *
|
|
<a href="TJ.html#getPixelSize(int)"><code>TJ.getPixelSize</code></a>(pixelFormat)</code>.) However,
|
|
you can also use this parameter to specify the row alignment/padding of
|
|
the source image, to skip rows, or to compress a JPEG image from a
|
|
specific region of a larger source image.</dd>
|
|
<dd><code>height</code> - height (in pixels) of the region in the source image from
|
|
which the JPEG image should be compressed</dd>
|
|
<dd><code>pixelFormat</code> - pixel format of the source image (one of
|
|
<a href="TJ.html#PF_RGB"><code>TJ.PF_*</code></a>)</dd>
|
|
<dt><span class="throwsLabel">Throws:</span></dt>
|
|
<dd><code><a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a id="setSourceImage(java.awt.image.BufferedImage,int,int,int,int)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>setSourceImage</h4>
|
|
<pre class="methodSignature">public void setSourceImage​(java.awt.image.BufferedImage srcImage,
|
|
int x,
|
|
int y,
|
|
int width,
|
|
int height)
|
|
throws <a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
|
|
<div class="block">Associate an 8-bit-per-pixel packed-pixel RGB or grayscale source image
|
|
with this compressor instance.</div>
|
|
<dl>
|
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
|
<dd><code>srcImage</code> - a <code>BufferedImage</code> instance containing a
|
|
packed-pixel RGB or grayscale source image to be compressed or encoded.
|
|
This image is not modified.</dd>
|
|
<dd><code>x</code> - x offset (in pixels) of the region in the source image from which
|
|
the JPEG or YUV image should be compressed/encoded</dd>
|
|
<dd><code>y</code> - y offset (in pixels) of the region in the source image from which
|
|
the JPEG or YUV image should be compressed/encoded</dd>
|
|
<dd><code>width</code> - width (in pixels) of the region in the source image from
|
|
which the JPEG or YUV image should be compressed/encoded (0 = use the
|
|
width of the source image)</dd>
|
|
<dd><code>height</code> - height (in pixels) of the region in the source image from
|
|
which the JPEG or YUV image should be compressed/encoded (0 = use the
|
|
height of the source image)</dd>
|
|
<dt><span class="throwsLabel">Throws:</span></dt>
|
|
<dd><code><a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a id="setSourceImage(org.libjpegturbo.turbojpeg.YUVImage)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>setSourceImage</h4>
|
|
<pre class="methodSignature">public void setSourceImage​(<a href="YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a> srcImage)
|
|
throws <a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
|
|
<div class="block">Associate an 8-bit-per-sample planar YUV source image with this compressor
|
|
instance. This method sets <a href="TJ.html#PARAM_SUBSAMP"><code>TJ.PARAM_SUBSAMP</code></a> to the chrominance
|
|
subsampling level of the source image.</div>
|
|
<dl>
|
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
|
<dd><code>srcImage</code> - planar YUV source image to be compressed. This image is
|
|
not modified.</dd>
|
|
<dt><span class="throwsLabel">Throws:</span></dt>
|
|
<dd><code><a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a id="set(int,int)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>set</h4>
|
|
<pre class="methodSignature">public void set​(int param,
|
|
int value)</pre>
|
|
<div class="block">Set the value of a compression parameter.</div>
|
|
<dl>
|
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
|
<dd><code>param</code> - one of <a href="TJ.html#PARAM_STOPONWARNING"><code>TJ.PARAM_*</code></a></dd>
|
|
<dd><code>value</code> - value of the compression parameter (refer to
|
|
<a href="TJ.html#PARAM_STOPONWARNING"><code>parameter documentation</code></a>)</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a id="get(int)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>get</h4>
|
|
<pre class="methodSignature">public int get​(int param)</pre>
|
|
<div class="block">Get the value of a compression parameter.</div>
|
|
<dl>
|
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
|
<dd><code>param</code> - one of <a href="TJ.html#PARAM_STOPONWARNING"><code>TJ.PARAM_*</code></a></dd>
|
|
<dt><span class="returnLabel">Returns:</span></dt>
|
|
<dd>the value of the specified compression parameter, or -1 if the
|
|
value is unknown.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a id="setSubsamp(int)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>setSubsamp</h4>
|
|
<pre class="methodSignature">@Deprecated
|
|
public void setSubsamp​(int subsamp)</pre>
|
|
<div class="deprecationBlock"><span class="deprecatedLabel">Deprecated.</span>
|
|
<div class="deprecationComment">Use
|
|
<code><a href="#set(int,int)"><code>set</code></a>(<a href="TJ.html#PARAM_SUBSAMP"><code>TJ.PARAM_SUBSAMP</code></a>, ...)</code> instead.</div>
|
|
</div>
|
|
</li>
|
|
</ul>
|
|
<a id="setJPEGQuality(int)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>setJPEGQuality</h4>
|
|
<pre class="methodSignature">@Deprecated
|
|
public void setJPEGQuality​(int quality)</pre>
|
|
<div class="deprecationBlock"><span class="deprecatedLabel">Deprecated.</span>
|
|
<div class="deprecationComment">Use
|
|
<code><a href="#set(int,int)"><code>set</code></a>(<a href="TJ.html#PARAM_QUALITY"><code>TJ.PARAM_QUALITY</code></a>, ...)</code> instead.</div>
|
|
</div>
|
|
</li>
|
|
</ul>
|
|
<a id="compress(byte[])">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>compress</h4>
|
|
<pre class="methodSignature">public void compress​(byte[] dstBuf)
|
|
throws <a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
|
|
<div class="block">Compress the packed-pixel or planar YUV source image associated with this
|
|
compressor instance and output a JPEG image to the given destination
|
|
buffer.</div>
|
|
<dl>
|
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
|
<dd><code>dstBuf</code> - buffer that will receive the JPEG image. Use
|
|
<a href="TJ.html#bufSize(int,int,int)"><code>TJ.bufSize()</code></a> to determine the maximum size for this
|
|
buffer based on the source image's width and height and the desired level
|
|
of chrominance subsampling (see <a href="TJ.html#PARAM_SUBSAMP"><code>TJ.PARAM_SUBSAMP</code></a>.)</dd>
|
|
<dt><span class="throwsLabel">Throws:</span></dt>
|
|
<dd><code><a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a id="compress(byte[],int)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>compress</h4>
|
|
<pre class="methodSignature">@Deprecated
|
|
public void compress​(byte[] dstBuf,
|
|
int flags)
|
|
throws <a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
|
|
<div class="deprecationBlock"><span class="deprecatedLabel">Deprecated.</span>
|
|
<div class="deprecationComment">Use <a href="#set(int,int)"><code>set()</code></a> and <a href="#compress(byte%5B%5D)"><code>compress(byte[])</code></a> instead.</div>
|
|
</div>
|
|
<dl>
|
|
<dt><span class="throwsLabel">Throws:</span></dt>
|
|
<dd><code><a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a id="compress()">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>compress</h4>
|
|
<pre class="methodSignature">public byte[] compress()
|
|
throws <a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
|
|
<div class="block">Compress the packed-pixel or planar YUV source image associated with this
|
|
compressor instance and return a buffer containing a JPEG image.</div>
|
|
<dl>
|
|
<dt><span class="returnLabel">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="#getCompressedSize()"><code>getCompressedSize()</code></a> to obtain the size of the JPEG image.</dd>
|
|
<dt><span class="throwsLabel">Throws:</span></dt>
|
|
<dd><code><a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a id="compress(int)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>compress</h4>
|
|
<pre class="methodSignature">@Deprecated
|
|
public byte[] compress​(int flags)
|
|
throws <a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
|
|
<div class="deprecationBlock"><span class="deprecatedLabel">Deprecated.</span>
|
|
<div class="deprecationComment">Use <a href="#set(int,int)"><code>set()</code></a> and <a href="#compress()"><code>compress()</code></a> instead.</div>
|
|
</div>
|
|
<dl>
|
|
<dt><span class="throwsLabel">Throws:</span></dt>
|
|
<dd><code><a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a id="encodeYUV(org.libjpegturbo.turbojpeg.YUVImage)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>encodeYUV</h4>
|
|
<pre class="methodSignature">public void encodeYUV​(<a href="YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a> dstImage)
|
|
throws <a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
|
|
<div class="block">Encode the 8-bit-per-sample packed-pixel source image associated with this
|
|
compressor instance into an 8-bit-per-sample planar YUV image and store it
|
|
in the given <a href="YUVImage.html" title="class in org.libjpegturbo.turbojpeg"><code>YUVImage</code></a> instance. This method performs color
|
|
conversion (which is accelerated in the libjpeg-turbo implementation) but
|
|
does not execute any of the other steps in the JPEG compression process.
|
|
Encoding CMYK source images into YUV images is not supported. This method
|
|
sets <a href="TJ.html#PARAM_SUBSAMP"><code>TJ.PARAM_SUBSAMP</code></a> to the chrominance subsampling level of the
|
|
destination image.</div>
|
|
<dl>
|
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
|
<dd><code>dstImage</code> - <a href="YUVImage.html" title="class in org.libjpegturbo.turbojpeg"><code>YUVImage</code></a> instance that will receive the planar YUV
|
|
image</dd>
|
|
<dt><span class="throwsLabel">Throws:</span></dt>
|
|
<dd><code><a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a id="encodeYUV(org.libjpegturbo.turbojpeg.YUVImage,int)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>encodeYUV</h4>
|
|
<pre class="methodSignature">@Deprecated
|
|
public void encodeYUV​(<a href="YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a> dstImage,
|
|
int flags)
|
|
throws <a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
|
|
<div class="deprecationBlock"><span class="deprecatedLabel">Deprecated.</span>
|
|
<div class="deprecationComment">Use <a href="#set(int,int)"><code>set()</code></a> and <a href="#encodeYUV(org.libjpegturbo.turbojpeg.YUVImage)"><code>encodeYUV(YUVImage)</code></a>
|
|
instead.</div>
|
|
</div>
|
|
<dl>
|
|
<dt><span class="throwsLabel">Throws:</span></dt>
|
|
<dd><code><a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a id="encodeYUV(int)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>encodeYUV</h4>
|
|
<pre class="methodSignature">public <a href="YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a> encodeYUV​(int align)
|
|
throws <a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
|
|
<div class="block">Encode the 8-bit-per-sample packed-pixel source image associated with this
|
|
compressor instance into an 8-bit-per-sample unified planar YUV image and
|
|
return a <a href="YUVImage.html" title="class in org.libjpegturbo.turbojpeg"><code>YUVImage</code></a> instance containing the encoded image. This
|
|
method performs color conversion (which is accelerated in the
|
|
libjpeg-turbo implementation) but does not execute any of the other steps
|
|
in the JPEG compression process. Encoding CMYK source images into YUV
|
|
images is not supported.</div>
|
|
<dl>
|
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
|
<dd><code>align</code> - row alignment (in bytes) of the YUV image (must be a power of
|
|
2.) Setting this parameter to n will cause each row in each plane of the
|
|
YUV image to be padded to the nearest multiple of n bytes (1 = unpadded.)</dd>
|
|
<dt><span class="returnLabel">Returns:</span></dt>
|
|
<dd>a <a href="YUVImage.html" title="class in org.libjpegturbo.turbojpeg"><code>YUVImage</code></a> instance containing the unified planar YUV
|
|
encoded image</dd>
|
|
<dt><span class="throwsLabel">Throws:</span></dt>
|
|
<dd><code><a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a id="encodeYUV(int,int)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>encodeYUV</h4>
|
|
<pre class="methodSignature">@Deprecated
|
|
public <a href="YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a> encodeYUV​(int align,
|
|
int flags)
|
|
throws <a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
|
|
<div class="deprecationBlock"><span class="deprecatedLabel">Deprecated.</span>
|
|
<div class="deprecationComment">Use <a href="#set(int,int)"><code>set()</code></a> and <a href="#encodeYUV(int)"><code>encodeYUV(int)</code></a> instead.</div>
|
|
</div>
|
|
<dl>
|
|
<dt><span class="throwsLabel">Throws:</span></dt>
|
|
<dd><code><a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a id="encodeYUV(int[])">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>encodeYUV</h4>
|
|
<pre class="methodSignature">public <a href="YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a> encodeYUV​(int[] strides)
|
|
throws <a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
|
|
<div class="block">Encode the 8-bit-per-sample packed-pixel source image associated with this
|
|
compressor instance into separate 8-bit-per-sample Y, U (Cb), and V (Cr)
|
|
image planes and return a <a href="YUVImage.html" title="class in org.libjpegturbo.turbojpeg"><code>YUVImage</code></a> instance containing the encoded
|
|
image planes. This method performs color conversion (which is accelerated
|
|
in the libjpeg-turbo implementation) but does not execute any of the other
|
|
steps in the JPEG compression process. Encoding CMYK source images into
|
|
YUV images is not supported.</div>
|
|
<dl>
|
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
|
<dd><code>strides</code> - an array of integers, each specifying the number of bytes
|
|
per row in the corresponding plane of the YUV source image. Setting the
|
|
stride for any plane to 0 is the same as setting it to the plane width
|
|
(see <a href="YUVImage.html" title="class in org.libjpegturbo.turbojpeg"><code>YUVImage</code></a>.) If <code>strides</code> is null, then the strides
|
|
for all planes will be set to their respective plane widths. You can
|
|
adjust the strides in order to add an arbitrary amount of row padding to
|
|
each plane.</dd>
|
|
<dt><span class="returnLabel">Returns:</span></dt>
|
|
<dd>a <a href="YUVImage.html" title="class in org.libjpegturbo.turbojpeg"><code>YUVImage</code></a> instance containing the encoded image planes</dd>
|
|
<dt><span class="throwsLabel">Throws:</span></dt>
|
|
<dd><code><a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a id="encodeYUV(int[],int)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>encodeYUV</h4>
|
|
<pre class="methodSignature">@Deprecated
|
|
public <a href="YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a> encodeYUV​(int[] strides,
|
|
int flags)
|
|
throws <a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
|
|
<div class="deprecationBlock"><span class="deprecatedLabel">Deprecated.</span>
|
|
<div class="deprecationComment">Use <a href="#set(int,int)"><code>set()</code></a> and <a href="#encodeYUV(int%5B%5D)"><code>encodeYUV(int[])</code></a> instead.</div>
|
|
</div>
|
|
<dl>
|
|
<dt><span class="throwsLabel">Throws:</span></dt>
|
|
<dd><code><a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a id="getCompressedSize()">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>getCompressedSize</h4>
|
|
<pre class="methodSignature">public int getCompressedSize()</pre>
|
|
<div class="block">Returns the size of the image (in bytes) generated by the most recent
|
|
compress operation.</div>
|
|
<dl>
|
|
<dt><span class="returnLabel">Returns:</span></dt>
|
|
<dd>the size of the image (in bytes) generated by the most recent
|
|
compress operation.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a id="close()">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>close</h4>
|
|
<pre class="methodSignature">public void close()
|
|
throws <a href="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><span class="overrideSpecifyLabel">Specified by:</span></dt>
|
|
<dd><code>close</code> in interface <code>java.lang.AutoCloseable</code></dd>
|
|
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
|
|
<dd><code>close</code> in interface <code>java.io.Closeable</code></dd>
|
|
<dt><span class="throwsLabel">Throws:</span></dt>
|
|
<dd><code><a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a id="finalize()">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockListLast">
|
|
<li class="blockList">
|
|
<h4>finalize</h4>
|
|
<pre class="methodSignature">protected void finalize()
|
|
throws java.lang.Throwable</pre>
|
|
<dl>
|
|
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
|
|
<dd><code>finalize</code> in class <code>java.lang.Object</code></dd>
|
|
<dt><span class="throwsLabel">Throws:</span></dt>
|
|
<dd><code>java.lang.Throwable</code></dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</section>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</main>
|
|
<!-- ========= END OF CLASS DATA ========= -->
|
|
<footer role="contentinfo">
|
|
<nav role="navigation">
|
|
<!-- ======= START OF BOTTOM NAVBAR ====== -->
|
|
<div class="bottomNav"><a id="navbar.bottom">
|
|
<!-- -->
|
|
</a>
|
|
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
|
|
<a id="navbar.bottom.firstrow">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="navList" title="Navigation">
|
|
<li><a href="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" id="allclasses_navbar_bottom">
|
|
<li><a href="../../../allclasses.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>
|
|
<noscript>
|
|
<div>JavaScript is disabled on your browser.</div>
|
|
</noscript>
|
|
</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="#method.summary">Method</a></li>
|
|
</ul>
|
|
<ul class="subNavList">
|
|
<li>Detail: </li>
|
|
<li>Field | </li>
|
|
<li><a href="#constructor.detail">Constr</a> | </li>
|
|
<li><a href="#method.detail">Method</a></li>
|
|
</ul>
|
|
</div>
|
|
<a id="skip.navbar.bottom">
|
|
<!-- -->
|
|
</a></div>
|
|
<!-- ======== END OF BOTTOM NAVBAR ======= -->
|
|
</nav>
|
|
</footer>
|
|
</body>
|
|
</html>
|