Import Cobalt 19.master.0.181919 Includes the following patches: https://cobalt-review.googlesource.com/c/cobalt/+/4310 by msieradzki@vewd.com Change-Id: I274695027d4c48da28dcb4ea81014d5bd066dff1
diff --git a/src/third_party/libjpeg-turbo/java/CMakeLists.txt b/src/third_party/libjpeg-turbo/java/CMakeLists.txt new file mode 100644 index 0000000..d51ada7 --- /dev/null +++ b/src/third_party/libjpeg-turbo/java/CMakeLists.txt
@@ -0,0 +1,78 @@ +find_package(Java REQUIRED) +find_package(JNI REQUIRED) + +# Allow the Java compiler flags to be set using an environment variable +if(NOT DEFINED CMAKE_JAVA_COMPILE_FLAGS AND DEFINED ENV{JAVAFLAGS}) + set(CMAKE_JAVA_COMPILE_FLAGS $ENV{JAVAFLAGS}) +endif() + +include(UseJava) + +set(CMAKE_JAVA_COMPILE_FLAGS "${CMAKE_JAVA_COMPILE_FLAGS} -J-Dfile.encoding=UTF8") +message(STATUS "CMAKE_JAVA_COMPILE_FLAGS = ${CMAKE_JAVA_COMPILE_FLAGS}") +string(REGEX REPLACE " " ";" CMAKE_JAVA_COMPILE_FLAGS "${CMAKE_JAVA_COMPILE_FLAGS}") + +set(JAVAARGS "" CACHE STRING "Additional arguments to pass to java when running unit tests (example: -d32)") +message(STATUS "JAVAARGS = ${JAVAARGS}") + +set(JAVA_SOURCES org/libjpegturbo/turbojpeg/TJ.java + 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/YUVImage.java + TJUnitTest.java + TJExample.java + TJBench.java) + +set(TURBOJPEG_DLL_NAME "turbojpeg") +if(MINGW) + set(TURBOJPEG_DLL_NAME "libturbojpeg") +endif() +if(WIN32) + configure_file(org/libjpegturbo/turbojpeg/TJLoader-win.java.in + ${CMAKE_CURRENT_BINARY_DIR}/org/libjpegturbo/turbojpeg/TJLoader.java) +else() + configure_file(org/libjpegturbo/turbojpeg/TJLoader-unix.java.in + ${CMAKE_CURRENT_BINARY_DIR}/org/libjpegturbo/turbojpeg/TJLoader.java) +endif() +set(JAVA_SOURCES ${JAVA_SOURCES} + ${CMAKE_CURRENT_BINARY_DIR}/org/libjpegturbo/turbojpeg/TJLoader.java) + +if(MSYS) + # UGLY HACK ALERT: If we don't do this, then UseJava.cmake will separate + # class path members with a semicolon, which is interpreted as a command + # separator by the MSYS shell. + set(CMAKE_HOST_SYSTEM_NAME_BAK ${CMAKE_HOST_SYSTEM_NAME}) + set(CMAKE_HOST_SYSTEM_NAME "MSYS") +endif() +add_jar(turbojpeg-java ${JAVA_SOURCES} OUTPUT_NAME turbojpeg + ENTRY_POINT TJExample) +if(MSYS) + set(CMAKE_HOST_SYSTEM_NAME ${CMAKE_HOST_SYSTEM_NAME_BAK}) +endif() + +add_custom_target(javadoc COMMAND + javadoc -notimestamp -d ${CMAKE_CURRENT_SOURCE_DIR}/doc -sourcepath ${CMAKE_CURRENT_SOURCE_DIR} org.libjpegturbo.turbojpeg) +set(JAVACLASSPATH ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/turbojpeg-java.dir) +add_custom_target(javah + COMMAND javah -d ${CMAKE_CURRENT_SOURCE_DIR} -classpath ${JAVACLASSPATH} org.libjpegturbo.turbojpeg.TJ + COMMAND javah -d ${CMAKE_CURRENT_SOURCE_DIR} -classpath ${JAVACLASSPATH} org.libjpegturbo.turbojpeg.TJCompressor + COMMAND javah -d ${CMAKE_CURRENT_SOURCE_DIR} -classpath ${JAVACLASSPATH} org.libjpegturbo.turbojpeg.TJDecompressor + COMMAND javah -d ${CMAKE_CURRENT_SOURCE_DIR} -classpath ${JAVACLASSPATH} org.libjpegturbo.turbojpeg.TJTransformer) + +if(NOT DEFINED CMAKE_INSTALL_DEFAULT_JAVADIR) + set(CMAKE_INSTALL_DEFAULT_JAVADIR "<CMAKE_INSTALL_DATAROOTDIR>/java") +endif() +GNUInstallDirs_set_install_dir(JAVADIR + "The directory into which Java classes should be installed") +GNUInstallDirs_get_absolute_install_dir(CMAKE_INSTALL_FULL_JAVADIR + CMAKE_INSTALL_JAVADIR) +set(CMAKE_INSTALL_JAVADIR ${CMAKE_INSTALL_JAVADIR} PARENT_SCOPE) +set(CMAKE_INSTALL_FULL_JAVADIR ${CMAKE_INSTALL_FULL_JAVADIR} PARENT_SCOPE) +report_directory(JAVADIR) +install_jar(turbojpeg-java ${CMAKE_INSTALL_JAVADIR}) +mark_as_advanced(CLEAR CMAKE_INSTALL_JAVADIR)
diff --git a/src/third_party/libjpeg-turbo/java/MANIFEST.MF b/src/third_party/libjpeg-turbo/java/MANIFEST.MF new file mode 100644 index 0000000..723bc51 --- /dev/null +++ b/src/third_party/libjpeg-turbo/java/MANIFEST.MF
@@ -0,0 +1,2 @@ +Manifest-Version: 1.0 +Main-Class: TJExample
diff --git a/src/third_party/libjpeg-turbo/java/README b/src/third_party/libjpeg-turbo/java/README new file mode 100644 index 0000000..88ddc3b --- /dev/null +++ b/src/third_party/libjpeg-turbo/java/README
@@ -0,0 +1,52 @@ +TurboJPEG Java Wrapper +====================== + +The TurboJPEG shared library can optionally be built with a Java Native +Interface wrapper, which allows the library to be loaded and used directly from +Java applications. The Java front end for this is defined in several classes +located under org/libjpegturbo/turbojpeg. The source code for these Java +classes is licensed under a BSD-style license, so the files can be incorporated +directly into both open source and proprietary projects without restriction. A +Java archive (JAR) file containing these classes is also shipped with the +"official" distribution packages of libjpeg-turbo. + +TJExample.java, which should also be located in the same directory as this +README file, demonstrates how to use the TurboJPEG Java API to compress and +decompress JPEG images in memory. + + +Performance Pitfalls +-------------------- + +The TurboJPEG Java API defines several convenience methods that can allocate +image buffers or instantiate classes to hold the result of compress, +decompress, or transform operations. However, if you use these methods, then +be mindful of the amount of new data you are creating on the heap. It may be +necessary to manually invoke the garbage collector to prevent heap exhaustion +or to prevent performance degradation. Background garbage collection can kill +performance, particularly in a multi-threaded environment (Java pauses all +threads when the GC runs.) + +The TurboJPEG Java API always gives you the option of pre-allocating your own +source and destination buffers, which allows you to re-use those buffers for +compressing/decompressing multiple images. If the image sequence you are +compressing or decompressing consists of images of the same size, then +pre-allocating the buffers is recommended. + + +Installation Directory +---------------------- + +The TurboJPEG Java Wrapper will look for the TurboJPEG JNI library +(libturbojpeg.so, libturbojpeg.jnilib, or turbojpeg.dll) in the system library +paths or in any paths specified in LD_LIBRARY_PATH (Un*x), DYLD_LIBRARY_PATH +(Mac), or PATH (Windows.) Failing this, on Un*x and Mac systems, the wrapper +will look for the JNI library under the library directory configured when +libjpeg-turbo was built. If that library directory is +/opt/libjpeg-turbo/lib32, then /opt/libjpeg-turbo/lib64 is also searched, and +vice versa. + +If you installed the JNI library into another directory, then you will need +to pass an argument of -Djava.library.path={path_to_JNI_library} to java, or +manipulate LD_LIBRARY_PATH, DYLD_LIBRARY_PATH, or PATH to include the directory +containing the JNI library.
diff --git a/src/third_party/libjpeg-turbo/java/TJBench.java b/src/third_party/libjpeg-turbo/java/TJBench.java new file mode 100644 index 0000000..bd55562 --- /dev/null +++ b/src/third_party/libjpeg-turbo/java/TJBench.java
@@ -0,0 +1,1004 @@ +/* + * Copyright (C)2009-2014, 2016-2018 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: + * + * - 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. + */ + +import java.io.*; +import java.awt.image.*; +import javax.imageio.*; +import java.util.*; +import org.libjpegturbo.turbojpeg.*; + +final class TJBench { + + private TJBench() {} + + private static int flags = 0, quiet = 0, pf = TJ.PF_BGR, yuvPad = 1; + private static boolean compOnly, decompOnly, doTile, doYUV, write = true; + + static final String[] PIXFORMATSTR = { + "RGB", "BGR", "RGBX", "BGRX", "XBGR", "XRGB", "GRAY" + }; + + static final String[] SUBNAME_LONG = { + "4:4:4", "4:2:2", "4:2:0", "GRAY", "4:4:0", "4:1:1" + }; + + static final String[] SUBNAME = { + "444", "422", "420", "GRAY", "440", "411" + }; + + static final String[] CSNAME = { + "RGB", "YCbCr", "GRAY", "CMYK", "YCCK" + }; + + private static TJScalingFactor sf; + private static int xformOp = TJTransform.OP_NONE, xformOpt = 0; + private static double benchTime = 5.0, warmup = 1.0; + + + static double getTime() { + return (double)System.nanoTime() / 1.0e9; + } + + + private static String tjErrorMsg; + private static int tjErrorCode = -1; + + static void handleTJException(TJException e) throws TJException { + String errorMsg = e.getMessage(); + int errorCode = e.getErrorCode(); + + if ((flags & TJ.FLAG_STOPONWARNING) == 0 && + errorCode == TJ.ERR_WARNING) { + if (tjErrorMsg == null || !tjErrorMsg.equals(errorMsg) || + tjErrorCode != errorCode) { + tjErrorMsg = errorMsg; + tjErrorCode = errorCode; + System.out.println("WARNING: " + errorMsg); + } + } else + throw e; + } + + + static String formatName(int subsamp, int cs) { + if (cs == TJ.CS_YCbCr) + return SUBNAME_LONG[subsamp]; + else if (cs == TJ.CS_YCCK) + return CSNAME[cs] + " " + SUBNAME_LONG[subsamp]; + else + return CSNAME[cs]; + } + + + static String sigFig(double val, int figs) { + String format; + int digitsAfterDecimal = figs - (int)Math.ceil(Math.log10(Math.abs(val))); + + if (digitsAfterDecimal < 1) + format = new String("%.0f"); + else + format = new String("%." + digitsAfterDecimal + "f"); + return String.format(format, val); + } + + + static byte[] loadImage(String fileName, int[] w, int[] h, int pixelFormat) + throws Exception { + BufferedImage img = ImageIO.read(new File(fileName)); + + if (img == null) + throw new Exception("Could not read " + fileName); + w[0] = img.getWidth(); + h[0] = img.getHeight(); + + int[] rgb = img.getRGB(0, 0, w[0], h[0], null, 0, w[0]); + int ps = TJ.getPixelSize(pixelFormat); + int rindex = TJ.getRedOffset(pixelFormat); + int gindex = TJ.getGreenOffset(pixelFormat); + int bindex = TJ.getBlueOffset(pixelFormat); + byte[] dstBuf = new byte[w[0] * h[0] * ps]; + int pixels = w[0] * h[0], dstPtr = 0, rgbPtr = 0; + + while (pixels-- > 0) { + dstBuf[dstPtr + rindex] = (byte)((rgb[rgbPtr] >> 16) & 0xff); + dstBuf[dstPtr + gindex] = (byte)((rgb[rgbPtr] >> 8) & 0xff); + dstBuf[dstPtr + bindex] = (byte)(rgb[rgbPtr] & 0xff); + dstPtr += ps; + rgbPtr++; + } + return dstBuf; + } + + + static void saveImage(String fileName, byte[] srcBuf, int w, int h, + int pixelFormat) throws Exception { + BufferedImage img = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB); + int pixels = w * h, srcPtr = 0; + int ps = TJ.getPixelSize(pixelFormat); + int rindex = TJ.getRedOffset(pixelFormat); + int gindex = TJ.getGreenOffset(pixelFormat); + int bindex = TJ.getBlueOffset(pixelFormat); + + for (int y = 0; y < h; y++) { + for (int x = 0; x < w; x++, srcPtr += ps) { + int pixel = (srcBuf[srcPtr + rindex] & 0xff) << 16 | + (srcBuf[srcPtr + gindex] & 0xff) << 8 | + (srcBuf[srcPtr + bindex] & 0xff); + + img.setRGB(x, y, pixel); + } + } + ImageIO.write(img, "bmp", new File(fileName)); + } + + + /* Decompression test */ + static void decomp(byte[] srcBuf, byte[][] jpegBuf, int[] jpegSize, + byte[] dstBuf, int w, int h, int subsamp, int jpegQual, + String fileName, int tilew, int tileh) throws Exception { + String qualStr = new String(""), sizeStr, tempStr; + TJDecompressor tjd; + double elapsed, elapsedDecode; + int ps = TJ.getPixelSize(pf), i, iter = 0; + int scaledw = sf.getScaled(w); + int scaledh = sf.getScaled(h); + int pitch = scaledw * ps; + YUVImage yuvImage = null; + + if (jpegQual > 0) + qualStr = new String("_Q" + jpegQual); + + tjd = new TJDecompressor(); + + if (dstBuf == null) + dstBuf = new byte[pitch * scaledh]; + + /* Set the destination buffer to gray so we know whether the decompressor + attempted to write to it */ + Arrays.fill(dstBuf, (byte)127); + + if (doYUV) { + int width = doTile ? tilew : scaledw; + int height = doTile ? tileh : scaledh; + + yuvImage = new YUVImage(width, yuvPad, height, subsamp); + Arrays.fill(yuvImage.getBuf(), (byte)127); + } + + /* Benchmark */ + iter = -1; + elapsed = elapsedDecode = 0.0; + while (true) { + int tile = 0; + double start = getTime(); + + for (int y = 0; y < h; y += tileh) { + for (int x = 0; x < w; x += tilew, tile++) { + int width = doTile ? Math.min(tilew, w - x) : scaledw; + int height = doTile ? Math.min(tileh, h - y) : scaledh; + + tjd.setSourceImage(jpegBuf[tile], jpegSize[tile]); + if (doYUV) { + yuvImage.setBuf(yuvImage.getBuf(), width, yuvPad, height, subsamp); + try { + tjd.decompressToYUV(yuvImage, flags); + } catch (TJException e) { handleTJException(e); } + double startDecode = getTime(); + tjd.setSourceImage(yuvImage); + try { + tjd.decompress(dstBuf, x, y, width, pitch, height, pf, flags); + } catch (TJException e) { handleTJException(e); } + if (iter >= 0) + elapsedDecode += getTime() - startDecode; + } else { + try { + tjd.decompress(dstBuf, x, y, width, pitch, height, pf, flags); + } catch (TJException e) { handleTJException(e); } + } + } + } + elapsed += getTime() - start; + if (iter >= 0) { + iter++; + if (elapsed >= benchTime) + break; + } else if (elapsed >= warmup) { + iter = 0; + elapsed = elapsedDecode = 0.0; + } + } + if (doYUV) + elapsed -= elapsedDecode; + + tjd = null; + for (i = 0; i < jpegBuf.length; i++) + jpegBuf[i] = null; + jpegBuf = null; jpegSize = null; + System.gc(); + + if (quiet != 0) { + System.out.format("%-6s%s", + sigFig((double)(w * h) / 1000000. * + (double)iter / elapsed, 4), + quiet == 2 ? "\n" : " "); + if (doYUV) + System.out.format("%s\n", + sigFig((double)(w * h) / 1000000. * + (double)iter / elapsedDecode, 4)); + else if (quiet != 2) + System.out.print("\n"); + } else { + System.out.format("%s --> Frame rate: %f fps\n", + (doYUV ? "Decomp to YUV" : "Decompress "), + (double)iter / elapsed); + System.out.format(" Throughput: %f Megapixels/sec\n", + (double)(w * h) / 1000000. * (double)iter / elapsed); + if (doYUV) { + System.out.format("YUV Decode --> Frame rate: %f fps\n", + (double)iter / elapsedDecode); + System.out.format(" Throughput: %f Megapixels/sec\n", + (double)(w * h) / 1000000. * + (double)iter / elapsedDecode); + } + } + + if (!write) return; + + if (sf.getNum() != 1 || sf.getDenom() != 1) + sizeStr = new String(sf.getNum() + "_" + sf.getDenom()); + else if (tilew != w || tileh != h) + sizeStr = new String(tilew + "x" + tileh); + else + sizeStr = new String("full"); + if (decompOnly) + tempStr = new String(fileName + "_" + sizeStr + ".bmp"); + else + tempStr = new String(fileName + "_" + SUBNAME[subsamp] + qualStr + + "_" + sizeStr + ".bmp"); + + saveImage(tempStr, dstBuf, scaledw, scaledh, pf); + int ndx = tempStr.lastIndexOf('.'); + tempStr = new String(tempStr.substring(0, ndx) + "-err.bmp"); + if (srcBuf != null && sf.getNum() == 1 && sf.getDenom() == 1) { + if (quiet == 0) + System.out.println("Compression error written to " + tempStr + "."); + if (subsamp == TJ.SAMP_GRAY) { + for (int y = 0, index = 0; y < h; y++, index += pitch) { + for (int x = 0, index2 = index; x < w; x++, index2 += ps) { + int rindex = index2 + TJ.getRedOffset(pf); + int gindex = index2 + TJ.getGreenOffset(pf); + int bindex = index2 + TJ.getBlueOffset(pf); + int lum = (int)((double)(srcBuf[rindex] & 0xff) * 0.299 + + (double)(srcBuf[gindex] & 0xff) * 0.587 + + (double)(srcBuf[bindex] & 0xff) * 0.114 + 0.5); + + if (lum > 255) lum = 255; + if (lum < 0) lum = 0; + dstBuf[rindex] = (byte)Math.abs((dstBuf[rindex] & 0xff) - lum); + dstBuf[gindex] = (byte)Math.abs((dstBuf[gindex] & 0xff) - lum); + dstBuf[bindex] = (byte)Math.abs((dstBuf[bindex] & 0xff) - lum); + } + } + } else { + for (int y = 0; y < h; y++) + for (int x = 0; x < w * ps; x++) + dstBuf[pitch * y + x] = + (byte)Math.abs((dstBuf[pitch * y + x] & 0xff) - + (srcBuf[pitch * y + x] & 0xff)); + } + saveImage(tempStr, dstBuf, w, h, pf); + } + } + + + static void fullTest(byte[] srcBuf, int w, int h, int subsamp, int jpegQual, + String fileName) throws Exception { + TJCompressor tjc; + byte[] tmpBuf; + byte[][] jpegBuf; + int[] jpegSize; + double start, elapsed, elapsedEncode; + int totalJpegSize = 0, tilew, tileh, i, iter; + int ps = TJ.getPixelSize(pf); + int ntilesw = 1, ntilesh = 1, pitch = w * ps; + String pfStr = PIXFORMATSTR[pf]; + YUVImage yuvImage = null; + + tmpBuf = new byte[pitch * h]; + + if (quiet == 0) + System.out.format(">>>>> %s (%s) <--> JPEG %s Q%d <<<<<\n", pfStr, + (flags & TJ.FLAG_BOTTOMUP) != 0 ? + "Bottom-up" : "Top-down", + SUBNAME_LONG[subsamp], jpegQual); + + tjc = new TJCompressor(); + + for (tilew = doTile ? 8 : w, tileh = doTile ? 8 : h; ; + tilew *= 2, tileh *= 2) { + if (tilew > w) + tilew = w; + if (tileh > h) + tileh = h; + ntilesw = (w + tilew - 1) / tilew; + ntilesh = (h + tileh - 1) / tileh; + + jpegBuf = new byte[ntilesw * ntilesh][TJ.bufSize(tilew, tileh, subsamp)]; + jpegSize = new int[ntilesw * ntilesh]; + + /* Compression test */ + if (quiet == 1) + System.out.format("%-4s (%s) %-5s %-3d ", pfStr, + (flags & TJ.FLAG_BOTTOMUP) != 0 ? "BU" : "TD", + SUBNAME_LONG[subsamp], jpegQual); + for (i = 0; i < h; i++) + System.arraycopy(srcBuf, w * ps * i, tmpBuf, pitch * i, w * ps); + tjc.setJPEGQuality(jpegQual); + tjc.setSubsamp(subsamp); + + if (doYUV) { + yuvImage = new YUVImage(tilew, yuvPad, tileh, subsamp); + Arrays.fill(yuvImage.getBuf(), (byte)127); + } + + /* Benchmark */ + iter = -1; + elapsed = elapsedEncode = 0.0; + while (true) { + int tile = 0; + + totalJpegSize = 0; + start = getTime(); + for (int y = 0; y < h; y += tileh) { + for (int x = 0; x < w; x += tilew, tile++) { + int width = Math.min(tilew, w - x); + int height = Math.min(tileh, h - y); + + tjc.setSourceImage(srcBuf, x, y, width, pitch, height, pf); + if (doYUV) { + double startEncode = getTime(); + + yuvImage.setBuf(yuvImage.getBuf(), width, yuvPad, height, + subsamp); + tjc.encodeYUV(yuvImage, flags); + if (iter >= 0) + elapsedEncode += getTime() - startEncode; + tjc.setSourceImage(yuvImage); + } + tjc.compress(jpegBuf[tile], flags); + jpegSize[tile] = tjc.getCompressedSize(); + totalJpegSize += jpegSize[tile]; + } + } + elapsed += getTime() - start; + if (iter >= 0) { + iter++; + if (elapsed >= benchTime) + break; + } else if (elapsed >= warmup) { + iter = 0; + elapsed = elapsedEncode = 0.0; + } + } + if (doYUV) + elapsed -= elapsedEncode; + + if (quiet == 1) + System.out.format("%-5d %-5d ", tilew, tileh); + if (quiet != 0) { + if (doYUV) + System.out.format("%-6s%s", + sigFig((double)(w * h) / 1000000. * + (double)iter / elapsedEncode, 4), + quiet == 2 ? "\n" : " "); + System.out.format("%-6s%s", + sigFig((double)(w * h) / 1000000. * + (double)iter / elapsed, 4), + quiet == 2 ? "\n" : " "); + System.out.format("%-6s%s", + sigFig((double)(w * h * ps) / (double)totalJpegSize, + 4), + quiet == 2 ? "\n" : " "); + } else { + System.out.format("\n%s size: %d x %d\n", doTile ? "Tile" : "Image", + tilew, tileh); + if (doYUV) { + System.out.format("Encode YUV --> Frame rate: %f fps\n", + (double)iter / elapsedEncode); + System.out.format(" Output image size: %d bytes\n", + yuvImage.getSize()); + System.out.format(" Compression ratio: %f:1\n", + (double)(w * h * ps) / (double)yuvImage.getSize()); + System.out.format(" Throughput: %f Megapixels/sec\n", + (double)(w * h) / 1000000. * + (double)iter / elapsedEncode); + System.out.format(" Output bit stream: %f Megabits/sec\n", + (double)yuvImage.getSize() * 8. / 1000000. * + (double)iter / elapsedEncode); + } + System.out.format("%s --> Frame rate: %f fps\n", + doYUV ? "Comp from YUV" : "Compress ", + (double)iter / elapsed); + System.out.format(" Output image size: %d bytes\n", + totalJpegSize); + System.out.format(" Compression ratio: %f:1\n", + (double)(w * h * ps) / (double)totalJpegSize); + System.out.format(" Throughput: %f Megapixels/sec\n", + (double)(w * h) / 1000000. * (double)iter / elapsed); + System.out.format(" Output bit stream: %f Megabits/sec\n", + (double)totalJpegSize * 8. / 1000000. * + (double)iter / elapsed); + } + if (tilew == w && tileh == h && write) { + String tempStr = fileName + "_" + SUBNAME[subsamp] + "_" + "Q" + + jpegQual + ".jpg"; + FileOutputStream fos = new FileOutputStream(tempStr); + + fos.write(jpegBuf[0], 0, jpegSize[0]); + fos.close(); + if (quiet == 0) + System.out.println("Reference image written to " + tempStr); + } + + /* Decompression test */ + if (!compOnly) + decomp(srcBuf, jpegBuf, jpegSize, tmpBuf, w, h, subsamp, jpegQual, + fileName, tilew, tileh); + + if (tilew == w && tileh == h) break; + } + } + + + static void decompTest(String fileName) throws Exception { + TJTransformer tjt; + byte[][] jpegBuf = null; + byte[] srcBuf; + int[] jpegSize = null; + int totalJpegSize; + double start, elapsed; + int ps = TJ.getPixelSize(pf), tile, x, y, iter; + // Original image + int w = 0, h = 0, ntilesw = 1, ntilesh = 1, subsamp = -1, cs = -1; + // Transformed image + int tw, th, ttilew, ttileh, tntilesw, tntilesh, tsubsamp; + + FileInputStream fis = new FileInputStream(fileName); + int srcSize = (int)fis.getChannel().size(); + srcBuf = new byte[srcSize]; + fis.read(srcBuf, 0, srcSize); + fis.close(); + + int index = fileName.lastIndexOf('.'); + if (index >= 0) + fileName = new String(fileName.substring(0, index)); + + tjt = new TJTransformer(); + + tjt.setSourceImage(srcBuf, srcSize); + w = tjt.getWidth(); + h = tjt.getHeight(); + subsamp = tjt.getSubsamp(); + cs = tjt.getColorspace(); + + if (quiet == 1) { + System.out.println("All performance values in Mpixels/sec\n"); + System.out.format("Bitmap JPEG JPEG %s %s Xform Comp Decomp ", + (doTile ? "Tile " : "Image"), + (doTile ? "Tile " : "Image")); + if (doYUV) + System.out.print("Decode"); + System.out.print("\n"); + System.out.print("Format CS Subsamp Width Height Perf Ratio Perf "); + if (doYUV) + System.out.print("Perf"); + System.out.println("\n"); + } else if (quiet == 0) + System.out.format(">>>>> JPEG %s --> %s (%s) <<<<<\n", + formatName(subsamp, cs), PIXFORMATSTR[pf], + (flags & TJ.FLAG_BOTTOMUP) != 0 ? + "Bottom-up" : "Top-down"); + + for (int tilew = doTile ? 16 : w, tileh = doTile ? 16 : h; ; + tilew *= 2, tileh *= 2) { + if (tilew > w) + tilew = w; + if (tileh > h) + tileh = h; + ntilesw = (w + tilew - 1) / tilew; + ntilesh = (h + tileh - 1) / tileh; + + tw = w; th = h; ttilew = tilew; ttileh = tileh; + if (quiet == 0) { + System.out.format("\n%s size: %d x %d", (doTile ? "Tile" : "Image"), + ttilew, ttileh); + if (sf.getNum() != 1 || sf.getDenom() != 1) + System.out.format(" --> %d x %d", sf.getScaled(tw), + sf.getScaled(th)); + System.out.println(""); + } else if (quiet == 1) { + System.out.format("%-4s (%s) %-5s %-5s ", PIXFORMATSTR[pf], + (flags & TJ.FLAG_BOTTOMUP) != 0 ? "BU" : "TD", + CSNAME[cs], SUBNAME_LONG[subsamp]); + System.out.format("%-5d %-5d ", tilew, tileh); + } + + tsubsamp = subsamp; + if (doTile || xformOp != TJTransform.OP_NONE || xformOpt != 0) { + if (xformOp == TJTransform.OP_TRANSPOSE || + xformOp == TJTransform.OP_TRANSVERSE || + xformOp == TJTransform.OP_ROT90 || + xformOp == TJTransform.OP_ROT270) { + tw = h; th = w; ttilew = tileh; ttileh = tilew; + } + + if ((xformOpt & TJTransform.OPT_GRAY) != 0) + tsubsamp = TJ.SAMP_GRAY; + if (xformOp == TJTransform.OP_HFLIP || + xformOp == TJTransform.OP_ROT180) + tw = tw - (tw % TJ.getMCUWidth(tsubsamp)); + if (xformOp == TJTransform.OP_VFLIP || + xformOp == TJTransform.OP_ROT180) + th = th - (th % TJ.getMCUHeight(tsubsamp)); + if (xformOp == TJTransform.OP_TRANSVERSE || + xformOp == TJTransform.OP_ROT90) + tw = tw - (tw % TJ.getMCUHeight(tsubsamp)); + if (xformOp == TJTransform.OP_TRANSVERSE || + xformOp == TJTransform.OP_ROT270) + th = th - (th % TJ.getMCUWidth(tsubsamp)); + tntilesw = (tw + ttilew - 1) / ttilew; + tntilesh = (th + ttileh - 1) / ttileh; + + if (xformOp == TJTransform.OP_TRANSPOSE || + xformOp == TJTransform.OP_TRANSVERSE || + xformOp == TJTransform.OP_ROT90 || + xformOp == TJTransform.OP_ROT270) { + if (tsubsamp == TJ.SAMP_422) + tsubsamp = TJ.SAMP_440; + else if (tsubsamp == TJ.SAMP_440) + tsubsamp = TJ.SAMP_422; + } + + TJTransform[] t = new TJTransform[tntilesw * tntilesh]; + jpegBuf = + new byte[tntilesw * tntilesh][TJ.bufSize(ttilew, ttileh, subsamp)]; + + for (y = 0, tile = 0; y < th; y += ttileh) { + for (x = 0; x < tw; x += ttilew, tile++) { + t[tile] = new TJTransform(); + t[tile].width = Math.min(ttilew, tw - x); + t[tile].height = Math.min(ttileh, th - y); + t[tile].x = x; + t[tile].y = y; + t[tile].op = xformOp; + t[tile].options = xformOpt | TJTransform.OPT_TRIM; + if ((t[tile].options & TJTransform.OPT_NOOUTPUT) != 0 && + jpegBuf[tile] != null) + jpegBuf[tile] = null; + } + } + + iter = -1; + elapsed = 0.; + while (true) { + start = getTime(); + tjt.transform(jpegBuf, t, flags); + jpegSize = tjt.getTransformedSizes(); + elapsed += getTime() - start; + if (iter >= 0) { + iter++; + if (elapsed >= benchTime) + break; + } else if (elapsed >= warmup) { + iter = 0; + elapsed = 0.0; + } + } + t = null; + + for (tile = 0, totalJpegSize = 0; tile < tntilesw * tntilesh; tile++) + totalJpegSize += jpegSize[tile]; + + if (quiet != 0) { + System.out.format("%-6s%s%-6s%s", + sigFig((double)(w * h) / 1000000. / elapsed, 4), + quiet == 2 ? "\n" : " ", + sigFig((double)(w * h * ps) / + (double)totalJpegSize, 4), + quiet == 2 ? "\n" : " "); + } else if (quiet == 0) { + System.out.format("Transform --> Frame rate: %f fps\n", + 1.0 / elapsed); + System.out.format(" Output image size: %d bytes\n", + totalJpegSize); + System.out.format(" Compression ratio: %f:1\n", + (double)(w * h * ps) / (double)totalJpegSize); + System.out.format(" Throughput: %f Megapixels/sec\n", + (double)(w * h) / 1000000. / elapsed); + System.out.format(" Output bit stream: %f Megabits/sec\n", + (double)totalJpegSize * 8. / 1000000. / elapsed); + } + } else { + if (quiet == 1) + System.out.print("N/A N/A "); + jpegBuf = new byte[1][TJ.bufSize(ttilew, ttileh, subsamp)]; + jpegSize = new int[1]; + jpegBuf[0] = srcBuf; + jpegSize[0] = srcSize; + } + + if (w == tilew) + ttilew = tw; + if (h == tileh) + ttileh = th; + if ((xformOpt & TJTransform.OPT_NOOUTPUT) == 0) + decomp(null, jpegBuf, jpegSize, null, tw, th, tsubsamp, 0, + fileName, ttilew, ttileh); + else if (quiet == 1) + System.out.println("N/A"); + + jpegBuf = null; + jpegSize = null; + + if (tilew == w && tileh == h) break; + } + } + + + static void usage() throws Exception { + int i; + TJScalingFactor[] scalingFactors = TJ.getScalingFactors(); + int nsf = scalingFactors.length; + String className = new TJBench().getClass().getName(); + + System.out.println("\nUSAGE: java " + className); + System.out.println(" <Inputfile (BMP)> <Quality> [options]\n"); + System.out.println(" java " + className); + System.out.println(" <Inputfile (JPG)> [options]\n"); + System.out.println("Options:\n"); + System.out.println("-alloc = Dynamically allocate JPEG image buffers"); + System.out.println("-bottomup = Test bottom-up compression/decompression"); + System.out.println("-tile = Test performance of the codec when the image is encoded as separate"); + System.out.println(" tiles of varying sizes."); + System.out.println("-rgb, -bgr, -rgbx, -bgrx, -xbgr, -xrgb ="); + System.out.println(" Test the specified color conversion path in the codec (default = BGR)"); + System.out.println("-fastupsample = Use the fastest chrominance upsampling algorithm available in"); + System.out.println(" the underlying codec"); + System.out.println("-fastdct = Use the fastest DCT/IDCT algorithms available in the underlying"); + System.out.println(" codec"); + System.out.println("-accuratedct = Use the most accurate DCT/IDCT algorithms available in the"); + System.out.println(" underlying codec"); + System.out.println("-progressive = Use progressive entropy coding in JPEG images generated by"); + System.out.println(" compression and transform operations."); + System.out.println("-subsamp <s> = When testing JPEG compression, this option specifies the level"); + System.out.println(" of chrominance subsampling to use (<s> = 444, 422, 440, 420, 411, or"); + System.out.println(" GRAY). The default is to test Grayscale, 4:2:0, 4:2:2, and 4:4:4 in"); + System.out.println(" sequence."); + System.out.println("-quiet = Output results in tabular rather than verbose format"); + System.out.println("-yuv = Test YUV encoding/decoding functions"); + System.out.println("-yuvpad <p> = If testing YUV encoding/decoding, this specifies the number of"); + System.out.println(" bytes to which each row of each plane in the intermediate YUV image is"); + System.out.println(" padded (default = 1)"); + System.out.println("-scale M/N = Scale down the width/height of the decompressed JPEG image by a"); + System.out.print (" factor of M/N (M/N = "); + for (i = 0; i < nsf; i++) { + System.out.format("%d/%d", scalingFactors[i].getNum(), + scalingFactors[i].getDenom()); + if (nsf == 2 && i != nsf - 1) + System.out.print(" or "); + else if (nsf > 2) { + if (i != nsf - 1) + System.out.print(", "); + if (i == nsf - 2) + System.out.print("or "); + } + if (i % 8 == 0 && i != 0) + System.out.print("\n "); + } + System.out.println(")"); + System.out.println("-hflip, -vflip, -transpose, -transverse, -rot90, -rot180, -rot270 ="); + System.out.println(" Perform the corresponding lossless transform prior to"); + System.out.println(" decompression (these options are mutually exclusive)"); + System.out.println("-grayscale = Perform lossless grayscale conversion prior to decompression"); + System.out.println(" test (can be combined with the other transforms above)"); + System.out.println("-copynone = Do not copy any extra markers (including EXIF and ICC profile data)"); + System.out.println(" when transforming the image."); + System.out.println("-benchtime <t> = Run each benchmark for at least <t> seconds (default = 5.0)"); + System.out.println("-warmup <t> = Run each benchmark for <t> seconds (default = 1.0) prior to"); + System.out.println(" starting the timer, in order to prime the caches and thus improve the"); + System.out.println(" consistency of the results."); + System.out.println("-componly = Stop after running compression tests. Do not test decompression."); + System.out.println("-nowrite = Do not write reference or output images (improves consistency"); + System.out.println(" of performance measurements.)"); + System.out.println("-stoponwarning = Immediately discontinue the current"); + System.out.println(" compression/decompression/transform operation if the underlying codec"); + System.out.println(" throws a warning (non-fatal error)\n"); + System.out.println("NOTE: If the quality is specified as a range (e.g. 90-100), a separate"); + System.out.println("test will be performed for all quality values in the range.\n"); + System.exit(1); + } + + + public static void main(String[] argv) { + byte[] srcBuf = null; + int w = 0, h = 0, minQual = -1, maxQual = -1; + int minArg = 1, retval = 0; + int subsamp = -1; + + try { + + if (argv.length < minArg) + usage(); + + String tempStr = argv[0].toLowerCase(); + if (tempStr.endsWith(".jpg") || tempStr.endsWith(".jpeg")) + decompOnly = true; + + System.out.println(""); + + if (!decompOnly) { + minArg = 2; + if (argv.length < minArg) + usage(); + try { + minQual = Integer.parseInt(argv[1]); + } catch (NumberFormatException e) {} + if (minQual < 1 || minQual > 100) + throw new Exception("Quality must be between 1 and 100."); + int dashIndex = argv[1].indexOf('-'); + if (dashIndex > 0 && argv[1].length() > dashIndex + 1) { + try { + maxQual = Integer.parseInt(argv[1].substring(dashIndex + 1)); + } catch (NumberFormatException e) {} + } + if (maxQual < 1 || maxQual > 100) + maxQual = minQual; + } + + if (argv.length > minArg) { + for (int i = minArg; i < argv.length; i++) { + if (argv[i].equalsIgnoreCase("-tile")) { + doTile = true; xformOpt |= TJTransform.OPT_CROP; + } else if (argv[i].equalsIgnoreCase("-fastupsample")) { + System.out.println("Using fast upsampling code\n"); + flags |= TJ.FLAG_FASTUPSAMPLE; + } else if (argv[i].equalsIgnoreCase("-fastdct")) { + System.out.println("Using fastest DCT/IDCT algorithm\n"); + flags |= TJ.FLAG_FASTDCT; + } else if (argv[i].equalsIgnoreCase("-accuratedct")) { + System.out.println("Using most accurate DCT/IDCT algorithm\n"); + flags |= TJ.FLAG_ACCURATEDCT; + } else if (argv[i].equalsIgnoreCase("-progressive")) { + System.out.println("Using progressive entropy coding\n"); + flags |= TJ.FLAG_PROGRESSIVE; + } else if (argv[i].equalsIgnoreCase("-rgb")) + pf = TJ.PF_RGB; + else if (argv[i].equalsIgnoreCase("-rgbx")) + pf = TJ.PF_RGBX; + else if (argv[i].equalsIgnoreCase("-bgr")) + pf = TJ.PF_BGR; + else if (argv[i].equalsIgnoreCase("-bgrx")) + pf = TJ.PF_BGRX; + else if (argv[i].equalsIgnoreCase("-xbgr")) + pf = TJ.PF_XBGR; + else if (argv[i].equalsIgnoreCase("-xrgb")) + pf = TJ.PF_XRGB; + else if (argv[i].equalsIgnoreCase("-bottomup")) + flags |= TJ.FLAG_BOTTOMUP; + else if (argv[i].equalsIgnoreCase("-quiet")) + quiet = 1; + else if (argv[i].equalsIgnoreCase("-qq")) + quiet = 2; + else if (argv[i].equalsIgnoreCase("-scale") && i < argv.length - 1) { + int temp1 = 0, temp2 = 0; + boolean match = false, scanned = true; + Scanner scanner = new Scanner(argv[++i]).useDelimiter("/"); + + try { + temp1 = scanner.nextInt(); + temp2 = scanner.nextInt(); + } catch (Exception e) {} + if (temp2 <= 0) temp2 = 1; + if (temp1 > 0) { + TJScalingFactor[] scalingFactors = TJ.getScalingFactors(); + + for (int j = 0; j < scalingFactors.length; j++) { + if ((double)temp1 / (double)temp2 == + (double)scalingFactors[j].getNum() / + (double)scalingFactors[j].getDenom()) { + sf = scalingFactors[j]; + match = true; break; + } + } + if (!match) usage(); + } else + usage(); + } else if (argv[i].equalsIgnoreCase("-hflip")) + xformOp = TJTransform.OP_HFLIP; + else if (argv[i].equalsIgnoreCase("-vflip")) + xformOp = TJTransform.OP_VFLIP; + else if (argv[i].equalsIgnoreCase("-transpose")) + xformOp = TJTransform.OP_TRANSPOSE; + else if (argv[i].equalsIgnoreCase("-transverse")) + xformOp = TJTransform.OP_TRANSVERSE; + else if (argv[i].equalsIgnoreCase("-rot90")) + xformOp = TJTransform.OP_ROT90; + else if (argv[i].equalsIgnoreCase("-rot180")) + xformOp = TJTransform.OP_ROT180; + else if (argv[i].equalsIgnoreCase("-rot270")) + xformOp = TJTransform.OP_ROT270; + else if (argv[i].equalsIgnoreCase("-grayscale")) + xformOpt |= TJTransform.OPT_GRAY; + else if (argv[i].equalsIgnoreCase("-nooutput")) + xformOpt |= TJTransform.OPT_NOOUTPUT; + else if (argv[i].equalsIgnoreCase("-copynone")) + xformOpt |= TJTransform.OPT_COPYNONE; + else if (argv[i].equalsIgnoreCase("-benchtime") && + i < argv.length - 1) { + double temp = -1; + + try { + temp = Double.parseDouble(argv[++i]); + } catch (NumberFormatException e) {} + if (temp > 0.0) + benchTime = temp; + else + usage(); + } else if (argv[i].equalsIgnoreCase("-warmup") && + i < argv.length - 1) { + double temp = -1; + + try { + temp = Double.parseDouble(argv[++i]); + } catch (NumberFormatException e) {} + if (temp >= 0.0) { + warmup = temp; + System.out.format("Warmup time = %.1f seconds\n\n", warmup); + } else + usage(); + } else if (argv[i].equalsIgnoreCase("-yuv")) { + System.out.println("Testing YUV planar encoding/decoding\n"); + doYUV = true; + } else if (argv[i].equalsIgnoreCase("-yuvpad") && + i < argv.length - 1) { + int temp = 0; + + try { + temp = Integer.parseInt(argv[++i]); + } catch (NumberFormatException e) {} + if (temp >= 1) + yuvPad = temp; + } else if (argv[i].equalsIgnoreCase("-subsamp") && + i < argv.length - 1) { + i++; + if (argv[i].toUpperCase().startsWith("G")) + subsamp = TJ.SAMP_GRAY; + else if (argv[i].equals("444")) + subsamp = TJ.SAMP_444; + else if (argv[i].equals("422")) + subsamp = TJ.SAMP_422; + else if (argv[i].equals("440")) + subsamp = TJ.SAMP_440; + else if (argv[i].equals("420")) + subsamp = TJ.SAMP_420; + else if (argv[i].equals("411")) + subsamp = TJ.SAMP_411; + } else if (argv[i].equalsIgnoreCase("-componly")) + compOnly = true; + else if (argv[i].equalsIgnoreCase("-nowrite")) + write = false; + else if (argv[i].equalsIgnoreCase("-stoponwarning")) + flags |= TJ.FLAG_STOPONWARNING; + else usage(); + } + } + + if (sf == null) + sf = new TJScalingFactor(1, 1); + + if ((sf.getNum() != 1 || sf.getDenom() != 1) && doTile) { + System.out.println("Disabling tiled compression/decompression tests, because those tests do not"); + System.out.println("work when scaled decompression is enabled."); + doTile = false; + } + + if (!decompOnly) { + int[] width = new int[1], height = new int[1]; + + srcBuf = loadImage(argv[0], width, height, pf); + w = width[0]; h = height[0]; + int index = -1; + if ((index = argv[0].lastIndexOf('.')) >= 0) + argv[0] = argv[0].substring(0, index); + } + + if (quiet == 1 && !decompOnly) { + System.out.println("All performance values in Mpixels/sec\n"); + System.out.format("Bitmap JPEG JPEG %s %s ", + (doTile ? "Tile " : "Image"), + (doTile ? "Tile " : "Image")); + if (doYUV) + System.out.print("Encode "); + System.out.print("Comp Comp Decomp "); + if (doYUV) + System.out.print("Decode"); + System.out.print("\n"); + System.out.print("Format Subsamp Qual Width Height "); + if (doYUV) + System.out.print("Perf "); + System.out.print("Perf Ratio Perf "); + if (doYUV) + System.out.print("Perf"); + System.out.println("\n"); + } + + if (decompOnly) { + decompTest(argv[0]); + System.out.println(""); + System.exit(retval); + } + + System.gc(); + if (subsamp >= 0 && subsamp < TJ.NUMSAMP) { + for (int i = maxQual; i >= minQual; i--) + fullTest(srcBuf, w, h, subsamp, i, argv[0]); + System.out.println(""); + } else { + for (int i = maxQual; i >= minQual; i--) + fullTest(srcBuf, w, h, TJ.SAMP_GRAY, i, argv[0]); + System.out.println(""); + System.gc(); + for (int i = maxQual; i >= minQual; i--) + fullTest(srcBuf, w, h, TJ.SAMP_420, i, argv[0]); + System.out.println(""); + System.gc(); + for (int i = maxQual; i >= minQual; i--) + fullTest(srcBuf, w, h, TJ.SAMP_422, i, argv[0]); + System.out.println(""); + System.gc(); + for (int i = maxQual; i >= minQual; i--) + fullTest(srcBuf, w, h, TJ.SAMP_444, i, argv[0]); + System.out.println(""); + } + + } catch (Exception e) { + if (e instanceof TJException) { + TJException tje = (TJException)e; + + System.out.println((tje.getErrorCode() == TJ.ERR_WARNING ? + "WARNING: " : "ERROR: ") + tje.getMessage()); + } else + System.out.println("ERROR: " + e.getMessage()); + e.printStackTrace(); + retval = -1; + } + + System.exit(retval); + } + +}
diff --git a/src/third_party/libjpeg-turbo/java/TJExample.java b/src/third_party/libjpeg-turbo/java/TJExample.java new file mode 100644 index 0000000..7859886 --- /dev/null +++ b/src/third_party/libjpeg-turbo/java/TJExample.java
@@ -0,0 +1,405 @@ +/* + * Copyright (C)2011-2012, 2014-2015, 2017-2018 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: + * + * - 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. + */ + +/* + * This program demonstrates how to compress, decompress, and transform JPEG + * images using the TurboJPEG Java API + */ + +import java.io.*; +import java.awt.*; +import java.awt.image.*; +import java.nio.*; +import javax.imageio.*; +import javax.swing.*; +import org.libjpegturbo.turbojpeg.*; + + +@SuppressWarnings("checkstyle:JavadocType") +class TJExample implements TJCustomFilter { + + static final String CLASS_NAME = + new TJExample().getClass().getName(); + + static final int DEFAULT_SUBSAMP = TJ.SAMP_444; + static final int DEFAULT_QUALITY = 95; + + + static final String[] SUBSAMP_NAME = { + "4:4:4", "4:2:2", "4:2:0", "Grayscale", "4:4:0", "4:1:1" + }; + + static final String[] COLORSPACE_NAME = { + "RGB", "YCbCr", "GRAY", "CMYK", "YCCK" + }; + + + /* DCT filter example. This produces a negative of the image. */ + + @SuppressWarnings("checkstyle:JavadocMethod") + public void customFilter(ShortBuffer coeffBuffer, Rectangle bufferRegion, + Rectangle planeRegion, int componentIndex, + int transformIndex, TJTransform transform) + throws TJException { + for (int i = 0; i < bufferRegion.width * bufferRegion.height; i++) { + coeffBuffer.put(i, (short)(-coeffBuffer.get(i))); + } + } + + + static void usage() throws Exception { + System.out.println("\nUSAGE: java [Java options] " + CLASS_NAME + + " <Input image> <Output image> [options]\n"); + + System.out.println("Input and output images can be in any image format that the Java Image I/O"); + System.out.println("extensions understand. If either filename ends in a .jpg extension, then"); + System.out.println("the TurboJPEG API will be used to compress or decompress the image.\n"); + + System.out.println("Compression Options (used if the output image is a JPEG image)"); + System.out.println("--------------------------------------------------------------\n"); + + System.out.println("-subsamp <444|422|420|gray> = Apply this level of chrominance subsampling when"); + System.out.println(" compressing the output image. The default is to use the same level of"); + System.out.println(" subsampling as in the input image, if the input image is also a JPEG"); + System.out.println(" image, or to use grayscale if the input image is a grayscale non-JPEG"); + System.out.println(" image, or to use " + + SUBSAMP_NAME[DEFAULT_SUBSAMP] + + " subsampling otherwise.\n"); + + System.out.println("-q <1-100> = Compress the output image with this JPEG quality level"); + System.out.println(" (default = " + DEFAULT_QUALITY + ").\n"); + + System.out.println("Decompression Options (used if the input image is a JPEG image)"); + System.out.println("---------------------------------------------------------------\n"); + + System.out.println("-scale M/N = Scale the input image by a factor of M/N when decompressing it."); + System.out.print("(M/N = "); + for (int i = 0; i < SCALING_FACTORS.length; i++) { + System.out.print(SCALING_FACTORS[i].getNum() + "/" + + SCALING_FACTORS[i].getDenom()); + if (SCALING_FACTORS.length == 2 && i != SCALING_FACTORS.length - 1) + System.out.print(" or "); + else if (SCALING_FACTORS.length > 2) { + if (i != SCALING_FACTORS.length - 1) + System.out.print(", "); + if (i == SCALING_FACTORS.length - 2) + System.out.print("or "); + } + } + System.out.println(")\n"); + + System.out.println("-hflip, -vflip, -transpose, -transverse, -rot90, -rot180, -rot270 ="); + System.out.println(" Perform one of these lossless transform operations on the input image"); + System.out.println(" prior to decompressing it (these options are mutually exclusive.)\n"); + + System.out.println("-grayscale = Perform lossless grayscale conversion on the input image prior"); + System.out.println(" to decompressing it (can be combined with the other transform operations"); + System.out.println(" above.)\n"); + + System.out.println("-crop WxH+X+Y = Perform lossless cropping on the input image prior to"); + System.out.println(" decompressing it. X and Y specify the upper left corner of the cropping"); + System.out.println(" region, and W and H specify the width and height of the cropping region."); + System.out.println(" X and Y must be evenly divible by the MCU block size (8x8 if the input"); + System.out.println(" image was compressed using no subsampling or grayscale, 16x8 if it was"); + System.out.println(" compressed using 4:2:2 subsampling, or 16x16 if it was compressed using"); + System.out.println(" 4:2:0 subsampling.)\n"); + + System.out.println("General Options"); + System.out.println("---------------\n"); + + System.out.println("-display = Display output image (Output filename need not be specified in this"); + System.out.println(" case.)\n"); + + System.out.println("-fastupsample = Use the fastest chrominance upsampling algorithm available in"); + System.out.println(" the underlying codec.\n"); + + System.out.println("-fastdct = Use the fastest DCT/IDCT algorithms available in the underlying"); + System.out.println(" codec.\n"); + + System.out.println("-accuratedct = Use the most accurate DCT/IDCT algorithms available in the"); + System.out.println(" underlying codec.\n"); + + System.exit(1); + } + + + public static void main(String[] argv) { + + try { + + TJScalingFactor scalingFactor = new TJScalingFactor(1, 1); + int outSubsamp = -1, outQual = -1; + TJTransform xform = new TJTransform(); + boolean display = false; + int flags = 0; + int width, height; + String inFormat = "jpg", outFormat = "jpg"; + BufferedImage img = null; + byte[] imgBuf = null; + + if (argv.length < 2) + usage(); + + if (argv[1].substring(0, 2).equalsIgnoreCase("-d")) + display = true; + + /* Parse arguments. */ + for (int i = 2; i < argv.length; i++) { + if (argv[i].length() < 2) + continue; + else if (argv[i].length() > 2 && + argv[i].substring(0, 3).equalsIgnoreCase("-sc") && + i < argv.length - 1) { + int match = 0; + String[] scaleArg = argv[++i].split("/"); + if (scaleArg.length == 2) { + TJScalingFactor tempsf = + new TJScalingFactor(Integer.parseInt(scaleArg[0]), + Integer.parseInt(scaleArg[1])); + for (int j = 0; j < SCALING_FACTORS.length; j++) { + if (tempsf.equals(SCALING_FACTORS[j])) { + scalingFactor = SCALING_FACTORS[j]; + match = 1; + break; + } + } + } + if (match != 1) + usage(); + } else if (argv[i].length() > 2 && + argv[i].substring(0, 3).equalsIgnoreCase("-su") && + i < argv.length - 1) { + i++; + if (argv[i].substring(0, 1).equalsIgnoreCase("g")) + outSubsamp = TJ.SAMP_GRAY; + else if (argv[i].equals("444")) + outSubsamp = TJ.SAMP_444; + else if (argv[i].equals("422")) + outSubsamp = TJ.SAMP_422; + else if (argv[i].equals("420")) + outSubsamp = TJ.SAMP_420; + else + usage(); + } else if (argv[i].substring(0, 2).equalsIgnoreCase("-q") && + i < argv.length - 1) { + outQual = Integer.parseInt(argv[++i]); + if (outQual < 1 || outQual > 100) + usage(); + } else if (argv[i].substring(0, 2).equalsIgnoreCase("-g")) + xform.options |= TJTransform.OPT_GRAY; + else if (argv[i].equalsIgnoreCase("-hflip")) + xform.op = TJTransform.OP_HFLIP; + else if (argv[i].equalsIgnoreCase("-vflip")) + xform.op = TJTransform.OP_VFLIP; + else if (argv[i].equalsIgnoreCase("-transpose")) + xform.op = TJTransform.OP_TRANSPOSE; + else if (argv[i].equalsIgnoreCase("-transverse")) + xform.op = TJTransform.OP_TRANSVERSE; + else if (argv[i].equalsIgnoreCase("-rot90")) + xform.op = TJTransform.OP_ROT90; + else if (argv[i].equalsIgnoreCase("-rot180")) + xform.op = TJTransform.OP_ROT180; + else if (argv[i].equalsIgnoreCase("-rot270")) + xform.op = TJTransform.OP_ROT270; + else if (argv[i].equalsIgnoreCase("-custom")) + xform.cf = new TJExample(); + else if (argv[i].length() > 2 && + argv[i].substring(0, 2).equalsIgnoreCase("-c") && + i < argv.length - 1) { + String[] cropArg = argv[++i].split("[x\\+]"); + if (cropArg.length != 4) + usage(); + xform.width = Integer.parseInt(cropArg[0]); + xform.height = Integer.parseInt(cropArg[1]); + xform.x = Integer.parseInt(cropArg[2]); + xform.y = Integer.parseInt(cropArg[3]); + if (xform.x < 0 || xform.y < 0 || xform.width < 1 || + xform.height < 1) + usage(); + xform.options |= TJTransform.OPT_CROP; + } else if (argv[i].substring(0, 2).equalsIgnoreCase("-d")) + display = true; + else if (argv[i].equalsIgnoreCase("-fastupsample")) { + System.out.println("Using fast upsampling code"); + flags |= TJ.FLAG_FASTUPSAMPLE; + } else if (argv[i].equalsIgnoreCase("-fastdct")) { + System.out.println("Using fastest DCT/IDCT algorithm"); + flags |= TJ.FLAG_FASTDCT; + } else if (argv[i].equalsIgnoreCase("-accuratedct")) { + System.out.println("Using most accurate DCT/IDCT algorithm"); + flags |= TJ.FLAG_ACCURATEDCT; + } else usage(); + } + + /* Determine input and output image formats based on file extensions. */ + String[] inFileTokens = argv[0].split("\\."); + if (inFileTokens.length > 1) + inFormat = inFileTokens[inFileTokens.length - 1]; + String[] outFileTokens; + if (display) + outFormat = "bmp"; + else { + outFileTokens = argv[1].split("\\."); + if (outFileTokens.length > 1) + outFormat = outFileTokens[outFileTokens.length - 1]; + } + + if (inFormat.equalsIgnoreCase("jpg")) { + /* Input image is a JPEG image. Decompress and/or transform it. */ + boolean doTransform = (xform.op != TJTransform.OP_NONE || + xform.options != 0 || xform.cf != null); + + /* Read the JPEG file into memory. */ + File jpegFile = new File(argv[0]); + FileInputStream fis = new FileInputStream(jpegFile); + int jpegSize = fis.available(); + if (jpegSize < 1) { + System.out.println("Input file contains no data"); + System.exit(1); + } + byte[] jpegBuf = new byte[jpegSize]; + fis.read(jpegBuf); + fis.close(); + + TJDecompressor tjd; + if (doTransform) { + /* Transform it. */ + TJTransformer tjt = new TJTransformer(jpegBuf); + TJTransform[] xforms = new TJTransform[1]; + xforms[0] = xform; + xforms[0].options |= TJTransform.OPT_TRIM; + TJDecompressor[] tjds = tjt.transform(xforms, 0); + tjd = tjds[0]; + tjt.close(); + } else + tjd = new TJDecompressor(jpegBuf); + + width = tjd.getWidth(); + height = tjd.getHeight(); + int inSubsamp = tjd.getSubsamp(); + int inColorspace = tjd.getColorspace(); + + System.out.println((doTransform ? "Transformed" : "Input") + + " Image (jpg): " + width + " x " + height + + " pixels, " + SUBSAMP_NAME[inSubsamp] + + " subsampling, " + COLORSPACE_NAME[inColorspace]); + + if (outFormat.equalsIgnoreCase("jpg") && doTransform && + scalingFactor.isOne() && outSubsamp < 0 && outQual < 0) { + /* Input image has been transformed, and no re-compression options + have been selected. Write the transformed image to disk and + exit. */ + File outFile = new File(argv[1]); + FileOutputStream fos = new FileOutputStream(outFile); + fos.write(tjd.getJPEGBuf(), 0, tjd.getJPEGSize()); + fos.close(); + System.exit(0); + } + + /* Scaling and/or a non-JPEG output image format and/or compression + options have been selected, so we need to decompress the + input/transformed image. */ + width = scalingFactor.getScaled(width); + height = scalingFactor.getScaled(height); + if (outSubsamp < 0) + outSubsamp = inSubsamp; + + if (!outFormat.equalsIgnoreCase("jpg")) + img = tjd.decompress(width, height, BufferedImage.TYPE_INT_RGB, + flags); + else + imgBuf = tjd.decompress(width, 0, height, TJ.PF_BGRX, flags); + tjd.close(); + } else { + /* Input image is not a JPEG image. Load it into memory. */ + img = ImageIO.read(new File(argv[0])); + if (img == null) + throw new Exception("Input image type not supported."); + width = img.getWidth(); + height = img.getHeight(); + if (outSubsamp < 0) { + if (img.getType() == BufferedImage.TYPE_BYTE_GRAY) + outSubsamp = TJ.SAMP_GRAY; + else + outSubsamp = DEFAULT_SUBSAMP; + } + System.out.println("Input Image: " + width + " x " + height + + " pixels"); + } + System.gc(); + if (!display) + System.out.print("Output Image (" + outFormat + "): " + width + + " x " + height + " pixels"); + + if (display) { + /* Display the uncompressed image */ + ImageIcon icon = new ImageIcon(img); + JLabel label = new JLabel(icon, JLabel.CENTER); + JOptionPane.showMessageDialog(null, label, "Output Image", + JOptionPane.PLAIN_MESSAGE); + } else if (outFormat.equalsIgnoreCase("jpg")) { + /* Output image format is JPEG. Compress the uncompressed image. */ + if (outQual < 0) + outQual = DEFAULT_QUALITY; + System.out.println(", " + SUBSAMP_NAME[outSubsamp] + + " subsampling, quality = " + outQual); + + TJCompressor tjc = new TJCompressor(); + tjc.setSubsamp(outSubsamp); + tjc.setJPEGQuality(outQual); + if (img != null) + tjc.setSourceImage(img, 0, 0, 0, 0); + else + tjc.setSourceImage(imgBuf, 0, 0, width, 0, height, TJ.PF_BGRX); + byte[] jpegBuf = tjc.compress(flags); + int jpegSize = tjc.getCompressedSize(); + tjc.close(); + + /* Write the JPEG image to disk. */ + File outFile = new File(argv[1]); + FileOutputStream fos = new FileOutputStream(outFile); + fos.write(jpegBuf, 0, jpegSize); + fos.close(); + } else { + /* Output image format is not JPEG. Save the uncompressed image + directly to disk. */ + System.out.print("\n"); + File outFile = new File(argv[1]); + ImageIO.write(img, outFormat, outFile); + } + + } catch (Exception e) { + e.printStackTrace(); + System.exit(-1); + } + } + + static final TJScalingFactor[] SCALING_FACTORS = + TJ.getScalingFactors(); +};
diff --git a/src/third_party/libjpeg-turbo/java/TJUnitTest.java b/src/third_party/libjpeg-turbo/java/TJUnitTest.java new file mode 100644 index 0000000..91ad5fd --- /dev/null +++ b/src/third_party/libjpeg-turbo/java/TJUnitTest.java
@@ -0,0 +1,960 @@ +/* + * Copyright (C)2011-2018 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: + * + * - 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. + */ + +/* + * This program tests the various code paths in the TurboJPEG JNI Wrapper + */ + +import java.io.*; +import java.util.*; +import java.awt.image.*; +import javax.imageio.*; +import java.nio.*; +import org.libjpegturbo.turbojpeg.*; + +@SuppressWarnings("checkstyle:JavadocType") +final class TJUnitTest { + + private TJUnitTest() {} + + static final String CLASS_NAME = + new TJUnitTest().getClass().getName(); + + static void usage() { + System.out.println("\nUSAGE: java " + CLASS_NAME + " [options]\n"); + System.out.println("Options:"); + System.out.println("-yuv = test YUV encoding/decoding support"); + System.out.println("-noyuvpad = do not pad each line of each Y, U, and V plane to the nearest"); + System.out.println(" 4-byte boundary"); + System.out.println("-bi = test BufferedImage support\n"); + System.exit(1); + } + + static final String[] SUBNAME_LONG = { + "4:4:4", "4:2:2", "4:2:0", "GRAY", "4:4:0", "4:1:1" + }; + static final String[] SUBNAME = { + "444", "422", "420", "GRAY", "440", "411" + }; + + static final String[] PIXFORMATSTR = { + "RGB", "BGR", "RGBX", "BGRX", "XBGR", "XRGB", "Grayscale", + "RGBA", "BGRA", "ABGR", "ARGB", "CMYK" + }; + + static final int[] FORMATS_3BYTE = { + TJ.PF_RGB, TJ.PF_BGR + }; + static final int[] FORMATS_3BYTEBI = { + BufferedImage.TYPE_3BYTE_BGR + }; + static final int[] FORMATS_4BYTE = { + TJ.PF_RGBX, TJ.PF_BGRX, TJ.PF_XBGR, TJ.PF_XRGB, TJ.PF_CMYK + }; + static final int[] FORMATS_4BYTEBI = { + BufferedImage.TYPE_INT_BGR, BufferedImage.TYPE_INT_RGB, + BufferedImage.TYPE_4BYTE_ABGR, BufferedImage.TYPE_4BYTE_ABGR_PRE, + BufferedImage.TYPE_INT_ARGB, BufferedImage.TYPE_INT_ARGB_PRE + }; + static final int[] FORMATS_GRAY = { + TJ.PF_GRAY + }; + static final int[] FORMATS_GRAYBI = { + BufferedImage.TYPE_BYTE_GRAY + }; + static final int[] FORMATS_RGB = { + TJ.PF_RGB + }; + + private static boolean doYUV = false; + private static int pad = 4; + private static boolean bi = false; + + private static int exitStatus = 0; + + static int biTypePF(int biType) { + ByteOrder byteOrder = ByteOrder.nativeOrder(); + switch (biType) { + case BufferedImage.TYPE_3BYTE_BGR: + return TJ.PF_BGR; + case BufferedImage.TYPE_4BYTE_ABGR: + case BufferedImage.TYPE_4BYTE_ABGR_PRE: + return TJ.PF_ABGR; + case BufferedImage.TYPE_BYTE_GRAY: + return TJ.PF_GRAY; + case BufferedImage.TYPE_INT_BGR: + return TJ.PF_RGBX; + case BufferedImage.TYPE_INT_RGB: + return TJ.PF_BGRX; + case BufferedImage.TYPE_INT_ARGB: + case BufferedImage.TYPE_INT_ARGB_PRE: + return TJ.PF_BGRA; + default: + return 0; + } + } + + static String biTypeStr(int biType) { + switch (biType) { + case BufferedImage.TYPE_3BYTE_BGR: + return "3BYTE_BGR"; + case BufferedImage.TYPE_4BYTE_ABGR: + return "4BYTE_ABGR"; + case BufferedImage.TYPE_4BYTE_ABGR_PRE: + return "4BYTE_ABGR_PRE"; + case BufferedImage.TYPE_BYTE_GRAY: + return "BYTE_GRAY"; + case BufferedImage.TYPE_INT_BGR: + return "INT_BGR"; + case BufferedImage.TYPE_INT_RGB: + return "INT_RGB"; + case BufferedImage.TYPE_INT_ARGB: + return "INT_ARGB"; + case BufferedImage.TYPE_INT_ARGB_PRE: + return "INT_ARGB_PRE"; + default: + return "Unknown"; + } + } + + static void initBuf(byte[] buf, int w, int pitch, int h, int pf, int flags) + throws Exception { + int roffset = TJ.getRedOffset(pf); + int goffset = TJ.getGreenOffset(pf); + int boffset = TJ.getBlueOffset(pf); + int aoffset = TJ.getAlphaOffset(pf); + int ps = TJ.getPixelSize(pf); + int index, row, col, halfway = 16; + + if (pf == TJ.PF_GRAY) { + Arrays.fill(buf, (byte)0); + for (row = 0; row < h; row++) { + for (col = 0; col < w; col++) { + if ((flags & TJ.FLAG_BOTTOMUP) != 0) + index = pitch * (h - row - 1) + col; + else + index = pitch * row + col; + if (((row / 8) + (col / 8)) % 2 == 0) + buf[index] = (row < halfway) ? (byte)255 : 0; + else + buf[index] = (row < halfway) ? 76 : (byte)226; + } + } + return; + } + if (pf == TJ.PF_CMYK) { + Arrays.fill(buf, (byte)255); + for (row = 0; row < h; row++) { + for (col = 0; col < w; col++) { + if ((flags & TJ.FLAG_BOTTOMUP) != 0) + index = (h - row - 1) * w + col; + else + index = row * w + col; + if (((row / 8) + (col / 8)) % 2 == 0) { + if (row >= halfway) buf[index * ps + 3] = 0; + } else { + buf[index * ps + 2] = 0; + if (row < halfway) + buf[index * ps + 1] = 0; + } + } + } + return; + } + + Arrays.fill(buf, (byte)0); + for (row = 0; row < h; row++) { + for (col = 0; col < w; col++) { + if ((flags & TJ.FLAG_BOTTOMUP) != 0) + index = pitch * (h - row - 1) + col * ps; + else + index = pitch * row + col * ps; + if (((row / 8) + (col / 8)) % 2 == 0) { + if (row < halfway) { + buf[index + roffset] = (byte)255; + buf[index + goffset] = (byte)255; + buf[index + boffset] = (byte)255; + } + } else { + buf[index + roffset] = (byte)255; + if (row >= halfway) + buf[index + goffset] = (byte)255; + } + if (aoffset >= 0) + buf[index + aoffset] = (byte)255; + } + } + } + + static void initIntBuf(int[] buf, int w, int pitch, int h, int pf, int flags) + throws Exception { + int rshift = TJ.getRedOffset(pf) * 8; + int gshift = TJ.getGreenOffset(pf) * 8; + int bshift = TJ.getBlueOffset(pf) * 8; + int ashift = TJ.getAlphaOffset(pf) * 8; + int index, row, col, halfway = 16; + + Arrays.fill(buf, 0); + for (row = 0; row < h; row++) { + for (col = 0; col < w; col++) { + if ((flags & TJ.FLAG_BOTTOMUP) != 0) + index = pitch * (h - row - 1) + col; + else + index = pitch * row + col; + if (((row / 8) + (col / 8)) % 2 == 0) { + if (row < halfway) { + buf[index] |= (255 << rshift); + buf[index] |= (255 << gshift); + buf[index] |= (255 << bshift); + } + } else { + buf[index] |= (255 << rshift); + if (row >= halfway) + buf[index] |= (255 << gshift); + } + if (ashift >= 0) + buf[index] |= (255 << ashift); + } + } + } + + static void initImg(BufferedImage img, int pf, int flags) throws Exception { + WritableRaster wr = img.getRaster(); + int imgType = img.getType(); + + if (imgType == BufferedImage.TYPE_INT_RGB || + imgType == BufferedImage.TYPE_INT_BGR || + imgType == BufferedImage.TYPE_INT_ARGB || + imgType == BufferedImage.TYPE_INT_ARGB_PRE) { + SinglePixelPackedSampleModel sm = + (SinglePixelPackedSampleModel)img.getSampleModel(); + int pitch = sm.getScanlineStride(); + DataBufferInt db = (DataBufferInt)wr.getDataBuffer(); + int[] buf = db.getData(); + initIntBuf(buf, img.getWidth(), pitch, img.getHeight(), pf, flags); + } else { + ComponentSampleModel sm = (ComponentSampleModel)img.getSampleModel(); + int pitch = sm.getScanlineStride(); + DataBufferByte db = (DataBufferByte)wr.getDataBuffer(); + byte[] buf = db.getData(); + initBuf(buf, img.getWidth(), pitch, img.getHeight(), pf, flags); + } + } + + static void checkVal(int row, int col, int v, String vname, int cv) + throws Exception { + v = (v < 0) ? v + 256 : v; + if (v < cv - 1 || v > cv + 1) { + throw new Exception("Comp. " + vname + " at " + row + "," + col + + " should be " + cv + ", not " + v); + } + } + + static void checkVal0(int row, int col, int v, String vname) + throws Exception { + v = (v < 0) ? v + 256 : v; + if (v > 1) { + throw new Exception("Comp. " + vname + " at " + row + "," + col + + " should be 0, not " + v); + } + } + + static void checkVal255(int row, int col, int v, String vname) + throws Exception { + v = (v < 0) ? v + 256 : v; + if (v < 254) { + throw new Exception("Comp. " + vname + " at " + row + "," + col + + " should be 255, not " + v); + } + } + + static int checkBuf(byte[] buf, int w, int pitch, int h, int pf, int subsamp, + TJScalingFactor sf, int flags) throws Exception { + int roffset = TJ.getRedOffset(pf); + int goffset = TJ.getGreenOffset(pf); + int boffset = TJ.getBlueOffset(pf); + int aoffset = TJ.getAlphaOffset(pf); + int ps = TJ.getPixelSize(pf); + int index, row, col, retval = 1; + int halfway = 16 * sf.getNum() / sf.getDenom(); + int blockSize = 8 * sf.getNum() / sf.getDenom(); + + try { + + if (pf == TJ.PF_GRAY) + roffset = goffset = boffset = 0; + + if (pf == TJ.PF_CMYK) { + for (row = 0; row < h; row++) { + for (col = 0; col < w; col++) { + if ((flags & TJ.FLAG_BOTTOMUP) != 0) + index = (h - row - 1) * w + col; + else + index = row * w + col; + byte c = buf[index * ps]; + byte m = buf[index * ps + 1]; + byte y = buf[index * ps + 2]; + byte k = buf[index * ps + 3]; + checkVal255(row, col, c, "C"); + if (((row / blockSize) + (col / blockSize)) % 2 == 0) { + checkVal255(row, col, m, "M"); + checkVal255(row, col, y, "Y"); + if (row < halfway) + checkVal255(row, col, k, "K"); + else + checkVal0(row, col, k, "K"); + } else { + checkVal0(row, col, y, "Y"); + checkVal255(row, col, k, "K"); + if (row < halfway) + checkVal0(row, col, m, "M"); + else + checkVal255(row, col, m, "M"); + } + } + } + return 1; + } + + for (row = 0; row < halfway; row++) { + for (col = 0; col < w; col++) { + if ((flags & TJ.FLAG_BOTTOMUP) != 0) + index = pitch * (h - row - 1) + col * ps; + else + index = pitch * row + col * ps; + byte r = buf[index + roffset]; + byte g = buf[index + goffset]; + byte b = buf[index + boffset]; + byte a = aoffset >= 0 ? buf[index + aoffset] : (byte)255; + if (((row / blockSize) + (col / blockSize)) % 2 == 0) { + if (row < halfway) { + checkVal255(row, col, r, "R"); + checkVal255(row, col, g, "G"); + checkVal255(row, col, b, "B"); + } else { + checkVal0(row, col, r, "R"); + checkVal0(row, col, g, "G"); + checkVal0(row, col, b, "B"); + } + } else { + if (subsamp == TJ.SAMP_GRAY) { + if (row < halfway) { + checkVal(row, col, r, "R", 76); + checkVal(row, col, g, "G", 76); + checkVal(row, col, b, "B", 76); + } else { + checkVal(row, col, r, "R", 226); + checkVal(row, col, g, "G", 226); + checkVal(row, col, b, "B", 226); + } + } else { + checkVal255(row, col, r, "R"); + if (row < halfway) { + checkVal0(row, col, g, "G"); + } else { + checkVal255(row, col, g, "G"); + } + checkVal0(row, col, b, "B"); + } + } + checkVal255(row, col, a, "A"); + } + } + } catch (Exception e) { + System.out.println("\n" + e.getMessage()); + retval = 0; + } + + if (retval == 0) { + for (row = 0; row < h; row++) { + for (col = 0; col < w; col++) { + if (pf == TJ.PF_CMYK) { + int c = buf[pitch * row + col * ps]; + int m = buf[pitch * row + col * ps + 1]; + int y = buf[pitch * row + col * ps + 2]; + int k = buf[pitch * row + col * ps + 3]; + if (c < 0) c += 256; + if (m < 0) m += 256; + if (y < 0) y += 256; + if (k < 0) k += 256; + System.out.format("%3d/%3d/%3d/%3d ", c, m, y, k); + } else { + int r = buf[pitch * row + col * ps + roffset]; + int g = buf[pitch * row + col * ps + goffset]; + int b = buf[pitch * row + col * ps + boffset]; + if (r < 0) r += 256; + if (g < 0) g += 256; + if (b < 0) b += 256; + System.out.format("%3d/%3d/%3d ", r, g, b); + } + } + System.out.print("\n"); + } + } + return retval; + } + + static int checkIntBuf(int[] buf, int w, int pitch, int h, int pf, + int subsamp, TJScalingFactor sf, int flags) + throws Exception { + int rshift = TJ.getRedOffset(pf) * 8; + int gshift = TJ.getGreenOffset(pf) * 8; + int bshift = TJ.getBlueOffset(pf) * 8; + int ashift = TJ.getAlphaOffset(pf) * 8; + int index, row, col, retval = 1; + int halfway = 16 * sf.getNum() / sf.getDenom(); + int blockSize = 8 * sf.getNum() / sf.getDenom(); + + try { + for (row = 0; row < halfway; row++) { + for (col = 0; col < w; col++) { + if ((flags & TJ.FLAG_BOTTOMUP) != 0) + index = pitch * (h - row - 1) + col; + else + index = pitch * row + col; + int r = (buf[index] >> rshift) & 0xFF; + int g = (buf[index] >> gshift) & 0xFF; + int b = (buf[index] >> bshift) & 0xFF; + int a = ashift >= 0 ? (buf[index] >> ashift) & 0xFF : 255; + if (((row / blockSize) + (col / blockSize)) % 2 == 0) { + if (row < halfway) { + checkVal255(row, col, r, "R"); + checkVal255(row, col, g, "G"); + checkVal255(row, col, b, "B"); + } else { + checkVal0(row, col, r, "R"); + checkVal0(row, col, g, "G"); + checkVal0(row, col, b, "B"); + } + } else { + if (subsamp == TJ.SAMP_GRAY) { + if (row < halfway) { + checkVal(row, col, r, "R", 76); + checkVal(row, col, g, "G", 76); + checkVal(row, col, b, "B", 76); + } else { + checkVal(row, col, r, "R", 226); + checkVal(row, col, g, "G", 226); + checkVal(row, col, b, "B", 226); + } + } else { + checkVal255(row, col, r, "R"); + if (row < halfway) { + checkVal0(row, col, g, "G"); + } else { + checkVal255(row, col, g, "G"); + } + checkVal0(row, col, b, "B"); + } + } + checkVal255(row, col, a, "A"); + } + } + } catch (Exception e) { + System.out.println("\n" + e.getMessage()); + retval = 0; + } + + if (retval == 0) { + for (row = 0; row < h; row++) { + for (col = 0; col < w; col++) { + int r = (buf[pitch * row + col] >> rshift) & 0xFF; + int g = (buf[pitch * row + col] >> gshift) & 0xFF; + int b = (buf[pitch * row + col] >> bshift) & 0xFF; + if (r < 0) r += 256; + if (g < 0) g += 256; + if (b < 0) b += 256; + System.out.format("%3d/%3d/%3d ", r, g, b); + } + System.out.print("\n"); + } + } + return retval; + } + + static int checkImg(BufferedImage img, int pf, int subsamp, + TJScalingFactor sf, int flags) throws Exception { + WritableRaster wr = img.getRaster(); + int imgType = img.getType(); + if (imgType == BufferedImage.TYPE_INT_RGB || + imgType == BufferedImage.TYPE_INT_BGR || + imgType == BufferedImage.TYPE_INT_ARGB || + imgType == BufferedImage.TYPE_INT_ARGB_PRE) { + SinglePixelPackedSampleModel sm = + (SinglePixelPackedSampleModel)img.getSampleModel(); + int pitch = sm.getScanlineStride(); + DataBufferInt db = (DataBufferInt)wr.getDataBuffer(); + int[] buf = db.getData(); + return checkIntBuf(buf, img.getWidth(), pitch, img.getHeight(), pf, + subsamp, sf, flags); + } else { + ComponentSampleModel sm = (ComponentSampleModel)img.getSampleModel(); + int pitch = sm.getScanlineStride(); + DataBufferByte db = (DataBufferByte)wr.getDataBuffer(); + byte[] buf = db.getData(); + return checkBuf(buf, img.getWidth(), pitch, img.getHeight(), pf, subsamp, + sf, flags); + } + } + + static int pad(int v, int p) { + return ((v + (p) - 1) & (~((p) - 1))); + } + + static int checkBufYUV(byte[] buf, int size, int w, int h, int subsamp, + TJScalingFactor sf) throws Exception { + int row, col; + int hsf = TJ.getMCUWidth(subsamp) / 8, vsf = TJ.getMCUHeight(subsamp) / 8; + int pw = pad(w, hsf), ph = pad(h, vsf); + int cw = pw / hsf, ch = ph / vsf; + int ypitch = pad(pw, pad), uvpitch = pad(cw, pad); + int retval = 1; + int correctsize = ypitch * ph + + (subsamp == TJ.SAMP_GRAY ? 0 : uvpitch * ch * 2); + int halfway = 16 * sf.getNum() / sf.getDenom(); + int blockSize = 8 * sf.getNum() / sf.getDenom(); + + try { + if (size != correctsize) + throw new Exception("Incorrect size " + size + ". Should be " + + correctsize); + + for (row = 0; row < ph; row++) { + for (col = 0; col < pw; col++) { + byte y = buf[ypitch * row + col]; + if (((row / blockSize) + (col / blockSize)) % 2 == 0) { + if (row < halfway) + checkVal255(row, col, y, "Y"); + else + checkVal0(row, col, y, "Y"); + } else { + if (row < halfway) + checkVal(row, col, y, "Y", 76); + else + checkVal(row, col, y, "Y", 226); + } + } + } + if (subsamp != TJ.SAMP_GRAY) { + halfway = 16 / vsf * sf.getNum() / sf.getDenom(); + for (row = 0; row < ch; row++) { + for (col = 0; col < cw; col++) { + byte u = buf[ypitch * ph + (uvpitch * row + col)], + v = buf[ypitch * ph + uvpitch * ch + (uvpitch * row + col)]; + if (((row * vsf / blockSize) + (col * hsf / blockSize)) % 2 == 0) { + checkVal(row, col, u, "U", 128); + checkVal(row, col, v, "V", 128); + } else { + if (row < halfway) { + checkVal(row, col, u, "U", 85); + checkVal255(row, col, v, "V"); + } else { + checkVal0(row, col, u, "U"); + checkVal(row, col, v, "V", 149); + } + } + } + } + } + } catch (Exception e) { + System.out.println("\n" + e.getMessage()); + retval = 0; + } + + if (retval == 0) { + for (row = 0; row < ph; row++) { + for (col = 0; col < pw; col++) { + int y = buf[ypitch * row + col]; + if (y < 0) y += 256; + System.out.format("%3d ", y); + } + System.out.print("\n"); + } + System.out.print("\n"); + for (row = 0; row < ch; row++) { + for (col = 0; col < cw; col++) { + int u = buf[ypitch * ph + (uvpitch * row + col)]; + if (u < 0) u += 256; + System.out.format("%3d ", u); + } + System.out.print("\n"); + } + System.out.print("\n"); + for (row = 0; row < ch; row++) { + for (col = 0; col < cw; col++) { + int v = buf[ypitch * ph + uvpitch * ch + (uvpitch * row + col)]; + if (v < 0) v += 256; + System.out.format("%3d ", v); + } + System.out.print("\n"); + } + } + + return retval; + } + + static void writeJPEG(byte[] jpegBuf, int jpegBufSize, String filename) + throws Exception { + File file = new File(filename); + FileOutputStream fos = new FileOutputStream(file); + fos.write(jpegBuf, 0, jpegBufSize); + fos.close(); + } + + static int compTest(TJCompressor tjc, byte[] dstBuf, int w, int h, int pf, + String baseName, int subsamp, int jpegQual, int flags) + throws Exception { + String tempStr; + byte[] srcBuf = null; + BufferedImage img = null; + String pfStr, pfStrLong; + String buStr = (flags & TJ.FLAG_BOTTOMUP) != 0 ? "BU" : "TD"; + String buStrLong = (flags & TJ.FLAG_BOTTOMUP) != 0 ? + "Bottom-Up" : "Top-Down "; + int size = 0, ps, imgType = pf; + + if (bi) { + pf = biTypePF(imgType); + pfStr = biTypeStr(imgType); + pfStrLong = pfStr + " (" + PIXFORMATSTR[pf] + ")"; + } else { + pfStr = PIXFORMATSTR[pf]; + pfStrLong = pfStr; + } + ps = TJ.getPixelSize(pf); + + if (bi) { + img = new BufferedImage(w, h, imgType); + initImg(img, pf, flags); + tempStr = baseName + "_enc_" + pfStr + "_" + buStr + "_" + + SUBNAME[subsamp] + "_Q" + jpegQual + ".png"; + File file = new File(tempStr); + ImageIO.write(img, "png", file); + tjc.setSourceImage(img, 0, 0, 0, 0); + } else { + srcBuf = new byte[w * h * ps + 1]; + initBuf(srcBuf, w, w * ps, h, pf, flags); + tjc.setSourceImage(srcBuf, 0, 0, w, 0, h, pf); + } + Arrays.fill(dstBuf, (byte)0); + + tjc.setSubsamp(subsamp); + tjc.setJPEGQuality(jpegQual); + if (doYUV) { + System.out.format("%s %s -> YUV %s ... ", pfStrLong, buStrLong, + SUBNAME_LONG[subsamp]); + YUVImage yuvImage = tjc.encodeYUV(pad, flags); + if (checkBufYUV(yuvImage.getBuf(), yuvImage.getSize(), w, h, subsamp, + new TJScalingFactor(1, 1)) == 1) + System.out.print("Passed.\n"); + else { + System.out.print("FAILED!\n"); + exitStatus = -1; + } + + System.out.format("YUV %s %s -> JPEG Q%d ... ", SUBNAME_LONG[subsamp], + buStrLong, jpegQual); + tjc.setSourceImage(yuvImage); + } else { + System.out.format("%s %s -> %s Q%d ... ", pfStrLong, buStrLong, + SUBNAME_LONG[subsamp], jpegQual); + } + tjc.compress(dstBuf, flags); + size = tjc.getCompressedSize(); + + tempStr = baseName + "_enc_" + pfStr + "_" + buStr + "_" + + SUBNAME[subsamp] + "_Q" + jpegQual + ".jpg"; + writeJPEG(dstBuf, size, tempStr); + System.out.println("Done.\n Result in " + tempStr); + + return size; + } + + static void decompTest(TJDecompressor tjd, byte[] jpegBuf, int jpegSize, + int w, int h, int pf, String baseName, int subsamp, + int flags, TJScalingFactor sf) throws Exception { + String pfStr, pfStrLong, tempStr; + String buStrLong = (flags & TJ.FLAG_BOTTOMUP) != 0 ? + "Bottom-Up" : "Top-Down "; + int scaledWidth = sf.getScaled(w); + int scaledHeight = sf.getScaled(h); + int temp1, temp2, imgType = pf; + BufferedImage img = null; + byte[] dstBuf = null; + + if (bi) { + pf = biTypePF(imgType); + pfStr = biTypeStr(imgType); + pfStrLong = pfStr + " (" + PIXFORMATSTR[pf] + ")"; + } else { + pfStr = PIXFORMATSTR[pf]; + pfStrLong = pfStr; + } + + tjd.setSourceImage(jpegBuf, jpegSize); + if (tjd.getWidth() != w || tjd.getHeight() != h || + tjd.getSubsamp() != subsamp) + throw new Exception("Incorrect JPEG header"); + + temp1 = scaledWidth; + temp2 = scaledHeight; + temp1 = tjd.getScaledWidth(temp1, temp2); + temp2 = tjd.getScaledHeight(temp1, temp2); + if (temp1 != scaledWidth || temp2 != scaledHeight) + throw new Exception("Scaled size mismatch"); + + if (doYUV) { + System.out.format("JPEG -> YUV %s ", SUBNAME_LONG[subsamp]); + if (!sf.isOne()) + System.out.format("%d/%d ... ", sf.getNum(), sf.getDenom()); + else System.out.print("... "); + YUVImage yuvImage = tjd.decompressToYUV(scaledWidth, pad, scaledHeight, + flags); + if (checkBufYUV(yuvImage.getBuf(), yuvImage.getSize(), scaledWidth, + scaledHeight, subsamp, sf) == 1) + System.out.print("Passed.\n"); + else { + System.out.print("FAILED!\n"); exitStatus = -1; + } + + System.out.format("YUV %s -> %s %s ... ", SUBNAME_LONG[subsamp], + pfStrLong, buStrLong); + tjd.setSourceImage(yuvImage); + } else { + System.out.format("JPEG -> %s %s ", pfStrLong, buStrLong); + if (!sf.isOne()) + System.out.format("%d/%d ... ", sf.getNum(), sf.getDenom()); + else System.out.print("... "); + } + if (bi) + img = tjd.decompress(scaledWidth, scaledHeight, imgType, flags); + else + dstBuf = tjd.decompress(scaledWidth, 0, scaledHeight, pf, flags); + + if (bi) { + tempStr = baseName + "_dec_" + pfStr + "_" + + (((flags & TJ.FLAG_BOTTOMUP) != 0) ? "BU" : "TD") + "_" + + SUBNAME[subsamp] + "_" + + (double)sf.getNum() / (double)sf.getDenom() + "x" + ".png"; + File file = new File(tempStr); + ImageIO.write(img, "png", file); + } + + if ((bi && checkImg(img, pf, subsamp, sf, flags) == 1) || + (!bi && checkBuf(dstBuf, scaledWidth, + scaledWidth * TJ.getPixelSize(pf), scaledHeight, pf, + subsamp, sf, flags) == 1)) + System.out.print("Passed.\n"); + else { + System.out.print("FAILED!\n"); + exitStatus = -1; + } + } + + static void decompTest(TJDecompressor tjd, byte[] jpegBuf, int jpegSize, + int w, int h, int pf, String baseName, int subsamp, + int flags) throws Exception { + int i; + TJScalingFactor[] sf = TJ.getScalingFactors(); + for (i = 0; i < sf.length; i++) { + int num = sf[i].getNum(); + int denom = sf[i].getDenom(); + if (subsamp == TJ.SAMP_444 || subsamp == TJ.SAMP_GRAY || + (subsamp == TJ.SAMP_411 && num == 1 && + (denom == 2 || denom == 1)) || + (subsamp != TJ.SAMP_411 && num == 1 && + (denom == 4 || denom == 2 || denom == 1))) + decompTest(tjd, jpegBuf, jpegSize, w, h, pf, baseName, subsamp, + flags, sf[i]); + } + } + + static void doTest(int w, int h, int[] formats, int subsamp, String baseName) + throws Exception { + TJCompressor tjc = null; + TJDecompressor tjd = null; + int size; + byte[] dstBuf; + + dstBuf = new byte[TJ.bufSize(w, h, subsamp)]; + + try { + tjc = new TJCompressor(); + tjd = new TJDecompressor(); + + for (int pf : formats) { + if (pf < 0) continue; + for (int i = 0; i < 2; i++) { + int flags = 0; + if (subsamp == TJ.SAMP_422 || subsamp == TJ.SAMP_420 || + subsamp == TJ.SAMP_440 || subsamp == TJ.SAMP_411) + flags |= TJ.FLAG_FASTUPSAMPLE; + if (i == 1) + flags |= TJ.FLAG_BOTTOMUP; + size = compTest(tjc, dstBuf, w, h, pf, baseName, subsamp, 100, + flags); + decompTest(tjd, dstBuf, size, w, h, pf, baseName, subsamp, flags); + if (pf >= TJ.PF_RGBX && pf <= TJ.PF_XRGB && !bi) { + System.out.print("\n"); + decompTest(tjd, dstBuf, size, w, h, pf + (TJ.PF_RGBA - TJ.PF_RGBX), + baseName, subsamp, flags); + } + System.out.print("\n"); + } + } + System.out.print("--------------------\n\n"); + } catch (Exception e) { + if (tjc != null) tjc.close(); + if (tjd != null) tjd.close(); + throw e; + } + if (tjc != null) tjc.close(); + if (tjd != null) tjd.close(); + } + + static void bufSizeTest() throws Exception { + int w, h, i, subsamp; + byte[] srcBuf, dstBuf = null; + YUVImage dstImage = null; + TJCompressor tjc = null; + Random r = new Random(); + + try { + tjc = new TJCompressor(); + System.out.println("Buffer size regression test"); + for (subsamp = 0; subsamp < TJ.NUMSAMP; subsamp++) { + for (w = 1; w < 48; w++) { + int maxh = (w == 1) ? 2048 : 48; + for (h = 1; h < maxh; h++) { + if (h % 100 == 0) + System.out.format("%04d x %04d\b\b\b\b\b\b\b\b\b\b\b", w, h); + srcBuf = new byte[w * h * 4]; + if (doYUV) + dstImage = new YUVImage(w, pad, h, subsamp); + else + dstBuf = new byte[TJ.bufSize(w, h, subsamp)]; + for (i = 0; i < w * h * 4; i++) { + srcBuf[i] = (byte)(r.nextInt(2) * 255); + } + tjc.setSourceImage(srcBuf, 0, 0, w, 0, h, TJ.PF_BGRX); + tjc.setSubsamp(subsamp); + tjc.setJPEGQuality(100); + if (doYUV) + tjc.encodeYUV(dstImage, 0); + else + tjc.compress(dstBuf, 0); + + srcBuf = new byte[h * w * 4]; + if (doYUV) + dstImage = new YUVImage(h, pad, w, subsamp); + else + dstBuf = new byte[TJ.bufSize(h, w, subsamp)]; + for (i = 0; i < h * w * 4; i++) { + srcBuf[i] = (byte)(r.nextInt(2) * 255); + } + tjc.setSourceImage(srcBuf, 0, 0, h, 0, w, TJ.PF_BGRX); + if (doYUV) + tjc.encodeYUV(dstImage, 0); + else + tjc.compress(dstBuf, 0); + } + dstImage = null; + dstBuf = null; + System.gc(); + } + } + System.out.println("Done. "); + } catch (Exception e) { + if (tjc != null) tjc.close(); + throw e; + } + if (tjc != null) tjc.close(); + } + + public static void main(String[] argv) { + try { + String testName = "javatest"; + for (int i = 0; i < argv.length; i++) { + if (argv[i].equalsIgnoreCase("-yuv")) + doYUV = true; + else if (argv[i].equalsIgnoreCase("-noyuvpad")) + pad = 1; + else if (argv[i].equalsIgnoreCase("-bi")) { + bi = true; + testName = "javabitest"; + } else + usage(); + } + if (doYUV) + FORMATS_4BYTE[4] = -1; + doTest(35, 39, bi ? FORMATS_3BYTEBI : FORMATS_3BYTE, TJ.SAMP_444, + testName); + doTest(39, 41, bi ? FORMATS_4BYTEBI : FORMATS_4BYTE, TJ.SAMP_444, + testName); + doTest(41, 35, bi ? FORMATS_3BYTEBI : FORMATS_3BYTE, TJ.SAMP_422, + testName); + doTest(35, 39, bi ? FORMATS_4BYTEBI : FORMATS_4BYTE, TJ.SAMP_422, + testName); + doTest(39, 41, bi ? FORMATS_3BYTEBI : FORMATS_3BYTE, TJ.SAMP_420, + testName); + doTest(41, 35, bi ? FORMATS_4BYTEBI : FORMATS_4BYTE, TJ.SAMP_420, + testName); + doTest(35, 39, bi ? FORMATS_3BYTEBI : FORMATS_3BYTE, TJ.SAMP_440, + testName); + doTest(39, 41, bi ? FORMATS_4BYTEBI : FORMATS_4BYTE, TJ.SAMP_440, + testName); + doTest(41, 35, bi ? FORMATS_3BYTEBI : FORMATS_3BYTE, TJ.SAMP_411, + testName); + doTest(35, 39, bi ? FORMATS_4BYTEBI : FORMATS_4BYTE, TJ.SAMP_411, + testName); + doTest(39, 41, bi ? FORMATS_GRAYBI : FORMATS_GRAY, TJ.SAMP_GRAY, + testName); + doTest(41, 35, bi ? FORMATS_3BYTEBI : FORMATS_3BYTE, TJ.SAMP_GRAY, + testName); + FORMATS_4BYTE[4] = -1; + doTest(35, 39, bi ? FORMATS_4BYTEBI : FORMATS_4BYTE, TJ.SAMP_GRAY, + testName); + if (!bi) + bufSizeTest(); + if (doYUV && !bi) { + System.out.print("\n--------------------\n\n"); + doTest(48, 48, FORMATS_RGB, TJ.SAMP_444, "javatest_yuv0"); + doTest(48, 48, FORMATS_RGB, TJ.SAMP_422, "javatest_yuv0"); + doTest(48, 48, FORMATS_RGB, TJ.SAMP_420, "javatest_yuv0"); + doTest(48, 48, FORMATS_RGB, TJ.SAMP_440, "javatest_yuv0"); + doTest(48, 48, FORMATS_RGB, TJ.SAMP_411, "javatest_yuv0"); + doTest(48, 48, FORMATS_RGB, TJ.SAMP_GRAY, "javatest_yuv0"); + doTest(48, 48, FORMATS_GRAY, TJ.SAMP_GRAY, "javatest_yuv0"); + } + } catch (Exception e) { + e.printStackTrace(); + exitStatus = -1; + } + System.exit(exitStatus); + } +}
diff --git a/src/third_party/libjpeg-turbo/java/doc/allclasses-frame.html b/src/third_party/libjpeg-turbo/java/doc/allclasses-frame.html new file mode 100644 index 0000000..fecac06 --- /dev/null +++ b/src/third_party/libjpeg-turbo/java/doc/allclasses-frame.html
@@ -0,0 +1,24 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!-- NewPage --> +<html lang="en"> +<head> +<title>All Classes</title> +<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style"> +</head> +<body> +<h1 class="bar">All Classes</h1> +<div class="indexContainer"> +<ul> +<li><a href="org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg" target="classFrame">TJ</a></li> +<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/YUVImage.html" title="class in org.libjpegturbo.turbojpeg" target="classFrame">YUVImage</a></li> +</ul> +</div> +</body> +</html>
diff --git a/src/third_party/libjpeg-turbo/java/doc/allclasses-noframe.html b/src/third_party/libjpeg-turbo/java/doc/allclasses-noframe.html new file mode 100644 index 0000000..1f7fd3c --- /dev/null +++ b/src/third_party/libjpeg-turbo/java/doc/allclasses-noframe.html
@@ -0,0 +1,24 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!-- NewPage --> +<html lang="en"> +<head> +<title>All Classes</title> +<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style"> +</head> +<body> +<h1 class="bar">All Classes</h1> +<div class="indexContainer"> +<ul> +<li><a href="org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</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> +<li><a href="org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a></li> +</ul> +</div> +</body> +</html>
diff --git a/src/third_party/libjpeg-turbo/java/doc/constant-values.html b/src/third_party/libjpeg-turbo/java/doc/constant-values.html new file mode 100644 index 0000000..fb33327 --- /dev/null +++ b/src/third_party/libjpeg-turbo/java/doc/constant-values.html
@@ -0,0 +1,532 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!-- NewPage --> +<html lang="en"> +<head> +<title>Constant Field Values</title> +<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style"> +</head> +<body> +<script type="text/javascript"><!-- + try { + if (location.href.indexOf('is-external=true') == -1) { + parent.document.title="Constant Field Values"; + } + } + catch(err) { + } +//--> +</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</li> +<li><a href="org/libjpegturbo/turbojpeg/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>Prev</li> +<li>Next</li> +</ul> +<ul class="navList"> +<li><a href="index.html?constant-values.html" target="_top">Frames</a></li> +<li><a href="constant-values.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> +<a name="skip-navbar_top"> +<!-- --> +</a></div> +<!-- ========= END OF TOP NAVBAR ========= --> +<div class="header"> +<h1 title="Constant Field Values" class="title">Constant Field Values</h1> +<h2 title="Contents">Contents</h2> +<ul> +<li><a href="#org.libjpegturbo">org.libjpegturbo.*</a></li> +</ul> +</div> +<div class="constantValuesContainer"><a name="org.libjpegturbo"> +<!-- --> +</a> +<h2 title="org.libjpegturbo">org.libjpegturbo.*</h2> +<ul class="blockList"> +<li class="blockList"> +<table border="0" cellpadding="3" cellspacing="0" summary="Constant Field Values table, listing constant fields, and values"> +<caption><span>org.libjpegturbo.turbojpeg.<a href="org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></span><span class="tabEnd"> </span></caption> +<tr> +<th class="colFirst" scope="col">Modifier and Type</th> +<th scope="col">Constant Field</th> +<th class="colLast" scope="col">Value</th> +</tr> +<tbody> +<tr class="altColor"> +<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.CS_CMYK"> +<!-- --> +</a><code>public static final int</code></td> +<td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#CS_CMYK">CS_CMYK</a></code></td> +<td class="colLast"><code>3</code></td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.CS_GRAY"> +<!-- --> +</a><code>public static final int</code></td> +<td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#CS_GRAY">CS_GRAY</a></code></td> +<td class="colLast"><code>2</code></td> +</tr> +<tr class="altColor"> +<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.CS_RGB"> +<!-- --> +</a><code>public static final int</code></td> +<td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#CS_RGB">CS_RGB</a></code></td> +<td class="colLast"><code>0</code></td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.CS_YCbCr"> +<!-- --> +</a><code>public static final int</code></td> +<td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#CS_YCbCr">CS_YCbCr</a></code></td> +<td class="colLast"><code>1</code></td> +</tr> +<tr class="altColor"> +<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.CS_YCCK"> +<!-- --> +</a><code>public static final int</code></td> +<td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#CS_YCCK">CS_YCCK</a></code></td> +<td class="colLast"><code>4</code></td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.ERR_FATAL"> +<!-- --> +</a><code>public static final int</code></td> +<td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#ERR_FATAL">ERR_FATAL</a></code></td> +<td class="colLast"><code>1</code></td> +</tr> +<tr class="altColor"> +<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.ERR_WARNING"> +<!-- --> +</a><code>public static final int</code></td> +<td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#ERR_WARNING">ERR_WARNING</a></code></td> +<td class="colLast"><code>0</code></td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.FLAG_ACCURATEDCT"> +<!-- --> +</a><code>public static final int</code></td> +<td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#FLAG_ACCURATEDCT">FLAG_ACCURATEDCT</a></code></td> +<td class="colLast"><code>4096</code></td> +</tr> +<tr class="altColor"> +<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.FLAG_BOTTOMUP"> +<!-- --> +</a><code>public static final int</code></td> +<td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#FLAG_BOTTOMUP">FLAG_BOTTOMUP</a></code></td> +<td class="colLast"><code>2</code></td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.FLAG_FASTDCT"> +<!-- --> +</a><code>public static final int</code></td> +<td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#FLAG_FASTDCT">FLAG_FASTDCT</a></code></td> +<td class="colLast"><code>2048</code></td> +</tr> +<tr class="altColor"> +<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.FLAG_FASTUPSAMPLE"> +<!-- --> +</a><code>public static final int</code></td> +<td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#FLAG_FASTUPSAMPLE">FLAG_FASTUPSAMPLE</a></code></td> +<td class="colLast"><code>256</code></td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.FLAG_FORCEMMX"> +<!-- --> +</a><code>public static final int</code></td> +<td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#FLAG_FORCEMMX">FLAG_FORCEMMX</a></code></td> +<td class="colLast"><code>8</code></td> +</tr> +<tr class="altColor"> +<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.FLAG_FORCESSE"> +<!-- --> +</a><code>public static final int</code></td> +<td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#FLAG_FORCESSE">FLAG_FORCESSE</a></code></td> +<td class="colLast"><code>16</code></td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.FLAG_FORCESSE2"> +<!-- --> +</a><code>public static final int</code></td> +<td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#FLAG_FORCESSE2">FLAG_FORCESSE2</a></code></td> +<td class="colLast"><code>32</code></td> +</tr> +<tr class="altColor"> +<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.FLAG_FORCESSE3"> +<!-- --> +</a><code>public static final int</code></td> +<td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#FLAG_FORCESSE3">FLAG_FORCESSE3</a></code></td> +<td class="colLast"><code>128</code></td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.FLAG_PROGRESSIVE"> +<!-- --> +</a><code>public static final int</code></td> +<td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#FLAG_PROGRESSIVE">FLAG_PROGRESSIVE</a></code></td> +<td class="colLast"><code>16384</code></td> +</tr> +<tr class="altColor"> +<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.FLAG_STOPONWARNING"> +<!-- --> +</a><code>public static final int</code></td> +<td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#FLAG_STOPONWARNING">FLAG_STOPONWARNING</a></code></td> +<td class="colLast"><code>8192</code></td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.NUMCS"> +<!-- --> +</a><code>public static final int</code></td> +<td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#NUMCS">NUMCS</a></code></td> +<td class="colLast"><code>5</code></td> +</tr> +<tr class="altColor"> +<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.NUMERR"> +<!-- --> +</a><code>public static final int</code></td> +<td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#NUMERR">NUMERR</a></code></td> +<td class="colLast"><code>2</code></td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.NUMPF"> +<!-- --> +</a><code>public static final int</code></td> +<td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#NUMPF">NUMPF</a></code></td> +<td class="colLast"><code>12</code></td> +</tr> +<tr class="altColor"> +<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.NUMSAMP"> +<!-- --> +</a><code>public static final int</code></td> +<td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#NUMSAMP">NUMSAMP</a></code></td> +<td class="colLast"><code>6</code></td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.PF_ABGR"> +<!-- --> +</a><code>public static final int</code></td> +<td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#PF_ABGR">PF_ABGR</a></code></td> +<td class="colLast"><code>9</code></td> +</tr> +<tr class="altColor"> +<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.PF_ARGB"> +<!-- --> +</a><code>public static final int</code></td> +<td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#PF_ARGB">PF_ARGB</a></code></td> +<td class="colLast"><code>10</code></td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.PF_BGR"> +<!-- --> +</a><code>public static final int</code></td> +<td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#PF_BGR">PF_BGR</a></code></td> +<td class="colLast"><code>1</code></td> +</tr> +<tr class="altColor"> +<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.PF_BGRA"> +<!-- --> +</a><code>public static final int</code></td> +<td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#PF_BGRA">PF_BGRA</a></code></td> +<td class="colLast"><code>8</code></td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.PF_BGRX"> +<!-- --> +</a><code>public static final int</code></td> +<td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#PF_BGRX">PF_BGRX</a></code></td> +<td class="colLast"><code>3</code></td> +</tr> +<tr class="altColor"> +<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.PF_CMYK"> +<!-- --> +</a><code>public static final int</code></td> +<td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#PF_CMYK">PF_CMYK</a></code></td> +<td class="colLast"><code>11</code></td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.PF_GRAY"> +<!-- --> +</a><code>public static final int</code></td> +<td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#PF_GRAY">PF_GRAY</a></code></td> +<td class="colLast"><code>6</code></td> +</tr> +<tr class="altColor"> +<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.PF_RGB"> +<!-- --> +</a><code>public static final int</code></td> +<td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#PF_RGB">PF_RGB</a></code></td> +<td class="colLast"><code>0</code></td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.PF_RGBA"> +<!-- --> +</a><code>public static final int</code></td> +<td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#PF_RGBA">PF_RGBA</a></code></td> +<td class="colLast"><code>7</code></td> +</tr> +<tr class="altColor"> +<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.PF_RGBX"> +<!-- --> +</a><code>public static final int</code></td> +<td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#PF_RGBX">PF_RGBX</a></code></td> +<td class="colLast"><code>2</code></td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.PF_XBGR"> +<!-- --> +</a><code>public static final int</code></td> +<td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#PF_XBGR">PF_XBGR</a></code></td> +<td class="colLast"><code>4</code></td> +</tr> +<tr class="altColor"> +<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.PF_XRGB"> +<!-- --> +</a><code>public static final int</code></td> +<td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#PF_XRGB">PF_XRGB</a></code></td> +<td class="colLast"><code>5</code></td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.SAMP_411"> +<!-- --> +</a><code>public static final int</code></td> +<td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#SAMP_411">SAMP_411</a></code></td> +<td class="colLast"><code>5</code></td> +</tr> +<tr class="altColor"> +<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.SAMP_420"> +<!-- --> +</a><code>public static final int</code></td> +<td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#SAMP_420">SAMP_420</a></code></td> +<td class="colLast"><code>2</code></td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.SAMP_422"> +<!-- --> +</a><code>public static final int</code></td> +<td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#SAMP_422">SAMP_422</a></code></td> +<td class="colLast"><code>1</code></td> +</tr> +<tr class="altColor"> +<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.SAMP_440"> +<!-- --> +</a><code>public static final int</code></td> +<td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#SAMP_440">SAMP_440</a></code></td> +<td class="colLast"><code>4</code></td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.SAMP_444"> +<!-- --> +</a><code>public static final int</code></td> +<td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#SAMP_444">SAMP_444</a></code></td> +<td class="colLast"><code>0</code></td> +</tr> +<tr class="altColor"> +<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.SAMP_GRAY"> +<!-- --> +</a><code>public static final int</code></td> +<td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#SAMP_GRAY">SAMP_GRAY</a></code></td> +<td class="colLast"><code>3</code></td> +</tr> +</tbody> +</table> +</li> +<li class="blockList"> +<table border="0" cellpadding="3" cellspacing="0" summary="Constant Field Values table, listing constant fields, and values"> +<caption><span>org.libjpegturbo.turbojpeg.<a href="org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</a></span><span class="tabEnd"> </span></caption> +<tr> +<th class="colFirst" scope="col">Modifier and Type</th> +<th scope="col">Constant Field</th> +<th class="colLast" scope="col">Value</th> +</tr> +<tbody> +<tr class="altColor"> +<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJTransform.NUMOP"> +<!-- --> +</a><code>public static final int</code></td> +<td><code><a href="org/libjpegturbo/turbojpeg/TJTransform.html#NUMOP">NUMOP</a></code></td> +<td class="colLast"><code>8</code></td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJTransform.OP_HFLIP"> +<!-- --> +</a><code>public static final int</code></td> +<td><code><a href="org/libjpegturbo/turbojpeg/TJTransform.html#OP_HFLIP">OP_HFLIP</a></code></td> +<td class="colLast"><code>1</code></td> +</tr> +<tr class="altColor"> +<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJTransform.OP_NONE"> +<!-- --> +</a><code>public static final int</code></td> +<td><code><a href="org/libjpegturbo/turbojpeg/TJTransform.html#OP_NONE">OP_NONE</a></code></td> +<td class="colLast"><code>0</code></td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJTransform.OP_ROT180"> +<!-- --> +</a><code>public static final int</code></td> +<td><code><a href="org/libjpegturbo/turbojpeg/TJTransform.html#OP_ROT180">OP_ROT180</a></code></td> +<td class="colLast"><code>6</code></td> +</tr> +<tr class="altColor"> +<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJTransform.OP_ROT270"> +<!-- --> +</a><code>public static final int</code></td> +<td><code><a href="org/libjpegturbo/turbojpeg/TJTransform.html#OP_ROT270">OP_ROT270</a></code></td> +<td class="colLast"><code>7</code></td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJTransform.OP_ROT90"> +<!-- --> +</a><code>public static final int</code></td> +<td><code><a href="org/libjpegturbo/turbojpeg/TJTransform.html#OP_ROT90">OP_ROT90</a></code></td> +<td class="colLast"><code>5</code></td> +</tr> +<tr class="altColor"> +<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJTransform.OP_TRANSPOSE"> +<!-- --> +</a><code>public static final int</code></td> +<td><code><a href="org/libjpegturbo/turbojpeg/TJTransform.html#OP_TRANSPOSE">OP_TRANSPOSE</a></code></td> +<td class="colLast"><code>3</code></td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJTransform.OP_TRANSVERSE"> +<!-- --> +</a><code>public static final int</code></td> +<td><code><a href="org/libjpegturbo/turbojpeg/TJTransform.html#OP_TRANSVERSE">OP_TRANSVERSE</a></code></td> +<td class="colLast"><code>4</code></td> +</tr> +<tr class="altColor"> +<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJTransform.OP_VFLIP"> +<!-- --> +</a><code>public static final int</code></td> +<td><code><a href="org/libjpegturbo/turbojpeg/TJTransform.html#OP_VFLIP">OP_VFLIP</a></code></td> +<td class="colLast"><code>2</code></td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJTransform.OPT_COPYNONE"> +<!-- --> +</a><code>public static final int</code></td> +<td><code><a href="org/libjpegturbo/turbojpeg/TJTransform.html#OPT_COPYNONE">OPT_COPYNONE</a></code></td> +<td class="colLast"><code>64</code></td> +</tr> +<tr class="altColor"> +<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJTransform.OPT_CROP"> +<!-- --> +</a><code>public static final int</code></td> +<td><code><a href="org/libjpegturbo/turbojpeg/TJTransform.html#OPT_CROP">OPT_CROP</a></code></td> +<td class="colLast"><code>4</code></td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJTransform.OPT_GRAY"> +<!-- --> +</a><code>public static final int</code></td> +<td><code><a href="org/libjpegturbo/turbojpeg/TJTransform.html#OPT_GRAY">OPT_GRAY</a></code></td> +<td class="colLast"><code>8</code></td> +</tr> +<tr class="altColor"> +<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJTransform.OPT_NOOUTPUT"> +<!-- --> +</a><code>public static final int</code></td> +<td><code><a href="org/libjpegturbo/turbojpeg/TJTransform.html#OPT_NOOUTPUT">OPT_NOOUTPUT</a></code></td> +<td class="colLast"><code>16</code></td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJTransform.OPT_PERFECT"> +<!-- --> +</a><code>public static final int</code></td> +<td><code><a href="org/libjpegturbo/turbojpeg/TJTransform.html#OPT_PERFECT">OPT_PERFECT</a></code></td> +<td class="colLast"><code>1</code></td> +</tr> +<tr class="altColor"> +<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJTransform.OPT_PROGRESSIVE"> +<!-- --> +</a><code>public static final int</code></td> +<td><code><a href="org/libjpegturbo/turbojpeg/TJTransform.html#OPT_PROGRESSIVE">OPT_PROGRESSIVE</a></code></td> +<td class="colLast"><code>32</code></td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJTransform.OPT_TRIM"> +<!-- --> +</a><code>public static final int</code></td> +<td><code><a href="org/libjpegturbo/turbojpeg/TJTransform.html#OPT_TRIM">OPT_TRIM</a></code></td> +<td class="colLast"><code>2</code></td> +</tr> +</tbody> +</table> +</li> +</ul> +</div> +<!-- ======= 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</li> +<li><a href="org/libjpegturbo/turbojpeg/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>Prev</li> +<li>Next</li> +</ul> +<ul class="navList"> +<li><a href="index.html?constant-values.html" target="_top">Frames</a></li> +<li><a href="constant-values.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> +<a name="skip-navbar_bottom"> +<!-- --> +</a></div> +<!-- ======== END OF BOTTOM NAVBAR ======= --> +</body> +</html>
diff --git a/src/third_party/libjpeg-turbo/java/doc/deprecated-list.html b/src/third_party/libjpeg-turbo/java/doc/deprecated-list.html new file mode 100644 index 0000000..31d4e64 --- /dev/null +++ b/src/third_party/libjpeg-turbo/java/doc/deprecated-list.html
@@ -0,0 +1,252 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!-- NewPage --> +<html lang="en"> +<head> +<title>Deprecated List</title> +<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style"> +</head> +<body> +<script type="text/javascript"><!-- + try { + if (location.href.indexOf('is-external=true') == -1) { + parent.document.title="Deprecated List"; + } + } + catch(err) { + } +//--> +</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</li> +<li><a href="org/libjpegturbo/turbojpeg/package-tree.html">Tree</a></li> +<li class="navBarCell1Rev">Deprecated</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>Prev</li> +<li>Next</li> +</ul> +<ul class="navList"> +<li><a href="index.html?deprecated-list.html" target="_top">Frames</a></li> +<li><a href="deprecated-list.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> +<a name="skip-navbar_top"> +<!-- --> +</a></div> +<!-- ========= END OF TOP NAVBAR ========= --> +<div class="header"> +<h1 title="Deprecated API" class="title">Deprecated API</h1> +<h2 title="Contents">Contents</h2> +<ul> +<li><a href="#field">Deprecated Fields</a></li> +<li><a href="#method">Deprecated Methods</a></li> +<li><a href="#constructor">Deprecated Constructors</a></li> +</ul> +</div> +<div class="contentContainer"><a name="field"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<table border="0" cellpadding="3" cellspacing="0" summary="Deprecated Fields table, listing deprecated fields, and an explanation"> +<caption><span>Deprecated Fields</span><span class="tabEnd"> </span></caption> +<tr> +<th class="colOne" scope="col">Field and Description</th> +</tr> +<tbody> +<tr class="altColor"> +<td class="colOne"><a href="org/libjpegturbo/turbojpeg/TJ.html#FLAG_FORCEMMX">org.libjpegturbo.turbojpeg.TJ.FLAG_FORCEMMX</a></td> +</tr> +<tr class="rowColor"> +<td class="colOne"><a href="org/libjpegturbo/turbojpeg/TJ.html#FLAG_FORCESSE">org.libjpegturbo.turbojpeg.TJ.FLAG_FORCESSE</a></td> +</tr> +<tr class="altColor"> +<td class="colOne"><a href="org/libjpegturbo/turbojpeg/TJ.html#FLAG_FORCESSE2">org.libjpegturbo.turbojpeg.TJ.FLAG_FORCESSE2</a></td> +</tr> +<tr class="rowColor"> +<td class="colOne"><a href="org/libjpegturbo/turbojpeg/TJ.html#FLAG_FORCESSE3">org.libjpegturbo.turbojpeg.TJ.FLAG_FORCESSE3</a></td> +</tr> +</tbody> +</table> +</li> +</ul> +<a name="method"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<table border="0" cellpadding="3" cellspacing="0" summary="Deprecated Methods table, listing deprecated methods, and an explanation"> +<caption><span>Deprecated Methods</span><span class="tabEnd"> </span></caption> +<tr> +<th class="colOne" scope="col">Method and Description</th> +</tr> +<tbody> +<tr class="altColor"> +<td class="colOne"><a href="org/libjpegturbo/turbojpeg/TJ.html#bufSizeYUV(int,%20int,%20int)">org.libjpegturbo.turbojpeg.TJ.bufSizeYUV(int, int, int)</a> +<div class="block"><i>Use <a href="org/libjpegturbo/turbojpeg/TJ.html#bufSizeYUV(int,%20int,%20int,%20int)"><code>TJ.bufSizeYUV(int, int, int, int)</code></a> instead.</i></div> +</td> +</tr> +<tr class="rowColor"> +<td class="colOne"><a href="org/libjpegturbo/turbojpeg/TJCompressor.html#compress(java.awt.image.BufferedImage,%20byte[],%20int)">org.libjpegturbo.turbojpeg.TJCompressor.compress(BufferedImage, byte[], int)</a> +<div class="block"><i>Use + <a href="org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage,%20int,%20int,%20int,%20int)"><code>TJCompressor.setSourceImage(BufferedImage, int, int, int, int)</code></a> and + <a href="org/libjpegturbo/turbojpeg/TJCompressor.html#compress(byte[],%20int)"><code>TJCompressor.compress(byte[], int)</code></a> instead.</i></div> +</td> +</tr> +<tr class="altColor"> +<td class="colOne"><a href="org/libjpegturbo/turbojpeg/TJCompressor.html#compress(java.awt.image.BufferedImage,%20int)">org.libjpegturbo.turbojpeg.TJCompressor.compress(BufferedImage, int)</a> +<div class="block"><i>Use + <a href="org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage,%20int,%20int,%20int,%20int)"><code>TJCompressor.setSourceImage(BufferedImage, int, int, int, int)</code></a> and + <a href="org/libjpegturbo/turbojpeg/TJCompressor.html#compress(int)"><code>TJCompressor.compress(int)</code></a> instead.</i></div> +</td> +</tr> +<tr class="rowColor"> +<td class="colOne"><a href="org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[],%20int,%20int,%20int,%20int,%20int)">org.libjpegturbo.turbojpeg.TJDecompressor.decompress(byte[], int, int, int, int, int)</a> +<div class="block"><i>Use + <a href="org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[],%20int,%20int,%20int,%20int,%20int,%20int,%20int)"><code>TJDecompressor.decompress(byte[], int, int, int, int, int, int, int)</code></a> instead.</i></div> +</td> +</tr> +<tr class="altColor"> +<td class="colOne"><a href="org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(byte[],%20int)">org.libjpegturbo.turbojpeg.TJDecompressor.decompressToYUV(byte[], int)</a> +<div class="block"><i>Use <a href="org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(org.libjpegturbo.turbojpeg.YUVImage,%20int)"><code>TJDecompressor.decompressToYUV(YUVImage, int)</code></a> instead.</i></div> +</td> +</tr> +<tr class="rowColor"> +<td class="colOne"><a href="org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(int)">org.libjpegturbo.turbojpeg.TJDecompressor.decompressToYUV(int)</a> +<div class="block"><i>Use <a href="org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(int,%20int,%20int,%20int)"><code>TJDecompressor.decompressToYUV(int, int, int, int)</code></a> instead.</i></div> +</td> +</tr> +<tr class="altColor"> +<td class="colOne"><a href="org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(java.awt.image.BufferedImage,%20byte[],%20int)">org.libjpegturbo.turbojpeg.TJCompressor.encodeYUV(BufferedImage, byte[], int)</a> +<div class="block"><i>Use + <a href="org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage,%20int,%20int,%20int,%20int)"><code>TJCompressor.setSourceImage(BufferedImage, int, int, int, int)</code></a> and + <a href="org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(byte[],%20int)"><code>TJCompressor.encodeYUV(byte[], int)</code></a> instead.</i></div> +</td> +</tr> +<tr class="rowColor"> +<td class="colOne"><a href="org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(java.awt.image.BufferedImage,%20int)">org.libjpegturbo.turbojpeg.TJCompressor.encodeYUV(BufferedImage, int)</a> +<div class="block"><i>Use + <a href="org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage,%20int,%20int,%20int,%20int)"><code>TJCompressor.setSourceImage(BufferedImage, int, int, int, int)</code></a> and + <a href="org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(int,%20int)"><code>TJCompressor.encodeYUV(int, int)</code></a> instead.</i></div> +</td> +</tr> +<tr class="altColor"> +<td class="colOne"><a href="org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(byte[],%20int)">org.libjpegturbo.turbojpeg.TJCompressor.encodeYUV(byte[], int)</a> +<div class="block"><i>Use <a href="org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(org.libjpegturbo.turbojpeg.YUVImage,%20int)"><code>TJCompressor.encodeYUV(YUVImage, int)</code></a> instead.</i></div> +</td> +</tr> +<tr class="rowColor"> +<td class="colOne"><a href="org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(int)">org.libjpegturbo.turbojpeg.TJCompressor.encodeYUV(int)</a> +<div class="block"><i>Use <a href="org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(int,%20int)"><code>TJCompressor.encodeYUV(int, int)</code></a> instead.</i></div> +</td> +</tr> +<tr class="altColor"> +<td class="colOne"><a href="org/libjpegturbo/turbojpeg/TJDecompressor.html#setJPEGImage(byte[],%20int)">org.libjpegturbo.turbojpeg.TJDecompressor.setJPEGImage(byte[], int)</a> +<div class="block"><i>Use <a href="org/libjpegturbo/turbojpeg/TJDecompressor.html#setSourceImage(byte[],%20int)"><code>TJDecompressor.setSourceImage(byte[], int)</code></a> instead.</i></div> +</td> +</tr> +<tr class="rowColor"> +<td class="colOne"><a href="org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[],%20int,%20int,%20int,%20int)">org.libjpegturbo.turbojpeg.TJCompressor.setSourceImage(byte[], int, int, int, int)</a> +<div class="block"><i>Use + <a href="org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[],%20int,%20int,%20int,%20int,%20int,%20int)"><code>TJCompressor.setSourceImage(byte[], int, int, int, int, int, int)</code></a> instead.</i></div> +</td> +</tr> +</tbody> +</table> +</li> +</ul> +<a name="constructor"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<table border="0" cellpadding="3" cellspacing="0" summary="Deprecated Constructors table, listing deprecated constructors, and an explanation"> +<caption><span>Deprecated Constructors</span><span class="tabEnd"> </span></caption> +<tr> +<th class="colOne" scope="col">Constructor and Description</th> +</tr> +<tbody> +<tr class="altColor"> +<td class="colOne"><a href="org/libjpegturbo/turbojpeg/TJCompressor.html#TJCompressor(byte[],%20int,%20int,%20int,%20int)">org.libjpegturbo.turbojpeg.TJCompressor(byte[], int, int, int, int)</a> +<div class="block"><i>Use + <a href="org/libjpegturbo/turbojpeg/TJCompressor.html#TJCompressor(byte[],%20int,%20int,%20int,%20int,%20int,%20int)"><code>TJCompressor.TJCompressor(byte[], int, int, int, int, int, int)</code></a> instead.</i></div> +</td> +</tr> +</tbody> +</table> +</li> +</ul> +</div> +<!-- ======= 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</li> +<li><a href="org/libjpegturbo/turbojpeg/package-tree.html">Tree</a></li> +<li class="navBarCell1Rev">Deprecated</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>Prev</li> +<li>Next</li> +</ul> +<ul class="navList"> +<li><a href="index.html?deprecated-list.html" target="_top">Frames</a></li> +<li><a href="deprecated-list.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> +<a name="skip-navbar_bottom"> +<!-- --> +</a></div> +<!-- ======== END OF BOTTOM NAVBAR ======= --> +</body> +</html>
diff --git a/src/third_party/libjpeg-turbo/java/doc/help-doc.html b/src/third_party/libjpeg-turbo/java/doc/help-doc.html new file mode 100644 index 0000000..6645d95 --- /dev/null +++ b/src/third_party/libjpeg-turbo/java/doc/help-doc.html
@@ -0,0 +1,210 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!-- NewPage --> +<html lang="en"> +<head> +<title>API Help</title> +<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style"> +</head> +<body> +<script type="text/javascript"><!-- + try { + if (location.href.indexOf('is-external=true') == -1) { + parent.document.title="API Help"; + } + } + catch(err) { + } +//--> +</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</li> +<li><a href="org/libjpegturbo/turbojpeg/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 class="navBarCell1Rev">Help</li> +</ul> +</div> +<div class="subNav"> +<ul class="navList"> +<li>Prev</li> +<li>Next</li> +</ul> +<ul class="navList"> +<li><a href="index.html?help-doc.html" target="_top">Frames</a></li> +<li><a href="help-doc.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> +<a name="skip-navbar_top"> +<!-- --> +</a></div> +<!-- ========= END OF TOP NAVBAR ========= --> +<div class="header"> +<h1 class="title">How This API Document Is Organized</h1> +<div class="subTitle">This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.</div> +</div> +<div class="contentContainer"> +<ul class="blockList"> +<li class="blockList"> +<h2>Package</h2> +<p>Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain six categories:</p> +<ul> +<li>Interfaces (italic)</li> +<li>Classes</li> +<li>Enums</li> +<li>Exceptions</li> +<li>Errors</li> +<li>Annotation Types</li> +</ul> +</li> +<li class="blockList"> +<h2>Class/Interface</h2> +<p>Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:</p> +<ul> +<li>Class inheritance diagram</li> +<li>Direct Subclasses</li> +<li>All Known Subinterfaces</li> +<li>All Known Implementing Classes</li> +<li>Class/interface declaration</li> +<li>Class/interface description</li> +</ul> +<ul> +<li>Nested Class Summary</li> +<li>Field Summary</li> +<li>Constructor Summary</li> +<li>Method Summary</li> +</ul> +<ul> +<li>Field Detail</li> +<li>Constructor Detail</li> +<li>Method Detail</li> +</ul> +<p>Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.</p> +</li> +<li class="blockList"> +<h2>Annotation Type</h2> +<p>Each annotation type has its own separate page with the following sections:</p> +<ul> +<li>Annotation Type declaration</li> +<li>Annotation Type description</li> +<li>Required Element Summary</li> +<li>Optional Element Summary</li> +<li>Element Detail</li> +</ul> +</li> +<li class="blockList"> +<h2>Enum</h2> +<p>Each enum has its own separate page with the following sections:</p> +<ul> +<li>Enum declaration</li> +<li>Enum description</li> +<li>Enum Constant Summary</li> +<li>Enum Constant Detail</li> +</ul> +</li> +<li class="blockList"> +<h2>Tree (Class Hierarchy)</h2> +<p>There is a <a href="overview-tree.html">Class Hierarchy</a> page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with <code>java.lang.Object</code>. The interfaces do not inherit from <code>java.lang.Object</code>.</p> +<ul> +<li>When viewing the Overview page, clicking on "Tree" displays the hierarchy for all packages.</li> +<li>When viewing a particular package, class or interface page, clicking "Tree" displays the hierarchy for only that package.</li> +</ul> +</li> +<li class="blockList"> +<h2>Deprecated API</h2> +<p>The <a href="deprecated-list.html">Deprecated API</a> page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.</p> +</li> +<li class="blockList"> +<h2>Index</h2> +<p>The <a href="index-all.html">Index</a> contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.</p> +</li> +<li class="blockList"> +<h2>Prev/Next</h2> +<p>These links take you to the next or previous class, interface, package, or related page.</p> +</li> +<li class="blockList"> +<h2>Frames/No Frames</h2> +<p>These links show and hide the HTML frames. All pages are available with or without frames.</p> +</li> +<li class="blockList"> +<h2>All Classes</h2> +<p>The <a href="allclasses-noframe.html">All Classes</a> link shows all classes and interfaces except non-static nested types.</p> +</li> +<li class="blockList"> +<h2>Serialized Form</h2> +<p>Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description.</p> +</li> +<li class="blockList"> +<h2>Constant Field Values</h2> +<p>The <a href="constant-values.html">Constant Field Values</a> page lists the static final fields and their values.</p> +</li> +</ul> +<em>This help file applies to API documentation generated using the standard doclet.</em></div> +<!-- ======= 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</li> +<li><a href="org/libjpegturbo/turbojpeg/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 class="navBarCell1Rev">Help</li> +</ul> +</div> +<div class="subNav"> +<ul class="navList"> +<li>Prev</li> +<li>Next</li> +</ul> +<ul class="navList"> +<li><a href="index.html?help-doc.html" target="_top">Frames</a></li> +<li><a href="help-doc.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> +<a name="skip-navbar_bottom"> +<!-- --> +</a></div> +<!-- ======== END OF BOTTOM NAVBAR ======= --> +</body> +</html>
diff --git a/src/third_party/libjpeg-turbo/java/doc/index-all.html b/src/third_party/libjpeg-turbo/java/doc/index-all.html new file mode 100644 index 0000000..366c7ea1 --- /dev/null +++ b/src/third_party/libjpeg-turbo/java/doc/index-all.html
@@ -0,0 +1,1029 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!-- NewPage --> +<html lang="en"> +<head> +<title>Index</title> +<link rel="stylesheet" type="text/css" href="./stylesheet.css" title="Style"> +</head> +<body> +<script type="text/javascript"><!-- + try { + if (location.href.indexOf('is-external=true') == -1) { + parent.document.title="Index"; + } + } + catch(err) { + } +//--> +</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</li> +<li><a href="./org/libjpegturbo/turbojpeg/package-tree.html">Tree</a></li> +<li><a href="./deprecated-list.html">Deprecated</a></li> +<li class="navBarCell1Rev">Index</li> +<li><a href="./help-doc.html">Help</a></li> +</ul> +</div> +<div class="subNav"> +<ul class="navList"> +<li>Prev</li> +<li>Next</li> +</ul> +<ul class="navList"> +<li><a href="./index.html?index-all.html" target="_top">Frames</a></li> +<li><a href="index-all.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> +<a name="skip-navbar_top"> +<!-- --> +</a></div> +<!-- ========= END OF TOP NAVBAR ========= --> +<div class="contentContainer"><a href="#_B_">B</a> <a href="#_C_">C</a> <a href="#_D_">D</a> <a href="#_E_">E</a> <a href="#_F_">F</a> <a href="#_G_">G</a> <a href="#_H_">H</a> <a href="#_I_">I</a> <a href="#_J_">J</a> <a href="#_N_">N</a> <a href="#_O_">O</a> <a href="#_P_">P</a> <a href="#_S_">S</a> <a href="#_T_">T</a> <a href="#_Y_">Y</a> <a name="_B_"> +<!-- --> +</a> +<h2 class="title">B</h2> +<dl> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJ.html#bufSize(int,%20int,%20int)">bufSize(int, int, int)</a></span> - Static method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt> +<dd> +<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> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJ.html#bufSizeYUV(int,%20int,%20int,%20int)">bufSizeYUV(int, int, int, int)</a></span> - Static method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt> +<dd> +<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> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJ.html#bufSizeYUV(int,%20int,%20int)">bufSizeYUV(int, int, int)</a></span> - Static method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt> +<dd> +<div class="block"><span class="strong">Deprecated.</span> +<div class="block"><i>Use <a href="./org/libjpegturbo/turbojpeg/TJ.html#bufSizeYUV(int,%20int,%20int,%20int)"><code>TJ.bufSizeYUV(int, int, int, int)</code></a> instead.</i></div> +</div> +</dd> +</dl> +<a name="_C_"> +<!-- --> +</a> +<h2 class="title">C</h2> +<dl> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJTransform.html#cf">cf</a></span> - Variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</a></dt> +<dd> +<div class="block">Custom filter instance</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#close()">close()</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</a></dt> +<dd> +<div class="block">Free the native structures associated with this compressor instance.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#close()">close()</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></dt> +<dd> +<div class="block">Free the native structures associated with this decompressor instance.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#compress(byte[],%20int)">compress(byte[], int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</a></dt> +<dd> +<div class="block">Compress the uncompressed source image associated with this compressor + instance and output a JPEG image to the given destination buffer.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#compress(int)">compress(int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</a></dt> +<dd> +<div class="block">Compress the uncompressed source image associated with this compressor + instance and return a buffer containing a JPEG image.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#compress(java.awt.image.BufferedImage,%20byte[],%20int)">compress(BufferedImage, byte[], int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</a></dt> +<dd> +<div class="block"><span class="strong">Deprecated.</span> +<div class="block"><i>Use + <a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage,%20int,%20int,%20int,%20int)"><code>TJCompressor.setSourceImage(BufferedImage, int, int, int, int)</code></a> and + <a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#compress(byte[],%20int)"><code>TJCompressor.compress(byte[], int)</code></a> instead.</i></div> +</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#compress(java.awt.image.BufferedImage,%20int)">compress(BufferedImage, int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</a></dt> +<dd> +<div class="block"><span class="strong">Deprecated.</span> +<div class="block"><i>Use + <a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage,%20int,%20int,%20int,%20int)"><code>TJCompressor.setSourceImage(BufferedImage, int, int, int, int)</code></a> and + <a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#compress(int)"><code>TJCompressor.compress(int)</code></a> instead.</i></div> +</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJ.html#CS_CMYK">CS_CMYK</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt> +<dd> +<div class="block">CMYK colorspace.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJ.html#CS_GRAY">CS_GRAY</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt> +<dd> +<div class="block">Grayscale colorspace.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJ.html#CS_RGB">CS_RGB</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt> +<dd> +<div class="block">RGB colorspace.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJ.html#CS_YCbCr">CS_YCbCr</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt> +<dd> +<div class="block">YCbCr colorspace.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJ.html#CS_YCCK">CS_YCCK</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt> +<dd> +<div class="block">YCCK colorspace.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJCustomFilter.html#customFilter(java.nio.ShortBuffer,%20java.awt.Rectangle,%20java.awt.Rectangle,%20int,%20int,%20org.libjpegturbo.turbojpeg.TJTransform)">customFilter(ShortBuffer, Rectangle, Rectangle, int, int, TJTransform)</a></span> - Method in interface org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJCustomFilter.html" title="interface in org.libjpegturbo.turbojpeg">TJCustomFilter</a></dt> +<dd> +<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.</div> +</dd> +</dl> +<a name="_D_"> +<!-- --> +</a> +<h2 class="title">D</h2> +<dl> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[],%20int,%20int,%20int,%20int,%20int,%20int,%20int)">decompress(byte[], int, int, int, int, int, int, int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></dt> +<dd> +<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> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[],%20int,%20int,%20int,%20int,%20int)">decompress(byte[], int, int, int, int, int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></dt> +<dd> +<div class="block"><span class="strong">Deprecated.</span> +<div class="block"><i>Use + <a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[],%20int,%20int,%20int,%20int,%20int,%20int,%20int)"><code>TJDecompressor.decompress(byte[], int, int, int, int, int, int, int)</code></a> instead.</i></div> +</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(int,%20int,%20int,%20int,%20int)">decompress(int, int, int, int, int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></dt> +<dd> +<div class="block">Decompress the JPEG source image associated with this decompressor + instance and return a buffer containing the decompressed image.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(int[],%20int,%20int,%20int,%20int,%20int,%20int,%20int)">decompress(int[], int, int, int, int, int, int, int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></dt> +<dd> +<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> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(java.awt.image.BufferedImage,%20int)">decompress(BufferedImage, int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></dt> +<dd> +<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> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(int,%20int,%20int,%20int)">decompress(int, int, int, int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></dt> +<dd> +<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> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(org.libjpegturbo.turbojpeg.YUVImage,%20int)">decompressToYUV(YUVImage, int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></dt> +<dd> +<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.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(byte[],%20int)">decompressToYUV(byte[], int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></dt> +<dd> +<div class="block"><span class="strong">Deprecated.</span> +<div class="block"><i>Use <a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(org.libjpegturbo.turbojpeg.YUVImage,%20int)"><code>TJDecompressor.decompressToYUV(YUVImage, int)</code></a> instead.</i></div> +</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(int,%20int[],%20int,%20int)">decompressToYUV(int, int[], int, int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></dt> +<dd> +<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.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(int,%20int,%20int,%20int)">decompressToYUV(int, int, int, int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></dt> +<dd> +<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.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(int)">decompressToYUV(int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></dt> +<dd> +<div class="block"><span class="strong">Deprecated.</span> +<div class="block"><i>Use <a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(int,%20int,%20int,%20int)"><code>TJDecompressor.decompressToYUV(int, int, int, int)</code></a> instead.</i></div> +</div> +</dd> +</dl> +<a name="_E_"> +<!-- --> +</a> +<h2 class="title">E</h2> +<dl> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(org.libjpegturbo.turbojpeg.YUVImage,%20int)">encodeYUV(YUVImage, int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</a></dt> +<dd> +<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.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(byte[],%20int)">encodeYUV(byte[], int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</a></dt> +<dd> +<div class="block"><span class="strong">Deprecated.</span> +<div class="block"><i>Use <a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(org.libjpegturbo.turbojpeg.YUVImage,%20int)"><code>TJCompressor.encodeYUV(YUVImage, int)</code></a> instead.</i></div> +</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(int,%20int)">encodeYUV(int, int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</a></dt> +<dd> +<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.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(int[],%20int)">encodeYUV(int[], int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</a></dt> +<dd> +<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.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(int)">encodeYUV(int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</a></dt> +<dd> +<div class="block"><span class="strong">Deprecated.</span> +<div class="block"><i>Use <a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(int,%20int)"><code>TJCompressor.encodeYUV(int, int)</code></a> instead.</i></div> +</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(java.awt.image.BufferedImage,%20byte[],%20int)">encodeYUV(BufferedImage, byte[], int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</a></dt> +<dd> +<div class="block"><span class="strong">Deprecated.</span> +<div class="block"><i>Use + <a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage,%20int,%20int,%20int,%20int)"><code>TJCompressor.setSourceImage(BufferedImage, int, int, int, int)</code></a> and + <a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(byte[],%20int)"><code>TJCompressor.encodeYUV(byte[], int)</code></a> instead.</i></div> +</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(java.awt.image.BufferedImage,%20int)">encodeYUV(BufferedImage, int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</a></dt> +<dd> +<div class="block"><span class="strong">Deprecated.</span> +<div class="block"><i>Use + <a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage,%20int,%20int,%20int,%20int)"><code>TJCompressor.setSourceImage(BufferedImage, int, int, int, int)</code></a> and + <a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(int,%20int)"><code>TJCompressor.encodeYUV(int, int)</code></a> instead.</i></div> +</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJScalingFactor.html#equals(org.libjpegturbo.turbojpeg.TJScalingFactor)">equals(TJScalingFactor)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg">TJScalingFactor</a></dt> +<dd> +<div class="block">Returns true or false, depending on whether this instance and + <code>other</code> have the same numerator and denominator.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJ.html#ERR_FATAL">ERR_FATAL</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt> +<dd> +<div class="block">The error was fatal and non-recoverable.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJ.html#ERR_WARNING">ERR_WARNING</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt> +<dd> +<div class="block">The error was non-fatal and recoverable, but the image may still be + corrupt.</div> +</dd> +</dl> +<a name="_F_"> +<!-- --> +</a> +<h2 class="title">F</h2> +<dl> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#finalize()">finalize()</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</a></dt> +<dd> </dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#finalize()">finalize()</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></dt> +<dd> </dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJ.html#FLAG_ACCURATEDCT">FLAG_ACCURATEDCT</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt> +<dd> +<div class="block">Use the most accurate DCT/IDCT algorithm available in the underlying + codec.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJ.html#FLAG_BOTTOMUP">FLAG_BOTTOMUP</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt> +<dd> +<div class="block">The uncompressed source/destination image is stored in bottom-up (Windows, + OpenGL) order, not top-down (X11) order.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJ.html#FLAG_FASTDCT">FLAG_FASTDCT</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt> +<dd> +<div class="block">Use the fastest DCT/IDCT algorithm available in the underlying codec.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJ.html#FLAG_FASTUPSAMPLE">FLAG_FASTUPSAMPLE</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt> +<dd> +<div class="block">When decompressing an image that was compressed using chrominance + subsampling, use the fastest chrominance upsampling algorithm available in + the underlying codec.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJ.html#FLAG_FORCEMMX">FLAG_FORCEMMX</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt> +<dd> +<div class="block"><span class="strong">Deprecated.</span></div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJ.html#FLAG_FORCESSE">FLAG_FORCESSE</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt> +<dd> +<div class="block"><span class="strong">Deprecated.</span></div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJ.html#FLAG_FORCESSE2">FLAG_FORCESSE2</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt> +<dd> +<div class="block"><span class="strong">Deprecated.</span></div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJ.html#FLAG_FORCESSE3">FLAG_FORCESSE3</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt> +<dd> +<div class="block"><span class="strong">Deprecated.</span></div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJ.html#FLAG_PROGRESSIVE">FLAG_PROGRESSIVE</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt> +<dd> +<div class="block">Use progressive entropy coding in JPEG images generated by compression and + transform operations.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJ.html#FLAG_STOPONWARNING">FLAG_STOPONWARNING</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt> +<dd> +<div class="block">Immediately discontinue the current compression/decompression/transform + operation if the underlying codec throws a warning (non-fatal error).</div> +</dd> +</dl> +<a name="_G_"> +<!-- --> +</a> +<h2 class="title">G</h2> +<dl> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJ.html#getAlphaOffset(int)">getAlphaOffset(int)</a></span> - Static method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt> +<dd> +<div class="block">For the given pixel format, returns the number of bytes that the alpha + component is offset from the start of the pixel.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJ.html#getBlueOffset(int)">getBlueOffset(int)</a></span> - Static method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt> +<dd> +<div class="block">For the given pixel format, returns the number of bytes that the blue + component is offset from the start of the pixel.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/YUVImage.html#getBuf()">getBuf()</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a></dt> +<dd> +<div class="block">Returns the YUV image buffer (if this image is stored in a unified + buffer rather than separate image planes.)</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#getColorspace()">getColorspace()</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></dt> +<dd> +<div class="block">Returns the colorspace used in the source image (JPEG or YUV) associated + with this decompressor instance.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#getCompressedSize()">getCompressedSize()</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</a></dt> +<dd> +<div class="block">Returns the size of the image (in bytes) generated by the most recent + compress operation.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJScalingFactor.html#getDenom()">getDenom()</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg">TJScalingFactor</a></dt> +<dd> +<div class="block">Returns denominator</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJException.html#getErrorCode()">getErrorCode()</a></span> - Method in exception org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></dt> +<dd> +<div class="block">Returns a code (one of <a href="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><code>TJ.ERR_*</code></a>) indicating the severity of the + last error.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJ.html#getGreenOffset(int)">getGreenOffset(int)</a></span> - Static method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt> +<dd> +<div class="block">For the given pixel format, returns the number of bytes that the green + component is offset from the start of the pixel.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#getHeight()">getHeight()</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></dt> +<dd> +<div class="block">Returns the height of the source image (JPEG or YUV) associated with this + decompressor instance.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/YUVImage.html#getHeight()">getHeight()</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a></dt> +<dd> +<div class="block">Returns the height of the YUV image (or subregion.)</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#getJPEGBuf()">getJPEGBuf()</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></dt> +<dd> +<div class="block">Returns the JPEG image buffer associated with this decompressor instance.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#getJPEGSize()">getJPEGSize()</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></dt> +<dd> +<div class="block">Returns the size of the JPEG image (in bytes) associated with this + decompressor instance.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJ.html#getMCUHeight(int)">getMCUHeight(int)</a></span> - Static method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt> +<dd> +<div class="block">Returns the MCU block height for the given level of chrominance + subsampling.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJ.html#getMCUWidth(int)">getMCUWidth(int)</a></span> - Static method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt> +<dd> +<div class="block">Returns the MCU block width for the given level of chrominance + subsampling.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJScalingFactor.html#getNum()">getNum()</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg">TJScalingFactor</a></dt> +<dd> +<div class="block">Returns numerator</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/YUVImage.html#getOffsets()">getOffsets()</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a></dt> +<dd> +<div class="block">Returns the offsets (in bytes) of each plane within the planes of a larger + YUV image.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/YUVImage.html#getPad()">getPad()</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a></dt> +<dd> +<div class="block">Returns the line padding used in the YUV image buffer (if this image is + stored in a unified buffer rather than separate image planes.)</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJ.html#getPixelSize(int)">getPixelSize(int)</a></span> - Static method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt> +<dd> +<div class="block">Returns the pixel size (in bytes) for the given pixel format.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/YUVImage.html#getPlanes()">getPlanes()</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a></dt> +<dd> +<div class="block">Returns the YUV image planes.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJ.html#getRedOffset(int)">getRedOffset(int)</a></span> - Static method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt> +<dd> +<div class="block">For the given pixel format, returns the number of bytes that the red + component is offset from the start of the pixel.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJScalingFactor.html#getScaled(int)">getScaled(int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg">TJScalingFactor</a></dt> +<dd> +<div class="block">Returns the scaled value of <code>dimension</code>.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#getScaledHeight(int,%20int)">getScaledHeight(int, int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></dt> +<dd> +<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> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#getScaledWidth(int,%20int)">getScaledWidth(int, int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></dt> +<dd> +<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> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJ.html#getScalingFactors()">getScalingFactors()</a></span> - Static method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt> +<dd> +<div class="block">Returns a list of fractional scaling factors that the JPEG decompressor in + this implementation of TurboJPEG supports.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/YUVImage.html#getSize()">getSize()</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a></dt> +<dd> +<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> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/YUVImage.html#getStrides()">getStrides()</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a></dt> +<dd> +<div class="block">Returns the number of bytes per line of each plane in the YUV image.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#getSubsamp()">getSubsamp()</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></dt> +<dd> +<div class="block">Returns the level of chrominance subsampling used in the source image + (JPEG or YUV) associated with this decompressor instance.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/YUVImage.html#getSubsamp()">getSubsamp()</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a></dt> +<dd> +<div class="block">Returns the level of chrominance subsampling used in the YUV image.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJTransformer.html#getTransformedSizes()">getTransformedSizes()</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJTransformer.html" title="class in org.libjpegturbo.turbojpeg">TJTransformer</a></dt> +<dd> +<div class="block">Returns an array containing the sizes of the transformed JPEG images + generated by the most recent transform operation.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#getWidth()">getWidth()</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></dt> +<dd> +<div class="block">Returns the width of the source image (JPEG or YUV) associated with this + decompressor instance.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/YUVImage.html#getWidth()">getWidth()</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a></dt> +<dd> +<div class="block">Returns the width of the YUV image (or subregion.)</div> +</dd> +</dl> +<a name="_H_"> +<!-- --> +</a> +<h2 class="title">H</h2> +<dl> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#handle">handle</a></span> - Variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></dt> +<dd> </dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/YUVImage.html#handle">handle</a></span> - Variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a></dt> +<dd> </dd> +</dl> +<a name="_I_"> +<!-- --> +</a> +<h2 class="title">I</h2> +<dl> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJScalingFactor.html#isOne()">isOne()</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg">TJScalingFactor</a></dt> +<dd> +<div class="block">Returns true or false, depending on whether this instance is equal to + 1/1.</div> +</dd> +</dl> +<a name="_J_"> +<!-- --> +</a> +<h2 class="title">J</h2> +<dl> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegBuf">jpegBuf</a></span> - Variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></dt> +<dd> </dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegBufSize">jpegBufSize</a></span> - Variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></dt> +<dd> </dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegColorspace">jpegColorspace</a></span> - Variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></dt> +<dd> </dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegHeight">jpegHeight</a></span> - Variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></dt> +<dd> </dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegSubsamp">jpegSubsamp</a></span> - Variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></dt> +<dd> </dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegWidth">jpegWidth</a></span> - Variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></dt> +<dd> </dd> +</dl> +<a name="_N_"> +<!-- --> +</a> +<h2 class="title">N</h2> +<dl> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJ.html#NUMCS">NUMCS</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt> +<dd> +<div class="block">The number of JPEG colorspaces</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJ.html#NUMERR">NUMERR</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt> +<dd> +<div class="block">The number of error codes</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJTransform.html#NUMOP">NUMOP</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</a></dt> +<dd> +<div class="block">The number of lossless transform operations</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJ.html#NUMPF">NUMPF</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt> +<dd> +<div class="block">The number of pixel formats</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJ.html#NUMSAMP">NUMSAMP</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt> +<dd> +<div class="block">The number of chrominance subsampling options</div> +</dd> +</dl> +<a name="_O_"> +<!-- --> +</a> +<h2 class="title">O</h2> +<dl> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJTransform.html#op">op</a></span> - Variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</a></dt> +<dd> +<div class="block">Transform operation (one of <code>OP_*</code>)</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJTransform.html#OP_HFLIP">OP_HFLIP</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</a></dt> +<dd> +<div class="block">Flip (mirror) image horizontally.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJTransform.html#OP_NONE">OP_NONE</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</a></dt> +<dd> +<div class="block">Do not transform the position of the image pixels.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJTransform.html#OP_ROT180">OP_ROT180</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</a></dt> +<dd> +<div class="block">Rotate image 180 degrees.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJTransform.html#OP_ROT270">OP_ROT270</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</a></dt> +<dd> +<div class="block">Rotate image counter-clockwise by 90 degrees.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJTransform.html#OP_ROT90">OP_ROT90</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</a></dt> +<dd> +<div class="block">Rotate image clockwise by 90 degrees.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJTransform.html#OP_TRANSPOSE">OP_TRANSPOSE</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</a></dt> +<dd> +<div class="block">Transpose image (flip/mirror along upper left to lower right axis).</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJTransform.html#OP_TRANSVERSE">OP_TRANSVERSE</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</a></dt> +<dd> +<div class="block">Transverse transpose image (flip/mirror along upper right to lower left + axis).</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJTransform.html#OP_VFLIP">OP_VFLIP</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</a></dt> +<dd> +<div class="block">Flip (mirror) image vertically.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJTransform.html#OPT_COPYNONE">OPT_COPYNONE</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</a></dt> +<dd> +<div class="block">This option will prevent <a href="./org/libjpegturbo/turbojpeg/TJTransformer.html#transform(byte[][],%20org.libjpegturbo.turbojpeg.TJTransform[],%20int)"><code>TJTransformer.transform()</code></a> from copying any extra markers (including EXIF + and ICC profile data) from the source image to the output image.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJTransform.html#OPT_CROP">OPT_CROP</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</a></dt> +<dd> +<div class="block">This option will enable lossless cropping.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJTransform.html#OPT_GRAY">OPT_GRAY</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</a></dt> +<dd> +<div class="block">This option will discard the color data in the input image and produce + a grayscale output image.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJTransform.html#OPT_NOOUTPUT">OPT_NOOUTPUT</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</a></dt> +<dd> +<div class="block">This option will prevent <a href="./org/libjpegturbo/turbojpeg/TJTransformer.html#transform(byte[][],%20org.libjpegturbo.turbojpeg.TJTransform[],%20int)"><code>TJTransformer.transform()</code></a> from outputting a JPEG image for this + particular transform.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJTransform.html#OPT_PERFECT">OPT_PERFECT</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</a></dt> +<dd> +<div class="block">This option will cause <a href="./org/libjpegturbo/turbojpeg/TJTransformer.html#transform(byte[][],%20org.libjpegturbo.turbojpeg.TJTransform[],%20int)"><code>TJTransformer.transform()</code></a> to throw an exception if the transform is not + perfect.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJTransform.html#OPT_PROGRESSIVE">OPT_PROGRESSIVE</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</a></dt> +<dd> +<div class="block">This option will enable progressive entropy coding in the output image + generated by this particular transform.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJTransform.html#OPT_TRIM">OPT_TRIM</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</a></dt> +<dd> +<div class="block">This option will discard any partial MCU blocks that cannot be + transformed.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJTransform.html#options">options</a></span> - Variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</a></dt> +<dd> +<div class="block">Transform options (bitwise OR of one or more of <code>OPT_*</code>)</div> +</dd> +<dt><a href="./org/libjpegturbo/turbojpeg/package-summary.html">org.libjpegturbo.turbojpeg</a> - package org.libjpegturbo.turbojpeg</dt> +<dd> </dd> +</dl> +<a name="_P_"> +<!-- --> +</a> +<h2 class="title">P</h2> +<dl> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJ.html#PF_ABGR">PF_ABGR</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt> +<dd> +<div class="block">ABGR pixel format.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJ.html#PF_ARGB">PF_ARGB</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt> +<dd> +<div class="block">ARGB pixel format.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJ.html#PF_BGR">PF_BGR</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt> +<dd> +<div class="block">BGR pixel format.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJ.html#PF_BGRA">PF_BGRA</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt> +<dd> +<div class="block">BGRA pixel format.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJ.html#PF_BGRX">PF_BGRX</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt> +<dd> +<div class="block">BGRX pixel format.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJ.html#PF_CMYK">PF_CMYK</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt> +<dd> +<div class="block">CMYK pixel format.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJ.html#PF_GRAY">PF_GRAY</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt> +<dd> +<div class="block">Grayscale pixel format.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJ.html#PF_RGB">PF_RGB</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt> +<dd> +<div class="block">RGB pixel format.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJ.html#PF_RGBA">PF_RGBA</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt> +<dd> +<div class="block">RGBA pixel format.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJ.html#PF_RGBX">PF_RGBX</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt> +<dd> +<div class="block">RGBX pixel format.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJ.html#PF_XBGR">PF_XBGR</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt> +<dd> +<div class="block">XBGR pixel format.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJ.html#PF_XRGB">PF_XRGB</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt> +<dd> +<div class="block">XRGB pixel format.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJ.html#planeHeight(int,%20int,%20int)">planeHeight(int, int, int)</a></span> - Static method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt> +<dd> +<div class="block">Returns the plane height of a YUV image plane with the given parameters.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJ.html#planeSizeYUV(int,%20int,%20int,%20int,%20int)">planeSizeYUV(int, int, int, int, int)</a></span> - Static method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt> +<dd> +<div class="block">Returns the size of the buffer (in bytes) required to hold a YUV image + plane with the given parameters.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJ.html#planeWidth(int,%20int,%20int)">planeWidth(int, int, int)</a></span> - Static method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt> +<dd> +<div class="block">Returns the plane width of a YUV image plane with the given parameters.</div> +</dd> +</dl> +<a name="_S_"> +<!-- --> +</a> +<h2 class="title">S</h2> +<dl> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJ.html#SAMP_411">SAMP_411</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt> +<dd> +<div class="block">4:1:1 chrominance subsampling.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJ.html#SAMP_420">SAMP_420</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt> +<dd> +<div class="block">4:2:0 chrominance subsampling.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJ.html#SAMP_422">SAMP_422</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt> +<dd> +<div class="block">4:2:2 chrominance subsampling.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJ.html#SAMP_440">SAMP_440</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt> +<dd> +<div class="block">4:4:0 chrominance subsampling.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJ.html#SAMP_444">SAMP_444</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt> +<dd> +<div class="block">4:4:4 chrominance subsampling (no chrominance subsampling).</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJ.html#SAMP_GRAY">SAMP_GRAY</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt> +<dd> +<div class="block">Grayscale.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/YUVImage.html#setBuf(byte[][],%20int[],%20int,%20int[],%20int,%20int)">setBuf(byte[][], int[], int, int[], int, int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a></dt> +<dd> +<div class="block">Assign a set of image planes to this <code>YUVImage</code> instance.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/YUVImage.html#setBuf(byte[],%20int,%20int,%20int,%20int)">setBuf(byte[], int, int, int, int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a></dt> +<dd> +<div class="block">Assign a unified image buffer to this <code>YUVImage</code> instance.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#setJPEGImage(byte[],%20int)">setJPEGImage(byte[], int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></dt> +<dd> +<div class="block"><span class="strong">Deprecated.</span> +<div class="block"><i>Use <a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#setSourceImage(byte[],%20int)"><code>TJDecompressor.setSourceImage(byte[], int)</code></a> instead.</i></div> +</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#setJPEGQuality(int)">setJPEGQuality(int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</a></dt> +<dd> +<div class="block">Set the JPEG image quality level for subsequent compress operations.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[],%20int,%20int,%20int,%20int,%20int,%20int)">setSourceImage(byte[], int, int, int, int, int, int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</a></dt> +<dd> +<div class="block">Associate an uncompressed RGB, grayscale, or CMYK source image with this + compressor instance.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[],%20int,%20int,%20int,%20int)">setSourceImage(byte[], int, int, int, int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</a></dt> +<dd> +<div class="block"><span class="strong">Deprecated.</span> +<div class="block"><i>Use + <a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[],%20int,%20int,%20int,%20int,%20int,%20int)"><code>TJCompressor.setSourceImage(byte[], int, int, int, int, int, int)</code></a> instead.</i></div> +</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage,%20int,%20int,%20int,%20int)">setSourceImage(BufferedImage, int, int, int, int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</a></dt> +<dd> +<div class="block">Associate an uncompressed RGB or grayscale source image with this + compressor instance.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(org.libjpegturbo.turbojpeg.YUVImage)">setSourceImage(YUVImage)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</a></dt> +<dd> +<div class="block">Associate an uncompressed YUV planar source image with this compressor + instance.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#setSourceImage(byte[],%20int)">setSourceImage(byte[], int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></dt> +<dd> +<div class="block">Associate the JPEG image of length <code>imageSize</code> bytes stored in + <code>jpegImage</code> with this decompressor instance.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#setSourceImage(org.libjpegturbo.turbojpeg.YUVImage)">setSourceImage(YUVImage)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></dt> +<dd> +<div class="block">Associate the specified YUV planar source image with this decompressor + instance.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#setSubsamp(int)">setSubsamp(int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</a></dt> +<dd> +<div class="block">Set the level of chrominance subsampling for subsequent compress/encode + operations.</div> +</dd> +</dl> +<a name="_T_"> +<!-- --> +</a> +<h2 class="title">T</h2> +<dl> +<dt><a href="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">TJ</span></a> - Class in <a href="./org/libjpegturbo/turbojpeg/package-summary.html">org.libjpegturbo.turbojpeg</a></dt> +<dd> +<div class="block">TurboJPEG utility class (cannot be instantiated)</div> +</dd> +<dt><a href="./org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">TJCompressor</span></a> - Class in <a href="./org/libjpegturbo/turbojpeg/package-summary.html">org.libjpegturbo.turbojpeg</a></dt> +<dd> +<div class="block">TurboJPEG compressor</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#TJCompressor()">TJCompressor()</a></span> - Constructor for class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</a></dt> +<dd> +<div class="block">Create a TurboJPEG compressor instance.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#TJCompressor(byte[],%20int,%20int,%20int,%20int,%20int,%20int)">TJCompressor(byte[], int, int, int, int, int, int)</a></span> - Constructor for class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</a></dt> +<dd> +<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> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#TJCompressor(byte[],%20int,%20int,%20int,%20int)">TJCompressor(byte[], int, int, int, int)</a></span> - Constructor for class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</a></dt> +<dd> +<div class="block"><span class="strong">Deprecated.</span> +<div class="block"><i>Use + <a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#TJCompressor(byte[],%20int,%20int,%20int,%20int,%20int,%20int)"><code>TJCompressor.TJCompressor(byte[], int, int, int, int, int, int)</code></a> instead.</i></div> +</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#TJCompressor(java.awt.image.BufferedImage,%20int,%20int,%20int,%20int)">TJCompressor(BufferedImage, int, int, int, int)</a></span> - Constructor for class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</a></dt> +<dd> +<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> +</dd> +<dt><a href="./org/libjpegturbo/turbojpeg/TJCustomFilter.html" title="interface in org.libjpegturbo.turbojpeg"><span class="strong">TJCustomFilter</span></a> - Interface in <a href="./org/libjpegturbo/turbojpeg/package-summary.html">org.libjpegturbo.turbojpeg</a></dt> +<dd> +<div class="block">Custom filter callback interface</div> +</dd> +<dt><a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">TJDecompressor</span></a> - Class in <a href="./org/libjpegturbo/turbojpeg/package-summary.html">org.libjpegturbo.turbojpeg</a></dt> +<dd> +<div class="block">TurboJPEG decompressor</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#TJDecompressor()">TJDecompressor()</a></span> - Constructor for class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></dt> +<dd> +<div class="block">Create a TurboJPEG decompresssor instance.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#TJDecompressor(byte[])">TJDecompressor(byte[])</a></span> - Constructor for class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></dt> +<dd> +<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> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#TJDecompressor(byte[],%20int)">TJDecompressor(byte[], int)</a></span> - Constructor for class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></dt> +<dd> +<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> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#TJDecompressor(org.libjpegturbo.turbojpeg.YUVImage)">TJDecompressor(YUVImage)</a></span> - Constructor for class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></dt> +<dd> +<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> +</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.String,%20int)">TJException(String, int)</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> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJScalingFactor.html#TJScalingFactor(int,%20int)">TJScalingFactor(int, int)</a></span> - Constructor for class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg">TJScalingFactor</a></dt> +<dd> +<div class="block">Create a TurboJPEG scaling factor instance.</div> +</dd> +<dt><a href="./org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">TJTransform</span></a> - Class in <a href="./org/libjpegturbo/turbojpeg/package-summary.html">org.libjpegturbo.turbojpeg</a></dt> +<dd> +<div class="block">Lossless transform parameters</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJTransform.html#TJTransform()">TJTransform()</a></span> - Constructor for class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</a></dt> +<dd> +<div class="block">Create a new lossless transform instance.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJTransform.html#TJTransform(int,%20int,%20int,%20int,%20int,%20int,%20org.libjpegturbo.turbojpeg.TJCustomFilter)">TJTransform(int, int, int, int, int, int, TJCustomFilter)</a></span> - Constructor for class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</a></dt> +<dd> +<div class="block">Create a new lossless transform instance with the given parameters.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJTransform.html#TJTransform(java.awt.Rectangle,%20int,%20int,%20org.libjpegturbo.turbojpeg.TJCustomFilter)">TJTransform(Rectangle, int, int, TJCustomFilter)</a></span> - Constructor for class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</a></dt> +<dd> +<div class="block">Create a new lossless transform instance with the given parameters.</div> +</dd> +<dt><a href="./org/libjpegturbo/turbojpeg/TJTransformer.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">TJTransformer</span></a> - Class in <a href="./org/libjpegturbo/turbojpeg/package-summary.html">org.libjpegturbo.turbojpeg</a></dt> +<dd> +<div class="block">TurboJPEG lossless transformer</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJTransformer.html#TJTransformer()">TJTransformer()</a></span> - Constructor for class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJTransformer.html" title="class in org.libjpegturbo.turbojpeg">TJTransformer</a></dt> +<dd> +<div class="block">Create a TurboJPEG lossless transformer instance.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJTransformer.html#TJTransformer(byte[])">TJTransformer(byte[])</a></span> - Constructor for class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJTransformer.html" title="class in org.libjpegturbo.turbojpeg">TJTransformer</a></dt> +<dd> +<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> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJTransformer.html#TJTransformer(byte[],%20int)">TJTransformer(byte[], int)</a></span> - Constructor for class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJTransformer.html" title="class in org.libjpegturbo.turbojpeg">TJTransformer</a></dt> +<dd> +<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> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJTransformer.html#transform(byte[][],%20org.libjpegturbo.turbojpeg.TJTransform[],%20int)">transform(byte[][], TJTransform[], int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJTransformer.html" title="class in org.libjpegturbo.turbojpeg">TJTransformer</a></dt> +<dd> +<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.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJTransformer.html#transform(org.libjpegturbo.turbojpeg.TJTransform[],%20int)">transform(TJTransform[], int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJTransformer.html" title="class in org.libjpegturbo.turbojpeg">TJTransformer</a></dt> +<dd> +<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> +</dd> +</dl> +<a name="_Y_"> +<!-- --> +</a> +<h2 class="title">Y</h2> +<dl> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/YUVImage.html#yuvHeight">yuvHeight</a></span> - Variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a></dt> +<dd> </dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#yuvImage">yuvImage</a></span> - Variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></dt> +<dd> </dd> +<dt><a href="./org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">YUVImage</span></a> - Class in <a href="./org/libjpegturbo/turbojpeg/package-summary.html">org.libjpegturbo.turbojpeg</a></dt> +<dd> +<div class="block">This class encapsulates a YUV planar image and the metadata + associated with it.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/YUVImage.html#YUVImage(int,%20int[],%20int,%20int)">YUVImage(int, int[], int, int)</a></span> - Constructor for class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a></dt> +<dd> +<div class="block">Create a new <code>YUVImage</code> instance backed by separate image + planes, and allocate memory for the image planes.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/YUVImage.html#YUVImage(int,%20int,%20int,%20int)">YUVImage(int, int, int, int)</a></span> - Constructor for class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a></dt> +<dd> +<div class="block">Create a new <code>YUVImage</code> instance backed by a unified image + buffer, and allocate memory for the image buffer.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/YUVImage.html#YUVImage(byte[][],%20int[],%20int,%20int[],%20int,%20int)">YUVImage(byte[][], int[], int, int[], int, int)</a></span> - Constructor for class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a></dt> +<dd> +<div class="block">Create a new <code>YUVImage</code> instance from a set of existing image + planes.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/YUVImage.html#YUVImage(byte[],%20int,%20int,%20int,%20int)">YUVImage(byte[], int, int, int, int)</a></span> - Constructor for class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a></dt> +<dd> +<div class="block">Create a new <code>YUVImage</code> instance from an existing unified image + buffer.</div> +</dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/YUVImage.html#yuvOffsets">yuvOffsets</a></span> - Variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a></dt> +<dd> </dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/YUVImage.html#yuvPad">yuvPad</a></span> - Variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a></dt> +<dd> </dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/YUVImage.html#yuvPlanes">yuvPlanes</a></span> - Variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a></dt> +<dd> </dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/YUVImage.html#yuvStrides">yuvStrides</a></span> - Variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a></dt> +<dd> </dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/YUVImage.html#yuvSubsamp">yuvSubsamp</a></span> - Variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a></dt> +<dd> </dd> +<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/YUVImage.html#yuvWidth">yuvWidth</a></span> - Variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a></dt> +<dd> </dd> +</dl> +<a href="#_B_">B</a> <a href="#_C_">C</a> <a href="#_D_">D</a> <a href="#_E_">E</a> <a href="#_F_">F</a> <a href="#_G_">G</a> <a href="#_H_">H</a> <a href="#_I_">I</a> <a href="#_J_">J</a> <a href="#_N_">N</a> <a href="#_O_">O</a> <a href="#_P_">P</a> <a href="#_S_">S</a> <a href="#_T_">T</a> <a href="#_Y_">Y</a> </div> +<!-- ======= 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</li> +<li><a href="./org/libjpegturbo/turbojpeg/package-tree.html">Tree</a></li> +<li><a href="./deprecated-list.html">Deprecated</a></li> +<li class="navBarCell1Rev">Index</li> +<li><a href="./help-doc.html">Help</a></li> +</ul> +</div> +<div class="subNav"> +<ul class="navList"> +<li>Prev</li> +<li>Next</li> +</ul> +<ul class="navList"> +<li><a href="./index.html?index-all.html" target="_top">Frames</a></li> +<li><a href="index-all.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> +<a name="skip-navbar_bottom"> +<!-- --> +</a></div> +<!-- ======== END OF BOTTOM NAVBAR ======= --> +</body> +</html>
diff --git a/src/third_party/libjpeg-turbo/java/doc/index.html b/src/third_party/libjpeg-turbo/java/doc/index.html new file mode 100644 index 0000000..4e21075 --- /dev/null +++ b/src/third_party/libjpeg-turbo/java/doc/index.html
@@ -0,0 +1,71 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd"> +<!-- NewPage --> +<html lang="en"> +<head> +<title>Generated Documentation (Untitled)</title> +<script type="text/javascript"> + tmpTargetPage = "" + window.location.search; + if (tmpTargetPage != "" && tmpTargetPage != "undefined") + tmpTargetPage = tmpTargetPage.substring(1); + if (tmpTargetPage.indexOf(":") != -1 || (tmpTargetPage != "" && !validURL(tmpTargetPage))) + tmpTargetPage = "undefined"; + targetPage = tmpTargetPage; + function validURL(url) { + try { + url = decodeURIComponent(url); + } + catch (error) { + return false; + } + var pos = url.indexOf(".html"); + if (pos == -1 || pos != url.length - 5) + return false; + var allowNumber = false; + var allowSep = false; + var seenDot = false; + for (var i = 0; i < url.length - 5; i++) { + var ch = url.charAt(i); + if ('a' <= ch && ch <= 'z' || + 'A' <= ch && ch <= 'Z' || + ch == '$' || + ch == '_' || + ch.charCodeAt(0) > 127) { + allowNumber = true; + allowSep = true; + } else if ('0' <= ch && ch <= '9' + || ch == '-') { + if (!allowNumber) + return false; + } else if (ch == '/' || ch == '.') { + if (!allowSep) + return false; + allowNumber = false; + allowSep = false; + if (ch == '.') + seenDot = true; + if (ch == '/' && seenDot) + return false; + } else { + return false; + } + } + return true; + } + function loadFrames() { + if (targetPage != "" && targetPage != "undefined") + top.classFrame.location = top.targetPage; + } +</script> +</head> +<frameset cols="20%,80%" title="Documentation frame" onload="top.loadFrames()"> +<frame src="allclasses-frame.html" name="packageFrame" title="All classes and interfaces (except non-static nested types)"> +<frame src="org/libjpegturbo/turbojpeg/package-summary.html" name="classFrame" title="Package, class and interface descriptions" scrolling="yes"> +<noframes> +<noscript> +<div>JavaScript is disabled on your browser.</div> +</noscript> +<h2>Frame Alert</h2> +<p>This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. Link to <a href="org/libjpegturbo/turbojpeg/package-summary.html">Non-frame version</a>.</p> +</noframes> +</frameset> +</html>
diff --git a/src/third_party/libjpeg-turbo/java/doc/org/libjpegturbo/turbojpeg/TJ.html b/src/third_party/libjpeg-turbo/java/doc/org/libjpegturbo/turbojpeg/TJ.html new file mode 100644 index 0000000..79f9fcf --- /dev/null +++ b/src/third_party/libjpeg-turbo/java/doc/org/libjpegturbo/turbojpeg/TJ.html
@@ -0,0 +1,1356 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!-- NewPage --> +<html lang="en"> +<head> +<title>TJ</title> +<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style"> +</head> +<body> +<script type="text/javascript"><!-- + try { + if (location.href.indexOf('is-external=true') == -1) { + parent.document.title="TJ"; + } + } + catch(err) { + } +//--> +</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>Prev Class</li> +<li><a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.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/TJ.html" target="_top">Frames</a></li> +<li><a href="TJ.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><a href="#field_summary">Field</a> | </li> +<li>Constr | </li> +<li><a href="#method_summary">Method</a></li> +</ul> +<ul class="subNavList"> +<li>Detail: </li> +<li><a href="#field_detail">Field</a> | </li> +<li>Constr | </li> +<li><a href="#method_detail">Method</a></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 TJ" class="title">Class TJ</h2> +</div> +<div class="contentContainer"> +<ul class="inheritance"> +<li>java.lang.Object</li> +<li> +<ul class="inheritance"> +<li>org.libjpegturbo.turbojpeg.TJ</li> +</ul> +</li> +</ul> +<div class="description"> +<ul class="blockList"> +<li class="blockList"> +<hr> +<br> +<pre>public final class <span class="strong">TJ</span> +extends java.lang.Object</pre> +<div class="block">TurboJPEG utility class (cannot be instantiated)</div> +</li> +</ul> +</div> +<div class="summary"> +<ul class="blockList"> +<li class="blockList"> +<!-- =========== FIELD SUMMARY =========== --> +<ul class="blockList"> +<li class="blockList"><a name="field_summary"> +<!-- --> +</a> +<h3>Field Summary</h3> +<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation"> +<caption><span>Fields</span><span class="tabEnd"> </span></caption> +<tr> +<th class="colFirst" scope="col">Modifier and Type</th> +<th class="colLast" scope="col">Field and Description</th> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>static int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJ.html#CS_CMYK">CS_CMYK</a></strong></code> +<div class="block">CMYK colorspace.</div> +</td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><code>static int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJ.html#CS_GRAY">CS_GRAY</a></strong></code> +<div class="block">Grayscale colorspace.</div> +</td> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>static int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJ.html#CS_RGB">CS_RGB</a></strong></code> +<div class="block">RGB colorspace.</div> +</td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><code>static int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJ.html#CS_YCbCr">CS_YCbCr</a></strong></code> +<div class="block">YCbCr colorspace.</div> +</td> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>static int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJ.html#CS_YCCK">CS_YCCK</a></strong></code> +<div class="block">YCCK colorspace.</div> +</td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><code>static int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJ.html#ERR_FATAL">ERR_FATAL</a></strong></code> +<div class="block">The error was fatal and non-recoverable.</div> +</td> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>static int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJ.html#ERR_WARNING">ERR_WARNING</a></strong></code> +<div class="block">The error was non-fatal and recoverable, but the image may still be + corrupt.</div> +</td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><code>static int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_ACCURATEDCT">FLAG_ACCURATEDCT</a></strong></code> +<div class="block">Use the most accurate DCT/IDCT algorithm available in the underlying + codec.</div> +</td> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>static int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_BOTTOMUP">FLAG_BOTTOMUP</a></strong></code> +<div class="block">The uncompressed source/destination image is stored in bottom-up (Windows, + OpenGL) order, not top-down (X11) order.</div> +</td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><code>static int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_FASTDCT">FLAG_FASTDCT</a></strong></code> +<div class="block">Use the fastest DCT/IDCT algorithm available in the underlying codec.</div> +</td> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>static int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_FASTUPSAMPLE">FLAG_FASTUPSAMPLE</a></strong></code> +<div class="block">When decompressing an image that was compressed using chrominance + subsampling, use the fastest chrominance upsampling algorithm available in + the underlying codec.</div> +</td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><code>static int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_FORCEMMX">FLAG_FORCEMMX</a></strong></code> +<div class="block"><strong>Deprecated.</strong> </div> +</td> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>static int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_FORCESSE">FLAG_FORCESSE</a></strong></code> +<div class="block"><strong>Deprecated.</strong> </div> +</td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><code>static int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_FORCESSE2">FLAG_FORCESSE2</a></strong></code> +<div class="block"><strong>Deprecated.</strong> </div> +</td> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>static int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_FORCESSE3">FLAG_FORCESSE3</a></strong></code> +<div class="block"><strong>Deprecated.</strong> </div> +</td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><code>static int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_PROGRESSIVE">FLAG_PROGRESSIVE</a></strong></code> +<div class="block">Use progressive entropy coding in JPEG images generated by compression and + transform operations.</div> +</td> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>static int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_STOPONWARNING">FLAG_STOPONWARNING</a></strong></code> +<div class="block">Immediately discontinue the current compression/decompression/transform + operation if the underlying codec throws a warning (non-fatal error).</div> +</td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><code>static int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJ.html#NUMCS">NUMCS</a></strong></code> +<div class="block">The number of JPEG colorspaces</div> +</td> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>static int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJ.html#NUMERR">NUMERR</a></strong></code> +<div class="block">The number of error codes</div> +</td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><code>static int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJ.html#NUMPF">NUMPF</a></strong></code> +<div class="block">The number of pixel formats</div> +</td> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>static int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJ.html#NUMSAMP">NUMSAMP</a></strong></code> +<div class="block">The number of chrominance subsampling options</div> +</td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><code>static int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJ.html#PF_ABGR">PF_ABGR</a></strong></code> +<div class="block">ABGR pixel format.</div> +</td> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>static int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJ.html#PF_ARGB">PF_ARGB</a></strong></code> +<div class="block">ARGB pixel format.</div> +</td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><code>static int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJ.html#PF_BGR">PF_BGR</a></strong></code> +<div class="block">BGR pixel format.</div> +</td> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>static int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJ.html#PF_BGRA">PF_BGRA</a></strong></code> +<div class="block">BGRA pixel format.</div> +</td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><code>static int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJ.html#PF_BGRX">PF_BGRX</a></strong></code> +<div class="block">BGRX pixel format.</div> +</td> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>static int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJ.html#PF_CMYK">PF_CMYK</a></strong></code> +<div class="block">CMYK pixel format.</div> +</td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><code>static int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJ.html#PF_GRAY">PF_GRAY</a></strong></code> +<div class="block">Grayscale pixel format.</div> +</td> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>static int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJ.html#PF_RGB">PF_RGB</a></strong></code> +<div class="block">RGB pixel format.</div> +</td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><code>static int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJ.html#PF_RGBA">PF_RGBA</a></strong></code> +<div class="block">RGBA pixel format.</div> +</td> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>static int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJ.html#PF_RGBX">PF_RGBX</a></strong></code> +<div class="block">RGBX pixel format.</div> +</td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><code>static int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJ.html#PF_XBGR">PF_XBGR</a></strong></code> +<div class="block">XBGR pixel format.</div> +</td> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>static int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJ.html#PF_XRGB">PF_XRGB</a></strong></code> +<div class="block">XRGB pixel format.</div> +</td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><code>static int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJ.html#SAMP_411">SAMP_411</a></strong></code> +<div class="block">4:1:1 chrominance subsampling.</div> +</td> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>static int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJ.html#SAMP_420">SAMP_420</a></strong></code> +<div class="block">4:2:0 chrominance subsampling.</div> +</td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><code>static int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJ.html#SAMP_422">SAMP_422</a></strong></code> +<div class="block">4:2:2 chrominance subsampling.</div> +</td> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>static int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJ.html#SAMP_440">SAMP_440</a></strong></code> +<div class="block">4:4:0 chrominance subsampling.</div> +</td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><code>static int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJ.html#SAMP_444">SAMP_444</a></strong></code> +<div class="block">4:4:4 chrominance subsampling (no chrominance subsampling).</div> +</td> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>static int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJ.html#SAMP_GRAY">SAMP_GRAY</a></strong></code> +<div class="block">Grayscale.</div> +</td> +</tr> +</table> +</li> +</ul> +<!-- ========== METHOD SUMMARY =========== --> +<ul class="blockList"> +<li class="blockList"><a name="method_summary"> +<!-- --> +</a> +<h3>Method Summary</h3> +<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> +<caption><span>Methods</span><span class="tabEnd"> </span></caption> +<tr> +<th class="colFirst" scope="col">Modifier and Type</th> +<th class="colLast" scope="col">Method and Description</th> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>static int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJ.html#bufSize(int,%20int,%20int)">bufSize</a></strong>(int width, + int height, + int jpegSubsamp)</code> +<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> +</td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><code>static int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJ.html#bufSizeYUV(int,%20int,%20int)">bufSizeYUV</a></strong>(int width, + int height, + int subsamp)</code> +<div class="block"><strong>Deprecated.</strong> +<div class="block"><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> +</div> +</td> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>static int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJ.html#bufSizeYUV(int,%20int,%20int,%20int)">bufSizeYUV</a></strong>(int width, + int pad, + int height, + int subsamp)</code> +<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> +</td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><code>static int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJ.html#getAlphaOffset(int)">getAlphaOffset</a></strong>(int pixelFormat)</code> +<div class="block">For the given pixel format, returns the number of bytes that the alpha + component is offset from the start of the pixel.</div> +</td> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>static int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJ.html#getBlueOffset(int)">getBlueOffset</a></strong>(int pixelFormat)</code> +<div class="block">For the given pixel format, returns the number of bytes that the blue + component is offset from the start of the pixel.</div> +</td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><code>static int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJ.html#getGreenOffset(int)">getGreenOffset</a></strong>(int pixelFormat)</code> +<div class="block">For the given pixel format, returns the number of bytes that the green + component is offset from the start of the pixel.</div> +</td> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>static int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJ.html#getMCUHeight(int)">getMCUHeight</a></strong>(int subsamp)</code> +<div class="block">Returns the MCU block height for the given level of chrominance + subsampling.</div> +</td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><code>static int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJ.html#getMCUWidth(int)">getMCUWidth</a></strong>(int subsamp)</code> +<div class="block">Returns the MCU block width for the given level of chrominance + subsampling.</div> +</td> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>static int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJ.html#getPixelSize(int)">getPixelSize</a></strong>(int pixelFormat)</code> +<div class="block">Returns the pixel size (in bytes) for the given pixel format.</div> +</td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><code>static int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJ.html#getRedOffset(int)">getRedOffset</a></strong>(int pixelFormat)</code> +<div class="block">For the given pixel format, returns the number of bytes that the red + component is offset from the start of the pixel.</div> +</td> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>static <a href="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg">TJScalingFactor</a>[]</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJ.html#getScalingFactors()">getScalingFactors</a></strong>()</code> +<div class="block">Returns a list of fractional scaling factors that the JPEG decompressor in + this implementation of TurboJPEG supports.</div> +</td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><code>static int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJ.html#planeHeight(int,%20int,%20int)">planeHeight</a></strong>(int componentID, + int height, + int subsamp)</code> +<div class="block">Returns the plane height of a YUV image plane with the given parameters.</div> +</td> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>static int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJ.html#planeSizeYUV(int,%20int,%20int,%20int,%20int)">planeSizeYUV</a></strong>(int componentID, + int width, + int stride, + int height, + int subsamp)</code> +<div class="block">Returns the size of the buffer (in bytes) required to hold a YUV image + plane with the given parameters.</div> +</td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><code>static int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJ.html#planeWidth(int,%20int,%20int)">planeWidth</a></strong>(int componentID, + int width, + int subsamp)</code> +<div class="block">Returns the plane width of a YUV image plane with the given parameters.</div> +</td> +</tr> +</table> +<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, toString, wait, wait, wait</code></li> +</ul> +</li> +</ul> +</li> +</ul> +</div> +<div class="details"> +<ul class="blockList"> +<li class="blockList"> +<!-- ============ FIELD DETAIL =========== --> +<ul class="blockList"> +<li class="blockList"><a name="field_detail"> +<!-- --> +</a> +<h3>Field Detail</h3> +<a name="NUMSAMP"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>NUMSAMP</h4> +<pre>public static final int NUMSAMP</pre> +<div class="block">The number of chrominance subsampling options</div> +<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.NUMSAMP">Constant Field Values</a></dd></dl> +</li> +</ul> +<a name="SAMP_444"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>SAMP_444</h4> +<pre>public static final int SAMP_444</pre> +<div class="block">4:4:4 chrominance subsampling (no chrominance subsampling). The JPEG + or YUV image will contain one chrominance component for every pixel in the + source image.</div> +<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.SAMP_444">Constant Field Values</a></dd></dl> +</li> +</ul> +<a name="SAMP_422"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>SAMP_422</h4> +<pre>public static final int SAMP_422</pre> +<div class="block">4:2:2 chrominance subsampling. The JPEG or YUV image will contain one + chrominance component for every 2x1 block of pixels in the source image.</div> +<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.SAMP_422">Constant Field Values</a></dd></dl> +</li> +</ul> +<a name="SAMP_420"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>SAMP_420</h4> +<pre>public static final int SAMP_420</pre> +<div class="block">4:2:0 chrominance subsampling. The JPEG or YUV image will contain one + chrominance component for every 2x2 block of pixels in the source image.</div> +<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.SAMP_420">Constant Field Values</a></dd></dl> +</li> +</ul> +<a name="SAMP_GRAY"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>SAMP_GRAY</h4> +<pre>public static final int SAMP_GRAY</pre> +<div class="block">Grayscale. The JPEG or YUV image will contain no chrominance components.</div> +<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.SAMP_GRAY">Constant Field Values</a></dd></dl> +</li> +</ul> +<a name="SAMP_440"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>SAMP_440</h4> +<pre>public static final int SAMP_440</pre> +<div class="block">4:4:0 chrominance subsampling. The JPEG or YUV image will contain one + chrominance component for every 1x2 block of pixels in the source image. + Note that 4:4:0 subsampling is not fully accelerated in libjpeg-turbo.</div> +<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.SAMP_440">Constant Field Values</a></dd></dl> +</li> +</ul> +<a name="SAMP_411"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>SAMP_411</h4> +<pre>public static final int SAMP_411</pre> +<div class="block">4:1:1 chrominance subsampling. The JPEG or YUV image will contain one + chrominance component for every 4x1 block of pixels in the source image. + JPEG images compressed with 4:1:1 subsampling will be almost exactly the + same size as those compressed with 4:2:0 subsampling, and in the + aggregate, both subsampling methods produce approximately the same + perceptual quality. However, 4:1:1 is better able to reproduce sharp + horizontal features. Note that 4:1:1 subsampling is not fully accelerated + in libjpeg-turbo.</div> +<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.SAMP_411">Constant Field Values</a></dd></dl> +</li> +</ul> +<a name="NUMPF"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>NUMPF</h4> +<pre>public static final int NUMPF</pre> +<div class="block">The number of pixel formats</div> +<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.NUMPF">Constant Field Values</a></dd></dl> +</li> +</ul> +<a name="PF_RGB"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>PF_RGB</h4> +<pre>public static final int PF_RGB</pre> +<div class="block">RGB pixel format. The red, green, and blue components in the image are + stored in 3-byte pixels in the order R, G, B from lowest to highest byte + address within each pixel.</div> +<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.PF_RGB">Constant Field Values</a></dd></dl> +</li> +</ul> +<a name="PF_BGR"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>PF_BGR</h4> +<pre>public static final int PF_BGR</pre> +<div class="block">BGR pixel format. The red, green, and blue components in the image are + stored in 3-byte pixels in the order B, G, R from lowest to highest byte + address within each pixel.</div> +<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.PF_BGR">Constant Field Values</a></dd></dl> +</li> +</ul> +<a name="PF_RGBX"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>PF_RGBX</h4> +<pre>public static final int PF_RGBX</pre> +<div class="block">RGBX pixel format. The red, green, and blue components in the image are + stored in 4-byte pixels in the order R, G, B from lowest to highest byte + address within each pixel. The X component is ignored when compressing + and undefined when decompressing.</div> +<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.PF_RGBX">Constant Field Values</a></dd></dl> +</li> +</ul> +<a name="PF_BGRX"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>PF_BGRX</h4> +<pre>public static final int PF_BGRX</pre> +<div class="block">BGRX pixel format. The red, green, and blue components in the image are + stored in 4-byte pixels in the order B, G, R from lowest to highest byte + address within each pixel. The X component is ignored when compressing + and undefined when decompressing.</div> +<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.PF_BGRX">Constant Field Values</a></dd></dl> +</li> +</ul> +<a name="PF_XBGR"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>PF_XBGR</h4> +<pre>public static final int PF_XBGR</pre> +<div class="block">XBGR pixel format. The red, green, and blue components in the image are + stored in 4-byte pixels in the order R, G, B from highest to lowest byte + address within each pixel. The X component is ignored when compressing + and undefined when decompressing.</div> +<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.PF_XBGR">Constant Field Values</a></dd></dl> +</li> +</ul> +<a name="PF_XRGB"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>PF_XRGB</h4> +<pre>public static final int PF_XRGB</pre> +<div class="block">XRGB pixel format. The red, green, and blue components in the image are + stored in 4-byte pixels in the order B, G, R from highest to lowest byte + address within each pixel. The X component is ignored when compressing + and undefined when decompressing.</div> +<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.PF_XRGB">Constant Field Values</a></dd></dl> +</li> +</ul> +<a name="PF_GRAY"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>PF_GRAY</h4> +<pre>public static final int PF_GRAY</pre> +<div class="block">Grayscale pixel format. Each 1-byte pixel represents a luminance + (brightness) level from 0 to 255.</div> +<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.PF_GRAY">Constant Field Values</a></dd></dl> +</li> +</ul> +<a name="PF_RGBA"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>PF_RGBA</h4> +<pre>public static final int PF_RGBA</pre> +<div class="block">RGBA pixel format. This is the same as <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#PF_RGBX"><code>PF_RGBX</code></a>, except that when + decompressing, the X byte is guaranteed to be 0xFF, which can be + interpreted as an opaque alpha channel.</div> +<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.PF_RGBA">Constant Field Values</a></dd></dl> +</li> +</ul> +<a name="PF_BGRA"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>PF_BGRA</h4> +<pre>public static final int PF_BGRA</pre> +<div class="block">BGRA pixel format. This is the same as <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#PF_BGRX"><code>PF_BGRX</code></a>, except that when + decompressing, the X byte is guaranteed to be 0xFF, which can be + interpreted as an opaque alpha channel.</div> +<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.PF_BGRA">Constant Field Values</a></dd></dl> +</li> +</ul> +<a name="PF_ABGR"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>PF_ABGR</h4> +<pre>public static final int PF_ABGR</pre> +<div class="block">ABGR pixel format. This is the same as <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#PF_XBGR"><code>PF_XBGR</code></a>, except that when + decompressing, the X byte is guaranteed to be 0xFF, which can be + interpreted as an opaque alpha channel.</div> +<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.PF_ABGR">Constant Field Values</a></dd></dl> +</li> +</ul> +<a name="PF_ARGB"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>PF_ARGB</h4> +<pre>public static final int PF_ARGB</pre> +<div class="block">ARGB pixel format. This is the same as <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#PF_XRGB"><code>PF_XRGB</code></a>, except that when + decompressing, the X byte is guaranteed to be 0xFF, which can be + interpreted as an opaque alpha channel.</div> +<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.PF_ARGB">Constant Field Values</a></dd></dl> +</li> +</ul> +<a name="PF_CMYK"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>PF_CMYK</h4> +<pre>public static final int PF_CMYK</pre> +<div class="block">CMYK pixel format. Unlike RGB, which is an additive color model used + primarily for display, CMYK (Cyan/Magenta/Yellow/Key) is a subtractive + color model used primarily for printing. In the CMYK color model, the + value of each color component typically corresponds to an amount of cyan, + magenta, yellow, or black ink that is applied to a white background. In + order to convert between CMYK and RGB, it is necessary to use a color + management system (CMS.) A CMS will attempt to map colors within the + printer's gamut to perceptually similar colors in the display's gamut and + vice versa, but the mapping is typically not 1:1 or reversible, nor can it + be defined with a simple formula. Thus, such a conversion is out of scope + for a codec library. However, the TurboJPEG API allows for compressing + CMYK pixels into a YCCK JPEG image (see <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#CS_YCCK"><code>CS_YCCK</code></a>) and + decompressing YCCK JPEG images into CMYK pixels.</div> +<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.PF_CMYK">Constant Field Values</a></dd></dl> +</li> +</ul> +<a name="NUMCS"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>NUMCS</h4> +<pre>public static final int NUMCS</pre> +<div class="block">The number of JPEG colorspaces</div> +<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.NUMCS">Constant Field Values</a></dd></dl> +</li> +</ul> +<a name="CS_RGB"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>CS_RGB</h4> +<pre>public static final int CS_RGB</pre> +<div class="block">RGB colorspace. When compressing the JPEG image, the R, G, and B + components in the source image are reordered into image planes, but no + colorspace conversion or subsampling is performed. RGB JPEG images can be + decompressed to any of the extended RGB pixel formats or grayscale, but + they cannot be decompressed to YUV images.</div> +<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.CS_RGB">Constant Field Values</a></dd></dl> +</li> +</ul> +<a name="CS_YCbCr"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>CS_YCbCr</h4> +<pre>public static final int CS_YCbCr</pre> +<div class="block">YCbCr colorspace. YCbCr is not an absolute colorspace but rather a + mathematical transformation of RGB designed solely for storage and + transmission. YCbCr images must be converted to RGB before they can + actually be displayed. In the YCbCr colorspace, the Y (luminance) + component represents the black & white portion of the original image, and + the Cb and Cr (chrominance) components represent the color portion of the + original image. Originally, the analog equivalent of this transformation + allowed the same signal to drive both black & white and color televisions, + but JPEG images use YCbCr primarily because it allows the color data to be + optionally subsampled for the purposes of reducing bandwidth or disk + space. YCbCr is the most common JPEG colorspace, and YCbCr JPEG images + can be compressed from and decompressed to any of the extended RGB pixel + formats or grayscale, or they can be decompressed to YUV planar images.</div> +<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.CS_YCbCr">Constant Field Values</a></dd></dl> +</li> +</ul> +<a name="CS_GRAY"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>CS_GRAY</h4> +<pre>public static final int CS_GRAY</pre> +<div class="block">Grayscale colorspace. The JPEG image retains only the luminance data (Y + component), and any color data from the source image is discarded. + Grayscale JPEG images can be compressed from and decompressed to any of + the extended RGB pixel formats or grayscale, or they can be decompressed + to YUV planar images.</div> +<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.CS_GRAY">Constant Field Values</a></dd></dl> +</li> +</ul> +<a name="CS_CMYK"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>CS_CMYK</h4> +<pre>public static final int CS_CMYK</pre> +<div class="block">CMYK colorspace. When compressing the JPEG image, the C, M, Y, and K + components in the source image are reordered into image planes, but no + colorspace conversion or subsampling is performed. CMYK JPEG images can + only be decompressed to CMYK pixels.</div> +<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.CS_CMYK">Constant Field Values</a></dd></dl> +</li> +</ul> +<a name="CS_YCCK"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>CS_YCCK</h4> +<pre>public static final int CS_YCCK</pre> +<div class="block">YCCK colorspace. YCCK (AKA "YCbCrK") is not an absolute colorspace but + rather a mathematical transformation of CMYK designed solely for storage + and transmission. It is to CMYK as YCbCr is to RGB. CMYK pixels can be + reversibly transformed into YCCK, and as with YCbCr, the chrominance + components in the YCCK pixels can be subsampled without incurring major + perceptual loss. YCCK JPEG images can only be compressed from and + decompressed to CMYK pixels.</div> +<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.CS_YCCK">Constant Field Values</a></dd></dl> +</li> +</ul> +<a name="FLAG_BOTTOMUP"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>FLAG_BOTTOMUP</h4> +<pre>public static final int FLAG_BOTTOMUP</pre> +<div class="block">The uncompressed source/destination image is stored in bottom-up (Windows, + OpenGL) order, not top-down (X11) order.</div> +<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.FLAG_BOTTOMUP">Constant Field Values</a></dd></dl> +</li> +</ul> +<a name="FLAG_FORCEMMX"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>FLAG_FORCEMMX</h4> +<pre>@Deprecated +public static final int FLAG_FORCEMMX</pre> +<div class="block"><span class="strong">Deprecated.</span> </div> +<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.FLAG_FORCEMMX">Constant Field Values</a></dd></dl> +</li> +</ul> +<a name="FLAG_FORCESSE"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>FLAG_FORCESSE</h4> +<pre>@Deprecated +public static final int FLAG_FORCESSE</pre> +<div class="block"><span class="strong">Deprecated.</span> </div> +<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.FLAG_FORCESSE">Constant Field Values</a></dd></dl> +</li> +</ul> +<a name="FLAG_FORCESSE2"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>FLAG_FORCESSE2</h4> +<pre>@Deprecated +public static final int FLAG_FORCESSE2</pre> +<div class="block"><span class="strong">Deprecated.</span> </div> +<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.FLAG_FORCESSE2">Constant Field Values</a></dd></dl> +</li> +</ul> +<a name="FLAG_FORCESSE3"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>FLAG_FORCESSE3</h4> +<pre>@Deprecated +public static final int FLAG_FORCESSE3</pre> +<div class="block"><span class="strong">Deprecated.</span> </div> +<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.FLAG_FORCESSE3">Constant Field Values</a></dd></dl> +</li> +</ul> +<a name="FLAG_FASTUPSAMPLE"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>FLAG_FASTUPSAMPLE</h4> +<pre>public static final int FLAG_FASTUPSAMPLE</pre> +<div class="block">When decompressing an image that was compressed using chrominance + subsampling, use the fastest chrominance upsampling algorithm available in + the underlying codec. The default is to use smooth upsampling, which + creates a smooth transition between neighboring chrominance components in + order to reduce upsampling artifacts in the decompressed image.</div> +<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.FLAG_FASTUPSAMPLE">Constant Field Values</a></dd></dl> +</li> +</ul> +<a name="FLAG_FASTDCT"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>FLAG_FASTDCT</h4> +<pre>public static final int FLAG_FASTDCT</pre> +<div class="block">Use the fastest DCT/IDCT algorithm available in the underlying codec. The + default if this flag is not specified is implementation-specific. For + example, the implementation of TurboJPEG for libjpeg[-turbo] uses the fast + algorithm by default when compressing, because this has been shown to have + only a very slight effect on accuracy, but it uses the accurate algorithm + when decompressing, because this has been shown to have a larger effect.</div> +<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.FLAG_FASTDCT">Constant Field Values</a></dd></dl> +</li> +</ul> +<a name="FLAG_ACCURATEDCT"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>FLAG_ACCURATEDCT</h4> +<pre>public static final int FLAG_ACCURATEDCT</pre> +<div class="block">Use the most accurate DCT/IDCT algorithm available in the underlying + codec. The default if this flag is not specified is + implementation-specific. For example, the implementation of TurboJPEG for + libjpeg[-turbo] uses the fast algorithm by default when compressing, + because this has been shown to have only a very slight effect on accuracy, + but it uses the accurate algorithm when decompressing, because this has + been shown to have a larger effect.</div> +<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.FLAG_ACCURATEDCT">Constant Field Values</a></dd></dl> +</li> +</ul> +<a name="FLAG_STOPONWARNING"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>FLAG_STOPONWARNING</h4> +<pre>public static final int FLAG_STOPONWARNING</pre> +<div class="block">Immediately discontinue the current compression/decompression/transform + operation if the underlying codec throws a warning (non-fatal error). The + default behavior is to allow the operation to complete unless a fatal + error is encountered. + <p> + NOTE: due to the design of the TurboJPEG Java API, only certain methods + (specifically, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg"><code>TJDecompressor.decompress*()</code></a> methods + with a void return type) will complete and leave the output image in a + fully recoverable state after a non-fatal error occurs.</div> +<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.FLAG_STOPONWARNING">Constant Field Values</a></dd></dl> +</li> +</ul> +<a name="FLAG_PROGRESSIVE"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>FLAG_PROGRESSIVE</h4> +<pre>public static final int FLAG_PROGRESSIVE</pre> +<div class="block">Use progressive entropy coding in JPEG images generated by compression and + transform operations. Progressive entropy coding will generally improve + compression relative to baseline entropy coding (the default), but it will + reduce compression and decompression performance considerably.</div> +<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.FLAG_PROGRESSIVE">Constant Field Values</a></dd></dl> +</li> +</ul> +<a name="NUMERR"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>NUMERR</h4> +<pre>public static final int NUMERR</pre> +<div class="block">The number of error codes</div> +<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.NUMERR">Constant Field Values</a></dd></dl> +</li> +</ul> +<a name="ERR_WARNING"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>ERR_WARNING</h4> +<pre>public static final int ERR_WARNING</pre> +<div class="block">The error was non-fatal and recoverable, but the image may still be + corrupt. + <p> + NOTE: due to the design of the TurboJPEG Java API, only certain methods + (specifically, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg"><code>TJDecompressor.decompress*()</code></a> methods + with a void return type) will complete and leave the output image in a + fully recoverable state after a non-fatal error occurs.</div> +<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.ERR_WARNING">Constant Field Values</a></dd></dl> +</li> +</ul> +<a name="ERR_FATAL"> +<!-- --> +</a> +<ul class="blockListLast"> +<li class="blockList"> +<h4>ERR_FATAL</h4> +<pre>public static final int ERR_FATAL</pre> +<div class="block">The error was fatal and non-recoverable.</div> +<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.ERR_FATAL">Constant Field Values</a></dd></dl> +</li> +</ul> +</li> +</ul> +<!-- ============ METHOD DETAIL ========== --> +<ul class="blockList"> +<li class="blockList"><a name="method_detail"> +<!-- --> +</a> +<h3>Method Detail</h3> +<a name="getMCUWidth(int)"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>getMCUWidth</h4> +<pre>public static int getMCUWidth(int subsamp)</pre> +<div class="block">Returns the MCU block width for the given level of chrominance + subsampling.</div> +<dl><dt><span class="strong">Parameters:</span></dt><dd><code>subsamp</code> - the level of chrominance subsampling (one of + <code>SAMP_*</code>)</dd> +<dt><span class="strong">Returns:</span></dt><dd>the MCU block width for the given level of chrominance + subsampling.</dd></dl> +</li> +</ul> +<a name="getMCUHeight(int)"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>getMCUHeight</h4> +<pre>public static int getMCUHeight(int subsamp)</pre> +<div class="block">Returns the MCU block height for the given level of chrominance + subsampling.</div> +<dl><dt><span class="strong">Parameters:</span></dt><dd><code>subsamp</code> - the level of chrominance subsampling (one of + <code>SAMP_*</code>)</dd> +<dt><span class="strong">Returns:</span></dt><dd>the MCU block height for the given level of chrominance + subsampling.</dd></dl> +</li> +</ul> +<a name="getPixelSize(int)"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>getPixelSize</h4> +<pre>public static int getPixelSize(int pixelFormat)</pre> +<div class="block">Returns the pixel size (in bytes) for the given pixel format.</div> +<dl><dt><span class="strong">Parameters:</span></dt><dd><code>pixelFormat</code> - the pixel format (one of <code>PF_*</code>)</dd> +<dt><span class="strong">Returns:</span></dt><dd>the pixel size (in bytes) for the given pixel format.</dd></dl> +</li> +</ul> +<a name="getRedOffset(int)"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>getRedOffset</h4> +<pre>public static int getRedOffset(int pixelFormat)</pre> +<div class="block">For the given pixel format, returns the number of bytes that the red + component is offset from the start of the pixel. For instance, if a pixel + of format <code>TJ.PF_BGRX</code> is stored in <code>char pixel[]</code>, + then the red component will be + <code>pixel[TJ.getRedOffset(TJ.PF_BGRX)]</code>.</div> +<dl><dt><span class="strong">Parameters:</span></dt><dd><code>pixelFormat</code> - the pixel format (one of <code>PF_*</code>)</dd> +<dt><span class="strong">Returns:</span></dt><dd>the red offset for the given pixel format, or -1 if the pixel + format does not have a red component.</dd></dl> +</li> +</ul> +<a name="getGreenOffset(int)"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>getGreenOffset</h4> +<pre>public static int getGreenOffset(int pixelFormat)</pre> +<div class="block">For the given pixel format, returns the number of bytes that the green + component is offset from the start of the pixel. For instance, if a pixel + of format <code>TJ.PF_BGRX</code> is stored in <code>char pixel[]</code>, + then the green component will be + <code>pixel[TJ.getGreenOffset(TJ.PF_BGRX)]</code>.</div> +<dl><dt><span class="strong">Parameters:</span></dt><dd><code>pixelFormat</code> - the pixel format (one of <code>PF_*</code>)</dd> +<dt><span class="strong">Returns:</span></dt><dd>the green offset for the given pixel format, or -1 if the pixel + format does not have a green component.</dd></dl> +</li> +</ul> +<a name="getBlueOffset(int)"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>getBlueOffset</h4> +<pre>public static int getBlueOffset(int pixelFormat)</pre> +<div class="block">For the given pixel format, returns the number of bytes that the blue + component is offset from the start of the pixel. For instance, if a pixel + of format <code>TJ.PF_BGRX</code> is stored in <code>char pixel[]</code>, + then the blue component will be + <code>pixel[TJ.getBlueOffset(TJ.PF_BGRX)]</code>.</div> +<dl><dt><span class="strong">Parameters:</span></dt><dd><code>pixelFormat</code> - the pixel format (one of <code>PF_*</code>)</dd> +<dt><span class="strong">Returns:</span></dt><dd>the blue offset for the given pixel format, or -1 if the pixel + format does not have a blue component.</dd></dl> +</li> +</ul> +<a name="getAlphaOffset(int)"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>getAlphaOffset</h4> +<pre>public static int getAlphaOffset(int pixelFormat)</pre> +<div class="block">For the given pixel format, returns the number of bytes that the alpha + component is offset from the start of the pixel. For instance, if a pixel + of format <code>TJ.PF_BGRA</code> is stored in <code>char pixel[]</code>, + then the alpha component will be + <code>pixel[TJ.getAlphaOffset(TJ.PF_BGRA)]</code>.</div> +<dl><dt><span class="strong">Parameters:</span></dt><dd><code>pixelFormat</code> - the pixel format (one of <code>PF_*</code>)</dd> +<dt><span class="strong">Returns:</span></dt><dd>the alpha offset for the given pixel format, or -1 if the pixel + format does not have a alpha component.</dd></dl> +</li> +</ul> +<a name="bufSize(int, int, int)"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>bufSize</h4> +<pre>public static int bufSize(int width, + int height, + 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></dl> +</li> +</ul> +<a name="bufSizeYUV(int, int, int, int)"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>bufSizeYUV</h4> +<pre>public static int bufSizeYUV(int width, + int pad, + int height, + 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></dl> +</li> +</ul> +<a name="bufSizeYUV(int, int, int)"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>bufSizeYUV</h4> +<pre>@Deprecated +public static int bufSizeYUV(int width, + int height, + 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> +</li> +</ul> +<a name="planeSizeYUV(int, int, int, int, int)"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>planeSizeYUV</h4> +<pre>public static int planeSizeYUV(int componentID, + int width, + int stride, + int height, + 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, + 2 = V/Cr)</dd><dd><code>width</code> - width (in pixels) of the YUV image. NOTE: this is the width + of the whole image, not the plane width.</dd><dd><code>stride</code> - bytes per line in the image plane.</dd><dd><code>height</code> - height (in pixels) of the YUV image. NOTE: this is the + 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></dl> +</li> +</ul> +<a name="planeWidth(int, int, int)"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>planeWidth</h4> +<pre>public static int planeWidth(int componentID, + int width, + 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></dl> +</li> +</ul> +<a name="planeHeight(int, int, int)"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>planeHeight</h4> +<pre>public static int planeHeight(int componentID, + int height, + 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></dl> +</li> +</ul> +<a name="getScalingFactors()"> +<!-- --> +</a> +<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()</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></dl> +</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>Prev Class</li> +<li><a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.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/TJ.html" target="_top">Frames</a></li> +<li><a href="TJ.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><a href="#field_summary">Field</a> | </li> +<li>Constr | </li> +<li><a href="#method_summary">Method</a></li> +</ul> +<ul class="subNavList"> +<li>Detail: </li> +<li><a href="#field_detail">Field</a> | </li> +<li>Constr | </li> +<li><a href="#method_detail">Method</a></li> +</ul> +</div> +<a name="skip-navbar_bottom"> +<!-- --> +</a></div> +<!-- ======== END OF BOTTOM NAVBAR ======= --> +</body> +</html>
diff --git a/src/third_party/libjpeg-turbo/java/doc/org/libjpegturbo/turbojpeg/TJCompressor.html b/src/third_party/libjpeg-turbo/java/doc/org/libjpegturbo/turbojpeg/TJCompressor.html new file mode 100644 index 0000000..a53f879 --- /dev/null +++ b/src/third_party/libjpeg-turbo/java/doc/org/libjpegturbo/turbojpeg/TJCompressor.html
@@ -0,0 +1,926 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!-- NewPage --> +<html lang="en"> +<head> +<title>TJCompressor</title> +<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style"> +</head> +<body> +<script type="text/javascript"><!-- + try { + if (location.href.indexOf('is-external=true') == -1) { + parent.document.title="TJCompressor"; + } + } + catch(err) { + } +//--> +</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/TJ.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">Prev Class</span></a></li> +<li><a href="../../../org/libjpegturbo/turbojpeg/TJCustomFilter.html" title="interface in org.libjpegturbo.turbojpeg"><span class="strong">Next Class</span></a></li> +</ul> +<ul class="navList"> +<li><a href="../../../index.html?org/libjpegturbo/turbojpeg/TJCompressor.html" target="_top">Frames</a></li> +<li><a href="TJCompressor.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="#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 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 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>java.io.Closeable, java.lang.AutoCloseable</dd> +</dl> +<hr> +<br> +<pre>public class <span class="strong">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 ======== --> +<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/TJCompressor.html#TJCompressor()">TJCompressor</a></strong>()</code> +<div class="block">Create a TurboJPEG compressor instance.</div> +</td> +</tr> +<tr class="rowColor"> +<td class="colOne"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#TJCompressor(java.awt.image.BufferedImage,%20int,%20int,%20int,%20int)">TJCompressor</a></strong>(java.awt.image.BufferedImage srcImage, + int x, + int y, + int width, + int height)</code> +<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> +</td> +</tr> +<tr class="altColor"> +<td class="colOne"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#TJCompressor(byte[],%20int,%20int,%20int,%20int)">TJCompressor</a></strong>(byte[] srcImage, + int width, + int pitch, + int height, + int pixelFormat)</code> +<div class="block"><strong>Deprecated.</strong> +<div class="block"><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> +</div> +</td> +</tr> +<tr class="rowColor"> +<td class="colOne"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#TJCompressor(byte[],%20int,%20int,%20int,%20int,%20int,%20int)">TJCompressor</a></strong>(byte[] srcImage, + int x, + int y, + int width, + int pitch, + int height, + int pixelFormat)</code> +<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> +</td> +</tr> +</table> +</li> +</ul> +<!-- ========== METHOD SUMMARY =========== --> +<ul class="blockList"> +<li class="blockList"><a name="method_summary"> +<!-- --> +</a> +<h3>Method Summary</h3> +<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> +<caption><span>Methods</span><span class="tabEnd"> </span></caption> +<tr> +<th class="colFirst" scope="col">Modifier and Type</th> +<th class="colLast" scope="col">Method and Description</th> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>void</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#close()">close</a></strong>()</code> +<div class="block">Free the native structures associated with this compressor instance.</div> +</td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><code>void</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#compress(java.awt.image.BufferedImage,%20byte[],%20int)">compress</a></strong>(java.awt.image.BufferedImage srcImage, + byte[] dstBuf, + int flags)</code> +<div class="block"><strong>Deprecated.</strong> +<div class="block"><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> +</div> +</td> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>byte[]</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#compress(java.awt.image.BufferedImage,%20int)">compress</a></strong>(java.awt.image.BufferedImage srcImage, + int flags)</code> +<div class="block"><strong>Deprecated.</strong> +<div class="block"><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> +</div> +</td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><code>void</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#compress(byte[],%20int)">compress</a></strong>(byte[] dstBuf, + int flags)</code> +<div class="block">Compress the uncompressed source image associated with this compressor + instance and output a JPEG image to the given destination buffer.</div> +</td> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>byte[]</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#compress(int)">compress</a></strong>(int flags)</code> +<div class="block">Compress the uncompressed source image associated with this compressor + instance and return a buffer containing a JPEG image.</div> +</td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><code>void</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(java.awt.image.BufferedImage,%20byte[],%20int)">encodeYUV</a></strong>(java.awt.image.BufferedImage srcImage, + byte[] dstBuf, + int flags)</code> +<div class="block"><strong>Deprecated.</strong> +<div class="block"><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> +</div> +</td> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>byte[]</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(java.awt.image.BufferedImage,%20int)">encodeYUV</a></strong>(java.awt.image.BufferedImage srcImage, + int flags)</code> +<div class="block"><strong>Deprecated.</strong> +<div class="block"><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> +</div> +</td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><code>void</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(byte[],%20int)">encodeYUV</a></strong>(byte[] dstBuf, + int flags)</code> +<div class="block"><strong>Deprecated.</strong> +<div class="block"><i>Use <a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(org.libjpegturbo.turbojpeg.YUVImage,%20int)"><code>encodeYUV(YUVImage, int)</code></a> instead.</i></div> +</div> +</td> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>byte[]</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(int)">encodeYUV</a></strong>(int flags)</code> +<div class="block"><strong>Deprecated.</strong> +<div class="block"><i>Use <a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(int,%20int)"><code>encodeYUV(int, int)</code></a> instead.</i></div> +</div> +</td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><code><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a></code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(int[],%20int)">encodeYUV</a></strong>(int[] strides, + int flags)</code> +<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.</div> +</td> +</tr> +<tr class="altColor"> +<td class="colFirst"><code><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a></code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(int,%20int)">encodeYUV</a></strong>(int pad, + int flags)</code> +<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.</div> +</td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><code>void</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(org.libjpegturbo.turbojpeg.YUVImage,%20int)">encodeYUV</a></strong>(<a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a> dstImage, + int flags)</code> +<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.</div> +</td> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>protected void</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#finalize()">finalize</a></strong>()</code> </td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><code>int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#getCompressedSize()">getCompressedSize</a></strong>()</code> +<div class="block">Returns the size of the image (in bytes) generated by the most recent + compress operation.</div> +</td> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>void</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setJPEGQuality(int)">setJPEGQuality</a></strong>(int quality)</code> +<div class="block">Set the JPEG image quality level for subsequent compress operations.</div> +</td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><code>void</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage,%20int,%20int,%20int,%20int)">setSourceImage</a></strong>(java.awt.image.BufferedImage srcImage, + int x, + int y, + int width, + int height)</code> +<div class="block">Associate an uncompressed RGB or grayscale source image with this + compressor instance.</div> +</td> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>void</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[],%20int,%20int,%20int,%20int)">setSourceImage</a></strong>(byte[] srcImage, + int width, + int pitch, + int height, + int pixelFormat)</code> +<div class="block"><strong>Deprecated.</strong> +<div class="block"><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> +</div> +</td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><code>void</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[],%20int,%20int,%20int,%20int,%20int,%20int)">setSourceImage</a></strong>(byte[] srcImage, + int x, + int y, + int width, + int pitch, + int height, + int pixelFormat)</code> +<div class="block">Associate an uncompressed RGB, grayscale, or CMYK source image with this + compressor instance.</div> +</td> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>void</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(org.libjpegturbo.turbojpeg.YUVImage)">setSourceImage</a></strong>(<a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a> srcImage)</code> +<div class="block">Associate an uncompressed YUV planar source image with this compressor + instance.</div> +</td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><code>void</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSubsamp(int)">setSubsamp</a></strong>(int newSubsamp)</code> +<div class="block">Set the level of chrominance subsampling for subsequent compress/encode + operations.</div> +</td> +</tr> +</table> +<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, getClass, hashCode, notify, notifyAll, toString, 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="TJCompressor()"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>TJCompressor</h4> +<pre>public TJCompressor() + 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><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)"> +<!-- --> +</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="../../../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><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)"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>TJCompressor</h4> +<pre>@Deprecated +public TJCompressor(byte[] srcImage, + int width, + int pitch, + int height, + int pixelFormat) + 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><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)"> +<!-- --> +</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="../../../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(java.awt.image.BufferedImage,%20int,%20int,%20int,%20int)"><code>setSourceImage(BufferedImage, int, int, int, int)</code></a> for description</dd><dd><code>x</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><dd><code>y</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><dd><code>width</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><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><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl> +</li> +</ul> +</li> +</ul> +<!-- ============ METHOD DETAIL ========== --> +<ul class="blockList"> +<li class="blockList"><a name="method_detail"> +<!-- --> +</a> +<h3>Method Detail</h3> +<a name="setSourceImage(byte[], int, int, int, int, int, int)"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>setSourceImage</h4> +<pre>public void setSourceImage(byte[] srcImage, + int x, + int y, + int width, + int pitch, + int height, + int pixelFormat) + 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 + 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 line of the source image. Normally, this should be + <code>width * TJ.pixelSize(pixelFormat)</code> if the source image is + unpadded, but you can use this parameter to, for instance, specify that + the scanlines in the source image are padded to a 4-byte boundary or to + compress/encode a JPEG or YUV image from a region of a larger source + image. You can also be clever and use this parameter to skip lines, etc. + Setting this parameter to 0 is the equivalent of setting it to + <code>width * TJ.pixelSize(pixelFormat)</code>.</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="../../../org/libjpegturbo/turbojpeg/TJ.html#PF_RGB"><code>TJ.PF_*</code></a>)</dd> +<dt><span class="strong">Throws:</span></dt> +<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)"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>setSourceImage</h4> +<pre>@Deprecated +public void setSourceImage(byte[] srcImage, + int width, + int pitch, + int height, + int pixelFormat) + 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><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)"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>setSourceImage</h4> +<pre>public void setSourceImage(java.awt.image.BufferedImage srcImage, + int x, + int y, + int width, + int height) + 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 + grayscale pixels 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="strong">Throws:</span></dt> +<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)"> +<!-- --> +</a> +<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 <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><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl> +</li> +</ul> +<a name="setSubsamp(int)"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>setSubsamp</h4> +<pre>public void setSubsamp(int newSubsamp)</pre> +<div class="block">Set the level of chrominance subsampling for subsequent compress/encode + operations. When pixels are converted from RGB to YCbCr (see + <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#CS_YCbCr"><code>TJ.CS_YCbCr</code></a>) or from CMYK to YCCK (see <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#CS_YCCK"><code>TJ.CS_YCCK</code></a>) as part + of the JPEG compression process, some of the Cb and Cr (chrominance) + components can be discarded or averaged together to produce a smaller + image with little perceptible loss of image clarity (the human eye is more + sensitive to small changes in brightness than to small changes in color.) + This is called "chrominance subsampling". + <p> + NOTE: This method has no effect when compressing a JPEG image from a YUV + planar source. In that case, the level of chrominance subsampling in + the JPEG image is determined by the source. Furthermore, this method has + no effect when encoding to a pre-allocated <a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg"><code>YUVImage</code></a> instance. In + that case, the level of chrominance subsampling is determined by the + destination.</div> +<dl><dt><span class="strong">Parameters:</span></dt><dd><code>newSubsamp</code> - the level of chrominance subsampling to use in + subsequent compress/encode oeprations (one of + <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#SAMP_444"><code>TJ.SAMP_*</code></a>)</dd></dl> +</li> +</ul> +<a name="setJPEGQuality(int)"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>setJPEGQuality</h4> +<pre>public void setJPEGQuality(int quality)</pre> +<div class="block">Set the JPEG image quality level for subsequent compress operations.</div> +<dl><dt><span class="strong">Parameters:</span></dt><dd><code>quality</code> - the new JPEG image quality level (1 to 100, 1 = worst, + 100 = best)</dd></dl> +</li> +</ul> +<a name="compress(byte[], int)"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>compress</h4> +<pre>public void compress(byte[] dstBuf, + int flags) + 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 + <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#bufSize(int,%20int,%20int)"><code>TJ.bufSize(int, int, int)</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.</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><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl> +</li> +</ul> +<a name="compress(int)"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>compress</h4> +<pre>public byte[] compress(int flags) + 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 + <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 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><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)"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>compress</h4> +<pre>@Deprecated +public void compress(java.awt.image.BufferedImage srcImage, + byte[] dstBuf, + int flags) + 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><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)"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>compress</h4> +<pre>@Deprecated +public byte[] compress(java.awt.image.BufferedImage srcImage, + int flags) + 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><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)"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<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 <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 + conversion routines in TurboJPEG's underlying codec but does not execute + any of the other steps in the JPEG compression process. Encoding + CMYK source images to YUV is not supported.</div> +<dl><dt><span class="strong">Parameters:</span></dt><dd><code>dstImage</code> - <a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg"><code>YUVImage</code></a> instance that will receive the YUV planar + 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><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)"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>encodeYUV</h4> +<pre>@Deprecated +public void encodeYUV(byte[] dstBuf, + int flags) + 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><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)"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<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 <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 + uses the accelerated color conversion routines in TurboJPEG's underlying + codec but does not execute any of the other steps in the JPEG compression + process. Encoding CMYK source images to YUV is not supported.</div> +<dl><dt><span class="strong">Parameters:</span></dt><dd><code>pad</code> - the width of each line in each plane of the YUV image will be + padded to the nearest multiple of this number of bytes (must be a power of + 2.)</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">Returns:</span></dt><dd>a YUV planar image.</dd> +<dt><span class="strong">Throws:</span></dt> +<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)"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<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 <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 + method uses the accelerated color conversion routines in TurboJPEG's + underlying codec but does not execute any of the other steps in the JPEG + compression process. Encoding CMYK source images to YUV is not supported.</div> +<dl><dt><span class="strong">Parameters:</span></dt><dd><code>strides</code> - an array of integers, each specifying the number of bytes + per line in the corresponding plane of the output image. Setting the + stride for any plane to 0 is the same as setting it to the component width + of the plane. If <code>strides</code> is null, then the strides for all + planes will be set to their respective component widths. You can adjust + the strides in order to add an arbitrary amount of line padding to each + plane.</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">Returns:</span></dt><dd>a YUV planar image.</dd> +<dt><span class="strong">Throws:</span></dt> +<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)"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>encodeYUV</h4> +<pre>@Deprecated +public byte[] encodeYUV(int flags) + 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><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)"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>encodeYUV</h4> +<pre>@Deprecated +public void encodeYUV(java.awt.image.BufferedImage srcImage, + byte[] dstBuf, + int flags) + 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><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)"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>encodeYUV</h4> +<pre>@Deprecated +public byte[] encodeYUV(java.awt.image.BufferedImage srcImage, + int flags) + 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><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl> +</li> +</ul> +<a name="getCompressedSize()"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>getCompressedSize</h4> +<pre>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="strong">Returns:</span></dt><dd>the size of the image (in bytes) generated by the most recent + compress operation.</dd></dl> +</li> +</ul> +<a name="close()"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>close</h4> +<pre>public void close() + 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> +<dd><code>close</code> in interface <code>java.io.Closeable</code></dd> +<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><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl> +</li> +</ul> +<a name="finalize()"> +<!-- --> +</a> +<ul class="blockListLast"> +<li class="blockList"> +<h4>finalize</h4> +<pre>protected void finalize() + throws java.lang.Throwable</pre> +<dl> +<dt><strong>Overrides:</strong></dt> +<dd><code>finalize</code> in class <code>java.lang.Object</code></dd> +<dt><span class="strong">Throws:</span></dt> +<dd><code>java.lang.Throwable</code></dd></dl> +</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/TJ.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">Prev Class</span></a></li> +<li><a href="../../../org/libjpegturbo/turbojpeg/TJCustomFilter.html" title="interface in org.libjpegturbo.turbojpeg"><span class="strong">Next Class</span></a></li> +</ul> +<ul class="navList"> +<li><a href="../../../index.html?org/libjpegturbo/turbojpeg/TJCompressor.html" target="_top">Frames</a></li> +<li><a href="TJCompressor.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="#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 name="skip-navbar_bottom"> +<!-- --> +</a></div> +<!-- ======== END OF BOTTOM NAVBAR ======= --> +</body> +</html>
diff --git a/src/third_party/libjpeg-turbo/java/doc/org/libjpegturbo/turbojpeg/TJCustomFilter.html b/src/third_party/libjpeg-turbo/java/doc/org/libjpegturbo/turbojpeg/TJCustomFilter.html new file mode 100644 index 0000000..412dcd4 --- /dev/null +++ b/src/third_party/libjpeg-turbo/java/doc/org/libjpegturbo/turbojpeg/TJCustomFilter.html
@@ -0,0 +1,241 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!-- NewPage --> +<html lang="en"> +<head> +<title>TJCustomFilter</title> +<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style"> +</head> +<body> +<script type="text/javascript"><!-- + try { + if (location.href.indexOf('is-external=true') == -1) { + parent.document.title="TJCustomFilter"; + } + } + catch(err) { + } +//--> +</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/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">Prev Class</span></a></li> +<li><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.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/TJCustomFilter.html" target="_top">Frames</a></li> +<li><a href="TJCustomFilter.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>Constr | </li> +<li><a href="#method_summary">Method</a></li> +</ul> +<ul class="subNavList"> +<li>Detail: </li> +<li>Field | </li> +<li>Constr | </li> +<li><a href="#method_detail">Method</a></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="Interface TJCustomFilter" class="title">Interface TJCustomFilter</h2> +</div> +<div class="contentContainer"> +<div class="description"> +<ul class="blockList"> +<li class="blockList"> +<hr> +<br> +<pre>public interface <span class="strong">TJCustomFilter</span></pre> +<div class="block">Custom filter callback interface</div> +</li> +</ul> +</div> +<div class="summary"> +<ul class="blockList"> +<li class="blockList"> +<!-- ========== METHOD SUMMARY =========== --> +<ul class="blockList"> +<li class="blockList"><a name="method_summary"> +<!-- --> +</a> +<h3>Method Summary</h3> +<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> +<caption><span>Methods</span><span class="tabEnd"> </span></caption> +<tr> +<th class="colFirst" scope="col">Modifier and Type</th> +<th class="colLast" scope="col">Method and Description</th> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>void</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJCustomFilter.html#customFilter(java.nio.ShortBuffer,%20java.awt.Rectangle,%20java.awt.Rectangle,%20int,%20int,%20org.libjpegturbo.turbojpeg.TJTransform)">customFilter</a></strong>(java.nio.ShortBuffer coeffBuffer, + java.awt.Rectangle bufferRegion, + java.awt.Rectangle planeRegion, + int componentID, + int transformID, + <a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</a> transform)</code> +<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.</div> +</td> +</tr> +</table> +</li> +</ul> +</li> +</ul> +</div> +<div class="details"> +<ul class="blockList"> +<li class="blockList"> +<!-- ============ METHOD DETAIL ========== --> +<ul class="blockList"> +<li class="blockList"><a name="method_detail"> +<!-- --> +</a> +<h3>Method Detail</h3> +<a name="customFilter(java.nio.ShortBuffer, java.awt.Rectangle, java.awt.Rectangle, int, int, org.libjpegturbo.turbojpeg.TJTransform)"> +<!-- --> +</a> +<ul class="blockListLast"> +<li class="blockList"> +<h4>customFilter</h4> +<pre>void customFilter(java.nio.ShortBuffer coeffBuffer, + java.awt.Rectangle bufferRegion, + java.awt.Rectangle planeRegion, + int componentID, + int transformID, + <a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</a> transform) + 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 + applied in the frequency domain.</div> +<dl><dt><span class="strong">Parameters:</span></dt><dd><code>coeffBuffer</code> - a buffer containing transformed DCT coefficients. + (NOTE: this buffer is not guaranteed to be valid once the callback + returns, so applications wishing to hand off the DCT coefficients to + another function or library should make a copy of them within the body of + the callback.)</dd><dd><code>bufferRegion</code> - rectangle containing the width and height of + <code>coeffBuffer</code> as well as its offset relative to the component + plane. TurboJPEG implementations may choose to split each component plane + into multiple DCT coefficient buffers and call the callback function once + for each buffer.</dd><dd><code>planeRegion</code> - rectangle containing the width and height of the + component plane to which <code>coeffBuffer</code> belongs</dd><dd><code>componentID</code> - ID number of the component plane to which + <code>coeffBuffer</code> belongs (Y, Cb, and Cr have, respectively, ID's + of 0, 1, and 2 in typical JPEG images.)</dd><dd><code>transformID</code> - ID number of the transformed image to which + <code>coeffBuffer</code> belongs. This is the same as the index of the + 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><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl> +</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/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">Prev Class</span></a></li> +<li><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.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/TJCustomFilter.html" target="_top">Frames</a></li> +<li><a href="TJCustomFilter.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>Constr | </li> +<li><a href="#method_summary">Method</a></li> +</ul> +<ul class="subNavList"> +<li>Detail: </li> +<li>Field | </li> +<li>Constr | </li> +<li><a href="#method_detail">Method</a></li> +</ul> +</div> +<a name="skip-navbar_bottom"> +<!-- --> +</a></div> +<!-- ======== END OF BOTTOM NAVBAR ======= --> +</body> +</html>
diff --git a/src/third_party/libjpeg-turbo/java/doc/org/libjpegturbo/turbojpeg/TJDecompressor.html b/src/third_party/libjpeg-turbo/java/doc/org/libjpegturbo/turbojpeg/TJDecompressor.html new file mode 100644 index 0000000..b281e32 --- /dev/null +++ b/src/third_party/libjpeg-turbo/java/doc/org/libjpegturbo/turbojpeg/TJDecompressor.html
@@ -0,0 +1,1255 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!-- NewPage --> +<html lang="en"> +<head> +<title>TJDecompressor</title> +<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style"> +</head> +<body> +<script type="text/javascript"><!-- + try { + if (location.href.indexOf('is-external=true') == -1) { + parent.document.title="TJDecompressor"; + } + } + catch(err) { + } +//--> +</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/TJCustomFilter.html" title="interface 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">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><a href="TJDecompressor.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><a href="#field_summary">Field</a> | </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><a href="#field_detail">Field</a> | </li> +<li><a href="#constructor_detail">Constr</a> | </li> +<li><a href="#method_detail">Method</a></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 TJDecompressor" class="title">Class TJDecompressor</h2> +</div> +<div class="contentContainer"> +<ul class="inheritance"> +<li>java.lang.Object</li> +<li> +<ul class="inheritance"> +<li>org.libjpegturbo.turbojpeg.TJDecompressor</li> +</ul> +</li> +</ul> +<div class="description"> +<ul class="blockList"> +<li class="blockList"> +<dl> +<dt>All Implemented Interfaces:</dt> +<dd>java.io.Closeable, java.lang.AutoCloseable</dd> +</dl> +<dl> +<dt>Direct Known Subclasses:</dt> +<dd><a href="../../../org/libjpegturbo/turbojpeg/TJTransformer.html" title="class in org.libjpegturbo.turbojpeg">TJTransformer</a></dd> +</dl> +<hr> +<br> +<pre>public class <span class="strong">TJDecompressor</span> +extends java.lang.Object +implements java.io.Closeable</pre> +<div class="block">TurboJPEG decompressor</div> +</li> +</ul> +</div> +<div class="summary"> +<ul class="blockList"> +<li class="blockList"> +<!-- =========== FIELD SUMMARY =========== --> +<ul class="blockList"> +<li class="blockList"><a name="field_summary"> +<!-- --> +</a> +<h3>Field Summary</h3> +<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation"> +<caption><span>Fields</span><span class="tabEnd"> </span></caption> +<tr> +<th class="colFirst" scope="col">Modifier and Type</th> +<th class="colLast" scope="col">Field and Description</th> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>protected long</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#handle">handle</a></strong></code> </td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><code>protected byte[]</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegBuf">jpegBuf</a></strong></code> </td> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>protected int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegBufSize">jpegBufSize</a></strong></code> </td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><code>protected int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegColorspace">jpegColorspace</a></strong></code> </td> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>protected int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegHeight">jpegHeight</a></strong></code> </td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><code>protected int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegSubsamp">jpegSubsamp</a></strong></code> </td> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>protected int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegWidth">jpegWidth</a></strong></code> </td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><code>protected <a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a></code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#yuvImage">yuvImage</a></strong></code> </td> +</tr> +</table> +</li> +</ul> +<!-- ======== 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/TJDecompressor.html#TJDecompressor()">TJDecompressor</a></strong>()</code> +<div class="block">Create a TurboJPEG decompresssor instance.</div> +</td> +</tr> +<tr class="rowColor"> +<td class="colOne"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#TJDecompressor(byte[])">TJDecompressor</a></strong>(byte[] jpegImage)</code> +<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> +</td> +</tr> +<tr class="altColor"> +<td class="colOne"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#TJDecompressor(byte[],%20int)">TJDecompressor</a></strong>(byte[] jpegImage, + int imageSize)</code> +<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> +</td> +</tr> +<tr class="rowColor"> +<td class="colOne"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#TJDecompressor(org.libjpegturbo.turbojpeg.YUVImage)">TJDecompressor</a></strong>(<a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a> yuvImage)</code> +<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> +</td> +</tr> +</table> +</li> +</ul> +<!-- ========== METHOD SUMMARY =========== --> +<ul class="blockList"> +<li class="blockList"><a name="method_summary"> +<!-- --> +</a> +<h3>Method Summary</h3> +<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> +<caption><span>Methods</span><span class="tabEnd"> </span></caption> +<tr> +<th class="colFirst" scope="col">Modifier and Type</th> +<th class="colLast" scope="col">Method and Description</th> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>void</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#close()">close</a></strong>()</code> +<div class="block">Free the native structures associated with this decompressor instance.</div> +</td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><code>void</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(java.awt.image.BufferedImage,%20int)">decompress</a></strong>(java.awt.image.BufferedImage dstImage, + int flags)</code> +<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> +</td> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>void</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[],%20int,%20int,%20int,%20int,%20int)">decompress</a></strong>(byte[] dstBuf, + int desiredWidth, + int pitch, + int desiredHeight, + int pixelFormat, + int flags)</code> +<div class="block"><strong>Deprecated.</strong> +<div class="block"><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> +</div> +</td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><code>void</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[],%20int,%20int,%20int,%20int,%20int,%20int,%20int)">decompress</a></strong>(byte[] dstBuf, + int x, + int y, + int desiredWidth, + int pitch, + int desiredHeight, + int pixelFormat, + int flags)</code> +<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> +</td> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>void</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(int[],%20int,%20int,%20int,%20int,%20int,%20int,%20int)">decompress</a></strong>(int[] dstBuf, + int x, + int y, + int desiredWidth, + int stride, + int desiredHeight, + int pixelFormat, + int flags)</code> +<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> +</td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><code>java.awt.image.BufferedImage</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(int,%20int,%20int,%20int)">decompress</a></strong>(int desiredWidth, + int desiredHeight, + int bufferedImageType, + int flags)</code> +<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> +</td> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>byte[]</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(int,%20int,%20int,%20int,%20int)">decompress</a></strong>(int desiredWidth, + int pitch, + int desiredHeight, + int pixelFormat, + int flags)</code> +<div class="block">Decompress the JPEG source image associated with this decompressor + instance and return a buffer containing the decompressed image.</div> +</td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><code>void</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(byte[],%20int)">decompressToYUV</a></strong>(byte[] dstBuf, + int flags)</code> +<div class="block"><strong>Deprecated.</strong> +<div class="block"><i>Use <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(org.libjpegturbo.turbojpeg.YUVImage,%20int)"><code>decompressToYUV(YUVImage, int)</code></a> instead.</i></div> +</div> +</td> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>byte[]</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(int)">decompressToYUV</a></strong>(int flags)</code> +<div class="block"><strong>Deprecated.</strong> +<div class="block"><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> +</div> +</td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><code><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a></code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(int,%20int[],%20int,%20int)">decompressToYUV</a></strong>(int desiredWidth, + int[] strides, + int desiredHeight, + int flags)</code> +<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.</div> +</td> +</tr> +<tr class="altColor"> +<td class="colFirst"><code><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a></code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(int,%20int,%20int,%20int)">decompressToYUV</a></strong>(int desiredWidth, + int pad, + int desiredHeight, + int flags)</code> +<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.</div> +</td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><code>void</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(org.libjpegturbo.turbojpeg.YUVImage,%20int)">decompressToYUV</a></strong>(<a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a> dstImage, + int flags)</code> +<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.</div> +</td> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>protected void</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#finalize()">finalize</a></strong>()</code> </td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><code>int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getColorspace()">getColorspace</a></strong>()</code> +<div class="block">Returns the colorspace used in the source image (JPEG or YUV) associated + with this decompressor instance.</div> +</td> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getHeight()">getHeight</a></strong>()</code> +<div class="block">Returns the height of the source image (JPEG or YUV) associated with this + decompressor instance.</div> +</td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><code>byte[]</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getJPEGBuf()">getJPEGBuf</a></strong>()</code> +<div class="block">Returns the JPEG image buffer associated with this decompressor instance.</div> +</td> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getJPEGSize()">getJPEGSize</a></strong>()</code> +<div class="block">Returns the size of the JPEG image (in bytes) associated with this + decompressor instance.</div> +</td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><code>int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getScaledHeight(int,%20int)">getScaledHeight</a></strong>(int desiredWidth, + int desiredHeight)</code> +<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> +</td> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getScaledWidth(int,%20int)">getScaledWidth</a></strong>(int desiredWidth, + int desiredHeight)</code> +<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> +</td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><code>int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getSubsamp()">getSubsamp</a></strong>()</code> +<div class="block">Returns the level of chrominance subsampling used in the source image + (JPEG or YUV) associated with this decompressor instance.</div> +</td> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getWidth()">getWidth</a></strong>()</code> +<div class="block">Returns the width of the source image (JPEG or YUV) associated with this + decompressor instance.</div> +</td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><code>void</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#setJPEGImage(byte[],%20int)">setJPEGImage</a></strong>(byte[] jpegImage, + int imageSize)</code> +<div class="block"><strong>Deprecated.</strong> +<div class="block"><i>Use <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#setSourceImage(byte[],%20int)"><code>setSourceImage(byte[], int)</code></a> instead.</i></div> +</div> +</td> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>void</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#setSourceImage(byte[],%20int)">setSourceImage</a></strong>(byte[] jpegImage, + int imageSize)</code> +<div class="block">Associate the JPEG image of length <code>imageSize</code> bytes stored in + <code>jpegImage</code> with this decompressor instance.</div> +</td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><code>void</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#setSourceImage(org.libjpegturbo.turbojpeg.YUVImage)">setSourceImage</a></strong>(<a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a> srcImage)</code> +<div class="block">Associate the specified YUV planar source image with this decompressor + instance.</div> +</td> +</tr> +</table> +<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, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li> +</ul> +</li> +</ul> +</li> +</ul> +</div> +<div class="details"> +<ul class="blockList"> +<li class="blockList"> +<!-- ============ FIELD DETAIL =========== --> +<ul class="blockList"> +<li class="blockList"><a name="field_detail"> +<!-- --> +</a> +<h3>Field Detail</h3> +<a name="handle"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>handle</h4> +<pre>protected long handle</pre> +</li> +</ul> +<a name="jpegBuf"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>jpegBuf</h4> +<pre>protected byte[] jpegBuf</pre> +</li> +</ul> +<a name="jpegBufSize"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>jpegBufSize</h4> +<pre>protected int jpegBufSize</pre> +</li> +</ul> +<a name="yuvImage"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>yuvImage</h4> +<pre>protected <a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a> yuvImage</pre> +</li> +</ul> +<a name="jpegWidth"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>jpegWidth</h4> +<pre>protected int jpegWidth</pre> +</li> +</ul> +<a name="jpegHeight"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>jpegHeight</h4> +<pre>protected int jpegHeight</pre> +</li> +</ul> +<a name="jpegSubsamp"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>jpegSubsamp</h4> +<pre>protected int jpegSubsamp</pre> +</li> +</ul> +<a name="jpegColorspace"> +<!-- --> +</a> +<ul class="blockListLast"> +<li class="blockList"> +<h4>jpegColorspace</h4> +<pre>protected int jpegColorspace</pre> +</li> +</ul> +</li> +</ul> +<!-- ========= CONSTRUCTOR DETAIL ======== --> +<ul class="blockList"> +<li class="blockList"><a name="constructor_detail"> +<!-- --> +</a> +<h3>Constructor Detail</h3> +<a name="TJDecompressor()"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>TJDecompressor</h4> +<pre>public TJDecompressor() + 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><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl> +</li> +</ul> +<a name="TJDecompressor(byte[])"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>TJDecompressor</h4> +<pre>public TJDecompressor(byte[] jpegImage) + 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><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)"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>TJDecompressor</h4> +<pre>public TJDecompressor(byte[] jpegImage, + int imageSize) + 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><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)"> +<!-- --> +</a> +<ul class="blockListLast"> +<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 <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><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl> +</li> +</ul> +</li> +</ul> +<!-- ============ METHOD DETAIL ========== --> +<ul class="blockList"> +<li class="blockList"><a name="method_detail"> +<!-- --> +</a> +<h3>Method Detail</h3> +<a name="setSourceImage(byte[], int)"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>setSourceImage</h4> +<pre>public void setSourceImage(byte[] jpegImage, + int imageSize) + 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><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)"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>setJPEGImage</h4> +<pre>@Deprecated +public void setJPEGImage(byte[] jpegImage, + int imageSize) + 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><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)"> +<!-- --> +</a> +<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)</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></dl> +</li> +</ul> +<a name="getWidth()"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>getWidth</h4> +<pre>public int getWidth()</pre> +<div class="block">Returns the width of the source image (JPEG or YUV) associated with this + decompressor instance.</div> +<dl><dt><span class="strong">Returns:</span></dt><dd>the width of the source image (JPEG or YUV) associated with this + decompressor instance.</dd></dl> +</li> +</ul> +<a name="getHeight()"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>getHeight</h4> +<pre>public int getHeight()</pre> +<div class="block">Returns the height of the source image (JPEG or YUV) associated with this + decompressor instance.</div> +<dl><dt><span class="strong">Returns:</span></dt><dd>the height of the source image (JPEG or YUV) associated with this + decompressor instance.</dd></dl> +</li> +</ul> +<a name="getSubsamp()"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>getSubsamp</h4> +<pre>public int getSubsamp()</pre> +<div class="block">Returns the level of chrominance subsampling used in the source image + (JPEG or YUV) associated with this decompressor instance. See + <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#SAMP_444"><code>TJ.SAMP_*</code></a>.</div> +<dl><dt><span class="strong">Returns:</span></dt><dd>the level of chrominance subsampling used in the source image + (JPEG or YUV) associated with this decompressor instance.</dd></dl> +</li> +</ul> +<a name="getColorspace()"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>getColorspace</h4> +<pre>public int getColorspace()</pre> +<div class="block">Returns the colorspace used in the source image (JPEG or YUV) associated + with this decompressor instance. See <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#CS_RGB"><code>TJ.CS_*</code></a>. If the + source image is YUV, then this always returns <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#CS_YCbCr"><code>TJ.CS_YCbCr</code></a>.</div> +<dl><dt><span class="strong">Returns:</span></dt><dd>the colorspace used in the source image (JPEG or YUV) associated + with this decompressor instance.</dd></dl> +</li> +</ul> +<a name="getJPEGBuf()"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>getJPEGBuf</h4> +<pre>public byte[] getJPEGBuf()</pre> +<div class="block">Returns the JPEG image buffer associated with this decompressor instance.</div> +<dl><dt><span class="strong">Returns:</span></dt><dd>the JPEG image buffer associated with this decompressor instance.</dd></dl> +</li> +</ul> +<a name="getJPEGSize()"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>getJPEGSize</h4> +<pre>public int getJPEGSize()</pre> +<div class="block">Returns the size of the JPEG image (in bytes) associated with this + decompressor instance.</div> +<dl><dt><span class="strong">Returns:</span></dt><dd>the size of the JPEG image (in bytes) associated with this + decompressor instance.</dd></dl> +</li> +</ul> +<a name="getScaledWidth(int, int)"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>getScaledWidth</h4> +<pre>public int getScaledWidth(int desiredWidth, + 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> +<dl><dt><span class="strong">Parameters:</span></dt><dd><code>desiredWidth</code> - desired width (in pixels) of the decompressed image. + Setting this to 0 is the same as setting it to the width of the JPEG image + (in other words, the width will not be considered when determining the + scaled image size.)</dd><dd><code>desiredHeight</code> - desired height (in pixels) of the decompressed image. + Setting this to 0 is the same as setting it to the height of the JPEG + image (in other words, the height will not be considered when determining + 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></dl> +</li> +</ul> +<a name="getScaledHeight(int, int)"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>getScaledHeight</h4> +<pre>public int getScaledHeight(int desiredWidth, + 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> +<dl><dt><span class="strong">Parameters:</span></dt><dd><code>desiredWidth</code> - desired width (in pixels) of the decompressed image. + Setting this to 0 is the same as setting it to the width of the JPEG image + (in other words, the width will not be considered when determining the + scaled image size.)</dd><dd><code>desiredHeight</code> - desired height (in pixels) of the decompressed image. + Setting this to 0 is the same as setting it to the height of the JPEG + image (in other words, the height will not be considered when determining + 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></dl> +</li> +</ul> +<a name="decompress(byte[], int, int, int, int, int, int, int)"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>decompress</h4> +<pre>public void decompress(byte[] dstBuf, + int x, + int y, + int desiredWidth, + int pitch, + int desiredHeight, + int pixelFormat, + int flags) + 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. + <p> + NOTE: The output image is fully recoverable if this method throws a + non-fatal <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg"><code>TJException</code></a> (unless + <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_STOPONWARNING"><code>TJ.FLAG_STOPONWARNING</code></a> is specified.)</div> +<dl><dt><span class="strong">Parameters:</span></dt><dd><code>dstBuf</code> - buffer that will receive the decompressed/decoded image. + If the source image is a JPEG image, then this buffer should normally be + <code>pitch * scaledHeight</code> bytes in size, where + <code>scaledHeight</code> can be determined by calling <code> + scalingFactor.<a href="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html#getScaled(int)"><code>getScaled</code></a>(jpegHeight) + </code> with one of the scaling factors returned from <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#getScalingFactors()"><code>TJ.getScalingFactors()</code></a> or by calling <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getScaledHeight(int,%20int)"><code>getScaledHeight(int, int)</code></a>. If the + source image is a YUV image, then this buffer should normally be + <code>pitch * height</code> bytes in size, where <code>height</code> is + the height of the YUV image. However, the buffer may also be larger than + the dimensions of the source image, in which case the <code>x</code>, + <code>y</code>, and <code>pitch</code> parameters can be used to specify + the region into which the source image should be decompressed/decoded.</dd><dd><code>x</code> - x offset (in pixels) of the region in the destination image into + which the source image should be decompressed/decoded</dd><dd><code>y</code> - y offset (in pixels) of the region in the destination image into + which the source image should be decompressed/decoded</dd><dd><code>desiredWidth</code> - If the source image is a JPEG image, then this + specifies the desired width (in pixels) of the decompressed image (or + image region.) If the desired destination image dimensions are different + than the source image dimensions, then TurboJPEG will use scaling in the + JPEG decompressor to generate the largest possible image that will fit + within the desired dimensions. Setting this to 0 is the same as setting + it to the width of the JPEG image (in other words, the width will not be + considered when determining the scaled image size.) This parameter is + ignored if the source image is a YUV image.</dd><dd><code>pitch</code> - bytes per line of the destination image. Normally, this + should be set to <code>scaledWidth * TJ.pixelSize(pixelFormat)</code> if + the destination image is unpadded, but you can use this to, for instance, + pad each line of the destination image to a 4-byte boundary or to + decompress/decode the source image into a region of a larger image. NOTE: + if the source image is a JPEG image, then <code>scaledWidth</code> can be + determined by calling <code> + scalingFactor.<a href="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html#getScaled(int)"><code>getScaled</code></a>(jpegWidth) + </code> or by calling <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getScaledWidth(int,%20int)"><code>getScaledWidth(int, int)</code></a>. If the source image is a + YUV image, then <code>scaledWidth</code> is the width of the YUV image. + Setting this parameter to 0 is the equivalent of setting it to + <code>scaledWidth * TJ.pixelSize(pixelFormat)</code>.</dd><dd><code>desiredHeight</code> - If the source image is a JPEG image, then this + specifies the desired height (in pixels) of the decompressed image (or + image region.) If the desired destination image dimensions are different + than the source image dimensions, then TurboJPEG will use scaling in the + JPEG decompressor to generate the largest possible image that will fit + within the desired dimensions. Setting this to 0 is the same as setting + it to the height of the JPEG image (in other words, the height will not be + considered when determining the scaled image size.) This parameter is + ignored if the source image is a YUV image.</dd><dd><code>pixelFormat</code> - pixel format of the decompressed/decoded image (one of + <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><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)"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>decompress</h4> +<pre>@Deprecated +public void decompress(byte[] dstBuf, + int desiredWidth, + int pitch, + int desiredHeight, + int pixelFormat, + int flags) + 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><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)"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>decompress</h4> +<pre>public byte[] decompress(int desiredWidth, + int pitch, + int desiredHeight, + int pixelFormat, + int flags) + 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/TJDecompressor.html#decompress(byte[],%20int,%20int,%20int,%20int,%20int,%20int,%20int)"><code>decompress(byte[], int, int, int, int, int, int, int)</code></a> + for description</dd><dd><code>pitch</code> - see + <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> + for description</dd><dd><code>desiredHeight</code> - see + <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> + for description</dd><dd><code>pixelFormat</code> - pixel format of the decompressed image (one of + <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">Returns:</span></dt><dd>a buffer containing the decompressed image.</dd> +<dt><span class="strong">Throws:</span></dt> +<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)"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<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 <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 + but leaves out the color conversion step, so a planar YUV image is + generated instead of an RGB or grayscale image. This method cannot be + used to decompress JPEG source images with the CMYK or YCCK colorspace. + <p> + NOTE: The YUV planar output image is fully recoverable if this method + throws a non-fatal <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg"><code>TJException</code></a> (unless + <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_STOPONWARNING"><code>TJ.FLAG_STOPONWARNING</code></a> is specified.)</div> +<dl><dt><span class="strong">Parameters:</span></dt><dd><code>dstImage</code> - <a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg"><code>YUVImage</code></a> instance that will receive the YUV planar + image. The level of subsampling specified in this <code>YUVImage</code> + instance must match that of the JPEG image, and the width and height + specified in the <code>YUVImage</code> instance must match one of the + scaled image sizes that TurboJPEG is capable of generating from the JPEG + 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><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)"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>decompressToYUV</h4> +<pre>@Deprecated +public void decompressToYUV(byte[] dstBuf, + int flags) + 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><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)"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>decompressToYUV</h4> +<pre>public <a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a> decompressToYUV(int desiredWidth, + int[] strides, + int desiredHeight, + int flags) + 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. + This method performs JPEG decompression but leaves out the color + conversion step, so a planar YUV image is generated instead of an RGB or + grayscale image. This method cannot be used to decompress JPEG source + images with the CMYK or YCCK colorspace.</div> +<dl><dt><span class="strong">Parameters:</span></dt><dd><code>desiredWidth</code> - desired width (in pixels) of the YUV image. If the + desired image dimensions are different than the dimensions of the JPEG + image being decompressed, then TurboJPEG will use scaling in the JPEG + decompressor to generate the largest possible image that will fit within + the desired dimensions. Setting this to 0 is the same as setting it to + the width of the JPEG image (in other words, the width will not be + considered when determining the scaled image size.)</dd><dd><code>strides</code> - an array of integers, each specifying the number of bytes + per line in the corresponding plane of the output image. Setting the + stride for any plane to 0 is the same as setting it to the scaled + component width of the plane. If <tt>strides</tt> is NULL, then the + strides for all planes will be set to their respective scaled component + widths. You can adjust the strides in order to add an arbitrary amount of + line padding to each plane.</dd><dd><code>desiredHeight</code> - desired height (in pixels) of the YUV image. If the + desired image dimensions are different than the dimensions of the JPEG + image being decompressed, then TurboJPEG will use scaling in the JPEG + decompressor to generate the largest possible image that will fit within + the desired dimensions. Setting this to 0 is the same as setting it to + the height of the JPEG image (in other words, the height will not be + considered when determining the scaled image size.)</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">Returns:</span></dt><dd>a YUV planar image.</dd> +<dt><span class="strong">Throws:</span></dt> +<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)"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>decompressToYUV</h4> +<pre>public <a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a> decompressToYUV(int desiredWidth, + int pad, + int desiredHeight, + int flags) + 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 + method performs JPEG decompression but leaves out the color conversion + step, so a planar YUV image is generated instead of an RGB or grayscale + image. This method cannot be used to decompress JPEG source images with + the CMYK or YCCK colorspace.</div> +<dl><dt><span class="strong">Parameters:</span></dt><dd><code>desiredWidth</code> - desired width (in pixels) of the YUV image. If the + desired image dimensions are different than the dimensions of the JPEG + image being decompressed, then TurboJPEG will use scaling in the JPEG + decompressor to generate the largest possible image that will fit within + the desired dimensions. Setting this to 0 is the same as setting it to + the width of the JPEG image (in other words, the width will not be + considered when determining the scaled image size.)</dd><dd><code>pad</code> - the width of each line in each plane of the YUV image will be + padded to the nearest multiple of this number of bytes (must be a power of + 2.)</dd><dd><code>desiredHeight</code> - desired height (in pixels) of the YUV image. If the + desired image dimensions are different than the dimensions of the JPEG + image being decompressed, then TurboJPEG will use scaling in the JPEG + decompressor to generate the largest possible image that will fit within + the desired dimensions. Setting this to 0 is the same as setting it to + the height of the JPEG image (in other words, the height will not be + considered when determining the scaled image size.)</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">Returns:</span></dt><dd>a YUV planar image.</dd> +<dt><span class="strong">Throws:</span></dt> +<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)"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>decompressToYUV</h4> +<pre>@Deprecated +public byte[] decompressToYUV(int flags) + 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><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)"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>decompress</h4> +<pre>public void decompress(int[] dstBuf, + int x, + int y, + int desiredWidth, + int stride, + int desiredHeight, + int pixelFormat, + int flags) + 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. + <p> + NOTE: The output image is fully recoverable if this method throws a + non-fatal <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg"><code>TJException</code></a> (unless + <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_STOPONWARNING"><code>TJ.FLAG_STOPONWARNING</code></a> is specified.)</div> +<dl><dt><span class="strong">Parameters:</span></dt><dd><code>dstBuf</code> - buffer that will receive the decompressed/decoded image. + If the source image is a JPEG image, then this buffer should normally be + <code>stride * scaledHeight</code> pixels in size, where + <code>scaledHeight</code> can be determined by calling <code> + scalingFactor.<a href="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html#getScaled(int)"><code>getScaled</code></a>(jpegHeight) + </code> with one of the scaling factors returned from <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#getScalingFactors()"><code>TJ.getScalingFactors()</code></a> or by calling <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getScaledHeight(int,%20int)"><code>getScaledHeight(int, int)</code></a>. If the + source image is a YUV image, then this buffer should normally be + <code>stride * height</code> pixels in size, where <code>height</code> is + the height of the YUV image. However, the buffer may also be larger than + the dimensions of the JPEG image, in which case the <code>x</code>, + <code>y</code>, and <code>stride</code> parameters can be used to specify + the region into which the source image should be decompressed.</dd><dd><code>x</code> - x offset (in pixels) of the region in the destination image into + which the source image should be decompressed/decoded</dd><dd><code>y</code> - y offset (in pixels) of the region in the destination image into + which the source image should be decompressed/decoded</dd><dd><code>desiredWidth</code> - If the source image is a JPEG image, then this + specifies the desired width (in pixels) of the decompressed image (or + image region.) If the desired destination image dimensions are different + than the source image dimensions, then TurboJPEG will use scaling in the + JPEG decompressor to generate the largest possible image that will fit + within the desired dimensions. Setting this to 0 is the same as setting + it to the width of the JPEG image (in other words, the width will not be + considered when determining the scaled image size.) This parameter is + ignored if the source image is a YUV image.</dd><dd><code>stride</code> - pixels per line of the destination image. Normally, this + should be set to <code>scaledWidth</code>, but you can use this to, for + instance, decompress the JPEG image into a region of a larger image. + NOTE: if the source image is a JPEG image, then <code>scaledWidth</code> + can be determined by calling <code> + scalingFactor.<a href="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html#getScaled(int)"><code>getScaled</code></a>(jpegWidth) + </code> or by calling <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getScaledWidth(int,%20int)"><code>getScaledWidth(int, int)</code></a>. If the source image is a + YUV image, then <code>scaledWidth</code> is the width of the YUV image. + Setting this parameter to 0 is the equivalent of setting it to + <code>scaledWidth</code>.</dd><dd><code>desiredHeight</code> - If the source image is a JPEG image, then this + specifies the desired height (in pixels) of the decompressed image (or + image region.) If the desired destination image dimensions are different + than the source image dimensions, then TurboJPEG will use scaling in the + JPEG decompressor to generate the largest possible image that will fit + within the desired dimensions. Setting this to 0 is the same as setting + it to the height of the JPEG image (in other words, the height will not be + considered when determining the scaled image size.) This parameter is + ignored if the source image is a YUV image.</dd><dd><code>pixelFormat</code> - pixel format of the decompressed image (one of + <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><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)"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>decompress</h4> +<pre>public void decompress(java.awt.image.BufferedImage dstImage, + int flags) + 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. + <p> + NOTE: The output image is fully recoverable if this method throws a + non-fatal <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg"><code>TJException</code></a> (unless + <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_STOPONWARNING"><code>TJ.FLAG_STOPONWARNING</code></a> is specified.)</div> +<dl><dt><span class="strong">Parameters:</span></dt><dd><code>dstImage</code> - a <code>BufferedImage</code> instance that will receive + the decompressed/decoded image. If the source image is a JPEG image, then + the width and height of the <code>BufferedImage</code> instance must match + one of the scaled image sizes that TurboJPEG is capable of generating from + the JPEG image. If the source image is a YUV image, then the width and + height of the <code>BufferedImage</code> instance must match the width and + 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><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)"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>decompress</h4> +<pre>public java.awt.image.BufferedImage decompress(int desiredWidth, + int desiredHeight, + int bufferedImageType, + int flags) + 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> +<dl><dt><span class="strong">Parameters:</span></dt><dd><code>desiredWidth</code> - see + <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> for + description</dd><dd><code>desiredHeight</code> - see + <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> for + description</dd><dd><code>bufferedImageType</code> - the image type of the <code>BufferedImage</code> + instance that will be created (for instance, + <code>BufferedImage.TYPE_INT_RGB</code>)</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">Returns:</span></dt><dd>a <code>BufferedImage</code> instance containing the + decompressed/decoded image.</dd> +<dt><span class="strong">Throws:</span></dt> +<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()"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>close</h4> +<pre>public void close() + 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> +<dd><code>close</code> in interface <code>java.io.Closeable</code></dd> +<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><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl> +</li> +</ul> +<a name="finalize()"> +<!-- --> +</a> +<ul class="blockListLast"> +<li class="blockList"> +<h4>finalize</h4> +<pre>protected void finalize() + throws java.lang.Throwable</pre> +<dl> +<dt><strong>Overrides:</strong></dt> +<dd><code>finalize</code> in class <code>java.lang.Object</code></dd> +<dt><span class="strong">Throws:</span></dt> +<dd><code>java.lang.Throwable</code></dd></dl> +</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/TJCustomFilter.html" title="interface 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">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><a href="TJDecompressor.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><a href="#field_summary">Field</a> | </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><a href="#field_detail">Field</a> | </li> +<li><a href="#constructor_detail">Constr</a> | </li> +<li><a href="#method_detail">Method</a></li> +</ul> +</div> +<a name="skip-navbar_bottom"> +<!-- --> +</a></div> +<!-- ======== END OF BOTTOM NAVBAR ======= --> +</body> +</html>
diff --git a/src/third_party/libjpeg-turbo/java/doc/org/libjpegturbo/turbojpeg/TJException.html b/src/third_party/libjpeg-turbo/java/doc/org/libjpegturbo/turbojpeg/TJException.html new file mode 100644 index 0000000..66d73e7 --- /dev/null +++ b/src/third_party/libjpeg-turbo/java/doc/org/libjpegturbo/turbojpeg/TJException.html
@@ -0,0 +1,340 @@ +<!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"><!-- + try { + if (location.href.indexOf('is-external=true') == -1) { + parent.document.title="TJException"; + } + } + catch(err) { + } +//--> +</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="#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 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,%20int)">TJException</a></strong>(java.lang.String message, + int code)</code> </td> +</tr> +<tr class="rowColor"> +<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="altColor"> +<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> +<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> +<caption><span>Methods</span><span class="tabEnd"> </span></caption> +<tr> +<th class="colFirst" scope="col">Modifier and Type</th> +<th class="colLast" scope="col">Method and Description</th> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJException.html#getErrorCode()">getErrorCode</a></strong>()</code> +<div class="block">Returns a code (one of <a href="../../../org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><code>TJ.ERR_*</code></a>) indicating the severity of the + last error.</div> +</td> +</tr> +</table> +<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.String, int)"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>TJException</h4> +<pre>public TJException(java.lang.String message, + int code)</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> +<!-- ============ METHOD DETAIL ========== --> +<ul class="blockList"> +<li class="blockList"><a name="method_detail"> +<!-- --> +</a> +<h3>Method Detail</h3> +<a name="getErrorCode()"> +<!-- --> +</a> +<ul class="blockListLast"> +<li class="blockList"> +<h4>getErrorCode</h4> +<pre>public int getErrorCode()</pre> +<div class="block">Returns a code (one of <a href="../../../org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><code>TJ.ERR_*</code></a>) indicating the severity of the + last error.</div> +<dl><dt><span class="strong">Returns:</span></dt><dd>a code (one of <a href="../../../org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><code>TJ.ERR_*</code></a>) indicating the severity of the + last error.</dd></dl> +</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="#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 name="skip-navbar_bottom"> +<!-- --> +</a></div> +<!-- ======== END OF BOTTOM NAVBAR ======= --> +</body> +</html>
diff --git a/src/third_party/libjpeg-turbo/java/doc/org/libjpegturbo/turbojpeg/TJScalingFactor.html b/src/third_party/libjpeg-turbo/java/doc/org/libjpegturbo/turbojpeg/TJScalingFactor.html new file mode 100644 index 0000000..4006bac --- /dev/null +++ b/src/third_party/libjpeg-turbo/java/doc/org/libjpegturbo/turbojpeg/TJScalingFactor.html
@@ -0,0 +1,343 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!-- NewPage --> +<html lang="en"> +<head> +<title>TJScalingFactor</title> +<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style"> +</head> +<body> +<script type="text/javascript"><!-- + try { + if (location.href.indexOf('is-external=true') == -1) { + parent.document.title="TJScalingFactor"; + } + } + catch(err) { + } +//--> +</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/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"> +<li><a href="../../../index.html?org/libjpegturbo/turbojpeg/TJScalingFactor.html" target="_top">Frames</a></li> +<li><a href="TJScalingFactor.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="#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 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 TJScalingFactor" class="title">Class TJScalingFactor</h2> +</div> +<div class="contentContainer"> +<ul class="inheritance"> +<li>java.lang.Object</li> +<li> +<ul class="inheritance"> +<li>org.libjpegturbo.turbojpeg.TJScalingFactor</li> +</ul> +</li> +</ul> +<div class="description"> +<ul class="blockList"> +<li class="blockList"> +<hr> +<br> +<pre>public class <span class="strong">TJScalingFactor</span> +extends java.lang.Object</pre> +<div class="block">Fractional scaling factor</div> +</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/TJScalingFactor.html#TJScalingFactor(int,%20int)">TJScalingFactor</a></strong>(int num, + int denom)</code> +<div class="block">Create a TurboJPEG scaling factor instance.</div> +</td> +</tr> +</table> +</li> +</ul> +<!-- ========== METHOD SUMMARY =========== --> +<ul class="blockList"> +<li class="blockList"><a name="method_summary"> +<!-- --> +</a> +<h3>Method Summary</h3> +<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> +<caption><span>Methods</span><span class="tabEnd"> </span></caption> +<tr> +<th class="colFirst" scope="col">Modifier and Type</th> +<th class="colLast" scope="col">Method and Description</th> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>boolean</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html#equals(org.libjpegturbo.turbojpeg.TJScalingFactor)">equals</a></strong>(<a href="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg">TJScalingFactor</a> other)</code> +<div class="block">Returns true or false, depending on whether this instance and + <code>other</code> have the same numerator and denominator.</div> +</td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><code>int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html#getDenom()">getDenom</a></strong>()</code> +<div class="block">Returns denominator</div> +</td> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html#getNum()">getNum</a></strong>()</code> +<div class="block">Returns numerator</div> +</td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><code>int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html#getScaled(int)">getScaled</a></strong>(int dimension)</code> +<div class="block">Returns the scaled value of <code>dimension</code>.</div> +</td> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>boolean</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html#isOne()">isOne</a></strong>()</code> +<div class="block">Returns true or false, depending on whether this instance is equal to + 1/1.</div> +</td> +</tr> +</table> +<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, toString, 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="TJScalingFactor(int, int)"> +<!-- --> +</a> +<ul class="blockListLast"> +<li class="blockList"> +<h4>TJScalingFactor</h4> +<pre>public TJScalingFactor(int num, + int denom)</pre> +<div class="block">Create a TurboJPEG scaling factor instance.</div> +<dl><dt><span class="strong">Parameters:</span></dt><dd><code>num</code> - numerator</dd><dd><code>denom</code> - denominator</dd></dl> +</li> +</ul> +</li> +</ul> +<!-- ============ METHOD DETAIL ========== --> +<ul class="blockList"> +<li class="blockList"><a name="method_detail"> +<!-- --> +</a> +<h3>Method Detail</h3> +<a name="getNum()"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>getNum</h4> +<pre>public int getNum()</pre> +<div class="block">Returns numerator</div> +<dl><dt><span class="strong">Returns:</span></dt><dd>numerator</dd></dl> +</li> +</ul> +<a name="getDenom()"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>getDenom</h4> +<pre>public int getDenom()</pre> +<div class="block">Returns denominator</div> +<dl><dt><span class="strong">Returns:</span></dt><dd>denominator</dd></dl> +</li> +</ul> +<a name="getScaled(int)"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>getScaled</h4> +<pre>public int getScaled(int dimension)</pre> +<div class="block">Returns the scaled value of <code>dimension</code>. This function + performs the integer equivalent of + <code>ceil(dimension * scalingFactor)</code>.</div> +<dl><dt><span class="strong">Parameters:</span></dt><dd><code>dimension</code> - width or height to multiply by this scaling factor</dd> +<dt><span class="strong">Returns:</span></dt><dd>the scaled value of <code>dimension</code>.</dd></dl> +</li> +</ul> +<a name="equals(org.libjpegturbo.turbojpeg.TJScalingFactor)"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>equals</h4> +<pre>public boolean equals(<a href="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg">TJScalingFactor</a> other)</pre> +<div class="block">Returns true or false, depending on whether this instance and + <code>other</code> have the same numerator and denominator.</div> +<dl><dt><span class="strong">Parameters:</span></dt><dd><code>other</code> - the scaling factor against which to compare this one</dd> +<dt><span class="strong">Returns:</span></dt><dd>true or false, depending on whether this instance and + <code>other</code> have the same numerator and denominator.</dd></dl> +</li> +</ul> +<a name="isOne()"> +<!-- --> +</a> +<ul class="blockListLast"> +<li class="blockList"> +<h4>isOne</h4> +<pre>public boolean isOne()</pre> +<div class="block">Returns true or false, depending on whether this instance is equal to + 1/1.</div> +<dl><dt><span class="strong">Returns:</span></dt><dd>true or false, depending on whether this instance is equal to + 1/1.</dd></dl> +</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/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"> +<li><a href="../../../index.html?org/libjpegturbo/turbojpeg/TJScalingFactor.html" target="_top">Frames</a></li> +<li><a href="TJScalingFactor.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="#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 name="skip-navbar_bottom"> +<!-- --> +</a></div> +<!-- ======== END OF BOTTOM NAVBAR ======= --> +</body> +</html>
diff --git a/src/third_party/libjpeg-turbo/java/doc/org/libjpegturbo/turbojpeg/TJTransform.html b/src/third_party/libjpeg-turbo/java/doc/org/libjpegturbo/turbojpeg/TJTransform.html new file mode 100644 index 0000000..5f22691 --- /dev/null +++ b/src/third_party/libjpeg-turbo/java/doc/org/libjpegturbo/turbojpeg/TJTransform.html
@@ -0,0 +1,751 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!-- NewPage --> +<html lang="en"> +<head> +<title>TJTransform</title> +<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style"> +</head> +<body> +<script type="text/javascript"><!-- + try { + if (location.href.indexOf('is-external=true') == -1) { + parent.document.title="TJTransform"; + } + } + catch(err) { + } +//--> +</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/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">Prev Class</span></a></li> +<li><a href="../../../org/libjpegturbo/turbojpeg/TJTransformer.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/TJTransform.html" target="_top">Frames</a></li> +<li><a href="TJTransform.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><a href="#nested_classes_inherited_from_class_java.awt.geom.Rectangle2D">Nested</a> | </li> +<li><a href="#field_summary">Field</a> | </li> +<li><a href="#constructor_summary">Constr</a> | </li> +<li><a href="#methods_inherited_from_class_java.awt.Rectangle">Method</a></li> +</ul> +<ul class="subNavList"> +<li>Detail: </li> +<li><a href="#field_detail">Field</a> | </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 TJTransform" class="title">Class TJTransform</h2> +</div> +<div class="contentContainer"> +<ul class="inheritance"> +<li>java.lang.Object</li> +<li> +<ul class="inheritance"> +<li>java.awt.geom.RectangularShape</li> +<li> +<ul class="inheritance"> +<li>java.awt.geom.Rectangle2D</li> +<li> +<ul class="inheritance"> +<li>java.awt.Rectangle</li> +<li> +<ul class="inheritance"> +<li>org.libjpegturbo.turbojpeg.TJTransform</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.awt.Shape, java.io.Serializable, java.lang.Cloneable</dd> +</dl> +<hr> +<br> +<pre>public class <span class="strong">TJTransform</span> +extends java.awt.Rectangle</pre> +<div class="block">Lossless transform parameters</div> +<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../serialized-form.html#org.libjpegturbo.turbojpeg.TJTransform">Serialized Form</a></dd></dl> +</li> +</ul> +</div> +<div class="summary"> +<ul class="blockList"> +<li class="blockList"> +<!-- ======== NESTED CLASS SUMMARY ======== --> +<ul class="blockList"> +<li class="blockList"><a name="nested_class_summary"> +<!-- --> +</a> +<h3>Nested Class Summary</h3> +<ul class="blockList"> +<li class="blockList"><a name="nested_classes_inherited_from_class_java.awt.geom.Rectangle2D"> +<!-- --> +</a> +<h3>Nested classes/interfaces inherited from class java.awt.geom.Rectangle2D</h3> +<code>java.awt.geom.Rectangle2D.Double, java.awt.geom.Rectangle2D.Float</code></li> +</ul> +</li> +</ul> +<!-- =========== FIELD SUMMARY =========== --> +<ul class="blockList"> +<li class="blockList"><a name="field_summary"> +<!-- --> +</a> +<h3>Field Summary</h3> +<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation"> +<caption><span>Fields</span><span class="tabEnd"> </span></caption> +<tr> +<th class="colFirst" scope="col">Modifier and Type</th> +<th class="colLast" scope="col">Field and Description</th> +</tr> +<tr class="altColor"> +<td class="colFirst"><code><a href="../../../org/libjpegturbo/turbojpeg/TJCustomFilter.html" title="interface in org.libjpegturbo.turbojpeg">TJCustomFilter</a></code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html#cf">cf</a></strong></code> +<div class="block">Custom filter instance</div> +</td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><code>static int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html#NUMOP">NUMOP</a></strong></code> +<div class="block">The number of lossless transform operations</div> +</td> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html#op">op</a></strong></code> +<div class="block">Transform operation (one of <code>OP_*</code>)</div> +</td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><code>static int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html#OP_HFLIP">OP_HFLIP</a></strong></code> +<div class="block">Flip (mirror) image horizontally.</div> +</td> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>static int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html#OP_NONE">OP_NONE</a></strong></code> +<div class="block">Do not transform the position of the image pixels.</div> +</td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><code>static int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html#OP_ROT180">OP_ROT180</a></strong></code> +<div class="block">Rotate image 180 degrees.</div> +</td> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>static int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html#OP_ROT270">OP_ROT270</a></strong></code> +<div class="block">Rotate image counter-clockwise by 90 degrees.</div> +</td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><code>static int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html#OP_ROT90">OP_ROT90</a></strong></code> +<div class="block">Rotate image clockwise by 90 degrees.</div> +</td> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>static int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html#OP_TRANSPOSE">OP_TRANSPOSE</a></strong></code> +<div class="block">Transpose image (flip/mirror along upper left to lower right axis).</div> +</td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><code>static int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html#OP_TRANSVERSE">OP_TRANSVERSE</a></strong></code> +<div class="block">Transverse transpose image (flip/mirror along upper right to lower left + axis).</div> +</td> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>static int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html#OP_VFLIP">OP_VFLIP</a></strong></code> +<div class="block">Flip (mirror) image vertically.</div> +</td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><code>static int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html#OPT_COPYNONE">OPT_COPYNONE</a></strong></code> +<div class="block">This option will prevent <a href="../../../org/libjpegturbo/turbojpeg/TJTransformer.html#transform(byte[][],%20org.libjpegturbo.turbojpeg.TJTransform[],%20int)"><code>TJTransformer.transform()</code></a> from copying any extra markers (including EXIF + and ICC profile data) from the source image to the output image.</div> +</td> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>static int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html#OPT_CROP">OPT_CROP</a></strong></code> +<div class="block">This option will enable lossless cropping.</div> +</td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><code>static int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html#OPT_GRAY">OPT_GRAY</a></strong></code> +<div class="block">This option will discard the color data in the input image and produce + a grayscale output image.</div> +</td> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>static int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html#OPT_NOOUTPUT">OPT_NOOUTPUT</a></strong></code> +<div class="block">This option will prevent <a href="../../../org/libjpegturbo/turbojpeg/TJTransformer.html#transform(byte[][],%20org.libjpegturbo.turbojpeg.TJTransform[],%20int)"><code>TJTransformer.transform()</code></a> from outputting a JPEG image for this + particular transform.</div> +</td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><code>static int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html#OPT_PERFECT">OPT_PERFECT</a></strong></code> +<div class="block">This option will cause <a href="../../../org/libjpegturbo/turbojpeg/TJTransformer.html#transform(byte[][],%20org.libjpegturbo.turbojpeg.TJTransform[],%20int)"><code>TJTransformer.transform()</code></a> to throw an exception if the transform is not + perfect.</div> +</td> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>static int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html#OPT_PROGRESSIVE">OPT_PROGRESSIVE</a></strong></code> +<div class="block">This option will enable progressive entropy coding in the output image + generated by this particular transform.</div> +</td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><code>static int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html#OPT_TRIM">OPT_TRIM</a></strong></code> +<div class="block">This option will discard any partial MCU blocks that cannot be + transformed.</div> +</td> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html#options">options</a></strong></code> +<div class="block">Transform options (bitwise OR of one or more of <code>OPT_*</code>)</div> +</td> +</tr> +</table> +<ul class="blockList"> +<li class="blockList"><a name="fields_inherited_from_class_java.awt.Rectangle"> +<!-- --> +</a> +<h3>Fields inherited from class java.awt.Rectangle</h3> +<code>height, width, x, y</code></li> +</ul> +<ul class="blockList"> +<li class="blockList"><a name="fields_inherited_from_class_java.awt.geom.Rectangle2D"> +<!-- --> +</a> +<h3>Fields inherited from class java.awt.geom.Rectangle2D</h3> +<code>OUT_BOTTOM, OUT_LEFT, OUT_RIGHT, OUT_TOP</code></li> +</ul> +</li> +</ul> +<!-- ======== 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/TJTransform.html#TJTransform()">TJTransform</a></strong>()</code> +<div class="block">Create a new lossless transform instance.</div> +</td> +</tr> +<tr class="rowColor"> +<td class="colOne"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html#TJTransform(int,%20int,%20int,%20int,%20int,%20int,%20org.libjpegturbo.turbojpeg.TJCustomFilter)">TJTransform</a></strong>(int x, + int y, + int w, + int h, + int op, + int options, + <a href="../../../org/libjpegturbo/turbojpeg/TJCustomFilter.html" title="interface in org.libjpegturbo.turbojpeg">TJCustomFilter</a> cf)</code> +<div class="block">Create a new lossless transform instance with the given parameters.</div> +</td> +</tr> +<tr class="altColor"> +<td class="colOne"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html#TJTransform(java.awt.Rectangle,%20int,%20int,%20org.libjpegturbo.turbojpeg.TJCustomFilter)">TJTransform</a></strong>(java.awt.Rectangle r, + int op, + int options, + <a href="../../../org/libjpegturbo/turbojpeg/TJCustomFilter.html" title="interface in org.libjpegturbo.turbojpeg">TJCustomFilter</a> cf)</code> +<div class="block">Create a new lossless transform instance with the given parameters.</div> +</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.awt.Rectangle"> +<!-- --> +</a> +<h3>Methods inherited from class java.awt.Rectangle</h3> +<code>add, add, add, contains, contains, contains, contains, createIntersection, createUnion, equals, getBounds, getBounds2D, getHeight, getLocation, getSize, getWidth, getX, getY, grow, inside, intersection, intersects, isEmpty, move, outcode, reshape, resize, setBounds, setBounds, setLocation, setLocation, setRect, setSize, setSize, toString, translate, union</code></li> +</ul> +<ul class="blockList"> +<li class="blockList"><a name="methods_inherited_from_class_java.awt.geom.Rectangle2D"> +<!-- --> +</a> +<h3>Methods inherited from class java.awt.geom.Rectangle2D</h3> +<code>add, add, add, contains, contains, getPathIterator, getPathIterator, hashCode, intersect, intersects, intersectsLine, intersectsLine, outcode, setFrame, setRect, union</code></li> +</ul> +<ul class="blockList"> +<li class="blockList"><a name="methods_inherited_from_class_java.awt.geom.RectangularShape"> +<!-- --> +</a> +<h3>Methods inherited from class java.awt.geom.RectangularShape</h3> +<code>clone, contains, contains, getCenterX, getCenterY, getFrame, getMaxX, getMaxY, getMinX, getMinY, intersects, setFrame, setFrame, setFrameFromCenter, setFrameFromCenter, setFrameFromDiagonal, setFrameFromDiagonal</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>finalize, getClass, notify, notifyAll, wait, wait, wait</code></li> +</ul> +<ul class="blockList"> +<li class="blockList"><a name="methods_inherited_from_class_java.awt.Shape"> +<!-- --> +</a> +<h3>Methods inherited from interface java.awt.Shape</h3> +<code>contains, contains, contains, contains, getPathIterator, getPathIterator, intersects, intersects</code></li> +</ul> +</li> +</ul> +</li> +</ul> +</div> +<div class="details"> +<ul class="blockList"> +<li class="blockList"> +<!-- ============ FIELD DETAIL =========== --> +<ul class="blockList"> +<li class="blockList"><a name="field_detail"> +<!-- --> +</a> +<h3>Field Detail</h3> +<a name="NUMOP"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>NUMOP</h4> +<pre>public static final int NUMOP</pre> +<div class="block">The number of lossless transform operations</div> +<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJTransform.NUMOP">Constant Field Values</a></dd></dl> +</li> +</ul> +<a name="OP_NONE"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>OP_NONE</h4> +<pre>public static final int OP_NONE</pre> +<div class="block">Do not transform the position of the image pixels.</div> +<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJTransform.OP_NONE">Constant Field Values</a></dd></dl> +</li> +</ul> +<a name="OP_HFLIP"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>OP_HFLIP</h4> +<pre>public static final int OP_HFLIP</pre> +<div class="block">Flip (mirror) image horizontally. This transform is imperfect if there + are any partial MCU blocks on the right edge.</div> +<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html#OPT_PERFECT"><code>OPT_PERFECT</code></a>, +<a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJTransform.OP_HFLIP">Constant Field Values</a></dd></dl> +</li> +</ul> +<a name="OP_VFLIP"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>OP_VFLIP</h4> +<pre>public static final int OP_VFLIP</pre> +<div class="block">Flip (mirror) image vertically. This transform is imperfect if there are + any partial MCU blocks on the bottom edge.</div> +<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html#OPT_PERFECT"><code>OPT_PERFECT</code></a>, +<a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJTransform.OP_VFLIP">Constant Field Values</a></dd></dl> +</li> +</ul> +<a name="OP_TRANSPOSE"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>OP_TRANSPOSE</h4> +<pre>public static final int OP_TRANSPOSE</pre> +<div class="block">Transpose image (flip/mirror along upper left to lower right axis). This + transform is always perfect.</div> +<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html#OPT_PERFECT"><code>OPT_PERFECT</code></a>, +<a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJTransform.OP_TRANSPOSE">Constant Field Values</a></dd></dl> +</li> +</ul> +<a name="OP_TRANSVERSE"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>OP_TRANSVERSE</h4> +<pre>public static final int OP_TRANSVERSE</pre> +<div class="block">Transverse transpose image (flip/mirror along upper right to lower left + axis). This transform is imperfect if there are any partial MCU blocks in + the image.</div> +<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html#OPT_PERFECT"><code>OPT_PERFECT</code></a>, +<a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJTransform.OP_TRANSVERSE">Constant Field Values</a></dd></dl> +</li> +</ul> +<a name="OP_ROT90"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>OP_ROT90</h4> +<pre>public static final int OP_ROT90</pre> +<div class="block">Rotate image clockwise by 90 degrees. This transform is imperfect if + there are any partial MCU blocks on the bottom edge.</div> +<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html#OPT_PERFECT"><code>OPT_PERFECT</code></a>, +<a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJTransform.OP_ROT90">Constant Field Values</a></dd></dl> +</li> +</ul> +<a name="OP_ROT180"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>OP_ROT180</h4> +<pre>public static final int OP_ROT180</pre> +<div class="block">Rotate image 180 degrees. This transform is imperfect if there are any + partial MCU blocks in the image.</div> +<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html#OPT_PERFECT"><code>OPT_PERFECT</code></a>, +<a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJTransform.OP_ROT180">Constant Field Values</a></dd></dl> +</li> +</ul> +<a name="OP_ROT270"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>OP_ROT270</h4> +<pre>public static final int OP_ROT270</pre> +<div class="block">Rotate image counter-clockwise by 90 degrees. This transform is imperfect + if there are any partial MCU blocks on the right edge.</div> +<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html#OPT_PERFECT"><code>OPT_PERFECT</code></a>, +<a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJTransform.OP_ROT270">Constant Field Values</a></dd></dl> +</li> +</ul> +<a name="OPT_PERFECT"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>OPT_PERFECT</h4> +<pre>public static final int OPT_PERFECT</pre> +<div class="block">This option will cause <a href="../../../org/libjpegturbo/turbojpeg/TJTransformer.html#transform(byte[][],%20org.libjpegturbo.turbojpeg.TJTransform[],%20int)"><code>TJTransformer.transform()</code></a> to throw an exception if the transform is not + perfect. Lossless transforms operate on MCU blocks, whose size depends on + the level of chrominance subsampling used. If the image's width or height + is not evenly divisible by the MCU block size (see <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#getMCUWidth(int)"><code>TJ.getMCUWidth(int)</code></a> + and <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#getMCUHeight(int)"><code>TJ.getMCUHeight(int)</code></a>), then there will be partial MCU blocks on the + right and/or bottom edges. It is not possible to move these partial MCU + blocks to the top or left of the image, so any transform that would + require that is "imperfect." If this option is not specified, then any + partial MCU blocks that cannot be transformed will be left in place, which + will create odd-looking strips on the right or bottom edge of the image.</div> +<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJTransform.OPT_PERFECT">Constant Field Values</a></dd></dl> +</li> +</ul> +<a name="OPT_TRIM"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>OPT_TRIM</h4> +<pre>public static final int OPT_TRIM</pre> +<div class="block">This option will discard any partial MCU blocks that cannot be + transformed.</div> +<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJTransform.OPT_TRIM">Constant Field Values</a></dd></dl> +</li> +</ul> +<a name="OPT_CROP"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>OPT_CROP</h4> +<pre>public static final int OPT_CROP</pre> +<div class="block">This option will enable lossless cropping.</div> +<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJTransform.OPT_CROP">Constant Field Values</a></dd></dl> +</li> +</ul> +<a name="OPT_GRAY"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>OPT_GRAY</h4> +<pre>public static final int OPT_GRAY</pre> +<div class="block">This option will discard the color data in the input image and produce + a grayscale output image.</div> +<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJTransform.OPT_GRAY">Constant Field Values</a></dd></dl> +</li> +</ul> +<a name="OPT_NOOUTPUT"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>OPT_NOOUTPUT</h4> +<pre>public static final int OPT_NOOUTPUT</pre> +<div class="block">This option will prevent <a href="../../../org/libjpegturbo/turbojpeg/TJTransformer.html#transform(byte[][],%20org.libjpegturbo.turbojpeg.TJTransform[],%20int)"><code>TJTransformer.transform()</code></a> from outputting a JPEG image for this + particular transform. This can be used in conjunction with a custom + filter to capture the transformed DCT coefficients without transcoding + them.</div> +<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJTransform.OPT_NOOUTPUT">Constant Field Values</a></dd></dl> +</li> +</ul> +<a name="OPT_PROGRESSIVE"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>OPT_PROGRESSIVE</h4> +<pre>public static final int OPT_PROGRESSIVE</pre> +<div class="block">This option will enable progressive entropy coding in the output image + generated by this particular transform. Progressive entropy coding will + generally improve compression relative to baseline entropy coding (the + default), but it will reduce compression and decompression performance + considerably.</div> +<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJTransform.OPT_PROGRESSIVE">Constant Field Values</a></dd></dl> +</li> +</ul> +<a name="OPT_COPYNONE"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>OPT_COPYNONE</h4> +<pre>public static final int OPT_COPYNONE</pre> +<div class="block">This option will prevent <a href="../../../org/libjpegturbo/turbojpeg/TJTransformer.html#transform(byte[][],%20org.libjpegturbo.turbojpeg.TJTransform[],%20int)"><code>TJTransformer.transform()</code></a> from copying any extra markers (including EXIF + and ICC profile data) from the source image to the output image.</div> +<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJTransform.OPT_COPYNONE">Constant Field Values</a></dd></dl> +</li> +</ul> +<a name="op"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>op</h4> +<pre>public int op</pre> +<div class="block">Transform operation (one of <code>OP_*</code>)</div> +</li> +</ul> +<a name="options"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>options</h4> +<pre>public int options</pre> +<div class="block">Transform options (bitwise OR of one or more of <code>OPT_*</code>)</div> +</li> +</ul> +<a name="cf"> +<!-- --> +</a> +<ul class="blockListLast"> +<li class="blockList"> +<h4>cf</h4> +<pre>public <a href="../../../org/libjpegturbo/turbojpeg/TJCustomFilter.html" title="interface in org.libjpegturbo.turbojpeg">TJCustomFilter</a> cf</pre> +<div class="block">Custom filter instance</div> +</li> +</ul> +</li> +</ul> +<!-- ========= CONSTRUCTOR DETAIL ======== --> +<ul class="blockList"> +<li class="blockList"><a name="constructor_detail"> +<!-- --> +</a> +<h3>Constructor Detail</h3> +<a name="TJTransform()"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>TJTransform</h4> +<pre>public TJTransform()</pre> +<div class="block">Create a new lossless transform instance.</div> +</li> +</ul> +<a name="TJTransform(int, int, int, int, int, int, org.libjpegturbo.turbojpeg.TJCustomFilter)"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>TJTransform</h4> +<pre>public TJTransform(int x, + int y, + int w, + int h, + int op, + int options, + <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 + divisible by the MCU block height (see <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#getMCUHeight(int)"><code>TJ.getMCUHeight(int)</code></a>)</dd><dd><code>w</code> - the width of the cropping region. Setting this to 0 is the + equivalent of setting it to (width of the source JPEG image - + <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></dl> +</li> +</ul> +<a name="TJTransform(java.awt.Rectangle, int, int, org.libjpegturbo.turbojpeg.TJCustomFilter)"> +<!-- --> +</a> +<ul class="blockListLast"> +<li class="blockList"> +<h4>TJTransform</h4> +<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)</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></dl> +</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/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">Prev Class</span></a></li> +<li><a href="../../../org/libjpegturbo/turbojpeg/TJTransformer.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/TJTransform.html" target="_top">Frames</a></li> +<li><a href="TJTransform.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><a href="#nested_classes_inherited_from_class_java.awt.geom.Rectangle2D">Nested</a> | </li> +<li><a href="#field_summary">Field</a> | </li> +<li><a href="#constructor_summary">Constr</a> | </li> +<li><a href="#methods_inherited_from_class_java.awt.Rectangle">Method</a></li> +</ul> +<ul class="subNavList"> +<li>Detail: </li> +<li><a href="#field_detail">Field</a> | </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>
diff --git a/src/third_party/libjpeg-turbo/java/doc/org/libjpegturbo/turbojpeg/TJTransformer.html b/src/third_party/libjpeg-turbo/java/doc/org/libjpegturbo/turbojpeg/TJTransformer.html new file mode 100644 index 0000000..a30fe30 --- /dev/null +++ b/src/third_party/libjpeg-turbo/java/doc/org/libjpegturbo/turbojpeg/TJTransformer.html
@@ -0,0 +1,421 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!-- NewPage --> +<html lang="en"> +<head> +<title>TJTransformer</title> +<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style"> +</head> +<body> +<script type="text/javascript"><!-- + try { + if (location.href.indexOf('is-external=true') == -1) { + parent.document.title="TJTransformer"; + } + } + catch(err) { + } +//--> +</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/TJTransform.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">Prev Class</span></a></li> +<li><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.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/TJTransformer.html" target="_top">Frames</a></li> +<li><a href="TJTransformer.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><a href="#fields_inherited_from_class_org.libjpegturbo.turbojpeg.TJDecompressor">Field</a> | </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 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 TJTransformer" class="title">Class TJTransformer</h2> +</div> +<div class="contentContainer"> +<ul class="inheritance"> +<li>java.lang.Object</li> +<li> +<ul class="inheritance"> +<li><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">org.libjpegturbo.turbojpeg.TJDecompressor</a></li> +<li> +<ul class="inheritance"> +<li>org.libjpegturbo.turbojpeg.TJTransformer</li> +</ul> +</li> +</ul> +</li> +</ul> +<div class="description"> +<ul class="blockList"> +<li class="blockList"> +<dl> +<dt>All Implemented Interfaces:</dt> +<dd>java.io.Closeable, java.lang.AutoCloseable</dd> +</dl> +<hr> +<br> +<pre>public class <span class="strong">TJTransformer</span> +extends <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></pre> +<div class="block">TurboJPEG lossless transformer</div> +</li> +</ul> +</div> +<div class="summary"> +<ul class="blockList"> +<li class="blockList"> +<!-- =========== FIELD SUMMARY =========== --> +<ul class="blockList"> +<li class="blockList"><a name="field_summary"> +<!-- --> +</a> +<h3>Field Summary</h3> +<ul class="blockList"> +<li class="blockList"><a name="fields_inherited_from_class_org.libjpegturbo.turbojpeg.TJDecompressor"> +<!-- --> +</a> +<h3>Fields inherited from class org.libjpegturbo.turbojpeg.<a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></h3> +<code><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#handle">handle</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegBuf">jpegBuf</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegBufSize">jpegBufSize</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegColorspace">jpegColorspace</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegHeight">jpegHeight</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegSubsamp">jpegSubsamp</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegWidth">jpegWidth</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#yuvImage">yuvImage</a></code></li> +</ul> +</li> +</ul> +<!-- ======== 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/TJTransformer.html#TJTransformer()">TJTransformer</a></strong>()</code> +<div class="block">Create a TurboJPEG lossless transformer instance.</div> +</td> +</tr> +<tr class="rowColor"> +<td class="colOne"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJTransformer.html#TJTransformer(byte[])">TJTransformer</a></strong>(byte[] jpegImage)</code> +<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> +</td> +</tr> +<tr class="altColor"> +<td class="colOne"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJTransformer.html#TJTransformer(byte[],%20int)">TJTransformer</a></strong>(byte[] jpegImage, + int imageSize)</code> +<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> +</td> +</tr> +</table> +</li> +</ul> +<!-- ========== METHOD SUMMARY =========== --> +<ul class="blockList"> +<li class="blockList"><a name="method_summary"> +<!-- --> +</a> +<h3>Method Summary</h3> +<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> +<caption><span>Methods</span><span class="tabEnd"> </span></caption> +<tr> +<th class="colFirst" scope="col">Modifier and Type</th> +<th class="colLast" scope="col">Method and Description</th> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>int[]</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJTransformer.html#getTransformedSizes()">getTransformedSizes</a></strong>()</code> +<div class="block">Returns an array containing the sizes of the transformed JPEG images + generated by the most recent transform operation.</div> +</td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><code>void</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJTransformer.html#transform(byte[][],%20org.libjpegturbo.turbojpeg.TJTransform[],%20int)">transform</a></strong>(byte[][] dstBufs, + <a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</a>[] transforms, + int flags)</code> +<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.</div> +</td> +</tr> +<tr class="altColor"> +<td class="colFirst"><code><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a>[]</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJTransformer.html#transform(org.libjpegturbo.turbojpeg.TJTransform[],%20int)">transform</a></strong>(<a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</a>[] transforms, + int flags)</code> +<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> +</td> +</tr> +</table> +<ul class="blockList"> +<li class="blockList"><a name="methods_inherited_from_class_org.libjpegturbo.turbojpeg.TJDecompressor"> +<!-- --> +</a> +<h3>Methods inherited from class org.libjpegturbo.turbojpeg.<a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></h3> +<code><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#close()">close</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(java.awt.image.BufferedImage,%20int)">decompress</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[],%20int,%20int,%20int,%20int,%20int)">decompress</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[],%20int,%20int,%20int,%20int,%20int,%20int,%20int)">decompress</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(int[],%20int,%20int,%20int,%20int,%20int,%20int,%20int)">decompress</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(int,%20int,%20int,%20int)">decompress</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(int,%20int,%20int,%20int,%20int)">decompress</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(byte[],%20int)">decompressToYUV</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(int)">decompressToYUV</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(int,%20int[],%20int,%20int)">decompressToYUV</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(int,%20int,%20int,%20int)">decompressToYUV</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(org.libjpegturbo.turbojpeg.YUVImage,%20int)">decompressToYUV</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#finalize()">finalize</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getColorspace()">getColorspace</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getHeight()">getHeight</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getJPEGBuf()">getJPEGBuf</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getJPEGSize()">getJPEGSize</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getScaledHeight(int,%20int)">getScaledHeight</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getScaledWidth(int,%20int)">getScaledWidth</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getSubsamp()">getSubsamp</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getWidth()">getWidth</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#setJPEGImage(byte[],%20int)">setJPEGImage</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#setSourceImage(byte[],%20int)">setSourceImage</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#setSourceImage(org.libjpegturbo.turbojpeg.YUVImage)">setSourceImage</a></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, getClass, hashCode, notify, notifyAll, toString, 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="TJTransformer()"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>TJTransformer</h4> +<pre>public TJTransformer() + 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><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl> +</li> +</ul> +<a name="TJTransformer(byte[])"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>TJTransformer</h4> +<pre>public TJTransformer(byte[] jpegImage) + 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><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)"> +<!-- --> +</a> +<ul class="blockListLast"> +<li class="blockList"> +<h4>TJTransformer</h4> +<pre>public TJTransformer(byte[] jpegImage, + int imageSize) + 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><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl> +</li> +</ul> +</li> +</ul> +<!-- ============ METHOD DETAIL ========== --> +<ul class="blockList"> +<li class="blockList"><a name="method_detail"> +<!-- --> +</a> +<h3>Method Detail</h3> +<a name="transform(byte[][], org.libjpegturbo.turbojpeg.TJTransform[], int)"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>transform</h4> +<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 <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 + JPEG image structure to another without altering the values of the + coefficients. While this is typically faster than decompressing the + image, transforming it, and re-compressing it, lossless transforms are not + free. Each lossless transform requires reading and performing Huffman + decoding on all of the coefficients in the source image, regardless of the + size of the destination image. Thus, this method provides a means of + generating multiple transformed images from the same source or of applying + multiple transformations simultaneously, in order to eliminate the need to + read the source coefficients multiple times.</div> +<dl><dt><span class="strong">Parameters:</span></dt><dd><code>dstBufs</code> - an array of image buffers. <code>dstbufs[i]</code> will + receive a JPEG image that has been transformed using the parameters in + <code>transforms[i]</code>. Use <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#bufSize(int,%20int,%20int)"><code>TJ.bufSize(int, int, int)</code></a> to determine the + maximum size for each buffer based on the transformed or cropped width and + height and the level of subsampling used in the source image.</dd><dd><code>transforms</code> - an array of <a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg"><code>TJTransform</code></a> instances, each of + which specifies the transform parameters and/or cropping region for the + corresponding transformed output image</dd><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><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)"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<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 <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> +<dl><dt><span class="strong">Parameters:</span></dt><dd><code>transforms</code> - an array of <a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg"><code>TJTransform</code></a> instances, each of + which specifies the transform parameters and/or cropping region for the + corresponding transformed output image</dd><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">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><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl> +</li> +</ul> +<a name="getTransformedSizes()"> +<!-- --> +</a> +<ul class="blockListLast"> +<li class="blockList"> +<h4>getTransformedSizes</h4> +<pre>public int[] getTransformedSizes()</pre> +<div class="block">Returns an array containing the sizes of the transformed JPEG images + generated by the most recent transform operation.</div> +<dl><dt><span class="strong">Returns:</span></dt><dd>an array containing the sizes of the transformed JPEG images + generated by the most recent transform operation.</dd></dl> +</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/TJTransform.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">Prev Class</span></a></li> +<li><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.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/TJTransformer.html" target="_top">Frames</a></li> +<li><a href="TJTransformer.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><a href="#fields_inherited_from_class_org.libjpegturbo.turbojpeg.TJDecompressor">Field</a> | </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 name="skip-navbar_bottom"> +<!-- --> +</a></div> +<!-- ======== END OF BOTTOM NAVBAR ======= --> +</body> +</html>
diff --git a/src/third_party/libjpeg-turbo/java/doc/org/libjpegturbo/turbojpeg/YUVImage.html b/src/third_party/libjpeg-turbo/java/doc/org/libjpegturbo/turbojpeg/YUVImage.html new file mode 100644 index 0000000..d4485ed --- /dev/null +++ b/src/third_party/libjpeg-turbo/java/doc/org/libjpegturbo/turbojpeg/YUVImage.html
@@ -0,0 +1,765 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!-- NewPage --> +<html lang="en"> +<head> +<title>YUVImage</title> +<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style"> +</head> +<body> +<script type="text/javascript"><!-- + try { + if (location.href.indexOf('is-external=true') == -1) { + parent.document.title="YUVImage"; + } + } + catch(err) { + } +//--> +</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/TJTransformer.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">Prev Class</span></a></li> +<li>Next Class</li> +</ul> +<ul class="navList"> +<li><a href="../../../index.html?org/libjpegturbo/turbojpeg/YUVImage.html" target="_top">Frames</a></li> +<li><a href="YUVImage.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><a href="#field_summary">Field</a> | </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><a href="#field_detail">Field</a> | </li> +<li><a href="#constructor_detail">Constr</a> | </li> +<li><a href="#method_detail">Method</a></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 YUVImage" class="title">Class YUVImage</h2> +</div> +<div class="contentContainer"> +<ul class="inheritance"> +<li>java.lang.Object</li> +<li> +<ul class="inheritance"> +<li>org.libjpegturbo.turbojpeg.YUVImage</li> +</ul> +</li> +</ul> +<div class="description"> +<ul class="blockList"> +<li class="blockList"> +<hr> +<br> +<pre>public class <span class="strong">YUVImage</span> +extends java.lang.Object</pre> +<div class="block">This class encapsulates a YUV planar image and the metadata + associated with it. The TurboJPEG API allows both the JPEG compression and + decompression pipelines to be split into stages: YUV encode, compress from + YUV, decompress to YUV, and YUV decode. A <code>YUVImage</code> instance + serves as the destination image for YUV encode and decompress-to-YUV + operations and as the source image for compress-from-YUV and YUV decode + operations. + <p> + Technically, the JPEG format uses the YCbCr colorspace (which technically is + not a "colorspace" but rather a "color transform"), but per the convention + of the digital video community, the TurboJPEG API uses "YUV" to refer to an + image format consisting of Y, Cb, and Cr image planes. + <p> + Each plane is simply a 2D array of bytes, each byte representing the value + of one of the components (Y, Cb, or Cr) at a particular location in the + image. The width and height of each plane are determined by the image + width, height, and level of chrominance subsampling. The luminance plane + width is the image width padded to the nearest multiple of the horizontal + subsampling factor (2 in the case of 4:2:0 and 4:2:2, 4 in the case of + 4:1:1, 1 in the case of 4:4:4 or grayscale.) Similarly, the luminance plane + height is the image height padded to the nearest multiple of the vertical + subsampling factor (2 in the case of 4:2:0 or 4:4:0, 1 in the case of 4:4:4 + or grayscale.) The chrominance plane width is equal to the luminance plane + width divided by the horizontal subsampling factor, and the chrominance + plane height is equal to the luminance plane height divided by the vertical + subsampling factor. + <p> + For example, if the source image is 35 x 35 pixels and 4:2:2 subsampling is + used, then the luminance plane would be 36 x 35 bytes, and each of the + chrominance planes would be 18 x 35 bytes. If you specify a line padding of + 4 bytes on top of this, then the luminance plane would be 36 x 35 bytes, and + each of the chrominance planes would be 20 x 35 bytes.</div> +</li> +</ul> +</div> +<div class="summary"> +<ul class="blockList"> +<li class="blockList"> +<!-- =========== FIELD SUMMARY =========== --> +<ul class="blockList"> +<li class="blockList"><a name="field_summary"> +<!-- --> +</a> +<h3>Field Summary</h3> +<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation"> +<caption><span>Fields</span><span class="tabEnd"> </span></caption> +<tr> +<th class="colFirst" scope="col">Modifier and Type</th> +<th class="colLast" scope="col">Field and Description</th> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>protected long</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html#handle">handle</a></strong></code> </td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><code>protected int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html#yuvHeight">yuvHeight</a></strong></code> </td> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>protected int[]</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html#yuvOffsets">yuvOffsets</a></strong></code> </td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><code>protected int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html#yuvPad">yuvPad</a></strong></code> </td> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>protected byte[][]</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html#yuvPlanes">yuvPlanes</a></strong></code> </td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><code>protected int[]</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html#yuvStrides">yuvStrides</a></strong></code> </td> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>protected int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html#yuvSubsamp">yuvSubsamp</a></strong></code> </td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><code>protected int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html#yuvWidth">yuvWidth</a></strong></code> </td> +</tr> +</table> +</li> +</ul> +<!-- ======== 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/YUVImage.html#YUVImage(byte[][],%20int[],%20int,%20int[],%20int,%20int)">YUVImage</a></strong>(byte[][] planes, + int[] offsets, + int width, + int[] strides, + int height, + int subsamp)</code> +<div class="block">Create a new <code>YUVImage</code> instance from a set of existing image + planes.</div> +</td> +</tr> +<tr class="rowColor"> +<td class="colOne"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html#YUVImage(byte[],%20int,%20int,%20int,%20int)">YUVImage</a></strong>(byte[] yuvImage, + int width, + int pad, + int height, + int subsamp)</code> +<div class="block">Create a new <code>YUVImage</code> instance from an existing unified image + buffer.</div> +</td> +</tr> +<tr class="altColor"> +<td class="colOne"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html#YUVImage(int,%20int[],%20int,%20int)">YUVImage</a></strong>(int width, + int[] strides, + int height, + int subsamp)</code> +<div class="block">Create a new <code>YUVImage</code> instance backed by separate image + planes, and allocate memory for the image planes.</div> +</td> +</tr> +<tr class="rowColor"> +<td class="colOne"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html#YUVImage(int,%20int,%20int,%20int)">YUVImage</a></strong>(int width, + int pad, + int height, + int subsamp)</code> +<div class="block">Create a new <code>YUVImage</code> instance backed by a unified image + buffer, and allocate memory for the image buffer.</div> +</td> +</tr> +</table> +</li> +</ul> +<!-- ========== METHOD SUMMARY =========== --> +<ul class="blockList"> +<li class="blockList"><a name="method_summary"> +<!-- --> +</a> +<h3>Method Summary</h3> +<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> +<caption><span>Methods</span><span class="tabEnd"> </span></caption> +<tr> +<th class="colFirst" scope="col">Modifier and Type</th> +<th class="colLast" scope="col">Method and Description</th> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>byte[]</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html#getBuf()">getBuf</a></strong>()</code> +<div class="block">Returns the YUV image buffer (if this image is stored in a unified + buffer rather than separate image planes.)</div> +</td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><code>int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html#getHeight()">getHeight</a></strong>()</code> +<div class="block">Returns the height of the YUV image (or subregion.)</div> +</td> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>int[]</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html#getOffsets()">getOffsets</a></strong>()</code> +<div class="block">Returns the offsets (in bytes) of each plane within the planes of a larger + YUV image.</div> +</td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><code>int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html#getPad()">getPad</a></strong>()</code> +<div class="block">Returns the line padding used in the YUV image buffer (if this image is + stored in a unified buffer rather than separate image planes.)</div> +</td> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>byte[][]</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html#getPlanes()">getPlanes</a></strong>()</code> +<div class="block">Returns the YUV image planes.</div> +</td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><code>int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html#getSize()">getSize</a></strong>()</code> +<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> +</td> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>int[]</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html#getStrides()">getStrides</a></strong>()</code> +<div class="block">Returns the number of bytes per line of each plane in the YUV image.</div> +</td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><code>int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html#getSubsamp()">getSubsamp</a></strong>()</code> +<div class="block">Returns the level of chrominance subsampling used in the YUV image.</div> +</td> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>int</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html#getWidth()">getWidth</a></strong>()</code> +<div class="block">Returns the width of the YUV image (or subregion.)</div> +</td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><code>void</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html#setBuf(byte[][],%20int[],%20int,%20int[],%20int,%20int)">setBuf</a></strong>(byte[][] planes, + int[] offsets, + int width, + int[] strides, + int height, + int subsamp)</code> +<div class="block">Assign a set of image planes to this <code>YUVImage</code> instance.</div> +</td> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>void</code></td> +<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html#setBuf(byte[],%20int,%20int,%20int,%20int)">setBuf</a></strong>(byte[] yuvImage, + int width, + int pad, + int height, + int subsamp)</code> +<div class="block">Assign a unified image buffer to this <code>YUVImage</code> instance.</div> +</td> +</tr> +</table> +<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, toString, wait, wait, wait</code></li> +</ul> +</li> +</ul> +</li> +</ul> +</div> +<div class="details"> +<ul class="blockList"> +<li class="blockList"> +<!-- ============ FIELD DETAIL =========== --> +<ul class="blockList"> +<li class="blockList"><a name="field_detail"> +<!-- --> +</a> +<h3>Field Detail</h3> +<a name="handle"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>handle</h4> +<pre>protected long handle</pre> +</li> +</ul> +<a name="yuvPlanes"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>yuvPlanes</h4> +<pre>protected byte[][] yuvPlanes</pre> +</li> +</ul> +<a name="yuvOffsets"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>yuvOffsets</h4> +<pre>protected int[] yuvOffsets</pre> +</li> +</ul> +<a name="yuvStrides"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>yuvStrides</h4> +<pre>protected int[] yuvStrides</pre> +</li> +</ul> +<a name="yuvPad"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>yuvPad</h4> +<pre>protected int yuvPad</pre> +</li> +</ul> +<a name="yuvWidth"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>yuvWidth</h4> +<pre>protected int yuvWidth</pre> +</li> +</ul> +<a name="yuvHeight"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>yuvHeight</h4> +<pre>protected int yuvHeight</pre> +</li> +</ul> +<a name="yuvSubsamp"> +<!-- --> +</a> +<ul class="blockListLast"> +<li class="blockList"> +<h4>yuvSubsamp</h4> +<pre>protected int yuvSubsamp</pre> +</li> +</ul> +</li> +</ul> +<!-- ========= CONSTRUCTOR DETAIL ======== --> +<ul class="blockList"> +<li class="blockList"><a name="constructor_detail"> +<!-- --> +</a> +<h3>Constructor Detail</h3> +<a name="YUVImage(int, int[], int, int)"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>YUVImage</h4> +<pre>public YUVImage(int width, + int[] strides, + int height, + 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 + per line in the corresponding plane of the YUV image. Setting the stride + for any plane to 0 is the same as setting it to the plane width (see + <a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg"><code>above</code></a>.) If <code>strides</code> is null, then the + 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></dl> +</li> +</ul> +<a name="YUVImage(int, int, int, int)"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>YUVImage</h4> +<pre>public YUVImage(int width, + int pad, + int height, + 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></dl> +</li> +</ul> +<a name="YUVImage(byte[][], int[], int, int[], int, int)"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>YUVImage</h4> +<pre>public YUVImage(byte[][] planes, + int[] offsets, + int width, + int[] strides, + int height, + 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) + image planes (or just the Y plane, if the image is grayscale.) These + planes can be contiguous or non-contiguous in memory. Plane + <code>i</code> should be at least <code>offsets[i] + + <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#planeSizeYUV(int,%20int,%20int,%20int,%20int)"><code>TJ.planeSizeYUV</code></a>(i, width, strides[i], height, subsamp)</code> + bytes in size.</dd><dd><code>offsets</code> - If this <code>YUVImage</code> instance represents a + subregion of a larger image, then <code>offsets[i]</code> specifies the + offset (in bytes) of the subregion within plane <code>i</code> of the + larger image. Setting this to null is the same as setting the offsets for + all planes to 0.</dd><dd><code>width</code> - width (in pixels) of the new YUV image (or subregion)</dd><dd><code>strides</code> - an array of integers, each specifying the number of bytes + per line in the corresponding plane of the YUV image. Setting the stride + for any plane to 0 is the same as setting it to the plane width (see + <a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg"><code>above</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 line padding + 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></dl> +</li> +</ul> +<a name="YUVImage(byte[], int, int, int, int)"> +<!-- --> +</a> +<ul class="blockListLast"> +<li class="blockList"> +<h4>YUVImage</h4> +<pre>public YUVImage(byte[] yuvImage, + int width, + int pad, + int height, + 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 + 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 + this buffer. The Y, U (Cb), and V (Cr) image planes are stored + sequentially in the buffer (see <a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg"><code>above</code></a> for a description + 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></dl> +</li> +</ul> +</li> +</ul> +<!-- ============ METHOD DETAIL ========== --> +<ul class="blockList"> +<li class="blockList"><a name="method_detail"> +<!-- --> +</a> +<h3>Method Detail</h3> +<a name="setBuf(byte[][], int[], int, int[], int, int)"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>setBuf</h4> +<pre>public void setBuf(byte[][] planes, + int[] offsets, + int width, + int[] strides, + int height, + 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 + planes can be contiguous or non-contiguous in memory. Plane + <code>i</code> should be at least <code>offsets[i] + + <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#planeSizeYUV(int,%20int,%20int,%20int,%20int)"><code>TJ.planeSizeYUV</code></a>(i, width, strides[i], height, subsamp)</code> + bytes in size.</dd><dd><code>offsets</code> - If this <code>YUVImage</code> instance represents a + subregion of a larger image, then <code>offsets[i]</code> specifies the + offset (in bytes) of the subregion within plane <code>i</code> of the + larger image. Setting this to null is the same as setting the offsets for + all planes to 0.</dd><dd><code>width</code> - width (in pixels) of the YUV image (or subregion)</dd><dd><code>strides</code> - an array of integers, each specifying the number of bytes + per line in the corresponding plane of the YUV image. Setting the stride + for any plane to 0 is the same as setting it to the plane width (see + <a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg"><code>above</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 line padding + 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></dl> +</li> +</ul> +<a name="setBuf(byte[], int, int, int, int)"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>setBuf</h4> +<pre>public void setBuf(byte[] yuvImage, + int width, + int pad, + int height, + 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 + this buffer. The Y, U (Cb), and V (Cr) image planes are stored + sequentially in the buffer (see <a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg"><code>above</code></a> for a description + 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></dl> +</li> +</ul> +<a name="getWidth()"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>getWidth</h4> +<pre>public int getWidth()</pre> +<div class="block">Returns the width of the YUV image (or subregion.)</div> +<dl><dt><span class="strong">Returns:</span></dt><dd>the width of the YUV image (or subregion)</dd></dl> +</li> +</ul> +<a name="getHeight()"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>getHeight</h4> +<pre>public int getHeight()</pre> +<div class="block">Returns the height of the YUV image (or subregion.)</div> +<dl><dt><span class="strong">Returns:</span></dt><dd>the height of the YUV image (or subregion)</dd></dl> +</li> +</ul> +<a name="getPad()"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>getPad</h4> +<pre>public int getPad()</pre> +<div class="block">Returns the line padding used in 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 line padding used in the YUV image buffer</dd></dl> +</li> +</ul> +<a name="getStrides()"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>getStrides</h4> +<pre>public int[] getStrides()</pre> +<div class="block">Returns the number of bytes per line of each plane in the YUV image.</div> +<dl><dt><span class="strong">Returns:</span></dt><dd>the number of bytes per line of each plane in the YUV image</dd></dl> +</li> +</ul> +<a name="getOffsets()"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>getOffsets</h4> +<pre>public int[] getOffsets()</pre> +<div class="block">Returns the offsets (in bytes) of each plane within the planes of a larger + YUV image.</div> +<dl><dt><span class="strong">Returns:</span></dt><dd>the offsets (in bytes) of each plane within the planes of a larger + YUV image</dd></dl> +</li> +</ul> +<a name="getSubsamp()"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>getSubsamp</h4> +<pre>public int getSubsamp()</pre> +<div class="block">Returns the level of chrominance subsampling used in the YUV image. See + <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#SAMP_444"><code>TJ.SAMP_*</code></a>.</div> +<dl><dt><span class="strong">Returns:</span></dt><dd>the level of chrominance subsampling used in the YUV image</dd></dl> +</li> +</ul> +<a name="getPlanes()"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>getPlanes</h4> +<pre>public byte[][] getPlanes()</pre> +<div class="block">Returns the YUV image planes. If the image is stored in a unified buffer, + then all image planes will point to that buffer.</div> +<dl><dt><span class="strong">Returns:</span></dt><dd>the YUV image planes</dd></dl> +</li> +</ul> +<a name="getBuf()"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>getBuf</h4> +<pre>public byte[] getBuf()</pre> +<div class="block">Returns 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 YUV image buffer</dd></dl> +</li> +</ul> +<a name="getSize()"> +<!-- --> +</a> +<ul class="blockListLast"> +<li class="blockList"> +<h4>getSize</h4> +<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></dl> +</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/TJTransformer.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">Prev Class</span></a></li> +<li>Next Class</li> +</ul> +<ul class="navList"> +<li><a href="../../../index.html?org/libjpegturbo/turbojpeg/YUVImage.html" target="_top">Frames</a></li> +<li><a href="YUVImage.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><a href="#field_summary">Field</a> | </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><a href="#field_detail">Field</a> | </li> +<li><a href="#constructor_detail">Constr</a> | </li> +<li><a href="#method_detail">Method</a></li> +</ul> +</div> +<a name="skip-navbar_bottom"> +<!-- --> +</a></div> +<!-- ======== END OF BOTTOM NAVBAR ======= --> +</body> +</html>
diff --git a/src/third_party/libjpeg-turbo/java/doc/org/libjpegturbo/turbojpeg/package-frame.html b/src/third_party/libjpeg-turbo/java/doc/org/libjpegturbo/turbojpeg/package-frame.html new file mode 100644 index 0000000..08a8bf8 --- /dev/null +++ b/src/third_party/libjpeg-turbo/java/doc/org/libjpegturbo/turbojpeg/package-frame.html
@@ -0,0 +1,31 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!-- NewPage --> +<html lang="en"> +<head> +<title>org.libjpegturbo.turbojpeg</title> +<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style"> +</head> +<body> +<h1 class="bar"><a href="../../../org/libjpegturbo/turbojpeg/package-summary.html" target="classFrame">org.libjpegturbo.turbojpeg</a></h1> +<div class="indexContainer"> +<h2 title="Interfaces">Interfaces</h2> +<ul title="Interfaces"> +<li><a href="TJCustomFilter.html" title="interface in org.libjpegturbo.turbojpeg" target="classFrame"><i>TJCustomFilter</i></a></li> +</ul> +<h2 title="Classes">Classes</h2> +<ul title="Classes"> +<li><a href="TJ.html" title="class in org.libjpegturbo.turbojpeg" target="classFrame">TJ</a></li> +<li><a href="TJCompressor.html" title="class in org.libjpegturbo.turbojpeg" target="classFrame">TJCompressor</a></li> +<li><a href="TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg" target="classFrame">TJDecompressor</a></li> +<li><a href="TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg" target="classFrame">TJScalingFactor</a></li> +<li><a href="TJTransform.html" title="class in org.libjpegturbo.turbojpeg" target="classFrame">TJTransform</a></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>
diff --git a/src/third_party/libjpeg-turbo/java/doc/org/libjpegturbo/turbojpeg/package-summary.html b/src/third_party/libjpeg-turbo/java/doc/org/libjpegturbo/turbojpeg/package-summary.html new file mode 100644 index 0000000..dedcce5 --- /dev/null +++ b/src/third_party/libjpeg-turbo/java/doc/org/libjpegturbo/turbojpeg/package-summary.html
@@ -0,0 +1,202 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!-- NewPage --> +<html lang="en"> +<head> +<title>org.libjpegturbo.turbojpeg</title> +<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style"> +</head> +<body> +<script type="text/javascript"><!-- + try { + if (location.href.indexOf('is-external=true') == -1) { + parent.document.title="org.libjpegturbo.turbojpeg"; + } + } + catch(err) { + } +//--> +</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</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>Prev Package</li> +<li>Next Package</li> +</ul> +<ul class="navList"> +<li><a href="../../../index.html?org/libjpegturbo/turbojpeg/package-summary.html" target="_top">Frames</a></li> +<li><a href="package-summary.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> +<a name="skip-navbar_top"> +<!-- --> +</a></div> +<!-- ========= END OF TOP NAVBAR ========= --> +<div class="header"> +<h1 title="Package" class="title">Package org.libjpegturbo.turbojpeg</h1> +</div> +<div class="contentContainer"> +<ul class="blockList"> +<li class="blockList"> +<table class="packageSummary" border="0" cellpadding="3" cellspacing="0" summary="Interface Summary table, listing interfaces, and an explanation"> +<caption><span>Interface Summary</span><span class="tabEnd"> </span></caption> +<tr> +<th class="colFirst" scope="col">Interface</th> +<th class="colLast" scope="col">Description</th> +</tr> +<tbody> +<tr class="altColor"> +<td class="colFirst"><a href="../../../org/libjpegturbo/turbojpeg/TJCustomFilter.html" title="interface in org.libjpegturbo.turbojpeg">TJCustomFilter</a></td> +<td class="colLast"> +<div class="block">Custom filter callback interface</div> +</td> +</tr> +</tbody> +</table> +</li> +<li class="blockList"> +<table class="packageSummary" border="0" cellpadding="3" cellspacing="0" summary="Class Summary table, listing classes, and an explanation"> +<caption><span>Class Summary</span><span class="tabEnd"> </span></caption> +<tr> +<th class="colFirst" scope="col">Class</th> +<th class="colLast" scope="col">Description</th> +</tr> +<tbody> +<tr class="altColor"> +<td class="colFirst"><a href="../../../org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></td> +<td class="colLast"> +<div class="block">TurboJPEG utility class (cannot be instantiated)</div> +</td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</a></td> +<td class="colLast"> +<div class="block">TurboJPEG compressor</div> +</td> +</tr> +<tr class="altColor"> +<td class="colFirst"><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></td> +<td class="colLast"> +<div class="block">TurboJPEG decompressor</div> +</td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><a href="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg">TJScalingFactor</a></td> +<td class="colLast"> +<div class="block">Fractional scaling factor</div> +</td> +</tr> +<tr class="altColor"> +<td class="colFirst"><a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</a></td> +<td class="colLast"> +<div class="block">Lossless transform parameters</div> +</td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><a href="../../../org/libjpegturbo/turbojpeg/TJTransformer.html" title="class in org.libjpegturbo.turbojpeg">TJTransformer</a></td> +<td class="colLast"> +<div class="block">TurboJPEG lossless transformer</div> +</td> +</tr> +<tr class="altColor"> +<td class="colFirst"><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a></td> +<td class="colLast"> +<div class="block">This class encapsulates a YUV planar image and the metadata + associated with it.</div> +</td> +</tr> +</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 ====== --> +<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</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>Prev Package</li> +<li>Next Package</li> +</ul> +<ul class="navList"> +<li><a href="../../../index.html?org/libjpegturbo/turbojpeg/package-summary.html" target="_top">Frames</a></li> +<li><a href="package-summary.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> +<a name="skip-navbar_bottom"> +<!-- --> +</a></div> +<!-- ======== END OF BOTTOM NAVBAR ======= --> +</body> +</html>
diff --git a/src/third_party/libjpeg-turbo/java/doc/org/libjpegturbo/turbojpeg/package-tree.html b/src/third_party/libjpeg-turbo/java/doc/org/libjpegturbo/turbojpeg/package-tree.html new file mode 100644 index 0000000..5f0f8c3 --- /dev/null +++ b/src/third_party/libjpeg-turbo/java/doc/org/libjpegturbo/turbojpeg/package-tree.html
@@ -0,0 +1,160 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!-- NewPage --> +<html lang="en"> +<head> +<title>org.libjpegturbo.turbojpeg Class Hierarchy</title> +<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style"> +</head> +<body> +<script type="text/javascript"><!-- + try { + if (location.href.indexOf('is-external=true') == -1) { + parent.document.title="org.libjpegturbo.turbojpeg Class Hierarchy"; + } + } + catch(err) { + } +//--> +</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</li> +<li class="navBarCell1Rev">Tree</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>Prev</li> +<li>Next</li> +</ul> +<ul class="navList"> +<li><a href="../../../index.html?org/libjpegturbo/turbojpeg/package-tree.html" target="_top">Frames</a></li> +<li><a href="package-tree.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> +<a name="skip-navbar_top"> +<!-- --> +</a></div> +<!-- ========= END OF TOP NAVBAR ========= --> +<div class="header"> +<h1 class="title">Hierarchy For Package org.libjpegturbo.turbojpeg</h1> +</div> +<div class="contentContainer"> +<h2 title="Class Hierarchy">Class Hierarchy</h2> +<ul> +<li type="circle">java.lang.Object +<ul> +<li type="circle">java.awt.geom.RectangularShape (implements java.lang.Cloneable, java.awt.Shape) +<ul> +<li type="circle">java.awt.geom.Rectangle2D +<ul> +<li type="circle">java.awt.Rectangle (implements java.io.Serializable, java.awt.Shape) +<ul> +<li type="circle">org.libjpegturbo.turbojpeg.<a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">TJTransform</span></a></li> +</ul> +</li> +</ul> +</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) +<ul> +<li type="circle">org.libjpegturbo.turbojpeg.<a href="../../../org/libjpegturbo/turbojpeg/TJTransformer.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">TJTransformer</span></a></li> +</ul> +</li> +<li type="circle">org.libjpegturbo.turbojpeg.<a href="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">TJScalingFactor</span></a></li> +<li type="circle">org.libjpegturbo.turbojpeg.<a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">YUVImage</span></a></li> +</ul> +</li> +</ul> +<h2 title="Interface Hierarchy">Interface Hierarchy</h2> +<ul> +<li type="circle">org.libjpegturbo.turbojpeg.<a href="../../../org/libjpegturbo/turbojpeg/TJCustomFilter.html" title="interface in org.libjpegturbo.turbojpeg"><span class="strong">TJCustomFilter</span></a></li> +</ul> +</div> +<!-- ======= 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</li> +<li class="navBarCell1Rev">Tree</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>Prev</li> +<li>Next</li> +</ul> +<ul class="navList"> +<li><a href="../../../index.html?org/libjpegturbo/turbojpeg/package-tree.html" target="_top">Frames</a></li> +<li><a href="package-tree.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> +<a name="skip-navbar_bottom"> +<!-- --> +</a></div> +<!-- ======== END OF BOTTOM NAVBAR ======= --> +</body> +</html>
diff --git a/src/third_party/libjpeg-turbo/java/doc/overview-tree.html b/src/third_party/libjpeg-turbo/java/doc/overview-tree.html new file mode 100644 index 0000000..b659995 --- /dev/null +++ b/src/third_party/libjpeg-turbo/java/doc/overview-tree.html
@@ -0,0 +1,164 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!-- NewPage --> +<html lang="en"> +<head> +<title>Class Hierarchy</title> +<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style"> +</head> +<body> +<script type="text/javascript"><!-- + try { + if (location.href.indexOf('is-external=true') == -1) { + parent.document.title="Class Hierarchy"; + } + } + catch(err) { + } +//--> +</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</li> +<li class="navBarCell1Rev">Tree</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>Prev</li> +<li>Next</li> +</ul> +<ul class="navList"> +<li><a href="index.html?overview-tree.html" target="_top">Frames</a></li> +<li><a href="overview-tree.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> +<a name="skip-navbar_top"> +<!-- --> +</a></div> +<!-- ========= END OF TOP NAVBAR ========= --> +<div class="header"> +<h1 class="title">Hierarchy For All Packages</h1> +<span class="strong">Package Hierarchies:</span> +<ul class="horizontal"> +<li><a href="org/libjpegturbo/turbojpeg/package-tree.html">org.libjpegturbo.turbojpeg</a></li> +</ul> +</div> +<div class="contentContainer"> +<h2 title="Class Hierarchy">Class Hierarchy</h2> +<ul> +<li type="circle">java.lang.Object +<ul> +<li type="circle">java.awt.geom.RectangularShape (implements java.lang.Cloneable, java.awt.Shape) +<ul> +<li type="circle">java.awt.geom.Rectangle2D +<ul> +<li type="circle">java.awt.Rectangle (implements java.io.Serializable, java.awt.Shape) +<ul> +<li type="circle">org.libjpegturbo.turbojpeg.<a href="org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">TJTransform</span></a></li> +</ul> +</li> +</ul> +</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) +<ul> +<li type="circle">org.libjpegturbo.turbojpeg.<a href="org/libjpegturbo/turbojpeg/TJTransformer.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">TJTransformer</span></a></li> +</ul> +</li> +<li type="circle">org.libjpegturbo.turbojpeg.<a href="org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">TJScalingFactor</span></a></li> +<li type="circle">org.libjpegturbo.turbojpeg.<a href="org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">YUVImage</span></a></li> +</ul> +</li> +</ul> +<h2 title="Interface Hierarchy">Interface Hierarchy</h2> +<ul> +<li type="circle">org.libjpegturbo.turbojpeg.<a href="org/libjpegturbo/turbojpeg/TJCustomFilter.html" title="interface in org.libjpegturbo.turbojpeg"><span class="strong">TJCustomFilter</span></a></li> +</ul> +</div> +<!-- ======= 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</li> +<li class="navBarCell1Rev">Tree</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>Prev</li> +<li>Next</li> +</ul> +<ul class="navList"> +<li><a href="index.html?overview-tree.html" target="_top">Frames</a></li> +<li><a href="overview-tree.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> +<a name="skip-navbar_bottom"> +<!-- --> +</a></div> +<!-- ======== END OF BOTTOM NAVBAR ======= --> +</body> +</html>
diff --git a/src/third_party/libjpeg-turbo/java/doc/package-list b/src/third_party/libjpeg-turbo/java/doc/package-list new file mode 100644 index 0000000..918d936 --- /dev/null +++ b/src/third_party/libjpeg-turbo/java/doc/package-list
@@ -0,0 +1 @@ +org.libjpegturbo.turbojpeg
diff --git a/src/third_party/libjpeg-turbo/java/doc/resources/background.gif b/src/third_party/libjpeg-turbo/java/doc/resources/background.gif new file mode 100644 index 0000000..f471940 --- /dev/null +++ b/src/third_party/libjpeg-turbo/java/doc/resources/background.gif Binary files differ
diff --git a/src/third_party/libjpeg-turbo/java/doc/resources/tab.gif b/src/third_party/libjpeg-turbo/java/doc/resources/tab.gif new file mode 100644 index 0000000..1a73a83 --- /dev/null +++ b/src/third_party/libjpeg-turbo/java/doc/resources/tab.gif Binary files differ
diff --git a/src/third_party/libjpeg-turbo/java/doc/resources/titlebar.gif b/src/third_party/libjpeg-turbo/java/doc/resources/titlebar.gif new file mode 100644 index 0000000..17443b3 --- /dev/null +++ b/src/third_party/libjpeg-turbo/java/doc/resources/titlebar.gif Binary files differ
diff --git a/src/third_party/libjpeg-turbo/java/doc/resources/titlebar_end.gif b/src/third_party/libjpeg-turbo/java/doc/resources/titlebar_end.gif new file mode 100644 index 0000000..3ad78d4 --- /dev/null +++ b/src/third_party/libjpeg-turbo/java/doc/resources/titlebar_end.gif Binary files differ
diff --git a/src/third_party/libjpeg-turbo/java/doc/script.js b/src/third_party/libjpeg-turbo/java/doc/script.js new file mode 100644 index 0000000..b346356 --- /dev/null +++ b/src/third_party/libjpeg-turbo/java/doc/script.js
@@ -0,0 +1,30 @@ +function show(type) +{ + count = 0; + for (var key in methods) { + var row = document.getElementById(key); + if ((methods[key] & type) != 0) { + row.style.display = ''; + row.className = (count++ % 2) ? rowColor : altColor; + } + else + row.style.display = 'none'; + } + updateTabs(type); +} + +function updateTabs(type) +{ + for (var value in tabs) { + var sNode = document.getElementById(tabs[value][0]); + var spanNode = sNode.firstChild; + if (value == type) { + sNode.className = activeTableTab; + spanNode.innerHTML = tabs[value][1]; + } + else { + sNode.className = tableTab; + spanNode.innerHTML = "<a href=\"javascript:show("+ value + ");\">" + tabs[value][1] + "</a>"; + } + } +}
diff --git a/src/third_party/libjpeg-turbo/java/doc/serialized-form.html b/src/third_party/libjpeg-turbo/java/doc/serialized-form.html new file mode 100644 index 0000000..45bbc86 --- /dev/null +++ b/src/third_party/libjpeg-turbo/java/doc/serialized-form.html
@@ -0,0 +1,176 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!-- NewPage --> +<html lang="en"> +<head> +<title>Serialized Form</title> +<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style"> +</head> +<body> +<script type="text/javascript"><!-- + try { + if (location.href.indexOf('is-external=true') == -1) { + parent.document.title="Serialized Form"; + } + } + catch(err) { + } +//--> +</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</li> +<li><a href="org/libjpegturbo/turbojpeg/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>Prev</li> +<li>Next</li> +</ul> +<ul class="navList"> +<li><a href="index.html?serialized-form.html" target="_top">Frames</a></li> +<li><a href="serialized-form.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> +<a name="skip-navbar_top"> +<!-- --> +</a></div> +<!-- ========= END OF TOP NAVBAR ========= --> +<div class="header"> +<h1 title="Serialized Form" class="title">Serialized Form</h1> +</div> +<div class="serializedFormContainer"> +<ul class="blockList"> +<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> +<ul class="blockList"> +<li class="blockList"><a name="serializedForm"> +<!-- --> +</a> +<h3>Serialized Fields</h3> +<ul class="blockList"> +<li class="blockListLast"> +<h4>errorCode</h4> +<pre>int errorCode</pre> +</li> +</ul> +</li> +</ul> +</li> +<li class="blockList"><a name="org.libjpegturbo.turbojpeg.TJTransform"> +<!-- --> +</a> +<h3>Class <a href="org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">org.libjpegturbo.turbojpeg.TJTransform</a> extends java.awt.Rectangle implements Serializable</h3> +<dl class="nameValue"> +<dt>serialVersionUID:</dt> +<dd>-127367705761430371L</dd> +</dl> +<ul class="blockList"> +<li class="blockList"><a name="serializedForm"> +<!-- --> +</a> +<h3>Serialized Fields</h3> +<ul class="blockList"> +<li class="blockList"> +<h4>op</h4> +<pre>int op</pre> +<div class="block">Transform operation (one of <code>OP_*</code>)</div> +</li> +<li class="blockList"> +<h4>options</h4> +<pre>int options</pre> +<div class="block">Transform options (bitwise OR of one or more of <code>OPT_*</code>)</div> +</li> +<li class="blockListLast"> +<h4>cf</h4> +<pre><a href="org/libjpegturbo/turbojpeg/TJCustomFilter.html" title="interface in org.libjpegturbo.turbojpeg">TJCustomFilter</a> cf</pre> +<div class="block">Custom filter instance</div> +</li> +</ul> +</li> +</ul> +</li> +</ul> +</li> +</ul> +</div> +<!-- ======= 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</li> +<li><a href="org/libjpegturbo/turbojpeg/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>Prev</li> +<li>Next</li> +</ul> +<ul class="navList"> +<li><a href="index.html?serialized-form.html" target="_top">Frames</a></li> +<li><a href="serialized-form.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> +<a name="skip-navbar_bottom"> +<!-- --> +</a></div> +<!-- ======== END OF BOTTOM NAVBAR ======= --> +</body> +</html>
diff --git a/src/third_party/libjpeg-turbo/java/doc/stylesheet.css b/src/third_party/libjpeg-turbo/java/doc/stylesheet.css new file mode 100644 index 0000000..0aeaa97 --- /dev/null +++ b/src/third_party/libjpeg-turbo/java/doc/stylesheet.css
@@ -0,0 +1,474 @@ +/* Javadoc style sheet */ +/* +Overall document style +*/ +body { + background-color:#ffffff; + color:#353833; + font-family:Arial, Helvetica, sans-serif; + font-size:76%; + margin:0; +} +a:link, a:visited { + text-decoration:none; + color:#4c6b87; +} +a:hover, a:focus { + text-decoration:none; + color:#bb7a2a; +} +a:active { + text-decoration:none; + color:#4c6b87; +} +a[name] { + color:#353833; +} +a[name]:hover { + text-decoration:none; + color:#353833; +} +pre { + font-size:1.3em; +} +h1 { + font-size:1.8em; +} +h2 { + font-size:1.5em; +} +h3 { + font-size:1.4em; +} +h4 { + font-size:1.3em; +} +h5 { + font-size:1.2em; +} +h6 { + font-size:1.1em; +} +ul { + list-style-type:disc; +} +code, tt { + font-size:1.2em; +} +dt code { + font-size:1.2em; +} +table tr td dt code { + font-size:1.2em; + vertical-align:top; +} +sup { + font-size:.6em; +} +/* +Document title and Copyright styles +*/ +.clear { + clear:both; + height:0px; + overflow:hidden; +} +.aboutLanguage { + float:right; + padding:0px 21px; + font-size:.8em; + z-index:200; + margin-top:-7px; +} +.legalCopy { + margin-left:.5em; +} +.bar a, .bar a:link, .bar a:visited, .bar a:active { + color:#FFFFFF; + text-decoration:none; +} +.bar a:hover, .bar a:focus { + color:#bb7a2a; +} +.tab { + background-color:#0066FF; + background-image:url(resources/titlebar.gif); + background-position:left top; + background-repeat:no-repeat; + color:#ffffff; + padding:8px; + width:5em; + font-weight:bold; +} +/* +Navigation bar styles +*/ +.bar { + background-image:url(resources/background.gif); + background-repeat:repeat-x; + color:#FFFFFF; + padding:.8em .5em .4em .8em; + height:auto;/*height:1.8em;*/ + font-size:1em; + margin:0; +} +.topNav { + background-image:url(resources/background.gif); + background-repeat:repeat-x; + color:#FFFFFF; + float:left; + padding:0; + width:100%; + clear:right; + height:2.8em; + padding-top:10px; + overflow:hidden; +} +.bottomNav { + margin-top:10px; + background-image:url(resources/background.gif); + background-repeat:repeat-x; + color:#FFFFFF; + float:left; + padding:0; + width:100%; + clear:right; + height:2.8em; + padding-top:10px; + overflow:hidden; +} +.subNav { + background-color:#dee3e9; + border-bottom:1px solid #9eadc0; + float:left; + width:100%; + overflow:hidden; +} +.subNav div { + clear:left; + float:left; + padding:0 0 5px 6px; +} +ul.navList, ul.subNavList { + float:left; + margin:0 25px 0 0; + padding:0; +} +ul.navList li{ + list-style:none; + float:left; + padding:3px 6px; +} +ul.subNavList li{ + list-style:none; + float:left; + font-size:90%; +} +.topNav a:link, .topNav a:active, .topNav a:visited, .bottomNav a:link, .bottomNav a:active, .bottomNav a:visited { + color:#FFFFFF; + text-decoration:none; +} +.topNav a:hover, .bottomNav a:hover { + text-decoration:none; + color:#bb7a2a; +} +.navBarCell1Rev { + background-image:url(resources/tab.gif); + background-color:#a88834; + color:#FFFFFF; + margin: auto 5px; + border:1px solid #c9aa44; +} +/* +Page header and footer styles +*/ +.header, .footer { + clear:both; + margin:0 20px; + padding:5px 0 0 0; +} +.indexHeader { + margin:10px; + position:relative; +} +.indexHeader h1 { + font-size:1.3em; +} +.title { + color:#2c4557; + margin:10px 0; +} +.subTitle { + margin:5px 0 0 0; +} +.header ul { + margin:0 0 25px 0; + padding:0; +} +.footer ul { + margin:20px 0 5px 0; +} +.header ul li, .footer ul li { + list-style:none; + font-size:1.2em; +} +/* +Heading styles +*/ +div.details ul.blockList ul.blockList ul.blockList li.blockList h4, div.details ul.blockList ul.blockList ul.blockListLast li.blockList h4 { + background-color:#dee3e9; + border-top:1px solid #9eadc0; + border-bottom:1px solid #9eadc0; + margin:0 0 6px -8px; + padding:2px 5px; +} +ul.blockList ul.blockList ul.blockList li.blockList h3 { + background-color:#dee3e9; + border-top:1px solid #9eadc0; + border-bottom:1px solid #9eadc0; + margin:0 0 6px -8px; + padding:2px 5px; +} +ul.blockList ul.blockList li.blockList h3 { + padding:0; + margin:15px 0; +} +ul.blockList li.blockList h2 { + padding:0px 0 20px 0; +} +/* +Page layout container styles +*/ +.contentContainer, .sourceContainer, .classUseContainer, .serializedFormContainer, .constantValuesContainer { + clear:both; + padding:10px 20px; + position:relative; +} +.indexContainer { + margin:10px; + position:relative; + font-size:1.0em; +} +.indexContainer h2 { + font-size:1.1em; + padding:0 0 3px 0; +} +.indexContainer ul { + margin:0; + padding:0; +} +.indexContainer ul li { + list-style:none; +} +.contentContainer .description dl dt, .contentContainer .details dl dt, .serializedFormContainer dl dt { + font-size:1.1em; + font-weight:bold; + margin:10px 0 0 0; + color:#4E4E4E; +} +.contentContainer .description dl dd, .contentContainer .details dl dd, .serializedFormContainer dl dd { + margin:10px 0 10px 20px; +} +.serializedFormContainer dl.nameValue dt { + margin-left:1px; + font-size:1.1em; + display:inline; + font-weight:bold; +} +.serializedFormContainer dl.nameValue dd { + margin:0 0 0 1px; + font-size:1.1em; + display:inline; +} +/* +List styles +*/ +ul.horizontal li { + display:inline; + font-size:0.9em; +} +ul.inheritance { + margin:0; + padding:0; +} +ul.inheritance li { + display:inline; + list-style:none; +} +ul.inheritance li ul.inheritance { + margin-left:15px; + padding-left:15px; + padding-top:1px; +} +ul.blockList, ul.blockListLast { + margin:10px 0 10px 0; + padding:0; +} +ul.blockList li.blockList, ul.blockListLast li.blockList { + list-style:none; + margin-bottom:25px; +} +ul.blockList ul.blockList li.blockList, ul.blockList ul.blockListLast li.blockList { + padding:0px 20px 5px 10px; + border:1px solid #9eadc0; + background-color:#f9f9f9; +} +ul.blockList ul.blockList ul.blockList li.blockList, ul.blockList ul.blockList ul.blockListLast li.blockList { + padding:0 0 5px 8px; + background-color:#ffffff; + border:1px solid #9eadc0; + border-top:none; +} +ul.blockList ul.blockList ul.blockList ul.blockList li.blockList { + margin-left:0; + padding-left:0; + padding-bottom:15px; + border:none; + border-bottom:1px solid #9eadc0; +} +ul.blockList ul.blockList ul.blockList ul.blockList li.blockListLast { + list-style:none; + border-bottom:none; + padding-bottom:0; +} +table tr td dl, table tr td dl dt, table tr td dl dd { + margin-top:0; + margin-bottom:1px; +} +/* +Table styles +*/ +.contentContainer table, .classUseContainer table, .constantValuesContainer table { + border-bottom:1px solid #9eadc0; + width:100%; +} +.contentContainer ul li table, .classUseContainer ul li table, .constantValuesContainer ul li table { + width:100%; +} +.contentContainer .description table, .contentContainer .details table { + border-bottom:none; +} +.contentContainer ul li table th.colOne, .contentContainer ul li table th.colFirst, .contentContainer ul li table th.colLast, .classUseContainer ul li table th, .constantValuesContainer ul li table th, .contentContainer ul li table td.colOne, .contentContainer ul li table td.colFirst, .contentContainer ul li table td.colLast, .classUseContainer ul li table td, .constantValuesContainer ul li table td{ + vertical-align:top; + padding-right:20px; +} +.contentContainer ul li table th.colLast, .classUseContainer ul li table th.colLast,.constantValuesContainer ul li table th.colLast, +.contentContainer ul li table td.colLast, .classUseContainer ul li table td.colLast,.constantValuesContainer ul li table td.colLast, +.contentContainer ul li table th.colOne, .classUseContainer ul li table th.colOne, +.contentContainer ul li table td.colOne, .classUseContainer ul li table td.colOne { + padding-right:3px; +} +.overviewSummary caption, .packageSummary caption, .contentContainer ul.blockList li.blockList caption, .summary caption, .classUseContainer caption, .constantValuesContainer caption { + position:relative; + text-align:left; + background-repeat:no-repeat; + color:#FFFFFF; + font-weight:bold; + clear:none; + overflow:hidden; + padding:0px; + margin:0px; +} +caption a:link, caption a:hover, caption a:active, caption a:visited { + color:#FFFFFF; +} +.overviewSummary caption span, .packageSummary caption span, .contentContainer ul.blockList li.blockList caption span, .summary caption span, .classUseContainer caption span, .constantValuesContainer caption span { + white-space:nowrap; + padding-top:8px; + padding-left:8px; + display:block; + float:left; + background-image:url(resources/titlebar.gif); + height:18px; +} +.overviewSummary .tabEnd, .packageSummary .tabEnd, .contentContainer ul.blockList li.blockList .tabEnd, .summary .tabEnd, .classUseContainer .tabEnd, .constantValuesContainer .tabEnd { + width:10px; + background-image:url(resources/titlebar_end.gif); + background-repeat:no-repeat; + background-position:top right; + position:relative; + float:left; +} +ul.blockList ul.blockList li.blockList table { + margin:0 0 12px 0px; + width:100%; +} +.tableSubHeadingColor { + background-color: #EEEEFF; +} +.altColor { + background-color:#eeeeef; +} +.rowColor { + background-color:#ffffff; +} +.overviewSummary td, .packageSummary td, .contentContainer ul.blockList li.blockList td, .summary td, .classUseContainer td, .constantValuesContainer td { + text-align:left; + padding:3px 3px 3px 7px; +} +th.colFirst, th.colLast, th.colOne, .constantValuesContainer th { + background:#dee3e9; + border-top:1px solid #9eadc0; + border-bottom:1px solid #9eadc0; + text-align:left; + padding:3px 3px 3px 7px; +} +td.colOne a:link, td.colOne a:active, td.colOne a:visited, td.colOne a:hover, td.colFirst a:link, td.colFirst a:active, td.colFirst a:visited, td.colFirst a:hover, td.colLast a:link, td.colLast a:active, td.colLast a:visited, td.colLast a:hover, .constantValuesContainer td a:link, .constantValuesContainer td a:active, .constantValuesContainer td a:visited, .constantValuesContainer td a:hover { + font-weight:bold; +} +td.colFirst, th.colFirst { + border-left:1px solid #9eadc0; + white-space:nowrap; +} +td.colLast, th.colLast { + border-right:1px solid #9eadc0; +} +td.colOne, th.colOne { + border-right:1px solid #9eadc0; + border-left:1px solid #9eadc0; +} +table.overviewSummary { + padding:0px; + margin-left:0px; +} +table.overviewSummary td.colFirst, table.overviewSummary th.colFirst, +table.overviewSummary td.colOne, table.overviewSummary th.colOne { + width:25%; + vertical-align:middle; +} +table.packageSummary td.colFirst, table.overviewSummary th.colFirst { + width:25%; + vertical-align:middle; +} +/* +Content styles +*/ +.description pre { + margin-top:0; +} +.deprecatedContent { + margin:0; + padding:10px 0; +} +.docSummary { + padding:0; +} +/* +Formatting effect styles +*/ +.sourceLineNo { + color:green; + padding:0 30px 0 0; +} +h1.hidden { + visibility:hidden; + overflow:hidden; + font-size:.9em; +} +.block { + display:block; + margin:3px 0 0 0; +} +.strong { + font-weight:bold; +}
diff --git a/src/third_party/libjpeg-turbo/java/org/libjpegturbo/turbojpeg/TJ.java b/src/third_party/libjpeg-turbo/java/org/libjpegturbo/turbojpeg/TJ.java new file mode 100644 index 0000000..fbb49df --- /dev/null +++ b/src/third_party/libjpeg-turbo/java/org/libjpegturbo/turbojpeg/TJ.java
@@ -0,0 +1,584 @@ +/* + * Copyright (C)2011-2013, 2017-2018 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: + * + * - 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; + +/** + * TurboJPEG utility class (cannot be instantiated) + */ +public final class TJ { + + private TJ() {} + + /** + * The number of chrominance subsampling options + */ + public static final int NUMSAMP = 6; + /** + * 4:4:4 chrominance subsampling (no chrominance subsampling). The JPEG + * or YUV image will contain one chrominance component for every pixel in the + * source image. + */ + public static final int SAMP_444 = 0; + /** + * 4:2:2 chrominance subsampling. The JPEG or YUV image will contain one + * chrominance component for every 2x1 block of pixels in the source image. + */ + public static final int SAMP_422 = 1; + /** + * 4:2:0 chrominance subsampling. The JPEG or YUV image will contain one + * chrominance component for every 2x2 block of pixels in the source image. + */ + public static final int SAMP_420 = 2; + /** + * Grayscale. The JPEG or YUV image will contain no chrominance components. + */ + public static final int SAMP_GRAY = 3; + /** + * 4:4:0 chrominance subsampling. The JPEG or YUV image will contain one + * chrominance component for every 1x2 block of pixels in the source image. + * Note that 4:4:0 subsampling is not fully accelerated in libjpeg-turbo. + */ + public static final int SAMP_440 = 4; + /** + * 4:1:1 chrominance subsampling. The JPEG or YUV image will contain one + * chrominance component for every 4x1 block of pixels in the source image. + * JPEG images compressed with 4:1:1 subsampling will be almost exactly the + * same size as those compressed with 4:2:0 subsampling, and in the + * aggregate, both subsampling methods produce approximately the same + * perceptual quality. However, 4:1:1 is better able to reproduce sharp + * horizontal features. Note that 4:1:1 subsampling is not fully accelerated + * in libjpeg-turbo. + */ + public static final int SAMP_411 = 5; + + + /** + * Returns the MCU block width for the given level of chrominance + * subsampling. + * + * @param subsamp the level of chrominance subsampling (one of + * <code>SAMP_*</code>) + * + * @return the MCU block width for the given level of chrominance + * subsampling. + */ + public static int getMCUWidth(int subsamp) { + checkSubsampling(subsamp); + return MCU_WIDTH[subsamp]; + } + + private static final int[] MCU_WIDTH = { + 8, 16, 16, 8, 8, 32 + }; + + + /** + * Returns the MCU block height for the given level of chrominance + * subsampling. + * + * @param subsamp the level of chrominance subsampling (one of + * <code>SAMP_*</code>) + * + * @return the MCU block height for the given level of chrominance + * subsampling. + */ + public static int getMCUHeight(int subsamp) { + checkSubsampling(subsamp); + return MCU_HEIGHT[subsamp]; + } + + private static final int[] MCU_HEIGHT = { + 8, 8, 16, 8, 16, 8 + }; + + + /** + * The number of pixel formats + */ + public static final int NUMPF = 12; + /** + * RGB pixel format. The red, green, and blue components in the image are + * stored in 3-byte pixels in the order R, G, B from lowest to highest byte + * address within each pixel. + */ + public static final int PF_RGB = 0; + /** + * BGR pixel format. The red, green, and blue components in the image are + * stored in 3-byte pixels in the order B, G, R from lowest to highest byte + * address within each pixel. + */ + public static final int PF_BGR = 1; + /** + * RGBX pixel format. The red, green, and blue components in the image are + * stored in 4-byte pixels in the order R, G, B from lowest to highest byte + * address within each pixel. The X component is ignored when compressing + * and undefined when decompressing. + */ + public static final int PF_RGBX = 2; + /** + * BGRX pixel format. The red, green, and blue components in the image are + * stored in 4-byte pixels in the order B, G, R from lowest to highest byte + * address within each pixel. The X component is ignored when compressing + * and undefined when decompressing. + */ + public static final int PF_BGRX = 3; + /** + * XBGR pixel format. The red, green, and blue components in the image are + * stored in 4-byte pixels in the order R, G, B from highest to lowest byte + * address within each pixel. The X component is ignored when compressing + * and undefined when decompressing. + */ + public static final int PF_XBGR = 4; + /** + * XRGB pixel format. The red, green, and blue components in the image are + * stored in 4-byte pixels in the order B, G, R from highest to lowest byte + * address within each pixel. The X component is ignored when compressing + * and undefined when decompressing. + */ + public static final int PF_XRGB = 5; + /** + * Grayscale pixel format. Each 1-byte pixel represents a luminance + * (brightness) level from 0 to 255. + */ + public static final int PF_GRAY = 6; + /** + * RGBA pixel format. This is the same as {@link #PF_RGBX}, except that when + * decompressing, the X byte is guaranteed to be 0xFF, which can be + * interpreted as an opaque alpha channel. + */ + public static final int PF_RGBA = 7; + /** + * BGRA pixel format. This is the same as {@link #PF_BGRX}, except that when + * decompressing, the X byte is guaranteed to be 0xFF, which can be + * interpreted as an opaque alpha channel. + */ + public static final int PF_BGRA = 8; + /** + * ABGR pixel format. This is the same as {@link #PF_XBGR}, except that when + * decompressing, the X byte is guaranteed to be 0xFF, which can be + * interpreted as an opaque alpha channel. + */ + public static final int PF_ABGR = 9; + /** + * ARGB pixel format. This is the same as {@link #PF_XRGB}, except that when + * decompressing, the X byte is guaranteed to be 0xFF, which can be + * interpreted as an opaque alpha channel. + */ + public static final int PF_ARGB = 10; + /** + * CMYK pixel format. Unlike RGB, which is an additive color model used + * primarily for display, CMYK (Cyan/Magenta/Yellow/Key) is a subtractive + * color model used primarily for printing. In the CMYK color model, the + * value of each color component typically corresponds to an amount of cyan, + * magenta, yellow, or black ink that is applied to a white background. In + * order to convert between CMYK and RGB, it is necessary to use a color + * management system (CMS.) A CMS will attempt to map colors within the + * printer's gamut to perceptually similar colors in the display's gamut and + * vice versa, but the mapping is typically not 1:1 or reversible, nor can it + * be defined with a simple formula. Thus, such a conversion is out of scope + * for a codec library. However, the TurboJPEG API allows for compressing + * CMYK pixels into a YCCK JPEG image (see {@link #CS_YCCK}) and + * decompressing YCCK JPEG images into CMYK pixels. + */ + public static final int PF_CMYK = 11; + + + /** + * Returns the pixel size (in bytes) for the given pixel format. + * + * @param pixelFormat the pixel format (one of <code>PF_*</code>) + * + * @return the pixel size (in bytes) for the given pixel format. + */ + public static int getPixelSize(int pixelFormat) { + checkPixelFormat(pixelFormat); + return PIXEL_SIZE[pixelFormat]; + } + + private static final int[] PIXEL_SIZE = { + 3, 3, 4, 4, 4, 4, 1, 4, 4, 4, 4, 4 + }; + + + /** + * For the given pixel format, returns the number of bytes that the red + * component is offset from the start of the pixel. For instance, if a pixel + * of format <code>TJ.PF_BGRX</code> is stored in <code>char pixel[]</code>, + * then the red component will be + * <code>pixel[TJ.getRedOffset(TJ.PF_BGRX)]</code>. + * + * @param pixelFormat the pixel format (one of <code>PF_*</code>) + * + * @return the red offset for the given pixel format, or -1 if the pixel + * format does not have a red component. + */ + public static int getRedOffset(int pixelFormat) { + checkPixelFormat(pixelFormat); + return RED_OFFSET[pixelFormat]; + } + + private static final int[] RED_OFFSET = { + 0, 2, 0, 2, 3, 1, -1, 0, 2, 3, 1, -1 + }; + + + /** + * For the given pixel format, returns the number of bytes that the green + * component is offset from the start of the pixel. For instance, if a pixel + * of format <code>TJ.PF_BGRX</code> is stored in <code>char pixel[]</code>, + * then the green component will be + * <code>pixel[TJ.getGreenOffset(TJ.PF_BGRX)]</code>. + * + * @param pixelFormat the pixel format (one of <code>PF_*</code>) + * + * @return the green offset for the given pixel format, or -1 if the pixel + * format does not have a green component. + */ + public static int getGreenOffset(int pixelFormat) { + checkPixelFormat(pixelFormat); + return GREEN_OFFSET[pixelFormat]; + } + + private static final int[] GREEN_OFFSET = { + 1, 1, 1, 1, 2, 2, -1, 1, 1, 2, 2, -1 + }; + + + /** + * For the given pixel format, returns the number of bytes that the blue + * component is offset from the start of the pixel. For instance, if a pixel + * of format <code>TJ.PF_BGRX</code> is stored in <code>char pixel[]</code>, + * then the blue component will be + * <code>pixel[TJ.getBlueOffset(TJ.PF_BGRX)]</code>. + * + * @param pixelFormat the pixel format (one of <code>PF_*</code>) + * + * @return the blue offset for the given pixel format, or -1 if the pixel + * format does not have a blue component. + */ + public static int getBlueOffset(int pixelFormat) { + checkPixelFormat(pixelFormat); + return BLUE_OFFSET[pixelFormat]; + } + + private static final int[] BLUE_OFFSET = { + 2, 0, 2, 0, 1, 3, -1, 2, 0, 1, 3, -1 + }; + + + /** + * For the given pixel format, returns the number of bytes that the alpha + * component is offset from the start of the pixel. For instance, if a pixel + * of format <code>TJ.PF_BGRA</code> is stored in <code>char pixel[]</code>, + * then the alpha component will be + * <code>pixel[TJ.getAlphaOffset(TJ.PF_BGRA)]</code>. + * + * @param pixelFormat the pixel format (one of <code>PF_*</code>) + * + * @return the alpha offset for the given pixel format, or -1 if the pixel + * format does not have a alpha component. + */ + public static int getAlphaOffset(int pixelFormat) { + checkPixelFormat(pixelFormat); + return ALPHA_OFFSET[pixelFormat]; + } + + private static final int[] ALPHA_OFFSET = { + -1, -1, -1, -1, -1, -1, -1, 3, 3, 0, 0, -1 + }; + + + /** + * The number of JPEG colorspaces + */ + public static final int NUMCS = 5; + /** + * RGB colorspace. When compressing the JPEG image, the R, G, and B + * components in the source image are reordered into image planes, but no + * colorspace conversion or subsampling is performed. RGB JPEG images can be + * decompressed to any of the extended RGB pixel formats or grayscale, but + * they cannot be decompressed to YUV images. + */ + public static final int CS_RGB = 0; + /** + * YCbCr colorspace. YCbCr is not an absolute colorspace but rather a + * mathematical transformation of RGB designed solely for storage and + * transmission. YCbCr images must be converted to RGB before they can + * actually be displayed. In the YCbCr colorspace, the Y (luminance) + * component represents the black & white portion of the original image, and + * the Cb and Cr (chrominance) components represent the color portion of the + * original image. Originally, the analog equivalent of this transformation + * allowed the same signal to drive both black & white and color televisions, + * but JPEG images use YCbCr primarily because it allows the color data to be + * optionally subsampled for the purposes of reducing bandwidth or disk + * space. YCbCr is the most common JPEG colorspace, and YCbCr JPEG images + * can be compressed from and decompressed to any of the extended RGB pixel + * formats or grayscale, or they can be decompressed to YUV planar images. + */ + @SuppressWarnings("checkstyle:ConstantName") + public static final int CS_YCbCr = 1; + /** + * Grayscale colorspace. The JPEG image retains only the luminance data (Y + * component), and any color data from the source image is discarded. + * Grayscale JPEG images can be compressed from and decompressed to any of + * the extended RGB pixel formats or grayscale, or they can be decompressed + * to YUV planar images. + */ + public static final int CS_GRAY = 2; + /** + * CMYK colorspace. When compressing the JPEG image, the C, M, Y, and K + * components in the source image are reordered into image planes, but no + * colorspace conversion or subsampling is performed. CMYK JPEG images can + * only be decompressed to CMYK pixels. + */ + public static final int CS_CMYK = 3; + /** + * YCCK colorspace. YCCK (AKA "YCbCrK") is not an absolute colorspace but + * rather a mathematical transformation of CMYK designed solely for storage + * and transmission. It is to CMYK as YCbCr is to RGB. CMYK pixels can be + * reversibly transformed into YCCK, and as with YCbCr, the chrominance + * components in the YCCK pixels can be subsampled without incurring major + * perceptual loss. YCCK JPEG images can only be compressed from and + * decompressed to CMYK pixels. + */ + public static final int CS_YCCK = 4; + + + /** + * The uncompressed source/destination image is stored in bottom-up (Windows, + * OpenGL) order, not top-down (X11) order. + */ + public static final int FLAG_BOTTOMUP = 2; + + @SuppressWarnings("checkstyle:JavadocVariable") + @Deprecated + public static final int FLAG_FORCEMMX = 8; + @SuppressWarnings("checkstyle:JavadocVariable") + @Deprecated + public static final int FLAG_FORCESSE = 16; + @SuppressWarnings("checkstyle:JavadocVariable") + @Deprecated + public static final int FLAG_FORCESSE2 = 32; + @SuppressWarnings("checkstyle:JavadocVariable") + @Deprecated + public static final int FLAG_FORCESSE3 = 128; + + /** + * When decompressing an image that was compressed using chrominance + * subsampling, use the fastest chrominance upsampling algorithm available in + * the underlying codec. The default is to use smooth upsampling, which + * creates a smooth transition between neighboring chrominance components in + * order to reduce upsampling artifacts in the decompressed image. + */ + public static final int FLAG_FASTUPSAMPLE = 256; + /** + * Use the fastest DCT/IDCT algorithm available in the underlying codec. The + * default if this flag is not specified is implementation-specific. For + * example, the implementation of TurboJPEG for libjpeg[-turbo] uses the fast + * algorithm by default when compressing, because this has been shown to have + * only a very slight effect on accuracy, but it uses the accurate algorithm + * when decompressing, because this has been shown to have a larger effect. + */ + public static final int FLAG_FASTDCT = 2048; + /** + * Use the most accurate DCT/IDCT algorithm available in the underlying + * codec. The default if this flag is not specified is + * implementation-specific. For example, the implementation of TurboJPEG for + * libjpeg[-turbo] uses the fast algorithm by default when compressing, + * because this has been shown to have only a very slight effect on accuracy, + * but it uses the accurate algorithm when decompressing, because this has + * been shown to have a larger effect. + */ + public static final int FLAG_ACCURATEDCT = 4096; + /** + * Immediately discontinue the current compression/decompression/transform + * operation if the underlying codec throws a warning (non-fatal error). The + * default behavior is to allow the operation to complete unless a fatal + * error is encountered. + * <p> + * NOTE: due to the design of the TurboJPEG Java API, only certain methods + * (specifically, {@link TJDecompressor TJDecompressor.decompress*()} methods + * with a void return type) will complete and leave the output image in a + * fully recoverable state after a non-fatal error occurs. + */ + public static final int FLAG_STOPONWARNING = 8192; + /** + * Use progressive entropy coding in JPEG images generated by compression and + * transform operations. Progressive entropy coding will generally improve + * compression relative to baseline entropy coding (the default), but it will + * reduce compression and decompression performance considerably. + */ + public static final int FLAG_PROGRESSIVE = 16384; + + + /** + * The number of error codes + */ + public static final int NUMERR = 2; + /** + * The error was non-fatal and recoverable, but the image may still be + * corrupt. + * <p> + * NOTE: due to the design of the TurboJPEG Java API, only certain methods + * (specifically, {@link TJDecompressor TJDecompressor.decompress*()} methods + * with a void return type) will complete and leave the output image in a + * fully recoverable state after a non-fatal error occurs. + */ + public static final int ERR_WARNING = 0; + /** + * The error was fatal and non-recoverable. + */ + public static final int ERR_FATAL = 1; + + + /** + * 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. + * + * @param width the width (in pixels) of the JPEG image + * + * @param height the height (in pixels) of the JPEG image + * + * @param jpegSubsamp the level of chrominance subsampling to be used when + * generating the JPEG image (one of {@link TJ TJ.SAMP_*}) + * + * @return the maximum size of the buffer (in bytes) required to hold a JPEG + * image with the given width, height, and level of chrominance subsampling. + */ + 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. + * + * @param width the width (in pixels) of the YUV image + * + * @param pad 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.) + * + * @param height the height (in pixels) of the YUV image + * + * @param subsamp the level of chrominance subsampling used in the YUV + * image (one of {@link TJ TJ.SAMP_*}) + * + * @return the size of the buffer (in bytes) required to hold a YUV planar + * image with the given width, height, and level of chrominance subsampling. + */ + public static native int bufSizeYUV(int width, int pad, int height, + int subsamp); + + /** + * @deprecated Use {@link #bufSizeYUV(int, int, int, int)} instead. + */ + @SuppressWarnings("checkstyle:JavadocMethod") + @Deprecated + 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 + * plane with the given parameters. + * + * @param componentID ID number of the image plane (0 = Y, 1 = U/Cb, + * 2 = V/Cr) + * + * @param width width (in pixels) of the YUV image. NOTE: this is the width + * of the whole image, not the plane width. + * + * @param stride bytes per line in the image plane. + * + * @param height height (in pixels) of the YUV image. NOTE: this is the + * height of the whole image, not the plane height. + * + * @param subsamp the level of chrominance subsampling used in the YUV + * image (one of {@link TJ TJ.SAMP_*}) + * + * @return the size of the buffer (in bytes) required to hold a YUV planar + * image with the given parameters. + */ + public static native int planeSizeYUV(int componentID, int width, int stride, + int height, int subsamp); + + /** + * Returns the plane width of a YUV image plane with the given parameters. + * Refer to {@link YUVImage YUVImage} for a description of plane width. + * + * @param componentID ID number of the image plane (0 = Y, 1 = U/Cb, + * 2 = V/Cr) + * + * @param width width (in pixels) of the YUV image + * + * @param subsamp the level of chrominance subsampling used in the YUV image + * (one of {@link TJ TJ.SAMP_*}) + * + * @return the plane width of a YUV image plane with the given parameters. + */ + public static native int planeWidth(int componentID, int width, int subsamp); + + /** + * Returns the plane height of a YUV image plane with the given parameters. + * Refer to {@link YUVImage YUVImage} for a description of plane height. + * + * @param componentID ID number of the image plane (0 = Y, 1 = U/Cb, + * 2 = V/Cr) + * + * @param height height (in pixels) of the YUV image + * + * @param subsamp the level of chrominance subsampling used in the YUV image + * (one of {@link TJ TJ.SAMP_*}) + * + * @return the plane height of a YUV image plane with the given parameters. + */ + public static native int planeHeight(int componentID, int height, + int subsamp); + + /** + * Returns a list of fractional scaling factors that the JPEG decompressor in + * this implementation of TurboJPEG supports. + * + * @return a list of fractional scaling factors that the JPEG decompressor in + * this implementation of TurboJPEG supports. + */ + public static native TJScalingFactor[] getScalingFactors(); + + static { + TJLoader.load(); + } + + private static void checkPixelFormat(int pixelFormat) { + if (pixelFormat < 0 || pixelFormat >= NUMPF) + throw new IllegalArgumentException("Invalid pixel format"); + } + + private static void checkSubsampling(int subsamp) { + if (subsamp < 0 || subsamp >= NUMSAMP) + throw new IllegalArgumentException("Invalid subsampling type"); + } + +}
diff --git a/src/third_party/libjpeg-turbo/java/org/libjpegturbo/turbojpeg/TJCompressor.java b/src/third_party/libjpeg-turbo/java/org/libjpegturbo/turbojpeg/TJCompressor.java new file mode 100644 index 0000000..74e5db9 --- /dev/null +++ b/src/third_party/libjpeg-turbo/java/org/libjpegturbo/turbojpeg/TJCompressor.java
@@ -0,0 +1,677 @@ +/* + * Copyright (C)2011-2015, 2018 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: + * + * - 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.awt.image.*; +import java.nio.*; +import java.io.*; + +/** + * TurboJPEG compressor + */ +public class TJCompressor implements Closeable { + + private static final String NO_ASSOC_ERROR = + "No source image is associated with this instance"; + + /** + * Create a TurboJPEG compressor instance. + */ + public TJCompressor() throws TJException { + init(); + } + + /** + * Create a TurboJPEG compressor instance and associate the uncompressed + * source image stored in <code>srcImage</code> with the newly created + * instance. + * + * @param srcImage see {@link #setSourceImage} for description + * + * @param x see {@link #setSourceImage} for description + * + * @param y see {@link #setSourceImage} for description + * + * @param width see {@link #setSourceImage} for description + * + * @param pitch see {@link #setSourceImage} for description + * + * @param height see {@link #setSourceImage} for description + * + * @param pixelFormat pixel format of the source image (one of + * {@link TJ#PF_RGB TJ.PF_*}) + */ + public TJCompressor(byte[] srcImage, int x, int y, int width, int pitch, + int height, int pixelFormat) throws TJException { + setSourceImage(srcImage, x, y, width, pitch, height, pixelFormat); + } + + /** + * @deprecated Use + * {@link #TJCompressor(byte[], int, int, int, int, int, int)} instead. + */ + @SuppressWarnings("checkstyle:JavadocMethod") + @Deprecated + public TJCompressor(byte[] srcImage, int width, int pitch, int height, + int pixelFormat) throws TJException { + setSourceImage(srcImage, width, pitch, height, pixelFormat); + } + + /** + * Create a TurboJPEG compressor instance and associate the uncompressed + * source image stored in <code>srcImage</code> with the newly created + * instance. + * + * @param srcImage see + * {@link #setSourceImage(BufferedImage, int, int, int, int)} for description + * + * @param x see + * {@link #setSourceImage(BufferedImage, int, int, int, int)} for description + * + * @param y see + * {@link #setSourceImage(BufferedImage, int, int, int, int)} for description + * + * @param width see + * {@link #setSourceImage(BufferedImage, int, int, int, int)} for description + * + * @param height see + * {@link #setSourceImage(BufferedImage, int, int, int, int)} for description + */ + public TJCompressor(BufferedImage srcImage, int x, int y, int width, + int height) throws TJException { + setSourceImage(srcImage, x, y, width, height); + } + + /** + * Associate an uncompressed RGB, grayscale, or CMYK source image with this + * compressor instance. + * + * @param srcImage image buffer containing RGB, grayscale, or CMYK pixels to + * be compressed or encoded. This buffer is not modified. + * + * @param x x offset (in pixels) of the region in the source image from which + * the JPEG or YUV image should be compressed/encoded + * + * @param y y offset (in pixels) of the region in the source image from which + * the JPEG or YUV image should be compressed/encoded + * + * @param width width (in pixels) of the region in the source image from + * which the JPEG or YUV image should be compressed/encoded + * + * @param pitch bytes per line of the source image. Normally, this should be + * <code>width * TJ.pixelSize(pixelFormat)</code> if the source image is + * unpadded, but you can use this parameter to, for instance, specify that + * the scanlines in the source image are padded to a 4-byte boundary or to + * compress/encode a JPEG or YUV image from a region of a larger source + * image. You can also be clever and use this parameter to skip lines, etc. + * Setting this parameter to 0 is the equivalent of setting it to + * <code>width * TJ.pixelSize(pixelFormat)</code>. + * + * @param height height (in pixels) of the region in the source image from + * which the JPEG or YUV image should be compressed/encoded + * + * @param pixelFormat pixel format of the source image (one of + * {@link TJ#PF_RGB TJ.PF_*}) + */ + public void setSourceImage(byte[] srcImage, int x, int y, int width, + int pitch, int height, int pixelFormat) + throws TJException { + if (handle == 0) init(); + if (srcImage == null || x < 0 || y < 0 || width < 1 || height < 1 || + pitch < 0 || pixelFormat < 0 || pixelFormat >= TJ.NUMPF) + throw new IllegalArgumentException("Invalid argument in setSourceImage()"); + srcBuf = srcImage; + srcWidth = width; + if (pitch == 0) + srcPitch = width * TJ.getPixelSize(pixelFormat); + else + srcPitch = pitch; + srcHeight = height; + srcPixelFormat = pixelFormat; + srcX = x; + srcY = y; + srcBufInt = null; + srcYUVImage = null; + } + + /** + * @deprecated Use + * {@link #setSourceImage(byte[], int, int, int, int, int, int)} instead. + */ + @SuppressWarnings("checkstyle:JavadocMethod") + @Deprecated + public void setSourceImage(byte[] srcImage, int width, int pitch, + int height, int pixelFormat) throws TJException { + setSourceImage(srcImage, 0, 0, width, pitch, height, pixelFormat); + srcX = srcY = -1; + } + + /** + * Associate an uncompressed RGB or grayscale source image with this + * compressor instance. + * + * @param srcImage a <code>BufferedImage</code> instance containing RGB or + * grayscale pixels to be compressed or encoded. This image is not modified. + * + * @param x x offset (in pixels) of the region in the source image from which + * the JPEG or YUV image should be compressed/encoded + * + * @param y y offset (in pixels) of the region in the source image from which + * the JPEG or YUV image should be compressed/encoded + * + * @param width 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) + * + * @param height 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) + */ + public void setSourceImage(BufferedImage srcImage, int x, int y, int width, + 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()"); + srcX = x; + srcY = y; + srcWidth = (width == 0) ? srcImage.getWidth() : width; + srcHeight = (height == 0) ? srcImage.getHeight() : height; + if (x + width > srcImage.getWidth() || y + height > srcImage.getHeight()) + throw new IllegalArgumentException("Compression region exceeds the bounds of the source image"); + + int pixelFormat; + boolean intPixels = false; + if (byteOrder == null) + byteOrder = ByteOrder.nativeOrder(); + switch (srcImage.getType()) { + case BufferedImage.TYPE_3BYTE_BGR: + pixelFormat = TJ.PF_BGR; break; + case BufferedImage.TYPE_4BYTE_ABGR: + case BufferedImage.TYPE_4BYTE_ABGR_PRE: + pixelFormat = TJ.PF_XBGR; break; + case BufferedImage.TYPE_BYTE_GRAY: + pixelFormat = TJ.PF_GRAY; break; + case BufferedImage.TYPE_INT_BGR: + if (byteOrder == ByteOrder.BIG_ENDIAN) + pixelFormat = TJ.PF_XBGR; + else + pixelFormat = TJ.PF_RGBX; + intPixels = true; break; + case BufferedImage.TYPE_INT_RGB: + case BufferedImage.TYPE_INT_ARGB: + case BufferedImage.TYPE_INT_ARGB_PRE: + if (byteOrder == ByteOrder.BIG_ENDIAN) + pixelFormat = TJ.PF_XRGB; + else + pixelFormat = TJ.PF_BGRX; + intPixels = true; break; + default: + throw new IllegalArgumentException("Unsupported BufferedImage format"); + } + srcPixelFormat = pixelFormat; + + WritableRaster wr = srcImage.getRaster(); + if (intPixels) { + SinglePixelPackedSampleModel sm = + (SinglePixelPackedSampleModel)srcImage.getSampleModel(); + srcStride = sm.getScanlineStride(); + DataBufferInt db = (DataBufferInt)wr.getDataBuffer(); + srcBufInt = db.getData(); + srcBuf = null; + } else { + ComponentSampleModel sm = + (ComponentSampleModel)srcImage.getSampleModel(); + int pixelSize = sm.getPixelStride(); + if (pixelSize != TJ.getPixelSize(pixelFormat)) + throw new IllegalArgumentException("Inconsistency between pixel format and pixel size in BufferedImage"); + srcPitch = sm.getScanlineStride(); + DataBufferByte db = (DataBufferByte)wr.getDataBuffer(); + srcBuf = db.getData(); + srcBufInt = null; + } + srcYUVImage = null; + } + + /** + * Associate an uncompressed YUV planar source image with this compressor + * instance. + * + * @param srcImage YUV planar image to be compressed. This image is not + * modified. + */ + public void setSourceImage(YUVImage srcImage) throws TJException { + if (handle == 0) init(); + if (srcImage == null) + throw new IllegalArgumentException("Invalid argument in setSourceImage()"); + srcYUVImage = srcImage; + srcBuf = null; + srcBufInt = null; + } + + /** + * Set the level of chrominance subsampling for subsequent compress/encode + * operations. When pixels are converted from RGB to YCbCr (see + * {@link TJ#CS_YCbCr}) or from CMYK to YCCK (see {@link TJ#CS_YCCK}) as part + * of the JPEG compression process, some of the Cb and Cr (chrominance) + * components can be discarded or averaged together to produce a smaller + * image with little perceptible loss of image clarity (the human eye is more + * sensitive to small changes in brightness than to small changes in color.) + * This is called "chrominance subsampling". + * <p> + * NOTE: This method has no effect when compressing a JPEG image from a YUV + * planar source. In that case, the level of chrominance subsampling in + * the JPEG image is determined by the source. Furthermore, this method has + * no effect when encoding to a pre-allocated {@link YUVImage} instance. In + * that case, the level of chrominance subsampling is determined by the + * destination. + * + * @param newSubsamp the level of chrominance subsampling to use in + * subsequent compress/encode oeprations (one of + * {@link TJ#SAMP_444 TJ.SAMP_*}) + */ + public void setSubsamp(int newSubsamp) { + if (newSubsamp < 0 || newSubsamp >= TJ.NUMSAMP) + throw new IllegalArgumentException("Invalid argument in setSubsamp()"); + subsamp = newSubsamp; + } + + /** + * Set the JPEG image quality level for subsequent compress operations. + * + * @param quality the new JPEG image quality level (1 to 100, 1 = worst, + * 100 = best) + */ + public void setJPEGQuality(int quality) { + if (quality < 1 || quality > 100) + throw new IllegalArgumentException("Invalid argument in setJPEGQuality()"); + jpegQuality = quality; + } + + /** + * Compress the uncompressed source image associated with this compressor + * instance and output a JPEG image to the given destination buffer. + * + * @param dstBuf buffer that will receive the JPEG image. Use + * {@link TJ#bufSize} to determine the maximum size for this buffer based on + * the source image's width and height and the desired level of chrominance + * subsampling. + * + * @param flags the bitwise OR of one or more of + * {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*} + */ + 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) + throw new IllegalStateException(NO_ASSOC_ERROR); + if (jpegQuality < 0) + throw new IllegalStateException("JPEG Quality not set"); + if (subsamp < 0 && srcYUVImage == null) + throw new IllegalStateException("Subsampling level not set"); + + if (srcYUVImage != null) + compressedSize = compressFromYUV(srcYUVImage.getPlanes(), + srcYUVImage.getOffsets(), + srcYUVImage.getWidth(), + srcYUVImage.getStrides(), + srcYUVImage.getHeight(), + srcYUVImage.getSubsamp(), + dstBuf, jpegQuality, flags); + else if (srcBuf != null) { + if (srcX >= 0 && srcY >= 0) + compressedSize = compress(srcBuf, srcX, srcY, srcWidth, srcPitch, + srcHeight, srcPixelFormat, dstBuf, subsamp, + jpegQuality, flags); + else + compressedSize = compress(srcBuf, srcWidth, srcPitch, srcHeight, + srcPixelFormat, dstBuf, subsamp, jpegQuality, + flags); + } else if (srcBufInt != null) { + if (srcX >= 0 && srcY >= 0) + compressedSize = compress(srcBufInt, srcX, srcY, srcWidth, srcStride, + srcHeight, srcPixelFormat, dstBuf, subsamp, + jpegQuality, flags); + else + compressedSize = compress(srcBufInt, srcWidth, srcStride, srcHeight, + srcPixelFormat, dstBuf, subsamp, jpegQuality, + flags); + } + } + + /** + * Compress the uncompressed source image associated with this compressor + * instance and return a buffer containing a JPEG image. + * + * @param flags the bitwise OR of one or more of + * {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*} + * + * @return a buffer containing a JPEG image. The length of this buffer will + * 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 TJException { + checkSourceImage(); + byte[] buf = new byte[TJ.bufSize(srcWidth, srcHeight, subsamp)]; + compress(buf, flags); + return buf; + } + + /** + * @deprecated Use + * {@link #setSourceImage(BufferedImage, int, int, int, int)} and + * {@link #compress(byte[], int)} instead. + */ + @SuppressWarnings("checkstyle:JavadocMethod") + @Deprecated + public void compress(BufferedImage srcImage, byte[] dstBuf, int flags) + throws TJException { + setSourceImage(srcImage, 0, 0, 0, 0); + compress(dstBuf, flags); + } + + /** + * @deprecated Use + * {@link #setSourceImage(BufferedImage, int, int, int, int)} and + * {@link #compress(int)} instead. + */ + @SuppressWarnings("checkstyle:JavadocMethod") + @Deprecated + public byte[] compress(BufferedImage srcImage, int flags) + throws TJException { + setSourceImage(srcImage, 0, 0, 0, 0); + return compress(flags); + } + + /** + * 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 + * conversion routines in TurboJPEG's underlying codec but does not execute + * any of the other steps in the JPEG compression process. Encoding + * CMYK source images to YUV is not supported. + * + * @param dstImage {@link YUVImage} instance that will receive the YUV planar + * image + * + * @param flags the bitwise OR of one or more of + * {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*} + */ + 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) + throw new IllegalStateException(NO_ASSOC_ERROR); + if (srcYUVImage != null) + throw new IllegalStateException("Source image is not correct type"); + checkSubsampling(); + if (srcWidth != dstImage.getWidth() || srcHeight != dstImage.getHeight()) + throw new IllegalStateException("Destination image is the wrong size"); + + if (srcBufInt != null) { + encodeYUV(srcBufInt, srcX, srcY, srcWidth, srcStride, srcHeight, + srcPixelFormat, dstImage.getPlanes(), dstImage.getOffsets(), + dstImage.getStrides(), dstImage.getSubsamp(), flags); + } else { + encodeYUV(srcBuf, srcX, srcY, srcWidth, srcPitch, srcHeight, + srcPixelFormat, dstImage.getPlanes(), dstImage.getOffsets(), + dstImage.getStrides(), dstImage.getSubsamp(), flags); + } + compressedSize = 0; + } + + /** + * @deprecated Use {@link #encodeYUV(YUVImage, int)} instead. + */ + @SuppressWarnings("checkstyle:JavadocMethod") + @Deprecated + public void encodeYUV(byte[] dstBuf, int flags) throws TJException { + if (dstBuf == null) + throw new IllegalArgumentException("Invalid argument in encodeYUV()"); + checkSourceImage(); + checkSubsampling(); + YUVImage dstYUVImage = new YUVImage(dstBuf, srcWidth, 4, srcHeight, + subsamp); + encodeYUV(dstYUVImage, flags); + } + + /** + * 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 + * uses the accelerated color conversion routines in TurboJPEG's underlying + * codec but does not execute any of the other steps in the JPEG compression + * process. Encoding CMYK source images to YUV is not supported. + * + * @param pad the width of each line in each plane of the YUV image will be + * padded to the nearest multiple of this number of bytes (must be a power of + * 2.) + * + * @param flags the bitwise OR of one or more of + * {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*} + * + * @return a YUV planar image. + */ + public YUVImage encodeYUV(int pad, int flags) throws TJException { + checkSourceImage(); + checkSubsampling(); + if (pad < 1 || ((pad & (pad - 1)) != 0)) + throw new IllegalStateException("Invalid argument in encodeYUV()"); + YUVImage dstYUVImage = new YUVImage(srcWidth, pad, srcHeight, subsamp); + encodeYUV(dstYUVImage, flags); + return dstYUVImage; + } + + /** + * 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 + * method uses the accelerated color conversion routines in TurboJPEG's + * underlying codec but does not execute any of the other steps in the JPEG + * compression process. Encoding CMYK source images to YUV is not supported. + * + * @param strides an array of integers, each specifying the number of bytes + * per line in the corresponding plane of the output image. Setting the + * stride for any plane to 0 is the same as setting it to the component width + * of the plane. If <code>strides</code> is null, then the strides for all + * planes will be set to their respective component widths. You can adjust + * the strides in order to add an arbitrary amount of line padding to each + * plane. + * + * @param flags the bitwise OR of one or more of + * {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*} + * + * @return a YUV planar image. + */ + public YUVImage encodeYUV(int[] strides, int flags) throws TJException { + checkSourceImage(); + checkSubsampling(); + YUVImage dstYUVImage = new YUVImage(srcWidth, strides, srcHeight, subsamp); + encodeYUV(dstYUVImage, flags); + return dstYUVImage; + } + + /** + * @deprecated Use {@link #encodeYUV(int, int)} instead. + */ + @SuppressWarnings("checkstyle:JavadocMethod") + @Deprecated + public byte[] encodeYUV(int flags) throws TJException { + checkSourceImage(); + checkSubsampling(); + YUVImage dstYUVImage = new YUVImage(srcWidth, 4, srcHeight, subsamp); + encodeYUV(dstYUVImage, flags); + return dstYUVImage.getBuf(); + } + + /** + * @deprecated Use + * {@link #setSourceImage(BufferedImage, int, int, int, int)} and + * {@link #encodeYUV(byte[], int)} instead. + */ + @SuppressWarnings("checkstyle:JavadocMethod") + @Deprecated + public void encodeYUV(BufferedImage srcImage, byte[] dstBuf, int flags) + throws TJException { + setSourceImage(srcImage, 0, 0, 0, 0); + encodeYUV(dstBuf, flags); + } + + /** + * @deprecated Use + * {@link #setSourceImage(BufferedImage, int, int, int, int)} and + * {@link #encodeYUV(int, int)} instead. + */ + @SuppressWarnings("checkstyle:JavadocMethod") + @Deprecated + public byte[] encodeYUV(BufferedImage srcImage, int flags) + throws TJException { + setSourceImage(srcImage, 0, 0, 0, 0); + return encodeYUV(flags); + } + + /** + * Returns the size of the image (in bytes) generated by the most recent + * compress operation. + * + * @return the size of the image (in bytes) generated by the most recent + * compress operation. + */ + public int getCompressedSize() { + return compressedSize; + } + + /** + * Free the native structures associated with this compressor instance. + */ + @Override + public void close() throws TJException { + if (handle != 0) + destroy(); + } + + @SuppressWarnings("checkstyle:DesignForExtension") + @Override + protected void finalize() throws Throwable { + try { + close(); + } catch (TJException e) { + } finally { + super.finalize(); + } + }; + + private native void init() throws TJException; + + private native void destroy() throws TJException; + + // JPEG size in bytes is returned + @SuppressWarnings("checkstyle:HiddenField") + @Deprecated + private native int compress(byte[] srcBuf, int width, int pitch, + int height, int pixelFormat, byte[] jpegBuf, int jpegSubsamp, int jpegQual, + int flags) throws TJException; + + @SuppressWarnings("checkstyle:HiddenField") + private native int compress(byte[] srcBuf, int x, int y, int width, + int pitch, int height, int pixelFormat, byte[] jpegBuf, int jpegSubsamp, + int jpegQual, int flags) throws TJException; + + @SuppressWarnings("checkstyle:HiddenField") + @Deprecated + private native int compress(int[] srcBuf, int width, int stride, + int height, int pixelFormat, byte[] jpegBuf, int jpegSubsamp, int jpegQual, + int flags) throws TJException; + + @SuppressWarnings("checkstyle:HiddenField") + private native int compress(int[] srcBuf, int x, int y, int width, + int stride, int height, int pixelFormat, byte[] jpegBuf, int jpegSubsamp, + int jpegQual, int flags) throws TJException; + + @SuppressWarnings("checkstyle:HiddenField") + private native int compressFromYUV(byte[][] srcPlanes, int[] srcOffsets, + int width, int[] srcStrides, int height, int subsamp, byte[] jpegBuf, + int jpegQual, int flags) + throws TJException; + + @SuppressWarnings("checkstyle:HiddenField") + @Deprecated + private native void encodeYUV(byte[] srcBuf, int width, int pitch, + int height, int pixelFormat, byte[] dstBuf, int subsamp, int flags) + throws TJException; + + @SuppressWarnings("checkstyle:HiddenField") + 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 TJException; + + @SuppressWarnings("checkstyle:HiddenField") + @Deprecated + private native void encodeYUV(int[] srcBuf, int width, int stride, + int height, int pixelFormat, byte[] dstBuf, int subsamp, int flags) + throws TJException; + + @SuppressWarnings("checkstyle:HiddenField") + 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 TJException; + + static { + TJLoader.load(); + } + + private void checkSourceImage() { + if (srcWidth < 1 || srcHeight < 1) + throw new IllegalStateException(NO_ASSOC_ERROR); + } + + private void checkSubsampling() { + if (subsamp < 0) + throw new IllegalStateException("Subsampling level not set"); + } + + private long handle = 0; + private byte[] srcBuf = null; + private int[] srcBufInt = null; + private int srcWidth = 0; + private int srcHeight = 0; + private int srcX = -1; + private int srcY = -1; + private int srcPitch = 0; + private int srcStride = 0; + private int srcPixelFormat = -1; + private YUVImage srcYUVImage = null; + private int subsamp = -1; + private int jpegQuality = -1; + private int compressedSize = 0; + private int yuvPad = 4; + private ByteOrder byteOrder = null; +}
diff --git a/src/third_party/libjpeg-turbo/java/org/libjpegturbo/turbojpeg/TJCustomFilter.java b/src/third_party/libjpeg-turbo/java/org/libjpegturbo/turbojpeg/TJCustomFilter.java new file mode 100644 index 0000000..9a34587 --- /dev/null +++ b/src/third_party/libjpeg-turbo/java/org/libjpegturbo/turbojpeg/TJCustomFilter.java
@@ -0,0 +1,76 @@ +/* + * Copyright (C)2011, 2013 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: + * + * - 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.awt.*; +import java.nio.*; + +/** + * Custom filter callback interface + */ +public interface TJCustomFilter { + + /** + * 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 + * applied in the frequency domain. + * + * @param coeffBuffer a buffer containing transformed DCT coefficients. + * (NOTE: this buffer is not guaranteed to be valid once the callback + * returns, so applications wishing to hand off the DCT coefficients to + * another function or library should make a copy of them within the body of + * the callback.) + * + * @param bufferRegion rectangle containing the width and height of + * <code>coeffBuffer</code> as well as its offset relative to the component + * plane. TurboJPEG implementations may choose to split each component plane + * into multiple DCT coefficient buffers and call the callback function once + * for each buffer. + * + * @param planeRegion rectangle containing the width and height of the + * component plane to which <code>coeffBuffer</code> belongs + * + * @param componentID ID number of the component plane to which + * <code>coeffBuffer</code> belongs (Y, Cb, and Cr have, respectively, ID's + * of 0, 1, and 2 in typical JPEG images.) + * + * @param transformID ID number of the transformed image to which + * <code>coeffBuffer</code> belongs. This is the same as the index of the + * transform in the <code>transforms</code> array that was passed to {@link + * TJTransformer#transform TJTransformer.transform()}. + * + * @param transform a {@link TJTransform} instance that specifies the + * parameters and/or cropping region for this transform + */ + void customFilter(ShortBuffer coeffBuffer, Rectangle bufferRegion, + Rectangle planeRegion, int componentID, int transformID, + TJTransform transform) + throws TJException; +}
diff --git a/src/third_party/libjpeg-turbo/java/org/libjpegturbo/turbojpeg/TJDecompressor.java b/src/third_party/libjpeg-turbo/java/org/libjpegturbo/turbojpeg/TJDecompressor.java new file mode 100644 index 0000000..cba9ff0 --- /dev/null +++ b/src/third_party/libjpeg-turbo/java/org/libjpegturbo/turbojpeg/TJDecompressor.java
@@ -0,0 +1,931 @@ +/* + * Copyright (C)2011-2015, 2018 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: + * + * - 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.awt.image.*; +import java.nio.*; +import java.io.*; + +/** + * TurboJPEG decompressor + */ +public class TJDecompressor implements Closeable { + + private static final String NO_ASSOC_ERROR = + "No JPEG image is associated with this instance"; + + /** + * Create a TurboJPEG decompresssor instance. + */ + public TJDecompressor() throws TJException { + init(); + } + + /** + * Create a TurboJPEG decompressor instance and associate the JPEG source + * image stored in <code>jpegImage</code> with the newly created instance. + * + * @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 TJException { + init(); + setSourceImage(jpegImage, jpegImage.length); + } + + /** + * 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. + * + * @param jpegImage JPEG image buffer. This buffer is not modified. + * + * @param imageSize size of the JPEG image (in bytes) + */ + public TJDecompressor(byte[] jpegImage, int imageSize) throws TJException { + init(); + setSourceImage(jpegImage, imageSize); + } + + /** + * Create a TurboJPEG decompressor instance and associate the YUV planar + * source image stored in <code>yuvImage</code> with the newly created + * instance. + * + * @param yuvImage {@link YUVImage} instance containing a YUV planar + * image to be decoded. This image is not modified. + */ + @SuppressWarnings("checkstyle:HiddenField") + public TJDecompressor(YUVImage yuvImage) throws TJException { + init(); + setSourceImage(yuvImage); + } + + /** + * 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. + * + * @param jpegImage JPEG image buffer. This buffer is not modified. + * + * @param imageSize size of the JPEG image (in bytes) + */ + public void setSourceImage(byte[] jpegImage, int imageSize) + throws TJException { + if (jpegImage == null || imageSize < 1) + throw new IllegalArgumentException("Invalid argument in setSourceImage()"); + jpegBuf = jpegImage; + jpegBufSize = imageSize; + decompressHeader(jpegBuf, jpegBufSize); + yuvImage = null; + } + + /** + * @deprecated Use {@link #setSourceImage(byte[], int)} instead. + */ + @SuppressWarnings("checkstyle:JavadocMethod") + @Deprecated + public void setJPEGImage(byte[] jpegImage, int imageSize) + throws TJException { + setSourceImage(jpegImage, imageSize); + } + + /** + * 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. + * + * @param srcImage {@link YUVImage} instance containing a YUV planar image to + * be decoded. This image is not modified. + */ + public void setSourceImage(YUVImage srcImage) { + if (srcImage == null) + throw new IllegalArgumentException("Invalid argument in setSourceImage()"); + yuvImage = srcImage; + jpegBuf = null; + jpegBufSize = 0; + } + + + /** + * Returns the width of the source image (JPEG or YUV) associated with this + * decompressor instance. + * + * @return the width of the source image (JPEG or YUV) associated with this + * decompressor instance. + */ + public int getWidth() { + if (yuvImage != null) + return yuvImage.getWidth(); + if (jpegWidth < 1) + throw new IllegalStateException(NO_ASSOC_ERROR); + return jpegWidth; + } + + /** + * Returns the height of the source image (JPEG or YUV) associated with this + * decompressor instance. + * + * @return the height of the source image (JPEG or YUV) associated with this + * decompressor instance. + */ + public int getHeight() { + if (yuvImage != null) + return yuvImage.getHeight(); + if (jpegHeight < 1) + throw new IllegalStateException(NO_ASSOC_ERROR); + return jpegHeight; + } + + /** + * Returns the level of chrominance subsampling used in the source image + * (JPEG or YUV) associated with this decompressor instance. See + * {@link TJ#SAMP_444 TJ.SAMP_*}. + * + * @return the level of chrominance subsampling used in the source image + * (JPEG or YUV) associated with this decompressor instance. + */ + public int getSubsamp() { + if (yuvImage != null) + return yuvImage.getSubsamp(); + if (jpegSubsamp < 0) + throw new IllegalStateException(NO_ASSOC_ERROR); + if (jpegSubsamp >= TJ.NUMSAMP) + throw new IllegalStateException("JPEG header information is invalid"); + return jpegSubsamp; + } + + /** + * Returns the colorspace used in the source image (JPEG or YUV) associated + * with this decompressor instance. See {@link TJ#CS_RGB TJ.CS_*}. If the + * source image is YUV, then this always returns {@link TJ#CS_YCbCr}. + * + * @return the colorspace used in the source image (JPEG or YUV) associated + * with this decompressor instance. + */ + public int getColorspace() { + if (yuvImage != null) + return TJ.CS_YCbCr; + if (jpegColorspace < 0) + throw new IllegalStateException(NO_ASSOC_ERROR); + if (jpegColorspace >= TJ.NUMCS) + throw new IllegalStateException("JPEG header information is invalid"); + return jpegColorspace; + } + + /** + * Returns the JPEG image buffer associated with this decompressor instance. + * + * @return the JPEG image buffer associated with this decompressor instance. + */ + public byte[] getJPEGBuf() { + if (jpegBuf == null) + throw new IllegalStateException(NO_ASSOC_ERROR); + return jpegBuf; + } + + /** + * Returns the size of the JPEG image (in bytes) associated with this + * decompressor instance. + * + * @return the size of the JPEG image (in bytes) associated with this + * decompressor instance. + */ + public int getJPEGSize() { + if (jpegBufSize < 1) + throw new IllegalStateException(NO_ASSOC_ERROR); + return jpegBufSize; + } + + /** + * Returns the width of the largest scaled-down image that the TurboJPEG + * decompressor can generate without exceeding the desired image width and + * height. + * + * @param desiredWidth desired width (in pixels) of the decompressed image. + * Setting this to 0 is the same as setting it to the width of the JPEG image + * (in other words, the width will not be considered when determining the + * scaled image size.) + * + * @param desiredHeight desired height (in pixels) of the decompressed image. + * Setting this to 0 is the same as setting it to the height of the JPEG + * image (in other words, the height will not be considered when determining + * the scaled image size.) + * + * @return the width of the largest scaled-down image that the TurboJPEG + * decompressor can generate without exceeding the desired image width and + * height. + */ + public int getScaledWidth(int desiredWidth, int desiredHeight) { + if (jpegWidth < 1 || jpegHeight < 1) + throw new IllegalStateException(NO_ASSOC_ERROR); + if (desiredWidth < 0 || desiredHeight < 0) + throw new IllegalArgumentException("Invalid argument in getScaledWidth()"); + TJScalingFactor[] sf = TJ.getScalingFactors(); + if (desiredWidth == 0) + desiredWidth = jpegWidth; + if (desiredHeight == 0) + desiredHeight = jpegHeight; + int scaledWidth = jpegWidth, scaledHeight = jpegHeight; + for (int i = 0; i < sf.length; i++) { + scaledWidth = sf[i].getScaled(jpegWidth); + scaledHeight = sf[i].getScaled(jpegHeight); + if (scaledWidth <= desiredWidth && scaledHeight <= desiredHeight) + break; + } + if (scaledWidth > desiredWidth || scaledHeight > desiredHeight) + throw new IllegalArgumentException("Could not scale down to desired image dimensions"); + return scaledWidth; + } + + /** + * Returns the height of the largest scaled-down image that the TurboJPEG + * decompressor can generate without exceeding the desired image width and + * height. + * + * @param desiredWidth desired width (in pixels) of the decompressed image. + * Setting this to 0 is the same as setting it to the width of the JPEG image + * (in other words, the width will not be considered when determining the + * scaled image size.) + * + * @param desiredHeight desired height (in pixels) of the decompressed image. + * Setting this to 0 is the same as setting it to the height of the JPEG + * image (in other words, the height will not be considered when determining + * the scaled image size.) + * + * @return the height of the largest scaled-down image that the TurboJPEG + * decompressor can generate without exceeding the desired image width and + * height. + */ + public int getScaledHeight(int desiredWidth, int desiredHeight) { + if (jpegWidth < 1 || jpegHeight < 1) + throw new IllegalStateException(NO_ASSOC_ERROR); + if (desiredWidth < 0 || desiredHeight < 0) + throw new IllegalArgumentException("Invalid argument in getScaledHeight()"); + TJScalingFactor[] sf = TJ.getScalingFactors(); + if (desiredWidth == 0) + desiredWidth = jpegWidth; + if (desiredHeight == 0) + desiredHeight = jpegHeight; + int scaledWidth = jpegWidth, scaledHeight = jpegHeight; + for (int i = 0; i < sf.length; i++) { + scaledWidth = sf[i].getScaled(jpegWidth); + scaledHeight = sf[i].getScaled(jpegHeight); + if (scaledWidth <= desiredWidth && scaledHeight <= desiredHeight) + break; + } + if (scaledWidth > desiredWidth || scaledHeight > desiredHeight) + throw new IllegalArgumentException("Could not scale down to desired image dimensions"); + return scaledHeight; + } + + /** + * 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. + * <p> + * NOTE: The output image is fully recoverable if this method throws a + * non-fatal {@link TJException} (unless + * {@link TJ#FLAG_STOPONWARNING TJ.FLAG_STOPONWARNING} is specified.) + * + * @param dstBuf buffer that will receive the decompressed/decoded image. + * If the source image is a JPEG image, then this buffer should normally be + * <code>pitch * scaledHeight</code> bytes in size, where + * <code>scaledHeight</code> can be determined by calling <code> + * scalingFactor.{@link TJScalingFactor#getScaled getScaled}(jpegHeight) + * </code> with one of the scaling factors returned from {@link + * TJ#getScalingFactors} or by calling {@link #getScaledHeight}. If the + * source image is a YUV image, then this buffer should normally be + * <code>pitch * height</code> bytes in size, where <code>height</code> is + * the height of the YUV image. However, the buffer may also be larger than + * the dimensions of the source image, in which case the <code>x</code>, + * <code>y</code>, and <code>pitch</code> parameters can be used to specify + * the region into which the source image should be decompressed/decoded. + * + * @param x x offset (in pixels) of the region in the destination image into + * which the source image should be decompressed/decoded + * + * @param y y offset (in pixels) of the region in the destination image into + * which the source image should be decompressed/decoded + * + * @param desiredWidth If the source image is a JPEG image, then this + * specifies the desired width (in pixels) of the decompressed image (or + * image region.) If the desired destination image dimensions are different + * than the source image dimensions, then TurboJPEG will use scaling in the + * JPEG decompressor to generate the largest possible image that will fit + * within the desired dimensions. Setting this to 0 is the same as setting + * it to the width of the JPEG image (in other words, the width will not be + * considered when determining the scaled image size.) This parameter is + * ignored if the source image is a YUV image. + * + * @param pitch bytes per line of the destination image. Normally, this + * should be set to <code>scaledWidth * TJ.pixelSize(pixelFormat)</code> if + * the destination image is unpadded, but you can use this to, for instance, + * pad each line of the destination image to a 4-byte boundary or to + * decompress/decode the source image into a region of a larger image. NOTE: + * if the source image is a JPEG image, then <code>scaledWidth</code> can be + * determined by calling <code> + * scalingFactor.{@link TJScalingFactor#getScaled getScaled}(jpegWidth) + * </code> or by calling {@link #getScaledWidth}. If the source image is a + * YUV image, then <code>scaledWidth</code> is the width of the YUV image. + * Setting this parameter to 0 is the equivalent of setting it to + * <code>scaledWidth * TJ.pixelSize(pixelFormat)</code>. + * + * @param desiredHeight If the source image is a JPEG image, then this + * specifies the desired height (in pixels) of the decompressed image (or + * image region.) If the desired destination image dimensions are different + * than the source image dimensions, then TurboJPEG will use scaling in the + * JPEG decompressor to generate the largest possible image that will fit + * within the desired dimensions. Setting this to 0 is the same as setting + * it to the height of the JPEG image (in other words, the height will not be + * considered when determining the scaled image size.) This parameter is + * ignored if the source image is a YUV image. + * + * @param pixelFormat pixel format of the decompressed/decoded image (one of + * {@link TJ#PF_RGB TJ.PF_*}) + * + * @param flags the bitwise OR of one or more of + * {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*} + */ + public void decompress(byte[] dstBuf, int x, int y, int desiredWidth, + int pitch, int desiredHeight, int pixelFormat, + int flags) throws TJException { + if (jpegBuf == null && yuvImage == null) + throw new IllegalStateException(NO_ASSOC_ERROR); + if (dstBuf == null || x < 0 || y < 0 || pitch < 0 || + (yuvImage != null && (desiredWidth < 0 || desiredHeight < 0)) || + pixelFormat < 0 || pixelFormat >= TJ.NUMPF || flags < 0) + throw new IllegalArgumentException("Invalid argument in decompress()"); + if (yuvImage != null) + decodeYUV(yuvImage.getPlanes(), yuvImage.getOffsets(), + yuvImage.getStrides(), yuvImage.getSubsamp(), dstBuf, x, y, + yuvImage.getWidth(), pitch, yuvImage.getHeight(), pixelFormat, + flags); + else { + if (x > 0 || y > 0) + decompress(jpegBuf, jpegBufSize, dstBuf, x, y, desiredWidth, pitch, + desiredHeight, pixelFormat, flags); + else + decompress(jpegBuf, jpegBufSize, dstBuf, desiredWidth, pitch, + desiredHeight, pixelFormat, flags); + } + } + + /** + * @deprecated Use + * {@link #decompress(byte[], int, int, int, int, int, int, int)} instead. + */ + @SuppressWarnings("checkstyle:JavadocMethod") + @Deprecated + public void decompress(byte[] dstBuf, int desiredWidth, int pitch, + int desiredHeight, int pixelFormat, int flags) + throws TJException { + decompress(dstBuf, 0, 0, desiredWidth, pitch, desiredHeight, pixelFormat, + flags); + } + + /** + * Decompress the JPEG source image associated with this decompressor + * instance and return a buffer containing the decompressed image. + * + * @param desiredWidth see + * {@link #decompress(byte[], int, int, int, int, int, int, int)} + * for description + * + * @param pitch see + * {@link #decompress(byte[], int, int, int, int, int, int, int)} + * for description + * + * @param desiredHeight see + * {@link #decompress(byte[], int, int, int, int, int, int, int)} + * for description + * + * @param pixelFormat pixel format of the decompressed image (one of + * {@link TJ#PF_RGB TJ.PF_*}) + * + * @param flags the bitwise OR of one or more of + * {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*} + * + * @return a buffer containing the decompressed image. + */ + public byte[] decompress(int desiredWidth, int pitch, int desiredHeight, + int pixelFormat, int flags) throws TJException { + if (pitch < 0 || + (yuvImage == null && (desiredWidth < 0 || desiredHeight < 0)) || + pixelFormat < 0 || pixelFormat >= TJ.NUMPF || flags < 0) + throw new IllegalArgumentException("Invalid argument in decompress()"); + int pixelSize = TJ.getPixelSize(pixelFormat); + int scaledWidth = getScaledWidth(desiredWidth, desiredHeight); + int scaledHeight = getScaledHeight(desiredWidth, desiredHeight); + if (pitch == 0) + pitch = scaledWidth * pixelSize; + byte[] buf = new byte[pitch * scaledHeight]; + decompress(buf, desiredWidth, pitch, desiredHeight, pixelFormat, flags); + return buf; + } + + /** + * 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 + * but leaves out the color conversion step, so a planar YUV image is + * generated instead of an RGB or grayscale image. This method cannot be + * used to decompress JPEG source images with the CMYK or YCCK colorspace. + * <p> + * NOTE: The YUV planar output image is fully recoverable if this method + * throws a non-fatal {@link TJException} (unless + * {@link TJ#FLAG_STOPONWARNING TJ.FLAG_STOPONWARNING} is specified.) + * + * @param dstImage {@link YUVImage} instance that will receive the YUV planar + * image. The level of subsampling specified in this <code>YUVImage</code> + * instance must match that of the JPEG image, and the width and height + * specified in the <code>YUVImage</code> instance must match one of the + * scaled image sizes that TurboJPEG is capable of generating from the JPEG + * source image. + * + * @param flags the bitwise OR of one or more of + * {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*} + */ + public void decompressToYUV(YUVImage dstImage, int flags) + throws TJException { + if (jpegBuf == null) + throw new IllegalStateException(NO_ASSOC_ERROR); + if (dstImage == null || flags < 0) + throw new IllegalArgumentException("Invalid argument in decompressToYUV()"); + int scaledWidth = getScaledWidth(dstImage.getWidth(), + dstImage.getHeight()); + int scaledHeight = getScaledHeight(dstImage.getWidth(), + dstImage.getHeight()); + if (scaledWidth != dstImage.getWidth() || + scaledHeight != dstImage.getHeight()) + throw new IllegalArgumentException("YUVImage dimensions do not match one of the scaled image sizes that TurboJPEG is capable of generating."); + if (jpegSubsamp != dstImage.getSubsamp()) + throw new IllegalArgumentException("YUVImage subsampling level does not match that of the JPEG image"); + + decompressToYUV(jpegBuf, jpegBufSize, dstImage.getPlanes(), + dstImage.getOffsets(), dstImage.getWidth(), + dstImage.getStrides(), dstImage.getHeight(), flags); + } + + /** + * @deprecated Use {@link #decompressToYUV(YUVImage, int)} instead. + */ + @SuppressWarnings("checkstyle:JavadocMethod") + @Deprecated + public void decompressToYUV(byte[] dstBuf, int flags) throws TJException { + YUVImage dstYUVImage = new YUVImage(dstBuf, jpegWidth, 4, jpegHeight, + jpegSubsamp); + decompressToYUV(dstYUVImage, flags); + } + + /** + * 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. + * This method performs JPEG decompression but leaves out the color + * conversion step, so a planar YUV image is generated instead of an RGB or + * grayscale image. This method cannot be used to decompress JPEG source + * images with the CMYK or YCCK colorspace. + * + * @param desiredWidth desired width (in pixels) of the YUV image. If the + * desired image dimensions are different than the dimensions of the JPEG + * image being decompressed, then TurboJPEG will use scaling in the JPEG + * decompressor to generate the largest possible image that will fit within + * the desired dimensions. Setting this to 0 is the same as setting it to + * the width of the JPEG image (in other words, the width will not be + * considered when determining the scaled image size.) + * + * @param strides an array of integers, each specifying the number of bytes + * per line in the corresponding plane of the output image. Setting the + * stride for any plane to 0 is the same as setting it to the scaled + * component width of the plane. If <tt>strides</tt> is NULL, then the + * strides for all planes will be set to their respective scaled component + * widths. You can adjust the strides in order to add an arbitrary amount of + * line padding to each plane. + * + * @param desiredHeight desired height (in pixels) of the YUV image. If the + * desired image dimensions are different than the dimensions of the JPEG + * image being decompressed, then TurboJPEG will use scaling in the JPEG + * decompressor to generate the largest possible image that will fit within + * the desired dimensions. Setting this to 0 is the same as setting it to + * the height of the JPEG image (in other words, the height will not be + * considered when determining the scaled image size.) + * + * @param flags the bitwise OR of one or more of + * {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*} + * + * @return a YUV planar image. + */ + public YUVImage decompressToYUV(int desiredWidth, int[] strides, + int desiredHeight, + int flags) throws TJException { + if (flags < 0) + throw new IllegalArgumentException("Invalid argument in decompressToYUV()"); + if (jpegWidth < 1 || jpegHeight < 1 || jpegSubsamp < 0) + throw new IllegalStateException(NO_ASSOC_ERROR); + if (jpegSubsamp >= TJ.NUMSAMP) + throw new IllegalStateException("JPEG header information is invalid"); + if (yuvImage != null) + throw new IllegalStateException("Source image is the wrong type"); + + int scaledWidth = getScaledWidth(desiredWidth, desiredHeight); + int scaledHeight = getScaledHeight(desiredWidth, desiredHeight); + YUVImage dstYUVImage = new YUVImage(scaledWidth, null, scaledHeight, + jpegSubsamp); + decompressToYUV(dstYUVImage, flags); + return dstYUVImage; + } + + /** + * 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 + * method performs JPEG decompression but leaves out the color conversion + * step, so a planar YUV image is generated instead of an RGB or grayscale + * image. This method cannot be used to decompress JPEG source images with + * the CMYK or YCCK colorspace. + * + * @param desiredWidth desired width (in pixels) of the YUV image. If the + * desired image dimensions are different than the dimensions of the JPEG + * image being decompressed, then TurboJPEG will use scaling in the JPEG + * decompressor to generate the largest possible image that will fit within + * the desired dimensions. Setting this to 0 is the same as setting it to + * the width of the JPEG image (in other words, the width will not be + * considered when determining the scaled image size.) + * + * @param pad the width of each line in each plane of the YUV image will be + * padded to the nearest multiple of this number of bytes (must be a power of + * 2.) + * + * @param desiredHeight desired height (in pixels) of the YUV image. If the + * desired image dimensions are different than the dimensions of the JPEG + * image being decompressed, then TurboJPEG will use scaling in the JPEG + * decompressor to generate the largest possible image that will fit within + * the desired dimensions. Setting this to 0 is the same as setting it to + * the height of the JPEG image (in other words, the height will not be + * considered when determining the scaled image size.) + * + * @param flags the bitwise OR of one or more of + * {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*} + * + * @return a YUV planar image. + */ + public YUVImage decompressToYUV(int desiredWidth, int pad, int desiredHeight, + int flags) throws TJException { + if (flags < 0) + throw new IllegalArgumentException("Invalid argument in decompressToYUV()"); + if (jpegWidth < 1 || jpegHeight < 1 || jpegSubsamp < 0) + throw new IllegalStateException(NO_ASSOC_ERROR); + if (jpegSubsamp >= TJ.NUMSAMP) + throw new IllegalStateException("JPEG header information is invalid"); + if (yuvImage != null) + throw new IllegalStateException("Source image is the wrong type"); + + int scaledWidth = getScaledWidth(desiredWidth, desiredHeight); + int scaledHeight = getScaledHeight(desiredWidth, desiredHeight); + YUVImage dstYUVImage = new YUVImage(scaledWidth, pad, scaledHeight, + jpegSubsamp); + decompressToYUV(dstYUVImage, flags); + return dstYUVImage; + } + + /** + * @deprecated Use {@link #decompressToYUV(int, int, int, int)} instead. + */ + @SuppressWarnings("checkstyle:JavadocMethod") + @Deprecated + public byte[] decompressToYUV(int flags) throws TJException { + YUVImage dstYUVImage = new YUVImage(jpegWidth, 4, jpegHeight, jpegSubsamp); + decompressToYUV(dstYUVImage, flags); + return dstYUVImage.getBuf(); + } + + /** + * 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. + * <p> + * NOTE: The output image is fully recoverable if this method throws a + * non-fatal {@link TJException} (unless + * {@link TJ#FLAG_STOPONWARNING TJ.FLAG_STOPONWARNING} is specified.) + * + * @param dstBuf buffer that will receive the decompressed/decoded image. + * If the source image is a JPEG image, then this buffer should normally be + * <code>stride * scaledHeight</code> pixels in size, where + * <code>scaledHeight</code> can be determined by calling <code> + * scalingFactor.{@link TJScalingFactor#getScaled getScaled}(jpegHeight) + * </code> with one of the scaling factors returned from {@link + * TJ#getScalingFactors} or by calling {@link #getScaledHeight}. If the + * source image is a YUV image, then this buffer should normally be + * <code>stride * height</code> pixels in size, where <code>height</code> is + * the height of the YUV image. However, the buffer may also be larger than + * the dimensions of the JPEG image, in which case the <code>x</code>, + * <code>y</code>, and <code>stride</code> parameters can be used to specify + * the region into which the source image should be decompressed. + * + * @param x x offset (in pixels) of the region in the destination image into + * which the source image should be decompressed/decoded + * + * @param y y offset (in pixels) of the region in the destination image into + * which the source image should be decompressed/decoded + * + * @param desiredWidth If the source image is a JPEG image, then this + * specifies the desired width (in pixels) of the decompressed image (or + * image region.) If the desired destination image dimensions are different + * than the source image dimensions, then TurboJPEG will use scaling in the + * JPEG decompressor to generate the largest possible image that will fit + * within the desired dimensions. Setting this to 0 is the same as setting + * it to the width of the JPEG image (in other words, the width will not be + * considered when determining the scaled image size.) This parameter is + * ignored if the source image is a YUV image. + * + * @param stride pixels per line of the destination image. Normally, this + * should be set to <code>scaledWidth</code>, but you can use this to, for + * instance, decompress the JPEG image into a region of a larger image. + * NOTE: if the source image is a JPEG image, then <code>scaledWidth</code> + * can be determined by calling <code> + * scalingFactor.{@link TJScalingFactor#getScaled getScaled}(jpegWidth) + * </code> or by calling {@link #getScaledWidth}. If the source image is a + * YUV image, then <code>scaledWidth</code> is the width of the YUV image. + * Setting this parameter to 0 is the equivalent of setting it to + * <code>scaledWidth</code>. + * + * @param desiredHeight If the source image is a JPEG image, then this + * specifies the desired height (in pixels) of the decompressed image (or + * image region.) If the desired destination image dimensions are different + * than the source image dimensions, then TurboJPEG will use scaling in the + * JPEG decompressor to generate the largest possible image that will fit + * within the desired dimensions. Setting this to 0 is the same as setting + * it to the height of the JPEG image (in other words, the height will not be + * considered when determining the scaled image size.) This parameter is + * ignored if the source image is a YUV image. + * + * @param pixelFormat pixel format of the decompressed image (one of + * {@link TJ#PF_RGB TJ.PF_*}) + * + * @param flags the bitwise OR of one or more of + * {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*} + */ + public void decompress(int[] dstBuf, int x, int y, int desiredWidth, + int stride, int desiredHeight, int pixelFormat, + int flags) throws TJException { + if (jpegBuf == null && yuvImage == null) + throw new IllegalStateException(NO_ASSOC_ERROR); + if (dstBuf == null || x < 0 || y < 0 || stride < 0 || + (yuvImage != null && (desiredWidth < 0 || desiredHeight < 0)) || + pixelFormat < 0 || pixelFormat >= TJ.NUMPF || flags < 0) + throw new IllegalArgumentException("Invalid argument in decompress()"); + if (yuvImage != null) + decodeYUV(yuvImage.getPlanes(), yuvImage.getOffsets(), + yuvImage.getStrides(), yuvImage.getSubsamp(), dstBuf, x, y, + yuvImage.getWidth(), stride, yuvImage.getHeight(), pixelFormat, + flags); + else + decompress(jpegBuf, jpegBufSize, dstBuf, x, y, desiredWidth, stride, + desiredHeight, pixelFormat, flags); + } + + /** + * 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. + * <p> + * NOTE: The output image is fully recoverable if this method throws a + * non-fatal {@link TJException} (unless + * {@link TJ#FLAG_STOPONWARNING TJ.FLAG_STOPONWARNING} is specified.) + * + * @param dstImage a <code>BufferedImage</code> instance that will receive + * the decompressed/decoded image. If the source image is a JPEG image, then + * the width and height of the <code>BufferedImage</code> instance must match + * one of the scaled image sizes that TurboJPEG is capable of generating from + * the JPEG image. If the source image is a YUV image, then the width and + * height of the <code>BufferedImage</code> instance must match the width and + * height of the YUV image. + * + * @param flags the bitwise OR of one or more of + * {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*} + */ + 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(); + int desiredHeight = dstImage.getHeight(); + int scaledWidth, scaledHeight; + + if (yuvImage != null) { + if (desiredWidth != yuvImage.getWidth() || + desiredHeight != yuvImage.getHeight()) + throw new IllegalArgumentException("BufferedImage dimensions do not match the dimensions of the source image."); + scaledWidth = yuvImage.getWidth(); + scaledHeight = yuvImage.getHeight(); + } else { + scaledWidth = getScaledWidth(desiredWidth, desiredHeight); + scaledHeight = getScaledHeight(desiredWidth, desiredHeight); + if (scaledWidth != desiredWidth || scaledHeight != desiredHeight) + throw new IllegalArgumentException("BufferedImage dimensions do not match one of the scaled image sizes that TurboJPEG is capable of generating."); + } + int pixelFormat; boolean intPixels = false; + if (byteOrder == null) + byteOrder = ByteOrder.nativeOrder(); + switch (dstImage.getType()) { + case BufferedImage.TYPE_3BYTE_BGR: + pixelFormat = TJ.PF_BGR; break; + case BufferedImage.TYPE_4BYTE_ABGR: + case BufferedImage.TYPE_4BYTE_ABGR_PRE: + pixelFormat = TJ.PF_XBGR; break; + case BufferedImage.TYPE_BYTE_GRAY: + pixelFormat = TJ.PF_GRAY; break; + case BufferedImage.TYPE_INT_BGR: + if (byteOrder == ByteOrder.BIG_ENDIAN) + pixelFormat = TJ.PF_XBGR; + else + pixelFormat = TJ.PF_RGBX; + intPixels = true; break; + case BufferedImage.TYPE_INT_RGB: + if (byteOrder == ByteOrder.BIG_ENDIAN) + pixelFormat = TJ.PF_XRGB; + else + pixelFormat = TJ.PF_BGRX; + intPixels = true; break; + case BufferedImage.TYPE_INT_ARGB: + case BufferedImage.TYPE_INT_ARGB_PRE: + if (byteOrder == ByteOrder.BIG_ENDIAN) + pixelFormat = TJ.PF_ARGB; + else + pixelFormat = TJ.PF_BGRA; + intPixels = true; break; + default: + throw new IllegalArgumentException("Unsupported BufferedImage format"); + } + WritableRaster wr = dstImage.getRaster(); + if (intPixels) { + SinglePixelPackedSampleModel sm = + (SinglePixelPackedSampleModel)dstImage.getSampleModel(); + int stride = sm.getScanlineStride(); + DataBufferInt db = (DataBufferInt)wr.getDataBuffer(); + int[] buf = db.getData(); + if (yuvImage != null) + decodeYUV(yuvImage.getPlanes(), yuvImage.getOffsets(), + yuvImage.getStrides(), yuvImage.getSubsamp(), buf, 0, 0, + yuvImage.getWidth(), stride, yuvImage.getHeight(), + pixelFormat, flags); + else { + if (jpegBuf == null) + throw new IllegalStateException(NO_ASSOC_ERROR); + decompress(jpegBuf, jpegBufSize, buf, 0, 0, scaledWidth, stride, + scaledHeight, pixelFormat, flags); + } + } else { + ComponentSampleModel sm = + (ComponentSampleModel)dstImage.getSampleModel(); + int pixelSize = sm.getPixelStride(); + if (pixelSize != TJ.getPixelSize(pixelFormat)) + throw new IllegalArgumentException("Inconsistency between pixel format and pixel size in BufferedImage"); + int pitch = sm.getScanlineStride(); + DataBufferByte db = (DataBufferByte)wr.getDataBuffer(); + byte[] buf = db.getData(); + decompress(buf, 0, 0, scaledWidth, pitch, scaledHeight, pixelFormat, + flags); + } + } + + /** + * 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. + * + * @param desiredWidth see + * {@link #decompress(byte[], int, int, int, int, int, int, int)} for + * description + * + * @param desiredHeight see + * {@link #decompress(byte[], int, int, int, int, int, int, int)} for + * description + * + * @param bufferedImageType the image type of the <code>BufferedImage</code> + * instance that will be created (for instance, + * <code>BufferedImage.TYPE_INT_RGB</code>) + * + * @param flags the bitwise OR of one or more of + * {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*} + * + * @return a <code>BufferedImage</code> instance containing the + * decompressed/decoded image. + */ + public BufferedImage decompress(int desiredWidth, int desiredHeight, + int bufferedImageType, int flags) + throws TJException { + if ((yuvImage == null && (desiredWidth < 0 || desiredHeight < 0)) || + flags < 0) + throw new IllegalArgumentException("Invalid argument in decompress()"); + int scaledWidth = getScaledWidth(desiredWidth, desiredHeight); + int scaledHeight = getScaledHeight(desiredWidth, desiredHeight); + BufferedImage img = new BufferedImage(scaledWidth, scaledHeight, + bufferedImageType); + decompress(img, flags); + return img; + } + + /** + * Free the native structures associated with this decompressor instance. + */ + @Override + public void close() throws TJException { + if (handle != 0) + destroy(); + } + + @SuppressWarnings("checkstyle:DesignForExtension") + @Override + protected void finalize() throws Throwable { + try { + close(); + } catch (TJException e) { + } finally { + super.finalize(); + } + }; + + private native void init() throws TJException; + + private native void destroy() throws TJException; + + private native void decompressHeader(byte[] srcBuf, int size) + throws TJException; + + @Deprecated + private native void decompress(byte[] srcBuf, int size, byte[] dstBuf, + int desiredWidth, int pitch, int desiredHeight, int pixelFormat, int flags) + 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 TJException; + + @Deprecated + private native void decompress(byte[] srcBuf, int size, int[] dstBuf, + int desiredWidth, int stride, int desiredHeight, int pixelFormat, + 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 TJException; + + @Deprecated + private native void decompressToYUV(byte[] srcBuf, int size, byte[] dstBuf, + 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 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 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 TJException; + + static { + TJLoader.load(); + } + + protected long handle = 0; + protected byte[] jpegBuf = null; + protected int jpegBufSize = 0; + protected YUVImage yuvImage = null; + protected int jpegWidth = 0; + protected int jpegHeight = 0; + protected int jpegSubsamp = -1; + protected int jpegColorspace = -1; + private ByteOrder byteOrder = null; +}
diff --git a/src/third_party/libjpeg-turbo/java/org/libjpegturbo/turbojpeg/TJException.java b/src/third_party/libjpeg-turbo/java/org/libjpegturbo/turbojpeg/TJException.java new file mode 100644 index 0000000..d03a256 --- /dev/null +++ b/src/third_party/libjpeg-turbo/java/org/libjpegturbo/turbojpeg/TJException.java
@@ -0,0 +1,78 @@ +/* + * Copyright (C)2015 Viktor Szathmáry. All Rights Reserved. + * Copyright (C)2017-2018 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: + * + * - 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; + +@SuppressWarnings("checkstyle:JavadocType") +public class TJException extends IOException { + + private static final long serialVersionUID = 1L; + + @SuppressWarnings("checkstyle:JavadocMethod") + public TJException() { + super(); + } + + @SuppressWarnings("checkstyle:JavadocMethod") + public TJException(String message, Throwable cause) { + super(message, cause); + } + + @SuppressWarnings("checkstyle:JavadocMethod") + public TJException(String message) { + super(message); + } + + @SuppressWarnings("checkstyle:JavadocMethod") + public TJException(String message, int code) { + super(message); + if (errorCode >= 0 && errorCode < TJ.NUMERR) + errorCode = code; + } + + @SuppressWarnings("checkstyle:JavadocMethod") + public TJException(Throwable cause) { + super(cause); + } + + /** + * Returns a code (one of {@link TJ TJ.ERR_*}) indicating the severity of the + * last error. + * + * @return a code (one of {@link TJ TJ.ERR_*}) indicating the severity of the + * last error. + */ + public int getErrorCode() { + return errorCode; + } + + private int errorCode = TJ.ERR_FATAL; +}
diff --git a/src/third_party/libjpeg-turbo/java/org/libjpegturbo/turbojpeg/TJLoader-unix.java.in b/src/third_party/libjpeg-turbo/java/org/libjpegturbo/turbojpeg/TJLoader-unix.java.in new file mode 100644 index 0000000..65884e8 --- /dev/null +++ b/src/third_party/libjpeg-turbo/java/org/libjpegturbo/turbojpeg/TJLoader-unix.java.in
@@ -0,0 +1,59 @@ +/* + * Copyright (C)2011-2013, 2016 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: + * + * - 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; + +final class TJLoader { + static void load() { + try { + System.loadLibrary("turbojpeg"); + } catch (java.lang.UnsatisfiedLinkError e) { + String os = System.getProperty("os.name").toLowerCase(); + if (os.indexOf("mac") >= 0) { + try { + System.load("@CMAKE_INSTALL_FULL_LIBDIR@/libturbojpeg.jnilib"); + } catch (java.lang.UnsatisfiedLinkError e2) { + System.load("/usr/lib/libturbojpeg.jnilib"); + } + } else { + try { + System.load("@CMAKE_INSTALL_FULL_LIBDIR@/libturbojpeg.so"); + } catch (java.lang.UnsatisfiedLinkError e3) { + String libdir = "@CMAKE_INSTALL_FULL_LIBDIR@"; + if (libdir.equals("@CMAKE_INSTALL_DEFAULT_PREFIX@/lib64")) { + System.load("@CMAKE_INSTALL_DEFAULT_PREFIX@/lib32/libturbojpeg.so"); + } else if (libdir.equals("@CMAKE_INSTALL_DEFAULT_PREFIX@/lib32")) { + System.load("@CMAKE_INSTALL_DEFAULT_PREFIX@/lib64/libturbojpeg.so"); + } else { + throw e3; + } + } + } + } + } +}
diff --git a/src/third_party/libjpeg-turbo/java/org/libjpegturbo/turbojpeg/TJLoader-win.java.in b/src/third_party/libjpeg-turbo/java/org/libjpegturbo/turbojpeg/TJLoader-win.java.in new file mode 100644 index 0000000..8397780 --- /dev/null +++ b/src/third_party/libjpeg-turbo/java/org/libjpegturbo/turbojpeg/TJLoader-win.java.in
@@ -0,0 +1,35 @@ +/* + * Copyright (C)2011 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: + * + * - 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; + +final class TJLoader { + static void load() { + System.loadLibrary("@TURBOJPEG_DLL_NAME@"); + } +}
diff --git a/src/third_party/libjpeg-turbo/java/org/libjpegturbo/turbojpeg/TJScalingFactor.java b/src/third_party/libjpeg-turbo/java/org/libjpegturbo/turbojpeg/TJScalingFactor.java new file mode 100644 index 0000000..ccf9179 --- /dev/null +++ b/src/third_party/libjpeg-turbo/java/org/libjpegturbo/turbojpeg/TJScalingFactor.java
@@ -0,0 +1,115 @@ +/* + * Copyright (C)2011, 2018 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: + * + * - 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; + +/** + * Fractional scaling factor + */ +public class TJScalingFactor { + + /** + * Create a TurboJPEG scaling factor instance. + * + * @param num numerator + * @param denom denominator + */ + @SuppressWarnings("checkstyle:HiddenField") + public TJScalingFactor(int num, int denom) { + if (num < 1 || denom < 1) + throw new IllegalArgumentException("Numerator and denominator must be >= 1"); + this.num = num; + this.denom = denom; + } + + /** + * Returns numerator + * + * @return numerator + */ + public int getNum() { + return num; + } + + /** + * Returns denominator + * + * @return denominator + */ + public int getDenom() { + return denom; + } + + /** + * Returns the scaled value of <code>dimension</code>. This function + * performs the integer equivalent of + * <code>ceil(dimension * scalingFactor)</code>. + * + * @param dimension width or height to multiply by this scaling factor + * + * @return the scaled value of <code>dimension</code>. + */ + public int getScaled(int dimension) { + return (dimension * num + denom - 1) / denom; + } + + /** + * Returns true or false, depending on whether this instance and + * <code>other</code> have the same numerator and denominator. + * + * @param other the scaling factor against which to compare this one + * + * @return true or false, depending on whether this instance and + * <code>other</code> have the same numerator and denominator. + */ + public boolean equals(TJScalingFactor other) { + return this.num == other.num && this.denom == other.denom; + } + + /** + * Returns true or false, depending on whether this instance is equal to + * 1/1. + * + * @return true or false, depending on whether this instance is equal to + * 1/1. + */ + public boolean isOne() { + return num == 1 && denom == 1; + } + + /** + * Numerator + */ + private int num = 1; + + /** + * Denominator + */ + private int denom = 1; +}
diff --git a/src/third_party/libjpeg-turbo/java/org/libjpegturbo/turbojpeg/TJTransform.java b/src/third_party/libjpeg-turbo/java/org/libjpegturbo/turbojpeg/TJTransform.java new file mode 100644 index 0000000..41c4b45 --- /dev/null +++ b/src/third_party/libjpeg-turbo/java/org/libjpegturbo/turbojpeg/TJTransform.java
@@ -0,0 +1,227 @@ +/* + * Copyright (C)2011, 2013, 2018 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: + * + * - 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.awt.*; + +/** + * Lossless transform parameters + */ +public class TJTransform extends Rectangle { + + private static final long serialVersionUID = -127367705761430371L; + + /** + * The number of lossless transform operations + */ + public static final int NUMOP = 8; + /** + * Do not transform the position of the image pixels. + */ + public static final int OP_NONE = 0; + /** + * Flip (mirror) image horizontally. This transform is imperfect if there + * are any partial MCU blocks on the right edge. + * @see #OPT_PERFECT + */ + public static final int OP_HFLIP = 1; + /** + * Flip (mirror) image vertically. This transform is imperfect if there are + * any partial MCU blocks on the bottom edge. + * @see #OPT_PERFECT + */ + public static final int OP_VFLIP = 2; + /** + * Transpose image (flip/mirror along upper left to lower right axis). This + * transform is always perfect. + * @see #OPT_PERFECT + */ + public static final int OP_TRANSPOSE = 3; + /** + * Transverse transpose image (flip/mirror along upper right to lower left + * axis). This transform is imperfect if there are any partial MCU blocks in + * the image. + * @see #OPT_PERFECT + */ + public static final int OP_TRANSVERSE = 4; + /** + * Rotate image clockwise by 90 degrees. This transform is imperfect if + * there are any partial MCU blocks on the bottom edge. + * @see #OPT_PERFECT + */ + public static final int OP_ROT90 = 5; + /** + * Rotate image 180 degrees. This transform is imperfect if there are any + * partial MCU blocks in the image. + * @see #OPT_PERFECT + */ + public static final int OP_ROT180 = 6; + /** + * Rotate image counter-clockwise by 90 degrees. This transform is imperfect + * if there are any partial MCU blocks on the right edge. + * @see #OPT_PERFECT + */ + public static final int OP_ROT270 = 7; + + + /** + * This option will cause {@link TJTransformer#transform + * TJTransformer.transform()} to throw an exception if the transform is not + * perfect. Lossless transforms operate on MCU blocks, whose size depends on + * the level of chrominance subsampling used. If the image's width or height + * is not evenly divisible by the MCU block size (see {@link TJ#getMCUWidth} + * and {@link TJ#getMCUHeight}), then there will be partial MCU blocks on the + * right and/or bottom edges. It is not possible to move these partial MCU + * blocks to the top or left of the image, so any transform that would + * require that is "imperfect." If this option is not specified, then any + * partial MCU blocks that cannot be transformed will be left in place, which + * will create odd-looking strips on the right or bottom edge of the image. + */ + public static final int OPT_PERFECT = 1; + /** + * This option will discard any partial MCU blocks that cannot be + * transformed. + */ + public static final int OPT_TRIM = 2; + /** + * This option will enable lossless cropping. + */ + public static final int OPT_CROP = 4; + /** + * This option will discard the color data in the input image and produce + * a grayscale output image. + */ + public static final int OPT_GRAY = 8; + /** + * This option will prevent {@link TJTransformer#transform + * TJTransformer.transform()} from outputting a JPEG image for this + * particular transform. This can be used in conjunction with a custom + * filter to capture the transformed DCT coefficients without transcoding + * them. + */ + public static final int OPT_NOOUTPUT = 16; + /** + * This option will enable progressive entropy coding in the output image + * generated by this particular transform. Progressive entropy coding will + * generally improve compression relative to baseline entropy coding (the + * default), but it will reduce compression and decompression performance + * considerably. + */ + public static final int OPT_PROGRESSIVE = 32; + /** + * This option will prevent {@link TJTransformer#transform + * TJTransformer.transform()} from copying any extra markers (including EXIF + * and ICC profile data) from the source image to the output image. + */ + public static final int OPT_COPYNONE = 64; + + + /** + * Create a new lossless transform instance. + */ + public TJTransform() { + } + + /** + * Create a new lossless transform instance with the given parameters. + * + * @param x the left boundary of the cropping region. This must be evenly + * divisible by the MCU block width (see {@link TJ#getMCUWidth}) + * + * @param y the upper boundary of the cropping region. This must be evenly + * divisible by the MCU block height (see {@link TJ#getMCUHeight}) + * + * @param w the width of the cropping region. Setting this to 0 is the + * equivalent of setting it to (width of the source JPEG image - + * <code>x</code>). + * + * @param h 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>). + * + * @param op one of the transform operations (<code>OP_*</code>) + * + * @param options the bitwise OR of one or more of the transform options + * (<code>OPT_*</code>) + * + * @param cf an instance of an object that implements the {@link + * TJCustomFilter} interface, or null if no custom filter is needed + */ + @SuppressWarnings("checkstyle:HiddenField") + public TJTransform(int x, int y, int w, int h, int op, int options, + TJCustomFilter cf) { + super(x, y, w, h); + this.op = op; + this.options = options; + this.cf = cf; + } + + /** + * Create a new lossless transform instance with the given parameters. + * + * @param r a <code>Rectangle</code> instance that specifies the cropping + * region. See {@link + * #TJTransform(int, int, int, int, int, int, TJCustomFilter)} for more + * detail. + * + * @param op one of the transform operations (<code>OP_*</code>) + * + * @param options the bitwise OR of one or more of the transform options + * (<code>OPT_*</code>) + * + * @param cf an instance of an object that implements the {@link + * TJCustomFilter} interface, or null if no custom filter is needed + */ + @SuppressWarnings("checkstyle:HiddenField") + public TJTransform(Rectangle r, int op, int options, + TJCustomFilter cf) { + super(r); + this.op = op; + this.options = options; + this.cf = cf; + } + + /** + * Transform operation (one of <code>OP_*</code>) + */ + @SuppressWarnings("checkstyle:VisibilityModifier") + public int op = 0; + + /** + * Transform options (bitwise OR of one or more of <code>OPT_*</code>) + */ + @SuppressWarnings("checkstyle:VisibilityModifier") + public int options = 0; + + /** + * Custom filter instance + */ + @SuppressWarnings("checkstyle:VisibilityModifier") + public TJCustomFilter cf = null; +}
diff --git a/src/third_party/libjpeg-turbo/java/org/libjpegturbo/turbojpeg/TJTransformer.java b/src/third_party/libjpeg-turbo/java/org/libjpegturbo/turbojpeg/TJTransformer.java new file mode 100644 index 0000000..d7a56f3 --- /dev/null +++ b/src/third_party/libjpeg-turbo/java/org/libjpegturbo/turbojpeg/TJTransformer.java
@@ -0,0 +1,163 @@ +/* + * 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: + * + * - 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; + +/** + * TurboJPEG lossless transformer + */ +public class TJTransformer extends TJDecompressor { + + /** + * Create a TurboJPEG lossless transformer instance. + */ + public TJTransformer() throws TJException { + init(); + } + + /** + * Create a TurboJPEG lossless transformer instance and associate the JPEG + * image stored in <code>jpegImage</code> with the newly created instance. + * + * @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 TJException { + init(); + setSourceImage(jpegImage, jpegImage.length); + } + + /** + * 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. + * + * @param jpegImage JPEG image buffer. This buffer is not modified. + * + * @param imageSize size of the JPEG image (in bytes) + */ + public TJTransformer(byte[] jpegImage, int imageSize) throws TJException { + init(); + setSourceImage(jpegImage, imageSize); + } + + /** + * 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 + * JPEG image structure to another without altering the values of the + * coefficients. While this is typically faster than decompressing the + * image, transforming it, and re-compressing it, lossless transforms are not + * free. Each lossless transform requires reading and performing Huffman + * decoding on all of the coefficients in the source image, regardless of the + * size of the destination image. Thus, this method provides a means of + * generating multiple transformed images from the same source or of applying + * multiple transformations simultaneously, in order to eliminate the need to + * read the source coefficients multiple times. + * + * @param dstBufs an array of image buffers. <code>dstbufs[i]</code> will + * receive a JPEG image that has been transformed using the parameters in + * <code>transforms[i]</code>. Use {@link TJ#bufSize} to determine the + * maximum size for each buffer based on the transformed or cropped width and + * height and the level of subsampling used in the source image. + * + * @param transforms an array of {@link TJTransform} instances, each of + * which specifies the transform parameters and/or cropping region for the + * corresponding transformed output image + * + * @param flags the bitwise OR of one or more of + * {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*} + */ + public void transform(byte[][] dstBufs, TJTransform[] transforms, + int flags) throws TJException { + if (jpegBuf == null) + throw new IllegalStateException("JPEG buffer not initialized"); + transformedSizes = transform(jpegBuf, jpegBufSize, dstBufs, transforms, + flags); + } + + /** + * Losslessly transform the JPEG image associated with this transformer + * instance and return an array of {@link TJDecompressor} instances, each of + * which has a transformed JPEG image associated with it. + * + * @param transforms an array of {@link TJTransform} instances, each of + * which specifies the transform parameters and/or cropping region for the + * corresponding transformed output image + * + * @param flags the bitwise OR of one or more of + * {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*} + * + * @return an array of {@link TJDecompressor} instances, each of + * which has a transformed JPEG image associated with it. + */ + public TJDecompressor[] transform(TJTransform[] transforms, int flags) + throws TJException { + byte[][] dstBufs = new byte[transforms.length][]; + if (jpegWidth < 1 || jpegHeight < 1) + throw new IllegalStateException("JPEG buffer not initialized"); + for (int i = 0; i < transforms.length; i++) { + int w = jpegWidth, h = jpegHeight; + if ((transforms[i].options & TJTransform.OPT_CROP) != 0) { + if (transforms[i].width != 0) w = transforms[i].width; + if (transforms[i].height != 0) h = transforms[i].height; + } + dstBufs[i] = new byte[TJ.bufSize(w, h, jpegSubsamp)]; + } + TJDecompressor[] tjd = new TJDecompressor[transforms.length]; + transform(dstBufs, transforms, flags); + for (int i = 0; i < transforms.length; i++) + tjd[i] = new TJDecompressor(dstBufs[i], transformedSizes[i]); + return tjd; + } + + /** + * Returns an array containing the sizes of the transformed JPEG images + * generated by the most recent transform operation. + * + * @return an array containing the sizes of the transformed JPEG images + * generated by the most recent transform operation. + */ + public int[] getTransformedSizes() { + if (transformedSizes == null) + throw new IllegalStateException("No image has been transformed yet"); + return transformedSizes; + } + + private native void init() throws TJException; + + private native int[] transform(byte[] srcBuf, int srcSize, byte[][] dstBufs, + TJTransform[] transforms, int flags) throws TJException; + + static { + TJLoader.load(); + } + + private int[] transformedSizes = null; +}
diff --git a/src/third_party/libjpeg-turbo/java/org/libjpegturbo/turbojpeg/YUVImage.java b/src/third_party/libjpeg-turbo/java/org/libjpegturbo/turbojpeg/YUVImage.java new file mode 100644 index 0000000..4da9843 --- /dev/null +++ b/src/third_party/libjpeg-turbo/java/org/libjpegturbo/turbojpeg/YUVImage.java
@@ -0,0 +1,445 @@ +/* + * Copyright (C)2014, 2017 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: + * + * - 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; + +/** + * This class encapsulates a YUV planar image and the metadata + * associated with it. The TurboJPEG API allows both the JPEG compression and + * decompression pipelines to be split into stages: YUV encode, compress from + * YUV, decompress to YUV, and YUV decode. A <code>YUVImage</code> instance + * serves as the destination image for YUV encode and decompress-to-YUV + * operations and as the source image for compress-from-YUV and YUV decode + * operations. + * <p> + * Technically, the JPEG format uses the YCbCr colorspace (which technically is + * not a "colorspace" but rather a "color transform"), but per the convention + * of the digital video community, the TurboJPEG API uses "YUV" to refer to an + * image format consisting of Y, Cb, and Cr image planes. + * <p> + * Each plane is simply a 2D array of bytes, each byte representing the value + * of one of the components (Y, Cb, or Cr) at a particular location in the + * image. The width and height of each plane are determined by the image + * width, height, and level of chrominance subsampling. The luminance plane + * width is the image width padded to the nearest multiple of the horizontal + * subsampling factor (2 in the case of 4:2:0 and 4:2:2, 4 in the case of + * 4:1:1, 1 in the case of 4:4:4 or grayscale.) Similarly, the luminance plane + * height is the image height padded to the nearest multiple of the vertical + * subsampling factor (2 in the case of 4:2:0 or 4:4:0, 1 in the case of 4:4:4 + * or grayscale.) The chrominance plane width is equal to the luminance plane + * width divided by the horizontal subsampling factor, and the chrominance + * plane height is equal to the luminance plane height divided by the vertical + * subsampling factor. + * <p> + * For example, if the source image is 35 x 35 pixels and 4:2:2 subsampling is + * used, then the luminance plane would be 36 x 35 bytes, and each of the + * chrominance planes would be 18 x 35 bytes. If you specify a line padding of + * 4 bytes on top of this, then the luminance plane would be 36 x 35 bytes, and + * each of the chrominance planes would be 20 x 35 bytes. + */ +public class YUVImage { + + private static final String NO_ASSOC_ERROR = + "No image data is associated with this instance"; + + /** + * Create a new <code>YUVImage</code> instance backed by separate image + * planes, and allocate memory for the image planes. + * + * @param width width (in pixels) of the YUV image + * + * @param strides an array of integers, each specifying the number of bytes + * per line in the corresponding plane of the YUV image. Setting the stride + * for any plane to 0 is the same as setting it to the plane width (see + * {@link YUVImage above}.) If <code>strides</code> is null, then the + * 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. + * + * @param height height (in pixels) of the YUV image + * + * @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) { + setBuf(null, null, width, strides, height, subsamp, true); + } + + /** + * Create a new <code>YUVImage</code> instance backed by a unified image + * buffer, and allocate memory for the image buffer. + * + * @param width width (in pixels) of the YUV image + * + * @param pad Each line of each plane in the YUV image buffer will be padded + * to this number of bytes (must be a power of 2.) + * + * @param height height (in pixels) of the YUV image + * + * @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) { + setBuf(new byte[TJ.bufSizeYUV(width, pad, height, subsamp)], width, pad, + height, subsamp); + } + + /** + * Create a new <code>YUVImage</code> instance from a set of existing image + * planes. + * + * @param planes 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 + * planes can be contiguous or non-contiguous in memory. Plane + * <code>i</code> should be at least <code>offsets[i] + + * {@link TJ#planeSizeYUV TJ.planeSizeYUV}(i, width, strides[i], height, subsamp)</code> + * bytes in size. + * + * @param offsets If this <code>YUVImage</code> instance represents a + * subregion of a larger image, then <code>offsets[i]</code> specifies the + * offset (in bytes) of the subregion within plane <code>i</code> of the + * larger image. Setting this to null is the same as setting the offsets for + * all planes to 0. + * + * @param width width (in pixels) of the new YUV image (or subregion) + * + * @param strides an array of integers, each specifying the number of bytes + * per line in the corresponding plane of the YUV image. Setting the stride + * for any plane to 0 is the same as setting it to the plane width (see + * {@link YUVImage above}.) 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 line padding + * 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.) + * + * @param height height (in pixels) of the new YUV image (or subregion) + * + * @param subsamp the level of chrominance subsampling used in the YUV + * image (one of {@link TJ#SAMP_444 TJ.SAMP_*}) + */ + public YUVImage(byte[][] planes, int[] offsets, int width, int[] strides, + int height, int subsamp) { + setBuf(planes, offsets, width, strides, height, subsamp, false); + } + + /** + * Create a new <code>YUVImage</code> instance from an existing unified image + * buffer. + * + * @param yuvImage image buffer that contains or will contain YUV planar + * image data. Use {@link TJ#bufSizeYUV} to determine the minimum size for + * this buffer. The Y, U (Cb), and V (Cr) image planes are stored + * sequentially in the buffer (see {@link YUVImage above} for a description + * of the image format.) + * + * @param width width (in pixels) of the YUV image + * + * @param pad 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. + * + * @param height height (in pixels) of the YUV image + * + * @param subsamp the level of chrominance subsampling used in the YUV + * image (one of {@link TJ#SAMP_444 TJ.SAMP_*}) + */ + public YUVImage(byte[] yuvImage, int width, int pad, int height, + int subsamp) { + setBuf(yuvImage, width, pad, height, subsamp); + } + + /** + * Assign a set of image planes to this <code>YUVImage</code> instance. + * + * @param planes 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 + * planes can be contiguous or non-contiguous in memory. Plane + * <code>i</code> should be at least <code>offsets[i] + + * {@link TJ#planeSizeYUV TJ.planeSizeYUV}(i, width, strides[i], height, subsamp)</code> + * bytes in size. + * + * @param offsets If this <code>YUVImage</code> instance represents a + * subregion of a larger image, then <code>offsets[i]</code> specifies the + * offset (in bytes) of the subregion within plane <code>i</code> of the + * larger image. Setting this to null is the same as setting the offsets for + * all planes to 0. + * + * @param width width (in pixels) of the YUV image (or subregion) + * + * @param strides an array of integers, each specifying the number of bytes + * per line in the corresponding plane of the YUV image. Setting the stride + * for any plane to 0 is the same as setting it to the plane width (see + * {@link YUVImage above}.) 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 line padding + * 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.) + * + * @param height height (in pixels) of the YUV image (or subregion) + * + * @param subsamp the level of chrominance subsampling used in the YUV + * image (one of {@link TJ#SAMP_444 TJ.SAMP_*}) + */ + public void setBuf(byte[][] planes, int[] offsets, int width, int[] strides, + 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) { + if ((planes == null && !alloc) || width < 1 || height < 1 || subsamp < 0 || + subsamp >= TJ.NUMSAMP) + throw new IllegalArgumentException("Invalid argument in YUVImage::setBuf()"); + + int nc = (subsamp == TJ.SAMP_GRAY ? 1 : 3); + if ((planes != null && planes.length != nc) || + (offsets != null && offsets.length != nc) || + (strides != null && strides.length != nc)) + throw new IllegalArgumentException("YUVImage::setBuf(): planes, offsets, or strides array is the wrong size"); + + if (planes == null) + planes = new byte[nc][]; + if (offsets == null) + offsets = new int[nc]; + if (strides == null) + strides = new int[nc]; + + for (int i = 0; i < nc; i++) { + int pw = TJ.planeWidth(i, width, subsamp); + int ph = TJ.planeHeight(i, height, subsamp); + int planeSize = TJ.planeSizeYUV(i, width, strides[i], height, subsamp); + + if (strides[i] == 0) + strides[i] = pw; + if (alloc) { + if (strides[i] < pw) + throw new IllegalArgumentException("Stride must be >= plane width when allocating a new YUV image"); + planes[i] = new byte[strides[i] * ph]; + } + if (planes[i] == null || offsets[i] < 0) + throw new IllegalArgumentException("Invalid argument in YUVImage::setBuf()"); + if (strides[i] < 0 && offsets[i] - planeSize + pw < 0) + throw new IllegalArgumentException("Stride for plane " + i + + " would cause memory to be accessed below plane boundary"); + if (planes[i].length < offsets[i] + planeSize) + throw new IllegalArgumentException("Image plane " + i + + " is not large enough"); + } + + yuvPlanes = planes; + yuvOffsets = offsets; + yuvWidth = width; + yuvStrides = strides; + yuvHeight = height; + yuvSubsamp = subsamp; + } + + /** + * Assign a unified image buffer to this <code>YUVImage</code> instance. + * + * @param yuvImage image buffer that contains or will contain YUV planar + * image data. Use {@link TJ#bufSizeYUV} to determine the minimum size for + * this buffer. The Y, U (Cb), and V (Cr) image planes are stored + * sequentially in the buffer (see {@link YUVImage above} for a description + * of the image format.) + * + * @param width width (in pixels) of the YUV image + * + * @param pad 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. + * + * @param height height (in pixels) of the YUV image + * + * @param subsamp the level of chrominance subsampling used in the YUV + * image (one of {@link TJ#SAMP_444 TJ.SAMP_*}) + */ + public void setBuf(byte[] yuvImage, int width, int pad, int height, + 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()"); + if (yuvImage.length < TJ.bufSizeYUV(width, pad, height, subsamp)) + throw new IllegalArgumentException("YUV image buffer is not large enough"); + + int nc = (subsamp == TJ.SAMP_GRAY ? 1 : 3); + byte[][] planes = new byte[nc][]; + int[] strides = new int[nc]; + int[] offsets = new int[nc]; + + planes[0] = yuvImage; + strides[0] = pad(TJ.planeWidth(0, width, subsamp), pad); + if (subsamp != TJ.SAMP_GRAY) { + strides[1] = strides[2] = pad(TJ.planeWidth(1, width, subsamp), pad); + planes[1] = planes[2] = yuvImage; + offsets[1] = offsets[0] + + strides[0] * TJ.planeHeight(0, height, subsamp); + offsets[2] = offsets[1] + + strides[1] * TJ.planeHeight(1, height, subsamp); + } + + yuvPad = pad; + setBuf(planes, offsets, width, strides, height, subsamp); + } + + /** + * Returns the width of the YUV image (or subregion.) + * + * @return the width of the YUV image (or subregion) + */ + public int getWidth() { + if (yuvWidth < 1) + throw new IllegalStateException(NO_ASSOC_ERROR); + return yuvWidth; + } + + /** + * Returns the height of the YUV image (or subregion.) + * + * @return the height of the YUV image (or subregion) + */ + public int getHeight() { + if (yuvHeight < 1) + throw new IllegalStateException(NO_ASSOC_ERROR); + return yuvHeight; + } + + /** + * Returns the line padding used in the YUV image buffer (if this image is + * stored in a unified buffer rather than separate image planes.) + * + * @return the line padding used in the YUV image buffer + */ + public int getPad() { + if (yuvPlanes == null) + throw new IllegalStateException(NO_ASSOC_ERROR); + if (yuvPad < 1 || ((yuvPad & (yuvPad - 1)) != 0)) + throw new IllegalStateException("Image is not stored in a unified buffer"); + return yuvPad; + } + + /** + * Returns the number of bytes per line of each plane in the YUV image. + * + * @return the number of bytes per line of each plane in the YUV image + */ + public int[] getStrides() { + if (yuvStrides == null) + throw new IllegalStateException(NO_ASSOC_ERROR); + return yuvStrides; + } + + /** + * Returns the offsets (in bytes) of each plane within the planes of a larger + * YUV image. + * + * @return the offsets (in bytes) of each plane within the planes of a larger + * YUV image + */ + public int[] getOffsets() { + if (yuvOffsets == null) + throw new IllegalStateException(NO_ASSOC_ERROR); + return yuvOffsets; + } + + /** + * Returns the level of chrominance subsampling used in the YUV image. See + * {@link TJ#SAMP_444 TJ.SAMP_*}. + * + * @return the level of chrominance subsampling used in the YUV image + */ + public int getSubsamp() { + if (yuvSubsamp < 0 || yuvSubsamp >= TJ.NUMSAMP) + throw new IllegalStateException(NO_ASSOC_ERROR); + return yuvSubsamp; + } + + /** + * Returns the YUV image planes. If the image is stored in a unified buffer, + * then all image planes will point to that buffer. + * + * @return the YUV image planes + */ + public byte[][] getPlanes() { + if (yuvPlanes == null) + throw new IllegalStateException(NO_ASSOC_ERROR); + return yuvPlanes; + } + + /** + * Returns the YUV image buffer (if this image is stored in a unified + * buffer rather than separate image planes.) + * + * @return the YUV image buffer + */ + public byte[] getBuf() { + if (yuvPlanes == null || yuvSubsamp < 0 || yuvSubsamp >= TJ.NUMSAMP) + throw new IllegalStateException(NO_ASSOC_ERROR); + int nc = (yuvSubsamp == TJ.SAMP_GRAY ? 1 : 3); + for (int i = 1; i < nc; i++) { + if (yuvPlanes[i] != yuvPlanes[0]) + throw new IllegalStateException("Image is not stored in a unified buffer"); + } + return yuvPlanes[0]; + } + + /** + * Returns the size (in bytes) of the YUV image buffer (if this image is + * stored in a unified buffer rather than separate image planes.) + * + * @return the size (in bytes) of the YUV image buffer + */ + 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); + if (yuvPad < 1) + throw new IllegalStateException("Image is not stored in a unified buffer"); + for (int i = 1; i < nc; i++) { + if (yuvPlanes[i] != yuvPlanes[0]) + throw new IllegalStateException("Image is not stored in a unified buffer"); + } + return TJ.bufSizeYUV(yuvWidth, yuvPad, yuvHeight, yuvSubsamp); + } + + private static int pad(int v, int p) { + return (v + p - 1) & (~(p - 1)); + } + + protected long handle = 0; + protected byte[][] yuvPlanes = null; + protected int[] yuvOffsets = null; + protected int[] yuvStrides = null; + protected int yuvPad = 0; + protected int yuvWidth = 0; + protected int yuvHeight = 0; + protected int yuvSubsamp = -1; +}
diff --git a/src/third_party/libjpeg-turbo/java/org_libjpegturbo_turbojpeg_TJ.h b/src/third_party/libjpeg-turbo/java/org_libjpegturbo_turbojpeg_TJ.h new file mode 100644 index 0000000..84ee871 --- /dev/null +++ b/src/third_party/libjpeg-turbo/java/org_libjpegturbo_turbojpeg_TJ.h
@@ -0,0 +1,129 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include <jni.h> +/* Header for class org_libjpegturbo_turbojpeg_TJ */ + +#ifndef _Included_org_libjpegturbo_turbojpeg_TJ +#define _Included_org_libjpegturbo_turbojpeg_TJ +#ifdef __cplusplus +extern "C" { +#endif +#undef org_libjpegturbo_turbojpeg_TJ_NUMSAMP +#define org_libjpegturbo_turbojpeg_TJ_NUMSAMP 6L +#undef org_libjpegturbo_turbojpeg_TJ_SAMP_444 +#define org_libjpegturbo_turbojpeg_TJ_SAMP_444 0L +#undef org_libjpegturbo_turbojpeg_TJ_SAMP_422 +#define org_libjpegturbo_turbojpeg_TJ_SAMP_422 1L +#undef org_libjpegturbo_turbojpeg_TJ_SAMP_420 +#define org_libjpegturbo_turbojpeg_TJ_SAMP_420 2L +#undef org_libjpegturbo_turbojpeg_TJ_SAMP_GRAY +#define org_libjpegturbo_turbojpeg_TJ_SAMP_GRAY 3L +#undef org_libjpegturbo_turbojpeg_TJ_SAMP_440 +#define org_libjpegturbo_turbojpeg_TJ_SAMP_440 4L +#undef org_libjpegturbo_turbojpeg_TJ_SAMP_411 +#define org_libjpegturbo_turbojpeg_TJ_SAMP_411 5L +#undef org_libjpegturbo_turbojpeg_TJ_NUMPF +#define org_libjpegturbo_turbojpeg_TJ_NUMPF 12L +#undef org_libjpegturbo_turbojpeg_TJ_PF_RGB +#define org_libjpegturbo_turbojpeg_TJ_PF_RGB 0L +#undef org_libjpegturbo_turbojpeg_TJ_PF_BGR +#define org_libjpegturbo_turbojpeg_TJ_PF_BGR 1L +#undef org_libjpegturbo_turbojpeg_TJ_PF_RGBX +#define org_libjpegturbo_turbojpeg_TJ_PF_RGBX 2L +#undef org_libjpegturbo_turbojpeg_TJ_PF_BGRX +#define org_libjpegturbo_turbojpeg_TJ_PF_BGRX 3L +#undef org_libjpegturbo_turbojpeg_TJ_PF_XBGR +#define org_libjpegturbo_turbojpeg_TJ_PF_XBGR 4L +#undef org_libjpegturbo_turbojpeg_TJ_PF_XRGB +#define org_libjpegturbo_turbojpeg_TJ_PF_XRGB 5L +#undef org_libjpegturbo_turbojpeg_TJ_PF_GRAY +#define org_libjpegturbo_turbojpeg_TJ_PF_GRAY 6L +#undef org_libjpegturbo_turbojpeg_TJ_PF_RGBA +#define org_libjpegturbo_turbojpeg_TJ_PF_RGBA 7L +#undef org_libjpegturbo_turbojpeg_TJ_PF_BGRA +#define org_libjpegturbo_turbojpeg_TJ_PF_BGRA 8L +#undef org_libjpegturbo_turbojpeg_TJ_PF_ABGR +#define org_libjpegturbo_turbojpeg_TJ_PF_ABGR 9L +#undef org_libjpegturbo_turbojpeg_TJ_PF_ARGB +#define org_libjpegturbo_turbojpeg_TJ_PF_ARGB 10L +#undef org_libjpegturbo_turbojpeg_TJ_PF_CMYK +#define org_libjpegturbo_turbojpeg_TJ_PF_CMYK 11L +#undef org_libjpegturbo_turbojpeg_TJ_NUMCS +#define org_libjpegturbo_turbojpeg_TJ_NUMCS 5L +#undef org_libjpegturbo_turbojpeg_TJ_CS_RGB +#define org_libjpegturbo_turbojpeg_TJ_CS_RGB 0L +#undef org_libjpegturbo_turbojpeg_TJ_CS_YCbCr +#define org_libjpegturbo_turbojpeg_TJ_CS_YCbCr 1L +#undef org_libjpegturbo_turbojpeg_TJ_CS_GRAY +#define org_libjpegturbo_turbojpeg_TJ_CS_GRAY 2L +#undef org_libjpegturbo_turbojpeg_TJ_CS_CMYK +#define org_libjpegturbo_turbojpeg_TJ_CS_CMYK 3L +#undef org_libjpegturbo_turbojpeg_TJ_CS_YCCK +#define org_libjpegturbo_turbojpeg_TJ_CS_YCCK 4L +#undef org_libjpegturbo_turbojpeg_TJ_FLAG_BOTTOMUP +#define org_libjpegturbo_turbojpeg_TJ_FLAG_BOTTOMUP 2L +#undef org_libjpegturbo_turbojpeg_TJ_FLAG_FASTUPSAMPLE +#define org_libjpegturbo_turbojpeg_TJ_FLAG_FASTUPSAMPLE 256L +#undef org_libjpegturbo_turbojpeg_TJ_FLAG_FASTDCT +#define org_libjpegturbo_turbojpeg_TJ_FLAG_FASTDCT 2048L +#undef org_libjpegturbo_turbojpeg_TJ_FLAG_ACCURATEDCT +#define org_libjpegturbo_turbojpeg_TJ_FLAG_ACCURATEDCT 4096L +/* + * Class: org_libjpegturbo_turbojpeg_TJ + * Method: bufSize + * Signature: (III)I + */ +JNIEXPORT jint JNICALL Java_org_libjpegturbo_turbojpeg_TJ_bufSize + (JNIEnv *, jclass, jint, jint, jint); + +/* + * Class: org_libjpegturbo_turbojpeg_TJ + * Method: bufSizeYUV + * Signature: (IIII)I + */ +JNIEXPORT jint JNICALL Java_org_libjpegturbo_turbojpeg_TJ_bufSizeYUV__IIII + (JNIEnv *, jclass, jint, jint, jint, jint); + +/* + * Class: org_libjpegturbo_turbojpeg_TJ + * Method: bufSizeYUV + * Signature: (III)I + */ +JNIEXPORT jint JNICALL Java_org_libjpegturbo_turbojpeg_TJ_bufSizeYUV__III + (JNIEnv *, jclass, jint, jint, jint); + +/* + * Class: org_libjpegturbo_turbojpeg_TJ + * Method: planeSizeYUV + * Signature: (IIIII)I + */ +JNIEXPORT jint JNICALL Java_org_libjpegturbo_turbojpeg_TJ_planeSizeYUV__IIIII + (JNIEnv *, jclass, jint, jint, jint, jint, jint); + +/* + * Class: org_libjpegturbo_turbojpeg_TJ + * Method: planeWidth + * Signature: (III)I + */ +JNIEXPORT jint JNICALL Java_org_libjpegturbo_turbojpeg_TJ_planeWidth__III + (JNIEnv *, jclass, jint, jint, jint); + +/* + * Class: org_libjpegturbo_turbojpeg_TJ + * Method: planeHeight + * Signature: (III)I + */ +JNIEXPORT jint JNICALL Java_org_libjpegturbo_turbojpeg_TJ_planeHeight__III + (JNIEnv *, jclass, jint, jint, jint); + +/* + * Class: org_libjpegturbo_turbojpeg_TJ + * Method: getScalingFactors + * Signature: ()[Lorg/libjpegturbo/turbojpeg/TJScalingFactor; + */ +JNIEXPORT jobjectArray JNICALL Java_org_libjpegturbo_turbojpeg_TJ_getScalingFactors + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif
diff --git a/src/third_party/libjpeg-turbo/java/org_libjpegturbo_turbojpeg_TJCompressor.h b/src/third_party/libjpeg-turbo/java/org_libjpegturbo_turbojpeg_TJCompressor.h new file mode 100644 index 0000000..e76bd0e --- /dev/null +++ b/src/third_party/libjpeg-turbo/java/org_libjpegturbo_turbojpeg_TJCompressor.h
@@ -0,0 +1,101 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include <jni.h> +/* Header for class org_libjpegturbo_turbojpeg_TJCompressor */ + +#ifndef _Included_org_libjpegturbo_turbojpeg_TJCompressor +#define _Included_org_libjpegturbo_turbojpeg_TJCompressor +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_libjpegturbo_turbojpeg_TJCompressor + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_init + (JNIEnv *, jobject); + +/* + * Class: org_libjpegturbo_turbojpeg_TJCompressor + * Method: destroy + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_destroy + (JNIEnv *, jobject); + +/* + * Class: org_libjpegturbo_turbojpeg_TJCompressor + * Method: compress + * Signature: ([BIIII[BIII)I + */ +JNIEXPORT jint JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_compress___3BIIII_3BIII + (JNIEnv *, jobject, jbyteArray, jint, jint, jint, jint, jbyteArray, jint, jint, jint); + +/* + * Class: org_libjpegturbo_turbojpeg_TJCompressor + * Method: compress + * Signature: ([BIIIIII[BIII)I + */ +JNIEXPORT jint JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_compress___3BIIIIII_3BIII + (JNIEnv *, jobject, jbyteArray, jint, jint, jint, jint, jint, jint, jbyteArray, jint, jint, jint); + +/* + * Class: org_libjpegturbo_turbojpeg_TJCompressor + * Method: compress + * Signature: ([IIIII[BIII)I + */ +JNIEXPORT jint JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_compress___3IIIII_3BIII + (JNIEnv *, jobject, jintArray, jint, jint, jint, jint, jbyteArray, jint, jint, jint); + +/* + * Class: org_libjpegturbo_turbojpeg_TJCompressor + * Method: compress + * Signature: ([IIIIIII[BIII)I + */ +JNIEXPORT jint JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_compress___3IIIIIII_3BIII + (JNIEnv *, jobject, jintArray, jint, jint, jint, jint, jint, jint, jbyteArray, jint, jint, jint); + +/* + * Class: org_libjpegturbo_turbojpeg_TJCompressor + * Method: compressFromYUV + * Signature: ([[B[II[III[BII)I + */ +JNIEXPORT jint JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_compressFromYUV___3_3B_3II_3III_3BII + (JNIEnv *, jobject, jobjectArray, jintArray, jint, jintArray, jint, jint, jbyteArray, jint, jint); + +/* + * Class: org_libjpegturbo_turbojpeg_TJCompressor + * Method: encodeYUV + * Signature: ([BIIII[BII)V + */ +JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_encodeYUV___3BIIII_3BII + (JNIEnv *, jobject, jbyteArray, jint, jint, jint, jint, jbyteArray, jint, jint); + +/* + * Class: org_libjpegturbo_turbojpeg_TJCompressor + * Method: encodeYUV + * Signature: ([BIIIIII[[B[I[III)V + */ +JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_encodeYUV___3BIIIIII_3_3B_3I_3III + (JNIEnv *, jobject, jbyteArray, jint, jint, jint, jint, jint, jint, jobjectArray, jintArray, jintArray, jint, jint); + +/* + * Class: org_libjpegturbo_turbojpeg_TJCompressor + * Method: encodeYUV + * Signature: ([IIIII[BII)V + */ +JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_encodeYUV___3IIIII_3BII + (JNIEnv *, jobject, jintArray, jint, jint, jint, jint, jbyteArray, jint, jint); + +/* + * Class: org_libjpegturbo_turbojpeg_TJCompressor + * Method: encodeYUV + * Signature: ([IIIIIII[[B[I[III)V + */ +JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_encodeYUV___3IIIIIII_3_3B_3I_3III + (JNIEnv *, jobject, jintArray, jint, jint, jint, jint, jint, jint, jobjectArray, jintArray, jintArray, jint, jint); + +#ifdef __cplusplus +} +#endif +#endif
diff --git a/src/third_party/libjpeg-turbo/java/org_libjpegturbo_turbojpeg_TJDecompressor.h b/src/third_party/libjpeg-turbo/java/org_libjpegturbo_turbojpeg_TJDecompressor.h new file mode 100644 index 0000000..2d58e73 --- /dev/null +++ b/src/third_party/libjpeg-turbo/java/org_libjpegturbo_turbojpeg_TJDecompressor.h
@@ -0,0 +1,101 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include <jni.h> +/* Header for class org_libjpegturbo_turbojpeg_TJDecompressor */ + +#ifndef _Included_org_libjpegturbo_turbojpeg_TJDecompressor +#define _Included_org_libjpegturbo_turbojpeg_TJDecompressor +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_libjpegturbo_turbojpeg_TJDecompressor + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJDecompressor_init + (JNIEnv *, jobject); + +/* + * Class: org_libjpegturbo_turbojpeg_TJDecompressor + * Method: destroy + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJDecompressor_destroy + (JNIEnv *, jobject); + +/* + * Class: org_libjpegturbo_turbojpeg_TJDecompressor + * Method: decompressHeader + * Signature: ([BI)V + */ +JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompressHeader + (JNIEnv *, jobject, jbyteArray, jint); + +/* + * Class: org_libjpegturbo_turbojpeg_TJDecompressor + * Method: decompress + * Signature: ([BI[BIIIII)V + */ +JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompress___3BI_3BIIIII + (JNIEnv *, jobject, jbyteArray, jint, jbyteArray, jint, jint, jint, jint, jint); + +/* + * Class: org_libjpegturbo_turbojpeg_TJDecompressor + * Method: decompress + * Signature: ([BI[BIIIIIII)V + */ +JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompress___3BI_3BIIIIIII + (JNIEnv *, jobject, jbyteArray, jint, jbyteArray, jint, jint, jint, jint, jint, jint, jint); + +/* + * Class: org_libjpegturbo_turbojpeg_TJDecompressor + * Method: decompress + * Signature: ([BI[IIIIII)V + */ +JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompress___3BI_3IIIIII + (JNIEnv *, jobject, jbyteArray, jint, jintArray, jint, jint, jint, jint, jint); + +/* + * Class: org_libjpegturbo_turbojpeg_TJDecompressor + * Method: decompress + * Signature: ([BI[IIIIIIII)V + */ +JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompress___3BI_3IIIIIIII + (JNIEnv *, jobject, jbyteArray, jint, jintArray, jint, jint, jint, jint, jint, jint, jint); + +/* + * Class: org_libjpegturbo_turbojpeg_TJDecompressor + * Method: decompressToYUV + * Signature: ([BI[BI)V + */ +JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompressToYUV___3BI_3BI + (JNIEnv *, jobject, jbyteArray, jint, jbyteArray, jint); + +/* + * Class: org_libjpegturbo_turbojpeg_TJDecompressor + * Method: decompressToYUV + * Signature: ([BI[[B[II[III)V + */ +JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompressToYUV___3BI_3_3B_3II_3III + (JNIEnv *, jobject, jbyteArray, jint, jobjectArray, jintArray, jint, jintArray, jint, jint); + +/* + * Class: org_libjpegturbo_turbojpeg_TJDecompressor + * Method: decodeYUV + * Signature: ([[B[I[II[BIIIIIII)V + */ +JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJDecompressor_decodeYUV___3_3B_3I_3II_3BIIIIIII + (JNIEnv *, jobject, jobjectArray, jintArray, jintArray, jint, jbyteArray, jint, jint, jint, jint, jint, jint, jint); + +/* + * Class: org_libjpegturbo_turbojpeg_TJDecompressor + * Method: decodeYUV + * Signature: ([[B[I[II[IIIIIIII)V + */ +JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJDecompressor_decodeYUV___3_3B_3I_3II_3IIIIIIII + (JNIEnv *, jobject, jobjectArray, jintArray, jintArray, jint, jintArray, jint, jint, jint, jint, jint, jint, jint); + +#ifdef __cplusplus +} +#endif +#endif
diff --git a/src/third_party/libjpeg-turbo/java/org_libjpegturbo_turbojpeg_TJTransformer.h b/src/third_party/libjpeg-turbo/java/org_libjpegturbo_turbojpeg_TJTransformer.h new file mode 100644 index 0000000..a9dad4d --- /dev/null +++ b/src/third_party/libjpeg-turbo/java/org_libjpegturbo_turbojpeg_TJTransformer.h
@@ -0,0 +1,29 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include <jni.h> +/* Header for class org_libjpegturbo_turbojpeg_TJTransformer */ + +#ifndef _Included_org_libjpegturbo_turbojpeg_TJTransformer +#define _Included_org_libjpegturbo_turbojpeg_TJTransformer +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_libjpegturbo_turbojpeg_TJTransformer + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJTransformer_init + (JNIEnv *, jobject); + +/* + * Class: org_libjpegturbo_turbojpeg_TJTransformer + * Method: transform + * Signature: ([BI[[B[Lorg/libjpegturbo/turbojpeg/TJTransform;I)[I + */ +JNIEXPORT jintArray JNICALL Java_org_libjpegturbo_turbojpeg_TJTransformer_transform + (JNIEnv *, jobject, jbyteArray, jint, jobjectArray, jobjectArray, jint); + +#ifdef __cplusplus +} +#endif +#endif