Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cc7150e281 | ||
|
|
88aeed428f | ||
|
|
4a6b730364 | ||
|
|
bd543f030e | ||
|
|
2cbeb8abd9 |
5
.gitattributes
vendored
@@ -1,5 +0,0 @@
|
||||
/appveyor.yml export-ignore
|
||||
/.gitattributes export-ignore
|
||||
/.github export-ignore
|
||||
*.ppm binary
|
||||
/ChangeLog.md conflict-marker-size=8
|
||||
8
.github/pull_request_template.md
vendored
@@ -1,8 +0,0 @@
|
||||
**Complete description of the bug fix or feature that this pull request implements**
|
||||
|
||||
|
||||
**Checklist before submitting the pull request, to maximize the chances that the pull request will be accepted**
|
||||
|
||||
- [ ] Read CONTRIBUTING.md, a link to which appears under "Helpful resources" below. That document discusses general guidelines for contributing to libjpeg-turbo, as well as the types of contributions that will not be accepted or are unlikely to be accepted.
|
||||
- [ ] Search the existing issues and pull requests (both open and closed) to ensure that a similar request has not already been submitted and rejected.
|
||||
- [ ] Discuss the proposed bug fix or feature in a GitHub issue, through direct e-mail with the project maintainer, or on the libjpeg-turbo-devel mailing list.
|
||||
48
.gitignore
vendored
@@ -1,48 +0,0 @@
|
||||
.DS_Store
|
||||
Makefile.in
|
||||
Makefile
|
||||
/CMakeFiles
|
||||
/autom4te.cache
|
||||
/aclocal.m4
|
||||
/compile
|
||||
/configure
|
||||
/depcomp
|
||||
/install-sh
|
||||
/libtool
|
||||
/missing
|
||||
/stamp-h*
|
||||
/java/classnoinst.stamp
|
||||
/pkgscripts/
|
||||
/jconfig.h
|
||||
/jconfigint.h
|
||||
/config.guess
|
||||
/config.h
|
||||
/config.h.in
|
||||
/config.log
|
||||
/config.status
|
||||
/config.sub
|
||||
/ltmain.sh
|
||||
/ar-lib
|
||||
/libjpeg.map
|
||||
/.libs/
|
||||
/simd/.libs/
|
||||
/simd/jsimdcfg.inc
|
||||
*.o
|
||||
*.lo
|
||||
*.la
|
||||
/cjpeg
|
||||
/djpeg
|
||||
/jcstest
|
||||
/jpegtran
|
||||
/jpegyuv
|
||||
/md5/md5cmp
|
||||
/rdjpgcom
|
||||
/test_enc_*
|
||||
/tjbench
|
||||
/tjbenchtest
|
||||
/tjunittest
|
||||
/wrjpgcom
|
||||
/yuvjpeg
|
||||
test_yuv*.jpg
|
||||
CMakeCache.txt
|
||||
CTestTestfile.cmake
|
||||
726
BUILDING.md
@@ -1,726 +0,0 @@
|
||||
Building libjpeg-turbo
|
||||
======================
|
||||
|
||||
|
||||
Build Requirements
|
||||
------------------
|
||||
|
||||
|
||||
### All Systems
|
||||
|
||||
- [CMake](https://cmake.org) v2.8.12 or later
|
||||
|
||||
- [NASM](https://nasm.us) or [Yasm](https://yasm.tortall.net)
|
||||
(if building x86 or x86-64 SIMD extensions)
|
||||
* If using NASM, 2.13 or later is required.
|
||||
* If using Yasm, 1.2.0 or later is required.
|
||||
* NASM 2.15 or later is required if building libjpeg-turbo with Intel
|
||||
Control-flow Enforcement Technology (CET) support.
|
||||
* If building on macOS, NASM or Yasm can be obtained from
|
||||
[MacPorts](https://macports.org) or [Homebrew](https://brew.sh).
|
||||
- NOTE: Currently, if it is desirable to hide the SIMD function symbols in
|
||||
Mac executables or shared libraries that statically link with
|
||||
libjpeg-turbo, then NASM 2.14 or later or Yasm must be used when
|
||||
building libjpeg-turbo.
|
||||
* If NASM or Yasm is not in your `PATH`, then you can specify the full path
|
||||
to the assembler by using either the `CMAKE_ASM_NASM_COMPILER` CMake
|
||||
variable or the `ASM_NASM` environment variable. On Windows, use forward
|
||||
slashes rather than backslashes in the path (for example,
|
||||
**c:/nasm/nasm.exe**).
|
||||
* NASM and Yasm are located in the CRB (Code Ready Builder) or PowerTools
|
||||
repository on Red Hat Enterprise Linux 8+ and derivatives, which is not
|
||||
enabled by default.
|
||||
|
||||
### Un*x Platforms (including Linux, Mac, FreeBSD, Solaris, and Cygwin)
|
||||
|
||||
- GCC v4.1 (or later) or Clang recommended for best performance
|
||||
|
||||
- If building the TurboJPEG Java wrapper, JDK or OpenJDK 1.5 or later is
|
||||
required. Most modern Linux distributions, as well as Solaris 10 and later,
|
||||
include JDK or OpenJDK. For other systems, you can obtain the Oracle Java
|
||||
Development Kit from
|
||||
<https://oracle.com/java/technologies/downloads>.
|
||||
|
||||
* If using JDK 11 or later, CMake 3.10.x or later must also be used.
|
||||
|
||||
### Windows
|
||||
|
||||
- Microsoft Visual C++ 2005 or later
|
||||
|
||||
If you don't already have Visual C++, then the easiest way to get it is by
|
||||
installing
|
||||
[Visual Studio Community Edition](https://visualstudio.microsoft.com),
|
||||
which includes everything necessary to build libjpeg-turbo.
|
||||
|
||||
* You can also download and install the standalone Windows SDK (for Windows 7
|
||||
or later), which includes command-line versions of the 32-bit and 64-bit
|
||||
Visual C++ compilers.
|
||||
* If you intend to build libjpeg-turbo from the command line, then add the
|
||||
appropriate compiler and SDK directories to the `INCLUDE`, `LIB`, and
|
||||
`PATH` environment variables. This is generally accomplished by
|
||||
executing `vcvars32.bat` or `vcvars64.bat`, which are located in the same
|
||||
directory as the compiler.
|
||||
* If built with Visual C++ 2015 or later, the libjpeg-turbo static libraries
|
||||
cannot be used with earlier versions of Visual C++, and vice versa.
|
||||
* The libjpeg API DLL (**jpeg{version}.dll**) will depend on the C run-time
|
||||
DLLs corresponding to the version of Visual C++ that was used to build it.
|
||||
|
||||
- Vcpkg
|
||||
|
||||
You need to download and install libpng using the [vcpkg](https://github.com/Microsoft/vcpkg) dependency manager:
|
||||
|
||||
git clone https://github.com/Microsoft/vcpkg.git
|
||||
cd vcpkg
|
||||
./bootstrap-vcpkg.bat
|
||||
./vcpkg integrate install
|
||||
./vcpkg install libpng:x64-windows
|
||||
./vcpkg install libpng:x64-windows-static
|
||||
|
||||
Actually, you can just download and install MozJPEG using vcpkg dependency manager:
|
||||
|
||||
./vcpkg install mozjpeg
|
||||
|
||||
The mozjpeg port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please [create an issue or pull request](https://github.com/Microsoft/vcpkg) on the vcpkg repository.
|
||||
|
||||
|
||||
... OR ...
|
||||
|
||||
|
||||
- MinGW
|
||||
|
||||
[MSYS2](https://msys2.org) or [tdm-gcc](https://jmeubank.github.io/tdm-gcc)
|
||||
recommended if building on a Windows machine. Both distributions install a
|
||||
Start Menu link that can be used to launch a command prompt with the
|
||||
appropriate compiler paths automatically set.
|
||||
|
||||
- If building the TurboJPEG Java wrapper, JDK 1.5 or later is required. This
|
||||
can be downloaded from
|
||||
<https://oracle.com/java/technologies/downloads>.
|
||||
|
||||
* If using JDK 11 or later, CMake 3.10.x or later must also be used.
|
||||
|
||||
|
||||
Sub-Project Builds
|
||||
------------------
|
||||
|
||||
The libjpeg-turbo build system does not support being included as a sub-project
|
||||
using the CMake `add_subdirectory()` function. Use the CMake
|
||||
`ExternalProject_Add()` function instead.
|
||||
|
||||
|
||||
Out-of-Tree Builds
|
||||
------------------
|
||||
|
||||
Binary objects, libraries, and executables are generated in the directory from
|
||||
which CMake is executed (the "binary directory"), and this directory need not
|
||||
necessarily be the same as the libjpeg-turbo source directory. You can create
|
||||
multiple independent binary directories, in which different versions of
|
||||
libjpeg-turbo can be built from the same source tree using different compilers
|
||||
or settings. In the sections below, *{build_directory}* refers to the binary
|
||||
directory, whereas *{source_directory}* refers to the libjpeg-turbo source
|
||||
directory. For in-tree builds, these directories are the same.
|
||||
|
||||
|
||||
Ninja
|
||||
-----
|
||||
|
||||
If using Ninja, then replace `make` or `nmake` with `ninja`, and replace the
|
||||
CMake generator (specified with the `-G` option) with `Ninja`, in all of the
|
||||
procedures and recipes below.
|
||||
|
||||
|
||||
Build Procedure
|
||||
---------------
|
||||
|
||||
NOTE: The build procedures below assume that CMake is invoked from the command
|
||||
line, but all of these procedures can be adapted to the CMake GUI as
|
||||
well.
|
||||
|
||||
|
||||
### Un*x
|
||||
|
||||
The following procedure will build libjpeg-turbo on Unix and Unix-like systems.
|
||||
(On Solaris, this generates a 32-bit build. See "Build Recipes" below for
|
||||
64-bit build instructions.)
|
||||
|
||||
cd {build_directory}
|
||||
cmake -G"Unix Makefiles" [additional CMake flags] {source_directory}
|
||||
make
|
||||
|
||||
This will generate the following files under *{build_directory}*:
|
||||
|
||||
**libjpeg.a**<br>
|
||||
Static link library for the libjpeg API
|
||||
|
||||
**libjpeg.so.{version}** (Linux, Unix)<br>
|
||||
**libjpeg.{version}.dylib** (Mac)<br>
|
||||
**cygjpeg-{version}.dll** (Cygwin)<br>
|
||||
Shared library for the libjpeg API
|
||||
|
||||
By default, *{version}* is 62.2.0, 7.2.0, or 8.1.2, depending on whether
|
||||
libjpeg v6b (default), v7, or v8 emulation is enabled. If using Cygwin,
|
||||
*{version}* is 62, 7, or 8.
|
||||
|
||||
**libjpeg.so** (Linux, Unix)<br>
|
||||
**libjpeg.dylib** (Mac)<br>
|
||||
Development symlink for the libjpeg API
|
||||
|
||||
**libjpeg.dll.a** (Cygwin)<br>
|
||||
Import library for the libjpeg API
|
||||
|
||||
**libturbojpeg.a**<br>
|
||||
Static link library for the TurboJPEG API
|
||||
|
||||
**libturbojpeg.so.0.2.0** (Linux, Unix)<br>
|
||||
**libturbojpeg.0.2.0.dylib** (Mac)<br>
|
||||
**cygturbojpeg-0.dll** (Cygwin)<br>
|
||||
Shared library for the TurboJPEG API
|
||||
|
||||
**libturbojpeg.so** (Linux, Unix)<br>
|
||||
**libturbojpeg.dylib** (Mac)<br>
|
||||
Development symlink for the TurboJPEG API
|
||||
|
||||
**libturbojpeg.dll.a** (Cygwin)<br>
|
||||
Import library for the TurboJPEG API
|
||||
|
||||
|
||||
### Visual C++ (Command Line)
|
||||
|
||||
cd {build_directory}
|
||||
cmake -G"NMake Makefiles" -DCMAKE_BUILD_TYPE=Release [additional CMake flags] {source_directory}
|
||||
nmake
|
||||
|
||||
This will build either a 32-bit or a 64-bit version of libjpeg-turbo, depending
|
||||
on which version of **cl.exe** is in the `PATH`.
|
||||
|
||||
The following files will be generated under *{build_directory}*:
|
||||
|
||||
**jpeg-static.lib**<br>
|
||||
Static link library for the libjpeg API
|
||||
|
||||
**jpeg{version}.dll**<br>
|
||||
DLL for the libjpeg API
|
||||
|
||||
**jpeg.lib**<br>
|
||||
Import library for the libjpeg API
|
||||
|
||||
**turbojpeg-static.lib**<br>
|
||||
Static link library for the TurboJPEG API
|
||||
|
||||
**turbojpeg.dll**<br>
|
||||
DLL for the TurboJPEG API
|
||||
|
||||
**turbojpeg.lib**<br>
|
||||
Import library for the TurboJPEG API
|
||||
|
||||
*{version}* is 62, 7, or 8, depending on whether libjpeg v6b (default), v7, or
|
||||
v8 emulation is enabled.
|
||||
|
||||
|
||||
### Visual C++ (IDE)
|
||||
|
||||
Choose the appropriate CMake generator option for your version of Visual Studio
|
||||
(run `cmake` with no arguments for a list of available generators.) For
|
||||
instance:
|
||||
|
||||
cd {build_directory}
|
||||
cmake -G"Visual Studio 10" [additional CMake flags] {source_directory}
|
||||
|
||||
NOTE: Add "Win64" to the generator name (for example, "Visual Studio 10 Win64")
|
||||
to build a 64-bit version of libjpeg-turbo. A separate build directory must be
|
||||
used for 32-bit and 64-bit builds.
|
||||
|
||||
You can then open **ALL_BUILD.vcproj** in Visual Studio and build one of the
|
||||
configurations in that project ("Debug", "Release", etc.) to generate a full
|
||||
build of libjpeg-turbo.
|
||||
|
||||
This will generate the following files under *{build_directory}*:
|
||||
|
||||
**{configuration}/jpeg-static.lib**<br>
|
||||
Static link library for the libjpeg API
|
||||
|
||||
**{configuration}/jpeg{version}.dll**<br>
|
||||
DLL for the libjpeg API
|
||||
|
||||
**{configuration}/jpeg.lib**<br>
|
||||
Import library for the libjpeg API
|
||||
|
||||
**{configuration}/turbojpeg-static.lib**<br>
|
||||
Static link library for the TurboJPEG API
|
||||
|
||||
**{configuration}/turbojpeg.dll**<br>
|
||||
DLL for the TurboJPEG API
|
||||
|
||||
**{configuration}/turbojpeg.lib**<br>
|
||||
Import library for the TurboJPEG API
|
||||
|
||||
*{configuration}* is Debug, Release, RelWithDebInfo, or MinSizeRel, depending
|
||||
on the configuration you built in the IDE, and *{version}* is 62, 7, or 8,
|
||||
depending on whether libjpeg v6b (default), v7, or v8 emulation is enabled.
|
||||
|
||||
|
||||
### MinGW
|
||||
|
||||
NOTE: This assumes that you are building on a Windows machine using the MSYS
|
||||
environment. If you are cross-compiling on a Un*x platform (including Mac and
|
||||
Cygwin), then see "Build Recipes" below.
|
||||
|
||||
cd {build_directory}
|
||||
cmake -G"MSYS Makefiles" [additional CMake flags] {source_directory}
|
||||
make
|
||||
|
||||
This will generate the following files under *{build_directory}*:
|
||||
|
||||
**libjpeg.a**<br>
|
||||
Static link library for the libjpeg API
|
||||
|
||||
**libjpeg-{version}.dll**<br>
|
||||
DLL for the libjpeg API
|
||||
|
||||
**libjpeg.dll.a**<br>
|
||||
Import library for the libjpeg API
|
||||
|
||||
**libturbojpeg.a**<br>
|
||||
Static link library for the TurboJPEG API
|
||||
|
||||
**libturbojpeg.dll**<br>
|
||||
DLL for the TurboJPEG API
|
||||
|
||||
**libturbojpeg.dll.a**<br>
|
||||
Import library for the TurboJPEG API
|
||||
|
||||
*{version}* is 62, 7, or 8, depending on whether libjpeg v6b (default), v7, or
|
||||
v8 emulation is enabled.
|
||||
|
||||
|
||||
### Debug Build
|
||||
|
||||
Add `-DCMAKE_BUILD_TYPE=Debug` to the CMake command line. Or, if building
|
||||
with NMake, remove `-DCMAKE_BUILD_TYPE=Release` (Debug builds are the default
|
||||
with NMake.)
|
||||
|
||||
|
||||
### libjpeg v7 or v8 API/ABI Emulation
|
||||
|
||||
Add `-DWITH_JPEG7=1` to the CMake command line to build a version of
|
||||
libjpeg-turbo that is API/ABI-compatible with libjpeg v7. Add `-DWITH_JPEG8=1`
|
||||
to the CMake command line to build a version of libjpeg-turbo that is
|
||||
API/ABI-compatible with libjpeg v8. See [README.md](README.md) for more
|
||||
information about libjpeg v7 and v8 emulation.
|
||||
|
||||
|
||||
### Arithmetic Coding Support
|
||||
|
||||
Since the patent on arithmetic coding has expired, this functionality has been
|
||||
included in this release of libjpeg-turbo. libjpeg-turbo's implementation is
|
||||
based on the implementation in libjpeg v8, but it works when emulating libjpeg
|
||||
v7 or v6b as well. The default is to enable both arithmetic encoding and
|
||||
decoding, but those who have philosophical objections to arithmetic coding can
|
||||
add `-DWITH_ARITH_ENC=0` or `-DWITH_ARITH_DEC=0` to the CMake command line to
|
||||
disable encoding or decoding (respectively.)
|
||||
|
||||
|
||||
### TurboJPEG Java Wrapper
|
||||
|
||||
Add `-DWITH_JAVA=1` to the CMake command line to incorporate an optional Java
|
||||
Native Interface (JNI) wrapper into the TurboJPEG shared library and build the
|
||||
Java front-end classes to support it. This allows the TurboJPEG shared library
|
||||
to be used directly from Java applications. See [java/README](java/README) for
|
||||
more details.
|
||||
|
||||
If Java is not in your `PATH`, or if you wish to use an alternate JDK to
|
||||
build/test libjpeg-turbo, then (prior to running CMake) set the `JAVA_HOME`
|
||||
environment variable to the location of the JDK that you wish to use. The
|
||||
`Java_JAVAC_EXECUTABLE`, `Java_JAVA_EXECUTABLE`, and `Java_JAR_EXECUTABLE`
|
||||
CMake variables can also be used to specify alternate commands or locations for
|
||||
javac, jar, and java (respectively.) You can also set the
|
||||
`CMAKE_JAVA_COMPILE_FLAGS` CMake variable or the `JAVAFLAGS` environment
|
||||
variable to specify arguments that should be passed to the Java compiler when
|
||||
building the TurboJPEG classes, and the `JAVAARGS` CMake variable to specify
|
||||
arguments that should be passed to the JRE when running the TurboJPEG Java unit
|
||||
tests.
|
||||
|
||||
|
||||
Build Recipes
|
||||
-------------
|
||||
|
||||
|
||||
### 32-bit Build on 64-bit Linux/Unix
|
||||
|
||||
Use export/setenv to set the following environment variables before running
|
||||
CMake:
|
||||
|
||||
CFLAGS=-m32
|
||||
LDFLAGS=-m32
|
||||
|
||||
|
||||
### 64-bit Build on Solaris
|
||||
|
||||
Use export/setenv to set the following environment variables before running
|
||||
CMake:
|
||||
|
||||
CFLAGS=-m64
|
||||
LDFLAGS=-m64
|
||||
|
||||
|
||||
### Other Compilers
|
||||
|
||||
On Un*x systems, prior to running CMake, you can set the `CC` environment
|
||||
variable to the command used to invoke the C compiler.
|
||||
|
||||
|
||||
### 32-bit MinGW Build on Un*x (including Mac and Cygwin)
|
||||
|
||||
Create a file called **toolchain.cmake** under *{build_directory}*, with the
|
||||
following contents:
|
||||
|
||||
set(CMAKE_SYSTEM_NAME Windows)
|
||||
set(CMAKE_SYSTEM_PROCESSOR X86)
|
||||
set(CMAKE_C_COMPILER {mingw_binary_path}/i686-w64-mingw32-gcc)
|
||||
set(CMAKE_RC_COMPILER {mingw_binary_path}/i686-w64-mingw32-windres)
|
||||
|
||||
*{mingw\_binary\_path}* is the directory under which the MinGW binaries are
|
||||
located (usually **/usr/bin**.) Next, execute the following commands:
|
||||
|
||||
cd {build_directory}
|
||||
cmake -G"Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=toolchain.cmake \
|
||||
-DCMAKE_INSTALL_PREFIX={install_path} \
|
||||
[additional CMake flags] {source_directory}
|
||||
make
|
||||
|
||||
*{install\_path}* is the path under which the libjpeg-turbo binaries should be
|
||||
installed.
|
||||
|
||||
|
||||
### 64-bit MinGW Build on Un*x (including Mac and Cygwin)
|
||||
|
||||
Create a file called **toolchain.cmake** under *{build_directory}*, with the
|
||||
following contents:
|
||||
|
||||
set(CMAKE_SYSTEM_NAME Windows)
|
||||
set(CMAKE_SYSTEM_PROCESSOR AMD64)
|
||||
set(CMAKE_C_COMPILER {mingw_binary_path}/x86_64-w64-mingw32-gcc)
|
||||
set(CMAKE_RC_COMPILER {mingw_binary_path}/x86_64-w64-mingw32-windres)
|
||||
|
||||
*{mingw\_binary\_path}* is the directory under which the MinGW binaries are
|
||||
located (usually **/usr/bin**.) Next, execute the following commands:
|
||||
|
||||
cd {build_directory}
|
||||
cmake -G"Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=toolchain.cmake \
|
||||
-DCMAKE_INSTALL_PREFIX={install_path} \
|
||||
[additional CMake flags] {source_directory}
|
||||
make
|
||||
|
||||
*{install\_path}* is the path under which the libjpeg-turbo binaries should be
|
||||
installed.
|
||||
|
||||
|
||||
Building libjpeg-turbo for iOS
|
||||
------------------------------
|
||||
|
||||
iOS platforms, such as the iPhone and iPad, use Arm processors, and all
|
||||
currently supported models include Neon instructions. Thus, they can take
|
||||
advantage of libjpeg-turbo's SIMD extensions to significantly accelerate JPEG
|
||||
compression/decompression. This section describes how to build libjpeg-turbo
|
||||
for these platforms.
|
||||
|
||||
|
||||
### Armv8 (64-bit)
|
||||
|
||||
**Xcode 5 or later required, Xcode 6.3.x or later recommended**
|
||||
|
||||
The following script demonstrates how to build libjpeg-turbo to run on the
|
||||
iPhone 5S/iPad Mini 2/iPad Air and newer.
|
||||
|
||||
IOS_PLATFORMDIR=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform
|
||||
IOS_SYSROOT=($IOS_PLATFORMDIR/Developer/SDKs/iPhoneOS*.sdk)
|
||||
export CFLAGS="-Wall -miphoneos-version-min=8.0 -funwind-tables"
|
||||
|
||||
cd {build_directory}
|
||||
|
||||
cmake -G"Unix Makefiles" \
|
||||
-DCMAKE_C_COMPILER=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang \
|
||||
-DCMAKE_OSX_ARCHITECTURES=arm64 \
|
||||
-DCMAKE_OSX_SYSROOT=${IOS_SYSROOT[0]} \
|
||||
[additional CMake flags] {source_directory}
|
||||
make
|
||||
|
||||
Replace `iPhoneOS` with `iPhoneSimulator` and `-miphoneos-version-min` with
|
||||
`-miphonesimulator-version-min` to build libjpeg-turbo for the iOS simulator on
|
||||
Macs with Apple silicon CPUs.
|
||||
|
||||
|
||||
Building libjpeg-turbo for Android
|
||||
----------------------------------
|
||||
|
||||
Building libjpeg-turbo for Android platforms requires v13b or later of the
|
||||
[Android NDK](https://developer.android.com/ndk).
|
||||
|
||||
|
||||
### Armv7 (32-bit)
|
||||
|
||||
**NDK r19 or later with Clang recommended**
|
||||
|
||||
The following is a general recipe script that can be modified for your specific
|
||||
needs.
|
||||
|
||||
# Set these variables to suit your needs
|
||||
NDK_PATH={full path to the NDK directory-- for example,
|
||||
/opt/android/android-ndk-r16b}
|
||||
TOOLCHAIN={"gcc" or "clang"-- "gcc" must be used with NDK r16b and earlier,
|
||||
and "clang" must be used with NDK r17c and later}
|
||||
ANDROID_VERSION={the minimum version of Android to support-- for example,
|
||||
"16", "19", etc.}
|
||||
|
||||
cd {build_directory}
|
||||
cmake -G"Unix Makefiles" \
|
||||
-DANDROID_ABI=armeabi-v7a \
|
||||
-DANDROID_ARM_MODE=arm \
|
||||
-DANDROID_PLATFORM=android-${ANDROID_VERSION} \
|
||||
-DANDROID_TOOLCHAIN=${TOOLCHAIN} \
|
||||
-DCMAKE_ASM_FLAGS="--target=arm-linux-androideabi${ANDROID_VERSION}" \
|
||||
-DCMAKE_TOOLCHAIN_FILE=${NDK_PATH}/build/cmake/android.toolchain.cmake \
|
||||
[additional CMake flags] {source_directory}
|
||||
make
|
||||
|
||||
|
||||
### Armv8 (64-bit)
|
||||
|
||||
**Clang recommended**
|
||||
|
||||
The following is a general recipe script that can be modified for your specific
|
||||
needs.
|
||||
|
||||
# Set these variables to suit your needs
|
||||
NDK_PATH={full path to the NDK directory-- for example,
|
||||
/opt/android/android-ndk-r16b}
|
||||
TOOLCHAIN={"gcc" or "clang"-- "gcc" must be used with NDK r14b and earlier,
|
||||
and "clang" must be used with NDK r17c and later}
|
||||
ANDROID_VERSION={the minimum version of Android to support. "21" or later
|
||||
is required for a 64-bit build.}
|
||||
|
||||
cd {build_directory}
|
||||
cmake -G"Unix Makefiles" \
|
||||
-DANDROID_ABI=arm64-v8a \
|
||||
-DANDROID_ARM_MODE=arm \
|
||||
-DANDROID_PLATFORM=android-${ANDROID_VERSION} \
|
||||
-DANDROID_TOOLCHAIN=${TOOLCHAIN} \
|
||||
-DCMAKE_ASM_FLAGS="--target=aarch64-linux-android${ANDROID_VERSION}" \
|
||||
-DCMAKE_TOOLCHAIN_FILE=${NDK_PATH}/build/cmake/android.toolchain.cmake \
|
||||
[additional CMake flags] {source_directory}
|
||||
make
|
||||
|
||||
|
||||
### x86 (32-bit)
|
||||
|
||||
The following is a general recipe script that can be modified for your specific
|
||||
needs.
|
||||
|
||||
# Set these variables to suit your needs
|
||||
NDK_PATH={full path to the NDK directory-- for example,
|
||||
/opt/android/android-ndk-r16b}
|
||||
TOOLCHAIN={"gcc" or "clang"-- "gcc" must be used with NDK r14b and earlier,
|
||||
and "clang" must be used with NDK r17c and later}
|
||||
ANDROID_VERSION={The minimum version of Android to support-- for example,
|
||||
"16", "19", etc.}
|
||||
|
||||
cd {build_directory}
|
||||
cmake -G"Unix Makefiles" \
|
||||
-DANDROID_ABI=x86 \
|
||||
-DANDROID_PLATFORM=android-${ANDROID_VERSION} \
|
||||
-DANDROID_TOOLCHAIN=${TOOLCHAIN} \
|
||||
-DCMAKE_TOOLCHAIN_FILE=${NDK_PATH}/build/cmake/android.toolchain.cmake \
|
||||
[additional CMake flags] {source_directory}
|
||||
make
|
||||
|
||||
|
||||
### x86-64 (64-bit)
|
||||
|
||||
The following is a general recipe script that can be modified for your specific
|
||||
needs.
|
||||
|
||||
# Set these variables to suit your needs
|
||||
NDK_PATH={full path to the NDK directory-- for example,
|
||||
/opt/android/android-ndk-r16b}
|
||||
TOOLCHAIN={"gcc" or "clang"-- "gcc" must be used with NDK r14b and earlier,
|
||||
and "clang" must be used with NDK r17c and later}
|
||||
ANDROID_VERSION={the minimum version of Android to support. "21" or later
|
||||
is required for a 64-bit build.}
|
||||
|
||||
cd {build_directory}
|
||||
cmake -G"Unix Makefiles" \
|
||||
-DANDROID_ABI=x86_64 \
|
||||
-DANDROID_PLATFORM=android-${ANDROID_VERSION} \
|
||||
-DANDROID_TOOLCHAIN=${TOOLCHAIN} \
|
||||
-DCMAKE_TOOLCHAIN_FILE=${NDK_PATH}/build/cmake/android.toolchain.cmake \
|
||||
[additional CMake flags] {source_directory}
|
||||
make
|
||||
|
||||
|
||||
Advanced CMake Options
|
||||
----------------------
|
||||
|
||||
To list and configure other CMake options not specifically mentioned in this
|
||||
guide, run
|
||||
|
||||
ccmake {source_directory}
|
||||
|
||||
or
|
||||
|
||||
cmake-gui {source_directory}
|
||||
|
||||
from the build directory after initially configuring the build. CCMake is a
|
||||
text-based interactive version of CMake, and CMake-GUI is a GUI version. Both
|
||||
will display all variables that are relevant to the libjpeg-turbo build, their
|
||||
current values, and a help string describing what they do.
|
||||
|
||||
|
||||
Installing libjpeg-turbo
|
||||
========================
|
||||
|
||||
You can use the build system to install libjpeg-turbo (as opposed to creating
|
||||
an installer package.) To do this, run `make install` or `nmake install`
|
||||
(or build the "install" target in the Visual Studio IDE.) Running
|
||||
`make uninstall` or `nmake uninstall` (or building the "uninstall" target in
|
||||
the Visual Studio IDE) will uninstall libjpeg-turbo.
|
||||
|
||||
The `CMAKE_INSTALL_PREFIX` CMake variable can be modified in order to install
|
||||
libjpeg-turbo into a directory of your choosing. If you don't specify
|
||||
`CMAKE_INSTALL_PREFIX`, then the default is:
|
||||
|
||||
**c:\libjpeg-turbo**<br>
|
||||
Visual Studio 32-bit build
|
||||
|
||||
**c:\libjpeg-turbo64**<br>
|
||||
Visual Studio 64-bit build
|
||||
|
||||
**c:\libjpeg-turbo-gcc**<br>
|
||||
MinGW 32-bit build
|
||||
|
||||
**c:\libjpeg-turbo-gcc64**<br>
|
||||
MinGW 64-bit build
|
||||
|
||||
**/opt/libjpeg-turbo**<br>
|
||||
Un*x
|
||||
|
||||
The default value of `CMAKE_INSTALL_PREFIX` causes the libjpeg-turbo files to
|
||||
be installed with a directory structure resembling that of the official
|
||||
libjpeg-turbo binary packages. Changing the value of `CMAKE_INSTALL_PREFIX`
|
||||
(for instance, to **/usr/local**) causes the libjpeg-turbo files to be
|
||||
installed with a directory structure that conforms to GNU standards.
|
||||
|
||||
The `CMAKE_INSTALL_BINDIR`, `CMAKE_INSTALL_DATAROOTDIR`,
|
||||
`CMAKE_INSTALL_DOCDIR`, `CMAKE_INSTALL_INCLUDEDIR`, `CMAKE_INSTALL_JAVADIR`,
|
||||
`CMAKE_INSTALL_LIBDIR`, and `CMAKE_INSTALL_MANDIR` CMake variables allow a
|
||||
finer degree of control over where specific files in the libjpeg-turbo
|
||||
distribution should be installed. These directory variables can either be
|
||||
specified as absolute paths or as paths relative to `CMAKE_INSTALL_PREFIX` (for
|
||||
instance, setting `CMAKE_INSTALL_DOCDIR` to **doc** would cause the
|
||||
documentation to be installed in **${CMAKE\_INSTALL\_PREFIX}/doc**.) If a
|
||||
directory variable contains the name of another directory variable in angle
|
||||
brackets, then its final value will depend on the final value of that other
|
||||
variable. For instance, the default value of `CMAKE_INSTALL_MANDIR` is
|
||||
**\<CMAKE\_INSTALL\_DATAROOTDIR\>/man**.
|
||||
|
||||
|
||||
Creating Distribution Packages
|
||||
==============================
|
||||
|
||||
The following commands can be used to create various types of distribution
|
||||
packages:
|
||||
|
||||
|
||||
Linux
|
||||
-----
|
||||
|
||||
make rpm
|
||||
|
||||
Create Red Hat-style binary RPM package. Requires RPM v4 or later.
|
||||
|
||||
make srpm
|
||||
|
||||
This runs `make dist` to create a pristine source tarball, then creates a
|
||||
Red Hat-style source RPM package from the tarball. Requires RPM v4 or later.
|
||||
|
||||
make deb
|
||||
|
||||
Create Debian-style binary package. Requires dpkg.
|
||||
|
||||
|
||||
Mac
|
||||
---
|
||||
|
||||
make dmg
|
||||
|
||||
Create Mac package/disk image. This requires pkgbuild and productbuild, which
|
||||
are installed by default on OS X/macOS 10.7 and later.
|
||||
|
||||
In order to create a Mac package/disk image that contains universal
|
||||
x86-64/Arm binaries, set the following CMake variable:
|
||||
|
||||
* `SECONDARY_BUILD`: Directory containing a cross-compiled x86-64 or Armv8
|
||||
(64-bit) iOS or macOS build of libjpeg-turbo to include in the universal
|
||||
binaries
|
||||
|
||||
You should first use CMake to configure the cross-compiled x86-64 or Armv8
|
||||
secondary build of libjpeg-turbo (see "Building libjpeg-turbo for iOS" above,
|
||||
if applicable) in a build directory that matches the one specified in the
|
||||
aforementioned CMake variable. Next, configure the primary (native) build of
|
||||
libjpeg-turbo as an out-of-tree build, specifying the aforementioned CMake
|
||||
variable, and build it. Once the primary build has been built, run `make dmg`
|
||||
from the build directory. The packaging system will build the secondary build,
|
||||
use lipo to combine it with the primary build into a single set of universal
|
||||
binaries, then package the universal binaries.
|
||||
|
||||
|
||||
Windows
|
||||
-------
|
||||
|
||||
If using NMake:
|
||||
|
||||
cd {build_directory}
|
||||
nmake installer
|
||||
|
||||
If using MinGW:
|
||||
|
||||
cd {build_directory}
|
||||
make installer
|
||||
|
||||
If using the Visual Studio IDE, build the "installer" target.
|
||||
|
||||
The installer package (libjpeg-turbo-*{version}*[-gcc|-vc][64].exe) will be
|
||||
located under *{build_directory}*. If building using the Visual Studio IDE,
|
||||
then the installer package will be located in a subdirectory with the same name
|
||||
as the configuration you built (such as *{build_directory}*\Debug\ or
|
||||
*{build_directory}*\Release\).
|
||||
|
||||
Building a Windows installer requires the
|
||||
[Nullsoft Install System](https://nsis.sourceforge.io). makensis.exe should
|
||||
be in your `PATH`.
|
||||
|
||||
|
||||
Regression testing
|
||||
==================
|
||||
|
||||
The most common way to test libjpeg-turbo is by invoking `make test` (Un*x) or
|
||||
`nmake test` (Windows command line) or by building the "RUN_TESTS" target
|
||||
(Visual Studio IDE), once the build has completed. This runs a series of tests
|
||||
to ensure that mathematical compatibility has been maintained between
|
||||
libjpeg-turbo and libjpeg v6b. This also invokes the TurboJPEG unit tests,
|
||||
which ensure that the colorspace extensions, YUV encoding, decompression
|
||||
scaling, and other features of the TurboJPEG C and Java APIs are working
|
||||
properly (and, by extension, that the equivalent features of the underlying
|
||||
libjpeg API are also working.)
|
||||
|
||||
Invoking `make testclean` (Un*x) or `nmake testclean` (Windows command line) or
|
||||
building the "testclean" target (Visual Studio IDE) will clean up the output
|
||||
images generated by the tests.
|
||||
|
||||
On Un*x platforms, more extensive tests of the TurboJPEG C and Java wrappers
|
||||
can be run by invoking `make tjtest`. These extended TurboJPEG tests
|
||||
essentially iterate through all of the available features of the TurboJPEG APIs
|
||||
that are not covered by the TurboJPEG unit tests (including the lossless
|
||||
transform options) and compare the images generated by each feature to images
|
||||
generated using the equivalent feature in the libjpeg API. The extended
|
||||
TurboJPEG tests are meant to test for regressions in the TurboJPEG wrappers,
|
||||
not in the underlying libjpeg API library.
|
||||
146
CHANGELOG
Normal file
@@ -0,0 +1,146 @@
|
||||
CHANGELOG for Independent JPEG Group's JPEG software
|
||||
|
||||
|
||||
Version 4A 18-Feb-93
|
||||
--------------------
|
||||
|
||||
Substantial speedup for grayscale output from color JPEG file (suppress
|
||||
processing of chrominance components). Lesser speedups in Huffman decoding
|
||||
and in compression quantization.
|
||||
|
||||
Can switch stdin/stdout to binary mode with either fdopen() or setmode();
|
||||
this allows use of one-file command line style on a wider range of systems.
|
||||
Also added -outfile switch so that makefile test scripts don't have to depend
|
||||
on the command line style.
|
||||
|
||||
New makefile.icc for Code Builder; makefile.sas is updated for SAS C 6.x.
|
||||
|
||||
Hook added to allow surrounding application to read and write COM (comment)
|
||||
blocks.
|
||||
|
||||
Bugfixes (DOS only): jmemdos.c code for accessing expanded memory only worked
|
||||
if struct fields are packed on byte boundaries. This is not true by default
|
||||
for Microsoft C. Furthermore, Microsoft C needs an _fheapmin() call to clean
|
||||
up the far heap correctly.
|
||||
|
||||
|
||||
Version 4 10-Dec-92
|
||||
--------------------
|
||||
|
||||
Revised user interface: switches now use names instead of single letters.
|
||||
(Old switch letters are acceptable abbreviations of new switch names, EXCEPT
|
||||
for djpeg's old -g, -D, -1 switches.) cjpeg has several new switches.
|
||||
|
||||
Provision for smoothing the input image added to cjpeg. This helps a lot with
|
||||
converting dithered GIFs to JPEG.
|
||||
|
||||
Decoder upsampling now uses interpolation instead of pixel replication; this
|
||||
improves rendering of sharp colored edges.
|
||||
|
||||
The decompressor will now try to continue after detecting an error in the
|
||||
compressed data, instead of just aborting. If the input file has restart
|
||||
markers, full synchronization will usually be regained at the next undamaged
|
||||
restart marker. (But you're still out of luck if any of the header markers
|
||||
are corrupt.)
|
||||
|
||||
Substantial improvements in speed; DCT accuracy improved too.
|
||||
|
||||
Numerous minor changes to improve portability. egetopt.c, which was by far
|
||||
the worst portability problem, is gone altogether.
|
||||
|
||||
A few bugfixes, sigh (mostly affecting DOS implementations only).
|
||||
Bugfix: on DOS machines, cjpeg -o would fail on grayscale input files.
|
||||
Bugfix: one-pass quantization to more than 64 color levels would fail on
|
||||
16-bit-int machines. This could only happen with quantized grayscale output.
|
||||
|
||||
A couple of changes affect code that calls the JPEG subroutine library:
|
||||
|
||||
1. The parameter struct tag names are now capitalized (Compress_info_struct,
|
||||
Compress_methods_struct, Decompress_info_struct, Decompress_methods_struct,
|
||||
and External_methods_struct). This makes it easier to live with brain-damaged
|
||||
compilers with short identifier lengths. (All identifiers used in the JPEG
|
||||
code are now unique within the first 16 characters.)
|
||||
|
||||
2. If you are not calling jselerror(), you need to initialize three new fields
|
||||
in the emethods structure, typically as follows:
|
||||
e_methods.num_warnings = 0; /* no warnings emitted yet */
|
||||
e_methods.first_warning_level = 0; /* display first corrupt-data warning */
|
||||
e_methods.more_warning_level = 3; /* but suppress additional ones */
|
||||
These fields control handling of corrupt-data warnings.
|
||||
|
||||
|
||||
Version 3 17-Mar-92
|
||||
--------------------
|
||||
|
||||
Memory manager is finally capable of swapping to temp files. There are
|
||||
separate versions of jmemsys.c for no temp files (same behavior as older
|
||||
versions), simple temp files with or without tmpfile(), and a DOS-specific
|
||||
version (including special code for EMS and XMS). This is probably much more
|
||||
system-dependent than any of the older code; some bugs may surface here.
|
||||
|
||||
Hooks added for user interface to install progress monitoring routine
|
||||
(percent-done bar, etc). See comments with dummy progress_monitor
|
||||
routines in jcdeflts.c, jddeflts.c.
|
||||
|
||||
Two-pass color quantization (finally!). This is now the default method when
|
||||
quantizing; say '-1' to djpeg for quick-and-ugly 1-pass method. There is
|
||||
a test file for checking 2-pass quantization and GIF output.
|
||||
|
||||
Fixed bug in jcopy_block_row that broke cjpeg -o option and djpeg -b option
|
||||
on MSDOS machines.
|
||||
|
||||
Miscellaneous small speedups; notably, DCT computation rearranged so that
|
||||
GCC "inline" feature is no longer needed for good code quality.
|
||||
|
||||
File config.c renamed ckconfig.c to avoid name conflict with /etc/config
|
||||
on Unix systems.
|
||||
|
||||
Added example.c to document usage of JPEG subroutines better.
|
||||
|
||||
Memory manager now knows how to release all storage during error exit ---
|
||||
avoids memory leak when using JPEG as subroutines. This implies a couple
|
||||
small changes to the subroutine interface: the old free_defaults subroutines
|
||||
are no longer needed, but if you have a replacement error_exit method then it
|
||||
must call the new free_all method. Also, jselvirtmem renamed to jselmemmgr.
|
||||
|
||||
Code for reading Targa files with 32-bit pixels was incorrect.
|
||||
|
||||
Colorspace conversion slightly faster and more accurate; because of
|
||||
this, old "test" files will no longer match bit-for-bit.
|
||||
|
||||
|
||||
Version 2 13-Dec-91
|
||||
--------------------
|
||||
|
||||
Documentation improved a little --- there are man pages now.
|
||||
Installation instructions moved from README to a separate file SETUP.
|
||||
|
||||
New program config.c is provided to help you get the configuration options
|
||||
right. This should make installation a lot more foolproof.
|
||||
|
||||
Sense of djpeg -D switch reversed: dithering is now ON by default.
|
||||
|
||||
RLE image file support added (thanks to Mike Lijewski).
|
||||
|
||||
Targa image file support added (thanks to Lee Crocker).
|
||||
|
||||
PPM input now accepts all PPM and PGM files.
|
||||
|
||||
Bug fix: on machines where 'int' is 16 bits, high-Q-setting JPEG files
|
||||
were not decoded correctly.
|
||||
|
||||
Numerous changes to improve portability. There should be few or no compiler
|
||||
warnings now.
|
||||
|
||||
Makefiles cleaned up; defaults now appropriate for production use rather than
|
||||
debugging.
|
||||
|
||||
Subroutine interface cleaned up. If you wrote code based on version 1's
|
||||
jcmain/jdmain, you'll need to change it, but it should get a little shorter
|
||||
and simpler.
|
||||
|
||||
|
||||
Version 1 7-Oct-91
|
||||
--------------------
|
||||
|
||||
Initial public release.
|
||||
1902
CMakeLists.txt
@@ -1,15 +0,0 @@
|
||||
# Community Participation Guidelines
|
||||
|
||||
This repository is governed by Mozilla's code of conduct and etiquette guidelines.
|
||||
For more details, please read the
|
||||
[Mozilla Community Participation Guidelines](https://www.mozilla.org/about/governance/policies/participation/).
|
||||
|
||||
## How to Report
|
||||
For more information on how to report violations of the Community Participation Guidelines, please read our '[How to Report](https://www.mozilla.org/about/governance/policies/participation/reporting/)' page.
|
||||
|
||||
<!--
|
||||
## Project Specific Etiquette
|
||||
|
||||
In some cases, there will be additional project etiquette i.e.: (https://bugzilla.mozilla.org/page.cgi?id=etiquette.html).
|
||||
Please update for your project.
|
||||
-->
|
||||
2316
ChangeLog.md
135
LICENSE.md
@@ -1,135 +0,0 @@
|
||||
libjpeg-turbo Licenses
|
||||
======================
|
||||
|
||||
libjpeg-turbo is covered by two compatible BSD-style open source licenses:
|
||||
|
||||
- The IJG (Independent JPEG Group) License, which is listed in
|
||||
[README.ijg](README.ijg)
|
||||
|
||||
This license applies to the libjpeg API library and associated programs,
|
||||
including any code inherited from libjpeg and any modifications to that
|
||||
code. Note that the libjpeg-turbo SIMD source code bears the
|
||||
[zlib License](https://opensource.org/licenses/Zlib), but in the context of
|
||||
the overall libjpeg API library, the terms of the zlib License are subsumed
|
||||
by the terms of the IJG License.
|
||||
|
||||
- The Modified (3-clause) BSD License, which is listed below
|
||||
|
||||
This license applies to the TurboJPEG API library and associated programs, as
|
||||
well as the build system. Note that the TurboJPEG API library wraps the
|
||||
libjpeg API library, so in the context of the overall TurboJPEG API library,
|
||||
both the terms of the IJG License and the terms of the Modified (3-clause)
|
||||
BSD License apply.
|
||||
|
||||
|
||||
Complying with the libjpeg-turbo Licenses
|
||||
=========================================
|
||||
|
||||
This section provides a roll-up of the libjpeg-turbo licensing terms, to the
|
||||
best of our understanding. This is not a license in and of itself. It is
|
||||
intended solely for clarification.
|
||||
|
||||
1. If you are distributing a modified version of the libjpeg-turbo source,
|
||||
then:
|
||||
|
||||
1. You cannot alter or remove any existing copyright or license notices
|
||||
from the source.
|
||||
|
||||
**Origin**
|
||||
- Clause 1 of the IJG License
|
||||
- Clause 1 of the Modified BSD License
|
||||
- Clauses 1 and 3 of the zlib License
|
||||
|
||||
2. You must add your own copyright notice to the header of each source
|
||||
file you modified, so others can tell that you modified that file. (If
|
||||
there is not an existing copyright header in that file, then you can
|
||||
simply add a notice stating that you modified the file.)
|
||||
|
||||
**Origin**
|
||||
- Clause 1 of the IJG License
|
||||
- Clause 2 of the zlib License
|
||||
|
||||
3. You must include the IJG README file, and you must not alter any of the
|
||||
copyright or license text in that file.
|
||||
|
||||
**Origin**
|
||||
- Clause 1 of the IJG License
|
||||
|
||||
2. If you are distributing only libjpeg-turbo binaries without the source, or
|
||||
if you are distributing an application that statically links with
|
||||
libjpeg-turbo, then:
|
||||
|
||||
1. Your product documentation must include a message stating:
|
||||
|
||||
This software is based in part on the work of the Independent JPEG
|
||||
Group.
|
||||
|
||||
**Origin**
|
||||
- Clause 2 of the IJG license
|
||||
|
||||
2. If your binary distribution includes or uses the TurboJPEG API, then
|
||||
your product documentation must include the text of the Modified BSD
|
||||
License (see below.)
|
||||
|
||||
**Origin**
|
||||
- Clause 2 of the Modified BSD License
|
||||
|
||||
3. You cannot use the name of the IJG or The libjpeg-turbo Project or the
|
||||
contributors thereof in advertising, publicity, etc.
|
||||
|
||||
**Origin**
|
||||
- IJG License
|
||||
- Clause 3 of the Modified BSD License
|
||||
|
||||
4. The IJG and The libjpeg-turbo Project do not warrant libjpeg-turbo to be
|
||||
free of defects, nor do we accept any liability for undesirable
|
||||
consequences resulting from your use of the software.
|
||||
|
||||
**Origin**
|
||||
- IJG License
|
||||
- Modified BSD License
|
||||
- zlib License
|
||||
|
||||
|
||||
The Modified (3-clause) BSD License
|
||||
===================================
|
||||
|
||||
Copyright (C)2009-2024 D. R. Commander. All Rights Reserved.<br>
|
||||
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.
|
||||
|
||||
|
||||
Why Two Licenses?
|
||||
=================
|
||||
|
||||
The zlib License could have been used instead of the Modified (3-clause) BSD
|
||||
License, and since the IJG License effectively subsumes the distribution
|
||||
conditions of the zlib License, this would have effectively placed
|
||||
libjpeg-turbo binary distributions under the IJG License. However, the IJG
|
||||
License specifically refers to the Independent JPEG Group and does not extend
|
||||
attribution and endorsement protections to other entities. Thus, it was
|
||||
desirable to choose a license that granted us the same protections for new code
|
||||
that were granted to the IJG for code derived from their software.
|
||||
405
README
Normal file
@@ -0,0 +1,405 @@
|
||||
The Independent JPEG Group's JPEG software
|
||||
==========================================
|
||||
|
||||
README for release 4A of 18-Feb-93
|
||||
==================================
|
||||
|
||||
This distribution contains a BETA TEST release of the Independent JPEG
|
||||
Group's free JPEG software. You are welcome to redistribute this software and
|
||||
to use it for any purpose, subject to the conditions under LEGAL ISSUES, below.
|
||||
|
||||
For installation instructions, see file SETUP.
|
||||
|
||||
For usage instructions, see file USAGE (or the cjpeg.1 and djpeg.1 manual
|
||||
pages; but USAGE contains a "hints" section not found in the manual pages).
|
||||
Useful information can also be found in the JPEG FAQ (Frequently Asked
|
||||
Questions) article; see ARCHIVE LOCATIONS below to obtain the FAQ article.
|
||||
|
||||
This software is still undergoing revision. Updated versions may be obtained
|
||||
by FTP or UUCP to UUNET and other archive sites; see ARCHIVE LOCATIONS below
|
||||
for details.
|
||||
|
||||
Serious users of this software (particularly those incorporating it into
|
||||
larger programs) should contact jpeg-info@uunet.uu.net to be added to our
|
||||
electronic mailing list. Mailing list members are notified of updates and
|
||||
have a chance to participate in technical discussions, etc.
|
||||
|
||||
This software is the work of Tom Lane, Philip Gladstone, Luis Ortiz, Lee
|
||||
Crocker, George Phillips, Ge' Weijers, and other members of the Independent
|
||||
JPEG Group.
|
||||
|
||||
|
||||
DISCLAIMER
|
||||
==========
|
||||
|
||||
THIS SOFTWARE IS NOT COMPLETE NOR FULLY DEBUGGED. It is not guaranteed to be
|
||||
useful for anything, nor to be compatible with subsequent releases, nor to be
|
||||
an accurate implementation of the JPEG standard. (See LEGAL ISSUES for even
|
||||
more disclaimers.)
|
||||
|
||||
Despite that, we believe that this software is pretty good, and if you find
|
||||
any problems with it, we'd like to know about them. Please report problems
|
||||
by e-mail to jpeg-info@uunet.uu.net.
|
||||
|
||||
|
||||
WHAT'S HERE
|
||||
===========
|
||||
|
||||
This distribution contains C software to implement JPEG image compression and
|
||||
decompression. JPEG (pronounced "jay-peg") is a standardized compression
|
||||
method for full-color and gray-scale images. JPEG is intended for compressing
|
||||
"real-world" scenes; cartoons and other non-realistic images are not its
|
||||
strong suit. JPEG is lossy, meaning that the output image is not necessarily
|
||||
identical to the input image. Hence you must not use JPEG if you have to have
|
||||
identical output bits. However, on typical images of real-world scenes, very
|
||||
good compression levels can be obtained with no visible change, and amazingly
|
||||
high compression levels are possible if you can tolerate a low-quality image.
|
||||
For more details, see the references, or just experiment with various
|
||||
compression settings.
|
||||
|
||||
The software implements JPEG baseline and extended-sequential compression
|
||||
processes. Provision is made for supporting all variants of these processes,
|
||||
although some uncommon parameter settings aren't implemented yet. For legal
|
||||
reasons, we are not distributing code for the arithmetic-coding process; see
|
||||
LEGAL ISSUES. At present we have made no provision for supporting the
|
||||
progressive, hierarchical, or lossless processes defined in the standard.
|
||||
|
||||
In order to support file conversion and viewing software, we have included
|
||||
considerable functionality beyond the bare JPEG coding/decoding capability;
|
||||
for example, the color quantization modules are not strictly part of JPEG
|
||||
decoding, but they are essential for output to colormapped file formats or
|
||||
colormapped displays. These extra functions can be compiled out if not
|
||||
required for a particular application.
|
||||
|
||||
The emphasis in designing this software has been on achieving portability and
|
||||
flexibility, while also making it fast enough to be useful. In particular,
|
||||
the software is not intended to be read as a tutorial on JPEG. (See the
|
||||
REFERENCES section for introductory material.) While we hope that the entire
|
||||
package will someday be industrial-strength code, much remains to be done in
|
||||
performance tuning and in improving the capabilities of individual modules.
|
||||
|
||||
|
||||
This software can be used on several levels:
|
||||
|
||||
* As canned software for JPEG compression and decompression. Just edit the
|
||||
Makefile and configuration files as needed (see file SETUP), compile and go.
|
||||
Members of the Independent JPEG Group will improve the out-of-the-box
|
||||
functionality and speed as time goes on.
|
||||
|
||||
* As the basis for other JPEG programs. For example, you could incorporate
|
||||
the decompressor into a general image viewing package by replacing the
|
||||
output module with write-to-screen functions. For an implementation on
|
||||
specific hardware, you might want to replace some of the inner loops with
|
||||
assembly code. For a non-command-line-driven system, you might want a
|
||||
different user interface. (Members of the group will be producing Macintosh
|
||||
and Amiga versions with more appropriate user interfaces, for example.)
|
||||
|
||||
* As a toolkit for experimentation with JPEG and JPEG-like algorithms. Most
|
||||
of the individual decisions you might want to mess with are packaged up into
|
||||
separate modules. For example, the details of color-space conversion and
|
||||
subsampling techniques are each localized in one compressor and one
|
||||
decompressor module. You'd probably also want to extend the user interface
|
||||
to give you more detailed control over the JPEG compression parameters.
|
||||
|
||||
In particular, we welcome the use of this software as a component of commercial
|
||||
products; no royalty is required.
|
||||
|
||||
|
||||
ARCHIVE LOCATIONS
|
||||
=================
|
||||
|
||||
[Version 4A is a beta-test release and will not be publicly archived.
|
||||
The following paragraphs refer to the most recent official release.]
|
||||
|
||||
The "official" archive site for this software is ftp.uu.net (Internet
|
||||
address 137.39.1.9 or 192.48.96.9). The most recent released version can
|
||||
always be found there in directory graphics/jpeg. This particular version
|
||||
will be archived as jpegsrc.v4.tar.Z. If you are on the Internet, you can
|
||||
retrieve files from UUNET by anonymous FTP. If you don't have FTP access,
|
||||
UUNET's archives are also available via UUCP; contact postmaster@uunet.uu.net
|
||||
for information on retrieving files that way.
|
||||
|
||||
Numerous Internet sites maintain copies of the UUNET files; in particular,
|
||||
you can probably find a copy at any site that archives comp.sources.misc
|
||||
submissions. However, only ftp.uu.net is guaranteed to have the latest
|
||||
official version.
|
||||
|
||||
You can also obtain this software from CompuServe, in the GRAPHSUPPORT forum
|
||||
(GO PICS), library 15; this version will be file jpsrc4.zip. Again,
|
||||
CompuServe is not guaranteed to have the very latest version.
|
||||
|
||||
The JPEG FAQ (Frequently Asked Questions) article is a useful source of
|
||||
general information about JPEG. It is updated constantly and therefore
|
||||
is not included in this distribution. The FAQ is posted every two weeks
|
||||
to Usenet newsgroups comp.graphics, news.answers, and other groups. You
|
||||
can always obtain the latest version from the news.answers archive at
|
||||
rtfm.mit.edu (18.172.1.27). By FTP, fetch /pub/usenet/news.answers/jpeg-faq.
|
||||
If you don't have FTP, send e-mail to mail-server@rtfm.mit.edu with body
|
||||
"send usenet/news.answers/jpeg-faq".
|
||||
|
||||
|
||||
SUPPORTING SOFTWARE
|
||||
===================
|
||||
|
||||
You will probably want Jef Poskanzer's PBMPLUS image software, which provides
|
||||
many useful operations on PPM-format image files. In particular, it can
|
||||
convert PPM images to and from a wide range of other formats. You can FTP
|
||||
this free software from export.lcs.mit.edu (contrib/pbmplus*.tar.Z) or
|
||||
ftp.ee.lbl.gov (pbmplus*.tar.Z). Unfortunately PBMPLUS is not nearly as
|
||||
portable as the JPEG software is; you are likely to have difficulty making it
|
||||
work on any non-Unix machine.
|
||||
|
||||
If you are using X Windows you might want to use the xv or xloadimage viewers
|
||||
to save yourself the trouble of converting PPM to some other format. Both of
|
||||
these can be found in the contrib directory at export.lcs.mit.edu. Actually,
|
||||
xv version 2.00 and up incorporates our software and thus can read and write
|
||||
JPEG files directly. (NOTE: since xv internally reduces all images to 8
|
||||
bits/pixel, a JPEG file written by xv will not be very high quality; and xv
|
||||
cannot fully exploit a 24-bit display. These problems are expected to go away
|
||||
in the next xv release, planned for early 1993. In the meantime, use
|
||||
xloadimage for 24-bit displays.)
|
||||
|
||||
For DOS machines, Lee Crocker's free Piclab program is a useful companion to
|
||||
the JPEG software. The latest version, currently 1.91, is available by FTP
|
||||
from SIMTEL20 and its various mirror sites, file <msdos.graphics>piclb191.zip.
|
||||
CompuServe also has it, in the same library as the JPEG software.
|
||||
|
||||
|
||||
SOFTWARE THAT'S NO HELP AT ALL
|
||||
==============================
|
||||
|
||||
Handmade Software's shareware PC program GIF2JPG produces files that are
|
||||
totally incompatible with our programs. They use a proprietary format that is
|
||||
an amalgam of GIF and JPEG representations. However, you can force GIF2JPG
|
||||
to produce compatible files with its -j switch, and their decompression
|
||||
program JPG2GIF can read our files (at least ones produced with our default
|
||||
option settings).
|
||||
|
||||
Some commercial JPEG implementations are also incompatible as of this writing,
|
||||
especially programs released before summer 1991. The root of the problem is
|
||||
that the ISO JPEG committee failed to specify a concrete file format. Some
|
||||
vendors "filled in the blanks" on their own, creating proprietary formats that
|
||||
no one else could read. (For example, none of the early commercial JPEG
|
||||
implementations for the Macintosh were able to exchange compressed files.)
|
||||
|
||||
The file format we have adopted is called JFIF (see REFERENCES). This format
|
||||
has been agreed to by a number of major commercial JPEG vendors, and we expect
|
||||
that it will become the de facto standard. JFIF is a minimal representation;
|
||||
work is also going forward to incorporate JPEG compression into the TIFF 6.0
|
||||
standard, for use in "high end" applications that need to record a lot of
|
||||
additional data about an image. We intend to support TIFF 6.0 in the future.
|
||||
We hope that these two formats will be sufficient and that other, incompatible
|
||||
JPEG file formats will not proliferate.
|
||||
|
||||
Indeed, part of the reason for developing and releasing this free software is
|
||||
to help force rapid convergence to de facto standards for JPEG file formats.
|
||||
SUPPORT STANDARD, NON-PROPRIETARY FORMATS: demand JFIF or TIFF 6.0!
|
||||
|
||||
|
||||
USING JPEG AS A SUBROUTINE IN A LARGER PROGRAM
|
||||
==============================================
|
||||
|
||||
You can readily incorporate the JPEG compression and decompression routines in
|
||||
a larger program. The file example.c provides a skeleton of the interface
|
||||
routines you'll need for this purpose. Essentially, you replace jcmain.c (for
|
||||
compression) and/or jdmain.c (for decompression) with your own code. Note
|
||||
that the fewer JPEG options you allow the user to twiddle, the less code you
|
||||
need; all the default options are set up automatically. (Alternately, if you
|
||||
know a lot about JPEG or have a special application, you may want to twiddle
|
||||
the default options even more extensively than jcmain/jdmain do.)
|
||||
|
||||
Most likely, you will want the uncompressed image to come from memory (for
|
||||
compression) or go to memory or the screen (for decompression). For this
|
||||
purpose you must provide image reading or writing routines that match the
|
||||
interface used by the image file I/O modules (jrdXXX or jwrXXX); again,
|
||||
example.c shows a skeleton of what is required. In this situation, you
|
||||
won't need any of the non-JPEG image file I/O modules used by cjpeg and djpeg.
|
||||
|
||||
By default, any error detected inside the JPEG routines will cause a message
|
||||
to be printed on stderr, followed by exit(). You can override this behavior
|
||||
by supplying your own message-printing and/or error-exit routines; again,
|
||||
example.c shows how.
|
||||
|
||||
We recommend you create libjpeg.a as shown in the Makefile, then link that
|
||||
with your surrounding program. (If your linker is at all reasonable, only the
|
||||
code you actually need will get loaded.) Include the files jconfig.h and
|
||||
jpegdata.h in C files that need to call the JPEG routines.
|
||||
|
||||
CAUTION: some people have tried to compile JPEG and their surrounding code
|
||||
with different compilers, e.g., cc for JPEG and c++ or gcc for the rest. This
|
||||
is a Real Bad Move and you will deserve what happens to you if you try it.
|
||||
(Hint: the parameter structures can get laid out differently with no warning.)
|
||||
|
||||
Read our "architecture" file for more info. If it seems to you that the
|
||||
software structure doesn't accommodate what you want to do, please contact
|
||||
the authors.
|
||||
|
||||
Beginning with version 3, we will endeavor to hold the interface described by
|
||||
example.c constant, so that you can plug in updated versions of the JPEG code
|
||||
just by recompiling. However, we can't guarantee this, especially if you
|
||||
choose to twiddle any JPEG options not listed in example.c. Check the
|
||||
CHANGELOG when installing any new version, and compare example.c against the
|
||||
prior version. Recompile your calling software (don't just relink), as we may
|
||||
add or subtract fields in the parameter structures.
|
||||
|
||||
|
||||
REFERENCES
|
||||
==========
|
||||
|
||||
We highly recommend reading one or more of these references before trying to
|
||||
understand the innards of any JPEG software.
|
||||
|
||||
The best short technical introduction to the JPEG compression algorithm is
|
||||
Wallace, Gregory K. "The JPEG Still Picture Compression Standard",
|
||||
Communications of the ACM, April 1991 (vol. 34 no. 4), pp. 30-44.
|
||||
(Adjacent articles in that issue discuss MPEG motion picture compression,
|
||||
applications of JPEG, and related topics.) If you don't have the CACM issue
|
||||
handy, a PostScript file containing a revised version of the article is
|
||||
available at ftp.uu.net, graphics/jpeg/wallace.ps.Z. The file (actually a
|
||||
preprint for an article to appear in IEEE Trans. Consumer Electronics) omits
|
||||
the sample images that appeared in CACM, but it includes corrections and some
|
||||
added material. Note: the Wallace article is copyright ACM and IEEE, and it
|
||||
may not be used for commercial purposes.
|
||||
|
||||
A somewhat less technical, more leisurely introduction to JPEG can be found in
|
||||
"The Data Compression Book" by Mark Nelson, published by M&T Books (Redwood
|
||||
City, CA), 1991, ISBN 1-55851-216-0. This book provides good explanations and
|
||||
example C code for a multitude of compression methods including JPEG. It is
|
||||
an excellent source if you are comfortable reading C code but don't know much
|
||||
about data compression in general. The book's JPEG sample code is far from
|
||||
industrial-strength, but when you are ready to look at a full implementation,
|
||||
you've got one here...
|
||||
|
||||
A new textbook about JPEG is "JPEG Still Image Data Compression Standard" by
|
||||
William B. Pennebaker and Joan L. Mitchell, published by Van Nostrand
|
||||
Reinhold, 1993, ISBN 0-442-01272-1. Price US$59.95. This book includes the
|
||||
complete text of the ISO JPEG standards (DIS 10918-1 and draft DIS 10918-2).
|
||||
This is by far the most complete exposition of JPEG in existence, and I highly
|
||||
recommend it. If you read the entire book, you will probably know more about
|
||||
JPEG than I do.
|
||||
|
||||
The JPEG standard itself is not available electronically; you must order a
|
||||
paper copy through ISO. (Unless you are concerned about having a certified
|
||||
official copy, I recommend buying the Pennebaker and Mitchell book instead;
|
||||
it's much cheaper and includes a great deal of useful explanatory material.)
|
||||
In the US, copies of the standard may be ordered from ANSI Sales at (212)
|
||||
642-4900. It's not cheap: as of 1992, Part 1 is $95 and Part 2 is $47, plus
|
||||
7% shipping/handling. The standard is divided into two parts, Part 1 being
|
||||
the actual specification, while Part 2 covers compliance testing methods.
|
||||
As of early 1992, Part 1 has Draft International Standard status. It is
|
||||
titled "Digital Compression and Coding of Continuous-tone Still Images, Part
|
||||
1: Requirements and guidelines" and has document number ISO/IEC DIS 10918-1.
|
||||
Part 2 is still at Committee Draft status. It is titled "Digital Compression
|
||||
and Coding of Continuous-tone Still Images, Part 2: Compliance testing" and
|
||||
has document number ISO/IEC CD 10918-2. (NOTE: I'm told that the final
|
||||
version of Part 2 will differ considerably from the CD draft.)
|
||||
|
||||
The JPEG standard does not specify all details of an interchangeable file
|
||||
format. For the omitted details we follow the "JFIF" conventions, revision
|
||||
1.02. A copy of the JFIF spec is available from:
|
||||
Literature Department
|
||||
C-Cube Microsystems, Inc.
|
||||
399A West Trimble Road
|
||||
San Jose, CA 95131
|
||||
(408) 944-6300
|
||||
A PostScript version of this document is available at ftp.uu.net, file
|
||||
graphics/jpeg/jfif.ps.Z. It can also be obtained by e-mail from the C-Cube
|
||||
mail server, netlib@c3.pla.ca.us. Send the message "send jfif_ps from jpeg"
|
||||
to the server to obtain the JFIF document; send the message "help" if you have
|
||||
trouble.
|
||||
|
||||
The TIFF 6.0 file format specification can be obtained by FTP from sgi.com
|
||||
(192.48.153.1), file graphics/tiff/TIFF6.ps.Z; or you can order a printed copy
|
||||
from Aldus Corp. at (206) 628-6593. It should be noted that the TIFF 6.0 spec
|
||||
of 3-June-92 has a number of serious problems in its JPEG features. A
|
||||
clarification note will probably be needed to ensure that TIFF JPEG files are
|
||||
compatible across different implementations. The IJG does not intend to
|
||||
support TIFF 6.0 until these problems are resolved.
|
||||
|
||||
If you want to understand this implementation, start by reading the
|
||||
"architecture" documentation file. Please read "codingrules" if you want to
|
||||
contribute any code.
|
||||
|
||||
|
||||
LEGAL ISSUES
|
||||
============
|
||||
|
||||
The authors make NO WARRANTY or representation, either express or implied,
|
||||
with respect to this software, its quality, accuracy, merchantability, or
|
||||
fitness for a particular purpose. This software is provided "AS IS", and you,
|
||||
its user, assume the entire risk as to its quality and accuracy.
|
||||
|
||||
This software is copyright (C) 1991, 1992, Thomas G. Lane.
|
||||
All Rights Reserved except as specified below.
|
||||
|
||||
Permission is hereby granted to use, copy, modify, and distribute this
|
||||
software (or portions thereof) for any purpose, without fee, subject to these
|
||||
conditions:
|
||||
(1) If any part of the source code for this software is distributed, then this
|
||||
README file must be included, with this copyright and no-warranty notice
|
||||
unaltered; and any additions, deletions, or changes to the original files
|
||||
must be clearly indicated in accompanying documentation.
|
||||
(2) If only executable code is distributed, then the accompanying
|
||||
documentation must state that "this software is based in part on the work of
|
||||
the Independent JPEG Group".
|
||||
(3) Permission for use of this software is granted only if the user accepts
|
||||
full responsibility for any undesirable consequences; the authors accept
|
||||
NO LIABILITY for damages of any kind.
|
||||
|
||||
Permission is NOT granted for the use of any IJG author's name or company name
|
||||
in advertising or publicity relating to this software or products derived from
|
||||
it. This software may be referred to only as "the Independent JPEG Group's
|
||||
software".
|
||||
|
||||
We specifically permit and encourage the use of this software as the basis of
|
||||
commercial products, provided that all warranty or liability claims are
|
||||
assumed by the product vendor.
|
||||
|
||||
|
||||
ansi2knr.c is included in this distribution by permission of L. Peter Deutsch,
|
||||
sole proprietor of its copyright holder, Aladdin Enterprises of Menlo Park, CA.
|
||||
ansi2knr.c is NOT covered by the above copyright and conditions, but instead
|
||||
by the usual distribution terms of the Free Software Foundation; principally,
|
||||
that you must include source code if you redistribute it. (See the file
|
||||
ansi2knr.c for full details.) However, since ansi2knr.c is not needed as part
|
||||
of any program generated from the JPEG code, this does not limit you more than
|
||||
the foregoing paragraphs do.
|
||||
|
||||
|
||||
It appears that the arithmetic coding option of the JPEG spec is covered by
|
||||
patents owned by IBM and AT&T, as well as a pending Japanese patent of
|
||||
Mitsubishi. Hence arithmetic coding cannot legally be used without obtaining
|
||||
one or more licenses. For this reason, support for arithmetic coding has been
|
||||
removed from the free JPEG software. (Since arithmetic coding provides only a
|
||||
marginal gain over the unpatented Huffman mode, it is unlikely that very many
|
||||
implementors will support it. If you do obtain the necessary licenses,
|
||||
contact jpeg-info@uunet.uu.net for a copy of our arithmetic coding modules.)
|
||||
So far as we are aware, there are no patent restrictions on the remaining
|
||||
code.
|
||||
|
||||
|
||||
We are required to state that
|
||||
"The Graphics Interchange Format(c) is the Copyright property of
|
||||
CompuServe Incorporated. GIF(sm) is a Service Mark property of
|
||||
CompuServe Incorporated."
|
||||
|
||||
|
||||
TO DO
|
||||
=====
|
||||
|
||||
The next major release will probably be a significant rewrite to allow use of
|
||||
this code in conjunction with Sam Leffler's free TIFF library (assuming the
|
||||
bugs in the TIFF 6.0 specification get resolved).
|
||||
|
||||
Many of the modules need fleshing out to provide more complete
|
||||
implementations, or to provide faster paths for common cases.
|
||||
Speeding things up is still high on our priority list.
|
||||
|
||||
We'd appreciate it if people would compile and check out the code on as wide a
|
||||
variety of systems as possible, and report any portability problems
|
||||
encountered (with solutions, if possible). Checks of file compatibility with
|
||||
other JPEG implementations would also be of interest. Finally, we would
|
||||
appreciate code profiles showing where the most time is spent, especially on
|
||||
unusual systems.
|
||||
|
||||
Please send bug reports, offers of help, etc. to jpeg-info@uunet.uu.net.
|
||||
@@ -1,194 +0,0 @@
|
||||
Mozilla JPEG Encoder Project
|
||||
============================
|
||||
|
||||
mozjpeg is a fork of libjpeg-turbo that aims to speed up load times of web
|
||||
pages by reducing the size (and, by extension, the transmission time) of JPEG
|
||||
files. It accomplishes this by enabling optimized Huffman trees and
|
||||
progressive entropy coding by default in the JPEG compressor, as well as
|
||||
splitting the spectrum of DCT coefficients into separate scans and using
|
||||
Trellis quantisation.
|
||||
|
||||
Although it is based on libjpeg-turbo, mozjpeg is not intended to be a
|
||||
general-purpose or high-performance JPEG library. Its performance is highly
|
||||
"asymmetric". That is, the JPEG files it generates require much more time to
|
||||
compress than to decompress. When the default settings are used, mozjpeg is
|
||||
considerably slower than libjpeg-turbo or even libjpeg at compressing images.
|
||||
Thus, it is not generally suitable for real-time compression. It is best used
|
||||
as part of a web encoding workflow.
|
||||
|
||||
|
||||
libjpeg API Extensibility Framework
|
||||
===================================
|
||||
|
||||
mozjpeg's implementation of the libjpeg API includes an extensibility framework
|
||||
that allows new features to be added without modifying the transparent libjpeg
|
||||
compress/decompress structures (which would break backward ABI compatibility.)
|
||||
Extension parameters are placed into the opaque jpeg_comp_master structure, and
|
||||
a set of accessor functions and globally unique tokens allows for
|
||||
getting/setting those parameters without directly accessing the structure.
|
||||
|
||||
Currently, only the accessor functions necessary to support the mozjpeg
|
||||
extensions are implemented, but the framework can be easily extended in the
|
||||
future to accommodate additional simple parameter types, complex or
|
||||
multi-valued parameters, or decompressor extensions.
|
||||
|
||||
|
||||
The currently-implemented accessor functions are as follows:
|
||||
|
||||
boolean jpeg_c_bool_param_supported (j_compress_ptr cinfo,
|
||||
J_BOOLEAN_PARAM param)
|
||||
Returns TRUE if the given boolean extension parameter is supported by
|
||||
this implementation of the libjpeg API, or FALSE otherwise.
|
||||
|
||||
void jpeg_c_set_bool_param (j_compress_ptr cinfo,
|
||||
J_BOOLEAN_PARAM param, boolean value);
|
||||
Set the given boolean extension parameter to the given value (TRUE or
|
||||
FALSE.)
|
||||
|
||||
boolean jpeg_c_get_bool_param (j_compress_ptr cinfo, J_BOOLEAN_PARAM param)
|
||||
Get the value of the given boolean extension parameter (TRUE or FALSE.)
|
||||
|
||||
boolean jpeg_c_float_param_supported (j_compress_ptr cinfo,
|
||||
J_FLOAT_PARAM param)
|
||||
Returns TRUE if the given floating point extension parameter is
|
||||
supported by this implementation of the libjpeg API, or FALSE
|
||||
otherwise.
|
||||
|
||||
void jpeg_c_set_float_param (j_compress_ptr cinfo, J_FLOAT_PARAM param,
|
||||
float value)
|
||||
Set the given floating point extension parameter to the given value.
|
||||
|
||||
float jpeg_c_get_float_param (j_compress_ptr cinfo, J_FLOAT_PARAM param);
|
||||
Get the value of the given floating point extension parameter.
|
||||
|
||||
boolean jpeg_c_int_param_supported (j_compress_ptr cinfo,
|
||||
J_INT_PARAM param)
|
||||
Returns TRUE if the given integer extension parameter is supported by
|
||||
this implementation of the libjpeg API, or FALSE otherwise.
|
||||
|
||||
void jpeg_c_set_int_param (j_compress_ptr cinfo, J_INT_PARAM param,
|
||||
int value)
|
||||
Set the given integer extension parameter to the given value.
|
||||
|
||||
int jpeg_c_get_int_param (j_compress_ptr cinfo, J_INT_PARAM param)
|
||||
Get the value of the given integer extension parameter.
|
||||
|
||||
|
||||
Boolean Extension Parameters Supported by mozjpeg
|
||||
-------------------------------------------------
|
||||
|
||||
* JBOOLEAN_OPTIMIZE_SCANS (default: TRUE)
|
||||
Specifies whether scan parameters should be optimized. Parameter
|
||||
optimization is done as in jpgcrush. jpeg_simple_progression() should be called
|
||||
after setting JBOOLEAN_OPTIMIZE_SCANS.
|
||||
When disabling JBOOLEAN_OPTIMIZE_SCANS, cinfo.scan_info should additionally be
|
||||
set to NULL to disable use of the progressive coding mode, if so desired.
|
||||
|
||||
* JBOOLEAN_TRELLIS_QUANT (default: TRUE)
|
||||
Specifies whether to apply trellis quantization. For each 8x8 block, trellis
|
||||
quantization determines the best tradeoff between rate and distortion.
|
||||
|
||||
* JBOOLEAN_TRELLIS_QUANT_DC (default: TRUE)
|
||||
Specifies whether to apply trellis quantization to DC coefficients.
|
||||
|
||||
* JBOOLEAN_TRELLIS_EOB_OPT (default: FALSE)
|
||||
Specifies whether to optimize runs of zero blocks in trellis quantization.
|
||||
This is applicable only when JBOOLEAN_USE_SCANS_IN_TRELLIS is enabled.
|
||||
|
||||
* JBOOLEAN_USE_LAMBDA_WEIGHT_TBL currently has no effect.
|
||||
|
||||
* JBOOLEAN_USE_SCANS_IN_TRELLIS (default: FALSE)
|
||||
Specifies whether multiple scans should be considered during trellis
|
||||
quantization.
|
||||
|
||||
* JBOOLEAN_TRELLIS_Q_OPT (default: FALSE)
|
||||
Specifies whether to optimize the quantization table after trellis
|
||||
quantization. If enabled, then a revised quantization table is derived so
|
||||
as to minimize the reconstruction error of the quantized coefficients.
|
||||
|
||||
* JBOOLEAN_OVERSHOOT_DERINGING (default: TRUE)
|
||||
Specifies whether overshooting is applied to samples with extreme values
|
||||
(for example, 0 and 255 for 8-bit samples). Overshooting may reduce ringing
|
||||
artifacts from compression, in particular in areas where black text appears
|
||||
on a white background.
|
||||
|
||||
|
||||
Floating Point Extension Parameters Supported by mozjpeg
|
||||
--------------------------------------------------------
|
||||
|
||||
* JFLOAT_LAMBDA_LOG_SCALE1 (default: 14.75)
|
||||
JFLOAT_LAMBDA_LOG_SCALE2 (default: 16.5)
|
||||
These parameters specify the lambda value used in trellis quantization. The
|
||||
lambda value (Lagrange multiplier) in the
|
||||
R + lambda * D
|
||||
equation is derived from
|
||||
lambda = 2^s1 / ((2^s2 + n) * q^2),
|
||||
where s1 and s2 are the values of JFLOAT_LAMBDA_LOG_SCALE1 and
|
||||
JFLOAT_LAMBDA_LOG_SCALE2, n is the average of the squared unquantized AC
|
||||
coefficients within the current 8x8 block, and q is the quantization table
|
||||
entry associated with the current coefficient frequency. If
|
||||
JFLOAT_LAMBDA_LOG_SCALE2 is 0, then an alternate form is used that does not
|
||||
rely on n:
|
||||
lambda = 2^(s1-12) / q^2.
|
||||
|
||||
* JFLOAT_TRELLIS_DELTA_DC_WEIGHT (default: 0.0)
|
||||
This parameter controls how distortion is calculated in DC trellis quantization
|
||||
(enabled with JBOOLEAN_TRELLIS_QUANT_DC). It defines weighting between distortion
|
||||
of the DC coefficient and distortion of the vertical gradient of DC coefficients.
|
||||
The value of the parameter corresponds to the weight applied to the distortion
|
||||
of the vertical gradient.
|
||||
|
||||
|
||||
Integer Extension Parameters Supported by mozjpeg
|
||||
-------------------------------------------------
|
||||
|
||||
* JINT_COMPRESS_PROFILE (default: JCP_MAX_COMPRESSION)
|
||||
Select a compression profile, which is a set of default parameters that will
|
||||
achieve a desired compression goal. This parameter controls the behavior of
|
||||
the jpeg_set_defaults() function. Thus, setting JINT_COMPRESS_PROFILE does
|
||||
not cause any other parameters to be modified until jpeg_set_defaults() is
|
||||
called. The following compression profiles are supported:
|
||||
|
||||
- JCP_MAX_COMPRESSION (default)
|
||||
Increase the compression ratio as much as possible, at the expense of
|
||||
increased encoding time. This enables progressive entropy coding and all
|
||||
mozjpeg extensions.
|
||||
|
||||
- JCP_FASTEST
|
||||
Use the libjpeg[-turbo] defaults (baseline entropy coding, no mozjpeg
|
||||
extensions enabled.)
|
||||
|
||||
* JINT_TRELLIS_FREQ_SPLIT (default: 8)
|
||||
Specifies the position within the zigzag scan at which the split between
|
||||
scans is positioned in the context of trellis quantization.
|
||||
JBOOLEAN_USE_SCANS_IN_TRELLIS must be enabled for this parameter to have any
|
||||
effect.
|
||||
|
||||
* JINT_TRELLIS_NUM_LOOPS (default: 1)
|
||||
Specifies the number of trellis quantization passes. Huffman tables are
|
||||
updated between passes.
|
||||
|
||||
* JINT_BASE_QUANT_TBL_IDX (default: 3)
|
||||
Specifies which quantization table set to use. The following options are
|
||||
available:
|
||||
0 = Tables from JPEG Annex K
|
||||
1 = Flat table
|
||||
2 = Table tuned for MSSIM on Kodak image set
|
||||
3 = Table from http://www.imagemagick.org/discourse-server/viewtopic.php?f=22&t=20333&p=98008#p98008
|
||||
4 = Table tuned for PSNR-HVS-M on Kodak image set
|
||||
5 = Table from: Relevance of Human Vision to JPEG-DCT Compression
|
||||
(1992) Klein, Silverstein and Carney
|
||||
6 = Table from: DCTune Perceptual Optimization of Compressed Dental X-Rays
|
||||
(1997) Watson, Taylor, Borthwick
|
||||
7 = Table from: A Visual Detection Model for DCT Coefficient Quantization
|
||||
(12/9/93) Ahumada, Watson, Peterson
|
||||
8 = Table from: An Improved Detection Model for DCT Coefficient Quantization
|
||||
(1993) Peterson, Ahumada and Watson
|
||||
|
||||
* JINT_DC_SCAN_OPT_MODE (default: 0)
|
||||
Specifies the DC scan optimization mode. The following options are
|
||||
available:
|
||||
0 = One scan for all components
|
||||
1 = One scan per component
|
||||
2 = Optimize between one scan for all components and one scan for the first
|
||||
component plus one scan for the remaining components
|
||||
372
README-turbo.txt
@@ -1,372 +0,0 @@
|
||||
Background
|
||||
==========
|
||||
|
||||
libjpeg-turbo is a JPEG image codec that uses SIMD instructions to accelerate
|
||||
baseline JPEG compression and decompression on x86, x86-64, Arm, PowerPC, and
|
||||
MIPS systems, as well as progressive JPEG compression on x86, x86-64, and Arm
|
||||
systems. On such systems, libjpeg-turbo is generally 2-6x as fast as libjpeg,
|
||||
all else being equal. On other types of systems, libjpeg-turbo can still
|
||||
outperform libjpeg by a significant amount, by virtue of its highly-optimized
|
||||
Huffman coding routines. In many cases, the performance of libjpeg-turbo
|
||||
rivals that of proprietary high-speed JPEG codecs.
|
||||
|
||||
libjpeg-turbo implements both the traditional libjpeg API as well as the less
|
||||
powerful but more straightforward TurboJPEG API. libjpeg-turbo also features
|
||||
colorspace extensions that allow it to compress from/decompress to 32-bit and
|
||||
big-endian pixel buffers (RGBX, XBGR, etc.), as well as a full-featured Java
|
||||
interface.
|
||||
|
||||
libjpeg-turbo was originally based on libjpeg/SIMD, an MMX-accelerated
|
||||
derivative of libjpeg v6b developed by Miyasaka Masaru. The TigerVNC and
|
||||
VirtualGL projects made numerous enhancements to the codec in 2009, and in
|
||||
early 2010, libjpeg-turbo spun off into an independent project, with the goal
|
||||
of making high-speed JPEG compression/decompression technology available to a
|
||||
broader range of users and developers. libjpeg-turbo is an ISO/IEC and ITU-T
|
||||
reference implementation of the JPEG standard.
|
||||
|
||||
More information about libjpeg-turbo can be found at
|
||||
<https://libjpeg-turbo.org>.
|
||||
|
||||
|
||||
Funding
|
||||
=======
|
||||
|
||||
libjpeg-turbo is an independent open source project, but we rely on patronage
|
||||
and funded development in order to maintain that independence. The easiest way
|
||||
to ensure that libjpeg-turbo remains community-focused and free of any one
|
||||
organization's agenda is to
|
||||
[sponsor our project through GitHub](https://github.com/sponsors/libjpeg-turbo).
|
||||
All sponsorship money goes directly toward funding the labor necessary to
|
||||
maintain libjpeg-turbo, support the user community, and implement bug fixes and
|
||||
strategically important features.
|
||||
|
||||
[](https://github.com/sponsors/libjpeg-turbo)
|
||||
|
||||
|
||||
License
|
||||
=======
|
||||
|
||||
libjpeg-turbo is covered by three compatible BSD-style open source licenses.
|
||||
Refer to [LICENSE.md](LICENSE.md) for a roll-up of license terms.
|
||||
|
||||
|
||||
Building libjpeg-turbo
|
||||
======================
|
||||
|
||||
Refer to [BUILDING.md](BUILDING.md) for complete instructions.
|
||||
|
||||
|
||||
Using libjpeg-turbo
|
||||
===================
|
||||
|
||||
libjpeg-turbo includes two APIs that can be used to compress and decompress
|
||||
JPEG images:
|
||||
|
||||
- **TurboJPEG API**<br>
|
||||
This API provides an easy-to-use interface for compressing and decompressing
|
||||
JPEG images in memory. It also provides some functionality that would not be
|
||||
straightforward to achieve using the underlying libjpeg API, such as
|
||||
generating planar YUV images and performing multiple simultaneous lossless
|
||||
transforms on an image. The Java interface for libjpeg-turbo is written on
|
||||
top of the TurboJPEG API. The TurboJPEG API is recommended for first-time
|
||||
users of libjpeg-turbo. Refer to [tjexample.c](tjexample.c) and
|
||||
[TJExample.java](java/TJExample.java) for examples of its usage and to
|
||||
<https://libjpeg-turbo.org/Documentation/Documentation> for API
|
||||
documentation.
|
||||
|
||||
- **libjpeg API**<br>
|
||||
This is the de facto industry-standard API for compressing and decompressing
|
||||
JPEG images. It is more difficult to use than the TurboJPEG API but also
|
||||
more powerful. The libjpeg API implementation in libjpeg-turbo is both
|
||||
API/ABI-compatible and mathematically compatible with libjpeg v6b. It can
|
||||
also optionally be configured to be API/ABI-compatible with libjpeg v7 and v8
|
||||
(see below.) Refer to [cjpeg.c](cjpeg.c) and [djpeg.c](djpeg.c) for examples
|
||||
of its usage and to [libjpeg.txt](libjpeg.txt) for API documentation.
|
||||
|
||||
There is no significant performance advantage to either API when both are used
|
||||
to perform similar operations.
|
||||
|
||||
Colorspace Extensions
|
||||
---------------------
|
||||
|
||||
libjpeg-turbo includes extensions that allow JPEG images to be compressed
|
||||
directly from (and decompressed directly to) buffers that use BGR, BGRX,
|
||||
RGBX, XBGR, and XRGB pixel ordering. This is implemented with ten new
|
||||
colorspace constants:
|
||||
|
||||
JCS_EXT_RGB /* red/green/blue */
|
||||
JCS_EXT_RGBX /* red/green/blue/x */
|
||||
JCS_EXT_BGR /* blue/green/red */
|
||||
JCS_EXT_BGRX /* blue/green/red/x */
|
||||
JCS_EXT_XBGR /* x/blue/green/red */
|
||||
JCS_EXT_XRGB /* x/red/green/blue */
|
||||
JCS_EXT_RGBA /* red/green/blue/alpha */
|
||||
JCS_EXT_BGRA /* blue/green/red/alpha */
|
||||
JCS_EXT_ABGR /* alpha/blue/green/red */
|
||||
JCS_EXT_ARGB /* alpha/red/green/blue */
|
||||
|
||||
Setting `cinfo.in_color_space` (compression) or `cinfo.out_color_space`
|
||||
(decompression) to one of these values will cause libjpeg-turbo to read the
|
||||
red, green, and blue values from (or write them to) the appropriate position in
|
||||
the pixel when compressing from/decompressing to an RGB buffer.
|
||||
|
||||
Your application can check for the existence of these extensions at compile
|
||||
time with:
|
||||
|
||||
#ifdef JCS_EXTENSIONS
|
||||
|
||||
At run time, attempting to use these extensions with a libjpeg implementation
|
||||
that does not support them will result in a "Bogus input colorspace" error.
|
||||
Applications can trap this error in order to test whether run-time support is
|
||||
available for the colorspace extensions.
|
||||
|
||||
When using the RGBX, BGRX, XBGR, and XRGB colorspaces during decompression, the
|
||||
X byte is undefined, and in order to ensure the best performance, libjpeg-turbo
|
||||
can set that byte to whatever value it wishes. If an application expects the X
|
||||
byte to be used as an alpha channel, then it should specify `JCS_EXT_RGBA`,
|
||||
`JCS_EXT_BGRA`, `JCS_EXT_ABGR`, or `JCS_EXT_ARGB`. When these colorspace
|
||||
constants are used, the X byte is guaranteed to be 0xFF, which is interpreted
|
||||
as opaque.
|
||||
|
||||
Your application can check for the existence of the alpha channel colorspace
|
||||
extensions at compile time with:
|
||||
|
||||
#ifdef JCS_ALPHA_EXTENSIONS
|
||||
|
||||
[jcstest.c](jcstest.c), located in the libjpeg-turbo source tree, demonstrates
|
||||
how to check for the existence of the colorspace extensions at compile time and
|
||||
run time.
|
||||
|
||||
libjpeg v7 and v8 API/ABI Emulation
|
||||
-----------------------------------
|
||||
|
||||
With libjpeg v7 and v8, new features were added that necessitated extending the
|
||||
compression and decompression structures. Unfortunately, due to the exposed
|
||||
nature of those structures, extending them also necessitated breaking backward
|
||||
ABI compatibility with previous libjpeg releases. Thus, programs that were
|
||||
built to use libjpeg v7 or v8 did not work with libjpeg-turbo, since it is
|
||||
based on the libjpeg v6b code base. Although libjpeg v7 and v8 are not
|
||||
as widely used as v6b, enough programs (including a few Linux distros) made
|
||||
the switch that there was a demand to emulate the libjpeg v7 and v8 ABIs
|
||||
in libjpeg-turbo. It should be noted, however, that this feature was added
|
||||
primarily so that applications that had already been compiled to use libjpeg
|
||||
v7+ could take advantage of accelerated baseline JPEG encoding/decoding
|
||||
without recompiling. libjpeg-turbo does not claim to support all of the
|
||||
libjpeg v7+ features, nor to produce identical output to libjpeg v7+ in all
|
||||
cases (see below.)
|
||||
|
||||
By passing an argument of `-DWITH_JPEG7=1` or `-DWITH_JPEG8=1` to `cmake`, you
|
||||
can build a version of libjpeg-turbo that emulates the libjpeg v7 or v8 ABI, so
|
||||
that programs that are built against libjpeg v7 or v8 can be run with
|
||||
libjpeg-turbo. The following section describes which libjpeg v7+ features are
|
||||
supported and which aren't.
|
||||
|
||||
### Support for libjpeg v7 and v8 Features
|
||||
|
||||
#### Fully supported
|
||||
|
||||
- **libjpeg API: IDCT scaling extensions in decompressor**<br>
|
||||
libjpeg-turbo supports IDCT scaling with scaling factors of 1/8, 1/4, 3/8,
|
||||
1/2, 5/8, 3/4, 7/8, 9/8, 5/4, 11/8, 3/2, 13/8, 7/4, 15/8, and 2/1 (only 1/4
|
||||
and 1/2 are SIMD-accelerated.)
|
||||
|
||||
- **libjpeg API: Arithmetic coding**
|
||||
|
||||
- **libjpeg API: In-memory source and destination managers**<br>
|
||||
See notes below.
|
||||
|
||||
- **cjpeg: Separate quality settings for luminance and chrominance**<br>
|
||||
Note that the libpjeg v7+ API was extended to accommodate this feature only
|
||||
for convenience purposes. It has always been possible to implement this
|
||||
feature with libjpeg v6b (see rdswitch.c for an example.)
|
||||
|
||||
- **cjpeg: 32-bit BMP support**
|
||||
|
||||
- **cjpeg: `-rgb` option**
|
||||
|
||||
- **jpegtran: Lossless cropping**
|
||||
|
||||
- **jpegtran: `-perfect` option**
|
||||
|
||||
- **jpegtran: Forcing width/height when performing lossless crop**
|
||||
|
||||
- **rdjpgcom: `-raw` option**
|
||||
|
||||
- **rdjpgcom: Locale awareness**
|
||||
|
||||
|
||||
#### Not supported
|
||||
|
||||
NOTE: As of this writing, extensive research has been conducted into the
|
||||
usefulness of DCT scaling as a means of data reduction and SmartScale as a
|
||||
means of quality improvement. Readers are invited to peruse the research at
|
||||
<https://libjpeg-turbo.org/About/SmartScale> and draw their own conclusions,
|
||||
but it is the general belief of our project that these features have not
|
||||
demonstrated sufficient usefulness to justify inclusion in libjpeg-turbo.
|
||||
|
||||
- **libjpeg API: DCT scaling in compressor**<br>
|
||||
`cinfo.scale_num` and `cinfo.scale_denom` are silently ignored.
|
||||
There is no technical reason why DCT scaling could not be supported when
|
||||
emulating the libjpeg v7+ API/ABI, but without the SmartScale extension (see
|
||||
below), only scaling factors of 1/2, 8/15, 4/7, 8/13, 2/3, 8/11, 4/5, and
|
||||
8/9 would be available, which is of limited usefulness.
|
||||
|
||||
- **libjpeg API: SmartScale**<br>
|
||||
`cinfo.block_size` is silently ignored.
|
||||
SmartScale is an extension to the JPEG format that allows for DCT block
|
||||
sizes other than 8x8. Providing support for this new format would be
|
||||
feasible (particularly without full acceleration.) However, until/unless
|
||||
the format becomes either an official industry standard or, at minimum, an
|
||||
accepted solution in the community, we are hesitant to implement it, as
|
||||
there is no sense of whether or how it might change in the future. It is
|
||||
our belief that SmartScale has not demonstrated sufficient usefulness as a
|
||||
lossless format nor as a means of quality enhancement, and thus our primary
|
||||
interest in providing this feature would be as a means of supporting
|
||||
additional DCT scaling factors.
|
||||
|
||||
- **libjpeg API: Fancy downsampling in compressor**<br>
|
||||
`cinfo.do_fancy_downsampling` is silently ignored.
|
||||
This requires the DCT scaling feature, which is not supported.
|
||||
|
||||
- **jpegtran: Scaling**<br>
|
||||
This requires both the DCT scaling and SmartScale features, which are not
|
||||
supported.
|
||||
|
||||
- **Lossless RGB JPEG files**<br>
|
||||
This requires the SmartScale feature, which is not supported.
|
||||
|
||||
### What About libjpeg v9?
|
||||
|
||||
libjpeg v9 introduced yet another field to the JPEG compression structure
|
||||
(`color_transform`), thus making the ABI backward incompatible with that of
|
||||
libjpeg v8. This new field was introduced solely for the purpose of supporting
|
||||
lossless SmartScale encoding. Furthermore, there was actually no reason to
|
||||
extend the API in this manner, as the color transform could have just as easily
|
||||
been activated by way of a new JPEG colorspace constant, thus preserving
|
||||
backward ABI compatibility.
|
||||
|
||||
Our research (see link above) has shown that lossless SmartScale does not
|
||||
generally accomplish anything that can't already be accomplished better with
|
||||
existing, standard lossless formats. Therefore, at this time it is our belief
|
||||
that there is not sufficient technical justification for software projects to
|
||||
upgrade from libjpeg v8 to libjpeg v9, and thus there is not sufficient
|
||||
technical justification for us to emulate the libjpeg v9 ABI.
|
||||
|
||||
In-Memory Source/Destination Managers
|
||||
-------------------------------------
|
||||
|
||||
By default, libjpeg-turbo 1.3 and later includes the `jpeg_mem_src()` and
|
||||
`jpeg_mem_dest()` functions, even when not emulating the libjpeg v8 API/ABI.
|
||||
Previously, it was necessary to build libjpeg-turbo from source with libjpeg v8
|
||||
API/ABI emulation in order to use the in-memory source/destination managers,
|
||||
but several projects requested that those functions be included when emulating
|
||||
the libjpeg v6b API/ABI as well. This allows the use of those functions by
|
||||
programs that need them, without breaking ABI compatibility for programs that
|
||||
don't, and it allows those functions to be provided in the "official"
|
||||
libjpeg-turbo binaries.
|
||||
|
||||
Note that, on most Un*x systems, the dynamic linker will not look for a
|
||||
function in a library until that function is actually used. Thus, if a program
|
||||
is built against libjpeg-turbo 1.3+ and uses `jpeg_mem_src()` or
|
||||
`jpeg_mem_dest()`, that program will not fail if run against an older version
|
||||
of libjpeg-turbo or against libjpeg v7- until the program actually tries to
|
||||
call `jpeg_mem_src()` or `jpeg_mem_dest()`. Such is not the case on Windows.
|
||||
If a program is built against the libjpeg-turbo 1.3+ DLL and uses
|
||||
`jpeg_mem_src()` or `jpeg_mem_dest()`, then it must use the libjpeg-turbo 1.3+
|
||||
DLL at run time.
|
||||
|
||||
Both cjpeg and djpeg have been extended to allow testing the in-memory
|
||||
source/destination manager functions. See their respective man pages for more
|
||||
details.
|
||||
|
||||
|
||||
Mathematical Compatibility
|
||||
==========================
|
||||
|
||||
For the most part, libjpeg-turbo should produce identical output to libjpeg
|
||||
v6b. There are two exceptions:
|
||||
|
||||
1. When decompressing a JPEG image that uses 4:4:0 chrominance subsampling, the
|
||||
outputs of libjpeg v6b and libjpeg-turbo can differ because libjpeg-turbo
|
||||
implements a "fancy" (smooth) 4:4:0 upsampling algorithm and libjpeg did not.
|
||||
|
||||
2. When using the floating point DCT/IDCT, the outputs of libjpeg v6b and
|
||||
libjpeg-turbo can differ for the following reasons:
|
||||
|
||||
- The SSE/SSE2 floating point DCT implementation in libjpeg-turbo is ever
|
||||
so slightly more accurate than the implementation in libjpeg v6b, but not
|
||||
by any amount perceptible to human vision (generally in the range of 0.01
|
||||
to 0.08 dB gain in PNSR.)
|
||||
|
||||
- When not using the SIMD extensions, libjpeg-turbo uses the more accurate
|
||||
(and slightly faster) floating point IDCT algorithm introduced in libjpeg
|
||||
v8a as opposed to the algorithm used in libjpeg v6b. It should be noted,
|
||||
however, that this algorithm basically brings the accuracy of the
|
||||
floating point IDCT in line with the accuracy of the accurate integer
|
||||
IDCT. The floating point DCT/IDCT algorithms are mainly a legacy
|
||||
feature, and they do not produce significantly more accuracy than the
|
||||
accurate integer algorithms. (To put numbers on this, the typical
|
||||
difference in PNSR between the two algorithms is less than 0.10 dB,
|
||||
whereas changing the quality level by 1 in the upper range of the quality
|
||||
scale is typically more like a 1.0 dB difference.)
|
||||
|
||||
- If the floating point algorithms in libjpeg-turbo are not implemented
|
||||
using SIMD instructions on a particular platform, then the accuracy of
|
||||
the floating point DCT/IDCT can depend on the compiler settings.
|
||||
|
||||
While libjpeg-turbo does emulate the libjpeg v8 API/ABI, under the hood it is
|
||||
still using the same algorithms as libjpeg v6b, so there are several specific
|
||||
cases in which libjpeg-turbo cannot be expected to produce the same output as
|
||||
libjpeg v8:
|
||||
|
||||
- When decompressing using scaling factors of 1/2 and 1/4, because libjpeg v8
|
||||
implements those scaling algorithms differently than libjpeg v6b does, and
|
||||
libjpeg-turbo's SIMD extensions are based on the libjpeg v6b behavior.
|
||||
|
||||
- When using chrominance subsampling, because libjpeg v8 implements this
|
||||
with its DCT/IDCT scaling algorithms rather than with a separate
|
||||
downsampling/upsampling algorithm. In our testing, the subsampled/upsampled
|
||||
output of libjpeg v8 is less accurate than that of libjpeg v6b for this
|
||||
reason.
|
||||
|
||||
- When decompressing using a scaling factor > 1 and merged (AKA "non-fancy" or
|
||||
"non-smooth") chrominance upsampling, because libjpeg v8 does not support
|
||||
merged upsampling with scaling factors > 1.
|
||||
|
||||
|
||||
Performance Pitfalls
|
||||
====================
|
||||
|
||||
Restart Markers
|
||||
---------------
|
||||
|
||||
The optimized Huffman decoder in libjpeg-turbo does not handle restart markers
|
||||
in a way that makes the rest of the libjpeg infrastructure happy, so it is
|
||||
necessary to use the slow Huffman decoder when decompressing a JPEG image that
|
||||
has restart markers. This can cause the decompression performance to drop by
|
||||
as much as 20%, but the performance will still be much greater than that of
|
||||
libjpeg. Many consumer packages, such as Photoshop, use restart markers when
|
||||
generating JPEG images, so images generated by those programs will experience
|
||||
this issue.
|
||||
|
||||
Fast Integer Forward DCT at High Quality Levels
|
||||
-----------------------------------------------
|
||||
|
||||
The algorithm used by the SIMD-accelerated quantization function cannot produce
|
||||
correct results whenever the fast integer forward DCT is used along with a JPEG
|
||||
quality of 98-100. Thus, libjpeg-turbo must use the non-SIMD quantization
|
||||
function in those cases. This causes performance to drop by as much as 40%.
|
||||
It is therefore strongly advised that you use the accurate integer forward DCT
|
||||
whenever encoding images with a JPEG quality of 98 or higher.
|
||||
|
||||
|
||||
Memory Debugger Pitfalls
|
||||
========================
|
||||
|
||||
Valgrind and Memory Sanitizer (MSan) can generate false positives
|
||||
(specifically, incorrect reports of uninitialized memory accesses) when used
|
||||
with libjpeg-turbo's SIMD extensions. It is generally recommended that the
|
||||
SIMD extensions be disabled, either by passing an argument of `-DWITH_SIMD=0`
|
||||
to `cmake` when configuring the build or by setting the environment variable
|
||||
`JSIMD_FORCENONE` to `1` at run time, when testing libjpeg-turbo with Valgrind,
|
||||
MSan, or other memory debuggers.
|
||||
258
README.ijg
@@ -1,258 +0,0 @@
|
||||
libjpeg-turbo note: This file has been modified by The libjpeg-turbo Project
|
||||
to include only information relevant to libjpeg-turbo, to wordsmith certain
|
||||
sections, and to remove impolitic language that existed in the libjpeg v8
|
||||
README. It is included only for reference. Please see README.md for
|
||||
information specific to libjpeg-turbo.
|
||||
|
||||
|
||||
The Independent JPEG Group's JPEG software
|
||||
==========================================
|
||||
|
||||
This distribution contains a release of the Independent JPEG Group's free JPEG
|
||||
software. You are welcome to redistribute this software and to use it for any
|
||||
purpose, subject to the conditions under LEGAL ISSUES, below.
|
||||
|
||||
This software is the work of Tom Lane, Guido Vollbeding, Philip Gladstone,
|
||||
Bill Allombert, Jim Boucher, Lee Crocker, Bob Friesenhahn, Ben Jackson,
|
||||
Julian Minguillon, Luis Ortiz, George Phillips, Davide Rossi, Ge' Weijers,
|
||||
and other members of the Independent JPEG Group.
|
||||
|
||||
IJG is not affiliated with the ISO/IEC JTC1/SC29/WG1 standards committee
|
||||
(also known as JPEG, together with ITU-T SG16).
|
||||
|
||||
|
||||
DOCUMENTATION ROADMAP
|
||||
=====================
|
||||
|
||||
This file contains the following sections:
|
||||
|
||||
OVERVIEW General description of JPEG and the IJG software.
|
||||
LEGAL ISSUES Copyright, lack of warranty, terms of distribution.
|
||||
REFERENCES Where to learn more about JPEG.
|
||||
ARCHIVE LOCATIONS Where to find newer versions of this software.
|
||||
FILE FORMAT WARS Software *not* to get.
|
||||
TO DO Plans for future IJG releases.
|
||||
|
||||
Other documentation files in the distribution are:
|
||||
|
||||
User documentation:
|
||||
usage.txt Usage instructions for cjpeg, djpeg, jpegtran,
|
||||
rdjpgcom, and wrjpgcom.
|
||||
*.1 Unix-style man pages for programs (same info as usage.txt).
|
||||
wizard.txt Advanced usage instructions for JPEG wizards only.
|
||||
change.log Version-to-version change highlights.
|
||||
Programmer and internal documentation:
|
||||
libjpeg.txt How to use the JPEG library in your own programs.
|
||||
example.c Sample code for calling the JPEG library.
|
||||
structure.txt Overview of the JPEG library's internal structure.
|
||||
coderules.txt Coding style rules --- please read if you contribute code.
|
||||
|
||||
Please read at least usage.txt. Some information can also be found in the JPEG
|
||||
FAQ (Frequently Asked Questions) article. See ARCHIVE LOCATIONS below to find
|
||||
out where to obtain the FAQ article.
|
||||
|
||||
If you want to understand how the JPEG code works, we suggest reading one or
|
||||
more of the REFERENCES, then looking at the documentation files (in roughly
|
||||
the order listed) before diving into the code.
|
||||
|
||||
|
||||
OVERVIEW
|
||||
========
|
||||
|
||||
This package contains C software to implement JPEG image encoding, decoding,
|
||||
and transcoding. JPEG (pronounced "jay-peg") is a standardized compression
|
||||
method for full-color and grayscale images. JPEG's strong suit is compressing
|
||||
photographic images or other types of images that have smooth color and
|
||||
brightness transitions between neighboring pixels. Images with sharp lines or
|
||||
other abrupt features may not compress well with JPEG, and a higher JPEG
|
||||
quality may have to be used to avoid visible compression artifacts with such
|
||||
images.
|
||||
|
||||
JPEG is normally lossy, meaning that the output pixels are not necessarily
|
||||
identical to the input pixels. However, on photographic content and other
|
||||
"smooth" images, very good compression ratios can be obtained with no visible
|
||||
compression artifacts, and extremely high compression ratios are possible if
|
||||
you are willing to sacrifice image quality (by reducing the "quality" setting
|
||||
in the compressor.)
|
||||
|
||||
This software implements JPEG baseline, extended-sequential, progressive, and
|
||||
lossless compression processes. Provision is made for supporting all variants
|
||||
of these processes, although some uncommon parameter settings aren't
|
||||
implemented yet. We have made no provision for supporting the hierarchical
|
||||
processes defined in the standard.
|
||||
|
||||
We provide a set of library routines for reading and writing JPEG image files,
|
||||
plus two sample applications "cjpeg" and "djpeg", which use the library to
|
||||
perform conversion between JPEG and some other popular image file formats.
|
||||
The library is intended to be reused in other applications.
|
||||
|
||||
In order to support file conversion and viewing software, we have included
|
||||
considerable functionality beyond the bare JPEG coding/decoding capability;
|
||||
for example, the color quantization modules are not strictly part of JPEG
|
||||
decoding, but they are essential for output to colormapped file formats. These
|
||||
extra functions can be compiled out of the library if not required for a
|
||||
particular application.
|
||||
|
||||
We have also included "jpegtran", a utility for lossless transcoding between
|
||||
different JPEG processes, and "rdjpgcom" and "wrjpgcom", two simple
|
||||
applications for inserting and extracting textual comments in JFIF files.
|
||||
|
||||
The emphasis in designing this software has been on achieving portability and
|
||||
flexibility, while also making it fast enough to be useful. In particular,
|
||||
the software is not intended to be read as a tutorial on JPEG. (See the
|
||||
REFERENCES section for introductory material.) Rather, it is intended to
|
||||
be reliable, portable, industrial-strength code. We do not claim to have
|
||||
achieved that goal in every aspect of the software, but we strive for it.
|
||||
|
||||
We welcome the use of this software as a component of commercial products.
|
||||
No royalty is required, but we do ask for an acknowledgement in product
|
||||
documentation, as described under LEGAL ISSUES.
|
||||
|
||||
|
||||
LEGAL ISSUES
|
||||
============
|
||||
|
||||
In plain English:
|
||||
|
||||
1. We don't promise that this software works. (But if you find any bugs,
|
||||
please let us know!)
|
||||
2. You can use this software for whatever you want. You don't have to pay us.
|
||||
3. You may not pretend that you wrote this software. If you use it in a
|
||||
program, you must acknowledge somewhere in your documentation that
|
||||
you've used the IJG code.
|
||||
|
||||
In legalese:
|
||||
|
||||
The authors make NO WARRANTY or representation, either express or implied,
|
||||
with respect to this software, its quality, accuracy, merchantability, or
|
||||
fitness for a particular purpose. This software is provided "AS IS", and you,
|
||||
its user, assume the entire risk as to its quality and accuracy.
|
||||
|
||||
This software is copyright (C) 1991-2020, Thomas G. Lane, Guido Vollbeding.
|
||||
All Rights Reserved except as specified below.
|
||||
|
||||
Permission is hereby granted to use, copy, modify, and distribute this
|
||||
software (or portions thereof) for any purpose, without fee, subject to these
|
||||
conditions:
|
||||
(1) If any part of the source code for this software is distributed, then this
|
||||
README file must be included, with this copyright and no-warranty notice
|
||||
unaltered; and any additions, deletions, or changes to the original files
|
||||
must be clearly indicated in accompanying documentation.
|
||||
(2) If only executable code is distributed, then the accompanying
|
||||
documentation must state that "this software is based in part on the work of
|
||||
the Independent JPEG Group".
|
||||
(3) Permission for use of this software is granted only if the user accepts
|
||||
full responsibility for any undesirable consequences; the authors accept
|
||||
NO LIABILITY for damages of any kind.
|
||||
|
||||
These conditions apply to any software derived from or based on the IJG code,
|
||||
not just to the unmodified library. If you use our work, you ought to
|
||||
acknowledge us.
|
||||
|
||||
Permission is NOT granted for the use of any IJG author's name or company name
|
||||
in advertising or publicity relating to this software or products derived from
|
||||
it. This software may be referred to only as "the Independent JPEG Group's
|
||||
software".
|
||||
|
||||
We specifically permit and encourage the use of this software as the basis of
|
||||
commercial products, provided that all warranty or liability claims are
|
||||
assumed by the product vendor.
|
||||
|
||||
|
||||
REFERENCES
|
||||
==========
|
||||
|
||||
We recommend reading one or more of these references before trying to
|
||||
understand the innards of the JPEG software.
|
||||
|
||||
The best short technical introduction to the JPEG compression algorithm is
|
||||
Wallace, Gregory K. "The JPEG Still Picture Compression Standard",
|
||||
Communications of the ACM, April 1991 (vol. 34 no. 4), pp. 30-44.
|
||||
(Adjacent articles in that issue discuss MPEG motion picture compression,
|
||||
applications of JPEG, and related topics.) If you don't have the CACM issue
|
||||
handy, a PDF file containing a revised version of Wallace's article is
|
||||
available at http://www.ijg.org/files/Wallace.JPEG.pdf. The file (actually
|
||||
a preprint for an article that appeared in IEEE Trans. Consumer Electronics)
|
||||
omits the sample images that appeared in CACM, but it includes corrections
|
||||
and some added material. Note: the Wallace article is copyright ACM and IEEE,
|
||||
and it may not be used for commercial purposes.
|
||||
|
||||
A somewhat less technical, more leisurely introduction to JPEG can be found in
|
||||
"The Data Compression Book" by Mark Nelson and Jean-loup Gailly, published by
|
||||
M&T Books (New York), 2nd ed. 1996, ISBN 1-55851-434-1. This book provides
|
||||
good explanations and example C code for a multitude of compression methods
|
||||
including JPEG. It is an excellent source if you are comfortable reading C
|
||||
code but don't know much about data compression in general. The book's JPEG
|
||||
sample code is far from industrial-strength, but when you are ready to look
|
||||
at a full implementation, you've got one here...
|
||||
|
||||
The best currently available description of JPEG is the textbook "JPEG Still
|
||||
Image Data Compression Standard" by William B. Pennebaker and Joan L.
|
||||
Mitchell, published by Van Nostrand Reinhold, 1993, ISBN 0-442-01272-1.
|
||||
Price US$59.95, 638 pp. The book includes the complete text of the ISO JPEG
|
||||
standards (DIS 10918-1 and draft DIS 10918-2).
|
||||
|
||||
The original JPEG standard is divided into two parts, Part 1 being the actual
|
||||
specification, while Part 2 covers compliance testing methods. Part 1 is
|
||||
titled "Digital Compression and Coding of Continuous-tone Still Images,
|
||||
Part 1: Requirements and guidelines" and has document numbers ISO/IEC IS
|
||||
10918-1, ITU-T T.81. Part 2 is titled "Digital Compression and Coding of
|
||||
Continuous-tone Still Images, Part 2: Compliance testing" and has document
|
||||
numbers ISO/IEC IS 10918-2, ITU-T T.83.
|
||||
|
||||
The JPEG standard does not specify all details of an interchangeable file
|
||||
format. For the omitted details, we follow the "JFIF" conventions, revision
|
||||
1.02. JFIF version 1 has been adopted as ISO/IEC 10918-5 (05/2013) and
|
||||
Recommendation ITU-T T.871 (05/2011): Information technology - Digital
|
||||
compression and coding of continuous-tone still images: JPEG File Interchange
|
||||
Format (JFIF). It is available as a free download in PDF file format from
|
||||
https://www.iso.org/standard/54989.html and http://www.itu.int/rec/T-REC-T.871.
|
||||
A PDF file of the older JFIF 1.02 specification is available at
|
||||
http://www.w3.org/Graphics/JPEG/jfif3.pdf.
|
||||
|
||||
The TIFF 6.0 file format specification can be obtained from
|
||||
http://mirrors.ctan.org/graphics/tiff/TIFF6.ps.gz. The JPEG incorporation
|
||||
scheme found in the TIFF 6.0 spec of 3-June-92 has a number of serious
|
||||
problems. IJG does not recommend use of the TIFF 6.0 design (TIFF Compression
|
||||
tag 6). Instead, we recommend the JPEG design proposed by TIFF Technical Note
|
||||
#2 (Compression tag 7). Copies of this Note can be obtained from
|
||||
http://www.ijg.org/files/. It is expected that the next revision
|
||||
of the TIFF spec will replace the 6.0 JPEG design with the Note's design.
|
||||
Although IJG's own code does not support TIFF/JPEG, the free libtiff library
|
||||
uses our library to implement TIFF/JPEG per the Note.
|
||||
|
||||
|
||||
ARCHIVE LOCATIONS
|
||||
=================
|
||||
|
||||
The "official" archive site for this software is www.ijg.org.
|
||||
The most recent released version can always be found there in
|
||||
directory "files".
|
||||
|
||||
The JPEG FAQ (Frequently Asked Questions) article is a source of some
|
||||
general information about JPEG. It is available at
|
||||
http://www.faqs.org/faqs/jpeg-faq.
|
||||
|
||||
|
||||
FILE FORMAT COMPATIBILITY
|
||||
=========================
|
||||
|
||||
This software implements ITU T.81 | ISO/IEC 10918 with some extensions from
|
||||
ITU T.871 | ISO/IEC 10918-5 (JPEG File Interchange Format-- see REFERENCES).
|
||||
Informally, the term "JPEG image" or "JPEG file" most often refers to JFIF or
|
||||
a subset thereof, but there are other formats containing the name "JPEG" that
|
||||
are incompatible with the original JPEG standard or with JFIF (for instance,
|
||||
JPEG 2000 and JPEG XR). This software therefore does not support these
|
||||
formats. Indeed, one of the original reasons for developing this free software
|
||||
was to help force convergence on a common, interoperable format standard for
|
||||
JPEG files.
|
||||
|
||||
JFIF is a minimal or "low end" representation. TIFF/JPEG (TIFF revision 6.0 as
|
||||
modified by TIFF Technical Note #2) can be used for "high end" applications
|
||||
that need to record a lot of additional data about an image.
|
||||
|
||||
|
||||
TO DO
|
||||
=====
|
||||
|
||||
Please send bug reports, offers of help, etc. to jpeg-info@jpegclub.org.
|
||||
29
README.md
@@ -1,29 +0,0 @@
|
||||
Mozilla JPEG Encoder Project [](https://ci.appveyor.com/project/kornel/mozjpeg-4ekrx)
|
||||
============================
|
||||
|
||||
MozJPEG improves JPEG compression efficiency achieving higher visual quality and smaller file sizes at the same time. It is compatible with the JPEG standard, and the vast majority of the world's deployed JPEG decoders.
|
||||
|
||||
MozJPEG is a patch for [libjpeg-turbo](https://github.com/libjpeg-turbo/libjpeg-turbo). **Please send pull requests to libjpeg-turbo** if the changes aren't specific to newly-added MozJPEG-only compression code. This project aims to keep differences with libjpeg-turbo minimal, so whenever possible, improvements and bug fixes should go there first.
|
||||
|
||||
MozJPEG is compatible with the libjpeg API and ABI. It is intended to be a drop-in replacement for libjpeg. MozJPEG is a strict superset of libjpeg-turbo's functionality. All MozJPEG's improvements can be disabled at run time, and in that case it behaves exactly like libjpeg-turbo.
|
||||
|
||||
MozJPEG is meant to be used as a library in graphics programs and image processing tools. We include a demo `cjpeg` command-line tool, but it's not intended for serious use. We encourage authors of graphics programs to use libjpeg's [C API](libjpeg.txt) and link with MozJPEG library instead.
|
||||
|
||||
## Features
|
||||
|
||||
* Progressive encoding with "jpegrescan" optimization. It can be applied to any JPEG file (with `jpegtran`) to losslessly reduce file size.
|
||||
* Trellis quantization. When converting other formats to JPEG it maximizes quality/filesize ratio.
|
||||
* Comes with new quantization table presets, e.g. tuned for high-resolution displays.
|
||||
* Fully compatible with all web browsers.
|
||||
* Can be seamlessly integrated into any program that uses the industry-standard libjpeg API. There's no need to write any MozJPEG-specific integration code.
|
||||
|
||||
## Releases
|
||||
|
||||
* [Latest release](https://github.com/mozilla/mozjpeg/releases/latest)
|
||||
* [Overview of 3.0 features](https://calendar.perfplanet.com/2014/mozjpeg-3-0/)
|
||||
* [Version 2.0 Announcement](https://blog.mozilla.org/research/2014/07/15/mozilla-advances-jpeg-encoding-with-mozjpeg-2-0/)
|
||||
* [Version 1.0 Announcement](https://blog.mozilla.org/research/2014/03/05/introducing-the-mozjpeg-project/)
|
||||
|
||||
## Compiling
|
||||
|
||||
See [BUILDING](BUILDING.md). MozJPEG is built exactly the same way as libjpeg-turbo, so if you need additional help please consult [libjpeg-turbo documentation](https://libjpeg-turbo.org/).
|
||||
550
SETUP
Normal file
@@ -0,0 +1,550 @@
|
||||
SETUP instructions for the Independent JPEG Group's JPEG software
|
||||
=================================================================
|
||||
|
||||
This file explains how to configure and compile the JPEG software. We have
|
||||
tried to make this software extremely portable and flexible, so that it can be
|
||||
adapted to almost any environment. The downside of this decision is that the
|
||||
installation process is not very automatic; you will need at least a little
|
||||
familiarity with C programming and program build procedures for your system.
|
||||
|
||||
This file contains general instructions, then sections of specific hints for
|
||||
certain systems. You may save yourself considerable time if you scan the
|
||||
whole file before starting to do anything.
|
||||
|
||||
Before installing the software you must unpack the distributed source code.
|
||||
Since you are reading this file, you have probably already succeeded in this
|
||||
task. However, there is one potential trap if you are on a non-Unix system:
|
||||
you may need to convert these files to the local standard text file format
|
||||
(for example, if you are on MS-DOS you probably have to convert LF end-of-line
|
||||
to CR/LF). If so, apply the conversion to all the files EXCEPT those whose
|
||||
names begin with "test". The test files contain binary data; if you change
|
||||
them in any way then the self-test will give bad results.
|
||||
|
||||
|
||||
STEP 1: PREPARE A MAKEFILE
|
||||
==========================
|
||||
|
||||
First, select a makefile and copy it to "Makefile" (or whatever your version
|
||||
of make uses as the default makefile name; for example, "makefile.mak" for
|
||||
old versions of Borland C). We include several standard makefiles in the
|
||||
distribution:
|
||||
|
||||
makefile.ansi: for Unix systems with ANSI-compatible C compilers.
|
||||
makefile.unix: for Unix systems with non-ANSI C compilers.
|
||||
makefile.mc5: for Microsoft C 5.x under MS-DOS.
|
||||
makefile.mc6: for Microsoft C 6.x and up under MS-DOS.
|
||||
makefile.bcc: for Borland C (Turbo C) under MS-DOS.
|
||||
makefile.icc: for Intel's Code Builder C under MS-DOS.
|
||||
makefile.manx: for Manx Aztec C on Amigas.
|
||||
makefile.sas: for SAS C on Amigas.
|
||||
makcjpeg.st: project file for Atari ST/STE/TT Pure C or Turbo C.
|
||||
makdjpeg.st: project file for Atari ST/STE/TT Pure C or Turbo C.
|
||||
makljpeg.st: project file for Atari ST/STE/TT Pure C or Turbo C.
|
||||
makefile.mms: for VAX/VMS systems with MMS.
|
||||
makefile.vms: for VAX/VMS systems without MMS.
|
||||
|
||||
If you don't see a makefile for your system, we recommend starting from either
|
||||
makefile.ansi or makefile.unix, depending on whether your compiler accepts
|
||||
ANSI C or not. Actually you should start with makefile.ansi whenever your
|
||||
compiler supports ANSI-style function definitions; you don't need full ANSI
|
||||
compatibility. The difference between the two makefiles is that makefile.unix
|
||||
preprocesses the source code to convert function definitions to old-style C.
|
||||
(Our thanks to Peter Deutsch of Aladdin Enterprises for the ansi2knr program.)
|
||||
|
||||
If you don't know whether your compiler supports ANSI-style function
|
||||
definitions, then take a look at ckconfig.c. It is a test program that will
|
||||
help you figure out this fact, as well as some other facts you'll need in
|
||||
later steps. You must compile and execute ckconfig.c by hand; the makefiles
|
||||
don't provide any support for this. ckconfig.c may not compile the first try
|
||||
(in fact, the whole idea is for it to fail if anything is going to). If you
|
||||
get compile errors, fix them by editing ckconfig.c according to the directions
|
||||
given in ckconfig.c. Once you get it to run, select a makefile according to
|
||||
the advice it prints out, and make any other changes it recommends.
|
||||
|
||||
Look over the selected Makefile and adjust options as needed. In particular
|
||||
you may want to change the CC and CFLAGS definitions. For instance, if you
|
||||
are using GCC, set CC=gcc. If you had to use any compiler switches to get
|
||||
ckconfig.c to work, make sure the same switches are in CFLAGS.
|
||||
|
||||
If you are on a system that doesn't use makefiles, you'll need to set up
|
||||
project files (or whatever you do use) to compile all the source files and
|
||||
link them into executable files cjpeg and djpeg. See the file lists in any of
|
||||
the makefiles to find out which files go into each program. As a last resort,
|
||||
you can make a batch script that just compiles everything and links it all
|
||||
together; makefile.vms is an example of this (it's for VMS systems that have
|
||||
no make-like utility).
|
||||
|
||||
|
||||
STEP 2: EDIT JCONFIG.H
|
||||
======================
|
||||
|
||||
Look over jconfig.h and adjust #defines to reflect the properties of your
|
||||
system and C compiler. If you prefer, you can usually leave jconfig.h
|
||||
unmodified and add -Dsymbol switches to the Makefile's CFLAGS definition.
|
||||
(This is already done if you used a compiler-specific makefile in step 1.)
|
||||
However, putting the switches in the Makefile is a bad idea if you are going
|
||||
to incorporate the JPEG software into other programs --- you'd need to include
|
||||
the same -D switches in the other programs' Makefiles. Better to change
|
||||
jconfig.h.
|
||||
|
||||
If you have an ANSI-compliant C compiler, no changes should be necessary
|
||||
except perhaps for RIGHT_SHIFT_IS_UNSIGNED and TWO_FILE_COMMANDLINE. For
|
||||
older compilers other changes may be needed, depending on what ANSI features
|
||||
are supported.
|
||||
|
||||
If you don't know enough about C programming to understand the questions in
|
||||
jconfig.h, then use ckconfig.c to figure out what to change. (See description
|
||||
of ckconfig.c in step 1.)
|
||||
|
||||
A note about TWO_FILE_COMMANDLINE: defining this selects the command line
|
||||
syntax in which the input and output files are both named on the command line.
|
||||
If it's not defined, the output image goes to standard output, and the input
|
||||
can optionally come from standard input. You MUST use two-file style on any
|
||||
system that doesn't cope well with binary data fed through stdin/stdout; this
|
||||
is true for most MS-DOS compilers, for example. If you're not on a Unix
|
||||
system, it's probably safest to assume you need two-file style. (But if your
|
||||
compiler provides either the Posix-standard fdopen() library routine or a
|
||||
Microsoft-compatible setmode() routine, you can use the Unix command line
|
||||
style, by defining USE_FDOPEN or USE_SETMODE respectively.)
|
||||
|
||||
|
||||
STEP 3: SELECT SYSTEM-DEPENDENT FILES
|
||||
=====================================
|
||||
|
||||
A few places in the JPEG software are so system-dependent that we have to
|
||||
provide several different implementations and let you select the one you need.
|
||||
|
||||
The only system-dependent file in the current version is jmemsys.c. This file
|
||||
controls use of temporary files for big images that won't fit in main memory.
|
||||
You'll notice there is no file named jmemsys.c in the distribution; you must
|
||||
select one of the provided versions and copy, rename, or link it to jmemsys.c.
|
||||
Here are the provided versions:
|
||||
|
||||
jmemansi.c This is a reasonably portable version that should
|
||||
work on most ANSI and near-ANSI C compilers. It uses
|
||||
the ANSI-standard library routine tmpfile(), which not
|
||||
all non-ANSI systems have. On some systems tmpfile()
|
||||
may put the temporary file in a non-optimal location;
|
||||
if you don't like what it does, use jmemname.c.
|
||||
|
||||
jmemname.c This version constructs the temp file name by itself.
|
||||
For anything except a Unix machine, you'll need to
|
||||
configure the select_file_name() routine appropriately;
|
||||
see the comments near the head of jmemname.c.
|
||||
If you use this version, define NEED_SIGNAL_CATCHER
|
||||
in jconfig.h or in the Makefile to make sure the temp
|
||||
files are removed if the program is aborted.
|
||||
|
||||
jmemnobs.c (That stands for No Backing Store :-). This will
|
||||
compile on almost any system, but it assumes you
|
||||
have enough main memory or virtual memory to hold
|
||||
the biggest images you need to work with.
|
||||
|
||||
jmemdos.c This should be used in most MS-DOS installations; see
|
||||
the system-specific notes about MS-DOS for more info.
|
||||
IMPORTANT: if you use this, also copy jmemdos.h to
|
||||
jmemsys.h, replacing the standard version. ALSO,
|
||||
include the assembly file jmemdosa.asm in the programs.
|
||||
(This last is already done if you used one of the
|
||||
supplied MS-DOS-specific makefiles.)
|
||||
|
||||
If you have plenty of (real or virtual) main memory, just use jmemnobs.c.
|
||||
"Plenty" means at least ten bytes for every pixel in the largest images
|
||||
you plan to process, so a lot of systems don't meet this criterion.
|
||||
If yours doesn't, try jmemansi.c first. If that doesn't compile, you'll have
|
||||
to use jmemname.c; be sure to adjust select_file_name() for local conditions.
|
||||
You may also need to change unlink() to remove() in close_backing_store().
|
||||
|
||||
Except with jmemnobs.c, you need to adjust the #define DEFAULT_MAX_MEM to a
|
||||
reasonable value for your system (either by editing jmemsys.c, or by adding
|
||||
a -D switch to the Makefile). This value limits the amount of data space the
|
||||
program will attempt to allocate. Code and static data space isn't counted,
|
||||
so the actual memory needs for cjpeg or djpeg are typically 100 to 150Kb more
|
||||
than the max-memory setting. Larger max-memory settings reduce the amount of
|
||||
I/O needed to process a large image, but too large a value can result in
|
||||
"insufficient memory" failures. On most Unix machines (and other systems with
|
||||
virtual memory), just set DEFAULT_MAX_MEM to several million and forget it.
|
||||
At the other end of the spectrum, for MS-DOS machines you probably can't go
|
||||
much above 300K to 400K. (On MS-DOS the value refers to conventional memory;
|
||||
extended/expanded memory is handled separately by jmemdos.c.)
|
||||
|
||||
|
||||
STEP 4: MAKE
|
||||
============
|
||||
|
||||
Now you should be able to "make" the software.
|
||||
|
||||
If you have trouble with missing system include files or inclusion of the
|
||||
wrong ones, look at jinclude.h (or use ckconfig.c, if you are not a C expert).
|
||||
|
||||
If your compiler complains about big_sarray_control and big_barray_control
|
||||
being undefined structures, you should be able to shut it up by adding
|
||||
-DINCOMPLETE_TYPES_BROKEN to CFLAGS (or add #define INCOMPLETE_TYPES_BROKEN
|
||||
to jconfig.h). If you don't have a getenv() library routine, define NO_GETENV.
|
||||
|
||||
There are a fair number of routines that do not use all of their parameters;
|
||||
some compilers will issue warnings about this, which you can ignore. Any
|
||||
other warning deserves investigation.
|
||||
|
||||
|
||||
STEP 5: TEST
|
||||
============
|
||||
|
||||
As a quick test of functionality we've included a small sample image in
|
||||
several forms:
|
||||
testorig.jpg A reduced section of the well-known Lenna picture.
|
||||
testimg.ppm The output of djpeg testorig.jpg
|
||||
testimg.gif The output of djpeg -gif testorig.jpg
|
||||
testimg.jpg The output of cjpeg testimg.ppm
|
||||
(The two .jpg files aren't identical since JPEG is lossy.) If you can
|
||||
generate duplicates of the testimg.* files then you probably have working
|
||||
programs.
|
||||
|
||||
With most of the makefiles, "make test" will perform the necessary
|
||||
comparisons. If you started with makefile.ansi or makefile.unix, and you
|
||||
defined TWO_FILE_COMMANDLINE, then change the makefile's test script to use
|
||||
two-file syntax (i.e., delete the ">" character from the invocations of cjpeg
|
||||
and djpeg). The other makefiles will work with either command-line syntax.
|
||||
|
||||
If you're using a makefile that doesn't provide the test option, run djpeg and
|
||||
cjpeg by hand to generate testout.ppm, testout.gif, and testout.jpg, then
|
||||
compare these to testimg.* with whatever binary file comparison tool you have.
|
||||
The files should be bit-for-bit identical.
|
||||
|
||||
If the cjpeg test run fails with "Missing Huffman code table entry", it's a
|
||||
good bet that you needed to define RIGHT_SHIFT_IS_UNSIGNED. Go back to step 2
|
||||
and run ckconfig.c. (This is a good plan for any other test failure, too.)
|
||||
|
||||
If you are using Unix (one-file) command line style on a non-Unix system,
|
||||
it's a good idea to check that binary I/O through stdin/stdout actually works.
|
||||
You should get the same results from "djpeg <testorig.jpg >out.ppm" as from
|
||||
"djpeg -outfile out.ppm testorig.jpg". Note that the non-Unix makefiles use
|
||||
the latter style and therefore do not exercise stdin/stdout. If this test
|
||||
fails, try recompiling jcmain.c & jdmain.c with USE_SETMODE and/or USE_FDOPEN.
|
||||
|
||||
If your choice of jmemsys.c was anything other than jmemnobs.c, you should
|
||||
test that temporary-file usage works. Try "djpeg -gif -max 0 testorig.jpg"
|
||||
and make sure its output matches testimg.gif. If you have any really large
|
||||
images handy, try compressing them with -optimize and/or decompressing with
|
||||
-gif to make sure your DEFAULT_MAX_MEM setting is not too large.
|
||||
|
||||
NOTE: this is far from an exhaustive test of the JPEG software; some modules,
|
||||
such as 1-pass color quantization, are not exercised at all. It's just a quick
|
||||
test to give you some confidence that you haven't missed something major.
|
||||
|
||||
|
||||
STEP 6: INSTALLATION
|
||||
====================
|
||||
|
||||
Once you're done with the above steps, you can install the software by copying
|
||||
the executable files (cjpeg and djpeg) to wherever you normally install
|
||||
programs. On Unix systems, you'll also want to put cjpeg.1 and djpeg.1 in the
|
||||
corresponding manual directory. (The makefiles don't support this step since
|
||||
there's such a wide variety of installation procedures on different systems.)
|
||||
|
||||
To learn to use the programs, read the file USAGE (or manual pages cjpeg(1)
|
||||
and djpeg(1) on Unix). Note that the man pages cjpeg.1/djpeg.1 only describe
|
||||
the Unix-style command line syntax; if you want to use these files with a
|
||||
version that uses two-file command line syntax, you'll have to modify the text
|
||||
accordingly. The USAGE file describes both styles.
|
||||
|
||||
|
||||
OPTIMIZATION
|
||||
============
|
||||
|
||||
Unless you own a Cray, you'll probably be interested in making the JPEG
|
||||
software go as fast as possible. This section covers some machine-dependent
|
||||
optimizations you may want to try. We suggest that before trying any of this,
|
||||
you first get the basic installation to pass the self-test (step 5 above).
|
||||
Repeat the self-test after any optimization to make sure that you haven't
|
||||
broken anything.
|
||||
|
||||
The JPEG DCT routines perform a lot of multiplications. These multiplications
|
||||
must yield 32-bit results, but none of their input values are more than 16
|
||||
bits wide. On many machines, notably the 680x0 and 80x86 CPUs, a 16x16=>32
|
||||
bit multiply instruction is faster than a full 32x32=>32 bit multiply.
|
||||
Unfortunately there is no portable way to specify such a multiplication in C,
|
||||
but some compilers can generate one when you use the right combination of
|
||||
casts. See the MULTIPLY macro definitions in jfwddct.c and jrevdct.c.
|
||||
If your compiler makes "int" be 32 bits and "short" be 16 bits, defining
|
||||
SHORTxSHORT_32 is fairly likely to work. When experimenting with alternate
|
||||
definitions, be sure to test not only whether the code still works (use the
|
||||
self-test step), but also whether it is actually faster --- on some compilers,
|
||||
alternate definitions may compute the right answer, yet be slower than the
|
||||
default. Timing cjpeg on a large PPM input file is the best way to check
|
||||
this, as the DCT will be the largest fraction of the runtime in that mode.
|
||||
(Note: some of the distributed compiler-specific makefiles already contain
|
||||
-D switches to select an appropriate MULTIPLY definition.)
|
||||
|
||||
If access to "short" arrays is slow on your machine, it may be a win to define
|
||||
type DCTELEM as int rather than as JCOEF (which is normally defined as short).
|
||||
This will cause the DCT routines to operate on int arrays instead of short
|
||||
arrays. If shorts are slow and you have lots of memory to burn, you might
|
||||
even make JCOEF itself be int.
|
||||
|
||||
If your compiler can compile function calls in-line, make sure the INLINE
|
||||
macro in jconfig.h is defined as the keyword that marks a function
|
||||
inline-able. Some compilers have a switch that tells the compiler to inline
|
||||
any function it thinks is profitable (e.g., -finline-functions for gcc).
|
||||
Enabling such a switch is likely to make the compiled code bigger but faster.
|
||||
|
||||
In general, it's worth trying the maximum optimization level of your compiler,
|
||||
and experimenting with any optional optimizations such as loop unrolling.
|
||||
(Unfortunately, far too many compilers have optimizer bugs ... be prepared to
|
||||
back off if the code fails self-test.) If you do any experimentation along
|
||||
these lines, please report the optimal settings to jpeg-info@uunet.uu.net so
|
||||
we can mention them in future releases. Be sure to specify your machine and
|
||||
compiler version.
|
||||
|
||||
|
||||
OPTIONAL STUFF
|
||||
==============
|
||||
|
||||
Progress monitor:
|
||||
|
||||
If you like, you can #define PROGRESS_REPORT (in jconfig.h or in the Makefile)
|
||||
to enable display of percent-done progress reports. The routines provided in
|
||||
jcmain.c/jdmain.c merely print percentages to stderr, but you can customize
|
||||
them to do something fancier.
|
||||
|
||||
Utah RLE file format support:
|
||||
|
||||
We distribute the software with support for RLE image files (Utah Raster
|
||||
Toolkit format) disabled, because the RLE support won't compile without the
|
||||
Utah library. If you have URT version 3.0, you can enable RLE support as
|
||||
follows:
|
||||
1. #define RLE_SUPPORTED in jconfig.h or in the Makefile.
|
||||
2. Add a -I option to CFLAGS in the Makefile for the directory
|
||||
containing the URT .h files (typically the "include"
|
||||
subdirectory of the URT distribution).
|
||||
3. Add -L... -lrle to LDLIBS in the Makefile, where ... specifies
|
||||
the directory containing the URT "librle.a" file (typically the
|
||||
"lib" subdirectory of the URT distribution).
|
||||
|
||||
JPEG library:
|
||||
|
||||
If you want to incorporate the JPEG code as subroutines in a larger program,
|
||||
we recommend that you make libjpeg.a, then link that into your surrounding
|
||||
program. See file README for more info.
|
||||
|
||||
CAUTION: When you use the JPEG code as subroutines, we recommend that you make
|
||||
any required configuration changes by modifying jconfig.h, not by adding -D
|
||||
switches to the Makefile. Otherwise you must be sure to provide the same -D
|
||||
switches when compiling any program that includes the JPEG .h files, to ensure
|
||||
that the parameter structures are interpreted the same way. (This is only
|
||||
critical for the first few symbols mentioned in jconfig.h, down through
|
||||
NEED_FAR_POINTERS.)
|
||||
|
||||
Removing code:
|
||||
|
||||
If you need to make a smaller version of the JPEG software, some optional
|
||||
functions can be removed at compile time. See the xxx_SUPPORTED #defines in
|
||||
jconfig.h. If at all possible, we recommend that you leave in decoder support
|
||||
for all valid JPEG files, to ensure that you can read anyone's output.
|
||||
Restricting your encoder, or removing optional functions like block smoothing,
|
||||
won't hurt compatibility. Taking out support for image file formats that you
|
||||
don't use is the most painless way to make the programs smaller.
|
||||
|
||||
|
||||
NOTES FOR SPECIFIC SYSTEMS
|
||||
==========================
|
||||
|
||||
We welcome reports on changes needed for systems not mentioned here.
|
||||
Submit 'em to jpeg-info@uunet.uu.net. Also, if ckconfig.c is wrong about
|
||||
how to configure the JPEG software for your system, please let us know.
|
||||
|
||||
|
||||
Amiga:
|
||||
|
||||
Makefiles are provided for Manx Aztec C and SAS C. I have also heard from
|
||||
people who have compiled with the free DICE compiler, using makefile.ansi as a
|
||||
starting point (set "CC= dcc" and "CFLAGS= -c -DAMIGA -DTWO_FILE_COMMANDLINE
|
||||
-DNEED_SIGNAL_CATCHER" in the makefile). For all compilers, we recommend you
|
||||
use jmemname.c as the system-dependent memory manager. Assuming you have
|
||||
-DAMIGA in the makefile, jmemname.c will put temporary files in JPEGTMP:.
|
||||
Change jmemname.c if you don't like this.
|
||||
|
||||
|
||||
Atari:
|
||||
|
||||
The project files provided should work as-is with Pure C. For Turbo C, change
|
||||
library filenames "PC..." to "TC..." in the project files for cjpeg.ttp and
|
||||
djpeg.ttp. Don't forget to select a jmemsys.c file, see Step 3 (we recommend
|
||||
jmemansi.c). Also adjust the DEFAULT_MAX_MEM setting --- you probably want it
|
||||
to be a couple hundred K less than your normal free memory. Note that you
|
||||
must make jpeg.lib before making cjpeg.ttp or cjpeg.ttp. You'll have to
|
||||
perform the self-test (Step 5) by hand.
|
||||
|
||||
There is a bug in some older versions of the Turbo C library which causes the
|
||||
space used by temporary files created with "tmpfile()" not to be freed after
|
||||
an abnormal program exit. If you check your disk afterwards, you will find
|
||||
cluster chains that are allocated but not used by a file. This should not
|
||||
happen in cjpeg or djpeg, since we enable a signal catcher to explicitly close
|
||||
temp files before exiting. But if you use the JPEG library with your own
|
||||
code, be sure to supply a signal catcher, or else use a different
|
||||
system-dependent memory manager.
|
||||
|
||||
|
||||
Cray:
|
||||
|
||||
Should you be so fortunate as to be running JPEG on a Cray YMP, there is a
|
||||
compiler bug in Cray's Standard C versions prior to 3.1. You'll need to
|
||||
insert a line reading "#pragma novector" just before the loop
|
||||
for (i = 1; i <= (int) htbl->bits[l]; i++)
|
||||
huffsize[p++] = (char) l;
|
||||
in fix_huff_tbl (in V4A, line 42 of jchuff.c and line 39 of jdhuff.c). The
|
||||
usual symptom of not adding this line is a core-dump. See Cray's SPR 48222.
|
||||
|
||||
|
||||
HP/Apollo DOMAIN:
|
||||
|
||||
With system release 10.4 or later, makefile.ansi should work OK. If you have
|
||||
version 10.3.anything, you need to figure out whether you have the ANSI C
|
||||
compiler (version 6.7 or later) and whether you've installed the ANSI C
|
||||
include files (if so, the first line of <stdio.h> will mention ANSI C).
|
||||
If you have the ANSI C compiler but not the ANSI C include files, use
|
||||
makefile.ansi and add -DNONANSI_INCLUDES to CFLAGS. If you have both,
|
||||
then makefile.ansi should work as is. If neither, use makefile.unix.
|
||||
|
||||
|
||||
HP-UX:
|
||||
|
||||
If you have HP-UX 7.05 or later with the "software development" C compiler,
|
||||
then you can use makefile.ansi. Add "-Aa" to the CFLAGS line in the makefile
|
||||
to make the compiler work in ANSI mode. If you have a pre-7.05 system, or if
|
||||
you are using the non-ANSI C compiler delivered with a minimum HP-UX 8.0
|
||||
system, then you must use makefile.unix (and do NOT add -Aa). Also, adding
|
||||
"-lmalloc" to LDLIBS is recommended if you have libmalloc.a (it seems not to
|
||||
be present in minimum 8.0).
|
||||
|
||||
On HP 9000 series 800 machines, the HP C compiler is buggy in revisions prior
|
||||
to A.08.07. If you get complaints about "not a typedef name", you'll have to
|
||||
convert the code to K&R style (i.e., use makefile.unix).
|
||||
|
||||
|
||||
Macintosh MPW:
|
||||
|
||||
We don't directly support MPW in the current release, but Larry Rosenstein
|
||||
reports that the JPEG code can be ported without very much trouble. There's
|
||||
useful notes and conversion scripts in his kit for porting PBMPLUS to MPW.
|
||||
You can obtain the kit by FTP to ftp.apple.com, file /pub/lsr/pbmplus-port*.
|
||||
|
||||
|
||||
Macintosh Think C:
|
||||
|
||||
You'll have to prepare project files for cjpeg and djpeg; we don't include
|
||||
those in the distribution since they are not text files. The COBJECTS and
|
||||
DOBJECTS lists in makefile.unix show which files should be included in each
|
||||
project. Also add the ANSI and Unix C libraries in a separate segment. You
|
||||
may need to divide the JPEG files into more than one segment; you can do this
|
||||
pretty much as you please.
|
||||
|
||||
If you have Think C version 5.0 you need not modify jconfig.h; instead you
|
||||
should turn on both the ANSI Settings and Language Extensions option buttons
|
||||
(so that both __STDC__ and THINK_C are predefined). With version 4.0 you must
|
||||
edit jconfig.h. (You can #define HAVE_STDC to do the right thing for all
|
||||
options except const; you must also #define const.)
|
||||
|
||||
jcmain and jdmain are set up to provide the usual command-line interface
|
||||
by means of Think's ccommand() library routine. A more Mac-like interface
|
||||
is in the works.
|
||||
|
||||
|
||||
MS-DOS, generic comments:
|
||||
|
||||
The JPEG code is designed to be compiled with 80x86 "small" or "medium" memory
|
||||
models (i.e., data pointers are 16 bits unless explicitly declared "far"; code
|
||||
pointers can be either size). You should be able to use small model to
|
||||
compile cjpeg or djpeg by itself, but you will probably have to go to medium
|
||||
model if you include the JPEG code in a larger application. This shouldn't
|
||||
hurt performance much. You *will* take a noticeable performance hit if you
|
||||
compile in a large-data memory model, and you should avoid "huge" model if at
|
||||
all possible. Be sure that NEED_FAR_POINTERS is defined by jconfig.h or by
|
||||
the Makefile if you use a small-data model; be sure it is NOT defined if you
|
||||
use a large-data memory model. (As distributed, jconfig.h defines
|
||||
NEED_FAR_POINTERS if MSDOS is defined.)
|
||||
|
||||
The DOS-specific memory manager, jmemdos.c, should be used if possible.
|
||||
(Be sure to install jmemdos.h and jmemdosa.asm along with it.) If you
|
||||
can't use jmemdos.c for some reason --- for example, because you don't have
|
||||
a Microsoft-compatible assembler to assemble jmemdosa.asm --- you'll have
|
||||
to fall back to jmemansi.c or jmemname.c. IMPORTANT: if you use either of
|
||||
the latter two files, you will have to compile in a large-data memory model
|
||||
in order to get the right stdio library. Too bad.
|
||||
|
||||
None of the above advice applies if you are using a 386 flat-memory-space
|
||||
environment, such as DJGPP or Watcom C. (And you should use one if you have
|
||||
it, as performance will be much better than 8086-compatible code!) For
|
||||
flat-memory-space compilers, do NOT define NEED_FAR_POINTERS, and do NOT use
|
||||
jmemdos.c. Use jmemnobs.c if the environment supplies adequate virtual
|
||||
memory, otherwise use jmemansi.c or jmemname.c.
|
||||
|
||||
Most MS-DOS compilers treat stdin/stdout as text files, so you must use
|
||||
two-file command line style. But if your compiler has either fdopen() or
|
||||
setmode(), you can use one-file style if you like. To do this, define
|
||||
USE_FDOPEN or USE_SETMODE so that stdin/stdout will be set to binary mode.
|
||||
(USE_SETMODE seems to work with more DOS compilers than USE_FDOPEN.) You
|
||||
should test that I/O through stdin/stdout produces the same results as I/O
|
||||
to explicitly named files... the "make test" procedures in the DOS-specific
|
||||
makefiles do NOT use stdin/stdout.
|
||||
|
||||
If you add more switches to CFLAGS in the DOS-specific makefiles, you are
|
||||
likely to run up against DOS' 128-byte command line length limit. In that
|
||||
case, remove some "-Dsymbol" switches from CFLAGS and instead put
|
||||
corresponding "#define symbol" lines at the head of jinclude.h.
|
||||
|
||||
|
||||
MS-DOS, Borland C:
|
||||
|
||||
Be sure to convert all the source files to DOS text format (CR/LF newlines).
|
||||
Although Borland C will often work OK with unmodified Unix (LF newlines)
|
||||
source files, sometimes it will give bogus compile errors.
|
||||
"Illegal character '#'" is the most common such error.
|
||||
|
||||
Some versions of Borland's MAKE erroneously display the warning message about
|
||||
creating jmemsys.c, even after you have done so. If this happens to you,
|
||||
delete the four lines beginning with "jmemsys.c:" from the Makefile.
|
||||
|
||||
If you want one-file command line style, define USE_SETMODE. fdopen() does
|
||||
not work correctly.
|
||||
|
||||
|
||||
MS-DOS, DJGPP:
|
||||
|
||||
Use makefile.ansi and jmemnobs.c, and put "-UMSDOS" in CFLAGS to undo the
|
||||
compiler's automatic definition of MSDOS. Also put either "-DUSE_SETMODE" or
|
||||
"-DTWO_FILE_COMMANDLINE" in CFLAGS, depending on whether you prefer one-file
|
||||
or two-file command line style. You'll also need to put the object-file lists
|
||||
into response files in order to circumvent DOS's 128-byte command line length
|
||||
limit at the final linking step.
|
||||
|
||||
|
||||
MS-DOS, Microsoft C:
|
||||
|
||||
Old versions of MS C fail with an "out of macro expansion space" error
|
||||
because they can't cope with the macro TRACEMS8 (defined in jpegdata.h).
|
||||
If this happens to you, the easiest solution is to change TRACEMS8 to
|
||||
expand to nothing. You'll lose the ability to dump out JPEG coefficient
|
||||
tables with djpeg -debug -debug, but at least you can compile.
|
||||
|
||||
Original MS C 6.0 is buggy; it compiles incorrect code unless you turn off
|
||||
optimization (remove -O from CFLAGS). That problem seems to have been fixed
|
||||
in 6.00A and later versions. 6.00A still generates a bogus "conditional
|
||||
expression is constant" warning in jrdppm.c, but the emitted code seems OK.
|
||||
|
||||
If you want one-file command line style, define USE_SETMODE. fdopen() does
|
||||
not work correctly, at least not in 6.00A.
|
||||
|
||||
|
||||
SGI:
|
||||
|
||||
Use makefile.ansi, but set "AR2= ar -ts" rather than "AR2= ranlib". Also
|
||||
make any changes recommended by ckconfig.c.
|
||||
|
||||
|
||||
Sun:
|
||||
|
||||
Don't forget to add -DBSD to CFLAGS. If you are using GCC on SunOS 4.0.1 or
|
||||
earlier, you will need to add -DNONANSI_INCLUDES to CFLAGS (your compiler may
|
||||
be ANSI, but your system include files aren't). I've gotten conflicting
|
||||
reports on whether this is still necessary on SunOS 4.1 or later.
|
||||
308
USAGE
Normal file
@@ -0,0 +1,308 @@
|
||||
USAGE instructions for the Independent JPEG Group's JPEG software
|
||||
=================================================================
|
||||
|
||||
INTRODUCTION
|
||||
|
||||
This distribution contains software to implement JPEG image compression and
|
||||
decompression. JPEG (pronounced "jay-peg") is a standardized compression
|
||||
method for full-color and gray-scale images. JPEG is designed to handle
|
||||
"real-world" scenes, for example scanned photographs. Cartoons, line
|
||||
drawings, and other non-realistic images are not JPEG's strong suit; on this
|
||||
sort of material you may get poor image quality and/or little compression.
|
||||
|
||||
JPEG is lossy, meaning that the output image is not necessarily identical to
|
||||
the input image. Hence you should not use JPEG if you have to have identical
|
||||
output bits. However, on typical real-world images, very good compression
|
||||
levels can be obtained with no visible change, and amazingly high compression
|
||||
is possible if you can tolerate a low-quality image. You can trade off image
|
||||
quality against file size by adjusting the compressor's "quality" setting.
|
||||
|
||||
This file describes usage of the standard programs "cjpeg" and "djpeg" that
|
||||
can be built directly from the distributed C code. See the README file for
|
||||
hints on incorporating the JPEG software into other programs.
|
||||
|
||||
If you are on a Unix machine you may prefer to read the Unix-style manual
|
||||
pages in files cjpeg.1 and djpeg.1. But also see the HINTS section below,
|
||||
which is not present in either manual page.
|
||||
|
||||
NOTE: the switch syntax has been redesigned since the v3 release of
|
||||
cjpeg/djpeg. Switch names are now words instead of single letters.
|
||||
|
||||
|
||||
GENERAL USAGE
|
||||
|
||||
We provide two programs, cjpeg to compress an image file into JPEG format,
|
||||
and djpeg to decompress a JPEG file back into a conventional image format.
|
||||
|
||||
On Unix-like systems, you say:
|
||||
cjpeg [switches] [imagefile] >jpegfile
|
||||
or
|
||||
djpeg [switches] [jpegfile] >imagefile
|
||||
The programs read the specified input file, or standard input if none is
|
||||
named. They always write to standard output (with trace/error messages to
|
||||
standard error). These conventions are handy for piping images between
|
||||
programs.
|
||||
|
||||
On most non-Unix systems, you say:
|
||||
cjpeg [switches] imagefile jpegfile
|
||||
or
|
||||
djpeg [switches] jpegfile imagefile
|
||||
i.e., both the input and output files are named on the command line. This
|
||||
style is a little more foolproof, and it loses no functionality if you don't
|
||||
have pipes. (You can get this style on Unix too, if you prefer, by defining
|
||||
TWO_FILE_COMMANDLINE when you compile the programs; see SETUP.)
|
||||
|
||||
You can also say:
|
||||
cjpeg [switches] -outfile jpegfile imagefile
|
||||
or
|
||||
djpeg [switches] -outfile imagefile jpegfile
|
||||
This syntax works on all systems, so it is useful for scripts.
|
||||
|
||||
The currently supported image file formats are: PPM (PBMPLUS color format),
|
||||
PGM (PBMPLUS gray-scale format), GIF, Targa, and RLE (Utah Raster Toolkit
|
||||
format). (RLE is supported only if the URT library is available.)
|
||||
cjpeg recognizes the input image format automatically, with the exception
|
||||
of some Targa-format files. You have to tell djpeg which format to generate.
|
||||
|
||||
The only JPEG file format currently supported is the JFIF format. Support for
|
||||
the TIFF 6.0 JPEG format will probably be added at some future date.
|
||||
|
||||
All switch names may be abbreviated; for example, -grayscale may be written
|
||||
-gray or -gr. Most of the "basic" switches can be abbreviated to as little as
|
||||
one letter. Upper and lower case are equivalent (-GIF is the same as -gif).
|
||||
British spellings are also accepted (e.g., -greyscale), though for brevity
|
||||
these are not mentioned below.
|
||||
|
||||
|
||||
CJPEG DETAILS
|
||||
|
||||
The basic command line switches for cjpeg are:
|
||||
|
||||
-quality N Scale quantization tables to adjust image quality.
|
||||
Quality is 0 (worst) to 100 (best); default is 75.
|
||||
(See below for more info.)
|
||||
|
||||
-grayscale Create monochrome JPEG file from color input.
|
||||
Be sure to use this switch when compressing a grayscale
|
||||
GIF file, because cjpeg isn't bright enough to notice
|
||||
whether a GIF file uses only shades of gray. By
|
||||
saying -grayscale, you'll get a smaller JPEG file that
|
||||
takes less time to process.
|
||||
|
||||
-optimize Perform optimization of entropy encoding parameters.
|
||||
Without this, default encoding parameters are used.
|
||||
-optimize usually makes the JPEG file a little smaller,
|
||||
but cjpeg runs somewhat slower and needs much more
|
||||
memory. Image quality and speed of decompression are
|
||||
unaffected by -optimize.
|
||||
|
||||
-targa Input file is Targa format. Targa files that contain
|
||||
an "identification" field will not be automatically
|
||||
recognized by cjpeg; for such files you must specify
|
||||
-targa to make cjpeg treat the input as Targa format.
|
||||
|
||||
The -quality switch lets you trade off compressed file size against quality of
|
||||
the reconstructed image: the higher the quality setting, the larger the JPEG
|
||||
file, and the closer the output image will be to the original input. Normally
|
||||
you want to use the lowest quality setting (smallest file) that decompresses
|
||||
into something visually indistinguishable from the original image. For this
|
||||
purpose the quality setting should be between 50 and 95; the default of 75 is
|
||||
often about right. If you see defects at -quality 75, then go up 5 or 10
|
||||
counts at a time until you are happy with the output image. (The optimal
|
||||
setting will vary from one image to another.)
|
||||
|
||||
-quality 100 will generate a quantization table of all 1's, eliminating loss
|
||||
in the quantization step (but there is still information loss in subsampling,
|
||||
as well as roundoff error). This setting is mainly of interest for
|
||||
experimental purposes. Quality values above about 95 are NOT recommended for
|
||||
normal use; the compressed file size goes up dramatically for hardly any gain
|
||||
in output image quality.
|
||||
|
||||
In the other direction, quality values below 50 will produce very small files
|
||||
of low image quality. Settings around 5 to 10 might be useful in preparing an
|
||||
index of a large image library, for example. Try -quality 2 (or so) for some
|
||||
amusing Cubist effects. (Note: quality values below about 25 generate 2-byte
|
||||
quantization tables, which are considered optional in the JPEG standard.
|
||||
cjpeg emits a warning message when you give such a quality value, because
|
||||
some commercial JPEG programs may be unable to decode the resulting file.)
|
||||
|
||||
Switches for advanced users:
|
||||
|
||||
-maxmemory N Set limit for amount of memory to use in processing
|
||||
large images. Value is in thousands of bytes, or
|
||||
millions of bytes if "M" is attached to the number.
|
||||
For example, -max 4m selects 4000000 bytes. If more
|
||||
space is needed, temporary files will be used.
|
||||
|
||||
-restart N Emit a JPEG restart marker every N MCU rows, or every
|
||||
N MCU blocks if "B" is attached to the number.
|
||||
-restart 0 (the default) means no restart markers.
|
||||
|
||||
-smooth N Smooth the input image to eliminate dithering noise.
|
||||
N, ranging from 1 to 100, indicates the strength of
|
||||
smoothing. 0 (the default) means no smoothing.
|
||||
|
||||
-verbose Enable debug printout. More -v's give more printout.
|
||||
or -debug Also, version information is printed at startup.
|
||||
|
||||
The -restart option inserts extra markers that allow a JPEG decoder to
|
||||
resynchronize after a transmission error. Without restart markers, any damage
|
||||
to a compressed file will usually ruin the image from the point of the error
|
||||
to the end of the image; with restart markers, the damage is usually confined
|
||||
to the portion of the image up to the next restart marker. Of course, the
|
||||
restart markers occupy extra space. We recommend -restart 1 for images that
|
||||
will be transmitted across unreliable networks such as Usenet.
|
||||
|
||||
The -smooth option filters the input to eliminate fine-scale noise. This is
|
||||
often useful when converting GIF files to JPEG: a moderate smoothing factor of
|
||||
10 to 50 gets rid of dithering patterns in the input file, resulting in a
|
||||
smaller JPEG file and a better-looking image. Too large a smoothing factor
|
||||
will visibly blur the image, however.
|
||||
|
||||
Switches for wizards:
|
||||
|
||||
-arithmetic Use arithmetic coding rather than Huffman coding.
|
||||
(Not currently supported for legal reasons.)
|
||||
|
||||
-nointerleave Generate noninterleaved JPEG file (not yet supported).
|
||||
|
||||
-qtables file Use the quantization tables given in the specified
|
||||
file. The file should contain one to four tables
|
||||
(64 values each) as plain text. Comments preceded by
|
||||
'#' may be included in the file. The tables are
|
||||
implicitly numbered 0,1,etc. If -quality N is also
|
||||
specified, the values in the file are scaled according
|
||||
to cjpeg's quality scaling curve.
|
||||
|
||||
-sample HxV[,...] Set JPEG sampling factors. If you specify
|
||||
fewer H/V pairs than there are components, the
|
||||
remaining components are set to 1x1 sampling. The
|
||||
default setting is equivalent to "-sample 2x2".
|
||||
|
||||
The "wizard" switches are intended for experimentation with JPEG. If you
|
||||
don't know what you are doing, DON'T USE THEM. You can easily produce files
|
||||
with worse image quality and/or poorer compression than you'll get from the
|
||||
default settings. Furthermore, these switches should not be used when making
|
||||
files intended for general use, because not all JPEG implementations will
|
||||
support unusual JPEG parameter settings.
|
||||
|
||||
|
||||
DJPEG DETAILS
|
||||
|
||||
The basic command line switches for djpeg are:
|
||||
|
||||
-colors N Reduce image to at most N colors. This reduces the
|
||||
or -quantize N number of colors used in the output image, so that it
|
||||
can be displayed on a colormapped display or stored in
|
||||
a colormapped file format. For example, if you have
|
||||
an 8-bit display, you'd need to reduce to 256 or fewer
|
||||
colors. (-colors is the recommended name, -quantize
|
||||
is provided only for backwards compatibility.)
|
||||
|
||||
-gif Select GIF output format. Since GIF does not support
|
||||
more than 256 colors, -colors 256 is assumed (unless
|
||||
you specify a smaller number of colors).
|
||||
|
||||
-pnm Select PBMPLUS (PPM/PGM) output format (this is the
|
||||
default format). PGM is emitted if the JPEG file is
|
||||
gray-scale or if -grayscale is specified; otherwise
|
||||
PPM is emitted.
|
||||
|
||||
-rle Select RLE output format. (Requires URT library.)
|
||||
|
||||
-targa Select Targa output format. Gray-scale format is
|
||||
emitted if the JPEG file is gray-scale or if
|
||||
-grayscale is specified; otherwise, colormapped format
|
||||
is emitted if -colors is specified; otherwise, 24-bit
|
||||
full-color format is emitted.
|
||||
|
||||
Switches for advanced users:
|
||||
|
||||
-blocksmooth Perform cross-block smoothing. This is slow, quite
|
||||
memory-intensive, and only seems to improve the image
|
||||
at very low quality settings (-quality 10 to 20 or so).
|
||||
At normal quality settings it may make things worse.
|
||||
|
||||
-grayscale Force gray-scale output even if JPEG file is color.
|
||||
Useful for viewing on monochrome displays.
|
||||
|
||||
-maxmemory N Set limit for amount of memory to use in processing
|
||||
large images. Value is in thousands of bytes, or
|
||||
millions of bytes if "M" is attached to the number.
|
||||
For example, -max 4m selects 4000000 bytes. If more
|
||||
space is needed, temporary files will be used.
|
||||
|
||||
-nodither Do not use dithering in color quantization.
|
||||
By default, Floyd-Steinberg dithering is applied when
|
||||
quantizing colors, but on some images dithering may
|
||||
result in objectionable "graininess". If that
|
||||
happens, you can turn off dithering with -nodither.
|
||||
-nodither is ignored unless you also say -colors N.
|
||||
|
||||
-onepass Use one-pass instead of two-pass color quantization.
|
||||
The one-pass method is faster and needs less memory,
|
||||
but it produces a lower-quality image. -onepass is
|
||||
ignored unless you also say -colors N. Also,
|
||||
the one-pass method is always used for gray-scale
|
||||
output (the two-pass method is no improvement then).
|
||||
|
||||
-verbose Enable debug printout. More -v's give more printout.
|
||||
or -debug Also, version information is printed at startup.
|
||||
|
||||
|
||||
HINTS
|
||||
|
||||
Color GIF files are not the ideal input for JPEG; JPEG is really intended for
|
||||
compressing full-color (24-bit) images. In particular, don't try to convert
|
||||
cartoons, line drawings, and other images that have only a few distinct
|
||||
colors. GIF works great on these, JPEG does not. If you want to convert a
|
||||
GIF to JPEG, you should experiment with cjpeg's -quality and -smooth options
|
||||
to get a satisfactory conversion. -smooth 10 or so is often helpful.
|
||||
|
||||
Avoid running an image through a series of JPEG compression/decompression
|
||||
cycles. Image quality loss will accumulate; after ten or so cycles the image
|
||||
may be noticeably worse than it was after one cycle. It's best to use a
|
||||
lossless format while manipulating an image, then convert to JPEG format when
|
||||
you are ready to file the image away.
|
||||
|
||||
The -optimize option to cjpeg is worth using when you are making a "final"
|
||||
version for posting or archiving. It's also a win when you are using low
|
||||
quality settings to make very small JPEG files; the percentage improvement
|
||||
is often a lot more than it is on larger files.
|
||||
|
||||
When making images to be posted on Usenet, we recommend using cjpeg's option
|
||||
-restart 1. This option limits the damage done to a compressed image by
|
||||
netnews transmission errors.
|
||||
|
||||
The default memory usage limit (-maxmemory) is set when the software is
|
||||
compiled. If you get an "insufficient memory" error, try specifying a smaller
|
||||
-maxmemory value, even -maxmemory 0 to use the absolute minimum space. You
|
||||
may want to recompile with a smaller default value if this happens often.
|
||||
|
||||
On machines that have "environment" variables, you can define the environment
|
||||
variable JPEGMEM to set the default memory limit. The value is specified as
|
||||
described for the -maxmemory switch. JPEGMEM overrides the default value
|
||||
specified when the program was compiled, and itself is overridden by an
|
||||
explicit -maxmemory switch.
|
||||
|
||||
On MS-DOS machines, -maxmemory is the amount of main (conventional) memory to
|
||||
use. (Extended or expanded memory is also used if available.) Most
|
||||
DOS-specific versions of this software do their own memory space estimation
|
||||
and do not need -maxmemory.
|
||||
|
||||
djpeg with two-pass color quantization requires a good deal of memory; on
|
||||
MS-DOS machines it may run out of memory even with -maxmemory 0. In that case
|
||||
you can still decompress, with some loss of image quality, by specifying
|
||||
-onepass for one-pass quantization.
|
||||
|
||||
If more space is needed than will fit in the available main memory (as
|
||||
determined by -maxmemory), temporary files will be used. (MS-DOS versions
|
||||
will try to get extended or expanded memory first.) The temporary files are
|
||||
often rather large: in typical cases they occupy three bytes per pixel, for
|
||||
example 3*800*600 = 1.44Mb for an 800x600 image. If you don't have enough
|
||||
free disk space, leave out -optimize (for cjpeg) or specify -onepass (for
|
||||
djpeg). On MS-DOS, the temporary files are created in the directory named by
|
||||
the TMP or TEMP environment variable, or in the current directory if neither
|
||||
of those exist. Amiga implementations put the temp files in the directory
|
||||
named by JPEGTMP:, so be sure to assign JPEGTMP: to a disk partition with
|
||||
adequate free space.
|
||||
477
ansi2knr.c
Normal file
@@ -0,0 +1,477 @@
|
||||
/* Copyright (C) 1989, 1991 Aladdin Enterprises. All rights reserved.
|
||||
Distributed by Free Software Foundation, Inc.
|
||||
|
||||
This file is part of Ghostscript.
|
||||
|
||||
Ghostscript is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY. No author or distributor accepts responsibility
|
||||
to anyone for the consequences of using it or for whether it serves any
|
||||
particular purpose or works at all, unless he says so in writing. Refer
|
||||
to the Ghostscript General Public License for full details.
|
||||
|
||||
Everyone is granted permission to copy, modify and redistribute
|
||||
Ghostscript, but only under the conditions described in the Ghostscript
|
||||
General Public License. A copy of this license is supposed to have been
|
||||
given to you along with Ghostscript so you can know your rights and
|
||||
responsibilities. It should be in a file named COPYING. Among other
|
||||
things, the copyright notice and this notice must be preserved on all
|
||||
copies. */
|
||||
|
||||
/*
|
||||
---------- Here is the GhostScript file COPYING, referred to above ----------
|
||||
----- These terms do NOT apply to the JPEG software itself; see README ------
|
||||
|
||||
GHOSTSCRIPT GENERAL PUBLIC LICENSE
|
||||
(Clarified 11 Feb 1988)
|
||||
|
||||
Copyright (C) 1988 Richard M. Stallman
|
||||
Everyone is permitted to copy and distribute verbatim copies of this
|
||||
license, but changing it is not allowed. You can also use this wording
|
||||
to make the terms for other programs.
|
||||
|
||||
The license agreements of most software companies keep you at the
|
||||
mercy of those companies. By contrast, our general public license is
|
||||
intended to give everyone the right to share Ghostscript. To make sure
|
||||
that you get the rights we want you to have, we need to make
|
||||
restrictions that forbid anyone to deny you these rights or to ask you
|
||||
to surrender the rights. Hence this license agreement.
|
||||
|
||||
Specifically, we want to make sure that you have the right to give
|
||||
away copies of Ghostscript, that you receive source code or else can get
|
||||
it if you want it, that you can change Ghostscript or use pieces of it
|
||||
in new free programs, and that you know you can do these things.
|
||||
|
||||
To make sure that everyone has such rights, we have to forbid you to
|
||||
deprive anyone else of these rights. For example, if you distribute
|
||||
copies of Ghostscript, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must tell them their rights.
|
||||
|
||||
Also, for our own protection, we must make certain that everyone finds
|
||||
out that there is no warranty for Ghostscript. If Ghostscript is
|
||||
modified by someone else and passed on, we want its recipients to know
|
||||
that what they have is not what we distributed, so that any problems
|
||||
introduced by others will not reflect on our reputation.
|
||||
|
||||
Therefore we (Richard M. Stallman and the Free Software Foundation,
|
||||
Inc.) make the following terms which say what you must do to be allowed
|
||||
to distribute or change Ghostscript.
|
||||
|
||||
|
||||
COPYING POLICIES
|
||||
|
||||
1. You may copy and distribute verbatim copies of Ghostscript source
|
||||
code as you receive it, in any medium, provided that you conspicuously
|
||||
and appropriately publish on each copy a valid copyright and license
|
||||
notice "Copyright (C) 1989 Aladdin Enterprises. All rights reserved.
|
||||
Distributed by Free Software Foundation, Inc." (or with whatever year is
|
||||
appropriate); keep intact the notices on all files that refer to this
|
||||
License Agreement and to the absence of any warranty; and give any other
|
||||
recipients of the Ghostscript program a copy of this License Agreement
|
||||
along with the program. You may charge a distribution fee for the
|
||||
physical act of transferring a copy.
|
||||
|
||||
2. You may modify your copy or copies of Ghostscript or any portion of
|
||||
it, and copy and distribute such modifications under the terms of
|
||||
Paragraph 1 above, provided that you also do the following:
|
||||
|
||||
a) cause the modified files to carry prominent notices stating
|
||||
that you changed the files and the date of any change; and
|
||||
|
||||
b) cause the whole of any work that you distribute or publish,
|
||||
that in whole or in part contains or is a derivative of Ghostscript
|
||||
or any part thereof, to be licensed at no charge to all third
|
||||
parties on terms identical to those contained in this License
|
||||
Agreement (except that you may choose to grant more extensive
|
||||
warranty protection to some or all third parties, at your option).
|
||||
|
||||
c) You may charge a distribution fee for the physical act of
|
||||
transferring a copy, and you may at your option offer warranty
|
||||
protection in exchange for a fee.
|
||||
|
||||
Mere aggregation of another unrelated program with this program (or its
|
||||
derivative) on a volume of a storage or distribution medium does not bring
|
||||
the other program under the scope of these terms.
|
||||
|
||||
3. You may copy and distribute Ghostscript (or a portion or derivative
|
||||
of it, under Paragraph 2) in object code or executable form under the
|
||||
terms of Paragraphs 1 and 2 above provided that you also do one of the
|
||||
following:
|
||||
|
||||
a) accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of
|
||||
Paragraphs 1 and 2 above; or,
|
||||
|
||||
b) accompany it with a written offer, valid for at least three
|
||||
years, to give any third party free (except for a nominal
|
||||
shipping charge) a complete machine-readable copy of the
|
||||
corresponding source code, to be distributed under the terms of
|
||||
Paragraphs 1 and 2 above; or,
|
||||
|
||||
c) accompany it with the information you received as to where the
|
||||
corresponding source code may be obtained. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form alone.)
|
||||
|
||||
For an executable file, complete source code means all the source code for
|
||||
all modules it contains; but, as a special exception, it need not include
|
||||
source code for modules which are standard libraries that accompany the
|
||||
operating system on which the executable file runs.
|
||||
|
||||
4. You may not copy, sublicense, distribute or transfer Ghostscript
|
||||
except as expressly provided under this License Agreement. Any attempt
|
||||
otherwise to copy, sublicense, distribute or transfer Ghostscript is
|
||||
void and your rights to use the program under this License agreement
|
||||
shall be automatically terminated. However, parties who have received
|
||||
computer software programs from you with this License Agreement will not
|
||||
have their licenses terminated so long as such parties remain in full
|
||||
compliance.
|
||||
|
||||
5. If you wish to incorporate parts of Ghostscript into other free
|
||||
programs whose distribution conditions are different, write to the Free
|
||||
Software Foundation at 675 Mass Ave, Cambridge, MA 02139. We have not
|
||||
yet worked out a simple rule that can be stated here, but we will often
|
||||
permit this. We will be guided by the two goals of preserving the free
|
||||
status of all derivatives of our free software and of promoting the
|
||||
sharing and reuse of software.
|
||||
|
||||
Your comments and suggestions about our licensing policies and our
|
||||
software are welcome! Please contact the Free Software Foundation,
|
||||
Inc., 675 Mass Ave, Cambridge, MA 02139, or call (617) 876-3296.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
BECAUSE GHOSTSCRIPT IS LICENSED FREE OF CHARGE, WE PROVIDE ABSOLUTELY
|
||||
NO WARRANTY, TO THE EXTENT PERMITTED BY APPLICABLE STATE LAW. EXCEPT
|
||||
WHEN OTHERWISE STATED IN WRITING, FREE SOFTWARE FOUNDATION, INC, RICHARD
|
||||
M. STALLMAN, ALADDIN ENTERPRISES, L. PETER DEUTSCH, AND/OR OTHER PARTIES
|
||||
PROVIDE GHOSTSCRIPT "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE
|
||||
ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF GHOSTSCRIPT IS WITH
|
||||
YOU. SHOULD GHOSTSCRIPT PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
|
||||
NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW WILL RICHARD M.
|
||||
STALLMAN, THE FREE SOFTWARE FOUNDATION, INC., L. PETER DEUTSCH, ALADDIN
|
||||
ENTERPRISES, AND/OR ANY OTHER PARTY WHO MAY MODIFY AND REDISTRIBUTE
|
||||
GHOSTSCRIPT AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING
|
||||
ANY LOST PROFITS, LOST MONIES, OR OTHER SPECIAL, INCIDENTAL OR
|
||||
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE
|
||||
(INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED
|
||||
INACCURATE OR LOSSES SUSTAINED BY THIRD PARTIES OR A FAILURE OF THE
|
||||
PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS) GHOSTSCRIPT, EVEN IF YOU
|
||||
HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES, OR FOR ANY CLAIM
|
||||
BY ANY OTHER PARTY.
|
||||
-------------------- End of file COPYING ------------------------------
|
||||
*/
|
||||
|
||||
|
||||
/* ansi2knr.c */
|
||||
/* Convert ANSI function declarations to K&R syntax */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#ifdef BSD
|
||||
#include <strings.h>
|
||||
#define strchr index
|
||||
#else
|
||||
#ifdef VMS
|
||||
extern char *strcat(), *strchr(), *strcpy(), *strupr();
|
||||
extern int strcmp(), strlen(), strncmp();
|
||||
#else
|
||||
#include <string.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef MSDOS
|
||||
#include <malloc.h>
|
||||
#else
|
||||
#ifdef VMS
|
||||
extern char *malloc();
|
||||
extern void free();
|
||||
#else
|
||||
extern char *malloc();
|
||||
extern int free();
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Usage:
|
||||
ansi2knr input_file output_file
|
||||
* If no output_file is supplied, output goes to stdout.
|
||||
* There are no error messages.
|
||||
*
|
||||
* ansi2knr recognizes functions by seeing a non-keyword identifier
|
||||
* at the left margin, followed by a left parenthesis,
|
||||
* with a right parenthesis as the last character on the line.
|
||||
* It will recognize a multi-line header if the last character
|
||||
* on each line but the last is a left parenthesis or comma.
|
||||
* These algorithms ignore whitespace and comments, except that
|
||||
* the function name must be the first thing on the line.
|
||||
* The following constructs will confuse it:
|
||||
- Any other construct that starts at the left margin and
|
||||
follows the above syntax (such as a macro or function call).
|
||||
- Macros that tinker with the syntax of the function header.
|
||||
*/
|
||||
|
||||
/* Scanning macros */
|
||||
#define isidchar(ch) (isalnum(ch) || (ch) == '_')
|
||||
#define isidfirstchar(ch) (isalpha(ch) || (ch) == '_')
|
||||
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{ FILE *in, *out;
|
||||
#define bufsize 5000 /* arbitrary size */
|
||||
char *buf;
|
||||
char *line;
|
||||
switch ( argc )
|
||||
{
|
||||
default:
|
||||
printf("Usage: ansi2knr input_file [output_file]\n");
|
||||
exit(0);
|
||||
case 2:
|
||||
out = stdout; break;
|
||||
case 3:
|
||||
out = fopen(argv[2], "w");
|
||||
if ( out == NULL )
|
||||
{ fprintf(stderr, "Cannot open %s\n", argv[2]);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
in = fopen(argv[1], "r");
|
||||
if ( in == NULL )
|
||||
{ fprintf(stderr, "Cannot open %s\n", argv[1]);
|
||||
exit(1);
|
||||
}
|
||||
fprintf(out, "#line 1 \"%s\"\n", argv[1]);
|
||||
buf = malloc(bufsize);
|
||||
line = buf;
|
||||
while ( fgets(line, (unsigned)(buf + bufsize - line), in) != NULL )
|
||||
{ switch ( test1(buf) )
|
||||
{
|
||||
case 1: /* a function */
|
||||
convert1(buf, out);
|
||||
break;
|
||||
case -1: /* maybe the start of a function */
|
||||
line = buf + strlen(buf);
|
||||
if ( line != buf + (bufsize - 1) ) /* overflow check */
|
||||
continue;
|
||||
/* falls through */
|
||||
default: /* not a function */
|
||||
fputs(buf, out);
|
||||
break;
|
||||
}
|
||||
line = buf;
|
||||
}
|
||||
if ( line != buf ) fputs(buf, out);
|
||||
free(buf);
|
||||
fclose(out);
|
||||
fclose(in);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Skip over space and comments, in either direction. */
|
||||
char *
|
||||
skipspace(p, dir)
|
||||
register char *p;
|
||||
register int dir; /* 1 for forward, -1 for backward */
|
||||
{ for ( ; ; )
|
||||
{ while ( isspace(*p) ) p += dir;
|
||||
if ( !(*p == '/' && p[dir] == '*') ) break;
|
||||
p += dir; p += dir;
|
||||
while ( !(*p == '*' && p[dir] == '/') )
|
||||
{ if ( *p == 0 ) return p; /* multi-line comment?? */
|
||||
p += dir;
|
||||
}
|
||||
p += dir; p += dir;
|
||||
}
|
||||
return p;
|
||||
}
|
||||
|
||||
/*
|
||||
* Write blanks over part of a string.
|
||||
*/
|
||||
int
|
||||
writeblanks(start, end)
|
||||
char *start;
|
||||
char *end;
|
||||
{ char *p;
|
||||
for ( p = start; p < end; p++ ) *p = ' ';
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Test whether the string in buf is a function definition.
|
||||
* The string may contain and/or end with a newline.
|
||||
* Return as follows:
|
||||
* 0 - definitely not a function definition;
|
||||
* 1 - definitely a function definition;
|
||||
* -1 - may be the beginning of a function definition,
|
||||
* append another line and look again.
|
||||
*/
|
||||
int
|
||||
test1(buf)
|
||||
char *buf;
|
||||
{ register char *p = buf;
|
||||
char *bend;
|
||||
char *endfn;
|
||||
int contin;
|
||||
if ( !isidfirstchar(*p) )
|
||||
return 0; /* no name at left margin */
|
||||
bend = skipspace(buf + strlen(buf) - 1, -1);
|
||||
switch ( *bend )
|
||||
{
|
||||
case ')': contin = 1; break;
|
||||
case '(':
|
||||
case ',': contin = -1; break;
|
||||
default: return 0; /* not a function */
|
||||
}
|
||||
while ( isidchar(*p) ) p++;
|
||||
endfn = p;
|
||||
p = skipspace(p, 1);
|
||||
if ( *p++ != '(' )
|
||||
return 0; /* not a function */
|
||||
p = skipspace(p, 1);
|
||||
if ( *p == ')' )
|
||||
return 0; /* no parameters */
|
||||
/* Check that the apparent function name isn't a keyword. */
|
||||
/* We only need to check for keywords that could be followed */
|
||||
/* by a left parenthesis (which, unfortunately, is most of them). */
|
||||
{ static char *words[] =
|
||||
{ "asm", "auto", "case", "char", "const", "double",
|
||||
"extern", "float", "for", "if", "int", "long",
|
||||
"register", "return", "short", "signed", "sizeof",
|
||||
"static", "switch", "typedef", "unsigned",
|
||||
"void", "volatile", "while", 0
|
||||
};
|
||||
char **key = words;
|
||||
char *kp;
|
||||
int len = endfn - buf;
|
||||
while ( (kp = *key) != 0 )
|
||||
{ if ( strlen(kp) == len && !strncmp(kp, buf, len) )
|
||||
return 0; /* name is a keyword */
|
||||
key++;
|
||||
}
|
||||
}
|
||||
return contin;
|
||||
}
|
||||
|
||||
int
|
||||
convert1(buf, out)
|
||||
char *buf;
|
||||
FILE *out;
|
||||
{ char *endfn = strchr(buf, '(') + 1;
|
||||
register char *p;
|
||||
char **breaks;
|
||||
unsigned num_breaks = 2; /* for testing */
|
||||
char **btop;
|
||||
char **bp;
|
||||
char **ap;
|
||||
top: p = endfn;
|
||||
breaks = (char **)malloc(sizeof(char *) * num_breaks * 2);
|
||||
if ( breaks == 0 )
|
||||
{ /* Couldn't allocate break table, give up */
|
||||
fprintf(stderr, "Unable to allocate break table!\n");
|
||||
fputs(buf, out);
|
||||
return -1;
|
||||
}
|
||||
btop = breaks + num_breaks * 2 - 2;
|
||||
bp = breaks;
|
||||
/* Parse the argument list */
|
||||
do
|
||||
{ int level = 0;
|
||||
char *end = NULL;
|
||||
if ( bp >= btop )
|
||||
{ /* Filled up break table. */
|
||||
/* Allocate a bigger one and start over. */
|
||||
free((char *)breaks);
|
||||
num_breaks <<= 1;
|
||||
goto top;
|
||||
}
|
||||
*bp++ = p;
|
||||
/* Find the end of the argument */
|
||||
for ( ; end == NULL; p++ )
|
||||
{ switch(*p)
|
||||
{
|
||||
case ',': if ( !level ) end = p; break;
|
||||
case '(': level++; break;
|
||||
case ')': if ( --level < 0 ) end = p; break;
|
||||
case '/': p = skipspace(p, 1) - 1; break;
|
||||
default: ;
|
||||
}
|
||||
}
|
||||
p--; /* back up over terminator */
|
||||
/* Find the name being declared. */
|
||||
/* This is complicated because of procedure and */
|
||||
/* array modifiers. */
|
||||
for ( ; ; )
|
||||
{ p = skipspace(p - 1, -1);
|
||||
switch ( *p )
|
||||
{
|
||||
case ']': /* skip array dimension(s) */
|
||||
case ')': /* skip procedure args OR name */
|
||||
{ int level = 1;
|
||||
while ( level )
|
||||
switch ( *--p )
|
||||
{
|
||||
case ']': case ')': level++; break;
|
||||
case '[': case '(': level--; break;
|
||||
case '/': p = skipspace(p, -1) + 1; break;
|
||||
default: ;
|
||||
}
|
||||
}
|
||||
if ( *p == '(' && *skipspace(p + 1, 1) == '*' )
|
||||
{ /* We found the name being declared */
|
||||
while ( !isidfirstchar(*p) )
|
||||
p = skipspace(p, 1) + 1;
|
||||
goto found;
|
||||
}
|
||||
break;
|
||||
default: goto found;
|
||||
}
|
||||
}
|
||||
found: if ( *p == '.' && p[-1] == '.' && p[-2] == '.' )
|
||||
{ p++;
|
||||
if ( bp == breaks + 1 ) /* sole argument */
|
||||
writeblanks(breaks[0], p);
|
||||
else
|
||||
writeblanks(bp[-1] - 1, p);
|
||||
bp--;
|
||||
}
|
||||
else
|
||||
{ while ( isidchar(*p) ) p--;
|
||||
*bp++ = p+1;
|
||||
}
|
||||
p = end;
|
||||
}
|
||||
while ( *p++ == ',' );
|
||||
*bp = p;
|
||||
/* Make a special check for 'void' arglist */
|
||||
if ( bp == breaks+2 )
|
||||
{ p = skipspace(breaks[0], 1);
|
||||
if ( !strncmp(p, "void", 4) )
|
||||
{ p = skipspace(p+4, 1);
|
||||
if ( p == breaks[2] - 1 )
|
||||
{ bp = breaks; /* yup, pretend arglist is empty */
|
||||
writeblanks(breaks[0], p + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
/* Put out the function name */
|
||||
p = buf;
|
||||
while ( p != endfn ) putc(*p, out), p++;
|
||||
/* Put out the declaration */
|
||||
for ( ap = breaks+1; ap < bp; ap += 2 )
|
||||
{ p = *ap;
|
||||
while ( isidchar(*p) ) putc(*p, out), p++;
|
||||
if ( ap < bp - 1 ) fputs(", ", out);
|
||||
}
|
||||
fputs(") ", out);
|
||||
/* Put out the argument declarations */
|
||||
for ( ap = breaks+2; ap <= bp; ap += 2 ) (*ap)[-1] = ';';
|
||||
fputs(breaks[0], out);
|
||||
free((char *)breaks);
|
||||
return 0;
|
||||
}
|
||||
62
appveyor.yml
@@ -1,62 +0,0 @@
|
||||
image: Visual Studio 2019
|
||||
configuration: Release
|
||||
platform:
|
||||
- Win32
|
||||
- x64
|
||||
|
||||
install:
|
||||
- if %PLATFORM% == Win32 (set ARCH=x86)
|
||||
- if %PLATFORM% == x64 (set ARCH=x64)
|
||||
## Set up nasm
|
||||
- choco install nasm
|
||||
- set PATH=%PATH%;C:\Program Files\NASM
|
||||
## Set up libpng
|
||||
- cd C:\Tools\vcpkg
|
||||
- vcpkg install libpng:%ARCH%-windows
|
||||
- vcpkg install libpng:%ARCH%-windows-static
|
||||
|
||||
before_build:
|
||||
- cd %APPVEYOR_BUILD_FOLDER%
|
||||
- nasm -v
|
||||
- cmake --version
|
||||
- git describe --always --tags --dirty
|
||||
- FOR /F %%a in ('git describe --always --tags --dirty') do set GIT_VERSION=%%a
|
||||
|
||||
build_script:
|
||||
## Build shared
|
||||
- cmake -B shared -A %PLATFORM%
|
||||
-DENABLE_SHARED=1 -DENABLE_STATIC=0
|
||||
-DREQUIRE_SIMD=1
|
||||
-DCMAKE_TOOLCHAIN_FILE=C:/tools/vcpkg/scripts/buildsystems/vcpkg.cmake
|
||||
|
||||
- cmake --build shared --config Release
|
||||
|
||||
## Build static
|
||||
- cmake -B static -A %PLATFORM%
|
||||
-DENABLE_SHARED=0 -DENABLE_STATIC=1
|
||||
-DREQUIRE_SIMD=1
|
||||
-DCMAKE_TOOLCHAIN_FILE=C:/tools/vcpkg/scripts/buildsystems/vcpkg.cmake
|
||||
-DVCPKG_TARGET_TRIPLET=%ARCH%-windows-static
|
||||
|
||||
- cmake --build static --config Release
|
||||
|
||||
after_build:
|
||||
- 7z a mozjpeg-%GIT_VERSION%-win-%ARCH%.zip shared/Release static/Release
|
||||
|
||||
artifacts:
|
||||
- path: '*.zip'
|
||||
|
||||
cache:
|
||||
- C:\ProgramData\chocolatey\bin
|
||||
- C:\ProgramData\chocolatey\lib
|
||||
- C:\Program Files\NASM
|
||||
- C:\tools\vcpkg\installed
|
||||
|
||||
deploy:
|
||||
description: 'Automated build using Appveyor'
|
||||
provider: GitHub
|
||||
auth_token:
|
||||
secure: 2Jj47Q5HnaPob9U4yX2t4q4TYTw4JWU6cS56mM12aoRLgfYkZ4gRZPySIzfmTPqC
|
||||
artifact: /.*\.zip/
|
||||
on:
|
||||
APPVEYOR_REPO_TAG: true # deploy on tag push only
|
||||
1195
architecture
Normal file
119
cderror.h
@@ -1,119 +0,0 @@
|
||||
/*
|
||||
* cderror.h
|
||||
*
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1994-1997, Thomas G. Lane.
|
||||
* Modified 2009-2017 by Guido Vollbeding.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2021, 2024, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
* This file defines the error and message codes for the cjpeg/djpeg
|
||||
* applications. These strings are not needed as part of the JPEG library
|
||||
* proper.
|
||||
* Edit this file to add new codes, or to translate the message strings to
|
||||
* some other language.
|
||||
*/
|
||||
|
||||
/*
|
||||
* To define the enum list of message codes, include this file without
|
||||
* defining macro JMESSAGE. To create a message string table, include it
|
||||
* again with a suitable JMESSAGE definition (see jerror.c for an example).
|
||||
*/
|
||||
#ifndef JMESSAGE
|
||||
#ifndef CDERROR_H
|
||||
#define CDERROR_H
|
||||
/* First time through, define the enum list */
|
||||
#define JMAKE_ENUM_LIST
|
||||
#else
|
||||
/* Repeated inclusions of this file are no-ops unless JMESSAGE is defined */
|
||||
#define JMESSAGE(code, string)
|
||||
#endif /* CDERROR_H */
|
||||
#endif /* JMESSAGE */
|
||||
|
||||
#ifdef JMAKE_ENUM_LIST
|
||||
|
||||
typedef enum {
|
||||
|
||||
#define JMESSAGE(code, string) code,
|
||||
|
||||
#endif /* JMAKE_ENUM_LIST */
|
||||
|
||||
JMESSAGE(JMSG_FIRSTADDONCODE = 1000, NULL) /* Must be first entry! */
|
||||
|
||||
JMESSAGE(JERR_BMP_BADCMAP, "Unsupported BMP colormap format")
|
||||
JMESSAGE(JERR_BMP_BADDEPTH, "Only 8-, 24-, and 32-bit BMP files are supported")
|
||||
JMESSAGE(JERR_BMP_BADHEADER, "Invalid BMP file: bad header length")
|
||||
JMESSAGE(JERR_BMP_BADPLANES, "Invalid BMP file: biPlanes not equal to 1")
|
||||
JMESSAGE(JERR_BMP_COLORSPACE, "BMP output must be grayscale or RGB")
|
||||
JMESSAGE(JERR_BMP_COMPRESSED, "Sorry, compressed BMPs not yet supported")
|
||||
JMESSAGE(JERR_BMP_EMPTY, "Empty BMP image")
|
||||
JMESSAGE(JERR_BMP_NOT, "Not a BMP file - does not start with BM")
|
||||
JMESSAGE(JERR_BMP_OUTOFRANGE, "Numeric value out of range in BMP file")
|
||||
JMESSAGE(JTRC_BMP, "%ux%u %d-bit BMP image")
|
||||
JMESSAGE(JTRC_BMP_MAPPED, "%ux%u 8-bit colormapped BMP image")
|
||||
JMESSAGE(JTRC_BMP_OS2, "%ux%u %d-bit OS2 BMP image")
|
||||
JMESSAGE(JTRC_BMP_OS2_MAPPED, "%ux%u 8-bit colormapped OS2 BMP image")
|
||||
|
||||
JMESSAGE(JERR_GIF_BUG, "GIF output got confused")
|
||||
JMESSAGE(JERR_GIF_CODESIZE, "Bogus GIF codesize %d")
|
||||
JMESSAGE(JERR_GIF_COLORSPACE, "GIF output must be grayscale or RGB")
|
||||
JMESSAGE(JERR_GIF_EMPTY, "Empty GIF image")
|
||||
JMESSAGE(JERR_GIF_IMAGENOTFOUND, "Too few images in GIF file")
|
||||
JMESSAGE(JERR_GIF_NOT, "Not a GIF file")
|
||||
JMESSAGE(JTRC_GIF, "%ux%ux%d GIF image")
|
||||
JMESSAGE(JTRC_GIF_BADVERSION,
|
||||
"Warning: unexpected GIF version number '%c%c%c'")
|
||||
JMESSAGE(JTRC_GIF_EXTENSION, "Ignoring GIF extension block of type 0x%02x")
|
||||
JMESSAGE(JTRC_GIF_NONSQUARE, "Caution: nonsquare pixels in input")
|
||||
JMESSAGE(JWRN_GIF_BADDATA, "Corrupt data in GIF file")
|
||||
JMESSAGE(JWRN_GIF_CHAR, "Bogus char 0x%02x in GIF file, ignoring")
|
||||
JMESSAGE(JWRN_GIF_ENDCODE, "Premature end of GIF image")
|
||||
JMESSAGE(JWRN_GIF_NOMOREDATA, "Ran out of GIF bits")
|
||||
|
||||
JMESSAGE(JERR_PPM_COLORSPACE, "PPM output must be grayscale or RGB")
|
||||
JMESSAGE(JERR_PPM_NONNUMERIC, "Nonnumeric data in PPM file")
|
||||
JMESSAGE(JERR_PPM_NOT, "Not a PPM/PGM file")
|
||||
JMESSAGE(JERR_PPM_OUTOFRANGE, "Numeric value out of range in PPM file")
|
||||
JMESSAGE(JTRC_PGM, "%ux%u PGM image (maximum color value = %u)")
|
||||
JMESSAGE(JTRC_PGM_TEXT, "%ux%u text PGM image (maximum color value = %u)")
|
||||
JMESSAGE(JTRC_PPM, "%ux%u PPM image (maximum color value = %u)")
|
||||
JMESSAGE(JTRC_PPM_TEXT, "%ux%u text PPM image (maximum color value = %u)")
|
||||
|
||||
JMESSAGE(JERR_TGA_BADCMAP, "Unsupported Targa colormap format")
|
||||
JMESSAGE(JERR_TGA_BADPARMS, "Invalid or unsupported Targa file")
|
||||
JMESSAGE(JERR_TGA_COLORSPACE, "Targa output must be grayscale or RGB")
|
||||
JMESSAGE(JTRC_TGA, "%ux%u RGB Targa image")
|
||||
JMESSAGE(JTRC_TGA_GRAY, "%ux%u grayscale Targa image")
|
||||
JMESSAGE(JTRC_TGA_MAPPED, "%ux%u colormapped Targa image")
|
||||
JMESSAGE(JERR_TGA_NOTCOMP, "Targa support was not compiled")
|
||||
|
||||
JMESSAGE(JERR_BAD_CMAP_FILE,
|
||||
"Color map file is invalid or of unsupported format")
|
||||
JMESSAGE(JERR_TOO_MANY_COLORS,
|
||||
"Output file format cannot handle %d colormap entries")
|
||||
JMESSAGE(JERR_UNGETC_FAILED, "ungetc failed")
|
||||
#ifdef PNG_SUPPORTED
|
||||
JMESSAGE(JERR_UNKNOWN_FORMAT,
|
||||
"MozJPEG can't read the image (JPEG, PNG and old BMP and Targa are supported)")
|
||||
#else
|
||||
JMESSAGE(JERR_UNKNOWN_FORMAT, "MozJPEG can't read the image (PNG support is disabled in this build)")
|
||||
#endif
|
||||
JMESSAGE(JERR_UNSUPPORTED_FORMAT, "Unsupported output file format")
|
||||
|
||||
#ifdef PNG_SUPPORTED
|
||||
JMESSAGE(JERR_PNG_ERROR, "Unable to read PNG file: %s")
|
||||
JMESSAGE(JERR_PNG_PROFILETOOLARGE, "Embedded profile was too large for this tool - dropped.")
|
||||
#endif
|
||||
|
||||
#ifdef JMAKE_ENUM_LIST
|
||||
|
||||
JMSG_LASTADDONCODE
|
||||
} ADDON_MESSAGE_CODE;
|
||||
|
||||
#undef JMAKE_ENUM_LIST
|
||||
#endif /* JMAKE_ENUM_LIST */
|
||||
|
||||
/* Zap JMESSAGE macro so that future re-inclusions do nothing by default */
|
||||
#undef JMESSAGE
|
||||
156
cdjpeg.c
@@ -1,156 +0,0 @@
|
||||
/*
|
||||
* cdjpeg.c
|
||||
*
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1991-1997, Thomas G. Lane.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2019, 2022, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
* This file contains common support routines used by the IJG application
|
||||
* programs (cjpeg, djpeg, jpegtran).
|
||||
*/
|
||||
|
||||
#include "cdjpeg.h" /* Common decls for cjpeg/djpeg applications */
|
||||
#include <ctype.h> /* to declare isupper(), tolower() */
|
||||
#ifdef USE_SETMODE
|
||||
#include <fcntl.h> /* to declare setmode()'s parameter macros */
|
||||
/* If you have setmode() but not <io.h>, just delete this line: */
|
||||
#include <io.h> /* to declare setmode() */
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Optional progress monitor: display a percent-done figure on stderr.
|
||||
*/
|
||||
|
||||
METHODDEF(void)
|
||||
progress_monitor(j_common_ptr cinfo)
|
||||
{
|
||||
cd_progress_ptr prog = (cd_progress_ptr)cinfo->progress;
|
||||
|
||||
if (prog->max_scans != 0 && cinfo->is_decompressor) {
|
||||
int scan_no = ((j_decompress_ptr)cinfo)->input_scan_number;
|
||||
|
||||
if (scan_no > (int)prog->max_scans) {
|
||||
fprintf(stderr, "Scan number %d exceeds maximum scans (%u)\n", scan_no,
|
||||
prog->max_scans);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
|
||||
if (prog->report) {
|
||||
int total_passes = prog->pub.total_passes + prog->total_extra_passes;
|
||||
int percent_done =
|
||||
(int)(prog->pub.pass_counter * 100L / prog->pub.pass_limit);
|
||||
|
||||
if (percent_done != prog->percent_done) {
|
||||
prog->percent_done = percent_done;
|
||||
if (total_passes > 1) {
|
||||
fprintf(stderr, "\rPass %d/%d: %3d%% ",
|
||||
prog->pub.completed_passes + prog->completed_extra_passes + 1,
|
||||
total_passes, percent_done);
|
||||
} else {
|
||||
fprintf(stderr, "\r %3d%% ", percent_done);
|
||||
}
|
||||
fflush(stderr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
GLOBAL(void)
|
||||
start_progress_monitor(j_common_ptr cinfo, cd_progress_ptr progress)
|
||||
{
|
||||
/* Enable progress display, unless trace output is on */
|
||||
if (cinfo->err->trace_level == 0) {
|
||||
progress->pub.progress_monitor = progress_monitor;
|
||||
progress->completed_extra_passes = 0;
|
||||
progress->total_extra_passes = 0;
|
||||
progress->max_scans = 0;
|
||||
progress->report = FALSE;
|
||||
progress->percent_done = -1;
|
||||
cinfo->progress = &progress->pub;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
GLOBAL(void)
|
||||
end_progress_monitor(j_common_ptr cinfo)
|
||||
{
|
||||
/* Clear away progress display */
|
||||
if (cinfo->err->trace_level == 0) {
|
||||
fprintf(stderr, "\r \r");
|
||||
fflush(stderr);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Case-insensitive matching of possibly-abbreviated keyword switches.
|
||||
* keyword is the constant keyword (must be lower case already),
|
||||
* minchars is length of minimum legal abbreviation.
|
||||
*/
|
||||
|
||||
GLOBAL(boolean)
|
||||
keymatch(char *arg, const char *keyword, int minchars)
|
||||
{
|
||||
register int ca, ck;
|
||||
register int nmatched = 0;
|
||||
|
||||
while ((ca = *arg++) != '\0') {
|
||||
if ((ck = *keyword++) == '\0')
|
||||
return FALSE; /* arg longer than keyword, no good */
|
||||
if (isupper(ca)) /* force arg to lcase (assume ck is already) */
|
||||
ca = tolower(ca);
|
||||
if (ca != ck)
|
||||
return FALSE; /* no good */
|
||||
nmatched++; /* count matched characters */
|
||||
}
|
||||
/* reached end of argument; fail if it's too short for unique abbrev */
|
||||
if (nmatched < minchars)
|
||||
return FALSE;
|
||||
return TRUE; /* A-OK */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Routines to establish binary I/O mode for stdin and stdout.
|
||||
* Non-Unix systems often require some hacking to get out of text mode.
|
||||
*/
|
||||
|
||||
GLOBAL(FILE *)
|
||||
read_stdin(void)
|
||||
{
|
||||
FILE *input_file = stdin;
|
||||
|
||||
#ifdef USE_SETMODE /* need to hack file mode? */
|
||||
setmode(fileno(stdin), O_BINARY);
|
||||
#endif
|
||||
#ifdef USE_FDOPEN /* need to re-open in binary mode? */
|
||||
if ((input_file = fdopen(fileno(stdin), READ_BINARY)) == NULL) {
|
||||
fprintf(stderr, "Cannot reopen stdin\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
#endif
|
||||
return input_file;
|
||||
}
|
||||
|
||||
|
||||
GLOBAL(FILE *)
|
||||
write_stdout(void)
|
||||
{
|
||||
FILE *output_file = stdout;
|
||||
|
||||
#ifdef USE_SETMODE /* need to hack file mode? */
|
||||
setmode(fileno(stdout), O_BINARY);
|
||||
#endif
|
||||
#ifdef USE_FDOPEN /* need to re-open in binary mode? */
|
||||
if ((output_file = fdopen(fileno(stdout), WRITE_BINARY)) == NULL) {
|
||||
fprintf(stderr, "Cannot reopen stdout\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
#endif
|
||||
return output_file;
|
||||
}
|
||||
189
cdjpeg.h
@@ -1,189 +0,0 @@
|
||||
/*
|
||||
* cdjpeg.h
|
||||
*
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1994-1997, Thomas G. Lane.
|
||||
* Modified 2019 by Guido Vollbeding.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2017, 2019, 2021-2022, D. R. Commander.
|
||||
* Copyright (C) 2014, Mozilla Corporation.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
* This file contains common declarations for the sample applications
|
||||
* cjpeg and djpeg. It is NOT used by the core JPEG library.
|
||||
*/
|
||||
|
||||
#define JPEG_CJPEG_DJPEG /* define proper options in jconfig.h */
|
||||
#define JPEG_INTERNAL_OPTIONS /* cjpeg.c,djpeg.c need to see xxx_SUPPORTED */
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jerror.h" /* get library error codes too */
|
||||
#include "cderror.h" /* get application-specific error codes */
|
||||
|
||||
#define JPEG_RAW_READER 0
|
||||
|
||||
/*
|
||||
* Object interface for cjpeg's source file decoding modules
|
||||
*/
|
||||
|
||||
typedef struct cjpeg_source_struct *cjpeg_source_ptr;
|
||||
|
||||
struct cjpeg_source_struct {
|
||||
void (*start_input) (j_compress_ptr cinfo, cjpeg_source_ptr sinfo);
|
||||
JDIMENSION (*get_pixel_rows) (j_compress_ptr cinfo, cjpeg_source_ptr sinfo);
|
||||
void (*finish_input) (j_compress_ptr cinfo, cjpeg_source_ptr sinfo);
|
||||
|
||||
FILE *input_file;
|
||||
|
||||
JSAMPARRAY buffer;
|
||||
J12SAMPARRAY buffer12;
|
||||
#ifdef C_LOSSLESS_SUPPORTED
|
||||
J16SAMPARRAY buffer16;
|
||||
#endif
|
||||
JDIMENSION buffer_height;
|
||||
JDIMENSION max_pixels;
|
||||
#if JPEG_RAW_READER
|
||||
// For reading JPEG
|
||||
JSAMPARRAY plane_pointer[4];
|
||||
#endif
|
||||
|
||||
jpeg_saved_marker_ptr marker_list;
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* Object interface for djpeg's output file encoding modules
|
||||
*/
|
||||
|
||||
typedef struct djpeg_dest_struct *djpeg_dest_ptr;
|
||||
|
||||
struct djpeg_dest_struct {
|
||||
/* start_output is called after jpeg_start_decompress finishes.
|
||||
* The color map will be ready at this time, if one is needed.
|
||||
*/
|
||||
void (*start_output) (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo);
|
||||
/* Emit the specified number of pixel rows from the buffer. */
|
||||
void (*put_pixel_rows) (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo,
|
||||
JDIMENSION rows_supplied);
|
||||
/* Finish up at the end of the image. */
|
||||
void (*finish_output) (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo);
|
||||
/* Re-calculate buffer dimensions based on output dimensions (for use with
|
||||
partial image decompression.) If this is NULL, then the output format
|
||||
does not support partial image decompression (BMP, in particular, cannot
|
||||
support partial decompression because it uses an inversion buffer to write
|
||||
the image in bottom-up order.) */
|
||||
void (*calc_buffer_dimensions) (j_decompress_ptr cinfo,
|
||||
djpeg_dest_ptr dinfo);
|
||||
|
||||
|
||||
/* Target file spec; filled in by djpeg.c after object is created. */
|
||||
FILE *output_file;
|
||||
|
||||
/* Output pixel-row buffer. Created by module init or start_output.
|
||||
* Width is cinfo->output_width * cinfo->output_components;
|
||||
* height is buffer_height.
|
||||
*/
|
||||
JSAMPARRAY buffer;
|
||||
J12SAMPARRAY buffer12;
|
||||
#ifdef D_LOSSLESS_SUPPORTED
|
||||
J16SAMPARRAY buffer16;
|
||||
#endif
|
||||
JDIMENSION buffer_height;
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* cjpeg/djpeg may need to perform extra passes to convert to or from
|
||||
* the source/destination file format. The JPEG library does not know
|
||||
* about these passes, but we'd like them to be counted by the progress
|
||||
* monitor. We use an expanded progress monitor object to hold the
|
||||
* additional pass count.
|
||||
*/
|
||||
|
||||
struct cdjpeg_progress_mgr {
|
||||
struct jpeg_progress_mgr pub; /* fields known to JPEG library */
|
||||
int completed_extra_passes; /* extra passes completed */
|
||||
int total_extra_passes; /* total extra */
|
||||
JDIMENSION max_scans; /* abort if the number of scans exceeds this
|
||||
value and the value is non-zero */
|
||||
boolean report; /* whether or not to report progress */
|
||||
/* last printed percentage stored here to avoid multiple printouts */
|
||||
int percent_done;
|
||||
};
|
||||
|
||||
typedef struct cdjpeg_progress_mgr *cd_progress_ptr;
|
||||
|
||||
|
||||
/* Module selection routines for I/O modules. */
|
||||
|
||||
EXTERN(cjpeg_source_ptr) jinit_read_jpeg (j_compress_ptr cinfo);
|
||||
EXTERN(cjpeg_source_ptr) jinit_read_png (j_compress_ptr cinfo);
|
||||
EXTERN(cjpeg_source_ptr) jinit_read_bmp(j_compress_ptr cinfo,
|
||||
boolean use_inversion_array);
|
||||
EXTERN(djpeg_dest_ptr) jinit_write_bmp(j_decompress_ptr cinfo, boolean is_os2,
|
||||
boolean use_inversion_array);
|
||||
EXTERN(cjpeg_source_ptr) jinit_read_gif(j_compress_ptr cinfo);
|
||||
EXTERN(cjpeg_source_ptr) j12init_read_gif(j_compress_ptr cinfo);
|
||||
#ifdef C_LOSSLESS_SUPPORTED
|
||||
EXTERN(cjpeg_source_ptr) j16init_read_gif(j_compress_ptr cinfo);
|
||||
#endif
|
||||
EXTERN(djpeg_dest_ptr) jinit_write_gif(j_decompress_ptr cinfo, boolean is_lzw);
|
||||
EXTERN(djpeg_dest_ptr) j12init_write_gif(j_decompress_ptr cinfo,
|
||||
boolean is_lzw);
|
||||
EXTERN(cjpeg_source_ptr) jinit_read_ppm(j_compress_ptr cinfo);
|
||||
EXTERN(cjpeg_source_ptr) j12init_read_ppm(j_compress_ptr cinfo);
|
||||
#ifdef C_LOSSLESS_SUPPORTED
|
||||
EXTERN(cjpeg_source_ptr) j16init_read_ppm(j_compress_ptr cinfo);
|
||||
#endif
|
||||
EXTERN(djpeg_dest_ptr) jinit_write_ppm(j_decompress_ptr cinfo);
|
||||
EXTERN(djpeg_dest_ptr) j12init_write_ppm(j_decompress_ptr cinfo);
|
||||
#ifdef D_LOSSLESS_SUPPORTED
|
||||
EXTERN(djpeg_dest_ptr) j16init_write_ppm(j_decompress_ptr cinfo);
|
||||
#endif
|
||||
EXTERN(cjpeg_source_ptr) jinit_read_targa(j_compress_ptr cinfo);
|
||||
EXTERN(djpeg_dest_ptr) jinit_write_targa(j_decompress_ptr cinfo);
|
||||
|
||||
/* cjpeg support routines (in rdswitch.c) */
|
||||
|
||||
EXTERN(boolean) read_quant_tables(j_compress_ptr cinfo, char *filename,
|
||||
boolean force_baseline);
|
||||
EXTERN(boolean) read_scan_script(j_compress_ptr cinfo, char *filename);
|
||||
EXTERN(boolean) set_quality_ratings(j_compress_ptr cinfo, char *arg,
|
||||
boolean force_baseline);
|
||||
EXTERN(boolean) set_quant_slots(j_compress_ptr cinfo, char *arg);
|
||||
EXTERN(boolean) set_sample_factors(j_compress_ptr cinfo, char *arg);
|
||||
|
||||
/* djpeg support routines (in rdcolmap.c) */
|
||||
|
||||
EXTERN(void) read_color_map(j_decompress_ptr cinfo, FILE *infile);
|
||||
EXTERN(void) read_color_map_12(j_decompress_ptr cinfo, FILE *infile);
|
||||
|
||||
/* common support routines (in cdjpeg.c) */
|
||||
|
||||
EXTERN(void) start_progress_monitor(j_common_ptr cinfo,
|
||||
cd_progress_ptr progress);
|
||||
EXTERN(void) end_progress_monitor(j_common_ptr cinfo);
|
||||
EXTERN(boolean) keymatch(char *arg, const char *keyword, int minchars);
|
||||
EXTERN(FILE *) read_stdin(void);
|
||||
EXTERN(FILE *) write_stdout(void);
|
||||
|
||||
/* miscellaneous useful macros */
|
||||
|
||||
#ifdef DONT_USE_B_MODE /* define mode parameters for fopen() */
|
||||
#define READ_BINARY "r"
|
||||
#define WRITE_BINARY "w"
|
||||
#else
|
||||
#define READ_BINARY "rb"
|
||||
#define WRITE_BINARY "wb"
|
||||
#endif
|
||||
|
||||
#ifndef EXIT_FAILURE /* define exit() codes if not provided */
|
||||
#define EXIT_FAILURE 1
|
||||
#endif
|
||||
#ifndef EXIT_SUCCESS
|
||||
#define EXIT_SUCCESS 0
|
||||
#endif
|
||||
#ifndef EXIT_WARNING
|
||||
#define EXIT_WARNING 2
|
||||
#endif
|
||||
336
change.log
@@ -1,336 +0,0 @@
|
||||
libjpeg-turbo note: This file has been modified by The libjpeg-turbo Project
|
||||
to include only information relevant to libjpeg-turbo. It is included only for
|
||||
reference. Please see ChangeLog.md for information specific to libjpeg-turbo.
|
||||
|
||||
|
||||
CHANGE LOG for Independent JPEG Group's JPEG software
|
||||
|
||||
|
||||
Version 9d 12-Jan-2020
|
||||
-----------------------
|
||||
|
||||
Restore GIF read and write support from libjpeg version 6a.
|
||||
Thank to Wolfgang Werner (W.W.) Heinz for suggestion.
|
||||
|
||||
Add jpegtran -drop option; add options to the crop extension and wipe
|
||||
to fill the extra area with content from the source image region,
|
||||
instead of gray out.
|
||||
|
||||
|
||||
Version 9c 14-Jan-2018
|
||||
-----------------------
|
||||
|
||||
jpegtran: add an option to the -wipe switch to fill the region
|
||||
with the average of adjacent blocks, instead of gray out.
|
||||
Thank to Caitlyn Feddock and Maddie Ziegler for inspiration.
|
||||
|
||||
|
||||
Version 9b 17-Jan-2016
|
||||
-----------------------
|
||||
|
||||
Document 'f' specifier for jpegtran -crop specification.
|
||||
Thank to Michele Martone for suggestion.
|
||||
|
||||
|
||||
Version 9a 19-Jan-2014
|
||||
-----------------------
|
||||
|
||||
Add jpegtran -wipe option and extension for -crop.
|
||||
Thank to Andrew Senior, David Clunie, and Josef Schmid for suggestion.
|
||||
|
||||
|
||||
Version 9 13-Jan-2013
|
||||
----------------------
|
||||
|
||||
Add remark for jpeg_mem_dest() in jdatadst.c.
|
||||
Thank to Elie-Gregoire Khoury for the hint.
|
||||
|
||||
Correct argument type in format string, avoid compiler warnings.
|
||||
Thank to Vincent Torri for hint.
|
||||
|
||||
|
||||
Version 8d 15-Jan-2012
|
||||
-----------------------
|
||||
|
||||
Add cjpeg -rgb option to create RGB JPEG files.
|
||||
Using this switch suppresses the conversion from RGB
|
||||
colorspace input to the default YCbCr JPEG colorspace.
|
||||
Thank to Michael Koch for the initial suggestion.
|
||||
|
||||
Add option to disable the region adjustment in the transupp crop code.
|
||||
Thank to Jeffrey Friedl for the suggestion.
|
||||
|
||||
|
||||
Version 8b 16-May-2010
|
||||
-----------------------
|
||||
|
||||
Repair problem in new memory source manager with corrupt JPEG data.
|
||||
Thank to Ted Campbell and Samuel Chun for the report.
|
||||
|
||||
|
||||
Version 8a 28-Feb-2010
|
||||
-----------------------
|
||||
|
||||
Writing tables-only datastreams via jpeg_write_tables works again.
|
||||
|
||||
Support 32-bit BMPs (RGB image with Alpha channel) for read in cjpeg.
|
||||
Thank to Brett Blackham for the suggestion.
|
||||
|
||||
|
||||
Version 8 10-Jan-2010
|
||||
----------------------
|
||||
|
||||
Add sanity check in BMP reader module to avoid cjpeg crash for empty input
|
||||
image (thank to Isaev Ildar of ISP RAS, Moscow, RU for reporting this error).
|
||||
|
||||
Add data source and destination managers for read from and write to
|
||||
memory buffers. New API functions jpeg_mem_src and jpeg_mem_dest.
|
||||
Thank to Roberto Boni from Italy for the suggestion.
|
||||
|
||||
|
||||
Version 7 27-Jun-2009
|
||||
----------------------
|
||||
|
||||
New scaled DCTs implemented.
|
||||
djpeg now supports scalings N/8 with all N from 1 to 16.
|
||||
|
||||
cjpeg -quality option has been extended for support of separate quality
|
||||
settings for luminance and chrominance (or in general, for every provided
|
||||
quantization table slot).
|
||||
New API function jpeg_default_qtables() and q_scale_factor array in library.
|
||||
|
||||
Support arithmetic entropy encoding and decoding.
|
||||
Added files jaricom.c, jcarith.c, jdarith.c.
|
||||
|
||||
jpegtran has a new "lossless" cropping feature.
|
||||
|
||||
Implement -perfect option in jpegtran, new API function
|
||||
jtransform_perfect_transform() in transupp. (DP 204_perfect.dpatch)
|
||||
|
||||
Better error messages for jpegtran fopen failure.
|
||||
(DP 203_jpegtran_errmsg.dpatch)
|
||||
|
||||
Fix byte order issue with 16bit PPM/PGM files in rdppm.c/wrppm.c:
|
||||
according to Netpbm, the de facto standard implementation of the PNM formats,
|
||||
the most significant byte is first. (DP 203_rdppm.dpatch)
|
||||
|
||||
Add -raw option to rdjpgcom not to mangle the output.
|
||||
(DP 205_rdjpgcom_raw.dpatch)
|
||||
|
||||
Make rdjpgcom locale aware. (DP 201_rdjpgcom_locale.dpatch)
|
||||
|
||||
Add extern "C" to jpeglib.h.
|
||||
This avoids the need to put extern "C" { ... } around #include "jpeglib.h"
|
||||
in your C++ application. Defining the symbol DONT_USE_EXTERN_C in the
|
||||
configuration prevents this. (DP 202_jpeglib.h_c++.dpatch)
|
||||
|
||||
|
||||
Version 6b 27-Mar-1998
|
||||
-----------------------
|
||||
|
||||
jpegtran has new features for lossless image transformations (rotation
|
||||
and flipping) as well as "lossless" reduction to grayscale.
|
||||
|
||||
jpegtran now copies comments by default; it has a -copy switch to enable
|
||||
copying all APPn blocks as well, or to suppress comments. (Formerly it
|
||||
always suppressed comments and APPn blocks.) jpegtran now also preserves
|
||||
JFIF version and resolution information.
|
||||
|
||||
New decompressor library feature: COM and APPn markers found in the input
|
||||
file can be saved in memory for later use by the application. (Before,
|
||||
you had to code this up yourself with a custom marker processor.)
|
||||
|
||||
There is an unused field "void * client_data" now in compress and decompress
|
||||
parameter structs; this may be useful in some applications.
|
||||
|
||||
JFIF version number information is now saved by the decoder and accepted by
|
||||
the encoder. jpegtran uses this to copy the source file's version number,
|
||||
to ensure "jpegtran -copy all" won't create bogus files that contain JFXX
|
||||
extensions but claim to be version 1.01. Applications that generate their
|
||||
own JFXX extension markers also (finally) have a supported way to cause the
|
||||
encoder to emit JFIF version number 1.02.
|
||||
|
||||
djpeg's trace mode reports JFIF 1.02 thumbnail images as such, rather
|
||||
than as unknown APP0 markers.
|
||||
|
||||
In -verbose mode, djpeg and rdjpgcom will try to print the contents of
|
||||
APP12 markers as text. Some digital cameras store useful text information
|
||||
in APP12 markers.
|
||||
|
||||
Handling of truncated data streams is more robust: blocks beyond the one in
|
||||
which the error occurs will be output as uniform gray, or left unchanged
|
||||
if decoding a progressive JPEG. The appearance no longer depends on the
|
||||
Huffman tables being used.
|
||||
|
||||
Huffman tables are checked for validity much more carefully than before.
|
||||
|
||||
The configure script now supports building libjpeg as a shared library
|
||||
on many flavors of Unix (all the ones that GNU libtool knows how to
|
||||
build shared libraries for). Use "./configure --enable-shared" to
|
||||
try this out.
|
||||
|
||||
New jconfig file and makefiles for Microsoft Visual C++ and Developer Studio.
|
||||
Also, a jconfig file and a build script for Metrowerks CodeWarrior
|
||||
on Apple Macintosh. makefile.dj has been updated for DJGPP v2, and there
|
||||
are miscellaneous other minor improvements in the makefiles.
|
||||
|
||||
jmemmac.c now knows how to create temporary files following Mac System 7
|
||||
conventions.
|
||||
|
||||
djpeg's -map switch is now able to read raw-format PPM files reliably.
|
||||
|
||||
cjpeg -progressive -restart no longer generates any unnecessary DRI markers.
|
||||
|
||||
Multiple calls to jpeg_simple_progression for a single JPEG object
|
||||
no longer leak memory.
|
||||
|
||||
|
||||
Version 6a 7-Feb-96
|
||||
--------------------
|
||||
|
||||
Library initialization sequence modified to detect version mismatches
|
||||
and struct field packing mismatches between library and calling application.
|
||||
This change requires applications to be recompiled, but does not require
|
||||
any application source code change.
|
||||
|
||||
All routine declarations changed to the style "GLOBAL(type) name ...",
|
||||
that is, GLOBAL, LOCAL, METHODDEF, EXTERN are now macros taking the
|
||||
routine's return type as an argument. This makes it possible to add
|
||||
Microsoft-style linkage keywords to all the routines by changing just
|
||||
these macros. Note that any application code that was using these macros
|
||||
will have to be changed.
|
||||
|
||||
DCT coefficient quantization tables are now stored in normal array order
|
||||
rather than zigzag order. Application code that calls jpeg_add_quant_table,
|
||||
or otherwise manipulates quantization tables directly, will need to be
|
||||
changed. If you need to make such code work with either older or newer
|
||||
versions of the library, a test like "#if JPEG_LIB_VERSION >= 61" is
|
||||
recommended.
|
||||
|
||||
djpeg's trace capability now dumps DQT tables in natural order, not zigzag
|
||||
order. This allows the trace output to be made into a "-qtables" file
|
||||
more easily.
|
||||
|
||||
New system-dependent memory manager module for use on Apple Macintosh.
|
||||
|
||||
Fix bug in cjpeg's -smooth option: last one or two scanlines would be
|
||||
duplicates of the prior line unless the image height mod 16 was 1 or 2.
|
||||
|
||||
Repair minor problems in VMS, BCC, MC6 makefiles.
|
||||
|
||||
New configure script based on latest GNU Autoconf.
|
||||
|
||||
Correct the list of include files needed by MetroWerks C for ccommand().
|
||||
|
||||
Numerous small documentation updates.
|
||||
|
||||
|
||||
Version 6 2-Aug-95
|
||||
-------------------
|
||||
|
||||
Progressive JPEG support: library can read and write full progressive JPEG
|
||||
files. A "buffered image" mode supports incremental decoding for on-the-fly
|
||||
display of progressive images. Simply recompiling an existing IJG-v5-based
|
||||
decoder with v6 should allow it to read progressive files, though of course
|
||||
without any special progressive display.
|
||||
|
||||
New "jpegtran" application performs lossless transcoding between different
|
||||
JPEG formats; primarily, it can be used to convert baseline to progressive
|
||||
JPEG and vice versa. In support of jpegtran, the library now allows lossless
|
||||
reading and writing of JPEG files as DCT coefficient arrays. This ability
|
||||
may be of use in other applications.
|
||||
|
||||
Notes for programmers:
|
||||
* We changed jpeg_start_decompress() to be able to suspend; this makes all
|
||||
decoding modes available to suspending-input applications. However,
|
||||
existing applications that use suspending input will need to be changed
|
||||
to check the return value from jpeg_start_decompress(). You don't need to
|
||||
do anything if you don't use a suspending data source.
|
||||
* We changed the interface to the virtual array routines: access_virt_array
|
||||
routines now take a count of the number of rows to access this time. The
|
||||
last parameter to request_virt_array routines is now interpreted as the
|
||||
maximum number of rows that may be accessed at once, but not necessarily
|
||||
the height of every access.
|
||||
|
||||
|
||||
Version 5b 15-Mar-95
|
||||
---------------------
|
||||
|
||||
Correct bugs with grayscale images having v_samp_factor > 1.
|
||||
|
||||
jpeg_write_raw_data() now supports output suspension.
|
||||
|
||||
Correct bugs in "configure" script for case of compiling in
|
||||
a directory other than the one containing the source files.
|
||||
|
||||
Repair bug in jquant1.c: sometimes didn't use as many colors as it could.
|
||||
|
||||
Borland C makefile and jconfig file work under either MS-DOS or OS/2.
|
||||
|
||||
Miscellaneous improvements to documentation.
|
||||
|
||||
|
||||
Version 5a 7-Dec-94
|
||||
--------------------
|
||||
|
||||
Changed color conversion roundoff behavior so that grayscale values are
|
||||
represented exactly. (This causes test image files to change.)
|
||||
|
||||
Make ordered dither use 16x16 instead of 4x4 pattern for a small quality
|
||||
improvement.
|
||||
|
||||
New configure script based on latest GNU Autoconf.
|
||||
Fix configure script to handle CFLAGS correctly.
|
||||
Rename *.auto files to *.cfg, so that configure script still works if
|
||||
file names have been truncated for DOS.
|
||||
|
||||
Fix bug in rdbmp.c: didn't allow for extra data between header and image.
|
||||
|
||||
Modify rdppm.c/wrppm.c to handle 2-byte raw PPM/PGM formats for 12-bit data.
|
||||
|
||||
Fix several bugs in rdrle.c.
|
||||
|
||||
NEED_SHORT_EXTERNAL_NAMES option was broken.
|
||||
|
||||
Revise jerror.h/jerror.c for more flexibility in message table.
|
||||
|
||||
Repair oversight in jmemname.c NO_MKTEMP case: file could be there
|
||||
but unreadable.
|
||||
|
||||
|
||||
Version 5 24-Sep-94
|
||||
--------------------
|
||||
|
||||
Version 5 represents a nearly complete redesign and rewrite of the IJG
|
||||
software. Major user-visible changes include:
|
||||
* Automatic configuration simplifies installation for most Unix systems.
|
||||
* A range of speed vs. image quality tradeoffs are supported.
|
||||
This includes resizing of an image during decompression: scaling down
|
||||
by a factor of 1/2, 1/4, or 1/8 is handled very efficiently.
|
||||
* New programs rdjpgcom and wrjpgcom allow insertion and extraction
|
||||
of text comments in a JPEG file.
|
||||
|
||||
The application programmer's interface to the library has changed completely.
|
||||
Notable improvements include:
|
||||
* We have eliminated the use of callback routines for handling the
|
||||
uncompressed image data. The application now sees the library as a
|
||||
set of routines that it calls to read or write image data on a
|
||||
scanline-by-scanline basis.
|
||||
* The application image data is represented in a conventional interleaved-
|
||||
pixel format, rather than as a separate array for each color channel.
|
||||
This can save a copying step in many programs.
|
||||
* The handling of compressed data has been cleaned up: the application can
|
||||
supply routines to source or sink the compressed data. It is possible to
|
||||
suspend processing on source/sink buffer overrun, although this is not
|
||||
supported in all operating modes.
|
||||
* All static state has been eliminated from the library, so that multiple
|
||||
instances of compression or decompression can be active concurrently.
|
||||
* JPEG abbreviated datastream formats are supported, ie, quantization and
|
||||
Huffman tables can be stored separately from the image data.
|
||||
* And not only that, but the documentation of the library has improved
|
||||
considerably!
|
||||
|
||||
|
||||
The last widely used release before the version 5 rewrite was version 4A of
|
||||
18-Feb-93. Change logs before that point have been discarded, since they
|
||||
are not of much interest after the rewrite.
|
||||
403
cjpeg.1
@@ -1,10 +1,46 @@
|
||||
.TH CJPEG 1 "30 August 2024"
|
||||
.TH CJPEG 1 "4 November 1992"
|
||||
.SH NAME
|
||||
cjpeg \- compress an image file to a JPEG file
|
||||
.SH SYNOPSIS
|
||||
.B cjpeg
|
||||
[
|
||||
.I options
|
||||
.BI \-quality " N"
|
||||
]
|
||||
[
|
||||
.B \-grayscale
|
||||
]
|
||||
[
|
||||
.B \-optimize
|
||||
]
|
||||
[
|
||||
.B \-targa
|
||||
]
|
||||
[
|
||||
.BI \-maxmemory " N"
|
||||
]
|
||||
[
|
||||
.BI \-restart " N"
|
||||
]
|
||||
[
|
||||
.BI \-smooth " N"
|
||||
]
|
||||
[
|
||||
.B \-verbose
|
||||
]
|
||||
[
|
||||
.B \-debug
|
||||
]
|
||||
[
|
||||
.B \-arithmetic
|
||||
]
|
||||
[
|
||||
.B \-nointerleave
|
||||
]
|
||||
[
|
||||
.BI \-qtables " file"
|
||||
]
|
||||
[
|
||||
.BI \-sample " HxV[,...]"
|
||||
]
|
||||
[
|
||||
.I filename
|
||||
@@ -16,8 +52,8 @@ cjpeg \- compress an image file to a JPEG file
|
||||
compresses the named image file, or the standard input if no file is
|
||||
named, and produces a JPEG/JFIF file on the standard output.
|
||||
The currently supported input file formats are: PPM (PBMPLUS color
|
||||
format), PGM (PBMPLUS grayscale format), BMP, GIF [legacy feature], and Targa
|
||||
[legacy feature].
|
||||
format), PGM (PBMPLUS gray-scale format), GIF, Targa, and RLE (Utah Raster
|
||||
Toolkit format). (RLE is supported only if the URT library is available.)
|
||||
.SH OPTIONS
|
||||
All switch names may be abbreviated; for example,
|
||||
.B \-grayscale
|
||||
@@ -27,28 +63,28 @@ or
|
||||
.BR \-gr .
|
||||
Most of the "basic" switches can be abbreviated to as little as one letter.
|
||||
Upper and lower case are equivalent (thus
|
||||
.B \-BMP
|
||||
.B \-GIF
|
||||
is the same as
|
||||
.BR \-bmp ).
|
||||
British spellings are also accepted (e.g.
|
||||
.BR \-gif ).
|
||||
British spellings are also accepted (e.g.,
|
||||
.BR \-greyscale ),
|
||||
though for brevity these are not mentioned below.
|
||||
.PP
|
||||
The basic switches are:
|
||||
.TP
|
||||
.BI \-quality " N[,...]"
|
||||
.BI \-quality " N"
|
||||
Scale quantization tables to adjust image quality. Quality is 0 (worst) to
|
||||
100 (best); default is 75. (See below for more info.)
|
||||
.TP
|
||||
.B \-grayscale
|
||||
Create monochrome JPEG file from color input. By specifying
|
||||
.BR \-grayscale,
|
||||
Create monochrome JPEG file from color input. Be sure to use this switch when
|
||||
compressing a grayscale GIF file, because
|
||||
.B cjpeg
|
||||
isn't bright enough to notice whether a GIF file uses only shades of gray.
|
||||
By saying
|
||||
.BR \-grayscale ,
|
||||
you'll get a smaller JPEG file that takes less time to process.
|
||||
.TP
|
||||
.B \-rgb
|
||||
Create RGB JPEG file. Using this switch suppresses the conversion from RGB
|
||||
colorspace input to the default YCbCr JPEG colorspace.
|
||||
.TP
|
||||
.B \-optimize
|
||||
Perform optimization of entropy encoding parameters. Without this, default
|
||||
encoding parameters are used.
|
||||
@@ -59,23 +95,15 @@ runs somewhat slower and needs much more memory. Image quality and speed of
|
||||
decompression are unaffected by
|
||||
.BR \-optimize .
|
||||
.TP
|
||||
.B \-progressive
|
||||
Create progressive JPEG file (see below). Implies
|
||||
.B \-optimize
|
||||
unless
|
||||
.B \-arithmetic
|
||||
is also specified.
|
||||
.TP
|
||||
.B \-targa
|
||||
Input file is Targa format [legacy feature]. Targa files that contain an
|
||||
"identification" field will not be automatically recognized by
|
||||
.BR cjpeg .
|
||||
For such files, you must specify
|
||||
Input file is Targa format. Targa files that contain an "identification"
|
||||
field will not be automatically recognized by
|
||||
.BR cjpeg ;
|
||||
for such files you must specify
|
||||
.B \-targa
|
||||
to make
|
||||
.B cjpeg
|
||||
treat the input as Targa format. For most Targa files, you won't need this
|
||||
switch.
|
||||
treat the input as Targa format.
|
||||
.PP
|
||||
The
|
||||
.B \-quality
|
||||
@@ -84,19 +112,20 @@ reconstructed image: the higher the quality setting, the larger the JPEG file,
|
||||
and the closer the output image will be to the original input. Normally you
|
||||
want to use the lowest quality setting (smallest file) that decompresses into
|
||||
something visually indistinguishable from the original image. For this
|
||||
purpose the quality setting should generally be between 50 and 95 (the default
|
||||
is 75) for photographic images. If you see defects at
|
||||
purpose the quality setting should be between 50 and 95; the default of 75 is
|
||||
often about right. If you see defects at
|
||||
.B \-quality
|
||||
75, then go up 5 or 10 counts at a time until you are happy with the output
|
||||
image. (The optimal setting will vary from one image to another.)
|
||||
.PP
|
||||
.B \-quality
|
||||
100 will generate a quantization table of all 1's, minimizing loss in the
|
||||
100 will generate a quantization table of all 1's, eliminating loss in the
|
||||
quantization step (but there is still information loss in subsampling, as well
|
||||
as roundoff error.) For most images, specifying a quality value above
|
||||
about 95 will increase the size of the compressed file dramatically, and while
|
||||
the quality gain from these higher quality values is measurable (using metrics
|
||||
such as PSNR or SSIM), it is rarely perceivable by human vision.
|
||||
as roundoff error). This setting is mainly of interest for experimental
|
||||
purposes. Quality values above about 95 are
|
||||
.B not
|
||||
recommended for normal use; the compressed file size goes up dramatically for
|
||||
hardly any gain in output image quality.
|
||||
.PP
|
||||
In the other direction, quality values below 50 will produce very small files
|
||||
of low image quality. Settings around 5 to 10 might be useful in preparing an
|
||||
@@ -107,210 +136,26 @@ values below about 25 generate 2-byte quantization tables, which are
|
||||
considered optional in the JPEG standard.
|
||||
.B cjpeg
|
||||
emits a warning message when you give such a quality value, because some
|
||||
other JPEG programs may be unable to decode the resulting file. Use
|
||||
.B \-baseline
|
||||
if you need to ensure compatibility at low quality values.)
|
||||
.PP
|
||||
The \fB-quality\fR option has been extended in this version of \fBcjpeg\fR to
|
||||
support separate quality settings for luminance and chrominance (or, in
|
||||
general, separate settings for every quantization table slot.) The principle
|
||||
is the same as chrominance subsampling: since the human eye is more sensitive
|
||||
to spatial changes in brightness than spatial changes in color, the chrominance
|
||||
components can be quantized more than the luminance components without
|
||||
incurring any visible image quality loss. However, unlike subsampling, this
|
||||
feature reduces data in the frequency domain instead of the spatial domain,
|
||||
which allows for more fine-grained control. This option is useful in
|
||||
quality-sensitive applications, for which the artifacts generated by
|
||||
subsampling may be unacceptable.
|
||||
.PP
|
||||
The \fB-quality\fR option accepts a comma-separated list of parameters, which
|
||||
respectively refer to the quality levels that should be assigned to the
|
||||
quantization table slots. If there are more q-table slots than parameters,
|
||||
then the last parameter is replicated. Thus, if only one quality parameter is
|
||||
given, this is used for both luminance and chrominance (slots 0 and 1,
|
||||
respectively), preserving the legacy behavior of cjpeg v6b and prior.
|
||||
More (or customized) quantization tables can be set with the \fB-qtables\fR
|
||||
option and assigned to components with the \fB-qslots\fR option (see the
|
||||
"wizard" switches below.)
|
||||
.PP
|
||||
JPEG files generated with separate luminance and chrominance quality are fully
|
||||
compliant with standard JPEG decoders.
|
||||
.PP
|
||||
.BR CAUTION:
|
||||
For this setting to be useful, be sure to pass an argument of \fB-sample 1x1\fR
|
||||
to \fBcjpeg\fR to disable chrominance subsampling. Otherwise, the default
|
||||
subsampling level (2x2, AKA "4:2:0") will be used.
|
||||
.PP
|
||||
The
|
||||
.B \-progressive
|
||||
switch creates a "progressive JPEG" file. In this type of JPEG file, the data
|
||||
is stored in multiple scans of increasing quality. If the file is being
|
||||
transmitted over a slow communications link, the decoder can use the first
|
||||
scan to display a low-quality image very quickly, and can then improve the
|
||||
display with each subsequent scan. The final image is exactly equivalent to a
|
||||
standard JPEG file of the same quality setting, and the total file size is
|
||||
about the same --- often a little smaller.
|
||||
commercial JPEG programs may be unable to decode the resulting file.)
|
||||
.PP
|
||||
Switches for advanced users:
|
||||
.TP
|
||||
.BI \-precision " N"
|
||||
Create JPEG file with N-bit data precision. N is 8, 12, or 16; default is 8.
|
||||
If N is 16, then
|
||||
.B -lossless
|
||||
must also be specified. Note that only the PBMPLUS input file format supports
|
||||
data precisions other than 8. (For historical reasons,
|
||||
.B cjpeg
|
||||
allows GIF input files to be converted into 12-bit-per-sample JPEG files, but
|
||||
this is not a useful conversion.) Note also that PBMPLUS input files are
|
||||
silently scaled to the target data precision, even if it is lower than the
|
||||
precision of the input file. Passing an argument of
|
||||
.B \-verbose
|
||||
to
|
||||
.B cjpeg
|
||||
will cause it to print information about the precision of the input file.
|
||||
.B Caution:
|
||||
12-bit and 16-bit data precision is not yet widely implemented, so many
|
||||
decoders will be unable to handle a 12-bit-per-sample or 16-bit-per-sample JPEG
|
||||
file at all.
|
||||
.IP
|
||||
.B \-precision\ 12
|
||||
implies
|
||||
.B \-optimize
|
||||
unless
|
||||
.B \-arithmetic
|
||||
is also specified.
|
||||
.TP
|
||||
.BI \-lossless " psv[,Pt]"
|
||||
Create a lossless JPEG file using the specified predictor selection value
|
||||
(1 through 7) and optional point transform (0 through
|
||||
.nh
|
||||
.I precision
|
||||
.hy
|
||||
- 1, where
|
||||
.nh
|
||||
.I precision
|
||||
.hy
|
||||
is the JPEG data precision in bits). A point transform value of 0 (the
|
||||
default) is necessary in order to create a fully lossless JPEG file. (A
|
||||
non-zero point transform value right-shifts the input samples by the specified
|
||||
number of bits, which is effectively a form of lossy color quantization.)
|
||||
.B Caution:
|
||||
lossless JPEG is not yet widely implemented, so many decoders will be unable to
|
||||
handle a lossless JPEG file at all. In most cases, compressing and
|
||||
decompressing a lossless JPEG file is considerably slower than compressing and
|
||||
decompressing a lossy JPEG file, and lossless JPEG files are much larger than
|
||||
lossy JPEG files. Also note that the following features will be unavailable
|
||||
when compressing or decompressing a lossless JPEG file:
|
||||
.IP
|
||||
- Quality/quantization table selection
|
||||
.IP
|
||||
- Color space conversion (the JPEG image will use the same color space as the
|
||||
input image)
|
||||
.IP
|
||||
- Color quantization
|
||||
.IP
|
||||
- DCT/IDCT algorithm selection
|
||||
.IP
|
||||
- Smoothing
|
||||
.IP
|
||||
- Downsampling/upsampling
|
||||
.IP
|
||||
- IDCT scaling
|
||||
.IP
|
||||
- Partial image decompression
|
||||
.IP
|
||||
- Transformations using
|
||||
.B jpegtran
|
||||
.IP
|
||||
Any switches used to enable or configure those features will be ignored.
|
||||
.TP
|
||||
.B \-arithmetic
|
||||
Use arithmetic coding.
|
||||
.B Caution:
|
||||
arithmetic-coded JPEG is not yet widely implemented, so many decoders will be
|
||||
unable to handle an arithmetic-coded JPEG file at all.
|
||||
.TP
|
||||
.B \-dct int
|
||||
Use accurate integer DCT method (default).
|
||||
.TP
|
||||
.B \-dct fast
|
||||
Use less accurate integer DCT method [legacy feature].
|
||||
When the Independent JPEG Group's software was first released in 1991, the
|
||||
compression time for a 1-megapixel JPEG image on a mainstream PC was measured
|
||||
in minutes. Thus, the \fBfast\fR integer DCT algorithm provided noticeable
|
||||
performance benefits. On modern CPUs running libjpeg-turbo, however, the
|
||||
compression time for a 1-megapixel JPEG image is measured in milliseconds, and
|
||||
thus the performance benefits of the \fBfast\fR algorithm are much less
|
||||
noticeable. On modern x86/x86-64 CPUs that support AVX2 instructions, the
|
||||
\fBfast\fR and \fBint\fR methods have similar performance. On other types of
|
||||
CPUs, the \fBfast\fR method is generally about 5-15% faster than the \fBint\fR
|
||||
method.
|
||||
|
||||
For quality levels of 90 and below, there should be little or no perceptible
|
||||
quality difference between the two algorithms. For quality levels above 90,
|
||||
however, the difference between the \fBfast\fR and \fBint\fR methods becomes
|
||||
more pronounced. With quality=97, for instance, the \fBfast\fR method incurs
|
||||
generally about a 1-3 dB loss in PSNR relative to the \fBint\fR method, but
|
||||
this can be larger for some images. Do not use the \fBfast\fR method with
|
||||
quality levels above 97. The algorithm often degenerates at quality=98 and
|
||||
above and can actually produce a more lossy image than if lower quality levels
|
||||
had been used. Also, in libjpeg-turbo, the \fBfast\fR method is not fully
|
||||
accelerated for quality levels above 97, so it will be slower than the
|
||||
\fBint\fR method.
|
||||
.TP
|
||||
.B \-dct float
|
||||
Use floating-point DCT method [legacy feature].
|
||||
The \fBfloat\fR method does not produce significantly more accurate results
|
||||
than the \fBint\fR method, and it is much slower. The \fBfloat\fR method may
|
||||
also give different results on different machines due to varying roundoff
|
||||
behavior, whereas the integer methods should give the same results on all
|
||||
machines.
|
||||
.TP
|
||||
.BI \-icc " file"
|
||||
Embed ICC color management profile contained in the specified file.
|
||||
.TP
|
||||
.BI \-restart " N"
|
||||
Emit a JPEG restart marker every N MCU rows, or every N MCUs if "B" is attached
|
||||
to the number.
|
||||
.IP
|
||||
In typical JPEG images, an MCU (Minimum Coded Unit) is the minimum set of
|
||||
interleaved "data units" (8x8 DCT blocks if the image is lossy or samples if
|
||||
the image is lossless) necessary to represent at least one data unit per
|
||||
component. (For example, an MCU in an interleaved lossy JPEG image that uses
|
||||
4:2:2 subsampling consists of two luminance blocks followed by one block for
|
||||
each chrominance component.) In single-component or non-interleaved JPEG
|
||||
images, an MCU is the same as a data unit. An MCU row is a row of MCUs
|
||||
spanning the entire width of the image.
|
||||
.IP
|
||||
.B \-restart 0
|
||||
(the default) means no restart markers.
|
||||
.TP
|
||||
.BI \-smooth " N"
|
||||
Smooth the input image to eliminate dithering noise. N, ranging from 1 to
|
||||
100, indicates the strength of smoothing. 0 (the default) means no smoothing.
|
||||
.TP
|
||||
.BI \-maxmemory " N"
|
||||
Set limit for amount of memory to use in processing large images. Value is
|
||||
in thousands of bytes, or millions of bytes if "M" is attached to the
|
||||
number. For example,
|
||||
.B \-max 4m
|
||||
selects 4000000 bytes. If more space is needed, an error will occur.
|
||||
selects 4000000 bytes. If more space is needed, temporary files will be used.
|
||||
.TP
|
||||
.BI \-outfile " name"
|
||||
Send output image to the named file, not to standard output.
|
||||
.BI \-restart " N"
|
||||
Emit a JPEG restart marker every N MCU rows, or every N MCU blocks if "B" is
|
||||
attached to the number.
|
||||
.B \-restart 0
|
||||
(the default) means no restart markers.
|
||||
.TP
|
||||
.BI \-memdst
|
||||
Compress to memory instead of a file. This feature was implemented mainly as a
|
||||
way of testing the in-memory destination manager (jpeg_mem_dest()), but it is
|
||||
also useful for benchmarking, since it reduces the I/O overhead.
|
||||
.TP
|
||||
.BI \-report
|
||||
Report compression progress.
|
||||
.TP
|
||||
.BI \-strict
|
||||
Treat all warnings as fatal. Enabling this option will cause the compressor to
|
||||
abort if an LZW-compressed GIF input image contains incomplete or corrupt image
|
||||
data.
|
||||
.BI \-smooth " N"
|
||||
Smooth the input image to eliminate dithering noise. N, ranging from 1 to
|
||||
100, indicates the strength of smoothing. 0 (the default) means no smoothing.
|
||||
.TP
|
||||
.B \-verbose
|
||||
Enable debug printout. More
|
||||
@@ -320,9 +165,6 @@ give more output. Also, version information is printed at startup.
|
||||
.B \-debug
|
||||
Same as
|
||||
.BR \-verbose .
|
||||
.TP
|
||||
.B \-version
|
||||
Print version information and exit.
|
||||
.PP
|
||||
The
|
||||
.B \-restart
|
||||
@@ -338,38 +180,41 @@ for images that will be transmitted across unreliable networks such as Usenet.
|
||||
The
|
||||
.B \-smooth
|
||||
option filters the input to eliminate fine-scale noise. This is often useful
|
||||
when converting dithered images to JPEG: a moderate smoothing factor of 10 to
|
||||
50 gets rid of dithering patterns in the input file, resulting in a smaller
|
||||
JPEG file and a better-looking image. Too large a smoothing factor will
|
||||
visibly blur the image, however.
|
||||
when converting GIF files to JPEG: a moderate smoothing factor of 10 to 50
|
||||
gets rid of dithering patterns in the input file, resulting in a smaller JPEG
|
||||
file and a better-looking image. Too large a smoothing factor will visibly
|
||||
blur the image, however.
|
||||
.PP
|
||||
Switches for wizards:
|
||||
.TP
|
||||
.B \-baseline
|
||||
Force baseline-compatible quantization tables to be generated. This clamps
|
||||
quantization values to 8 bits even at low quality settings. (This switch is
|
||||
poorly named, since it does not ensure that the output is actually baseline
|
||||
JPEG. For example, you can use
|
||||
.B \-baseline
|
||||
and
|
||||
.B \-progressive
|
||||
together.)
|
||||
.B \-arithmetic
|
||||
Use arithmetic coding rather than Huffman coding. (Not currently
|
||||
supported for legal reasons.)
|
||||
.TP
|
||||
.B \-nointerleave
|
||||
Generate noninterleaved JPEG file (not yet supported).
|
||||
.TP
|
||||
.BI \-qtables " file"
|
||||
Use the quantization tables given in the specified text file.
|
||||
.TP
|
||||
.BI \-qslots " N[,...]"
|
||||
Select which quantization table to use for each color component.
|
||||
Use the quantization tables given in the specified file. The file should
|
||||
contain one to four tables (64 values each) as plain text. Comments preceded
|
||||
by '#' may be included in the file. The tables are implicitly numbered
|
||||
0,1,etc. If
|
||||
.B \-quality
|
||||
N is also specified, the values in the file are scaled according to
|
||||
.BR cjpeg 's
|
||||
quality scaling curve.
|
||||
.TP
|
||||
.BI \-sample " HxV[,...]"
|
||||
Set JPEG sampling factors for each color component.
|
||||
.TP
|
||||
.BI \-scans " file"
|
||||
Use the scan script given in the specified text file.
|
||||
Set JPEG sampling factors. If you specify fewer H/V pairs than there are
|
||||
components, the remaining components are set to 1x1 sampling. The default
|
||||
setting is equivalent to \fB\-sample 2x2\fR.
|
||||
.PP
|
||||
The "wizard" switches are intended for experimentation with JPEG. If you
|
||||
don't know what you are doing, \fBdon't use them\fR. These switches are
|
||||
documented further in the file wizard.txt.
|
||||
don't know what you are doing, \fBdon't use them\fR. You can easily produce
|
||||
files with worse image quality and/or poorer compression than you'll get from
|
||||
the default settings. Furthermore, these switches should not be used when
|
||||
making files intended for general use, because not all JPEG implementations
|
||||
will support unusual JPEG parameter settings.
|
||||
.SH EXAMPLES
|
||||
.LP
|
||||
This example compresses the PPM file foo.ppm with a quality factor of
|
||||
@@ -379,36 +224,6 @@ This example compresses the PPM file foo.ppm with a quality factor of
|
||||
.I 60 foo.ppm
|
||||
.B >
|
||||
.I foo.jpg
|
||||
.SH HINTS
|
||||
Color GIF files are not the ideal input for JPEG; JPEG is really intended for
|
||||
compressing full-color (24-bit through 48-bit) images. In particular, don't
|
||||
try to convert cartoons, line drawings, and other images that have only a few
|
||||
distinct colors. GIF works great on these; JPEG does not. If you want to
|
||||
convert a GIF to JPEG, you should experiment with
|
||||
.BR cjpeg 's
|
||||
.B \-quality
|
||||
and
|
||||
.B \-smooth
|
||||
options to get a satisfactory conversion.
|
||||
.B \-smooth 10
|
||||
or so is often helpful.
|
||||
.PP
|
||||
Avoid running an image through a series of JPEG compression/decompression
|
||||
cycles. Image quality loss will accumulate; after ten or so cycles the image
|
||||
may be noticeably worse than it was after one cycle. It's best to use a
|
||||
lossless format while manipulating an image, then convert to JPEG format when
|
||||
you are ready to file the image away.
|
||||
.PP
|
||||
The
|
||||
.B \-optimize
|
||||
option to
|
||||
.B cjpeg
|
||||
is worth using when you are making a "final" version for posting or archiving.
|
||||
It's also a win when you are using low quality settings to make very small
|
||||
JPEG files; the percentage improvement is often a lot more than it is on
|
||||
larger files. (At present,
|
||||
.B \-optimize
|
||||
mode is always selected when generating progressive JPEG files.)
|
||||
.SH ENVIRONMENT
|
||||
.TP
|
||||
.B JPEGMEM
|
||||
@@ -421,10 +236,7 @@ overrides the default value specified when the program was compiled, and
|
||||
itself is overridden by an explicit
|
||||
.BR \-maxmemory .
|
||||
.SH SEE ALSO
|
||||
.BR djpeg (1),
|
||||
.BR jpegtran (1),
|
||||
.BR rdjpgcom (1),
|
||||
.BR wrjpgcom (1)
|
||||
.BR djpeg (1)
|
||||
.br
|
||||
.BR ppm (5),
|
||||
.BR pgm (5)
|
||||
@@ -433,9 +245,14 @@ Wallace, Gregory K. "The JPEG Still Picture Compression Standard",
|
||||
Communications of the ACM, April 1991 (vol. 34, no. 4), pp. 30-44.
|
||||
.SH AUTHOR
|
||||
Independent JPEG Group
|
||||
.SH BUGS
|
||||
Arithmetic coding and interleaved output not yet supported.
|
||||
.PP
|
||||
This file was modified by The libjpeg-turbo Project to include only information
|
||||
relevant to libjpeg-turbo, to wordsmith certain sections, and to describe
|
||||
features not present in libjpeg.
|
||||
.SH ISSUES
|
||||
Not all variants of BMP and Targa file formats are supported.
|
||||
Not all variants of Targa file format are supported.
|
||||
.PP
|
||||
The
|
||||
.B -targa
|
||||
switch is not a bug, it's a feature. (It would be a bug if the Targa format
|
||||
designers had not been clueless.)
|
||||
.PP
|
||||
Still not as fast as we'd like.
|
||||
|
||||
404
ckconfig.c
Normal file
@@ -0,0 +1,404 @@
|
||||
/*
|
||||
* ckconfig.c
|
||||
*
|
||||
* Copyright (C) 1991, 1992, Thomas G. Lane.
|
||||
* This file is part of the Independent JPEG Group's software.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This program is intended to help you determine how to configure the JPEG
|
||||
* software for installation on a particular system. The idea is to try to
|
||||
* compile and execute this program. If your compiler fails to compile the
|
||||
* program, make changes as indicated in the comments below. Once you can
|
||||
* compile the program, run it, and it will tell you how to set the various
|
||||
* switches in jconfig.h and in your Makefile.
|
||||
*
|
||||
* This could all be done automatically if we could assume we were on a Unix
|
||||
* system, but we don't want to assume that, so you'll have to edit and
|
||||
* recompile this program until it works.
|
||||
*
|
||||
* As a general rule, each time you try to compile this program,
|
||||
* pay attention only to the *first* error message you get from the compiler.
|
||||
* Many C compilers will issue lots of spurious error messages once they
|
||||
* have gotten confused. Go to the line indicated in the first error message,
|
||||
* and read the comments preceding that line to see what to change.
|
||||
*
|
||||
* Almost all of the edits you may need to make to this program consist of
|
||||
* changing a line that reads "#define SOME_SYMBOL" to "#undef SOME_SYMBOL",
|
||||
* or vice versa. This is called defining or undefining that symbol.
|
||||
*/
|
||||
|
||||
|
||||
/* First we must see if your system has the include files we need.
|
||||
* We start out with the assumption that your system follows the ANSI
|
||||
* conventions for include files. If you get any error in the next dozen
|
||||
* lines, undefine INCLUDES_ARE_ANSI.
|
||||
*/
|
||||
|
||||
#define INCLUDES_ARE_ANSI /* replace 'define' by 'undef' if error here */
|
||||
|
||||
#ifdef INCLUDES_ARE_ANSI /* this will be skipped if you undef... */
|
||||
#include <stdio.h> /* If you ain't got this, you ain't got C. */
|
||||
#ifdef __SASC /* Amiga SAS C provides size_t in stddef.h. */
|
||||
#include <stddef.h> /* (They are wrong...) */
|
||||
#endif
|
||||
#include <string.h> /* size_t might be here too. */
|
||||
typedef size_t my_size_t; /* The payoff: do we have size_t now? */
|
||||
#include <stdlib.h> /* Check other ANSI includes we use. */
|
||||
#endif
|
||||
|
||||
|
||||
/* If your system doesn't follow the ANSI conventions, we have to figure out
|
||||
* what it does follow. If you didn't get an error before this line, you can
|
||||
* ignore everything down to "#define HAVE_ANSI_DEFINITIONS".
|
||||
*/
|
||||
|
||||
#ifndef INCLUDES_ARE_ANSI /* skip these tests if INCLUDES_ARE_ANSI */
|
||||
|
||||
#include <stdio.h> /* If you ain't got this, you ain't got C. */
|
||||
|
||||
/* jinclude.h will try to include <sys/types.h> if you don't set
|
||||
* INCLUDES_ARE_ANSI. We need to test whether that include file is provided.
|
||||
* If you get an error here, undefine HAVE_TYPES_H.
|
||||
*/
|
||||
|
||||
#define HAVE_TYPES_H
|
||||
|
||||
#ifdef HAVE_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
|
||||
/* We have to see if your string functions are defined by
|
||||
* strings.h (BSD convention) or string.h (everybody else).
|
||||
* We try the non-BSD convention first; define BSD if the compiler
|
||||
* says it can't find string.h.
|
||||
*/
|
||||
|
||||
#undef BSD
|
||||
|
||||
#ifdef BSD
|
||||
#include <strings.h>
|
||||
#else
|
||||
#include <string.h>
|
||||
#endif
|
||||
|
||||
/* Usually size_t is defined in stdio.h, sys/types.h, and/or string.h.
|
||||
* If not, you'll get an error on the "typedef size_t my_size_t;" line below.
|
||||
* In that case, you'll have to search through your system library to
|
||||
* figure out which include file defines "size_t". Look for a line that
|
||||
* says "typedef something-or-other size_t;" (stddef.h and stdlib.h are
|
||||
* good places to look first). Then, change the line below that says
|
||||
* "#include <someincludefile.h>" to instead include the file
|
||||
* you found size_t in, and define NEED_SPECIAL_INCLUDE.
|
||||
*/
|
||||
|
||||
#undef NEED_SPECIAL_INCLUDE /* assume we DON'T need it, for starters */
|
||||
|
||||
#ifdef NEED_SPECIAL_INCLUDE
|
||||
#include <someincludefile.h>
|
||||
#endif
|
||||
|
||||
typedef size_t my_size_t; /* The payoff: do we have size_t now? */
|
||||
|
||||
|
||||
#endif /* INCLUDES_ARE_ANSI */
|
||||
|
||||
|
||||
|
||||
/* The next question is whether your compiler supports ANSI-style function
|
||||
* definitions. You need to know this in order to choose between using
|
||||
* makefile.ansi and using makefile.unix.
|
||||
* The #define line below is set to assume you have ANSI function definitions.
|
||||
* If you get an error in this group of lines, undefine HAVE_ANSI_DEFINITIONS.
|
||||
*/
|
||||
|
||||
#define HAVE_ANSI_DEFINITIONS
|
||||
|
||||
#ifdef HAVE_ANSI_DEFINITIONS
|
||||
int testfunction (int arg1, int * arg2); /* check prototypes */
|
||||
|
||||
struct methods_struct { /* check method-pointer declarations */
|
||||
int (*error_exit) (char *msgtext);
|
||||
int (*trace_message) (char *msgtext);
|
||||
int (*another_method) (void);
|
||||
};
|
||||
|
||||
int testfunction (int arg1, int * arg2) /* check definitions */
|
||||
{
|
||||
return arg2[arg1];
|
||||
}
|
||||
|
||||
int testfunction1 (void) /* check void arg list */
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/* Now we want to find out if your compiler knows what "unsigned char" means.
|
||||
* If you get an error on the "unsigned char un_char;" line,
|
||||
* then undefine HAVE_UNSIGNED_CHAR.
|
||||
*/
|
||||
|
||||
#define HAVE_UNSIGNED_CHAR
|
||||
|
||||
#ifdef HAVE_UNSIGNED_CHAR
|
||||
unsigned char un_char;
|
||||
#endif
|
||||
|
||||
|
||||
/* Now we want to find out if your compiler knows what "unsigned short" means.
|
||||
* If you get an error on the "unsigned short un_short;" line,
|
||||
* then undefine HAVE_UNSIGNED_SHORT.
|
||||
*/
|
||||
|
||||
#define HAVE_UNSIGNED_SHORT
|
||||
|
||||
#ifdef HAVE_UNSIGNED_SHORT
|
||||
unsigned short un_short;
|
||||
#endif
|
||||
|
||||
|
||||
/* Now we want to find out if your compiler understands type "void".
|
||||
* If you get an error anywhere in here, undefine HAVE_VOID.
|
||||
*/
|
||||
|
||||
#define HAVE_VOID
|
||||
|
||||
#ifdef HAVE_VOID
|
||||
typedef void * void_ptr; /* check void * */
|
||||
typedef void (*void_func) (); /* check ptr to function returning void */
|
||||
|
||||
void testfunction2 (arg1, arg2) /* check void function result */
|
||||
void_ptr arg1;
|
||||
void_func arg2;
|
||||
{
|
||||
char * locptr = (char *) arg1; /* check casting to and from void * */
|
||||
arg1 = (void *) locptr;
|
||||
(*arg2) (1, 2); /* check call of fcn returning void */
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/* Now we want to find out if your compiler knows what "const" means.
|
||||
* If you get an error here, undefine HAVE_CONST.
|
||||
*/
|
||||
|
||||
#define HAVE_CONST
|
||||
|
||||
#ifdef HAVE_CONST
|
||||
static const int carray[3] = {1, 2, 3};
|
||||
|
||||
int testfunction3 (arg1)
|
||||
const int arg1;
|
||||
{
|
||||
return carray[arg1];
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/************************************************************************
|
||||
* OK, that's it. You should not have to change anything beyond this
|
||||
* point in order to compile and execute this program. (You might get
|
||||
* some warnings, but you can ignore them.)
|
||||
* When you run the program, it will make a couple more tests that it
|
||||
* can do automatically, and then it will print out a summary of the changes
|
||||
* that you need to make to the makefile and jconfig.h.
|
||||
************************************************************************
|
||||
*/
|
||||
|
||||
|
||||
static int any_changes = 0;
|
||||
|
||||
int new_change ()
|
||||
{
|
||||
if (! any_changes) {
|
||||
printf("\nMost of the changes recommended by this program can be made either\n");
|
||||
printf("by editing jconfig.h, or by adding -Dsymbol switches to the CFLAGS\n");
|
||||
printf("line in your Makefile. (Some PC compilers expect /Dsymbol instead.)\n");
|
||||
printf("The CFLAGS method is simpler, but if your compiler doesn't support -D,\n");
|
||||
printf("then you must change jconfig.h. Also, it's best to change jconfig.h\n");
|
||||
printf("if you plan to use the JPEG software as a library for other programs.\n");
|
||||
any_changes = 1;
|
||||
}
|
||||
printf("\n"); /* blank line before each problem report */
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int test_char_sign (arg)
|
||||
int arg;
|
||||
{
|
||||
if (arg == 189) { /* expected result for unsigned char */
|
||||
new_change();
|
||||
printf("You should add -DCHAR_IS_UNSIGNED to CFLAGS,\n");
|
||||
printf("or else remove the /* */ comment marks from the line\n");
|
||||
printf("/* #define CHAR_IS_UNSIGNED */ in jconfig.h.\n");
|
||||
printf("(Be sure to delete the space before the # character too.)\n");
|
||||
}
|
||||
else if (arg != -67) { /* expected result for signed char */
|
||||
new_change();
|
||||
printf("Hmm, it seems 'char' is less than eight bits wide on your machine.\n");
|
||||
printf("I fear the JPEG software will not work at all.\n");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int test_shifting (arg)
|
||||
long arg;
|
||||
/* See whether right-shift on a long is signed or not. */
|
||||
{
|
||||
long res = arg >> 4;
|
||||
|
||||
if (res == 0x80817F4L) { /* expected result for unsigned */
|
||||
new_change();
|
||||
printf("You must add -DRIGHT_SHIFT_IS_UNSIGNED to CFLAGS,\n");
|
||||
printf("or else remove the /* */ comment marks from the line\n");
|
||||
printf("/* #define RIGHT_SHIFT_IS_UNSIGNED */ in jconfig.h.\n");
|
||||
}
|
||||
else if (res != -0x7F7E80CL) { /* expected result for signed */
|
||||
new_change();
|
||||
printf("Right shift isn't acting as I expect it to.\n");
|
||||
printf("I fear the JPEG software will not work at all.\n");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int main (argc, argv)
|
||||
int argc;
|
||||
char ** argv;
|
||||
{
|
||||
char signed_char_check = (char) (-67);
|
||||
|
||||
printf("Results of configuration check for Independent JPEG Group's software:\n");
|
||||
printf("\nIf there's not a specific makefile provided for your compiler,\n");
|
||||
#ifdef HAVE_ANSI_DEFINITIONS
|
||||
printf("you should use makefile.ansi as the starting point for your Makefile.\n");
|
||||
#else
|
||||
printf("you should use makefile.unix as the starting point for your Makefile.\n");
|
||||
#endif
|
||||
|
||||
/* Check whether we have all the ANSI features, */
|
||||
/* and whether this agrees with __STDC__ being predefined. */
|
||||
#ifdef __STDC__
|
||||
#define HAVE_STDC /* ANSI compilers won't allow redefining __STDC__ */
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_ANSI_DEFINITIONS
|
||||
#ifdef HAVE_UNSIGNED_CHAR
|
||||
#ifdef HAVE_UNSIGNED_SHORT
|
||||
#ifdef HAVE_CONST
|
||||
#define HAVE_ALL_ANSI_FEATURES
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_ALL_ANSI_FEATURES
|
||||
#ifndef HAVE_STDC
|
||||
new_change();
|
||||
printf("Your compiler doesn't claim to be ANSI-compliant, but it is close enough\n");
|
||||
printf("for me. Either add -DHAVE_STDC to CFLAGS, or add #define HAVE_STDC at the\n");
|
||||
printf("beginning of jconfig.h.\n");
|
||||
#define HAVE_STDC
|
||||
#endif
|
||||
#else /* !HAVE_ALL_ANSI_FEATURES */
|
||||
#ifdef HAVE_STDC
|
||||
new_change();
|
||||
printf("Your compiler claims to be ANSI-compliant, but it is lying!\n");
|
||||
printf("Delete the line #define HAVE_STDC near the beginning of jconfig.h.\n");
|
||||
#undef HAVE_STDC
|
||||
#endif
|
||||
#endif /* HAVE_ALL_ANSI_FEATURES */
|
||||
|
||||
#ifndef HAVE_STDC
|
||||
|
||||
#ifdef HAVE_ANSI_DEFINITIONS
|
||||
new_change();
|
||||
printf("You should add -DPROTO to CFLAGS, or else take out the several\n");
|
||||
printf("#ifdef/#else/#endif lines surrounding #define PROTO in jconfig.h.\n");
|
||||
printf("(Leave only one #define PROTO line.)\n");
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_UNSIGNED_CHAR
|
||||
#ifdef HAVE_UNSIGNED_SHORT
|
||||
new_change();
|
||||
printf("You should add -DHAVE_UNSIGNED_CHAR and -DHAVE_UNSIGNED_SHORT\n");
|
||||
printf("to CFLAGS, or else take out the #ifdef HAVE_STDC/#endif lines\n");
|
||||
printf("surrounding #define HAVE_UNSIGNED_CHAR and #define HAVE_UNSIGNED_SHORT\n");
|
||||
printf("in jconfig.h.\n");
|
||||
#else /* only unsigned char */
|
||||
new_change();
|
||||
printf("You should add -DHAVE_UNSIGNED_CHAR to CFLAGS,\n");
|
||||
printf("or else move #define HAVE_UNSIGNED_CHAR outside the\n");
|
||||
printf("#ifdef HAVE_STDC/#endif lines surrounding it in jconfig.h.\n");
|
||||
#endif
|
||||
#else /* !HAVE_UNSIGNED_CHAR */
|
||||
#ifdef HAVE_UNSIGNED_SHORT
|
||||
new_change();
|
||||
printf("You should add -DHAVE_UNSIGNED_SHORT to CFLAGS,\n");
|
||||
printf("or else move #define HAVE_UNSIGNED_SHORT outside the\n");
|
||||
printf("#ifdef HAVE_STDC/#endif lines surrounding it in jconfig.h.\n");
|
||||
#endif
|
||||
#endif /* HAVE_UNSIGNED_CHAR */
|
||||
|
||||
#ifdef HAVE_CONST
|
||||
new_change();
|
||||
printf("You should delete the #define const line from jconfig.h.\n");
|
||||
#endif
|
||||
|
||||
#endif /* HAVE_STDC */
|
||||
|
||||
test_char_sign((int) signed_char_check);
|
||||
|
||||
test_shifting(-0x7F7E80B1L);
|
||||
|
||||
#ifndef HAVE_VOID
|
||||
new_change();
|
||||
printf("You should add -Dvoid=char to CFLAGS,\n");
|
||||
printf("or else remove the /* */ comment marks from the line\n");
|
||||
printf("/* #define void char */ in jconfig.h.\n");
|
||||
printf("(Be sure to delete the space before the # character too.)\n");
|
||||
#endif
|
||||
|
||||
#ifdef INCLUDES_ARE_ANSI
|
||||
#ifndef __STDC__
|
||||
new_change();
|
||||
printf("You should add -DINCLUDES_ARE_ANSI to CFLAGS, or else add\n");
|
||||
printf("#define INCLUDES_ARE_ANSI at the beginning of jinclude.h (NOT jconfig.h).\n");
|
||||
#endif
|
||||
#else /* !INCLUDES_ARE_ANSI */
|
||||
#ifdef __STDC__
|
||||
new_change();
|
||||
printf("You should add -DNONANSI_INCLUDES to CFLAGS, or else add\n");
|
||||
printf("#define NONANSI_INCLUDES at the beginning of jinclude.h (NOT jconfig.h).\n");
|
||||
#endif
|
||||
#ifdef NEED_SPECIAL_INCLUDE
|
||||
new_change();
|
||||
printf("In jinclude.h, change the line reading #include <sys/types.h>\n");
|
||||
printf("to instead include the file you found size_t in.\n");
|
||||
#else /* !NEED_SPECIAL_INCLUDE */
|
||||
#ifndef HAVE_TYPES_H
|
||||
new_change();
|
||||
printf("In jinclude.h, delete the line reading #include <sys/types.h>.\n");
|
||||
#endif
|
||||
#endif /* NEED_SPECIAL_INCLUDE */
|
||||
#ifdef BSD
|
||||
new_change();
|
||||
printf("You should add -DBSD to CFLAGS, or else add\n");
|
||||
printf("#define BSD at the beginning of jinclude.h (NOT jconfig.h).\n");
|
||||
#endif
|
||||
#endif /* INCLUDES_ARE_ANSI */
|
||||
|
||||
if (any_changes) {
|
||||
printf("\nI think that's everything...\n");
|
||||
} else {
|
||||
printf("\nI think jconfig.h is OK as distributed.\n");
|
||||
}
|
||||
|
||||
return any_changes;
|
||||
}
|
||||
@@ -1,176 +0,0 @@
|
||||
# This file is included from the top-level CMakeLists.txt. We just store it
|
||||
# here to avoid cluttering up that file.
|
||||
|
||||
###############################################################################
|
||||
# Linux RPM and DEB
|
||||
###############################################################################
|
||||
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
|
||||
set(RPMARCH ${CMAKE_SYSTEM_PROCESSOR})
|
||||
if(CPU_TYPE STREQUAL "x86_64")
|
||||
set(DEBARCH amd64)
|
||||
elseif(CPU_TYPE STREQUAL "arm64")
|
||||
set(DEBARCH ${CPU_TYPE})
|
||||
elseif(CPU_TYPE STREQUAL "arm")
|
||||
check_c_source_compiles("
|
||||
#if __ARM_PCS_VFP != 1
|
||||
#error \"float ABI != hard\"
|
||||
#endif
|
||||
int main(void) { return 0; }" HAVE_HARD_FLOAT)
|
||||
if(HAVE_HARD_FLOAT)
|
||||
set(RPMARCH armv7hl)
|
||||
set(DEBARCH armhf)
|
||||
else()
|
||||
set(RPMARCH armel)
|
||||
set(DEBARCH armel)
|
||||
endif()
|
||||
elseif(CMAKE_SYSTEM_PROCESSOR_LC STREQUAL "ppc64le")
|
||||
set(DEBARCH ppc64el)
|
||||
elseif(CPU_TYPE STREQUAL "powerpc" AND BITS EQUAL 32)
|
||||
set(RPMARCH ppc)
|
||||
set(DEBARCH ppc)
|
||||
else()
|
||||
set(DEBARCH ${CMAKE_SYSTEM_PROCESSOR})
|
||||
endif()
|
||||
message(STATUS "RPM architecture = ${RPMARCH}, DEB architecture = ${DEBARCH}")
|
||||
|
||||
# Re-set CMAKE_POSITION_INDEPENDENT_CODE so that the RPM spec file works
|
||||
# properly
|
||||
boolean_number(CMAKE_POSITION_INDEPENDENT_CODE)
|
||||
|
||||
configure_file(release/makerpm.in pkgscripts/makerpm)
|
||||
configure_file(release/rpm.spec.in pkgscripts/rpm.spec @ONLY)
|
||||
|
||||
add_custom_target(rpm pkgscripts/makerpm
|
||||
SOURCES pkgscripts/makerpm)
|
||||
|
||||
configure_file(release/makesrpm.in pkgscripts/makesrpm)
|
||||
|
||||
add_custom_target(srpm pkgscripts/makesrpm
|
||||
SOURCES pkgscripts/makesrpm
|
||||
DEPENDS dist)
|
||||
|
||||
configure_file(release/makedpkg.in pkgscripts/makedpkg)
|
||||
configure_file(release/deb-control.in pkgscripts/deb-control)
|
||||
|
||||
add_custom_target(deb pkgscripts/makedpkg
|
||||
SOURCES pkgscripts/makedpkg)
|
||||
|
||||
endif() # Linux
|
||||
|
||||
|
||||
###############################################################################
|
||||
# Windows installer (NullSoft Installer)
|
||||
###############################################################################
|
||||
|
||||
if(WIN32)
|
||||
|
||||
if(MSVC_LIKE)
|
||||
set(INST_PLATFORM "Visual C++")
|
||||
set(INST_ID vc)
|
||||
set(INST_NAME ${CMAKE_PROJECT_NAME}-${VERSION}-${INST_ID})
|
||||
set(INST_REG_NAME ${CMAKE_PROJECT_NAME})
|
||||
elseif(MINGW)
|
||||
set(INST_PLATFORM GCC)
|
||||
set(INST_ID gcc)
|
||||
set(INST_NAME ${CMAKE_PROJECT_NAME}-${VERSION}-${INST_ID})
|
||||
set(INST_REG_NAME ${CMAKE_PROJECT_NAME}-${INST_ID})
|
||||
set(INST_DEFS -DGCC)
|
||||
endif()
|
||||
|
||||
if(BITS EQUAL 64)
|
||||
set(INST_PLATFORM "${INST_PLATFORM} 64-bit")
|
||||
set(INST_NAME ${INST_NAME}64)
|
||||
set(INST_REG_NAME ${INST_REG_NAME}64)
|
||||
set(INST_DEFS ${INST_DEFS} -DWIN64)
|
||||
endif()
|
||||
|
||||
if(WITH_JAVA)
|
||||
set(INST_DEFS ${INST_DEFS} -DJAVA)
|
||||
endif()
|
||||
|
||||
if(GENERATOR_IS_MULTI_CONFIG)
|
||||
set(INST_DEFS ${INST_DEFS} "-DBUILDDIR=${CMAKE_CFG_INTDIR}\\")
|
||||
else()
|
||||
set(INST_DEFS ${INST_DEFS} "-DBUILDDIR=")
|
||||
endif()
|
||||
|
||||
string(REGEX REPLACE "/" "\\\\" INST_DIR ${CMAKE_INSTALL_PREFIX})
|
||||
|
||||
configure_file(release/installer.nsi.in installer.nsi @ONLY)
|
||||
# TODO: It would be nice to eventually switch to CPack and eliminate this mess,
|
||||
# but not today.
|
||||
configure_file(win/projectTargets.cmake.in
|
||||
win/${CMAKE_PROJECT_NAME}Targets.cmake @ONLY)
|
||||
configure_file(win/${INST_ID}/projectTargets-release.cmake.in
|
||||
win/${CMAKE_PROJECT_NAME}Targets-release.cmake @ONLY)
|
||||
|
||||
if(WITH_JAVA)
|
||||
set(JAVA_DEPEND turbojpeg-java)
|
||||
endif()
|
||||
if(WITH_TURBOJPEG)
|
||||
set(TURBOJPEG_DEPEND turbojpeg turbojpeg-static tjbench)
|
||||
endif()
|
||||
add_custom_target(installer
|
||||
makensis -nocd ${INST_DEFS} installer.nsi
|
||||
DEPENDS jpeg jpeg-static rdjpgcom wrjpgcom cjpeg djpeg jpegtran
|
||||
${JAVA_DEPEND} ${TURBOJPEG_DEPEND}
|
||||
SOURCES installer.nsi)
|
||||
|
||||
endif() # WIN32
|
||||
|
||||
|
||||
###############################################################################
|
||||
# Mac DMG
|
||||
###############################################################################
|
||||
|
||||
if(APPLE)
|
||||
|
||||
set(SECONDARY_BUILD "" CACHE PATH
|
||||
"Directory containing cross-compiled x86-64 or Armv8 (64-bit) iOS or macOS build to include in universal binaries")
|
||||
|
||||
set(MACOS_APP_CERT_NAME "" CACHE STRING
|
||||
"Name of the Developer ID Application certificate (in the macOS keychain) that should be used to sign the libjpeg-turbo DMG. Leave this blank to generate an unsigned DMG.")
|
||||
set(MACOS_INST_CERT_NAME "" CACHE STRING
|
||||
"Name of the Developer ID Installer certificate (in the macOS keychain) that should be used to sign the libjpeg-turbo installer package. Leave this blank to generate an unsigned package.")
|
||||
|
||||
configure_file(release/makemacpkg.in pkgscripts/makemacpkg)
|
||||
configure_file(release/Distribution.xml.in pkgscripts/Distribution.xml)
|
||||
configure_file(release/Welcome.rtf.in pkgscripts/Welcome.rtf)
|
||||
configure_file(release/uninstall.in pkgscripts/uninstall)
|
||||
|
||||
add_custom_target(dmg pkgscripts/makemacpkg
|
||||
SOURCES pkgscripts/makemacpkg)
|
||||
|
||||
endif() # APPLE
|
||||
|
||||
|
||||
###############################################################################
|
||||
# Generic
|
||||
###############################################################################
|
||||
|
||||
add_custom_target(dist
|
||||
COMMAND git archive --prefix=${CMAKE_PROJECT_NAME}-${VERSION}/ HEAD |
|
||||
gzip > ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}-${VERSION}.tar.gz
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
configure_file(release/maketarball.in pkgscripts/maketarball)
|
||||
|
||||
add_custom_target(tarball pkgscripts/maketarball
|
||||
SOURCES pkgscripts/maketarball)
|
||||
|
||||
configure_file(release/libjpeg.pc.in pkgscripts/libjpeg.pc @ONLY)
|
||||
|
||||
if(WITH_TURBOJPEG)
|
||||
configure_file(release/libturbojpeg.pc.in pkgscripts/libturbojpeg.pc @ONLY)
|
||||
endif()
|
||||
|
||||
include(CMakePackageConfigHelpers)
|
||||
write_basic_package_version_file(
|
||||
pkgscripts/${CMAKE_PROJECT_NAME}ConfigVersion.cmake
|
||||
VERSION ${VERSION} COMPATIBILITY AnyNewerVersion)
|
||||
|
||||
configure_package_config_file(release/Config.cmake.in
|
||||
pkgscripts/${CMAKE_PROJECT_NAME}Config.cmake
|
||||
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${CMAKE_PROJECT_NAME})
|
||||
@@ -1,424 +0,0 @@
|
||||
#.rst:
|
||||
# GNUInstallDirs
|
||||
# --------------
|
||||
#
|
||||
# Define GNU standard installation directories
|
||||
#
|
||||
# Provides install directory variables as defined by the
|
||||
# `GNU Coding Standards`_.
|
||||
#
|
||||
# .. _`GNU Coding Standards`: https://www.gnu.org/prep/standards/html_node/Directory-Variables.html
|
||||
#
|
||||
# Result Variables
|
||||
# ^^^^^^^^^^^^^^^^
|
||||
#
|
||||
# Inclusion of this module defines the following variables:
|
||||
#
|
||||
# ``CMAKE_INSTALL_<dir>``
|
||||
#
|
||||
# Destination for files of a given type. This value may be passed to
|
||||
# the ``DESTINATION`` options of :command:`install` commands for the
|
||||
# corresponding file type.
|
||||
#
|
||||
# ``CMAKE_INSTALL_FULL_<dir>``
|
||||
#
|
||||
# The absolute path generated from the corresponding ``CMAKE_INSTALL_<dir>``
|
||||
# value. If the value is not already an absolute path, an absolute path
|
||||
# is constructed typically by prepending the value of the
|
||||
# :variable:`CMAKE_INSTALL_PREFIX` variable. However, there are some
|
||||
# `special cases`_ as documented below.
|
||||
#
|
||||
# where ``<dir>`` is one of:
|
||||
#
|
||||
# ``BINDIR``
|
||||
# user executables (``bin``)
|
||||
# ``SBINDIR``
|
||||
# system admin executables (``sbin``)
|
||||
# ``LIBEXECDIR``
|
||||
# program executables (``libexec``)
|
||||
# ``SYSCONFDIR``
|
||||
# read-only single-machine data (``etc``)
|
||||
# ``SHAREDSTATEDIR``
|
||||
# modifiable architecture-independent data (``com``)
|
||||
# ``LOCALSTATEDIR``
|
||||
# modifiable single-machine data (``var``)
|
||||
# ``LIBDIR``
|
||||
# object code libraries (``lib`` or ``lib64``
|
||||
# or ``lib/<multiarch-tuple>`` on Debian)
|
||||
# ``INCLUDEDIR``
|
||||
# C header files (``include``)
|
||||
# ``OLDINCLUDEDIR``
|
||||
# C header files for non-gcc (``/usr/include``)
|
||||
# ``DATAROOTDIR``
|
||||
# read-only architecture-independent data root (``share``)
|
||||
# ``DATADIR``
|
||||
# read-only architecture-independent data (``DATAROOTDIR``)
|
||||
# ``INFODIR``
|
||||
# info documentation (``DATAROOTDIR/info``)
|
||||
# ``LOCALEDIR``
|
||||
# locale-dependent data (``DATAROOTDIR/locale``)
|
||||
# ``MANDIR``
|
||||
# man documentation (``DATAROOTDIR/man``)
|
||||
# ``DOCDIR``
|
||||
# documentation root (``DATAROOTDIR/doc/PROJECT_NAME``)
|
||||
#
|
||||
# If the includer does not define a value the above-shown default will be
|
||||
# used and the value will appear in the cache for editing by the user.
|
||||
#
|
||||
# Special Cases
|
||||
# ^^^^^^^^^^^^^
|
||||
#
|
||||
# The following values of :variable:`CMAKE_INSTALL_PREFIX` are special:
|
||||
#
|
||||
# ``/``
|
||||
#
|
||||
# For ``<dir>`` other than the ``SYSCONFDIR`` and ``LOCALSTATEDIR``,
|
||||
# the value of ``CMAKE_INSTALL_<dir>`` is prefixed with ``usr/`` if
|
||||
# it is not user-specified as an absolute path. For example, the
|
||||
# ``INCLUDEDIR`` value ``include`` becomes ``usr/include``.
|
||||
# This is required by the `GNU Coding Standards`_, which state:
|
||||
#
|
||||
# When building the complete GNU system, the prefix will be empty
|
||||
# and ``/usr`` will be a symbolic link to ``/``.
|
||||
#
|
||||
# ``/usr``
|
||||
#
|
||||
# For ``<dir>`` equal to ``SYSCONFDIR`` or ``LOCALSTATEDIR``, the
|
||||
# ``CMAKE_INSTALL_FULL_<dir>`` is computed by prepending just ``/``
|
||||
# to the value of ``CMAKE_INSTALL_<dir>`` if it is not user-specified
|
||||
# as an absolute path. For example, the ``SYSCONFDIR`` value ``etc``
|
||||
# becomes ``/etc``. This is required by the `GNU Coding Standards`_.
|
||||
#
|
||||
# ``/opt/...``
|
||||
#
|
||||
# For ``<dir>`` equal to ``SYSCONFDIR`` or ``LOCALSTATEDIR``, the
|
||||
# ``CMAKE_INSTALL_FULL_<dir>`` is computed by *appending* the prefix
|
||||
# to the value of ``CMAKE_INSTALL_<dir>`` if it is not user-specified
|
||||
# as an absolute path. For example, the ``SYSCONFDIR`` value ``etc``
|
||||
# becomes ``/etc/opt/...``. This is defined by the
|
||||
# `Filesystem Hierarchy Standard`_.
|
||||
#
|
||||
# .. _`Filesystem Hierarchy Standard`: https://refspecs.linuxfoundation.org/FHS_3.0/fhs/index.html
|
||||
#
|
||||
# Macros
|
||||
# ^^^^^^
|
||||
#
|
||||
# .. command:: GNUInstallDirs_get_absolute_install_dir
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# GNUInstallDirs_get_absolute_install_dir(absvar var)
|
||||
#
|
||||
# Set the given variable ``absvar`` to the absolute path contained
|
||||
# within the variable ``var``. This is to allow the computation of an
|
||||
# absolute path, accounting for all the special cases documented
|
||||
# above. While this macro is used to compute the various
|
||||
# ``CMAKE_INSTALL_FULL_<dir>`` variables, it is exposed publicly to
|
||||
# allow users who create additional path variables to also compute
|
||||
# absolute paths where necessary, using the same logic.
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2018 Tobias C. Berner
|
||||
# Copyright 2018 Matthias Räncker
|
||||
# Copyright 2016, 2019, 2024 D. R. Commander
|
||||
# Copyright 2016, 2021 Dmitry Marakasov
|
||||
# Copyright 2016 Roger Leigh
|
||||
# Copyright 2015 Alex Turbov
|
||||
# Copyright 2014 Rolf Eike Beer
|
||||
# Copyright 2014 Daniele E. Domenichelli
|
||||
# Copyright 2013 Dimitri John Ledkov
|
||||
# Copyright 2011 Alex Neundorf
|
||||
# Copyright 2011 Eric NOULARD
|
||||
# Copyright 2011, 2013-2015 Kitware, Inc.
|
||||
# Copyright 2011 Nikita Krupen'ko
|
||||
#
|
||||
# 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 names of Kitware, Inc., the Insight Software Consortium,
|
||||
# nor the names of their 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
|
||||
# HOLDER 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.
|
||||
#=============================================================================
|
||||
|
||||
# Installation directories
|
||||
#
|
||||
|
||||
macro(GNUInstallDirs_set_install_dir var docstring)
|
||||
# If CMAKE_INSTALL_PREFIX changes and CMAKE_INSTALL_*DIR is still set to the
|
||||
# default value, then modify it accordingly. This presumes that the default
|
||||
# value may change based on the prefix.
|
||||
|
||||
set(_GNUInstallDirs_CMAKE_INSTALL_FORCE_${var} "")
|
||||
if(NOT DEFINED CMAKE_INSTALL_${var})
|
||||
set(_GNUInstallDirs_CMAKE_INSTALL_DEFAULT_${var} 1 CACHE INTERNAL
|
||||
"CMAKE_INSTALL_${var} has default value")
|
||||
elseif(DEFINED _GNUInstallDirs_CMAKE_INSTALL_LAST_DEFAULT_${var} AND
|
||||
NOT "${_GNUInstallDirs_CMAKE_INSTALL_LAST_DEFAULT_${var}}" STREQUAL
|
||||
"${CMAKE_INSTALL_DEFAULT_${var}}" AND
|
||||
_GNUInstallDirs_CMAKE_INSTALL_DEFAULT_${var} AND
|
||||
"${_GNUInstallDirs_CMAKE_INSTALL_LAST_${var}}" STREQUAL
|
||||
"${CMAKE_INSTALL_${var}}")
|
||||
set(_GNUInstallDirs_CMAKE_INSTALL_FORCE_${var} "FORCE")
|
||||
endif()
|
||||
|
||||
if(DEFINED CMAKE_INSTALL_${var} AND NOT CMAKE_INSTALL_${var} MATCHES "^/")
|
||||
set_property(CACHE CMAKE_INSTALL_${var} PROPERTY TYPE PATH)
|
||||
endif()
|
||||
|
||||
set(CMAKE_INSTALL_${var} "${CMAKE_INSTALL_DEFAULT_${var}}" CACHE PATH
|
||||
"${docstring} (Default: ${CMAKE_INSTALL_DEFAULT_${var}})"
|
||||
${_GNUInstallDirs_CMAKE_INSTALL_FORCE_${var}})
|
||||
|
||||
if(NOT CMAKE_INSTALL_${var} STREQUAL CMAKE_INSTALL_DEFAULT_${var})
|
||||
unset(_GNUInstallDirs_CMAKE_INSTALL_DEFAULT_${var} CACHE)
|
||||
endif()
|
||||
|
||||
# Save for next run
|
||||
set(_GNUInstallDirs_CMAKE_INSTALL_LAST_${var} "${CMAKE_INSTALL_${var}}"
|
||||
CACHE INTERNAL "CMAKE_INSTALL_${var} during last run")
|
||||
set(_GNUInstallDirs_CMAKE_INSTALL_LAST_DEFAULT_${var}
|
||||
"${CMAKE_INSTALL_DEFAULT_${var}}" CACHE INTERNAL
|
||||
"CMAKE_INSTALL_DEFAULT_${var} during last run")
|
||||
endmacro()
|
||||
|
||||
if(NOT DEFINED CMAKE_INSTALL_DEFAULT_BINDIR)
|
||||
set(CMAKE_INSTALL_DEFAULT_BINDIR "bin")
|
||||
endif()
|
||||
GNUInstallDirs_set_install_dir(BINDIR
|
||||
"Directory into which user executables should be installed")
|
||||
|
||||
if(NOT DEFINED CMAKE_INSTALL_DEFAULT_SBINDIR)
|
||||
set(CMAKE_INSTALL_DEFAULT_SBINDIR "sbin")
|
||||
endif()
|
||||
GNUInstallDirs_set_install_dir(SBINDIR
|
||||
"Directory into which system admin executables should be installed")
|
||||
|
||||
if(NOT DEFINED CMAKE_INSTALL_DEFAULT_LIBEXECDIR)
|
||||
set(CMAKE_INSTALL_DEFAULT_LIBEXECDIR "libexec")
|
||||
endif()
|
||||
GNUInstallDirs_set_install_dir(LIBEXECDIR
|
||||
"Directory under which executables run by other programs should be installed")
|
||||
|
||||
if(NOT DEFINED CMAKE_INSTALL_DEFAULT_SYSCONFDIR)
|
||||
set(CMAKE_INSTALL_DEFAULT_SYSCONFDIR "etc")
|
||||
endif()
|
||||
GNUInstallDirs_set_install_dir(SYSCONFDIR
|
||||
"Directory into which machine-specific read-only ASCII data and configuration files should be installed")
|
||||
|
||||
if(NOT DEFINED CMAKE_INSTALL_DEFAULT_SHAREDSTATEDIR)
|
||||
set(CMAKE_INSTALL_DEFAULT_SHAREDSTATEDIR "com")
|
||||
endif()
|
||||
GNUInstallDirs_set_install_dir(SHAREDSTATEDIR
|
||||
"Directory into which architecture-independent run-time-modifiable data files should be installed")
|
||||
|
||||
if(NOT DEFINED CMAKE_INSTALL_DEFAULT_LOCALSTATEDIR)
|
||||
set(CMAKE_INSTALL_DEFAULT_LOCALSTATEDIR "var")
|
||||
endif()
|
||||
GNUInstallDirs_set_install_dir(LOCALSTATEDIR
|
||||
"Directory into which machine-specific run-time-modifiable data files should be installed")
|
||||
|
||||
if(NOT DEFINED CMAKE_INSTALL_DEFAULT_LIBDIR)
|
||||
set(CMAKE_INSTALL_DEFAULT_LIBDIR "lib")
|
||||
# Override this default 'lib' with 'lib64' iff:
|
||||
# - we are on Linux system but NOT cross-compiling
|
||||
# - we are NOT on debian
|
||||
# - we are on a 64 bits system
|
||||
# reason is: amd64 ABI: http://www.x86-64.org/documentation/abi.pdf
|
||||
# For Debian with multiarch, use 'lib/${CMAKE_LIBRARY_ARCHITECTURE}' if
|
||||
# CMAKE_LIBRARY_ARCHITECTURE is set (which contains e.g. "i386-linux-gnu"
|
||||
# and CMAKE_INSTALL_PREFIX is "/usr"
|
||||
# See http://wiki.debian.org/Multiarch
|
||||
if(CMAKE_SYSTEM_NAME MATCHES "^(Linux|kFreeBSD|GNU)$"
|
||||
AND NOT CMAKE_CROSSCOMPILING)
|
||||
if (EXISTS "/etc/debian_version") # is this a debian system ?
|
||||
if(CMAKE_LIBRARY_ARCHITECTURE)
|
||||
if("${CMAKE_INSTALL_PREFIX}" MATCHES "^/usr/?$")
|
||||
set(CMAKE_INSTALL_DEFAULT_LIBDIR "lib/${CMAKE_LIBRARY_ARCHITECTURE}")
|
||||
endif()
|
||||
endif()
|
||||
else() # not debian, rely on CMAKE_SIZEOF_VOID_P:
|
||||
if(NOT DEFINED CMAKE_SIZEOF_VOID_P)
|
||||
message(AUTHOR_WARNING
|
||||
"Unable to determine default CMAKE_INSTALL_LIBDIR directory because no target architecture is known. "
|
||||
"Please enable at least one language before including GNUInstallDirs.")
|
||||
else()
|
||||
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
|
||||
set(CMAKE_INSTALL_DEFAULT_LIBDIR "lib64")
|
||||
elseif(CMAKE_C_COMPILER_ABI MATCHES "ELF X32")
|
||||
set(CMAKE_INSTALL_DEFAULT_LIBDIR "libx32")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
GNUInstallDirs_set_install_dir(LIBDIR
|
||||
"Directory into which object files and object code libraries should be installed")
|
||||
|
||||
if(NOT DEFINED CMAKE_INSTALL_DEFAULT_INCLUDEDIR)
|
||||
set(CMAKE_INSTALL_DEFAULT_INCLUDEDIR "include")
|
||||
endif()
|
||||
GNUInstallDirs_set_install_dir(INCLUDEDIR
|
||||
"Directory into which C header files should be installed")
|
||||
|
||||
if(NOT DEFINED CMAKE_INSTALL_DEFAULT_OLDINCLUDEDIR)
|
||||
set(CMAKE_INSTALL_DEFAULT_OLDINCLUDEDIR "/usr/include")
|
||||
endif()
|
||||
GNUInstallDirs_set_install_dir(OLDINCLUDEDIR
|
||||
PATH "Directory into which C header files for non-GCC compilers should be installed")
|
||||
|
||||
if(NOT DEFINED CMAKE_INSTALL_DEFAULT_DATAROOTDIR)
|
||||
set(CMAKE_INSTALL_DEFAULT_DATAROOTDIR "share")
|
||||
endif()
|
||||
GNUInstallDirs_set_install_dir(DATAROOTDIR
|
||||
"The root of the directory tree for read-only architecture-independent data files")
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Values whose defaults are relative to DATAROOTDIR. Store empty values in
|
||||
# the cache and store the defaults in local variables if the cache values are
|
||||
# not set explicitly. This auto-updates the defaults as DATAROOTDIR changes.
|
||||
|
||||
if(NOT DEFINED CMAKE_INSTALL_DEFAULT_DATADIR)
|
||||
set(CMAKE_INSTALL_DEFAULT_DATADIR "<CMAKE_INSTALL_DATAROOTDIR>")
|
||||
endif()
|
||||
GNUInstallDirs_set_install_dir(DATADIR
|
||||
"The directory under which read-only architecture-independent data files should be installed")
|
||||
|
||||
if(NOT DEFINED CMAKE_INSTALL_DEFAULT_INFODIR)
|
||||
if(CMAKE_SYSTEM_NAME MATCHES "^(([^kF].*)?BSD|DragonFly)$")
|
||||
set(CMAKE_INSTALL_DEFAULT_INFODIR "info")
|
||||
else()
|
||||
set(CMAKE_INSTALL_DEFAULT_INFODIR "<CMAKE_INSTALL_DATAROOTDIR>/info")
|
||||
endif()
|
||||
endif()
|
||||
GNUInstallDirs_set_install_dir(INFODIR
|
||||
"The directory into which info documentation files should be installed")
|
||||
|
||||
if(NOT DEFINED CMAKE_INSTALL_DEFAULT_MANDIR)
|
||||
if(CMAKE_SYSTEM_NAME MATCHES "^(([^k].*)?BSD|DragonFly)$" AND NOT CMAKE_SYSTEM_NAME MATCHES "^(FreeBSD)$")
|
||||
set(CMAKE_INSTALL_DEFAULT_MANDIR "man")
|
||||
else()
|
||||
set(CMAKE_INSTALL_DEFAULT_MANDIR "<CMAKE_INSTALL_DATAROOTDIR>/man")
|
||||
endif()
|
||||
endif()
|
||||
GNUInstallDirs_set_install_dir(MANDIR
|
||||
"The directory under which man pages should be installed")
|
||||
|
||||
if(NOT DEFINED CMAKE_INSTALL_DEFAULT_LOCALEDIR)
|
||||
set(CMAKE_INSTALL_DEFAULT_LOCALEDIR "<CMAKE_INSTALL_DATAROOTDIR>/locale")
|
||||
endif()
|
||||
GNUInstallDirs_set_install_dir(LOCALEDIR
|
||||
"The directory under which locale-specific message catalogs should be installed")
|
||||
|
||||
if(NOT DEFINED CMAKE_INSTALL_DEFAULT_DOCDIR)
|
||||
set(CMAKE_INSTALL_DEFAULT_DOCDIR "<CMAKE_INSTALL_DATAROOTDIR>/doc/${PROJECT_NAME}")
|
||||
endif()
|
||||
GNUInstallDirs_set_install_dir(DOCDIR
|
||||
"The directory into which documentation files (other than info files) should be installed")
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
mark_as_advanced(
|
||||
CMAKE_INSTALL_BINDIR
|
||||
CMAKE_INSTALL_SBINDIR
|
||||
CMAKE_INSTALL_LIBEXECDIR
|
||||
CMAKE_INSTALL_SYSCONFDIR
|
||||
CMAKE_INSTALL_SHAREDSTATEDIR
|
||||
CMAKE_INSTALL_LOCALSTATEDIR
|
||||
CMAKE_INSTALL_LIBDIR
|
||||
CMAKE_INSTALL_INCLUDEDIR
|
||||
CMAKE_INSTALL_OLDINCLUDEDIR
|
||||
CMAKE_INSTALL_DATAROOTDIR
|
||||
CMAKE_INSTALL_DATADIR
|
||||
CMAKE_INSTALL_INFODIR
|
||||
CMAKE_INSTALL_LOCALEDIR
|
||||
CMAKE_INSTALL_MANDIR
|
||||
CMAKE_INSTALL_DOCDIR
|
||||
)
|
||||
|
||||
macro(GNUInstallDirs_get_absolute_install_dir absvar var)
|
||||
string(REGEX REPLACE "[<>]" "@" ${var} "${${var}}")
|
||||
# Handle the specific case of an empty CMAKE_INSTALL_DATAROOTDIR
|
||||
if(NOT CMAKE_INSTALL_DATAROOTDIR AND
|
||||
${var} MATCHES "\@CMAKE_INSTALL_DATAROOTDIR\@/")
|
||||
string(CONFIGURE "${${var}}" ${var} @ONLY)
|
||||
string(REGEX REPLACE "^/" "" ${var} "${${var}}")
|
||||
else()
|
||||
string(CONFIGURE "${${var}}" ${var} @ONLY)
|
||||
endif()
|
||||
if(NOT IS_ABSOLUTE "${${var}}")
|
||||
# Handle special cases:
|
||||
# - CMAKE_INSTALL_PREFIX == /
|
||||
# - CMAKE_INSTALL_PREFIX == /usr
|
||||
# - CMAKE_INSTALL_PREFIX == /opt/...
|
||||
if("${CMAKE_INSTALL_PREFIX}" STREQUAL "/")
|
||||
if("${dir}" STREQUAL "SYSCONFDIR" OR "${dir}" STREQUAL "LOCALSTATEDIR")
|
||||
set(${absvar} "/${${var}}")
|
||||
else()
|
||||
if (NOT "${${var}}" MATCHES "^usr/")
|
||||
set(${var} "usr/${${var}}")
|
||||
endif()
|
||||
set(${absvar} "/${${var}}")
|
||||
endif()
|
||||
elseif("${CMAKE_INSTALL_PREFIX}" MATCHES "^/usr/?$")
|
||||
if("${dir}" STREQUAL "SYSCONFDIR" OR "${dir}" STREQUAL "LOCALSTATEDIR")
|
||||
set(${absvar} "/${${var}}")
|
||||
else()
|
||||
set(${absvar} "${CMAKE_INSTALL_PREFIX}/${${var}}")
|
||||
endif()
|
||||
elseif("${CMAKE_INSTALL_PREFIX}" MATCHES "^/opt/.*")
|
||||
if("${dir}" STREQUAL "SYSCONFDIR" OR "${dir}" STREQUAL "LOCALSTATEDIR")
|
||||
set(${absvar} "/${${var}}${CMAKE_INSTALL_PREFIX}")
|
||||
else()
|
||||
set(${absvar} "${CMAKE_INSTALL_PREFIX}/${${var}}")
|
||||
endif()
|
||||
else()
|
||||
set(${absvar} "${CMAKE_INSTALL_PREFIX}/${${var}}")
|
||||
endif()
|
||||
else()
|
||||
set(${absvar} "${${var}}")
|
||||
endif()
|
||||
string(REGEX REPLACE "/$" "" ${absvar} "${${absvar}}")
|
||||
endmacro()
|
||||
|
||||
# Result directories
|
||||
#
|
||||
foreach(dir
|
||||
BINDIR
|
||||
SBINDIR
|
||||
LIBEXECDIR
|
||||
SYSCONFDIR
|
||||
SHAREDSTATEDIR
|
||||
LOCALSTATEDIR
|
||||
LIBDIR
|
||||
INCLUDEDIR
|
||||
OLDINCLUDEDIR
|
||||
DATAROOTDIR
|
||||
DATADIR
|
||||
INFODIR
|
||||
LOCALEDIR
|
||||
MANDIR
|
||||
DOCDIR
|
||||
)
|
||||
GNUInstallDirs_get_absolute_install_dir(CMAKE_INSTALL_FULL_${dir} CMAKE_INSTALL_${dir})
|
||||
endforeach()
|
||||
@@ -1,13 +0,0 @@
|
||||
# This file is included from the top-level CMakeLists.txt. We just store it
|
||||
# here to avoid cluttering up that file.
|
||||
|
||||
set(PKGNAME ${CMAKE_PROJECT_NAME} CACHE STRING
|
||||
"Distribution package name (default: ${CMAKE_PROJECT_NAME})")
|
||||
set(PKGVENDOR "The ${CMAKE_PROJECT_NAME} Project" CACHE STRING
|
||||
"Vendor name to be included in distribution package descriptions (default: The ${CMAKE_PROJECT_NAME} Project)")
|
||||
set(PKGURL "https://${CMAKE_PROJECT_NAME}.org" CACHE STRING
|
||||
"URL of project web site to be included in distribution package descriptions (default: https://${CMAKE_PROJECT_NAME}.org)")
|
||||
set(PKGEMAIL "information@${CMAKE_PROJECT_NAME}.org" CACHE STRING
|
||||
"E-mail of project maintainer to be included in distribution package descriptions (default: information@${CMAKE_PROJECT_NAME}.org")
|
||||
set(PKGID "com.${CMAKE_PROJECT_NAME}.${PKGNAME}" CACHE STRING
|
||||
"Globally unique package identifier (reverse DNS notation) (default: com.${CMAKE_PROJECT_NAME}.${PKGNAME})")
|
||||
@@ -1,24 +0,0 @@
|
||||
# This code is from the CMake FAQ
|
||||
|
||||
if (NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt")
|
||||
message(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_BINARY_DIR@/install_manifest.txt\"")
|
||||
endif(NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt")
|
||||
|
||||
file(READ "@CMAKE_BINARY_DIR@/install_manifest.txt" files)
|
||||
string(REGEX REPLACE "\n" ";" files "${files}")
|
||||
list(REVERSE files)
|
||||
foreach (file ${files})
|
||||
message(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"")
|
||||
if (EXISTS "$ENV{DESTDIR}${file}")
|
||||
execute_process(
|
||||
COMMAND "@CMAKE_COMMAND@" -E remove "$ENV{DESTDIR}${file}"
|
||||
OUTPUT_VARIABLE rm_out
|
||||
RESULT_VARIABLE rm_retval
|
||||
)
|
||||
if(NOT ${rm_retval} EQUAL 0)
|
||||
message(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"")
|
||||
endif (NOT ${rm_retval} EQUAL 0)
|
||||
else (EXISTS "$ENV{DESTDIR}${file}")
|
||||
message(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.")
|
||||
endif (EXISTS "$ENV{DESTDIR}${file}")
|
||||
endforeach(file)
|
||||
@@ -1,50 +0,0 @@
|
||||
file(GLOB FILES
|
||||
testout*
|
||||
*_GRAY_*.bmp
|
||||
*_GRAY_*.png
|
||||
*_GRAY_*.ppm
|
||||
*_GRAY_*.jpg
|
||||
*_GRAY.yuv
|
||||
*_420_*.bmp
|
||||
*_420_*.png
|
||||
*_420_*.ppm
|
||||
*_420_*.jpg
|
||||
*_420.yuv
|
||||
*_422_*.bmp
|
||||
*_422_*.png
|
||||
*_422_*.ppm
|
||||
*_422_*.jpg
|
||||
*_422.yuv
|
||||
*_444_*.bmp
|
||||
*_444_*.png
|
||||
*_444_*.ppm
|
||||
*_444_*.jpg
|
||||
*_444.yuv
|
||||
*_440_*.bmp
|
||||
*_440_*.png
|
||||
*_440_*.ppm
|
||||
*_440_*.jpg
|
||||
*_440.yuv
|
||||
*_411_*.bmp
|
||||
*_411_*.png
|
||||
*_411_*.ppm
|
||||
*_411_*.jpg
|
||||
*_411.yuv
|
||||
*_441_*.bmp
|
||||
*_441_*.png
|
||||
*_441_*.ppm
|
||||
*_441_*.jpg
|
||||
*_441.yuv
|
||||
*_LOSSL*S_*.bmp
|
||||
*_LOSSL*S_*.ppm
|
||||
*_LOSSL*S_*.jpg
|
||||
croptest.log
|
||||
tjbenchtest*.log
|
||||
tjexampletest*.log)
|
||||
|
||||
if(NOT FILES STREQUAL "")
|
||||
message(STATUS "Removing test files")
|
||||
file(REMOVE ${FILES})
|
||||
else()
|
||||
message(STATUS "No files to remove")
|
||||
endif()
|
||||
@@ -1,77 +0,0 @@
|
||||
if(NOT DEFINED PRECISION)
|
||||
message(FATAL_ERROR "PRECISION must be specified")
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED WITH_JAVA)
|
||||
message(FATAL_ERROR "WITH_JAVA must be specified")
|
||||
endif()
|
||||
|
||||
macro(check_error program)
|
||||
if(NOT RESULT EQUAL 0)
|
||||
message(FATAL_ERROR "${program} failed.")
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
macro(run_test PROG ARGS)
|
||||
string(REPLACE ";" " " SPACED_ARGS "${ARGS}")
|
||||
message(STATUS "${PROG} ${SPACED_ARGS}")
|
||||
execute_process(COMMAND ${CMAKE_CURRENT_BINARY_DIR}/${PROG} ${ARGS}
|
||||
RESULT_VARIABLE RESULT)
|
||||
check_error("${PROG} ${SPACED_ARGS}")
|
||||
endmacro()
|
||||
|
||||
if(NOT PRECISION EQUAL 16)
|
||||
run_test(tjbenchtest "-precision;${PRECISION}")
|
||||
run_test(tjbenchtest "-precision;${PRECISION};-alloc")
|
||||
endif()
|
||||
if(PRECISION EQUAL 8)
|
||||
run_test(tjbenchtest "-precision;${PRECISION};-yuv")
|
||||
run_test(tjbenchtest "-precision;${PRECISION};-yuv;-alloc")
|
||||
run_test(tjbenchtest "-precision;${PRECISION};-optimize")
|
||||
run_test(tjbenchtest "-precision;${PRECISION};-optimize;-yuv")
|
||||
endif()
|
||||
if(NOT PRECISION EQUAL 16)
|
||||
run_test(tjbenchtest "-precision;${PRECISION};-progressive")
|
||||
endif()
|
||||
if(PRECISION EQUAL 8)
|
||||
run_test(tjbenchtest "-precision;${PRECISION};-progressive;-yuv")
|
||||
endif()
|
||||
if(NOT PRECISION EQUAL 16)
|
||||
run_test(tjbenchtest "-precision;${PRECISION};-arithmetic")
|
||||
run_test(tjbenchtest "-precision;${PRECISION};-progressive;-arithmetic")
|
||||
endif()
|
||||
if(PRECISION EQUAL 8)
|
||||
run_test(tjbenchtest "-precision;${PRECISION};-arithmetic;-yuv")
|
||||
endif()
|
||||
run_test(tjbenchtest "-precision;${PRECISION};-lossless")
|
||||
run_test(tjbenchtest "-precision;${PRECISION};-lossless;-alloc")
|
||||
if(PRECISION EQUAL 8)
|
||||
run_test(tjexampletest "")
|
||||
endif()
|
||||
if(WITH_JAVA)
|
||||
if(NOT PRECISION EQUAL 16)
|
||||
run_test(tjbenchtest "-java;-precision;${PRECISION}")
|
||||
endif()
|
||||
if(PRECISION EQUAL 8)
|
||||
run_test(tjbenchtest "-java;-precision;${PRECISION};-yuv")
|
||||
run_test(tjbenchtest "-java;-precision;${PRECISION};-optimize")
|
||||
run_test(tjbenchtest "-java;-precision;${PRECISION};-optimize;-yuv")
|
||||
endif()
|
||||
if(NOT PRECISION EQUAL 16)
|
||||
run_test(tjbenchtest "-java;-precision;${PRECISION};-progressive")
|
||||
endif()
|
||||
if(PRECISION EQUAL 8)
|
||||
run_test(tjbenchtest "-java;-precision;${PRECISION};-progressive;-yuv")
|
||||
endif()
|
||||
if(NOT PRECISION EQUAL 16)
|
||||
run_test(tjbenchtest "-java;-precision;${PRECISION};-arithmetic")
|
||||
run_test(tjbenchtest "-java;-precision;${PRECISION};-progressive;-arithmetic")
|
||||
endif()
|
||||
if(PRECISION EQUAL 8)
|
||||
run_test(tjbenchtest "-java;-precision;${PRECISION};-arithmetic;-yuv")
|
||||
endif()
|
||||
run_test(tjbenchtest "-java;-precision;${PRECISION};-lossless")
|
||||
if(PRECISION EQUAL 8)
|
||||
run_test(tjexampletest "-java")
|
||||
endif()
|
||||
endif()
|
||||
61
cmyk.h
@@ -1,61 +0,0 @@
|
||||
/*
|
||||
* cmyk.h
|
||||
*
|
||||
* Copyright (C) 2017-2018, 2022, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
* This file contains convenience functions for performing quick & dirty
|
||||
* CMYK<->RGB conversion. This algorithm is suitable for testing purposes
|
||||
* only. Properly converting between CMYK and RGB requires a color management
|
||||
* system.
|
||||
*/
|
||||
|
||||
#ifndef CMYK_H
|
||||
#define CMYK_H
|
||||
|
||||
#include <jinclude.h>
|
||||
#define JPEG_INTERNALS
|
||||
#include <jpeglib.h>
|
||||
#include "jsamplecomp.h"
|
||||
|
||||
|
||||
/* Fully reversible */
|
||||
|
||||
INLINE
|
||||
LOCAL(void)
|
||||
rgb_to_cmyk(_JSAMPLE r, _JSAMPLE g, _JSAMPLE b,
|
||||
_JSAMPLE *c, _JSAMPLE *m, _JSAMPLE *y, _JSAMPLE *k)
|
||||
{
|
||||
double ctmp = 1.0 - ((double)r / (double)_MAXJSAMPLE);
|
||||
double mtmp = 1.0 - ((double)g / (double)_MAXJSAMPLE);
|
||||
double ytmp = 1.0 - ((double)b / (double)_MAXJSAMPLE);
|
||||
double ktmp = MIN(MIN(ctmp, mtmp), ytmp);
|
||||
|
||||
if (ktmp == 1.0) ctmp = mtmp = ytmp = 0.0;
|
||||
else {
|
||||
ctmp = (ctmp - ktmp) / (1.0 - ktmp);
|
||||
mtmp = (mtmp - ktmp) / (1.0 - ktmp);
|
||||
ytmp = (ytmp - ktmp) / (1.0 - ktmp);
|
||||
}
|
||||
*c = (_JSAMPLE)((double)_MAXJSAMPLE - ctmp * (double)_MAXJSAMPLE + 0.5);
|
||||
*m = (_JSAMPLE)((double)_MAXJSAMPLE - mtmp * (double)_MAXJSAMPLE + 0.5);
|
||||
*y = (_JSAMPLE)((double)_MAXJSAMPLE - ytmp * (double)_MAXJSAMPLE + 0.5);
|
||||
*k = (_JSAMPLE)((double)_MAXJSAMPLE - ktmp * (double)_MAXJSAMPLE + 0.5);
|
||||
}
|
||||
|
||||
|
||||
/* Fully reversible only for C/M/Y/K values generated with rgb_to_cmyk() */
|
||||
|
||||
INLINE
|
||||
LOCAL(void)
|
||||
cmyk_to_rgb(_JSAMPLE c, _JSAMPLE m, _JSAMPLE y, _JSAMPLE k,
|
||||
_JSAMPLE *r, _JSAMPLE *g, _JSAMPLE *b)
|
||||
{
|
||||
*r = (_JSAMPLE)((double)c * (double)k / (double)_MAXJSAMPLE + 0.5);
|
||||
*g = (_JSAMPLE)((double)m * (double)k / (double)_MAXJSAMPLE + 0.5);
|
||||
*b = (_JSAMPLE)((double)y * (double)k / (double)_MAXJSAMPLE + 0.5);
|
||||
}
|
||||
|
||||
|
||||
#endif /* CMYK_H */
|
||||
@@ -1,78 +0,0 @@
|
||||
IJG JPEG LIBRARY: CODING RULES
|
||||
|
||||
This file was part of the Independent JPEG Group's software:
|
||||
Copyright (C) 1991-1996, Thomas G. Lane.
|
||||
It was modified by The libjpeg-turbo Project to include only information
|
||||
relevant to libjpeg-turbo.
|
||||
For conditions of distribution and use, see the accompanying README.ijg file.
|
||||
|
||||
|
||||
Since numerous people will be contributing code and bug fixes, it's important
|
||||
to establish a common coding style. The goal of using similar coding styles
|
||||
is much more important than the details of just what that style is.
|
||||
|
||||
In general we follow the recommendations of "Recommended C Style and Coding
|
||||
Standards" revision 6.1 (Cannon et al. as modified by Spencer, Keppel and
|
||||
Brader). This document is available in the IJG FTP archive (see
|
||||
jpeg/doc/cstyle.ms.tbl.Z, or cstyle.txt.Z for those without nroff/tbl).
|
||||
|
||||
Block comments should be laid out thusly:
|
||||
|
||||
/*
|
||||
* Block comments in this style.
|
||||
*/
|
||||
|
||||
We indent statements in K&R style, e.g.,
|
||||
if (test) {
|
||||
then-part;
|
||||
} else {
|
||||
else-part;
|
||||
}
|
||||
with two spaces per indentation level. (This indentation convention is
|
||||
handled automatically by GNU Emacs and many other text editors.)
|
||||
|
||||
Multi-word names should be written in lower case with underscores, e.g.,
|
||||
multi_word_name (not multiWordName). Preprocessor symbols and enum constants
|
||||
are similar but upper case (MULTI_WORD_NAME). Names should be unique within
|
||||
the first fifteen characters.
|
||||
|
||||
Note that each function definition must begin with GLOBAL(type), LOCAL(type),
|
||||
or METHODDEF(type). These macros expand to "static type" or just "type" as
|
||||
appropriate. They provide a readable indication of the routine's usage and
|
||||
can readily be changed for special needs. (For instance, special linkage
|
||||
keywords can be inserted for use in Windows DLLs.)
|
||||
|
||||
A similar solution is used for external function declarations (see the EXTERN
|
||||
macro.)
|
||||
|
||||
|
||||
The JPEG library is intended to be used within larger programs. Furthermore,
|
||||
we want it to be reentrant so that it can be used by applications that process
|
||||
multiple images concurrently. The following rules support these requirements:
|
||||
|
||||
1. Avoid direct use of file I/O, "malloc", error report printouts, etc;
|
||||
pass these through the common routines provided.
|
||||
|
||||
2. Minimize global namespace pollution. Functions should be declared static
|
||||
wherever possible. (Note that our method-based calling conventions help this
|
||||
a lot: in many modules only the initialization function will ever need to be
|
||||
called directly, so only that function need be externally visible.) All
|
||||
global function names should begin with "jpeg_".
|
||||
|
||||
3. Don't use global variables; anything that must be used in another module
|
||||
should be in the common data structures.
|
||||
|
||||
4. Don't use static variables except for read-only constant tables. Variables
|
||||
that should be private to a module can be placed into private structures (see
|
||||
the system architecture document, structure.txt).
|
||||
|
||||
5. Source file names should begin with "j" for files that are part of the
|
||||
library proper; source files that are not part of the library, such as cjpeg.c
|
||||
and djpeg.c, do not begin with "j". Keep compression and decompression code in
|
||||
separate source files --- some applications may want only one half of the
|
||||
library.
|
||||
|
||||
Note: these rules (particularly #4) are not followed religiously in the
|
||||
modules that are used in cjpeg/djpeg but are not part of the JPEG library
|
||||
proper. Those modules are not really intended to be used in other
|
||||
applications.
|
||||
99
codingrules
Normal file
@@ -0,0 +1,99 @@
|
||||
|
||||
JPEG SYSTEM CODING RULES 27-SEP-91
|
||||
|
||||
Since numerous people will be contributing code and bug fixes, it's important
|
||||
to establish a common coding style. The goal of using similar coding styles
|
||||
is much more important than the details of just what that style is.
|
||||
|
||||
I suggest we follow the recommendations of "Recommended C Style and Coding
|
||||
Standards" revision 6.1 (Cannon et al. as modified by Spencer, Keppel and
|
||||
Brader). I have placed a copy of this document in the jpeg FTP archive (see
|
||||
jpeg/doc/cstyle.ms.tbl.Z, or cstyle.txt.Z for those without nroff/tbl).
|
||||
|
||||
Unless someone has a real strong objection, let's do block comments thusly:
|
||||
|
||||
/*
|
||||
* Block comments in this style.
|
||||
*/
|
||||
|
||||
and indent statements in K&R style, e.g.,
|
||||
|
||||
if (test) {
|
||||
then-part;
|
||||
} else {
|
||||
else-part;
|
||||
}
|
||||
|
||||
I suggest that multi-word names be written in the style multi_word_name
|
||||
rather than multiWordName, but I am open to argument on this.
|
||||
|
||||
|
||||
I would like to use function prototypes everywhere, and rely on automatic
|
||||
source code transformation to feed non-ANSI C compilers. The best tool
|
||||
I have so far found for this is 'ansi2knr.c', which is part of Ghostscript.
|
||||
ansi2knr is not very bright, so it imposes a format requirement on function
|
||||
declarations: the function name MUST BEGIN IN COLUMN 1. Thus all functions
|
||||
should be written in the following style:
|
||||
|
||||
static int *
|
||||
function_name (int a, char *b)
|
||||
{
|
||||
code...
|
||||
}
|
||||
|
||||
ansi2knr won't help with method declarations (function pointers in structs).
|
||||
I suggest we use a macro to declare method pointers, something like this:
|
||||
|
||||
#ifdef PROTO
|
||||
#define METHOD(type,methodname,arglist) type (*methodname) arglist
|
||||
#else
|
||||
#define METHOD(type,methodname,arglist) type (*methodname) ()
|
||||
#endif
|
||||
|
||||
which is used like this:
|
||||
|
||||
struct function_pointers {
|
||||
METHOD(void, init_entropy_encoder, (functptrs fptrs, jparms *jp));
|
||||
METHOD(void, term_entropy_encoder, (void));
|
||||
};
|
||||
|
||||
Note the set of parentheses surrounding the parameter list.
|
||||
|
||||
A similar solution is used for external function declarations (see the PP
|
||||
macro in jpegdata.h).
|
||||
|
||||
If the code is to work on non-ANSI compilers, you cannot rely on a prototype
|
||||
declaration to coerce actual parameters into the right types. Therefore, use
|
||||
explicit casts on actual parameters whenever the actual parameter type is not
|
||||
identical to the formal parameter. Beware of implicit conversions to "int".
|
||||
|
||||
It seems there are some non-ANSI compilers in which the sizeof() operator
|
||||
is defined to return int, while size_t is defined as long. Needless to say,
|
||||
this is brain-damaged. Always use the SIZEOF() macro in place of sizeof(),
|
||||
so that the result is guaranteed to be of type size_t.
|
||||
|
||||
|
||||
We can expect that the JPEG compressor and decompressor will be incorporated
|
||||
into larger programs. Therefore, the following rules are important:
|
||||
|
||||
1. Avoid direct use of any file I/O, "malloc", error report printouts, etc;
|
||||
pass these through the common routines provided.
|
||||
|
||||
2. Assume that the JPEG code may be invoked more than once per program run;
|
||||
therefore, do not rely on static initialization of variables, and be careful
|
||||
to release all allocated storage at the end of processing.
|
||||
|
||||
3. Minimize global namespace pollution. Functions should be declared static
|
||||
wherever possible. (Note that our method-based calling conventions help this
|
||||
a lot: in many modules only the method-selector function will ever need to be
|
||||
called directly, so only that function need be externally visible.) All
|
||||
global function names should begin with "j", and should be unique in the first
|
||||
six characters for portability reasons.
|
||||
Don't use global variables at all; anything that must be used in another
|
||||
module should be put into parameters (there'll be some large structs passed
|
||||
around for this purpose).
|
||||
|
||||
4. Source file names should also begin with "j"; remember to keep them to
|
||||
eight characters (plus ".c" or ".h", etc) to make life easy for MS-DOSers.
|
||||
Do not put code for both compression and decompression into the same source
|
||||
file.
|
||||
95
croptest.in
@@ -1,95 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -u
|
||||
set -e
|
||||
trap onexit INT
|
||||
trap onexit TERM
|
||||
trap onexit EXIT
|
||||
|
||||
onexit()
|
||||
{
|
||||
if [ -d $OUTDIR ]; then
|
||||
rm -rf $OUTDIR
|
||||
fi
|
||||
}
|
||||
|
||||
runme()
|
||||
{
|
||||
echo \*\*\* $*
|
||||
$*
|
||||
}
|
||||
|
||||
IMAGE=vgl_6548_0026a.bmp
|
||||
WIDTH=128
|
||||
HEIGHT=95
|
||||
IMGDIR=@CMAKE_CURRENT_SOURCE_DIR@/testimages
|
||||
OUTDIR=`mktemp -d /tmp/__croptest_output.XXXXXX`
|
||||
EXEDIR=@CMAKE_CURRENT_BINARY_DIR@
|
||||
|
||||
if [ -d $OUTDIR ]; then
|
||||
rm -rf $OUTDIR
|
||||
fi
|
||||
mkdir -p $OUTDIR
|
||||
|
||||
exec >$EXEDIR/croptest.log
|
||||
|
||||
echo "============================================================"
|
||||
echo "$IMAGE ($WIDTH x $HEIGHT)"
|
||||
echo "============================================================"
|
||||
echo
|
||||
|
||||
for PROGARG in "" -progressive; do
|
||||
|
||||
cp $IMGDIR/$IMAGE $OUTDIR
|
||||
basename=`basename $IMAGE .bmp`
|
||||
echo "------------------------------------------------------------"
|
||||
echo "Generating test images"
|
||||
echo "------------------------------------------------------------"
|
||||
echo
|
||||
runme $EXEDIR/cjpeg $PROGARG -grayscale -outfile $OUTDIR/${basename}_GRAY.jpg $IMGDIR/${basename}.bmp
|
||||
runme $EXEDIR/cjpeg $PROGARG -sample 2x2 -outfile $OUTDIR/${basename}_420.jpg $IMGDIR/${basename}.bmp
|
||||
runme $EXEDIR/cjpeg $PROGARG -sample 2x1 -outfile $OUTDIR/${basename}_422.jpg $IMGDIR/${basename}.bmp
|
||||
runme $EXEDIR/cjpeg $PROGARG -sample 1x2 -outfile $OUTDIR/${basename}_440.jpg $IMGDIR/${basename}.bmp
|
||||
runme $EXEDIR/cjpeg $PROGARG -sample 1x1 -outfile $OUTDIR/${basename}_444.jpg $IMGDIR/${basename}.bmp
|
||||
echo
|
||||
|
||||
for NSARG in "" -nosmooth; do
|
||||
|
||||
for COLORSARG in "" "-colors 256 -dither none -onepass"; do
|
||||
|
||||
for Y in {0..16}; do
|
||||
|
||||
for H in {1..16}; do
|
||||
|
||||
X=$(( (Y*16)%128 ))
|
||||
W=$(( WIDTH-X-7 ))
|
||||
if [ $Y -le 15 ]; then
|
||||
CROPSPEC="${W}x${H}+${X}+${Y}"
|
||||
else
|
||||
Y2=$(( HEIGHT-H ));
|
||||
CROPSPEC="${W}x${H}+${X}+${Y2}"
|
||||
fi
|
||||
|
||||
echo "------------------------------------------------------------"
|
||||
echo $PROGARG $NSARG $COLORSARG -crop $CROPSPEC
|
||||
echo "------------------------------------------------------------"
|
||||
echo
|
||||
for samp in GRAY 420 422 440 444; do
|
||||
$EXEDIR/djpeg $NSARG $COLORSARG -rgb -outfile $OUTDIR/${basename}_${samp}_full.ppm $OUTDIR/${basename}_${samp}.jpg
|
||||
convert -crop $CROPSPEC $OUTDIR/${basename}_${samp}_full.ppm $OUTDIR/${basename}_${samp}_ref.ppm
|
||||
runme $EXEDIR/djpeg $NSARG $COLORSARG -crop $CROPSPEC -rgb -outfile $OUTDIR/${basename}_${samp}.ppm $OUTDIR/${basename}_${samp}.jpg
|
||||
runme cmp $OUTDIR/${basename}_${samp}.ppm $OUTDIR/${basename}_${samp}_ref.ppm
|
||||
done
|
||||
echo
|
||||
|
||||
done
|
||||
|
||||
done
|
||||
|
||||
done
|
||||
|
||||
done
|
||||
|
||||
done
|
||||
|
||||
echo SUCCESS!
|
||||
296
djpeg.1
@@ -1,10 +1,43 @@
|
||||
.TH DJPEG 1 "17 June 2024"
|
||||
.TH DJPEG 1 "17 February 1993"
|
||||
.SH NAME
|
||||
djpeg \- decompress a JPEG file to an image file
|
||||
.SH SYNOPSIS
|
||||
.B djpeg
|
||||
[
|
||||
.I options
|
||||
.BI \-colors " N"
|
||||
]
|
||||
[
|
||||
.B \-gif
|
||||
]
|
||||
[
|
||||
.B \-pnm
|
||||
]
|
||||
[
|
||||
.B \-rle
|
||||
]
|
||||
[
|
||||
.B \-targa
|
||||
]
|
||||
[
|
||||
.B \-blocksmooth
|
||||
]
|
||||
[
|
||||
.B \-grayscale
|
||||
]
|
||||
[
|
||||
.BI \-maxmemory " N"
|
||||
]
|
||||
[
|
||||
.B \-nodither
|
||||
]
|
||||
[
|
||||
.B \-onepass
|
||||
]
|
||||
[
|
||||
.B \-verbose
|
||||
]
|
||||
[
|
||||
.B \-debug
|
||||
]
|
||||
[
|
||||
.I filename
|
||||
@@ -14,8 +47,9 @@ djpeg \- decompress a JPEG file to an image file
|
||||
.LP
|
||||
.B djpeg
|
||||
decompresses the named JPEG file, or the standard input if no file is named,
|
||||
and produces an image file on the standard output. PBMPLUS (PPM/PGM), BMP,
|
||||
GIF, or Targa output format can be selected.
|
||||
and produces an image file on the standard output. PBMPLUS (PPM/PGM), GIF,
|
||||
Targa, or RLE (Utah Raster Toolkit) output format can be selected. (RLE is
|
||||
supported only if the URT library is available.)
|
||||
.SH OPTIONS
|
||||
All switch names may be abbreviated; for example,
|
||||
.B \-grayscale
|
||||
@@ -25,231 +59,89 @@ or
|
||||
.BR \-gr .
|
||||
Most of the "basic" switches can be abbreviated to as little as one letter.
|
||||
Upper and lower case are equivalent (thus
|
||||
.B \-BMP
|
||||
.B \-GIF
|
||||
is the same as
|
||||
.BR \-bmp ).
|
||||
British spellings are also accepted (e.g.
|
||||
.BR \-gif ).
|
||||
British spellings are also accepted (e.g.,
|
||||
.BR \-greyscale ),
|
||||
though for brevity these are not mentioned below.
|
||||
.PP
|
||||
The basic switches are:
|
||||
.TP
|
||||
.BI \-colors " N"
|
||||
Reduce image to at most N colors [legacy feature]. This reduces the number of
|
||||
colors used in the output image so that it can be stored in a colormapped file
|
||||
format. This feature cannot be used when decompressing lossless JPEG images.
|
||||
Reduce image to at most N colors. This reduces the number of colors used in
|
||||
the output image, so that it can be displayed on a colormapped display or
|
||||
stored in a colormapped file format. For example, if you have an 8-bit
|
||||
display, you'd need to reduce to 256 or fewer colors.
|
||||
.TP
|
||||
.BI \-quantize " N"
|
||||
Same as
|
||||
.BR \-colors .
|
||||
.B \-colors
|
||||
is the recommended name.
|
||||
is the recommended name,
|
||||
.B \-quantize
|
||||
is provided only for backward compatibility.
|
||||
.TP
|
||||
.B \-fast
|
||||
Select recommended processing options for low-quality output [legacy feature].
|
||||
(The default options are chosen for highest-quality output.) Currently, this
|
||||
is equivalent to \fB\-dct fast \-nosmooth \-onepass \-dither ordered\fR. On
|
||||
modern CPUs, these settings have little or no performance benefit and are
|
||||
retained solely for backward compatibility.
|
||||
.TP
|
||||
.B \-grayscale
|
||||
Force grayscale output even if JPEG file is full-color. This feature cannot be
|
||||
used when decompressing full-color lossless JPEG images.
|
||||
.TP
|
||||
.B \-rgb
|
||||
Force RGB output even if JPEG file is grayscale. This feature cannot be used
|
||||
when decompressing grayscale lossless JPEG images.
|
||||
.TP
|
||||
.BI \-scale " M/N"
|
||||
Scale the output image by a factor M/N. Currently the scale factor must be
|
||||
M/8, where M is an integer between 1 and 16 inclusive, or any reduced fraction
|
||||
thereof (such as 1/2, 3/4, etc.) Scaling is handy if the image is larger than
|
||||
your screen. This feature cannot be used when decompressing lossless JPEG
|
||||
images.
|
||||
.TP
|
||||
.B \-bmp
|
||||
Select BMP output format (Windows flavor). 8-bit colormapped format is
|
||||
emitted if
|
||||
.B \-colors
|
||||
or
|
||||
.B \-grayscale
|
||||
is specified, or if the JPEG file is grayscale; otherwise, 24-bit full-color
|
||||
format is emitted. This format can only be used when decompressing
|
||||
8-bit-per-sample JPEG images.
|
||||
is provided only for backwards compatibility.
|
||||
.TP
|
||||
.B \-gif
|
||||
Select GIF output format (LZW-compressed) [legacy feature]. Since GIF does not
|
||||
support more than 256 colors,
|
||||
Select GIF output format. Since GIF does not support more than 256 colors,
|
||||
.B \-colors 256
|
||||
is assumed (unless you specify a smaller number of colors). If you specify
|
||||
.BR \-fast,
|
||||
the default number of colors is 216. This format can only be used when
|
||||
decompressing 8-bit-per-sample or 12-bit-per-sample lossy JPEG images.
|
||||
.TP
|
||||
.B \-gif0
|
||||
Select GIF output format (uncompressed) [legacy feature]. Since GIF does not
|
||||
support more than 256 colors,
|
||||
.B \-colors 256
|
||||
is assumed (unless you specify a smaller number of colors). If you specify
|
||||
.BR \-fast,
|
||||
the default number of colors is 216. This format can only be used when
|
||||
decompressing 8-bit-per-sample or 12-bit-per-sample lossy JPEG images.
|
||||
.TP
|
||||
.B \-os2
|
||||
Select BMP output format (OS/2 1.x flavor) [legacy feature]. 8-bit colormapped
|
||||
format is emitted if
|
||||
.B \-colors
|
||||
or
|
||||
.B \-grayscale
|
||||
is specified, or if the JPEG file is grayscale; otherwise, 24-bit full-color
|
||||
format is emitted. This format can only be used when decompressing
|
||||
8-bit-per-sample JPEG images.
|
||||
is assumed (unless you specify a smaller number of colors).
|
||||
.TP
|
||||
.B \-pnm
|
||||
Select PBMPLUS (PPM/PGM) output format (this is the default format).
|
||||
PGM is emitted if the JPEG file is grayscale or if
|
||||
PGM is emitted if the JPEG file is gray-scale or if
|
||||
.B \-grayscale
|
||||
is specified; otherwise PPM is emitted.
|
||||
.TP
|
||||
.B \-rle
|
||||
Select RLE output format. (Requires URT library.)
|
||||
.TP
|
||||
.B \-targa
|
||||
Select Targa output format [legacy feature]. Grayscale format is emitted if
|
||||
the JPEG file is grayscale or if
|
||||
Select Targa output format. Gray-scale format is emitted if the JPEG file is
|
||||
gray-scale or if
|
||||
.B \-grayscale
|
||||
is specified; otherwise, colormapped format is emitted if
|
||||
.B \-colors
|
||||
is specified; otherwise, 24-bit full-color format is emitted. This format can
|
||||
only be used when decompressing 8-bit-per-sample JPEG images.
|
||||
is specified; otherwise, 24-bit full-color format is emitted.
|
||||
.PP
|
||||
Switches for advanced users:
|
||||
.TP
|
||||
.B \-dct int
|
||||
Use accurate integer DCT method (default).
|
||||
.B \-blocksmooth
|
||||
Perform cross-block smoothing. This is slow, quite memory-intensive, and only
|
||||
seems to improve the image at very low quality settings (\fB\-quality\fR 10 to
|
||||
20 or so). At normal quality settings it may make the image worse.
|
||||
.TP
|
||||
.B \-dct fast
|
||||
Use less accurate integer DCT method [legacy feature].
|
||||
When the Independent JPEG Group's software was first released in 1991, the
|
||||
decompression time for a 1-megapixel JPEG image on a mainstream PC was measured
|
||||
in minutes. Thus, the \fBfast\fR integer DCT algorithm provided noticeable
|
||||
performance benefits. On modern CPUs running libjpeg-turbo, however, the
|
||||
decompression time for a 1-megapixel JPEG image is measured in milliseconds,
|
||||
and thus the performance benefits of the \fBfast\fR algorithm are much less
|
||||
noticeable. On modern x86/x86-64 CPUs that support AVX2 instructions, the
|
||||
\fBfast\fR and \fBint\fR methods have similar performance. On other types of
|
||||
CPUs, the \fBfast\fR method is generally about 5-15% faster than the \fBint\fR
|
||||
method.
|
||||
|
||||
If the JPEG image was compressed using a quality level of 85 or below, then
|
||||
there should be little or no perceptible quality difference between the two
|
||||
algorithms. When decompressing images that were compressed using quality
|
||||
levels above 85, however, the difference between the \fBfast\fR and \fBint\fR
|
||||
methods becomes more pronounced. With images compressed using quality=97, for
|
||||
instance, the \fBfast\fR method incurs generally about a 4-6 dB loss in PSNR
|
||||
relative to the \fBint\fR method, but this can be larger for some images. If
|
||||
you can avoid it, do not use the \fBfast\fR method when decompressing images
|
||||
that were compressed using quality levels above 97. The algorithm often
|
||||
degenerates for such images and can actually produce a more lossy output image
|
||||
than if the JPEG image had been compressed using lower quality levels.
|
||||
.TP
|
||||
.B \-dct float
|
||||
Use floating-point DCT method [legacy feature].
|
||||
The \fBfloat\fR method does not produce significantly more accurate results
|
||||
than the \fBint\fR method, and it is much slower. The \fBfloat\fR method may
|
||||
also give different results on different machines due to varying roundoff
|
||||
behavior, whereas the integer methods should give the same results on all
|
||||
machines.
|
||||
.TP
|
||||
.B \-dither fs
|
||||
Use Floyd-Steinberg dithering when quantizing colors [legacy feature].
|
||||
.TP
|
||||
.B \-dither ordered
|
||||
Use ordered dithering when quantizing colors [legacy feature].
|
||||
.TP
|
||||
.B \-dither none
|
||||
Do not use dithering when quantizing colors [legacy feature]. By default,
|
||||
Floyd-Steinberg dithering is applied when quantizing colors. This is slower
|
||||
but usually produces the best results. Ordered dithering is a compromise
|
||||
between speed and quality. No dithering is faster but usually looks awful.
|
||||
Note that these switches have no effect unless color quantization is being
|
||||
done. Ordered dithering is only available in
|
||||
.B \-onepass
|
||||
mode.
|
||||
.TP
|
||||
.BI \-icc " file"
|
||||
Extract ICC color management profile to the specified file.
|
||||
.TP
|
||||
.BI \-map " file"
|
||||
Quantize to the colors used in the specified image file [legacy feature]. This
|
||||
is useful for producing multiple files with identical color maps, or for
|
||||
forcing a predefined set of colors to be used. The
|
||||
.I file
|
||||
must be a GIF or PPM file. This option overrides
|
||||
.B \-colors
|
||||
and
|
||||
.BR \-onepass .
|
||||
.TP
|
||||
.B \-nosmooth
|
||||
Use a faster, lower-quality upsampling routine.
|
||||
.TP
|
||||
.B \-onepass
|
||||
Use one-pass instead of two-pass color quantization [legacy feature]. The
|
||||
one-pass method needs less memory, but it produces a lower-quality image.
|
||||
.B \-onepass
|
||||
is ignored unless you also specify
|
||||
.B \-colors
|
||||
.IR N .
|
||||
Also, the one-pass method is always used for grayscale output. (The two-pass
|
||||
method has no improvement in that case.)
|
||||
.B \-grayscale
|
||||
Force gray-scale output even if JPEG file is color.
|
||||
Useful for viewing on monochrome displays.
|
||||
.TP
|
||||
.BI \-maxmemory " N"
|
||||
Set limit for amount of memory to use in processing large images. Value is
|
||||
in thousands of bytes, or millions of bytes if "M" is attached to the
|
||||
number. For example,
|
||||
.B \-max 4m
|
||||
selects 4000000 bytes. If more space is needed, an error will occur.
|
||||
selects 4000000 bytes. If more space is needed, temporary files will be used.
|
||||
.TP
|
||||
.BI \-maxscans " N"
|
||||
Abort if the JPEG image contains more than
|
||||
.I N
|
||||
scans. This feature demonstrates a method by which applications can guard
|
||||
against denial-of-service attacks instigated by specially-crafted malformed
|
||||
JPEG images containing numerous scans with missing image data or image data
|
||||
consisting only of "EOB runs" (a feature of progressive JPEG images that allows
|
||||
potentially hundreds of thousands of adjoining zero-value pixels to be
|
||||
represented using only a few bytes.) Attempting to decompress such malformed
|
||||
JPEG images can cause excessive CPU activity, since the decompressor must fully
|
||||
process each scan (even if the scan is corrupt) before it can proceed to the
|
||||
next scan.
|
||||
.B \-nodither
|
||||
Do not use dithering in color quantization. By default, Floyd-Steinberg
|
||||
dithering is applied when quantizing colors, but on some images dithering may
|
||||
result in objectionable "graininess". If that happens, you can turn off
|
||||
dithering with
|
||||
.BR \-nodither .
|
||||
.B \-nodither
|
||||
is ignored unless you also say
|
||||
.B \-colors
|
||||
.IR N .
|
||||
.TP
|
||||
.BI \-outfile " name"
|
||||
Send output image to the named file, not to standard output.
|
||||
.TP
|
||||
.BI \-memsrc
|
||||
Load input file into memory before decompressing. This feature was implemented
|
||||
mainly as a way of testing the in-memory source manager (jpeg_mem_src().)
|
||||
.TP
|
||||
.BI \-report
|
||||
Report decompression progress.
|
||||
.TP
|
||||
.BI \-skip " Y0,Y1"
|
||||
Decompress all rows of the JPEG image except those between Y0 and Y1
|
||||
(inclusive.) Note that if decompression scaling is being used, then Y0 and Y1
|
||||
are relative to the scaled image dimensions.
|
||||
.TP
|
||||
.BI \-crop " WxH+X+Y"
|
||||
Decompress only a rectangular subregion of the image, starting at point X,Y
|
||||
with width W and height H. If necessary, X will be shifted left to the nearest
|
||||
iMCU boundary, and the width will be increased accordingly. Note that if
|
||||
decompression scaling is being used, then X, Y, W, and H are relative to the
|
||||
scaled image dimensions. Currently this option only works with the
|
||||
PBMPLUS (PPM/PGM), GIF, and Targa output formats.
|
||||
.TP
|
||||
.BI \-strict
|
||||
Treat all warnings as fatal. This feature also demonstrates a method by which
|
||||
applications can guard against attacks instigated by specially-crafted
|
||||
malformed JPEG images. Enabling this option will cause the decompressor to
|
||||
abort if the JPEG image contains incomplete or corrupt image data.
|
||||
.B \-onepass
|
||||
Use one-pass instead of two-pass color quantization. The one-pass method is
|
||||
faster and needs less memory, but it produces a lower-quality image.
|
||||
.B \-onepass
|
||||
is ignored unless you also say
|
||||
.B \-colors
|
||||
.IR N .
|
||||
Also, the one-pass method is always used for gray-scale output (the two-pass
|
||||
method is no improvement then).
|
||||
.TP
|
||||
.B \-verbose
|
||||
Enable debug printout. More
|
||||
@@ -259,18 +151,15 @@ give more output. Also, version information is printed at startup.
|
||||
.B \-debug
|
||||
Same as
|
||||
.BR \-verbose .
|
||||
.TP
|
||||
.B \-version
|
||||
Print version information and exit.
|
||||
.SH EXAMPLES
|
||||
.LP
|
||||
This example decompresses the JPEG file foo.jpg and saves the output in 8-bit
|
||||
BMP format in foo.bmp:
|
||||
This example decompresses the JPEG file foo.jpg, automatically quantizes to
|
||||
256 colors, and saves the output in GIF format in foo.gif:
|
||||
.IP
|
||||
.B djpeg \-bmp
|
||||
.B djpeg \-gif
|
||||
.I foo.jpg
|
||||
.B >
|
||||
.I foo.bmp
|
||||
.I foo.gif
|
||||
.SH ENVIRONMENT
|
||||
.TP
|
||||
.B JPEGMEM
|
||||
@@ -283,10 +172,7 @@ overrides the default value specified when the program was compiled, and
|
||||
itself is overridden by an explicit
|
||||
.BR \-maxmemory .
|
||||
.SH SEE ALSO
|
||||
.BR cjpeg (1),
|
||||
.BR jpegtran (1),
|
||||
.BR rdjpgcom (1),
|
||||
.BR wrjpgcom (1)
|
||||
.BR cjpeg (1)
|
||||
.br
|
||||
.BR ppm (5),
|
||||
.BR pgm (5)
|
||||
@@ -295,7 +181,7 @@ Wallace, Gregory K. "The JPEG Still Picture Compression Standard",
|
||||
Communications of the ACM, April 1991 (vol. 34, no. 4), pp. 30-44.
|
||||
.SH AUTHOR
|
||||
Independent JPEG Group
|
||||
.SH BUGS
|
||||
Arithmetic coding is not supported for legal reasons.
|
||||
.PP
|
||||
This file was modified by The libjpeg-turbo Project to include only information
|
||||
relevant to libjpeg-turbo, to wordsmith certain sections, and to describe
|
||||
features not present in libjpeg.
|
||||
Still not as fast as we'd like.
|
||||
|
||||
943
djpeg.c
@@ -1,943 +0,0 @@
|
||||
/*
|
||||
* djpeg.c
|
||||
*
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1991-1997, Thomas G. Lane.
|
||||
* Modified 2013-2019 by Guido Vollbeding.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2010-2011, 2013-2017, 2019-2020, 2022-2024, D. R. Commander.
|
||||
* Copyright (C) 2015, Google, Inc.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
* This file contains a command-line user interface for the JPEG decompressor.
|
||||
* It should work on any system with Unix- or MS-DOS-style command lines.
|
||||
*
|
||||
* Two different command line styles are permitted, depending on the
|
||||
* compile-time switch TWO_FILE_COMMANDLINE:
|
||||
* djpeg [options] inputfile outputfile
|
||||
* djpeg [options] [inputfile]
|
||||
* In the second style, output is always to standard output, which you'd
|
||||
* normally redirect to a file or pipe to some other program. Input is
|
||||
* either from a named file or from standard input (typically redirected).
|
||||
* The second style is convenient on Unix but is unhelpful on systems that
|
||||
* don't support pipes. Also, you MUST use the first style if your system
|
||||
* doesn't do binary I/O to stdin/stdout.
|
||||
* To simplify script writing, the "-outfile" switch is provided. The syntax
|
||||
* djpeg [options] -outfile outputfile inputfile
|
||||
* works regardless of which command line style is used.
|
||||
*/
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#define _CRT_SECURE_NO_DEPRECATE
|
||||
#endif
|
||||
|
||||
#include "cdjpeg.h" /* Common decls for cjpeg/djpeg applications */
|
||||
#include "jversion.h" /* for version message */
|
||||
#include "jconfigint.h"
|
||||
|
||||
#include <ctype.h> /* to declare isprint() */
|
||||
|
||||
|
||||
/* Create the add-on message string table. */
|
||||
|
||||
#define JMESSAGE(code, string) string,
|
||||
|
||||
static const char * const cdjpeg_message_table[] = {
|
||||
#include "cderror.h"
|
||||
NULL
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* This list defines the known output image formats
|
||||
* (not all of which need be supported by a given version).
|
||||
* You can change the default output format by defining DEFAULT_FMT;
|
||||
* indeed, you had better do so if you undefine PPM_SUPPORTED.
|
||||
*/
|
||||
|
||||
typedef enum {
|
||||
FMT_BMP, /* BMP format (Windows flavor) */
|
||||
FMT_GIF, /* GIF format (LZW-compressed) */
|
||||
FMT_GIF0, /* GIF format (uncompressed) */
|
||||
FMT_OS2, /* BMP format (OS/2 flavor) */
|
||||
FMT_PPM, /* PPM/PGM (PBMPLUS formats) */
|
||||
FMT_TARGA, /* Targa format */
|
||||
FMT_TIFF /* TIFF format */
|
||||
} IMAGE_FORMATS;
|
||||
|
||||
#ifndef DEFAULT_FMT /* so can override from CFLAGS in Makefile */
|
||||
#define DEFAULT_FMT FMT_PPM
|
||||
#endif
|
||||
|
||||
static IMAGE_FORMATS requested_fmt;
|
||||
|
||||
|
||||
/*
|
||||
* Argument-parsing code.
|
||||
* The switch parser is designed to be useful with DOS-style command line
|
||||
* syntax, ie, intermixed switches and file names, where only the switches
|
||||
* to the left of a given file name affect processing of that file.
|
||||
* The main program in this file doesn't actually use this capability...
|
||||
*/
|
||||
|
||||
|
||||
static const char *progname; /* program name for error messages */
|
||||
static char *icc_filename; /* for -icc switch */
|
||||
static JDIMENSION max_scans; /* for -maxscans switch */
|
||||
static char *outfilename; /* for -outfile switch */
|
||||
static boolean memsrc; /* for -memsrc switch */
|
||||
static boolean report; /* for -report switch */
|
||||
static boolean skip, crop;
|
||||
static JDIMENSION skip_start, skip_end;
|
||||
static JDIMENSION crop_x, crop_y, crop_width, crop_height;
|
||||
static boolean strict; /* for -strict switch */
|
||||
#define INPUT_BUF_SIZE 4096
|
||||
|
||||
|
||||
LOCAL(void)
|
||||
usage(void)
|
||||
/* complain about bad command line */
|
||||
{
|
||||
fprintf(stderr, "usage: %s [switches] ", progname);
|
||||
#ifdef TWO_FILE_COMMANDLINE
|
||||
fprintf(stderr, "inputfile outputfile\n");
|
||||
#else
|
||||
fprintf(stderr, "[inputfile]\n");
|
||||
#endif
|
||||
|
||||
fprintf(stderr, "Switches (names may be abbreviated):\n");
|
||||
fprintf(stderr, " -colors N Reduce image to no more than N colors [legacy feature]\n");
|
||||
fprintf(stderr, " -fast Low-quality processing [legacy feature]\n");
|
||||
fprintf(stderr, " -grayscale Force grayscale output\n");
|
||||
fprintf(stderr, " -rgb Force RGB output\n");
|
||||
fprintf(stderr, " -rgb565 Force RGB565 output\n");
|
||||
#ifdef IDCT_SCALING_SUPPORTED
|
||||
fprintf(stderr, " -scale M/N Scale output image by fraction M/N, eg, 1/8\n");
|
||||
#endif
|
||||
#ifdef BMP_SUPPORTED
|
||||
fprintf(stderr, " -bmp Select BMP output format (Windows style)%s\n",
|
||||
(DEFAULT_FMT == FMT_BMP ? " (default)" : ""));
|
||||
#endif
|
||||
#ifdef GIF_SUPPORTED
|
||||
fprintf(stderr, " -gif Select GIF output format (LZW-compressed)%s [legacy feature]\n",
|
||||
(DEFAULT_FMT == FMT_GIF ? " (default)" : ""));
|
||||
fprintf(stderr, " -gif0 Select GIF output format (uncompressed)%s [legacy feature]\n",
|
||||
(DEFAULT_FMT == FMT_GIF0 ? " (default)" : ""));
|
||||
#endif
|
||||
#ifdef BMP_SUPPORTED
|
||||
fprintf(stderr, " -os2 Select BMP output format (OS/2 style)%s [legacy feature]\n",
|
||||
(DEFAULT_FMT == FMT_OS2 ? " (default)" : ""));
|
||||
#endif
|
||||
#ifdef PPM_SUPPORTED
|
||||
fprintf(stderr, " -pnm Select PBMPLUS (PPM/PGM) output format%s\n",
|
||||
(DEFAULT_FMT == FMT_PPM ? " (default)" : ""));
|
||||
#endif
|
||||
#ifdef TARGA_SUPPORTED
|
||||
fprintf(stderr, " -targa Select Targa output format%s [legacy feature]\n",
|
||||
(DEFAULT_FMT == FMT_TARGA ? " (default)" : ""));
|
||||
#endif
|
||||
fprintf(stderr, "Switches for advanced users:\n");
|
||||
#ifdef DCT_ISLOW_SUPPORTED
|
||||
fprintf(stderr, " -dct int Use accurate integer DCT method%s\n",
|
||||
(JDCT_DEFAULT == JDCT_ISLOW ? " (default)" : ""));
|
||||
#endif
|
||||
#ifdef DCT_IFAST_SUPPORTED
|
||||
fprintf(stderr, " -dct fast Use less accurate integer DCT method [legacy feature]%s\n",
|
||||
(JDCT_DEFAULT == JDCT_IFAST ? " (default)" : ""));
|
||||
#endif
|
||||
#ifdef DCT_FLOAT_SUPPORTED
|
||||
fprintf(stderr, " -dct float Use floating-point DCT method [legacy feature]%s\n",
|
||||
(JDCT_DEFAULT == JDCT_FLOAT ? " (default)" : ""));
|
||||
#endif
|
||||
fprintf(stderr, " -dither fs Use Floyd-Steinberg dithering when quantizing colors (default)\n");
|
||||
fprintf(stderr, " [legacy feature]\n");
|
||||
fprintf(stderr, " -dither none Don't use dithering when quantizing colors [legacy feature]\n");
|
||||
fprintf(stderr, " -dither ordered Use ordered dithering when quantizing colors\n");
|
||||
fprintf(stderr, " [legacy feature]\n");
|
||||
fprintf(stderr, " -icc FILE Extract ICC profile to FILE\n");
|
||||
#ifdef QUANT_2PASS_SUPPORTED
|
||||
fprintf(stderr, " -map FILE Quantize to colors used in named image file [legacy feature]\n");
|
||||
#endif
|
||||
fprintf(stderr, " -nosmooth Use faster, lower-quality upsampling\n");
|
||||
#ifdef QUANT_1PASS_SUPPORTED
|
||||
fprintf(stderr, " -onepass Use 1-pass color quantization (low quality) [legacy feature]\n");
|
||||
#endif
|
||||
fprintf(stderr, " -maxmemory N Maximum memory to use (in kbytes)\n");
|
||||
fprintf(stderr, " -maxscans N Maximum number of scans to allow in input file\n");
|
||||
fprintf(stderr, " -outfile name Specify name for output file\n");
|
||||
fprintf(stderr, " -memsrc Load input file into memory before decompressing\n");
|
||||
fprintf(stderr, " -report Report decompression progress\n");
|
||||
fprintf(stderr, " -skip Y0,Y1 Decompress all rows except those between Y0 and Y1 (inclusive)\n");
|
||||
fprintf(stderr, " -crop WxH+X+Y Decompress only a rectangular subregion of the image\n");
|
||||
fprintf(stderr, " [requires PBMPLUS (PPM/PGM), GIF, or Targa output format]\n");
|
||||
fprintf(stderr, " -strict Treat all warnings as fatal\n");
|
||||
fprintf(stderr, " -verbose or -debug Emit debug output\n");
|
||||
fprintf(stderr, " -version Print version information and exit\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
|
||||
LOCAL(int)
|
||||
parse_switches(j_decompress_ptr cinfo, int argc, char **argv,
|
||||
int last_file_arg_seen, boolean for_real)
|
||||
/* Parse optional switches.
|
||||
* Returns argv[] index of first file-name argument (== argc if none).
|
||||
* Any file names with indexes <= last_file_arg_seen are ignored;
|
||||
* they have presumably been processed in a previous iteration.
|
||||
* (Pass 0 for last_file_arg_seen on the first or only iteration.)
|
||||
* for_real is FALSE on the first (dummy) pass; we may skip any expensive
|
||||
* processing.
|
||||
*/
|
||||
{
|
||||
int argn;
|
||||
char *arg;
|
||||
|
||||
/* Set up default JPEG parameters. */
|
||||
requested_fmt = DEFAULT_FMT; /* set default output file format */
|
||||
icc_filename = NULL;
|
||||
max_scans = 0;
|
||||
outfilename = NULL;
|
||||
memsrc = FALSE;
|
||||
report = FALSE;
|
||||
skip = FALSE;
|
||||
crop = FALSE;
|
||||
strict = FALSE;
|
||||
cinfo->err->trace_level = 0;
|
||||
|
||||
/* Scan command line options, adjust parameters */
|
||||
|
||||
for (argn = 1; argn < argc; argn++) {
|
||||
arg = argv[argn];
|
||||
if (*arg != '-') {
|
||||
/* Not a switch, must be a file name argument */
|
||||
if (argn <= last_file_arg_seen) {
|
||||
outfilename = NULL; /* -outfile applies to just one input file */
|
||||
continue; /* ignore this name if previously processed */
|
||||
}
|
||||
break; /* else done parsing switches */
|
||||
}
|
||||
arg++; /* advance past switch marker character */
|
||||
|
||||
if (keymatch(arg, "bmp", 1)) {
|
||||
/* BMP output format (Windows flavor). */
|
||||
requested_fmt = FMT_BMP;
|
||||
|
||||
} else if (keymatch(arg, "colors", 1) || keymatch(arg, "colours", 1) ||
|
||||
keymatch(arg, "quantize", 1) || keymatch(arg, "quantise", 1)) {
|
||||
/* Do color quantization. */
|
||||
int val;
|
||||
|
||||
if (++argn >= argc) /* advance to next argument */
|
||||
usage();
|
||||
if (sscanf(argv[argn], "%d", &val) != 1)
|
||||
usage();
|
||||
cinfo->desired_number_of_colors = val;
|
||||
cinfo->quantize_colors = TRUE;
|
||||
|
||||
} else if (keymatch(arg, "dct", 2)) {
|
||||
/* Select IDCT algorithm. */
|
||||
if (++argn >= argc) /* advance to next argument */
|
||||
usage();
|
||||
if (keymatch(argv[argn], "int", 1)) {
|
||||
cinfo->dct_method = JDCT_ISLOW;
|
||||
} else if (keymatch(argv[argn], "fast", 2)) {
|
||||
cinfo->dct_method = JDCT_IFAST;
|
||||
} else if (keymatch(argv[argn], "float", 2)) {
|
||||
cinfo->dct_method = JDCT_FLOAT;
|
||||
} else
|
||||
usage();
|
||||
|
||||
} else if (keymatch(arg, "dither", 2)) {
|
||||
/* Select dithering algorithm. */
|
||||
if (++argn >= argc) /* advance to next argument */
|
||||
usage();
|
||||
if (keymatch(argv[argn], "fs", 2)) {
|
||||
cinfo->dither_mode = JDITHER_FS;
|
||||
} else if (keymatch(argv[argn], "none", 2)) {
|
||||
cinfo->dither_mode = JDITHER_NONE;
|
||||
} else if (keymatch(argv[argn], "ordered", 2)) {
|
||||
cinfo->dither_mode = JDITHER_ORDERED;
|
||||
} else
|
||||
usage();
|
||||
|
||||
} else if (keymatch(arg, "debug", 1) || keymatch(arg, "verbose", 1)) {
|
||||
/* Enable debug printouts. */
|
||||
/* On first -d, print version identification */
|
||||
static boolean printed_version = FALSE;
|
||||
|
||||
if (!printed_version) {
|
||||
fprintf(stderr, "%s version %s (build %s)\n",
|
||||
PACKAGE_NAME, VERSION, BUILD);
|
||||
fprintf(stderr, JCOPYRIGHT1);
|
||||
fprintf(stderr, JCOPYRIGHT2 "\n");
|
||||
fprintf(stderr, "Emulating The Independent JPEG Group's software, version %s\n\n",
|
||||
JVERSION);
|
||||
printed_version = TRUE;
|
||||
}
|
||||
cinfo->err->trace_level++;
|
||||
|
||||
} else if (keymatch(arg, "version", 4)) {
|
||||
fprintf(stderr, "%s version %s (build %s)\n",
|
||||
PACKAGE_NAME, VERSION, BUILD);
|
||||
exit(EXIT_SUCCESS);
|
||||
|
||||
} else if (keymatch(arg, "fast", 1)) {
|
||||
/* Select recommended processing options for quick-and-dirty output. */
|
||||
cinfo->two_pass_quantize = FALSE;
|
||||
cinfo->dither_mode = JDITHER_ORDERED;
|
||||
if (!cinfo->quantize_colors) /* don't override an earlier -colors */
|
||||
cinfo->desired_number_of_colors = 216;
|
||||
cinfo->dct_method = JDCT_FASTEST;
|
||||
cinfo->do_fancy_upsampling = FALSE;
|
||||
|
||||
} else if (keymatch(arg, "gif", 1)) {
|
||||
/* GIF output format (LZW-compressed). */
|
||||
requested_fmt = FMT_GIF;
|
||||
|
||||
} else if (keymatch(arg, "gif0", 4)) {
|
||||
/* GIF output format (uncompressed). */
|
||||
requested_fmt = FMT_GIF0;
|
||||
|
||||
} else if (keymatch(arg, "grayscale", 2) ||
|
||||
keymatch(arg, "greyscale", 2)) {
|
||||
/* Force monochrome output. */
|
||||
cinfo->out_color_space = JCS_GRAYSCALE;
|
||||
|
||||
} else if (keymatch(arg, "rgb", 2)) {
|
||||
/* Force RGB output. */
|
||||
cinfo->out_color_space = JCS_RGB;
|
||||
|
||||
} else if (keymatch(arg, "rgb565", 2)) {
|
||||
/* Force RGB565 output. */
|
||||
cinfo->out_color_space = JCS_RGB565;
|
||||
|
||||
} else if (keymatch(arg, "icc", 1)) {
|
||||
/* Set ICC filename. */
|
||||
if (++argn >= argc) /* advance to next argument */
|
||||
usage();
|
||||
icc_filename = argv[argn];
|
||||
#ifdef SAVE_MARKERS_SUPPORTED
|
||||
jpeg_save_markers(cinfo, JPEG_APP0 + 2, 0xFFFF);
|
||||
#endif
|
||||
|
||||
} else if (keymatch(arg, "map", 3)) {
|
||||
/* Quantize to a color map taken from an input file. */
|
||||
if (++argn >= argc) /* advance to next argument */
|
||||
usage();
|
||||
if (for_real) { /* too expensive to do twice! */
|
||||
#ifdef QUANT_2PASS_SUPPORTED /* otherwise can't quantize to supplied map */
|
||||
FILE *mapfile;
|
||||
|
||||
if ((mapfile = fopen(argv[argn], READ_BINARY)) == NULL) {
|
||||
fprintf(stderr, "%s: can't open %s\n", progname, argv[argn]);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
if (cinfo->data_precision == 12)
|
||||
read_color_map_12(cinfo, mapfile);
|
||||
else
|
||||
read_color_map(cinfo, mapfile);
|
||||
fclose(mapfile);
|
||||
cinfo->quantize_colors = TRUE;
|
||||
#else
|
||||
ERREXIT(cinfo, JERR_NOT_COMPILED);
|
||||
#endif
|
||||
}
|
||||
|
||||
} else if (keymatch(arg, "maxmemory", 3)) {
|
||||
/* Maximum memory in Kb (or Mb with 'm'). */
|
||||
long lval;
|
||||
char ch = 'x';
|
||||
|
||||
if (++argn >= argc) /* advance to next argument */
|
||||
usage();
|
||||
if (sscanf(argv[argn], "%ld%c", &lval, &ch) < 1)
|
||||
usage();
|
||||
if (ch == 'm' || ch == 'M')
|
||||
lval *= 1000L;
|
||||
cinfo->mem->max_memory_to_use = lval * 1000L;
|
||||
|
||||
} else if (keymatch(arg, "maxscans", 4)) {
|
||||
if (++argn >= argc) /* advance to next argument */
|
||||
usage();
|
||||
if (sscanf(argv[argn], "%u", &max_scans) != 1)
|
||||
usage();
|
||||
|
||||
} else if (keymatch(arg, "nosmooth", 3)) {
|
||||
/* Suppress fancy upsampling */
|
||||
cinfo->do_fancy_upsampling = FALSE;
|
||||
|
||||
} else if (keymatch(arg, "onepass", 3)) {
|
||||
/* Use fast one-pass quantization. */
|
||||
cinfo->two_pass_quantize = FALSE;
|
||||
|
||||
} else if (keymatch(arg, "os2", 3)) {
|
||||
/* BMP output format (OS/2 flavor). */
|
||||
requested_fmt = FMT_OS2;
|
||||
|
||||
} else if (keymatch(arg, "outfile", 4)) {
|
||||
/* Set output file name. */
|
||||
if (++argn >= argc) /* advance to next argument */
|
||||
usage();
|
||||
outfilename = argv[argn]; /* save it away for later use */
|
||||
|
||||
} else if (keymatch(arg, "memsrc", 2)) {
|
||||
/* Use in-memory source manager */
|
||||
memsrc = TRUE;
|
||||
|
||||
} else if (keymatch(arg, "pnm", 1) || keymatch(arg, "ppm", 1)) {
|
||||
/* PPM/PGM output format. */
|
||||
requested_fmt = FMT_PPM;
|
||||
|
||||
} else if (keymatch(arg, "report", 2)) {
|
||||
report = TRUE;
|
||||
|
||||
} else if (keymatch(arg, "scale", 1)) {
|
||||
/* Scale the output image by a fraction M/N. */
|
||||
if (++argn >= argc) /* advance to next argument */
|
||||
usage();
|
||||
if (sscanf(argv[argn], "%u/%u",
|
||||
&cinfo->scale_num, &cinfo->scale_denom) != 2)
|
||||
usage();
|
||||
|
||||
} else if (keymatch(arg, "skip", 2)) {
|
||||
int temp_start = -1, temp_end = -1;
|
||||
if (++argn >= argc)
|
||||
usage();
|
||||
if (sscanf(argv[argn], "%d,%d", &temp_start, &temp_end) != 2 ||
|
||||
temp_start < 0 || temp_end < 0 || temp_start > temp_end)
|
||||
usage();
|
||||
skip = TRUE;
|
||||
skip_start = temp_start;
|
||||
skip_end = temp_end;
|
||||
|
||||
} else if (keymatch(arg, "crop", 2)) {
|
||||
int temp_width = -1, temp_height = -1, temp_x = -1, temp_y = -1;
|
||||
char c;
|
||||
if (++argn >= argc)
|
||||
usage();
|
||||
if (sscanf(argv[argn], "%d%c%d+%d+%d", &temp_width, &c, &temp_height,
|
||||
&temp_x, &temp_y) != 5 ||
|
||||
(c != 'X' && c != 'x') || temp_width < 1 || temp_height < 1 ||
|
||||
temp_x < 0 || temp_y < 0)
|
||||
usage();
|
||||
crop = TRUE;
|
||||
crop_width = temp_width;
|
||||
crop_height = temp_height;
|
||||
crop_x = temp_x;
|
||||
crop_y = temp_y;
|
||||
|
||||
} else if (keymatch(arg, "strict", 2)) {
|
||||
strict = TRUE;
|
||||
|
||||
} else if (keymatch(arg, "targa", 1)) {
|
||||
/* Targa output format. */
|
||||
requested_fmt = FMT_TARGA;
|
||||
|
||||
} else {
|
||||
usage(); /* bogus switch */
|
||||
}
|
||||
}
|
||||
|
||||
return argn; /* return index of next arg (file name) */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Marker processor for COM and interesting APPn markers.
|
||||
* This replaces the library's built-in processor, which just skips the marker.
|
||||
* We want to print out the marker as text, to the extent possible.
|
||||
* Note this code relies on a non-suspending data source.
|
||||
*/
|
||||
|
||||
LOCAL(unsigned int)
|
||||
jpeg_getc(j_decompress_ptr cinfo)
|
||||
/* Read next byte */
|
||||
{
|
||||
struct jpeg_source_mgr *datasrc = cinfo->src;
|
||||
|
||||
if (datasrc->bytes_in_buffer == 0) {
|
||||
if (!(*datasrc->fill_input_buffer) (cinfo))
|
||||
ERREXIT(cinfo, JERR_CANT_SUSPEND);
|
||||
}
|
||||
datasrc->bytes_in_buffer--;
|
||||
return *datasrc->next_input_byte++;
|
||||
}
|
||||
|
||||
|
||||
METHODDEF(boolean)
|
||||
print_text_marker(j_decompress_ptr cinfo)
|
||||
{
|
||||
boolean traceit = (cinfo->err->trace_level >= 1);
|
||||
long length;
|
||||
unsigned int ch;
|
||||
unsigned int lastch = 0;
|
||||
|
||||
length = jpeg_getc(cinfo) << 8;
|
||||
length += jpeg_getc(cinfo);
|
||||
length -= 2; /* discount the length word itself */
|
||||
|
||||
if (traceit) {
|
||||
if (cinfo->unread_marker == JPEG_COM)
|
||||
fprintf(stderr, "Comment, length %ld:\n", (long)length);
|
||||
else /* assume it is an APPn otherwise */
|
||||
fprintf(stderr, "APP%d, length %ld:\n",
|
||||
cinfo->unread_marker - JPEG_APP0, (long)length);
|
||||
}
|
||||
|
||||
while (--length >= 0) {
|
||||
ch = jpeg_getc(cinfo);
|
||||
if (traceit) {
|
||||
/* Emit the character in a readable form.
|
||||
* Nonprintables are converted to \nnn form,
|
||||
* while \ is converted to \\.
|
||||
* Newlines in CR, CR/LF, or LF form will be printed as one newline.
|
||||
*/
|
||||
if (ch == '\r') {
|
||||
fprintf(stderr, "\n");
|
||||
} else if (ch == '\n') {
|
||||
if (lastch != '\r')
|
||||
fprintf(stderr, "\n");
|
||||
} else if (ch == '\\') {
|
||||
fprintf(stderr, "\\\\");
|
||||
} else if (isprint(ch)) {
|
||||
putc(ch, stderr);
|
||||
} else {
|
||||
fprintf(stderr, "\\%03o", ch);
|
||||
}
|
||||
lastch = ch;
|
||||
}
|
||||
}
|
||||
|
||||
if (traceit)
|
||||
fprintf(stderr, "\n");
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
METHODDEF(void)
|
||||
my_emit_message(j_common_ptr cinfo, int msg_level)
|
||||
{
|
||||
if (msg_level < 0) {
|
||||
/* Treat warning as fatal */
|
||||
cinfo->err->error_exit(cinfo);
|
||||
} else {
|
||||
if (cinfo->err->trace_level >= msg_level)
|
||||
cinfo->err->output_message(cinfo);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* The main program.
|
||||
*/
|
||||
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
struct jpeg_decompress_struct cinfo;
|
||||
struct jpeg_error_mgr jerr;
|
||||
struct cdjpeg_progress_mgr progress;
|
||||
int file_index;
|
||||
djpeg_dest_ptr dest_mgr = NULL;
|
||||
FILE *input_file;
|
||||
FILE *output_file;
|
||||
unsigned char *inbuffer = NULL;
|
||||
unsigned long insize = 0;
|
||||
JDIMENSION num_scanlines;
|
||||
|
||||
progname = argv[0];
|
||||
if (progname == NULL || progname[0] == 0)
|
||||
progname = "djpeg"; /* in case C library doesn't provide it */
|
||||
|
||||
/* Initialize the JPEG decompression object with default error handling. */
|
||||
cinfo.err = jpeg_std_error(&jerr);
|
||||
jpeg_create_decompress(&cinfo);
|
||||
/* Add some application-specific error messages (from cderror.h) */
|
||||
jerr.addon_message_table = cdjpeg_message_table;
|
||||
jerr.first_addon_message = JMSG_FIRSTADDONCODE;
|
||||
jerr.last_addon_message = JMSG_LASTADDONCODE;
|
||||
|
||||
/* Insert custom marker processor for COM and APP12.
|
||||
* APP12 is used by some digital camera makers for textual info,
|
||||
* so we provide the ability to display it as text.
|
||||
* If you like, additional APPn marker types can be selected for display,
|
||||
* but don't try to override APP0 or APP14 this way (see libjpeg.txt).
|
||||
*/
|
||||
jpeg_set_marker_processor(&cinfo, JPEG_COM, print_text_marker);
|
||||
jpeg_set_marker_processor(&cinfo, JPEG_APP0 + 12, print_text_marker);
|
||||
|
||||
/* Scan command line to find file names. */
|
||||
/* It is convenient to use just one switch-parsing routine, but the switch
|
||||
* values read here are ignored; we will rescan the switches after opening
|
||||
* the input file.
|
||||
* (Exception: tracing level set here controls verbosity for COM markers
|
||||
* found during jpeg_read_header...)
|
||||
*/
|
||||
|
||||
file_index = parse_switches(&cinfo, argc, argv, 0, FALSE);
|
||||
|
||||
if (strict)
|
||||
jerr.emit_message = my_emit_message;
|
||||
|
||||
#ifdef TWO_FILE_COMMANDLINE
|
||||
/* Must have either -outfile switch or explicit output file name */
|
||||
if (outfilename == NULL) {
|
||||
if (file_index != argc - 2) {
|
||||
fprintf(stderr, "%s: must name one input and one output file\n",
|
||||
progname);
|
||||
usage();
|
||||
}
|
||||
outfilename = argv[file_index + 1];
|
||||
} else {
|
||||
if (file_index != argc - 1) {
|
||||
fprintf(stderr, "%s: must name one input and one output file\n",
|
||||
progname);
|
||||
usage();
|
||||
}
|
||||
}
|
||||
#else
|
||||
/* Unix style: expect zero or one file name */
|
||||
if (file_index < argc - 1) {
|
||||
fprintf(stderr, "%s: only one input file\n", progname);
|
||||
usage();
|
||||
}
|
||||
#endif /* TWO_FILE_COMMANDLINE */
|
||||
|
||||
/* Open the input file. */
|
||||
if (file_index < argc) {
|
||||
if ((input_file = fopen(argv[file_index], READ_BINARY)) == NULL) {
|
||||
fprintf(stderr, "%s: can't open %s\n", progname, argv[file_index]);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
} else {
|
||||
/* default input file is stdin */
|
||||
input_file = read_stdin();
|
||||
}
|
||||
|
||||
/* Open the output file. */
|
||||
if (outfilename != NULL) {
|
||||
if ((output_file = fopen(outfilename, WRITE_BINARY)) == NULL) {
|
||||
fprintf(stderr, "%s: can't open %s\n", progname, outfilename);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
} else {
|
||||
/* default output file is stdout */
|
||||
output_file = write_stdout();
|
||||
}
|
||||
|
||||
if (report || max_scans != 0) {
|
||||
start_progress_monitor((j_common_ptr)&cinfo, &progress);
|
||||
progress.report = report;
|
||||
progress.max_scans = max_scans;
|
||||
}
|
||||
|
||||
/* Specify data source for decompression */
|
||||
if (memsrc) {
|
||||
size_t nbytes;
|
||||
do {
|
||||
inbuffer = (unsigned char *)realloc(inbuffer, insize + INPUT_BUF_SIZE);
|
||||
if (inbuffer == NULL) {
|
||||
fprintf(stderr, "%s: memory allocation failure\n", progname);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
nbytes = fread(&inbuffer[insize], 1, INPUT_BUF_SIZE, input_file);
|
||||
if (nbytes < INPUT_BUF_SIZE && ferror(input_file)) {
|
||||
if (file_index < argc)
|
||||
fprintf(stderr, "%s: can't read from %s\n", progname,
|
||||
argv[file_index]);
|
||||
else
|
||||
fprintf(stderr, "%s: can't read from stdin\n", progname);
|
||||
}
|
||||
insize += (unsigned long)nbytes;
|
||||
} while (nbytes == INPUT_BUF_SIZE);
|
||||
fprintf(stderr, "Compressed size: %lu bytes\n", insize);
|
||||
jpeg_mem_src(&cinfo, inbuffer, insize);
|
||||
} else
|
||||
jpeg_stdio_src(&cinfo, input_file);
|
||||
|
||||
/* Read file header, set default decompression parameters */
|
||||
(void)jpeg_read_header(&cinfo, TRUE);
|
||||
|
||||
/* Adjust default decompression parameters by re-parsing the options */
|
||||
file_index = parse_switches(&cinfo, argc, argv, 0, TRUE);
|
||||
|
||||
/* Initialize the output module now to let it override any crucial
|
||||
* option settings (for instance, GIF wants to force color quantization).
|
||||
*/
|
||||
switch (requested_fmt) {
|
||||
#ifdef BMP_SUPPORTED
|
||||
case FMT_BMP:
|
||||
dest_mgr = jinit_write_bmp(&cinfo, FALSE, TRUE);
|
||||
break;
|
||||
case FMT_OS2:
|
||||
dest_mgr = jinit_write_bmp(&cinfo, TRUE, TRUE);
|
||||
break;
|
||||
#endif
|
||||
#ifdef GIF_SUPPORTED
|
||||
case FMT_GIF:
|
||||
if (cinfo.data_precision == 16)
|
||||
ERREXIT1(&cinfo, JERR_BAD_PRECISION, cinfo.data_precision);
|
||||
else if (cinfo.data_precision == 12)
|
||||
dest_mgr = j12init_write_gif(&cinfo, TRUE);
|
||||
else
|
||||
dest_mgr = jinit_write_gif(&cinfo, TRUE);
|
||||
break;
|
||||
case FMT_GIF0:
|
||||
dest_mgr = jinit_write_gif(&cinfo, FALSE);
|
||||
break;
|
||||
#endif
|
||||
#ifdef PPM_SUPPORTED
|
||||
case FMT_PPM:
|
||||
if (cinfo.data_precision == 16)
|
||||
#ifdef D_LOSSLESS_SUPPORTED
|
||||
dest_mgr = j16init_write_ppm(&cinfo);
|
||||
#else
|
||||
ERREXIT1(&cinfo, JERR_BAD_PRECISION, cinfo.data_precision);
|
||||
#endif
|
||||
else if (cinfo.data_precision == 12)
|
||||
dest_mgr = j12init_write_ppm(&cinfo);
|
||||
else
|
||||
dest_mgr = jinit_write_ppm(&cinfo);
|
||||
break;
|
||||
#endif
|
||||
#ifdef TARGA_SUPPORTED
|
||||
case FMT_TARGA:
|
||||
dest_mgr = jinit_write_targa(&cinfo);
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
ERREXIT(&cinfo, JERR_UNSUPPORTED_FORMAT);
|
||||
break;
|
||||
}
|
||||
dest_mgr->output_file = output_file;
|
||||
|
||||
/* Start decompressor */
|
||||
(void)jpeg_start_decompress(&cinfo);
|
||||
|
||||
/* Skip rows */
|
||||
if (skip) {
|
||||
JDIMENSION tmp;
|
||||
|
||||
/* Check for valid skip_end. We cannot check this value until after
|
||||
* jpeg_start_decompress() is called. Note that we have already verified
|
||||
* that skip_start <= skip_end.
|
||||
*/
|
||||
if (skip_end > cinfo.output_height - 1) {
|
||||
fprintf(stderr, "%s: skip region exceeds image height %u\n", progname,
|
||||
cinfo.output_height);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
/* Write output file header. This is a hack to ensure that the destination
|
||||
* manager creates an output image of the proper size.
|
||||
*/
|
||||
tmp = cinfo.output_height;
|
||||
cinfo.output_height -= (skip_end - skip_start + 1);
|
||||
(*dest_mgr->start_output) (&cinfo, dest_mgr);
|
||||
cinfo.output_height = tmp;
|
||||
|
||||
if (cinfo.data_precision == 16)
|
||||
ERREXIT(&cinfo, JERR_NOTIMPL);
|
||||
else if (cinfo.data_precision == 12) {
|
||||
/* Process data */
|
||||
while (cinfo.output_scanline < skip_start) {
|
||||
num_scanlines = jpeg12_read_scanlines(&cinfo, dest_mgr->buffer12,
|
||||
dest_mgr->buffer_height);
|
||||
(*dest_mgr->put_pixel_rows) (&cinfo, dest_mgr, num_scanlines);
|
||||
}
|
||||
if ((tmp = jpeg12_skip_scanlines(&cinfo, skip_end - skip_start + 1)) !=
|
||||
skip_end - skip_start + 1) {
|
||||
fprintf(stderr, "%s: jpeg12_skip_scanlines() returned %u rather than %u\n",
|
||||
progname, tmp, skip_end - skip_start + 1);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
while (cinfo.output_scanline < cinfo.output_height) {
|
||||
num_scanlines = jpeg12_read_scanlines(&cinfo, dest_mgr->buffer12,
|
||||
dest_mgr->buffer_height);
|
||||
(*dest_mgr->put_pixel_rows) (&cinfo, dest_mgr, num_scanlines);
|
||||
}
|
||||
} else {
|
||||
/* Process data */
|
||||
while (cinfo.output_scanline < skip_start) {
|
||||
num_scanlines = jpeg_read_scanlines(&cinfo, dest_mgr->buffer,
|
||||
dest_mgr->buffer_height);
|
||||
(*dest_mgr->put_pixel_rows) (&cinfo, dest_mgr, num_scanlines);
|
||||
}
|
||||
if ((tmp = jpeg_skip_scanlines(&cinfo, skip_end - skip_start + 1)) !=
|
||||
skip_end - skip_start + 1) {
|
||||
fprintf(stderr, "%s: jpeg_skip_scanlines() returned %u rather than %u\n",
|
||||
progname, tmp, skip_end - skip_start + 1);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
while (cinfo.output_scanline < cinfo.output_height) {
|
||||
num_scanlines = jpeg_read_scanlines(&cinfo, dest_mgr->buffer,
|
||||
dest_mgr->buffer_height);
|
||||
(*dest_mgr->put_pixel_rows) (&cinfo, dest_mgr, num_scanlines);
|
||||
}
|
||||
}
|
||||
|
||||
/* Decompress a subregion */
|
||||
} else if (crop) {
|
||||
JDIMENSION tmp;
|
||||
|
||||
/* Check for valid crop dimensions. We cannot check these values until
|
||||
* after jpeg_start_decompress() is called.
|
||||
*/
|
||||
if ((unsigned long long)crop_x + crop_width > cinfo.output_width ||
|
||||
(unsigned long long)crop_y + crop_height > cinfo.output_height) {
|
||||
fprintf(stderr, "%s: crop dimensions exceed image dimensions %u x %u\n",
|
||||
progname, cinfo.output_width, cinfo.output_height);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if (cinfo.data_precision == 16)
|
||||
ERREXIT(&cinfo, JERR_NOTIMPL);
|
||||
else if (cinfo.data_precision == 12)
|
||||
jpeg12_crop_scanline(&cinfo, &crop_x, &crop_width);
|
||||
else
|
||||
jpeg_crop_scanline(&cinfo, &crop_x, &crop_width);
|
||||
if (dest_mgr->calc_buffer_dimensions)
|
||||
(*dest_mgr->calc_buffer_dimensions) (&cinfo, dest_mgr);
|
||||
else
|
||||
ERREXIT(&cinfo, JERR_UNSUPPORTED_FORMAT);
|
||||
|
||||
/* Write output file header. This is a hack to ensure that the destination
|
||||
* manager creates an output image of the proper size.
|
||||
*/
|
||||
tmp = cinfo.output_height;
|
||||
cinfo.output_height = crop_height;
|
||||
(*dest_mgr->start_output) (&cinfo, dest_mgr);
|
||||
cinfo.output_height = tmp;
|
||||
|
||||
if (cinfo.data_precision == 16)
|
||||
ERREXIT(&cinfo, JERR_NOTIMPL);
|
||||
else if (cinfo.data_precision == 12) {
|
||||
/* Process data */
|
||||
if ((tmp = jpeg12_skip_scanlines(&cinfo, crop_y)) != crop_y) {
|
||||
fprintf(stderr, "%s: jpeg12_skip_scanlines() returned %u rather than %u\n",
|
||||
progname, tmp, crop_y);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
while (cinfo.output_scanline < crop_y + crop_height) {
|
||||
num_scanlines = jpeg12_read_scanlines(&cinfo, dest_mgr->buffer12,
|
||||
dest_mgr->buffer_height);
|
||||
(*dest_mgr->put_pixel_rows) (&cinfo, dest_mgr, num_scanlines);
|
||||
}
|
||||
if ((tmp =
|
||||
jpeg12_skip_scanlines(&cinfo, cinfo.output_height - crop_y -
|
||||
crop_height)) !=
|
||||
cinfo.output_height - crop_y - crop_height) {
|
||||
fprintf(stderr, "%s: jpeg12_skip_scanlines() returned %u rather than %u\n",
|
||||
progname, tmp, cinfo.output_height - crop_y - crop_height);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
} else {
|
||||
/* Process data */
|
||||
if ((tmp = jpeg_skip_scanlines(&cinfo, crop_y)) != crop_y) {
|
||||
fprintf(stderr, "%s: jpeg_skip_scanlines() returned %u rather than %u\n",
|
||||
progname, tmp, crop_y);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
while (cinfo.output_scanline < crop_y + crop_height) {
|
||||
num_scanlines = jpeg_read_scanlines(&cinfo, dest_mgr->buffer,
|
||||
dest_mgr->buffer_height);
|
||||
(*dest_mgr->put_pixel_rows) (&cinfo, dest_mgr, num_scanlines);
|
||||
}
|
||||
if ((tmp =
|
||||
jpeg_skip_scanlines(&cinfo,
|
||||
cinfo.output_height - crop_y - crop_height)) !=
|
||||
cinfo.output_height - crop_y - crop_height) {
|
||||
fprintf(stderr, "%s: jpeg_skip_scanlines() returned %u rather than %u\n",
|
||||
progname, tmp, cinfo.output_height - crop_y - crop_height);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
|
||||
/* Normal full-image decompress */
|
||||
} else {
|
||||
/* Write output file header */
|
||||
(*dest_mgr->start_output) (&cinfo, dest_mgr);
|
||||
|
||||
if (cinfo.data_precision == 16) {
|
||||
#ifdef D_LOSSLESS_SUPPORTED
|
||||
/* Process data */
|
||||
while (cinfo.output_scanline < cinfo.output_height) {
|
||||
num_scanlines = jpeg16_read_scanlines(&cinfo, dest_mgr->buffer16,
|
||||
dest_mgr->buffer_height);
|
||||
(*dest_mgr->put_pixel_rows) (&cinfo, dest_mgr, num_scanlines);
|
||||
}
|
||||
#else
|
||||
ERREXIT1(&cinfo, JERR_BAD_PRECISION, cinfo.data_precision);
|
||||
#endif
|
||||
} else if (cinfo.data_precision == 12) {
|
||||
/* Process data */
|
||||
while (cinfo.output_scanline < cinfo.output_height) {
|
||||
num_scanlines = jpeg12_read_scanlines(&cinfo, dest_mgr->buffer12,
|
||||
dest_mgr->buffer_height);
|
||||
(*dest_mgr->put_pixel_rows) (&cinfo, dest_mgr, num_scanlines);
|
||||
}
|
||||
} else {
|
||||
/* Process data */
|
||||
while (cinfo.output_scanline < cinfo.output_height) {
|
||||
num_scanlines = jpeg_read_scanlines(&cinfo, dest_mgr->buffer,
|
||||
dest_mgr->buffer_height);
|
||||
(*dest_mgr->put_pixel_rows) (&cinfo, dest_mgr, num_scanlines);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Hack: count final pass as done in case finish_output does an extra pass.
|
||||
* The library won't have updated completed_passes.
|
||||
*/
|
||||
if (report || max_scans != 0)
|
||||
progress.pub.completed_passes = progress.pub.total_passes;
|
||||
|
||||
if (icc_filename != NULL) {
|
||||
FILE *icc_file;
|
||||
JOCTET *icc_profile;
|
||||
unsigned int icc_len;
|
||||
|
||||
if ((icc_file = fopen(icc_filename, WRITE_BINARY)) == NULL) {
|
||||
fprintf(stderr, "%s: can't open %s\n", progname, icc_filename);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
if (jpeg_read_icc_profile(&cinfo, &icc_profile, &icc_len)) {
|
||||
if (fwrite(icc_profile, icc_len, 1, icc_file) < 1) {
|
||||
fprintf(stderr, "%s: can't read ICC profile from %s\n", progname,
|
||||
icc_filename);
|
||||
free(icc_profile);
|
||||
fclose(icc_file);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
free(icc_profile);
|
||||
fclose(icc_file);
|
||||
} else if (cinfo.err->msg_code != JWRN_BOGUS_ICC)
|
||||
fprintf(stderr, "%s: no ICC profile data in JPEG file\n", progname);
|
||||
}
|
||||
|
||||
/* Finish decompression and release memory.
|
||||
* I must do it in this order because output module has allocated memory
|
||||
* of lifespan JPOOL_IMAGE; it needs to finish before releasing memory.
|
||||
*/
|
||||
(*dest_mgr->finish_output) (&cinfo, dest_mgr);
|
||||
(void)jpeg_finish_decompress(&cinfo);
|
||||
jpeg_destroy_decompress(&cinfo);
|
||||
|
||||
/* Close files, if we opened them */
|
||||
if (input_file != stdin)
|
||||
fclose(input_file);
|
||||
if (output_file != stdout)
|
||||
fclose(output_file);
|
||||
|
||||
if (report || max_scans != 0)
|
||||
end_progress_monitor((j_common_ptr)&cinfo);
|
||||
|
||||
if (memsrc)
|
||||
free(inbuffer);
|
||||
|
||||
/* All done. */
|
||||
exit(jerr.num_warnings ? EXIT_WARNING : EXIT_SUCCESS);
|
||||
return 0; /* suppress no-return-value warnings */
|
||||
}
|
||||
@@ -1,89 +0,0 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.9.8"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TurboJPEG: Data Structures</title>
|
||||
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="jquery.js"></script>
|
||||
<script type="text/javascript" src="dynsections.js"></script>
|
||||
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="search/searchdata.js"></script>
|
||||
<script type="text/javascript" src="search/search.js"></script>
|
||||
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||
<link href="doxygen-extra.css" rel="stylesheet" type="text/css"/>
|
||||
</head>
|
||||
<body>
|
||||
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||
<div id="titlearea">
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<tbody>
|
||||
<tr id="projectrow">
|
||||
<td id="projectalign">
|
||||
<div id="projectname">TurboJPEG<span id="projectnumber"> 3.0.1</span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.9.8 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "search/",'.html');
|
||||
/* @license-end */
|
||||
</script>
|
||||
<script type="text/javascript" src="menudata.js"></script>
|
||||
<script type="text/javascript" src="menu.js"></script>
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
$(function() {
|
||||
initMenu('',true,false,'search.php','Search');
|
||||
$(document).ready(function() { init_search(); });
|
||||
});
|
||||
/* @license-end */
|
||||
</script>
|
||||
<div id="main-nav"></div>
|
||||
</div><!-- top -->
|
||||
<!-- window showing the filter options -->
|
||||
<div id="MSearchSelectWindow"
|
||||
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||
</div>
|
||||
|
||||
<!-- iframe showing the search results (closed by default) -->
|
||||
<div id="MSearchResultsWindow">
|
||||
<div id="MSearchResults">
|
||||
<div class="SRPage">
|
||||
<div id="SRIndex">
|
||||
<div id="SRResults"></div>
|
||||
<div class="SRStatus" id="Loading">Loading...</div>
|
||||
<div class="SRStatus" id="Searching">Searching...</div>
|
||||
<div class="SRStatus" id="NoMatches">No Matches</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="header">
|
||||
<div class="headertitle"><div class="title">Data Structures</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<div class="textblock">Here are the data structures with brief descriptions:</div><div class="directory">
|
||||
<table class="directory">
|
||||
<tr id="row_0_" class="even"><td class="entry"><span style="width:16px;display:inline-block;"> </span><span class="icona"><span class="icon">C</span></span><a class="el" href="structtjregion.html" target="_self">tjregion</a></td><td class="desc">Cropping region </td></tr>
|
||||
<tr id="row_1_" class="odd"><td class="entry"><span style="width:16px;display:inline-block;"> </span><span class="icona"><span class="icon">C</span></span><a class="el" href="structtjscalingfactor.html" target="_self">tjscalingfactor</a></td><td class="desc">Scaling factor </td></tr>
|
||||
<tr id="row_2_" class="even"><td class="entry"><span style="width:16px;display:inline-block;"> </span><span class="icona"><span class="icon">C</span></span><a class="el" href="structtjtransform.html" target="_self">tjtransform</a></td><td class="desc">Lossless transform </td></tr>
|
||||
</table>
|
||||
</div><!-- directory -->
|
||||
</div><!-- contents -->
|
||||
<!-- start footer part -->
|
||||
<hr class="footer"/><address class="footer"><small>
|
||||
Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.8
|
||||
</small></address>
|
||||
</body>
|
||||
</html>
|
||||
|
Before Width: | Height: | Size: 676 B |
|
Before Width: | Height: | Size: 635 B |
@@ -1,88 +0,0 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.9.8"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TurboJPEG: Data Structure Index</title>
|
||||
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="jquery.js"></script>
|
||||
<script type="text/javascript" src="dynsections.js"></script>
|
||||
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="search/searchdata.js"></script>
|
||||
<script type="text/javascript" src="search/search.js"></script>
|
||||
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||
<link href="doxygen-extra.css" rel="stylesheet" type="text/css"/>
|
||||
</head>
|
||||
<body>
|
||||
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||
<div id="titlearea">
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<tbody>
|
||||
<tr id="projectrow">
|
||||
<td id="projectalign">
|
||||
<div id="projectname">TurboJPEG<span id="projectnumber"> 3.0.1</span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.9.8 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "search/",'.html');
|
||||
/* @license-end */
|
||||
</script>
|
||||
<script type="text/javascript" src="menudata.js"></script>
|
||||
<script type="text/javascript" src="menu.js"></script>
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
$(function() {
|
||||
initMenu('',true,false,'search.php','Search');
|
||||
$(document).ready(function() { init_search(); });
|
||||
});
|
||||
/* @license-end */
|
||||
</script>
|
||||
<div id="main-nav"></div>
|
||||
</div><!-- top -->
|
||||
<!-- window showing the filter options -->
|
||||
<div id="MSearchSelectWindow"
|
||||
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||
</div>
|
||||
|
||||
<!-- iframe showing the search results (closed by default) -->
|
||||
<div id="MSearchResultsWindow">
|
||||
<div id="MSearchResults">
|
||||
<div class="SRPage">
|
||||
<div id="SRIndex">
|
||||
<div id="SRResults"></div>
|
||||
<div class="SRStatus" id="Loading">Loading...</div>
|
||||
<div class="SRStatus" id="Searching">Searching...</div>
|
||||
<div class="SRStatus" id="NoMatches">No Matches</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="header">
|
||||
<div class="headertitle"><div class="title">Data Structure Index</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<div class="qindex"><a class="qindex" href="#letter_T">T</a></div>
|
||||
<div class="classindex">
|
||||
<dl class="classindex even">
|
||||
<dt class="alphachar"><a id="letter_T" name="letter_T">T</a></dt>
|
||||
<dd><a class="el" href="structtjregion.html">tjregion</a></dd><dd><a class="el" href="structtjscalingfactor.html">tjscalingfactor</a></dd><dd><a class="el" href="structtjtransform.html">tjtransform</a></dd></dl>
|
||||
</div>
|
||||
</div><!-- contents -->
|
||||
<!-- start footer part -->
|
||||
<hr class="footer"/><address class="footer"><small>
|
||||
Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.8
|
||||
</small></address>
|
||||
</body>
|
||||
</html>
|
||||
|
Before Width: | Height: | Size: 132 B |
@@ -1,12 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"https://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" width="16" height="24" viewBox="0 0 80 60" id="doc" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve">
|
||||
<g style="fill:#4665A2">
|
||||
<path d="m 14,-1.1445312 c -2.824372,0 -5.1445313,2.320159 -5.1445312,5.1445312 v 72 c 0,2.824372 2.3201592,5.144531 5.1445312,5.144531 h 52 c 2.824372,0 5.144531,-2.320159 5.144531,-5.144531 V 23.699219 a 1.1447968,1.1447968 0 0 0 -0.01563,-0.1875 C 70.977847,22.605363 70.406495,21.99048 70.007812,21.591797 L 48.208984,-0.20898438 C 47.606104,-0.81186474 46.804652,-1.1445313 46,-1.1445312 Z m 1.144531,6.2890624 H 42.855469 V 24 c 0,1.724372 1.420159,3.144531 3.144531,3.144531 H 64.855469 V 74.855469 H 15.144531 Z m 34,4.4179688 L 60.4375,20.855469 H 49.144531 Z"/>
|
||||
</g>
|
||||
<g style="fill:#D8DFEE;stroke-width:0">
|
||||
<path d="M 3.0307167,13.993174 V 7.0307167 h 2.7576792 2.7576792 v 1.8826151 c 0,1.2578262 0.0099,1.9287572 0.029818,2.0216512 0.03884,0.181105 0.168631,0.348218 0.33827,0.43554 l 0.1355017,0.06975 1.9598092,0.0079 1.959809,0.0078 v 4.749829 4.749829 H 8 3.0307167 Z" transform="matrix(5,0,0,5,0,-30)" />
|
||||
<path d="M 9.8293515,9.0581469 V 7.9456453 l 1.1058025,1.1055492 c 0.608191,0.6080521 1.105802,1.1086775 1.105802,1.1125015 0,0.0038 -0.497611,0.007 -1.105802,0.007 H 9.8293515 Z" transform="matrix(5,0,0,5,0,-30)" />
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 1.5 KiB |
@@ -1,12 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"https://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" width="16" height="24" viewBox="0 0 80 60" id="doc" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve">
|
||||
<g style="fill:#C4CFE5">
|
||||
<path d="m 14,-1.1445312 c -2.824372,0 -5.1445313,2.320159 -5.1445312,5.1445312 v 72 c 0,2.824372 2.3201592,5.144531 5.1445312,5.144531 h 52 c 2.824372,0 5.144531,-2.320159 5.144531,-5.144531 V 23.699219 a 1.1447968,1.1447968 0 0 0 -0.01563,-0.1875 C 70.977847,22.605363 70.406495,21.99048 70.007812,21.591797 L 48.208984,-0.20898438 C 47.606104,-0.81186474 46.804652,-1.1445313 46,-1.1445312 Z m 1.144531,6.2890624 H 42.855469 V 24 c 0,1.724372 1.420159,3.144531 3.144531,3.144531 H 64.855469 V 74.855469 H 15.144531 Z m 34,4.4179688 L 60.4375,20.855469 H 49.144531 Z"/>
|
||||
</g>
|
||||
<g style="fill:#4665A2;stroke-width:0">
|
||||
<path d="M 3.0307167,13.993174 V 7.0307167 h 2.7576792 2.7576792 v 1.8826151 c 0,1.2578262 0.0099,1.9287572 0.029818,2.0216512 0.03884,0.181105 0.168631,0.348218 0.33827,0.43554 l 0.1355017,0.06975 1.9598092,0.0079 1.959809,0.0078 v 4.749829 4.749829 H 8 3.0307167 Z" transform="matrix(5,0,0,5,0,-30)" />
|
||||
<path d="M 9.8293515,9.0581469 V 7.9456453 l 1.1058025,1.1055492 c 0.608191,0.6080521 1.105802,1.1086775 1.105802,1.1125015 0,0.0038 -0.497611,0.007 -1.105802,0.007 H 9.8293515 Z" transform="matrix(5,0,0,5,0,-30)" />
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 1.5 KiB |
@@ -1,7 +0,0 @@
|
||||
code {
|
||||
color: #4665A2;
|
||||
}
|
||||
|
||||
th.markdownTableHeadNone {
|
||||
color: black;
|
||||
}
|
||||
2027
doc/html/doxygen.css
|
Before Width: | Height: | Size: 15 KiB |
@@ -1,192 +0,0 @@
|
||||
/*
|
||||
@licstart The following is the entire license notice for the JavaScript code in this file.
|
||||
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (C) 1997-2020 by Dimitri van Heesch
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software
|
||||
and associated documentation files (the "Software"), to deal in the Software without restriction,
|
||||
including without limitation the rights to use, copy, modify, merge, publish, distribute,
|
||||
sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or
|
||||
substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
|
||||
BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
@licend The above is the entire license notice for the JavaScript code in this file
|
||||
*/
|
||||
function toggleVisibility(linkObj)
|
||||
{
|
||||
var base = $(linkObj).attr('id');
|
||||
var summary = $('#'+base+'-summary');
|
||||
var content = $('#'+base+'-content');
|
||||
var trigger = $('#'+base+'-trigger');
|
||||
var src=$(trigger).attr('src');
|
||||
if (content.is(':visible')===true) {
|
||||
content.hide();
|
||||
summary.show();
|
||||
$(linkObj).addClass('closed').removeClass('opened');
|
||||
$(trigger).attr('src',src.substring(0,src.length-8)+'closed.png');
|
||||
} else {
|
||||
content.show();
|
||||
summary.hide();
|
||||
$(linkObj).removeClass('closed').addClass('opened');
|
||||
$(trigger).attr('src',src.substring(0,src.length-10)+'open.png');
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function updateStripes()
|
||||
{
|
||||
$('table.directory tr').
|
||||
removeClass('even').filter(':visible:even').addClass('even');
|
||||
$('table.directory tr').
|
||||
removeClass('odd').filter(':visible:odd').addClass('odd');
|
||||
}
|
||||
|
||||
function toggleLevel(level)
|
||||
{
|
||||
$('table.directory tr').each(function() {
|
||||
var l = this.id.split('_').length-1;
|
||||
var i = $('#img'+this.id.substring(3));
|
||||
var a = $('#arr'+this.id.substring(3));
|
||||
if (l<level+1) {
|
||||
i.removeClass('iconfopen iconfclosed').addClass('iconfopen');
|
||||
a.html('▼');
|
||||
$(this).show();
|
||||
} else if (l==level+1) {
|
||||
i.removeClass('iconfclosed iconfopen').addClass('iconfclosed');
|
||||
a.html('►');
|
||||
$(this).show();
|
||||
} else {
|
||||
$(this).hide();
|
||||
}
|
||||
});
|
||||
updateStripes();
|
||||
}
|
||||
|
||||
function toggleFolder(id)
|
||||
{
|
||||
// the clicked row
|
||||
var currentRow = $('#row_'+id);
|
||||
|
||||
// all rows after the clicked row
|
||||
var rows = currentRow.nextAll("tr");
|
||||
|
||||
var re = new RegExp('^row_'+id+'\\d+_$', "i"); //only one sub
|
||||
|
||||
// only match elements AFTER this one (can't hide elements before)
|
||||
var childRows = rows.filter(function() { return this.id.match(re); });
|
||||
|
||||
// first row is visible we are HIDING
|
||||
if (childRows.filter(':first').is(':visible')===true) {
|
||||
// replace down arrow by right arrow for current row
|
||||
var currentRowSpans = currentRow.find("span");
|
||||
currentRowSpans.filter(".iconfopen").removeClass("iconfopen").addClass("iconfclosed");
|
||||
currentRowSpans.filter(".arrow").html('►');
|
||||
rows.filter("[id^=row_"+id+"]").hide(); // hide all children
|
||||
} else { // we are SHOWING
|
||||
// replace right arrow by down arrow for current row
|
||||
var currentRowSpans = currentRow.find("span");
|
||||
currentRowSpans.filter(".iconfclosed").removeClass("iconfclosed").addClass("iconfopen");
|
||||
currentRowSpans.filter(".arrow").html('▼');
|
||||
// replace down arrows by right arrows for child rows
|
||||
var childRowsSpans = childRows.find("span");
|
||||
childRowsSpans.filter(".iconfopen").removeClass("iconfopen").addClass("iconfclosed");
|
||||
childRowsSpans.filter(".arrow").html('►');
|
||||
childRows.show(); //show all children
|
||||
}
|
||||
updateStripes();
|
||||
}
|
||||
|
||||
|
||||
function toggleInherit(id)
|
||||
{
|
||||
var rows = $('tr.inherit.'+id);
|
||||
var img = $('tr.inherit_header.'+id+' img');
|
||||
var src = $(img).attr('src');
|
||||
if (rows.filter(':first').is(':visible')===true) {
|
||||
rows.css('display','none');
|
||||
$(img).attr('src',src.substring(0,src.length-8)+'closed.png');
|
||||
} else {
|
||||
rows.css('display','table-row'); // using show() causes jump in firefox
|
||||
$(img).attr('src',src.substring(0,src.length-10)+'open.png');
|
||||
}
|
||||
}
|
||||
|
||||
var opened=true;
|
||||
// in case HTML_COLORSTYLE is LIGHT or DARK the vars will be replaced, so we write them out explicitly and use double quotes
|
||||
var plusImg = [ "var(--fold-plus-image)", "var(--fold-plus-image-relpath)" ];
|
||||
var minusImg = [ "var(--fold-minus-image)", "var(--fold-minus-image-relpath)" ];
|
||||
|
||||
// toggle all folding blocks
|
||||
function codefold_toggle_all(relPath) {
|
||||
if (opened) {
|
||||
$('#fold_all').css('background-image',plusImg[relPath]);
|
||||
$('div[id^=foldopen]').hide();
|
||||
$('div[id^=foldclosed]').show();
|
||||
} else {
|
||||
$('#fold_all').css('background-image',minusImg[relPath]);
|
||||
$('div[id^=foldopen]').show();
|
||||
$('div[id^=foldclosed]').hide();
|
||||
}
|
||||
opened=!opened;
|
||||
}
|
||||
|
||||
// toggle single folding block
|
||||
function codefold_toggle(id) {
|
||||
$('#foldopen'+id).toggle();
|
||||
$('#foldclosed'+id).toggle();
|
||||
}
|
||||
function init_codefold(relPath) {
|
||||
$('span[class=lineno]').css(
|
||||
{'padding-right':'4px',
|
||||
'margin-right':'2px',
|
||||
'display':'inline-block',
|
||||
'width':'54px',
|
||||
'background':'linear-gradient(var(--fold-line-color),var(--fold-line-color)) no-repeat 46px/2px 100%'
|
||||
});
|
||||
// add global toggle to first line
|
||||
$('span[class=lineno]:first').append('<span class="fold" id="fold_all" '+
|
||||
'onclick="javascript:codefold_toggle_all('+relPath+');" '+
|
||||
'style="background-image:'+minusImg[relPath]+';"></span>');
|
||||
// add vertical lines to other rows
|
||||
$('span[class=lineno]').not(':eq(0)').append('<span class="fold"></span>');
|
||||
// add toggle controls to lines with fold divs
|
||||
$('div[class=foldopen]').each(function() {
|
||||
// extract specific id to use
|
||||
var id = $(this).attr('id').replace('foldopen','');
|
||||
// extract start and end foldable fragment attributes
|
||||
var start = $(this).attr('data-start');
|
||||
var end = $(this).attr('data-end');
|
||||
// replace normal fold span with controls for the first line of a foldable fragment
|
||||
$(this).find('span[class=fold]:first').replaceWith('<span class="fold" '+
|
||||
'onclick="javascript:codefold_toggle(\''+id+'\');" '+
|
||||
'style="background-image:'+minusImg[relPath]+';"></span>');
|
||||
// append div for folded (closed) representation
|
||||
$(this).after('<div id="foldclosed'+id+'" class="foldclosed" style="display:none;"></div>');
|
||||
// extract the first line from the "open" section to represent closed content
|
||||
var line = $(this).children().first().clone();
|
||||
// remove any glow that might still be active on the original line
|
||||
$(line).removeClass('glow');
|
||||
if (start) {
|
||||
// if line already ends with a start marker (e.g. trailing {), remove it
|
||||
$(line).html($(line).html().replace(new RegExp('\\s*'+start+'\\s*$','g'),''));
|
||||
}
|
||||
// replace minus with plus symbol
|
||||
$(line).find('span[class=fold]').css('background-image',plusImg[relPath]);
|
||||
// append ellipsis
|
||||
$(line).append(' '+start+'<a href="javascript:codefold_toggle(\''+id+'\')">…</a>'+end);
|
||||
// insert constructed line into closed div
|
||||
$('#foldclosed'+id).html(line);
|
||||
});
|
||||
}
|
||||
|
||||
/* @license-end */
|
||||
@@ -1,11 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"https://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" width="16" height="24" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve">
|
||||
<g style="fill:#4665A2;">
|
||||
<path d="M1,5.998l-0,16.002c-0,1.326 0.527,2.598 1.464,3.536c0.938,0.937 2.21,1.464 3.536,1.464c5.322,0 14.678,-0 20,0c1.326,0 2.598,-0.527 3.536,-1.464c0.937,-0.938 1.464,-2.21 1.464,-3.536c0,-3.486 0,-8.514 0,-12c0,-1.326 -0.527,-2.598 -1.464,-3.536c-0.938,-0.937 -2.21,-1.464 -3.536,-1.464c-0,0 -10.586,0 -10.586,0c0,-0 -3.707,-3.707 -3.707,-3.707c-0.187,-0.188 -0.442,-0.293 -0.707,-0.293l-5.002,0c-2.76,0 -4.998,2.238 -4.998,4.998Zm2,-0l-0,16.002c-0,0.796 0.316,1.559 0.879,2.121c0.562,0.563 1.325,0.879 2.121,0.879l20,0c0.796,0 1.559,-0.316 2.121,-0.879c0.563,-0.562 0.879,-1.325 0.879,-2.121c0,-3.486 0,-8.514 0,-12c0,-0.796 -0.316,-1.559 -0.879,-2.121c-0.562,-0.563 -1.325,-0.879 -2.121,-0.879c-7.738,0 -11,0 -11,0c-0.265,0 -0.52,-0.105 -0.707,-0.293c-0,0 -3.707,-3.707 -3.707,-3.707c-0,0 -4.588,0 -4.588,0c-1.656,0 -2.998,1.342 -2.998,2.998Z"/>
|
||||
</g>
|
||||
<g style="fill:#D8DFEE;stroke-width:0;">
|
||||
<path d="M 5.6063709,24.951908 C 4.3924646,24.775461 3.4197129,23.899792 3.1031586,22.698521 L 3.0216155,22.389078 V 13.997725 5.6063709 L 3.1037477,5.2982247 C 3.3956682,4.2029881 4.1802788,3.412126 5.2787258,3.105917 5.5646428,3.0262132 5.6154982,3.0244963 8.0611641,3.0119829 l 2.4911989,-0.012746 1.932009,1.9300342 c 1.344142,1.3427669 1.976319,1.9498819 2.07763,1.9952626 0.137456,0.061571 0.474218,0.066269 6.006826,0.083795 l 5.861206,0.018568 0.29124,0.081916 c 1.094895,0.3079569 1.890116,1.109428 2.175567,2.192667 l 0.08154,0.3094425 V 16 22.389078 l -0.08154,0.309443 c -0.28446,1.079482 -1.086411,1.888085 -2.175567,2.193614 l -0.29124,0.0817 -10.302616,0.0049 c -5.700217,0.0027 -10.4001945,-0.0093 -10.5210471,-0.02684 z"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 1.9 KiB |
@@ -1,11 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"https://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" width="16" height="24" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve">
|
||||
<g style="fill:#C4CFE5;">
|
||||
<path d="M1,5.998l-0,16.002c-0,1.326 0.527,2.598 1.464,3.536c0.938,0.937 2.21,1.464 3.536,1.464c5.322,0 14.678,-0 20,0c1.326,0 2.598,-0.527 3.536,-1.464c0.937,-0.938 1.464,-2.21 1.464,-3.536c0,-3.486 0,-8.514 0,-12c0,-1.326 -0.527,-2.598 -1.464,-3.536c-0.938,-0.937 -2.21,-1.464 -3.536,-1.464c-0,0 -10.586,0 -10.586,0c0,-0 -3.707,-3.707 -3.707,-3.707c-0.187,-0.188 -0.442,-0.293 -0.707,-0.293l-5.002,0c-2.76,0 -4.998,2.238 -4.998,4.998Zm2,-0l-0,16.002c-0,0.796 0.316,1.559 0.879,2.121c0.562,0.563 1.325,0.879 2.121,0.879l20,0c0.796,0 1.559,-0.316 2.121,-0.879c0.563,-0.562 0.879,-1.325 0.879,-2.121c0,-3.486 0,-8.514 0,-12c0,-0.796 -0.316,-1.559 -0.879,-2.121c-0.562,-0.563 -1.325,-0.879 -2.121,-0.879c-7.738,0 -11,0 -11,0c-0.265,0 -0.52,-0.105 -0.707,-0.293c-0,0 -3.707,-3.707 -3.707,-3.707c-0,0 -4.588,0 -4.588,0c-1.656,0 -2.998,1.342 -2.998,2.998Z"/>
|
||||
</g>
|
||||
<g style="fill:#4665A2;stroke-width:0;">
|
||||
<path d="M 5.6063709,24.951908 C 4.3924646,24.775461 3.4197129,23.899792 3.1031586,22.698521 L 3.0216155,22.389078 V 13.997725 5.6063709 L 3.1037477,5.2982247 C 3.3956682,4.2029881 4.1802788,3.412126 5.2787258,3.105917 5.5646428,3.0262132 5.6154982,3.0244963 8.0611641,3.0119829 l 2.4911989,-0.012746 1.932009,1.9300342 c 1.344142,1.3427669 1.976319,1.9498819 2.07763,1.9952626 0.137456,0.061571 0.474218,0.066269 6.006826,0.083795 l 5.861206,0.018568 0.29124,0.081916 c 1.094895,0.3079569 1.890116,1.109428 2.175567,2.192667 l 0.08154,0.3094425 V 16 22.389078 l -0.08154,0.309443 c -0.28446,1.079482 -1.086411,1.888085 -2.175567,2.193614 l -0.29124,0.0817 -10.302616,0.0049 c -5.700217,0.0027 -10.4001945,-0.0093 -10.5210471,-0.02684 z"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 1.9 KiB |
@@ -1,17 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"https://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" width="16" height="24" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve">
|
||||
<g style="fill:#4665A2;">
|
||||
<path
|
||||
d="M1,5.998l0,16.002c-0,1.326 0.527,2.598 1.464,3.536c0.938,0.937 2.21,1.464 3.536,1.464c5.322,0 14.678,-0 20,0c1.326,0 2.598,-0.527 3.536,-1.464c0.937,-0.938 1.464,-2.21 1.464,-3.536c0,-3.486 0,-8.514 0,-12c0,-1.326 -0.527,-2.598 -1.464,-3.536c-0.938,-0.937 -2.21,-1.464 -3.536,-1.464c-0,0 -10.586,0 -10.586,0c0,-0 -3.707,-3.707 -3.707,-3.707c-0.187,-0.188 -0.442,-0.293 -0.707,-0.293l-5.002,0c-2.76,0 -4.998,2.238 -4.998,4.998Zm28,14.415l-3.456,-5.925c-0.538,-0.921 -1.524,-1.488 -2.591,-1.488c-0,0 -12.905,0 -12.906,0c-1.067,0 -2.053,0.567 -2.591,1.488l-4.453,7.635c0.03,0.751 0.342,1.465 0.876,1.998c0.562,0.563 1.325,0.879 2.121,0.879l20,0c0.796,0 1.559,-0.316 2.121,-0.879c0.563,-0.562 0.879,-1.325 0.879,-2.121l0,-1.587Zm0,-3.969l0,-6.444c0,-0.796 -0.316,-1.559 -0.879,-2.121c-0.562,-0.563 -1.325,-0.879 -2.121,-0.879c-7.738,0 -11,0 -11,0c-0.265,0 -0.52,-0.105 -0.707,-0.293c-0,0 -3.707,-3.707 -3.707,-3.707c-0,0 -4.588,0 -4.588,0c-1.656,0 -2.998,1.342 -2.998,2.998l0,12.16l2.729,-4.677c0.896,-1.536 2.54,-2.481 4.318,-2.481c3.354,0 9.552,0 12.906,0c1.778,0 3.422,0.945 4.318,2.481l1.729,2.963Z"
|
||||
id="path2" />
|
||||
</g>
|
||||
<g style="fill:#D8DFEE;stroke-width:0;">
|
||||
<path
|
||||
d="M 5.3879408,24.913408 C 4.1598821,24.650818 3.1571088,23.558656 3.053503,22.370876 L 3.0312746,22.116041 5.2606813,18.293515 C 6.486855,16.191126 7.5598351,14.372696 7.6450818,14.25256 8.0043056,13.746312 8.5423079,13.363007 9.2104664,13.137285 l 0.2548351,-0.08609 6.9294785,-0.0097 c 6.805096,-0.0095 6.934944,-0.0084 7.234011,0.06267 0.695577,0.165199 1.290483,0.557253 1.714887,1.130141 0.08158,0.110125 0.938747,1.556711 1.90481,3.214634 l 1.756479,3.014406 -0.0186,0.971942 c -0.01387,0.724723 -0.03365,1.032131 -0.07778,1.208575 -0.242792,0.970733 -0.88732,1.735415 -1.772382,2.102793 -0.58835,0.244217 0.247209,0.227436 -11.161974,0.224159 -9.0281537,-0.0026 -10.3636023,-0.0098 -10.5862902,-0.05746 z"
|
||||
id="path199" /><path
|
||||
d="M 3.0126385,11.849829 3.0235061,5.5881684 3.1020974,5.2969283 C 3.3478146,4.3863605 3.93576,3.6757372 4.756668,3.2971229 5.3293315,3.0330025 5.1813272,3.0450949 8.0130385,3.0310668 l 2.5522875,-0.012644 1.918693,1.9107086 c 1.404146,1.3983023 1.964459,1.9332518 2.089351,1.9947704 l 0.170657,0.084062 5.897611,0.019367 c 5.553257,0.018236 5.910365,0.023213 6.116041,0.085231 1.102257,0.3323708 1.857042,1.1184422 2.154229,2.2435244 0.05645,0.2137228 0.06373,0.5643981 0.07519,3.6220748 0.0076,2.032169 -5.42e-4,3.370979 -0.02041,3.349261 -0.0182,-0.0199 -0.414296,-0.691472 -0.880217,-1.492382 -0.46592,-0.80091 -0.93093,-1.577954 -1.033354,-1.726764 -0.735716,-1.0689 -1.983568,-1.844244 -3.315972,-2.060353 -0.280375,-0.04548 -1.345158,-0.05334 -7.238708,-0.05347 -4.713933,-1.09e-4 -6.9931825,0.01221 -7.1717862,0.03874 -1.3002273,0.193134 -2.4770512,0.889916 -3.283628,1.944192 -0.1076466,0.140705 -0.8359664,1.353438 -1.6184885,2.694963 L 3.0017709,18.11149 Z"
|
||||
id="path201" />
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 3.2 KiB |
@@ -1,12 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"https://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" width="16" height="24" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve">
|
||||
<g style="fill:#C4CFE5;">
|
||||
<path d="M1,5.998l0,16.002c-0,1.326 0.527,2.598 1.464,3.536c0.938,0.937 2.21,1.464 3.536,1.464c5.322,0 14.678,-0 20,0c1.326,0 2.598,-0.527 3.536,-1.464c0.937,-0.938 1.464,-2.21 1.464,-3.536c0,-3.486 0,-8.514 0,-12c0,-1.326 -0.527,-2.598 -1.464,-3.536c-0.938,-0.937 -2.21,-1.464 -3.536,-1.464c-0,0 -10.586,0 -10.586,0c0,-0 -3.707,-3.707 -3.707,-3.707c-0.187,-0.188 -0.442,-0.293 -0.707,-0.293l-5.002,0c-2.76,0 -4.998,2.238 -4.998,4.998Zm28,14.415l-3.456,-5.925c-0.538,-0.921 -1.524,-1.488 -2.591,-1.488c-0,0 -12.905,0 -12.906,0c-1.067,0 -2.053,0.567 -2.591,1.488l-4.453,7.635c0.03,0.751 0.342,1.465 0.876,1.998c0.562,0.563 1.325,0.879 2.121,0.879l20,0c0.796,0 1.559,-0.316 2.121,-0.879c0.563,-0.562 0.879,-1.325 0.879,-2.121l0,-1.587Zm0,-3.969l0,-6.444c0,-0.796 -0.316,-1.559 -0.879,-2.121c-0.562,-0.563 -1.325,-0.879 -2.121,-0.879c-7.738,0 -11,0 -11,0c-0.265,0 -0.52,-0.105 -0.707,-0.293c-0,0 -3.707,-3.707 -3.707,-3.707c-0,0 -4.588,0 -4.588,0c-1.656,0 -2.998,1.342 -2.998,2.998l0,12.16l2.729,-4.677c0.896,-1.536 2.54,-2.481 4.318,-2.481c3.354,0 9.552,0 12.906,0c1.778,0 3.422,0.945 4.318,2.481l1.729,2.963Z"/>
|
||||
</g>
|
||||
<g style="fill:#4665A2;stroke-width:0;">
|
||||
<path d="M 5.3879408,24.913408 C 4.1598821,24.650818 3.1571088,23.558656 3.053503,22.370876 L 3.0312746,22.116041 5.2606813,18.293515 C 6.486855,16.191126 7.5598351,14.372696 7.6450818,14.25256 8.0043056,13.746312 8.5423079,13.363007 9.2104664,13.137285 l 0.2548351,-0.08609 6.9294785,-0.0097 c 6.805096,-0.0095 6.934944,-0.0084 7.234011,0.06267 0.695577,0.165199 1.290483,0.557253 1.714887,1.130141 0.08158,0.110125 0.938747,1.556711 1.90481,3.214634 l 1.756479,3.014406 -0.0186,0.971942 c -0.01387,0.724723 -0.03365,1.032131 -0.07778,1.208575 -0.242792,0.970733 -0.88732,1.735415 -1.772382,2.102793 -0.58835,0.244217 0.247209,0.227436 -11.161974,0.224159 -9.0281537,-0.0026 -10.3636023,-0.0098 -10.5862902,-0.05746 z" />
|
||||
<path d="M 3.0126385,11.849829 3.0235061,5.5881684 3.1020974,5.2969283 C 3.3478146,4.3863605 3.93576,3.6757372 4.756668,3.2971229 5.3293315,3.0330025 5.1813272,3.0450949 8.0130385,3.0310668 l 2.5522875,-0.012644 1.918693,1.9107086 c 1.404146,1.3983023 1.964459,1.9332518 2.089351,1.9947704 l 0.170657,0.084062 5.897611,0.019367 c 5.553257,0.018236 5.910365,0.023213 6.116041,0.085231 1.102257,0.3323708 1.857042,1.1184422 2.154229,2.2435244 0.05645,0.2137228 0.06373,0.5643981 0.07519,3.6220748 0.0076,2.032169 -5.42e-4,3.370979 -0.02041,3.349261 -0.0182,-0.0199 -0.414296,-0.691472 -0.880217,-1.492382 -0.46592,-0.80091 -0.93093,-1.577954 -1.033354,-1.726764 -0.735716,-1.0689 -1.983568,-1.844244 -3.315972,-2.060353 -0.280375,-0.04548 -1.345158,-0.05334 -7.238708,-0.05347 -4.713933,-1.09e-4 -6.9931825,0.01221 -7.1717862,0.03874 -1.3002273,0.193134 -2.4770512,0.889916 -3.283628,1.944192 -0.1076466,0.140705 -0.8359664,1.353438 -1.6184885,2.694963 L 3.0017709,18.11149 Z" />
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 3.1 KiB |
@@ -1,92 +0,0 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.9.8"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TurboJPEG: Data Fields</title>
|
||||
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="jquery.js"></script>
|
||||
<script type="text/javascript" src="dynsections.js"></script>
|
||||
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="search/searchdata.js"></script>
|
||||
<script type="text/javascript" src="search/search.js"></script>
|
||||
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||
<link href="doxygen-extra.css" rel="stylesheet" type="text/css"/>
|
||||
</head>
|
||||
<body>
|
||||
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||
<div id="titlearea">
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<tbody>
|
||||
<tr id="projectrow">
|
||||
<td id="projectalign">
|
||||
<div id="projectname">TurboJPEG<span id="projectnumber"> 3.0.1</span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.9.8 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "search/",'.html');
|
||||
/* @license-end */
|
||||
</script>
|
||||
<script type="text/javascript" src="menudata.js"></script>
|
||||
<script type="text/javascript" src="menu.js"></script>
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
$(function() {
|
||||
initMenu('',true,false,'search.php','Search');
|
||||
$(document).ready(function() { init_search(); });
|
||||
});
|
||||
/* @license-end */
|
||||
</script>
|
||||
<div id="main-nav"></div>
|
||||
</div><!-- top -->
|
||||
<!-- window showing the filter options -->
|
||||
<div id="MSearchSelectWindow"
|
||||
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||
</div>
|
||||
|
||||
<!-- iframe showing the search results (closed by default) -->
|
||||
<div id="MSearchResultsWindow">
|
||||
<div id="MSearchResults">
|
||||
<div class="SRPage">
|
||||
<div id="SRIndex">
|
||||
<div id="SRResults"></div>
|
||||
<div class="SRStatus" id="Loading">Loading...</div>
|
||||
<div class="SRStatus" id="Searching">Searching...</div>
|
||||
<div class="SRStatus" id="NoMatches">No Matches</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="contents">
|
||||
<div class="textblock">Here is a list of all documented struct and union fields with links to the struct/union documentation for each field:</div><ul>
|
||||
<li>customFilter : <a class="el" href="structtjtransform.html#a0dc7697d59a7abe48afc629e96cbc1d2">tjtransform</a></li>
|
||||
<li>data : <a class="el" href="structtjtransform.html#a688fe8f1a8ecc12a538d9e561cf338e3">tjtransform</a></li>
|
||||
<li>denom : <a class="el" href="structtjscalingfactor.html#aefbcdf3e9e62274b2d312c695f133ce3">tjscalingfactor</a></li>
|
||||
<li>h : <a class="el" href="structtjregion.html#aecefc45a26f4d8b60dd4d825c1710115">tjregion</a></li>
|
||||
<li>num : <a class="el" href="structtjscalingfactor.html#a9b011e57f981ee23083e2c1aa5e640ec">tjscalingfactor</a></li>
|
||||
<li>op : <a class="el" href="structtjtransform.html#a2525aab4ba6978a1c273f74fef50e498">tjtransform</a></li>
|
||||
<li>options : <a class="el" href="structtjtransform.html#ac0e74655baa4402209a21e1ae481c8f6">tjtransform</a></li>
|
||||
<li>r : <a class="el" href="structtjtransform.html#ac324e5e442abec8a961e5bf219db12cf">tjtransform</a></li>
|
||||
<li>w : <a class="el" href="structtjregion.html#ab6eb73ceef584fc23c8c8097926dce42">tjregion</a></li>
|
||||
<li>x : <a class="el" href="structtjregion.html#a4b6a37a93997091b26a75831fa291ad9">tjregion</a></li>
|
||||
<li>y : <a class="el" href="structtjregion.html#a7b3e0c24cfe87acc80e334cafdcf22c2">tjregion</a></li>
|
||||
</ul>
|
||||
</div><!-- contents -->
|
||||
<!-- start footer part -->
|
||||
<hr class="footer"/><address class="footer"><small>
|
||||
Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.8
|
||||
</small></address>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,92 +0,0 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.9.8"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TurboJPEG: Data Fields - Variables</title>
|
||||
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="jquery.js"></script>
|
||||
<script type="text/javascript" src="dynsections.js"></script>
|
||||
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="search/searchdata.js"></script>
|
||||
<script type="text/javascript" src="search/search.js"></script>
|
||||
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||
<link href="doxygen-extra.css" rel="stylesheet" type="text/css"/>
|
||||
</head>
|
||||
<body>
|
||||
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||
<div id="titlearea">
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<tbody>
|
||||
<tr id="projectrow">
|
||||
<td id="projectalign">
|
||||
<div id="projectname">TurboJPEG<span id="projectnumber"> 3.0.1</span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.9.8 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "search/",'.html');
|
||||
/* @license-end */
|
||||
</script>
|
||||
<script type="text/javascript" src="menudata.js"></script>
|
||||
<script type="text/javascript" src="menu.js"></script>
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
$(function() {
|
||||
initMenu('',true,false,'search.php','Search');
|
||||
$(document).ready(function() { init_search(); });
|
||||
});
|
||||
/* @license-end */
|
||||
</script>
|
||||
<div id="main-nav"></div>
|
||||
</div><!-- top -->
|
||||
<!-- window showing the filter options -->
|
||||
<div id="MSearchSelectWindow"
|
||||
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||
</div>
|
||||
|
||||
<!-- iframe showing the search results (closed by default) -->
|
||||
<div id="MSearchResultsWindow">
|
||||
<div id="MSearchResults">
|
||||
<div class="SRPage">
|
||||
<div id="SRIndex">
|
||||
<div id="SRResults"></div>
|
||||
<div class="SRStatus" id="Loading">Loading...</div>
|
||||
<div class="SRStatus" id="Searching">Searching...</div>
|
||||
<div class="SRStatus" id="NoMatches">No Matches</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="contents">
|
||||
<div class="textblock">Here is a list of all documented variables with links to the struct/union documentation for each field:</div><ul>
|
||||
<li>customFilter : <a class="el" href="structtjtransform.html#a0dc7697d59a7abe48afc629e96cbc1d2">tjtransform</a></li>
|
||||
<li>data : <a class="el" href="structtjtransform.html#a688fe8f1a8ecc12a538d9e561cf338e3">tjtransform</a></li>
|
||||
<li>denom : <a class="el" href="structtjscalingfactor.html#aefbcdf3e9e62274b2d312c695f133ce3">tjscalingfactor</a></li>
|
||||
<li>h : <a class="el" href="structtjregion.html#aecefc45a26f4d8b60dd4d825c1710115">tjregion</a></li>
|
||||
<li>num : <a class="el" href="structtjscalingfactor.html#a9b011e57f981ee23083e2c1aa5e640ec">tjscalingfactor</a></li>
|
||||
<li>op : <a class="el" href="structtjtransform.html#a2525aab4ba6978a1c273f74fef50e498">tjtransform</a></li>
|
||||
<li>options : <a class="el" href="structtjtransform.html#ac0e74655baa4402209a21e1ae481c8f6">tjtransform</a></li>
|
||||
<li>r : <a class="el" href="structtjtransform.html#ac324e5e442abec8a961e5bf219db12cf">tjtransform</a></li>
|
||||
<li>w : <a class="el" href="structtjregion.html#ab6eb73ceef584fc23c8c8097926dce42">tjregion</a></li>
|
||||
<li>x : <a class="el" href="structtjregion.html#a4b6a37a93997091b26a75831fa291ad9">tjregion</a></li>
|
||||
<li>y : <a class="el" href="structtjregion.html#a7b3e0c24cfe87acc80e334cafdcf22c2">tjregion</a></li>
|
||||
</ul>
|
||||
</div><!-- contents -->
|
||||
<!-- start footer part -->
|
||||
<hr class="footer"/><address class="footer"><small>
|
||||
Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.8
|
||||
</small></address>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,82 +0,0 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.9.8"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TurboJPEG: Main Page</title>
|
||||
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="jquery.js"></script>
|
||||
<script type="text/javascript" src="dynsections.js"></script>
|
||||
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="search/searchdata.js"></script>
|
||||
<script type="text/javascript" src="search/search.js"></script>
|
||||
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||
<link href="doxygen-extra.css" rel="stylesheet" type="text/css"/>
|
||||
</head>
|
||||
<body>
|
||||
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||
<div id="titlearea">
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<tbody>
|
||||
<tr id="projectrow">
|
||||
<td id="projectalign">
|
||||
<div id="projectname">TurboJPEG<span id="projectnumber"> 3.0.1</span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.9.8 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "search/",'.html');
|
||||
/* @license-end */
|
||||
</script>
|
||||
<script type="text/javascript" src="menudata.js"></script>
|
||||
<script type="text/javascript" src="menu.js"></script>
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
$(function() {
|
||||
initMenu('',true,false,'search.php','Search');
|
||||
$(document).ready(function() { init_search(); });
|
||||
});
|
||||
/* @license-end */
|
||||
</script>
|
||||
<div id="main-nav"></div>
|
||||
</div><!-- top -->
|
||||
<!-- window showing the filter options -->
|
||||
<div id="MSearchSelectWindow"
|
||||
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||
</div>
|
||||
|
||||
<!-- iframe showing the search results (closed by default) -->
|
||||
<div id="MSearchResultsWindow">
|
||||
<div id="MSearchResults">
|
||||
<div class="SRPage">
|
||||
<div id="SRIndex">
|
||||
<div id="SRResults"></div>
|
||||
<div class="SRStatus" id="Loading">Loading...</div>
|
||||
<div class="SRStatus" id="Searching">Searching...</div>
|
||||
<div class="SRStatus" id="NoMatches">No Matches</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="header">
|
||||
<div class="headertitle"><div class="title">TurboJPEG Documentation</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
</div><!-- contents -->
|
||||
<!-- start footer part -->
|
||||
<hr class="footer"/><address class="footer"><small>
|
||||
Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.8
|
||||
</small></address>
|
||||
</body>
|
||||
</html>
|
||||
34
doc/html/jquery.js
vendored
136
doc/html/menu.js
@@ -1,136 +0,0 @@
|
||||
/*
|
||||
@licstart The following is the entire license notice for the JavaScript code in this file.
|
||||
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (C) 1997-2020 by Dimitri van Heesch
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software
|
||||
and associated documentation files (the "Software"), to deal in the Software without restriction,
|
||||
including without limitation the rights to use, copy, modify, merge, publish, distribute,
|
||||
sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or
|
||||
substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
|
||||
BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
@licend The above is the entire license notice for the JavaScript code in this file
|
||||
*/
|
||||
function initMenu(relPath,searchEnabled,serverSide,searchPage,search) {
|
||||
function makeTree(data,relPath) {
|
||||
var result='';
|
||||
if ('children' in data) {
|
||||
result+='<ul>';
|
||||
for (var i in data.children) {
|
||||
var url;
|
||||
var link;
|
||||
link = data.children[i].url;
|
||||
if (link.substring(0,1)=='^') {
|
||||
url = link.substring(1);
|
||||
} else {
|
||||
url = relPath+link;
|
||||
}
|
||||
result+='<li><a href="'+url+'">'+
|
||||
data.children[i].text+'</a>'+
|
||||
makeTree(data.children[i],relPath)+'</li>';
|
||||
}
|
||||
result+='</ul>';
|
||||
}
|
||||
return result;
|
||||
}
|
||||
var searchBoxHtml;
|
||||
if (searchEnabled) {
|
||||
if (serverSide) {
|
||||
searchBoxHtml='<div id="MSearchBox" class="MSearchBoxInactive">'+
|
||||
'<div class="left">'+
|
||||
'<form id="FSearchBox" action="'+relPath+searchPage+
|
||||
'" method="get"><span id="MSearchSelectExt"> </span>'+
|
||||
'<input type="text" id="MSearchField" name="query" value="" placeholder="'+search+
|
||||
'" size="20" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)"'+
|
||||
' onblur="searchBox.OnSearchFieldFocus(false)"/>'+
|
||||
'</form>'+
|
||||
'</div>'+
|
||||
'<div class="right"></div>'+
|
||||
'</div>';
|
||||
} else {
|
||||
searchBoxHtml='<div id="MSearchBox" class="MSearchBoxInactive">'+
|
||||
'<span class="left">'+
|
||||
'<span id="MSearchSelect" onmouseover="return searchBox.OnSearchSelectShow()"'+
|
||||
' onmouseout="return searchBox.OnSearchSelectHide()"> </span>'+
|
||||
'<input type="text" id="MSearchField" value="" placeholder="'+search+
|
||||
'" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" '+
|
||||
'onblur="searchBox.OnSearchFieldFocus(false)" '+
|
||||
'onkeyup="searchBox.OnSearchFieldChange(event)"/>'+
|
||||
'</span>'+
|
||||
'<span class="right"><a id="MSearchClose" '+
|
||||
'href="javascript:searchBox.CloseResultsWindow()">'+
|
||||
'<img id="MSearchCloseImg" border="0" src="'+relPath+
|
||||
'search/close.svg" alt=""/></a>'+
|
||||
'</span>'+
|
||||
'</div>';
|
||||
}
|
||||
}
|
||||
|
||||
$('#main-nav').before('<div class="sm sm-dox"><input id="main-menu-state" type="checkbox"/>'+
|
||||
'<label class="main-menu-btn" for="main-menu-state">'+
|
||||
'<span class="main-menu-btn-icon"></span> '+
|
||||
'Toggle main menu visibility</label>'+
|
||||
'<span id="searchBoxPos1" style="position:absolute;right:8px;top:8px;height:36px;"></span>'+
|
||||
'</div>');
|
||||
$('#main-nav').append(makeTree(menudata,relPath));
|
||||
$('#main-nav').children(':first').addClass('sm sm-dox').attr('id','main-menu');
|
||||
if (searchBoxHtml) {
|
||||
$('#main-menu').append('<li id="searchBoxPos2" style="float:right"></li>');
|
||||
}
|
||||
var $mainMenuState = $('#main-menu-state');
|
||||
var prevWidth = 0;
|
||||
if ($mainMenuState.length) {
|
||||
function initResizableIfExists() {
|
||||
if (typeof initResizable==='function') initResizable();
|
||||
}
|
||||
// animate mobile menu
|
||||
$mainMenuState.change(function(e) {
|
||||
var $menu = $('#main-menu');
|
||||
var options = { duration: 250, step: initResizableIfExists };
|
||||
if (this.checked) {
|
||||
options['complete'] = function() { $menu.css('display', 'block') };
|
||||
$menu.hide().slideDown(options);
|
||||
} else {
|
||||
options['complete'] = function() { $menu.css('display', 'none') };
|
||||
$menu.show().slideUp(options);
|
||||
}
|
||||
});
|
||||
// set default menu visibility
|
||||
function resetState() {
|
||||
var $menu = $('#main-menu');
|
||||
var $mainMenuState = $('#main-menu-state');
|
||||
var newWidth = $(window).outerWidth();
|
||||
if (newWidth!=prevWidth) {
|
||||
if ($(window).outerWidth()<768) {
|
||||
$mainMenuState.prop('checked',false); $menu.hide();
|
||||
$('#searchBoxPos1').html(searchBoxHtml);
|
||||
$('#searchBoxPos2').hide();
|
||||
} else {
|
||||
$menu.show();
|
||||
$('#searchBoxPos1').empty();
|
||||
$('#searchBoxPos2').html(searchBoxHtml);
|
||||
$('#searchBoxPos2').show();
|
||||
}
|
||||
if (typeof searchBox!=='undefined') {
|
||||
searchBox.CloseResultsWindow();
|
||||
}
|
||||
prevWidth = newWidth;
|
||||
}
|
||||
}
|
||||
$(window).ready(function() { resetState(); initResizableIfExists(); });
|
||||
$(window).resize(resetState);
|
||||
}
|
||||
$('#main-menu').smartmenus();
|
||||
}
|
||||
/* @license-end */
|
||||
@@ -1,33 +0,0 @@
|
||||
/*
|
||||
@licstart The following is the entire license notice for the JavaScript code in this file.
|
||||
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (C) 1997-2020 by Dimitri van Heesch
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software
|
||||
and associated documentation files (the "Software"), to deal in the Software without restriction,
|
||||
including without limitation the rights to use, copy, modify, merge, publish, distribute,
|
||||
sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or
|
||||
substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
|
||||
BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
@licend The above is the entire license notice for the JavaScript code in this file
|
||||
*/
|
||||
var menudata={children:[
|
||||
{text:"Main Page",url:"index.html"},
|
||||
{text:"Topics",url:"topics.html"},
|
||||
{text:"Data Structures",url:"annotated.html",children:[
|
||||
{text:"Data Structures",url:"annotated.html"},
|
||||
{text:"Data Structure Index",url:"classes.html"},
|
||||
{text:"Data Fields",url:"functions.html",children:[
|
||||
{text:"All",url:"functions.html"},
|
||||
{text:"Variables",url:"functions_vars.html"}]}]}]}
|
||||
@@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg width="12px" height="12px" viewBox="0 0 105.83333 105.83333" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg">
|
||||
<g>
|
||||
<rect style="fill:#808080;stroke-width:0" width="105.83333" height="105.83334" x="4.2409692e-08" y="-1.2701158e-06" ry="0" />
|
||||
<rect style="fill:#fcfcfc;stroke-width:0" width="79.375" height="79.375" x="13.229166" y="13.229166" />
|
||||
<rect style="fill:#808080;stroke-width:0" width="52.916668" height="15.874998" x="26.458332" y="44.979168" />
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 582 B |
@@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg width="12px" height="12px" viewBox="0 0 105.83333 105.83333" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg">
|
||||
<g>
|
||||
<rect style="fill:#808080;stroke-width:0" width="105.83333" height="105.83334" x="4.2409692e-08" y="-1.2701158e-06" ry="0" />
|
||||
<rect style="fill:#000000;stroke-width:0" width="79.375" height="79.375" x="13.229166" y="13.229166" />
|
||||
<rect style="fill:#808080;stroke-width:0" width="52.916668" height="15.874998" x="26.458332" y="44.979168" />
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 582 B |
|
Before Width: | Height: | Size: 153 B |
|
Before Width: | Height: | Size: 169 B |
|
Before Width: | Height: | Size: 95 B |
|
Before Width: | Height: | Size: 98 B |
|
Before Width: | Height: | Size: 114 B |
|
Before Width: | Height: | Size: 123 B |
@@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg width="12px" height="12px" viewBox="0 0 105.83333 105.83333" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg">
|
||||
<g>
|
||||
<rect style="fill:#808080;stroke-width:0" width="105.83333" height="105.83334" x="4.2409692e-08" y="-1.2701158e-06" ry="0" />
|
||||
<rect style="fill:#fcfcfc;stroke-width:0" width="79.375" height="79.375" x="13.229166" y="13.229166" />
|
||||
<rect style="fill:#808080;stroke-width:0" width="52.916668" height="15.874998" x="26.458332" y="44.979168" />
|
||||
<rect style="fill:#808080;stroke-width:0" width="15.874998" height="52.916668" x="44.979168" y="26.458332" />
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 696 B |
@@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg width="12px" height="12px" viewBox="0 0 105.83333 105.83333" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg">
|
||||
<g>
|
||||
<rect style="fill:#808080;stroke-width:0" width="105.83333" height="105.83334" x="4.2409692e-08" y="-1.2701158e-06" ry="0" />
|
||||
<rect style="fill:#000000;stroke-width:0" width="79.375" height="79.375" x="13.229166" y="13.229166" />
|
||||
<rect style="fill:#808080;stroke-width:0" width="52.916668" height="15.874998" x="26.458332" y="44.979168" />
|
||||
<rect style="fill:#808080;stroke-width:0" width="15.874998" height="52.916668" x="44.979168" y="26.458332" />
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 696 B |
@@ -1,4 +0,0 @@
|
||||
var searchData=
|
||||
[
|
||||
['customfilter_0',['customFilter',['../structtjtransform.html#a0dc7697d59a7abe48afc629e96cbc1d2',1,'tjtransform']]]
|
||||
];
|
||||
@@ -1,5 +0,0 @@
|
||||
var searchData=
|
||||
[
|
||||
['data_0',['data',['../structtjtransform.html#a688fe8f1a8ecc12a538d9e561cf338e3',1,'tjtransform']]],
|
||||
['denom_1',['denom',['../structtjscalingfactor.html#aefbcdf3e9e62274b2d312c695f133ce3',1,'tjscalingfactor']]]
|
||||
];
|
||||
@@ -1,4 +0,0 @@
|
||||
var searchData=
|
||||
[
|
||||
['format_20notes_0',['YUV Image Format Notes',['../group___turbo_j_p_e_g.html#autotoc_md0',1,'']]]
|
||||
];
|
||||
@@ -1,4 +0,0 @@
|
||||
var searchData=
|
||||
[
|
||||
['h_0',['h',['../structtjregion.html#aecefc45a26f4d8b60dd4d825c1710115',1,'tjregion']]]
|
||||
];
|
||||
@@ -1,4 +0,0 @@
|
||||
var searchData=
|
||||
[
|
||||
['image_20format_20notes_0',['YUV Image Format Notes',['../group___turbo_j_p_e_g.html#autotoc_md0',1,'']]]
|
||||
];
|
||||
@@ -1,5 +0,0 @@
|
||||
var searchData=
|
||||
[
|
||||
['notes_0',['YUV Image Format Notes',['../group___turbo_j_p_e_g.html#autotoc_md0',1,'']]],
|
||||
['num_1',['num',['../structtjscalingfactor.html#a9b011e57f981ee23083e2c1aa5e640ec',1,'tjscalingfactor']]]
|
||||
];
|
||||
@@ -1,5 +0,0 @@
|
||||
var searchData=
|
||||
[
|
||||
['op_0',['op',['../structtjtransform.html#a2525aab4ba6978a1c273f74fef50e498',1,'tjtransform']]],
|
||||
['options_1',['options',['../structtjtransform.html#ac0e74655baa4402209a21e1ae481c8f6',1,'tjtransform']]]
|
||||
];
|
||||
@@ -1,4 +0,0 @@
|
||||
var searchData=
|
||||
[
|
||||
['r_0',['r',['../structtjtransform.html#ac324e5e442abec8a961e5bf219db12cf',1,'tjtransform']]]
|
||||
];
|
||||
@@ -1,142 +0,0 @@
|
||||
var searchData=
|
||||
[
|
||||
['tj3alloc_0',['tj3Alloc',['../group___turbo_j_p_e_g.html#ga1a2c96d8b47530b6e6050ba6f10b7c57',1,'turbojpeg.h']]],
|
||||
['tj3compress12_1',['tj3Compress12',['../group___turbo_j_p_e_g.html#ga9a1968c384ec7abb6122830253ebf570',1,'turbojpeg.h']]],
|
||||
['tj3compress16_2',['tj3Compress16',['../group___turbo_j_p_e_g.html#ga77901b71d0471784f318ada31ff4e7bd',1,'turbojpeg.h']]],
|
||||
['tj3compress8_3',['tj3Compress8',['../group___turbo_j_p_e_g.html#ga2cc418a2dab709ad7f30f5b25905f138',1,'turbojpeg.h']]],
|
||||
['tj3compressfromyuv8_4',['tj3CompressFromYUV8',['../group___turbo_j_p_e_g.html#ga041c870d9c669eb3f385c78f4346c43f',1,'turbojpeg.h']]],
|
||||
['tj3compressfromyuvplanes8_5',['tj3CompressFromYUVPlanes8',['../group___turbo_j_p_e_g.html#gac9f5ace3e73805b476c95dda9f8d0cd0',1,'turbojpeg.h']]],
|
||||
['tj3decodeyuv8_6',['tj3DecodeYUV8',['../group___turbo_j_p_e_g.html#gaa1eb574f38b1c1de43a6c7aafcf68d8c',1,'turbojpeg.h']]],
|
||||
['tj3decodeyuvplanes8_7',['tj3DecodeYUVPlanes8',['../group___turbo_j_p_e_g.html#gad366f1915f82c1ad4e7e37ebe073ca89',1,'turbojpeg.h']]],
|
||||
['tj3decompress12_8',['tj3Decompress12',['../group___turbo_j_p_e_g.html#ga39b848f01781ad74a5b3941c012b6199',1,'turbojpeg.h']]],
|
||||
['tj3decompress16_9',['tj3Decompress16',['../group___turbo_j_p_e_g.html#gaa074e63f9beb0b3ff42b833a4049df6e',1,'turbojpeg.h']]],
|
||||
['tj3decompress8_10',['tj3Decompress8',['../group___turbo_j_p_e_g.html#ga1169c7c1a26ec18c9e6122cb8ae64013',1,'turbojpeg.h']]],
|
||||
['tj3decompressheader_11',['tj3DecompressHeader',['../group___turbo_j_p_e_g.html#ga96d2c4b3432f9d88ad14758ae240b8d1',1,'turbojpeg.h']]],
|
||||
['tj3decompresstoyuv8_12',['tj3DecompressToYUV8',['../group___turbo_j_p_e_g.html#ga1e6bf6a19fec3f9fa7534348879d8320',1,'turbojpeg.h']]],
|
||||
['tj3decompresstoyuvplanes8_13',['tj3DecompressToYUVPlanes8',['../group___turbo_j_p_e_g.html#ga934373482dbbf257f2280505b6ff4fb5',1,'turbojpeg.h']]],
|
||||
['tj3destroy_14',['tj3Destroy',['../group___turbo_j_p_e_g.html#ga53fbadf4560e95a65b8f5ab81703fe82',1,'turbojpeg.h']]],
|
||||
['tj3encodeyuv8_15',['tj3EncodeYUV8',['../group___turbo_j_p_e_g.html#ga2a8d50f130bde10f0a04030f8cc59936',1,'turbojpeg.h']]],
|
||||
['tj3encodeyuvplanes8_16',['tj3EncodeYUVPlanes8',['../group___turbo_j_p_e_g.html#gae2e9df38790e9bddc249d04cb158a4cf',1,'turbojpeg.h']]],
|
||||
['tj3free_17',['tj3Free',['../group___turbo_j_p_e_g.html#gaddb84fb6c81769e9faa0f5a63b296606',1,'turbojpeg.h']]],
|
||||
['tj3get_18',['tj3Get',['../group___turbo_j_p_e_g.html#ga34af9ba3183bdf0ec7c8f47bb9a4c84f',1,'turbojpeg.h']]],
|
||||
['tj3geterrorcode_19',['tj3GetErrorCode',['../group___turbo_j_p_e_g.html#gab8c8279f1415fe425ff30dbbc56013bd',1,'turbojpeg.h']]],
|
||||
['tj3geterrorstr_20',['tj3GetErrorStr',['../group___turbo_j_p_e_g.html#ga5a23ad0776c5333cda0d7c6d826e9d29',1,'turbojpeg.h']]],
|
||||
['tj3getscalingfactors_21',['tj3GetScalingFactors',['../group___turbo_j_p_e_g.html#gaf9253e0c2e9f464142d389673da085fa',1,'turbojpeg.h']]],
|
||||
['tj3init_22',['tj3Init',['../group___turbo_j_p_e_g.html#ga69c09d39f97ec30250ad3605ace7e5df',1,'turbojpeg.h']]],
|
||||
['tj3jpegbufsize_23',['tj3JPEGBufSize',['../group___turbo_j_p_e_g.html#gac6285e58e35a35d871d7162ec5a929c4',1,'turbojpeg.h']]],
|
||||
['tj3loadimage12_24',['tj3LoadImage12',['../group___turbo_j_p_e_g.html#gaa1d3772cfdb53afa21aae3c606238d44',1,'turbojpeg.h']]],
|
||||
['tj3loadimage16_25',['tj3LoadImage16',['../group___turbo_j_p_e_g.html#gace4240b665dc47742cbb3b76b03dfd69',1,'turbojpeg.h']]],
|
||||
['tj3loadimage8_26',['tj3LoadImage8',['../group___turbo_j_p_e_g.html#ga884023536e70985616126a073f662001',1,'turbojpeg.h']]],
|
||||
['tj3saveimage12_27',['tj3SaveImage12',['../group___turbo_j_p_e_g.html#ga7c64b5106d04267a46aad85f9714ad90',1,'turbojpeg.h']]],
|
||||
['tj3saveimage16_28',['tj3SaveImage16',['../group___turbo_j_p_e_g.html#ga0fd87851f4266aca24bf4594dd0c0e71',1,'turbojpeg.h']]],
|
||||
['tj3saveimage8_29',['tj3SaveImage8',['../group___turbo_j_p_e_g.html#gaa4ec838988e469cc15618e4690cc8722',1,'turbojpeg.h']]],
|
||||
['tj3set_30',['tj3Set',['../group___turbo_j_p_e_g.html#gaddf92640bfee3e8622218c713e77e7db',1,'turbojpeg.h']]],
|
||||
['tj3setcroppingregion_31',['tj3SetCroppingRegion',['../group___turbo_j_p_e_g.html#gaa49c7bd4c9431667a043cfc93388ba1c',1,'turbojpeg.h']]],
|
||||
['tj3setscalingfactor_32',['tj3SetScalingFactor',['../group___turbo_j_p_e_g.html#ga89da17ee1e43ff423382cbc145803c75',1,'turbojpeg.h']]],
|
||||
['tj3transform_33',['tj3Transform',['../group___turbo_j_p_e_g.html#gaff23ba1dcabed456794b844791613920',1,'turbojpeg.h']]],
|
||||
['tj3yuvbufsize_34',['tj3YUVBufSize',['../group___turbo_j_p_e_g.html#gaaebaa16973a0f550a66eca5765ed0546',1,'turbojpeg.h']]],
|
||||
['tj3yuvplaneheight_35',['tj3YUVPlaneHeight',['../group___turbo_j_p_e_g.html#ga969767ec8180cc3edd99cf507f87299b',1,'turbojpeg.h']]],
|
||||
['tj3yuvplanesize_36',['tj3YUVPlaneSize',['../group___turbo_j_p_e_g.html#gacc19d265edce76b46146f59579f9438d',1,'turbojpeg.h']]],
|
||||
['tj3yuvplanewidth_37',['tj3YUVPlaneWidth',['../group___turbo_j_p_e_g.html#gac99d1933ede1d59fcada9a826e88eb2d',1,'turbojpeg.h']]],
|
||||
['tj_5fnumcs_38',['TJ_NUMCS',['../group___turbo_j_p_e_g.html#ga39f57a6fb02d9cf32e7b6890099b5a71',1,'turbojpeg.h']]],
|
||||
['tj_5fnumerr_39',['TJ_NUMERR',['../group___turbo_j_p_e_g.html#ga79bde1b4a3e2351e00887e47781b966e',1,'turbojpeg.h']]],
|
||||
['tj_5fnuminit_40',['TJ_NUMINIT',['../group___turbo_j_p_e_g.html#ga5e0e8c784295c636f0bf8dab93c4bddf',1,'turbojpeg.h']]],
|
||||
['tj_5fnumpf_41',['TJ_NUMPF',['../group___turbo_j_p_e_g.html#ga7010a4402f54a45ba822ad8675a4655e',1,'turbojpeg.h']]],
|
||||
['tj_5fnumsamp_42',['TJ_NUMSAMP',['../group___turbo_j_p_e_g.html#ga5ef3d169162ce77ce348e292a0b7477c',1,'turbojpeg.h']]],
|
||||
['tj_5fnumxop_43',['TJ_NUMXOP',['../group___turbo_j_p_e_g.html#ga0f6dbd18adf38b7d46ac547f0f4d562c',1,'turbojpeg.h']]],
|
||||
['tjalphaoffset_44',['tjAlphaOffset',['../group___turbo_j_p_e_g.html#ga5af0ab065feefd526debf1e20c43e837',1,'turbojpeg.h']]],
|
||||
['tjblueoffset_45',['tjBlueOffset',['../group___turbo_j_p_e_g.html#ga84e2e35d3f08025f976ec1ec53693dea',1,'turbojpeg.h']]],
|
||||
['tjcs_46',['TJCS',['../group___turbo_j_p_e_g.html#ga4f83ad3368e0e29d1957be0efa7c3720',1,'turbojpeg.h']]],
|
||||
['tjcs_5fcmyk_47',['TJCS_CMYK',['../group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720a6c8b636152ac8195b869587db315ee53',1,'turbojpeg.h']]],
|
||||
['tjcs_5fgray_48',['TJCS_GRAY',['../group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720ab3e7d6a87f695e45b81c1b5262b5a50a',1,'turbojpeg.h']]],
|
||||
['tjcs_5frgb_49',['TJCS_RGB',['../group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720a677cb7ccb85c4038ac41964a2e09e555',1,'turbojpeg.h']]],
|
||||
['tjcs_5fycbcr_50',['TJCS_YCbCr',['../group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720a7389b8f65bb387ffedce3efd0d78ec75',1,'turbojpeg.h']]],
|
||||
['tjcs_5fycck_51',['TJCS_YCCK',['../group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720a53839e0fe867b76b58d16b0a1a7c598e',1,'turbojpeg.h']]],
|
||||
['tjerr_52',['TJERR',['../group___turbo_j_p_e_g.html#gafbc17cfa57d0d5d11fea35ac025950fe',1,'turbojpeg.h']]],
|
||||
['tjerr_5ffatal_53',['TJERR_FATAL',['../group___turbo_j_p_e_g.html#ggafbc17cfa57d0d5d11fea35ac025950feafc9cceeada13122b09e4851e3788039a',1,'turbojpeg.h']]],
|
||||
['tjerr_5fwarning_54',['TJERR_WARNING',['../group___turbo_j_p_e_g.html#ggafbc17cfa57d0d5d11fea35ac025950fea342dd6e2aedb47bb257b4e7568329b59',1,'turbojpeg.h']]],
|
||||
['tjgreenoffset_55',['tjGreenOffset',['../group___turbo_j_p_e_g.html#ga82d6e35da441112a411da41923c0ba2f',1,'turbojpeg.h']]],
|
||||
['tjhandle_56',['tjhandle',['../group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763',1,'turbojpeg.h']]],
|
||||
['tjinit_57',['TJINIT',['../group___turbo_j_p_e_g.html#ga3850bbee1313e752e667b4eb08b1e086',1,'turbojpeg.h']]],
|
||||
['tjinit_5fcompress_58',['TJINIT_COMPRESS',['../group___turbo_j_p_e_g.html#gga3850bbee1313e752e667b4eb08b1e086aa45ac279e3dc6ffabc4b0f45864da796',1,'turbojpeg.h']]],
|
||||
['tjinit_5fdecompress_59',['TJINIT_DECOMPRESS',['../group___turbo_j_p_e_g.html#gga3850bbee1313e752e667b4eb08b1e086a4b8ca1ef700699b71350700bf95c2167',1,'turbojpeg.h']]],
|
||||
['tjinit_5ftransform_60',['TJINIT_TRANSFORM',['../group___turbo_j_p_e_g.html#gga3850bbee1313e752e667b4eb08b1e086a8d58a2a4c45b3e0cd349746544a6e0c2',1,'turbojpeg.h']]],
|
||||
['tjmcuheight_61',['tjMCUHeight',['../group___turbo_j_p_e_g.html#gabd247bb9fecb393eca57366feb8327bf',1,'turbojpeg.h']]],
|
||||
['tjmcuwidth_62',['tjMCUWidth',['../group___turbo_j_p_e_g.html#ga9e61e7cd47a15a173283ba94e781308c',1,'turbojpeg.h']]],
|
||||
['tjparam_63',['TJPARAM',['../group___turbo_j_p_e_g.html#gaa0f6be63ba78278299c9f5c12031fe82',1,'turbojpeg.h']]],
|
||||
['tjparam_5farithmetic_64',['TJPARAM_ARITHMETIC',['../group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a1c756757384308145602c040524aebf7',1,'turbojpeg.h']]],
|
||||
['tjparam_5fbottomup_65',['TJPARAM_BOTTOMUP',['../group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a924657172695ed6cb0b128219546fcce',1,'turbojpeg.h']]],
|
||||
['tjparam_5fcolorspace_66',['TJPARAM_COLORSPACE',['../group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a46a10d46309514907d0c39fcd86c324c',1,'turbojpeg.h']]],
|
||||
['tjparam_5fdensityunits_67',['TJPARAM_DENSITYUNITS',['../group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a4c045981bd8a303521a401dbbe1df208',1,'turbojpeg.h']]],
|
||||
['tjparam_5ffastdct_68',['TJPARAM_FASTDCT',['../group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a6914692ac6ec5567787d592b7563f627',1,'turbojpeg.h']]],
|
||||
['tjparam_5ffastupsample_69',['TJPARAM_FASTUPSAMPLE',['../group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a0e051ac106f7b7402b690a5daf4869c0',1,'turbojpeg.h']]],
|
||||
['tjparam_5fjpegheight_70',['TJPARAM_JPEGHEIGHT',['../group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a8f76673be73f2b659440a9572a65a95f',1,'turbojpeg.h']]],
|
||||
['tjparam_5fjpegwidth_71',['TJPARAM_JPEGWIDTH',['../group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a02ab77fb294a0c9061a78cd424c82dd8',1,'turbojpeg.h']]],
|
||||
['tjparam_5flossless_72',['TJPARAM_LOSSLESS',['../group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a249f35f0770792b19f995e603bb17c6f',1,'turbojpeg.h']]],
|
||||
['tjparam_5flosslesspsv_73',['TJPARAM_LOSSLESSPSV',['../group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82abcc997d40e5bec84817c12b76ef84159',1,'turbojpeg.h']]],
|
||||
['tjparam_5flosslesspt_74',['TJPARAM_LOSSLESSPT',['../group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a4a6c6f25764ecaf4231a36bff844e46a',1,'turbojpeg.h']]],
|
||||
['tjparam_5fmaxmemory_75',['TJPARAM_MAXMEMORY',['../group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a0de0a8281da45d1fc984edc8918f7dd2',1,'turbojpeg.h']]],
|
||||
['tjparam_5fmaxpixels_76',['TJPARAM_MAXPIXELS',['../group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82ac4e95dd2ecd766854feee579406eae68',1,'turbojpeg.h']]],
|
||||
['tjparam_5fnorealloc_77',['TJPARAM_NOREALLOC',['../group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82ae64ffb358bc7b194fd48e0f27750b29b',1,'turbojpeg.h']]],
|
||||
['tjparam_5foptimize_78',['TJPARAM_OPTIMIZE',['../group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a8f0af9afc0b36443751f9ee82b760aa6',1,'turbojpeg.h']]],
|
||||
['tjparam_5fprecision_79',['TJPARAM_PRECISION',['../group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a781db82741934e8cd008d308597c59d8',1,'turbojpeg.h']]],
|
||||
['tjparam_5fprogressive_80',['TJPARAM_PROGRESSIVE',['../group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a1716f242b3859905b4a317dae8cfb75f',1,'turbojpeg.h']]],
|
||||
['tjparam_5fquality_81',['TJPARAM_QUALITY',['../group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a0467e8792621f2d817dc2af563d3186c',1,'turbojpeg.h']]],
|
||||
['tjparam_5frestartblocks_82',['TJPARAM_RESTARTBLOCKS',['../group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a343c72883b7160f23f3ef46fc548a0ec',1,'turbojpeg.h']]],
|
||||
['tjparam_5frestartrows_83',['TJPARAM_RESTARTROWS',['../group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a714367585952fe5c863f0dba5bd37e5c',1,'turbojpeg.h']]],
|
||||
['tjparam_5fscanlimit_84',['TJPARAM_SCANLIMIT',['../group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82ac478910e20ecf61b914f9824d80f8167',1,'turbojpeg.h']]],
|
||||
['tjparam_5fstoponwarning_85',['TJPARAM_STOPONWARNING',['../group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a555e2212079fa49b30bcd2879c6c8ddb',1,'turbojpeg.h']]],
|
||||
['tjparam_5fsubsamp_86',['TJPARAM_SUBSAMP',['../group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a2a3494a8215d3de4fdbaeb2ba6f6b03a',1,'turbojpeg.h']]],
|
||||
['tjparam_5fxdensity_87',['TJPARAM_XDENSITY',['../group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a4de5c9d7cab5be806143a43c3b0e0877',1,'turbojpeg.h']]],
|
||||
['tjparam_5fydensity_88',['TJPARAM_YDENSITY',['../group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82abda48f2df7eb9b88e2b7621efb017eba',1,'turbojpeg.h']]],
|
||||
['tjpf_89',['TJPF',['../group___turbo_j_p_e_g.html#gac916144e26c3817ac514e64ae5d12e2a',1,'turbojpeg.h']]],
|
||||
['tjpf_5fabgr_90',['TJPF_ABGR',['../group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa1ba1a7f1631dbeaa49a0a85fc4a40081',1,'turbojpeg.h']]],
|
||||
['tjpf_5fargb_91',['TJPF_ARGB',['../group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aae8f846ed9d9de99b6e1dfe448848765c',1,'turbojpeg.h']]],
|
||||
['tjpf_5fbgr_92',['TJPF_BGR',['../group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aab10624437fb8ef495a0b153e65749839',1,'turbojpeg.h']]],
|
||||
['tjpf_5fbgra_93',['TJPF_BGRA',['../group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aac037ff1845cf9b74bb81a3659c2b9fb4',1,'turbojpeg.h']]],
|
||||
['tjpf_5fbgrx_94',['TJPF_BGRX',['../group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa2a1fbf569ca79897eae886e3376ca4c8',1,'turbojpeg.h']]],
|
||||
['tjpf_5fcmyk_95',['TJPF_CMYK',['../group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa7f5100ec44c91994e243f1cf55553f8b',1,'turbojpeg.h']]],
|
||||
['tjpf_5fgray_96',['TJPF_GRAY',['../group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa5431b54b015337705f13118073711a1a',1,'turbojpeg.h']]],
|
||||
['tjpf_5frgb_97',['TJPF_RGB',['../group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa7ce93230bff449518ce387c17e6ed37c',1,'turbojpeg.h']]],
|
||||
['tjpf_5frgba_98',['TJPF_RGBA',['../group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa88d2e88fab67f6503cf972e14851cc12',1,'turbojpeg.h']]],
|
||||
['tjpf_5frgbx_99',['TJPF_RGBX',['../group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa83973bebb7e2dc6fa8bae89ff3f42e01',1,'turbojpeg.h']]],
|
||||
['tjpf_5funknown_100',['TJPF_UNKNOWN',['../group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa84c1a6cead7952998e2fb895844a21ed',1,'turbojpeg.h']]],
|
||||
['tjpf_5fxbgr_101',['TJPF_XBGR',['../group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aaf6603b27147de47e212e75dac027b2af',1,'turbojpeg.h']]],
|
||||
['tjpf_5fxrgb_102',['TJPF_XRGB',['../group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aadae996905efcfa3b42a0bb3bea7f9d84',1,'turbojpeg.h']]],
|
||||
['tjpixelsize_103',['tjPixelSize',['../group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c',1,'turbojpeg.h']]],
|
||||
['tjredoffset_104',['tjRedOffset',['../group___turbo_j_p_e_g.html#gadd9b446742ac8a3923f7992c7988fea8',1,'turbojpeg.h']]],
|
||||
['tjregion_105',['tjregion',['../structtjregion.html',1,'']]],
|
||||
['tjsamp_106',['TJSAMP',['../group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074',1,'turbojpeg.h']]],
|
||||
['tjsamp_5f411_107',['TJSAMP_411',['../group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074a28ec62575e5ea295c3fde3001dc628e2',1,'turbojpeg.h']]],
|
||||
['tjsamp_5f420_108',['TJSAMP_420',['../group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074a63085dbf683cfe39e513cdb6343e3737',1,'turbojpeg.h']]],
|
||||
['tjsamp_5f422_109',['TJSAMP_422',['../group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074a136130902cc578f11f32429b59368404',1,'turbojpeg.h']]],
|
||||
['tjsamp_5f440_110',['TJSAMP_440',['../group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074accf740e6f3aa6ba20ba922cad13cb974',1,'turbojpeg.h']]],
|
||||
['tjsamp_5f441_111',['TJSAMP_441',['../group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074a3351696e1dd34a083a35b6be8b90122d',1,'turbojpeg.h']]],
|
||||
['tjsamp_5f444_112',['TJSAMP_444',['../group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074afb8da4f44197837bdec0a4f593dacae3',1,'turbojpeg.h']]],
|
||||
['tjsamp_5fgray_113',['TJSAMP_GRAY',['../group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074a3f1c9504842ddc7a48d0f690754b6248',1,'turbojpeg.h']]],
|
||||
['tjsamp_5funknown_114',['TJSAMP_UNKNOWN',['../group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074ac124fa8f6cb41147e3d670dfbdfb7173',1,'turbojpeg.h']]],
|
||||
['tjscaled_115',['TJSCALED',['../group___turbo_j_p_e_g.html#ga84878bb65404204743aa18cac02781df',1,'turbojpeg.h']]],
|
||||
['tjscalingfactor_116',['tjscalingfactor',['../structtjscalingfactor.html',1,'']]],
|
||||
['tjtransform_117',['tjtransform',['../structtjtransform.html',1,'tjtransform'],['../group___turbo_j_p_e_g.html#ga504805ec0161f1b505397ca0118bf8fd',1,'tjtransform: turbojpeg.h']]],
|
||||
['tjuncropped_118',['TJUNCROPPED',['../group___turbo_j_p_e_g.html#ga6f192ad58a5a5802e145149d83c643bf',1,'turbojpeg.h']]],
|
||||
['tjunscaled_119',['TJUNSCALED',['../group___turbo_j_p_e_g.html#ga7880644a0849161ad20933536169ee19',1,'turbojpeg.h']]],
|
||||
['tjxop_120',['TJXOP',['../group___turbo_j_p_e_g.html#ga2de531af4e7e6c4f124908376b354866',1,'turbojpeg.h']]],
|
||||
['tjxop_5fhflip_121',['TJXOP_HFLIP',['../group___turbo_j_p_e_g.html#gga2de531af4e7e6c4f124908376b354866aa0df69776caa30f0fa28e26332d311ce',1,'turbojpeg.h']]],
|
||||
['tjxop_5fnone_122',['TJXOP_NONE',['../group___turbo_j_p_e_g.html#gga2de531af4e7e6c4f124908376b354866aad88c0366cd3f7d0eac9d7a3fa1c2c27',1,'turbojpeg.h']]],
|
||||
['tjxop_5frot180_123',['TJXOP_ROT180',['../group___turbo_j_p_e_g.html#gga2de531af4e7e6c4f124908376b354866a140952eb8dd0300accfcc22726d69692',1,'turbojpeg.h']]],
|
||||
['tjxop_5frot270_124',['TJXOP_ROT270',['../group___turbo_j_p_e_g.html#gga2de531af4e7e6c4f124908376b354866a3064ee5dfb7f032df332818587567a08',1,'turbojpeg.h']]],
|
||||
['tjxop_5frot90_125',['TJXOP_ROT90',['../group___turbo_j_p_e_g.html#gga2de531af4e7e6c4f124908376b354866a43b2bbb23bc4bd548422d43fbe9af128',1,'turbojpeg.h']]],
|
||||
['tjxop_5ftranspose_126',['TJXOP_TRANSPOSE',['../group___turbo_j_p_e_g.html#gga2de531af4e7e6c4f124908376b354866a31060aed199f886afdd417f80499c32d',1,'turbojpeg.h']]],
|
||||
['tjxop_5ftransverse_127',['TJXOP_TRANSVERSE',['../group___turbo_j_p_e_g.html#gga2de531af4e7e6c4f124908376b354866af3b14d488aea6ece9e5b3df73a74d6a4',1,'turbojpeg.h']]],
|
||||
['tjxop_5fvflip_128',['TJXOP_VFLIP',['../group___turbo_j_p_e_g.html#gga2de531af4e7e6c4f124908376b354866a324eddfbec53b7e691f61e56929d0d5d',1,'turbojpeg.h']]],
|
||||
['tjxopt_5farithmetic_129',['TJXOPT_ARITHMETIC',['../group___turbo_j_p_e_g.html#gaecaaa3b7e2af812592c015d83207f010',1,'turbojpeg.h']]],
|
||||
['tjxopt_5fcopynone_130',['TJXOPT_COPYNONE',['../group___turbo_j_p_e_g.html#ga153b468cfb905d0de61706c838986fe8',1,'turbojpeg.h']]],
|
||||
['tjxopt_5fcrop_131',['TJXOPT_CROP',['../group___turbo_j_p_e_g.html#ga9c771a757fc1294add611906b89ab2d2',1,'turbojpeg.h']]],
|
||||
['tjxopt_5fgray_132',['TJXOPT_GRAY',['../group___turbo_j_p_e_g.html#ga3acee7b48ade1b99e5588736007c2589',1,'turbojpeg.h']]],
|
||||
['tjxopt_5fnooutput_133',['TJXOPT_NOOUTPUT',['../group___turbo_j_p_e_g.html#gafbf992bbf6e006705886333703ffab31',1,'turbojpeg.h']]],
|
||||
['tjxopt_5foptimize_134',['TJXOPT_OPTIMIZE',['../group___turbo_j_p_e_g.html#ga6bedf37aa9e1122f3ec9f7302ca59117',1,'turbojpeg.h']]],
|
||||
['tjxopt_5fperfect_135',['TJXOPT_PERFECT',['../group___turbo_j_p_e_g.html#ga50e03cb5ed115330e212417429600b00',1,'turbojpeg.h']]],
|
||||
['tjxopt_5fprogressive_136',['TJXOPT_PROGRESSIVE',['../group___turbo_j_p_e_g.html#gad2371c80674584ecc1a7d75e564cf026',1,'turbojpeg.h']]],
|
||||
['tjxopt_5ftrim_137',['TJXOPT_TRIM',['../group___turbo_j_p_e_g.html#ga319826b7eb1583c0595bbe7b95428709',1,'turbojpeg.h']]],
|
||||
['turbojpeg_138',['TurboJPEG',['../group___turbo_j_p_e_g.html',1,'']]]
|
||||
];
|
||||
@@ -1,4 +0,0 @@
|
||||
var searchData=
|
||||
[
|
||||
['w_0',['w',['../structtjregion.html#ab6eb73ceef584fc23c8c8097926dce42',1,'tjregion']]]
|
||||
];
|
||||
@@ -1,4 +0,0 @@
|
||||
var searchData=
|
||||
[
|
||||
['x_0',['x',['../structtjregion.html#a4b6a37a93997091b26a75831fa291ad9',1,'tjregion']]]
|
||||
];
|
||||
@@ -1,5 +0,0 @@
|
||||
var searchData=
|
||||
[
|
||||
['y_0',['y',['../structtjregion.html#a7b3e0c24cfe87acc80e334cafdcf22c2',1,'tjregion']]],
|
||||
['yuv_20image_20format_20notes_1',['YUV Image Format Notes',['../group___turbo_j_p_e_g.html#autotoc_md0',1,'']]]
|
||||
];
|
||||
@@ -1,6 +0,0 @@
|
||||
var searchData=
|
||||
[
|
||||
['tjregion_0',['tjregion',['../structtjregion.html',1,'']]],
|
||||
['tjscalingfactor_1',['tjscalingfactor',['../structtjscalingfactor.html',1,'']]],
|
||||
['tjtransform_2',['tjtransform',['../structtjtransform.html',1,'']]]
|
||||
];
|
||||
@@ -1,18 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"https://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
viewBox="0 0 11 11"
|
||||
height="11"
|
||||
width="11"
|
||||
id="svg2"
|
||||
version="1.1">
|
||||
<defs
|
||||
id="defs6" />
|
||||
<path
|
||||
id="path12"
|
||||
d="M 5.5 0.5 A 5 5 0 0 0 0.5 5.5 A 5 5 0 0 0 5.5 10.5 A 5 5 0 0 0 10.5 5.5 A 5 5 0 0 0 5.5 0.5 z M 3.5820312 3 A 0.58291923 0.58291923 0 0 1 4 3.1757812 L 5.5 4.6757812 L 7 3.1757812 A 0.58291923 0.58291923 0 0 1 7.4003906 3 A 0.58291923 0.58291923 0 0 1 7.8242188 4 L 6.3242188 5.5 L 7.8242188 7 A 0.58291923 0.58291923 0 1 1 7 7.8242188 L 5.5 6.3242188 L 4 7.8242188 A 0.58291923 0.58291923 0 1 1 3.1757812 7 L 4.6757812 5.5 L 3.1757812 4 A 0.58291923 0.58291923 0 0 1 3.5820312 3 z "
|
||||
style="stroke-width:1.09870648;fill:#bababa;fill-opacity:1" />
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 947 B |
@@ -1,10 +0,0 @@
|
||||
var searchData=
|
||||
[
|
||||
['tjcs_0',['TJCS',['../group___turbo_j_p_e_g.html#ga4f83ad3368e0e29d1957be0efa7c3720',1,'turbojpeg.h']]],
|
||||
['tjerr_1',['TJERR',['../group___turbo_j_p_e_g.html#gafbc17cfa57d0d5d11fea35ac025950fe',1,'turbojpeg.h']]],
|
||||
['tjinit_2',['TJINIT',['../group___turbo_j_p_e_g.html#ga3850bbee1313e752e667b4eb08b1e086',1,'turbojpeg.h']]],
|
||||
['tjparam_3',['TJPARAM',['../group___turbo_j_p_e_g.html#gaa0f6be63ba78278299c9f5c12031fe82',1,'turbojpeg.h']]],
|
||||
['tjpf_4',['TJPF',['../group___turbo_j_p_e_g.html#gac916144e26c3817ac514e64ae5d12e2a',1,'turbojpeg.h']]],
|
||||
['tjsamp_5',['TJSAMP',['../group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074',1,'turbojpeg.h']]],
|
||||
['tjxop_6',['TJXOP',['../group___turbo_j_p_e_g.html#ga2de531af4e7e6c4f124908376b354866',1,'turbojpeg.h']]]
|
||||
];
|
||||
@@ -1,67 +0,0 @@
|
||||
var searchData=
|
||||
[
|
||||
['tjcs_5fcmyk_0',['TJCS_CMYK',['../group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720a6c8b636152ac8195b869587db315ee53',1,'turbojpeg.h']]],
|
||||
['tjcs_5fgray_1',['TJCS_GRAY',['../group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720ab3e7d6a87f695e45b81c1b5262b5a50a',1,'turbojpeg.h']]],
|
||||
['tjcs_5frgb_2',['TJCS_RGB',['../group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720a677cb7ccb85c4038ac41964a2e09e555',1,'turbojpeg.h']]],
|
||||
['tjcs_5fycbcr_3',['TJCS_YCbCr',['../group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720a7389b8f65bb387ffedce3efd0d78ec75',1,'turbojpeg.h']]],
|
||||
['tjcs_5fycck_4',['TJCS_YCCK',['../group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720a53839e0fe867b76b58d16b0a1a7c598e',1,'turbojpeg.h']]],
|
||||
['tjerr_5ffatal_5',['TJERR_FATAL',['../group___turbo_j_p_e_g.html#ggafbc17cfa57d0d5d11fea35ac025950feafc9cceeada13122b09e4851e3788039a',1,'turbojpeg.h']]],
|
||||
['tjerr_5fwarning_6',['TJERR_WARNING',['../group___turbo_j_p_e_g.html#ggafbc17cfa57d0d5d11fea35ac025950fea342dd6e2aedb47bb257b4e7568329b59',1,'turbojpeg.h']]],
|
||||
['tjinit_5fcompress_7',['TJINIT_COMPRESS',['../group___turbo_j_p_e_g.html#gga3850bbee1313e752e667b4eb08b1e086aa45ac279e3dc6ffabc4b0f45864da796',1,'turbojpeg.h']]],
|
||||
['tjinit_5fdecompress_8',['TJINIT_DECOMPRESS',['../group___turbo_j_p_e_g.html#gga3850bbee1313e752e667b4eb08b1e086a4b8ca1ef700699b71350700bf95c2167',1,'turbojpeg.h']]],
|
||||
['tjinit_5ftransform_9',['TJINIT_TRANSFORM',['../group___turbo_j_p_e_g.html#gga3850bbee1313e752e667b4eb08b1e086a8d58a2a4c45b3e0cd349746544a6e0c2',1,'turbojpeg.h']]],
|
||||
['tjparam_5farithmetic_10',['TJPARAM_ARITHMETIC',['../group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a1c756757384308145602c040524aebf7',1,'turbojpeg.h']]],
|
||||
['tjparam_5fbottomup_11',['TJPARAM_BOTTOMUP',['../group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a924657172695ed6cb0b128219546fcce',1,'turbojpeg.h']]],
|
||||
['tjparam_5fcolorspace_12',['TJPARAM_COLORSPACE',['../group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a46a10d46309514907d0c39fcd86c324c',1,'turbojpeg.h']]],
|
||||
['tjparam_5fdensityunits_13',['TJPARAM_DENSITYUNITS',['../group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a4c045981bd8a303521a401dbbe1df208',1,'turbojpeg.h']]],
|
||||
['tjparam_5ffastdct_14',['TJPARAM_FASTDCT',['../group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a6914692ac6ec5567787d592b7563f627',1,'turbojpeg.h']]],
|
||||
['tjparam_5ffastupsample_15',['TJPARAM_FASTUPSAMPLE',['../group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a0e051ac106f7b7402b690a5daf4869c0',1,'turbojpeg.h']]],
|
||||
['tjparam_5fjpegheight_16',['TJPARAM_JPEGHEIGHT',['../group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a8f76673be73f2b659440a9572a65a95f',1,'turbojpeg.h']]],
|
||||
['tjparam_5fjpegwidth_17',['TJPARAM_JPEGWIDTH',['../group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a02ab77fb294a0c9061a78cd424c82dd8',1,'turbojpeg.h']]],
|
||||
['tjparam_5flossless_18',['TJPARAM_LOSSLESS',['../group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a249f35f0770792b19f995e603bb17c6f',1,'turbojpeg.h']]],
|
||||
['tjparam_5flosslesspsv_19',['TJPARAM_LOSSLESSPSV',['../group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82abcc997d40e5bec84817c12b76ef84159',1,'turbojpeg.h']]],
|
||||
['tjparam_5flosslesspt_20',['TJPARAM_LOSSLESSPT',['../group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a4a6c6f25764ecaf4231a36bff844e46a',1,'turbojpeg.h']]],
|
||||
['tjparam_5fmaxmemory_21',['TJPARAM_MAXMEMORY',['../group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a0de0a8281da45d1fc984edc8918f7dd2',1,'turbojpeg.h']]],
|
||||
['tjparam_5fmaxpixels_22',['TJPARAM_MAXPIXELS',['../group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82ac4e95dd2ecd766854feee579406eae68',1,'turbojpeg.h']]],
|
||||
['tjparam_5fnorealloc_23',['TJPARAM_NOREALLOC',['../group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82ae64ffb358bc7b194fd48e0f27750b29b',1,'turbojpeg.h']]],
|
||||
['tjparam_5foptimize_24',['TJPARAM_OPTIMIZE',['../group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a8f0af9afc0b36443751f9ee82b760aa6',1,'turbojpeg.h']]],
|
||||
['tjparam_5fprecision_25',['TJPARAM_PRECISION',['../group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a781db82741934e8cd008d308597c59d8',1,'turbojpeg.h']]],
|
||||
['tjparam_5fprogressive_26',['TJPARAM_PROGRESSIVE',['../group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a1716f242b3859905b4a317dae8cfb75f',1,'turbojpeg.h']]],
|
||||
['tjparam_5fquality_27',['TJPARAM_QUALITY',['../group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a0467e8792621f2d817dc2af563d3186c',1,'turbojpeg.h']]],
|
||||
['tjparam_5frestartblocks_28',['TJPARAM_RESTARTBLOCKS',['../group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a343c72883b7160f23f3ef46fc548a0ec',1,'turbojpeg.h']]],
|
||||
['tjparam_5frestartrows_29',['TJPARAM_RESTARTROWS',['../group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a714367585952fe5c863f0dba5bd37e5c',1,'turbojpeg.h']]],
|
||||
['tjparam_5fscanlimit_30',['TJPARAM_SCANLIMIT',['../group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82ac478910e20ecf61b914f9824d80f8167',1,'turbojpeg.h']]],
|
||||
['tjparam_5fstoponwarning_31',['TJPARAM_STOPONWARNING',['../group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a555e2212079fa49b30bcd2879c6c8ddb',1,'turbojpeg.h']]],
|
||||
['tjparam_5fsubsamp_32',['TJPARAM_SUBSAMP',['../group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a2a3494a8215d3de4fdbaeb2ba6f6b03a',1,'turbojpeg.h']]],
|
||||
['tjparam_5fxdensity_33',['TJPARAM_XDENSITY',['../group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a4de5c9d7cab5be806143a43c3b0e0877',1,'turbojpeg.h']]],
|
||||
['tjparam_5fydensity_34',['TJPARAM_YDENSITY',['../group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82abda48f2df7eb9b88e2b7621efb017eba',1,'turbojpeg.h']]],
|
||||
['tjpf_5fabgr_35',['TJPF_ABGR',['../group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa1ba1a7f1631dbeaa49a0a85fc4a40081',1,'turbojpeg.h']]],
|
||||
['tjpf_5fargb_36',['TJPF_ARGB',['../group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aae8f846ed9d9de99b6e1dfe448848765c',1,'turbojpeg.h']]],
|
||||
['tjpf_5fbgr_37',['TJPF_BGR',['../group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aab10624437fb8ef495a0b153e65749839',1,'turbojpeg.h']]],
|
||||
['tjpf_5fbgra_38',['TJPF_BGRA',['../group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aac037ff1845cf9b74bb81a3659c2b9fb4',1,'turbojpeg.h']]],
|
||||
['tjpf_5fbgrx_39',['TJPF_BGRX',['../group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa2a1fbf569ca79897eae886e3376ca4c8',1,'turbojpeg.h']]],
|
||||
['tjpf_5fcmyk_40',['TJPF_CMYK',['../group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa7f5100ec44c91994e243f1cf55553f8b',1,'turbojpeg.h']]],
|
||||
['tjpf_5fgray_41',['TJPF_GRAY',['../group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa5431b54b015337705f13118073711a1a',1,'turbojpeg.h']]],
|
||||
['tjpf_5frgb_42',['TJPF_RGB',['../group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa7ce93230bff449518ce387c17e6ed37c',1,'turbojpeg.h']]],
|
||||
['tjpf_5frgba_43',['TJPF_RGBA',['../group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa88d2e88fab67f6503cf972e14851cc12',1,'turbojpeg.h']]],
|
||||
['tjpf_5frgbx_44',['TJPF_RGBX',['../group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa83973bebb7e2dc6fa8bae89ff3f42e01',1,'turbojpeg.h']]],
|
||||
['tjpf_5funknown_45',['TJPF_UNKNOWN',['../group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa84c1a6cead7952998e2fb895844a21ed',1,'turbojpeg.h']]],
|
||||
['tjpf_5fxbgr_46',['TJPF_XBGR',['../group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aaf6603b27147de47e212e75dac027b2af',1,'turbojpeg.h']]],
|
||||
['tjpf_5fxrgb_47',['TJPF_XRGB',['../group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aadae996905efcfa3b42a0bb3bea7f9d84',1,'turbojpeg.h']]],
|
||||
['tjsamp_5f411_48',['TJSAMP_411',['../group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074a28ec62575e5ea295c3fde3001dc628e2',1,'turbojpeg.h']]],
|
||||
['tjsamp_5f420_49',['TJSAMP_420',['../group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074a63085dbf683cfe39e513cdb6343e3737',1,'turbojpeg.h']]],
|
||||
['tjsamp_5f422_50',['TJSAMP_422',['../group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074a136130902cc578f11f32429b59368404',1,'turbojpeg.h']]],
|
||||
['tjsamp_5f440_51',['TJSAMP_440',['../group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074accf740e6f3aa6ba20ba922cad13cb974',1,'turbojpeg.h']]],
|
||||
['tjsamp_5f441_52',['TJSAMP_441',['../group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074a3351696e1dd34a083a35b6be8b90122d',1,'turbojpeg.h']]],
|
||||
['tjsamp_5f444_53',['TJSAMP_444',['../group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074afb8da4f44197837bdec0a4f593dacae3',1,'turbojpeg.h']]],
|
||||
['tjsamp_5fgray_54',['TJSAMP_GRAY',['../group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074a3f1c9504842ddc7a48d0f690754b6248',1,'turbojpeg.h']]],
|
||||
['tjsamp_5funknown_55',['TJSAMP_UNKNOWN',['../group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074ac124fa8f6cb41147e3d670dfbdfb7173',1,'turbojpeg.h']]],
|
||||
['tjxop_5fhflip_56',['TJXOP_HFLIP',['../group___turbo_j_p_e_g.html#gga2de531af4e7e6c4f124908376b354866aa0df69776caa30f0fa28e26332d311ce',1,'turbojpeg.h']]],
|
||||
['tjxop_5fnone_57',['TJXOP_NONE',['../group___turbo_j_p_e_g.html#gga2de531af4e7e6c4f124908376b354866aad88c0366cd3f7d0eac9d7a3fa1c2c27',1,'turbojpeg.h']]],
|
||||
['tjxop_5frot180_58',['TJXOP_ROT180',['../group___turbo_j_p_e_g.html#gga2de531af4e7e6c4f124908376b354866a140952eb8dd0300accfcc22726d69692',1,'turbojpeg.h']]],
|
||||
['tjxop_5frot270_59',['TJXOP_ROT270',['../group___turbo_j_p_e_g.html#gga2de531af4e7e6c4f124908376b354866a3064ee5dfb7f032df332818587567a08',1,'turbojpeg.h']]],
|
||||
['tjxop_5frot90_60',['TJXOP_ROT90',['../group___turbo_j_p_e_g.html#gga2de531af4e7e6c4f124908376b354866a43b2bbb23bc4bd548422d43fbe9af128',1,'turbojpeg.h']]],
|
||||
['tjxop_5ftranspose_61',['TJXOP_TRANSPOSE',['../group___turbo_j_p_e_g.html#gga2de531af4e7e6c4f124908376b354866a31060aed199f886afdd417f80499c32d',1,'turbojpeg.h']]],
|
||||
['tjxop_5ftransverse_62',['TJXOP_TRANSVERSE',['../group___turbo_j_p_e_g.html#gga2de531af4e7e6c4f124908376b354866af3b14d488aea6ece9e5b3df73a74d6a4',1,'turbojpeg.h']]],
|
||||
['tjxop_5fvflip_63',['TJXOP_VFLIP',['../group___turbo_j_p_e_g.html#gga2de531af4e7e6c4f124908376b354866a324eddfbec53b7e691f61e56929d0d5d',1,'turbojpeg.h']]]
|
||||
];
|
||||
@@ -1,41 +0,0 @@
|
||||
var searchData=
|
||||
[
|
||||
['tj3alloc_0',['tj3Alloc',['../group___turbo_j_p_e_g.html#ga1a2c96d8b47530b6e6050ba6f10b7c57',1,'turbojpeg.h']]],
|
||||
['tj3compress12_1',['tj3Compress12',['../group___turbo_j_p_e_g.html#ga9a1968c384ec7abb6122830253ebf570',1,'turbojpeg.h']]],
|
||||
['tj3compress16_2',['tj3Compress16',['../group___turbo_j_p_e_g.html#ga77901b71d0471784f318ada31ff4e7bd',1,'turbojpeg.h']]],
|
||||
['tj3compress8_3',['tj3Compress8',['../group___turbo_j_p_e_g.html#ga2cc418a2dab709ad7f30f5b25905f138',1,'turbojpeg.h']]],
|
||||
['tj3compressfromyuv8_4',['tj3CompressFromYUV8',['../group___turbo_j_p_e_g.html#ga041c870d9c669eb3f385c78f4346c43f',1,'turbojpeg.h']]],
|
||||
['tj3compressfromyuvplanes8_5',['tj3CompressFromYUVPlanes8',['../group___turbo_j_p_e_g.html#gac9f5ace3e73805b476c95dda9f8d0cd0',1,'turbojpeg.h']]],
|
||||
['tj3decodeyuv8_6',['tj3DecodeYUV8',['../group___turbo_j_p_e_g.html#gaa1eb574f38b1c1de43a6c7aafcf68d8c',1,'turbojpeg.h']]],
|
||||
['tj3decodeyuvplanes8_7',['tj3DecodeYUVPlanes8',['../group___turbo_j_p_e_g.html#gad366f1915f82c1ad4e7e37ebe073ca89',1,'turbojpeg.h']]],
|
||||
['tj3decompress12_8',['tj3Decompress12',['../group___turbo_j_p_e_g.html#ga39b848f01781ad74a5b3941c012b6199',1,'turbojpeg.h']]],
|
||||
['tj3decompress16_9',['tj3Decompress16',['../group___turbo_j_p_e_g.html#gaa074e63f9beb0b3ff42b833a4049df6e',1,'turbojpeg.h']]],
|
||||
['tj3decompress8_10',['tj3Decompress8',['../group___turbo_j_p_e_g.html#ga1169c7c1a26ec18c9e6122cb8ae64013',1,'turbojpeg.h']]],
|
||||
['tj3decompressheader_11',['tj3DecompressHeader',['../group___turbo_j_p_e_g.html#ga96d2c4b3432f9d88ad14758ae240b8d1',1,'turbojpeg.h']]],
|
||||
['tj3decompresstoyuv8_12',['tj3DecompressToYUV8',['../group___turbo_j_p_e_g.html#ga1e6bf6a19fec3f9fa7534348879d8320',1,'turbojpeg.h']]],
|
||||
['tj3decompresstoyuvplanes8_13',['tj3DecompressToYUVPlanes8',['../group___turbo_j_p_e_g.html#ga934373482dbbf257f2280505b6ff4fb5',1,'turbojpeg.h']]],
|
||||
['tj3destroy_14',['tj3Destroy',['../group___turbo_j_p_e_g.html#ga53fbadf4560e95a65b8f5ab81703fe82',1,'turbojpeg.h']]],
|
||||
['tj3encodeyuv8_15',['tj3EncodeYUV8',['../group___turbo_j_p_e_g.html#ga2a8d50f130bde10f0a04030f8cc59936',1,'turbojpeg.h']]],
|
||||
['tj3encodeyuvplanes8_16',['tj3EncodeYUVPlanes8',['../group___turbo_j_p_e_g.html#gae2e9df38790e9bddc249d04cb158a4cf',1,'turbojpeg.h']]],
|
||||
['tj3free_17',['tj3Free',['../group___turbo_j_p_e_g.html#gaddb84fb6c81769e9faa0f5a63b296606',1,'turbojpeg.h']]],
|
||||
['tj3get_18',['tj3Get',['../group___turbo_j_p_e_g.html#ga34af9ba3183bdf0ec7c8f47bb9a4c84f',1,'turbojpeg.h']]],
|
||||
['tj3geterrorcode_19',['tj3GetErrorCode',['../group___turbo_j_p_e_g.html#gab8c8279f1415fe425ff30dbbc56013bd',1,'turbojpeg.h']]],
|
||||
['tj3geterrorstr_20',['tj3GetErrorStr',['../group___turbo_j_p_e_g.html#ga5a23ad0776c5333cda0d7c6d826e9d29',1,'turbojpeg.h']]],
|
||||
['tj3getscalingfactors_21',['tj3GetScalingFactors',['../group___turbo_j_p_e_g.html#gaf9253e0c2e9f464142d389673da085fa',1,'turbojpeg.h']]],
|
||||
['tj3init_22',['tj3Init',['../group___turbo_j_p_e_g.html#ga69c09d39f97ec30250ad3605ace7e5df',1,'turbojpeg.h']]],
|
||||
['tj3jpegbufsize_23',['tj3JPEGBufSize',['../group___turbo_j_p_e_g.html#gac6285e58e35a35d871d7162ec5a929c4',1,'turbojpeg.h']]],
|
||||
['tj3loadimage12_24',['tj3LoadImage12',['../group___turbo_j_p_e_g.html#gaa1d3772cfdb53afa21aae3c606238d44',1,'turbojpeg.h']]],
|
||||
['tj3loadimage16_25',['tj3LoadImage16',['../group___turbo_j_p_e_g.html#gace4240b665dc47742cbb3b76b03dfd69',1,'turbojpeg.h']]],
|
||||
['tj3loadimage8_26',['tj3LoadImage8',['../group___turbo_j_p_e_g.html#ga884023536e70985616126a073f662001',1,'turbojpeg.h']]],
|
||||
['tj3saveimage12_27',['tj3SaveImage12',['../group___turbo_j_p_e_g.html#ga7c64b5106d04267a46aad85f9714ad90',1,'turbojpeg.h']]],
|
||||
['tj3saveimage16_28',['tj3SaveImage16',['../group___turbo_j_p_e_g.html#ga0fd87851f4266aca24bf4594dd0c0e71',1,'turbojpeg.h']]],
|
||||
['tj3saveimage8_29',['tj3SaveImage8',['../group___turbo_j_p_e_g.html#gaa4ec838988e469cc15618e4690cc8722',1,'turbojpeg.h']]],
|
||||
['tj3set_30',['tj3Set',['../group___turbo_j_p_e_g.html#gaddf92640bfee3e8622218c713e77e7db',1,'turbojpeg.h']]],
|
||||
['tj3setcroppingregion_31',['tj3SetCroppingRegion',['../group___turbo_j_p_e_g.html#gaa49c7bd4c9431667a043cfc93388ba1c',1,'turbojpeg.h']]],
|
||||
['tj3setscalingfactor_32',['tj3SetScalingFactor',['../group___turbo_j_p_e_g.html#ga89da17ee1e43ff423382cbc145803c75',1,'turbojpeg.h']]],
|
||||
['tj3transform_33',['tj3Transform',['../group___turbo_j_p_e_g.html#gaff23ba1dcabed456794b844791613920',1,'turbojpeg.h']]],
|
||||
['tj3yuvbufsize_34',['tj3YUVBufSize',['../group___turbo_j_p_e_g.html#gaaebaa16973a0f550a66eca5765ed0546',1,'turbojpeg.h']]],
|
||||
['tj3yuvplaneheight_35',['tj3YUVPlaneHeight',['../group___turbo_j_p_e_g.html#ga969767ec8180cc3edd99cf507f87299b',1,'turbojpeg.h']]],
|
||||
['tj3yuvplanesize_36',['tj3YUVPlaneSize',['../group___turbo_j_p_e_g.html#gacc19d265edce76b46146f59579f9438d',1,'turbojpeg.h']]],
|
||||
['tj3yuvplanewidth_37',['tj3YUVPlaneWidth',['../group___turbo_j_p_e_g.html#gac99d1933ede1d59fcada9a826e88eb2d',1,'turbojpeg.h']]]
|
||||
];
|
||||
@@ -1,4 +0,0 @@
|
||||
var searchData=
|
||||
[
|
||||
['turbojpeg_0',['TurboJPEG',['../group___turbo_j_p_e_g.html',1,'']]]
|
||||
];
|
||||
@@ -1,24 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"https://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
viewBox="0 0 20 19"
|
||||
height="19"
|
||||
width="20"
|
||||
id="svg2"
|
||||
version="1.1">
|
||||
<defs
|
||||
id="defs6" />
|
||||
<circle
|
||||
r="3.5"
|
||||
cy="8.5"
|
||||
cx="5.5"
|
||||
id="path4611"
|
||||
style="fill:#000000;fill-opacity:0;stroke:#656565;stroke-width:1.4;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none" />
|
||||
<path
|
||||
id="path4630"
|
||||
d="m 8.1085854,11.109059 2.7823556,2.782356"
|
||||
style="fill:none;stroke:#656565;stroke-width:1.4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 804 B |
@@ -1,24 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"https://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
viewBox="0 0 20 19"
|
||||
height="19"
|
||||
width="20"
|
||||
id="svg2"
|
||||
version="1.1">
|
||||
<defs
|
||||
id="defs6" />
|
||||
<circle
|
||||
r="3.5"
|
||||
cy="8.5"
|
||||
cx="5.5"
|
||||
id="path4611"
|
||||
style="fill:#000000;fill-opacity:0;stroke:#C5C5C5;stroke-width:1.4;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none" />
|
||||
<path
|
||||
id="path4630"
|
||||
d="m 8.1085854,11.109059 2.7823556,2.782356"
|
||||
style="fill:none;stroke:#C5C5C5;stroke-width:1.4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 804 B |
@@ -1,31 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"https://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
version="1.1"
|
||||
id="svg2"
|
||||
width="20"
|
||||
height="19"
|
||||
viewBox="0 0 20 19"
|
||||
>
|
||||
<defs
|
||||
id="defs6" />
|
||||
<circle
|
||||
style="fill:#000000;fill-opacity:0;stroke:#656565;stroke-width:1.4;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none"
|
||||
id="path4611"
|
||||
cx="5.5"
|
||||
cy="8.5"
|
||||
r="3.5" />
|
||||
<path
|
||||
style="fill:#656565;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="M 11,7 13.5,10 16,7 Z"
|
||||
id="path4609"
|
||||
/>
|
||||
<path
|
||||
style="fill:none;stroke:#656565;stroke-width:1.4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 8.1085854,11.109059 2.7823556,2.782356"
|
||||
id="path4630"
|
||||
/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 1019 B |
@@ -1,31 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"https://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
version="1.1"
|
||||
id="svg2"
|
||||
width="20"
|
||||
height="19"
|
||||
viewBox="0 0 20 19"
|
||||
>
|
||||
<defs
|
||||
id="defs6" />
|
||||
<circle
|
||||
style="fill:#000000;fill-opacity:0;stroke:#c5C5C5;stroke-width:1.4;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none"
|
||||
id="path4611"
|
||||
cx="5.5"
|
||||
cy="8.5"
|
||||
r="3.5" />
|
||||
<path
|
||||
style="fill:#c5C5C5;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="M 11,7 13.5,10 16,7 Z"
|
||||
id="path4609"
|
||||
/>
|
||||
<path
|
||||
style="fill:none;stroke:#c5C5C5;stroke-width:1.4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 8.1085854,11.109059 2.7823556,2.782356"
|
||||
id="path4630"
|
||||
/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 1019 B |
@@ -1,291 +0,0 @@
|
||||
/*---------------- Search Box positioning */
|
||||
|
||||
#main-menu > li:last-child {
|
||||
/* This <li> object is the parent of the search bar */
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 36px;
|
||||
margin-right: 1em;
|
||||
}
|
||||
|
||||
/*---------------- Search box styling */
|
||||
|
||||
.SRPage * {
|
||||
font-weight: normal;
|
||||
line-height: normal;
|
||||
}
|
||||
|
||||
dark-mode-toggle {
|
||||
margin-left: 5px;
|
||||
display: flex;
|
||||
float: right;
|
||||
}
|
||||
|
||||
#MSearchBox {
|
||||
display: inline-block;
|
||||
white-space : nowrap;
|
||||
background: var(--search-background-color);
|
||||
border-radius: 0.65em;
|
||||
box-shadow: var(--search-box-shadow);
|
||||
z-index: 102;
|
||||
}
|
||||
|
||||
#MSearchBox .left {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
height: 1.4em;
|
||||
}
|
||||
|
||||
#MSearchSelect {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
width: 20px;
|
||||
height: 19px;
|
||||
background-image: var(--search-magnification-select-image);
|
||||
margin: 0 0 0 0.3em;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#MSearchSelectExt {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
width: 10px;
|
||||
height: 19px;
|
||||
background-image: var(--search-magnification-image);
|
||||
margin: 0 0 0 0.5em;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
|
||||
#MSearchField {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
width: 7.5em;
|
||||
height: 19px;
|
||||
margin: 0 0.15em;
|
||||
padding: 0;
|
||||
line-height: 1em;
|
||||
border:none;
|
||||
color: var(--search-foreground-color);
|
||||
outline: none;
|
||||
font-family: var(--font-family-search);
|
||||
-webkit-border-radius: 0px;
|
||||
border-radius: 0px;
|
||||
background: none;
|
||||
}
|
||||
|
||||
@media(hover: none) {
|
||||
/* to avoid zooming on iOS */
|
||||
#MSearchField {
|
||||
font-size: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
#MSearchBox .right {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
width: 1.4em;
|
||||
height: 1.4em;
|
||||
}
|
||||
|
||||
#MSearchClose {
|
||||
display: none;
|
||||
font-size: inherit;
|
||||
background : none;
|
||||
border: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
outline: none;
|
||||
|
||||
}
|
||||
|
||||
#MSearchCloseImg {
|
||||
padding: 0.3em;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.MSearchBoxActive #MSearchField {
|
||||
color: var(--search-active-color);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*---------------- Search filter selection */
|
||||
|
||||
#MSearchSelectWindow {
|
||||
display: none;
|
||||
position: absolute;
|
||||
left: 0; top: 0;
|
||||
border: 1px solid var(--search-filter-border-color);
|
||||
background-color: var(--search-filter-background-color);
|
||||
z-index: 10001;
|
||||
padding-top: 4px;
|
||||
padding-bottom: 4px;
|
||||
-moz-border-radius: 4px;
|
||||
-webkit-border-top-left-radius: 4px;
|
||||
-webkit-border-top-right-radius: 4px;
|
||||
-webkit-border-bottom-left-radius: 4px;
|
||||
-webkit-border-bottom-right-radius: 4px;
|
||||
-webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
|
||||
}
|
||||
|
||||
.SelectItem {
|
||||
font: 8pt var(--font-family-search);
|
||||
padding-left: 2px;
|
||||
padding-right: 12px;
|
||||
border: 0px;
|
||||
}
|
||||
|
||||
span.SelectionMark {
|
||||
margin-right: 4px;
|
||||
font-family: var(--font-family-monospace);
|
||||
outline-style: none;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a.SelectItem {
|
||||
display: block;
|
||||
outline-style: none;
|
||||
color: var(--search-filter-foreground-color);
|
||||
text-decoration: none;
|
||||
padding-left: 6px;
|
||||
padding-right: 12px;
|
||||
}
|
||||
|
||||
a.SelectItem:focus,
|
||||
a.SelectItem:active {
|
||||
color: var(--search-filter-foreground-color);
|
||||
outline-style: none;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a.SelectItem:hover {
|
||||
color: var(--search-filter-highlight-text-color);
|
||||
background-color: var(--search-filter-highlight-bg-color);
|
||||
outline-style: none;
|
||||
text-decoration: none;
|
||||
cursor: pointer;
|
||||
display: block;
|
||||
}
|
||||
|
||||
/*---------------- Search results window */
|
||||
|
||||
iframe#MSearchResults {
|
||||
/*width: 60ex;*/
|
||||
height: 15em;
|
||||
}
|
||||
|
||||
#MSearchResultsWindow {
|
||||
display: none;
|
||||
position: absolute;
|
||||
left: 0; top: 0;
|
||||
border: 1px solid var(--search-results-border-color);
|
||||
background-color: var(--search-results-background-color);
|
||||
z-index:10000;
|
||||
width: 300px;
|
||||
height: 400px;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
/* ----------------------------------- */
|
||||
|
||||
|
||||
#SRIndex {
|
||||
clear:both;
|
||||
}
|
||||
|
||||
.SREntry {
|
||||
font-size: 10pt;
|
||||
padding-left: 1ex;
|
||||
}
|
||||
|
||||
.SRPage .SREntry {
|
||||
font-size: 8pt;
|
||||
padding: 1px 5px;
|
||||
}
|
||||
|
||||
div.SRPage {
|
||||
margin: 5px 2px;
|
||||
background-color: var(--search-results-background-color);
|
||||
}
|
||||
|
||||
.SRChildren {
|
||||
padding-left: 3ex; padding-bottom: .5em
|
||||
}
|
||||
|
||||
.SRPage .SRChildren {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.SRSymbol {
|
||||
font-weight: bold;
|
||||
color: var(--search-results-foreground-color);
|
||||
font-family: var(--font-family-search);
|
||||
text-decoration: none;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
a.SRScope {
|
||||
display: block;
|
||||
color: var(--search-results-foreground-color);
|
||||
font-family: var(--font-family-search);
|
||||
font-size: 8pt;
|
||||
text-decoration: none;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
a.SRSymbol:focus, a.SRSymbol:active,
|
||||
a.SRScope:focus, a.SRScope:active {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
span.SRScope {
|
||||
padding-left: 4px;
|
||||
font-family: var(--font-family-search);
|
||||
}
|
||||
|
||||
.SRPage .SRStatus {
|
||||
padding: 2px 5px;
|
||||
font-size: 8pt;
|
||||
font-style: italic;
|
||||
font-family: var(--font-family-search);
|
||||
}
|
||||
|
||||
.SRResult {
|
||||
display: none;
|
||||
}
|
||||
|
||||
div.searchresults {
|
||||
margin-left: 10px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
/*---------------- External search page results */
|
||||
|
||||
.pages b {
|
||||
color: white;
|
||||
padding: 5px 5px 3px 5px;
|
||||
background-image: var(--nav-gradient-active-image-parent);
|
||||
background-repeat: repeat-x;
|
||||
text-shadow: 0 1px 1px #000000;
|
||||
}
|
||||
|
||||
.pages {
|
||||
line-height: 17px;
|
||||
margin-left: 4px;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.hl {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
#searchresults {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.searchpages {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
@@ -1,840 +0,0 @@
|
||||
/*
|
||||
@licstart The following is the entire license notice for the JavaScript code in this file.
|
||||
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (C) 1997-2020 by Dimitri van Heesch
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software
|
||||
and associated documentation files (the "Software"), to deal in the Software without restriction,
|
||||
including without limitation the rights to use, copy, modify, merge, publish, distribute,
|
||||
sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or
|
||||
substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
|
||||
BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
@licend The above is the entire license notice for the JavaScript code in this file
|
||||
*/
|
||||
function convertToId(search)
|
||||
{
|
||||
var result = '';
|
||||
for (i=0;i<search.length;i++)
|
||||
{
|
||||
var c = search.charAt(i);
|
||||
var cn = c.charCodeAt(0);
|
||||
if (c.match(/[a-z0-9\u0080-\uFFFF]/))
|
||||
{
|
||||
result+=c;
|
||||
}
|
||||
else if (cn<16)
|
||||
{
|
||||
result+="_0"+cn.toString(16);
|
||||
}
|
||||
else
|
||||
{
|
||||
result+="_"+cn.toString(16);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
function getXPos(item)
|
||||
{
|
||||
var x = 0;
|
||||
if (item.offsetWidth)
|
||||
{
|
||||
while (item && item!=document.body)
|
||||
{
|
||||
x += item.offsetLeft;
|
||||
item = item.offsetParent;
|
||||
}
|
||||
}
|
||||
return x;
|
||||
}
|
||||
|
||||
function getYPos(item)
|
||||
{
|
||||
var y = 0;
|
||||
if (item.offsetWidth)
|
||||
{
|
||||
while (item && item!=document.body)
|
||||
{
|
||||
y += item.offsetTop;
|
||||
item = item.offsetParent;
|
||||
}
|
||||
}
|
||||
return y;
|
||||
}
|
||||
|
||||
var searchResults = new SearchResults("searchResults");
|
||||
|
||||
/* A class handling everything associated with the search panel.
|
||||
|
||||
Parameters:
|
||||
name - The name of the global variable that will be
|
||||
storing this instance. Is needed to be able to set timeouts.
|
||||
resultPath - path to use for external files
|
||||
*/
|
||||
function SearchBox(name, resultsPath, extension)
|
||||
{
|
||||
if (!name || !resultsPath) { alert("Missing parameters to SearchBox."); }
|
||||
if (!extension || extension == "") { extension = ".html"; }
|
||||
|
||||
// ---------- Instance variables
|
||||
this.name = name;
|
||||
this.resultsPath = resultsPath;
|
||||
this.keyTimeout = 0;
|
||||
this.keyTimeoutLength = 500;
|
||||
this.closeSelectionTimeout = 300;
|
||||
this.lastSearchValue = "";
|
||||
this.lastResultsPage = "";
|
||||
this.hideTimeout = 0;
|
||||
this.searchIndex = 0;
|
||||
this.searchActive = false;
|
||||
this.extension = extension;
|
||||
|
||||
// ----------- DOM Elements
|
||||
|
||||
this.DOMSearchField = function()
|
||||
{ return document.getElementById("MSearchField"); }
|
||||
|
||||
this.DOMSearchSelect = function()
|
||||
{ return document.getElementById("MSearchSelect"); }
|
||||
|
||||
this.DOMSearchSelectWindow = function()
|
||||
{ return document.getElementById("MSearchSelectWindow"); }
|
||||
|
||||
this.DOMPopupSearchResults = function()
|
||||
{ return document.getElementById("MSearchResults"); }
|
||||
|
||||
this.DOMPopupSearchResultsWindow = function()
|
||||
{ return document.getElementById("MSearchResultsWindow"); }
|
||||
|
||||
this.DOMSearchClose = function()
|
||||
{ return document.getElementById("MSearchClose"); }
|
||||
|
||||
this.DOMSearchBox = function()
|
||||
{ return document.getElementById("MSearchBox"); }
|
||||
|
||||
// ------------ Event Handlers
|
||||
|
||||
// Called when focus is added or removed from the search field.
|
||||
this.OnSearchFieldFocus = function(isActive)
|
||||
{
|
||||
this.Activate(isActive);
|
||||
}
|
||||
|
||||
this.OnSearchSelectShow = function()
|
||||
{
|
||||
var searchSelectWindow = this.DOMSearchSelectWindow();
|
||||
var searchField = this.DOMSearchSelect();
|
||||
|
||||
var left = getXPos(searchField);
|
||||
var top = getYPos(searchField);
|
||||
top += searchField.offsetHeight;
|
||||
|
||||
// show search selection popup
|
||||
searchSelectWindow.style.display='block';
|
||||
searchSelectWindow.style.left = left + 'px';
|
||||
searchSelectWindow.style.top = top + 'px';
|
||||
|
||||
// stop selection hide timer
|
||||
if (this.hideTimeout)
|
||||
{
|
||||
clearTimeout(this.hideTimeout);
|
||||
this.hideTimeout=0;
|
||||
}
|
||||
return false; // to avoid "image drag" default event
|
||||
}
|
||||
|
||||
this.OnSearchSelectHide = function()
|
||||
{
|
||||
this.hideTimeout = setTimeout(this.CloseSelectionWindow.bind(this),
|
||||
this.closeSelectionTimeout);
|
||||
}
|
||||
|
||||
// Called when the content of the search field is changed.
|
||||
this.OnSearchFieldChange = function(evt)
|
||||
{
|
||||
if (this.keyTimeout) // kill running timer
|
||||
{
|
||||
clearTimeout(this.keyTimeout);
|
||||
this.keyTimeout = 0;
|
||||
}
|
||||
|
||||
var e = (evt) ? evt : window.event; // for IE
|
||||
if (e.keyCode==40 || e.keyCode==13)
|
||||
{
|
||||
if (e.shiftKey==1)
|
||||
{
|
||||
this.OnSearchSelectShow();
|
||||
var win=this.DOMSearchSelectWindow();
|
||||
for (i=0;i<win.childNodes.length;i++)
|
||||
{
|
||||
var child = win.childNodes[i]; // get span within a
|
||||
if (child.className=='SelectItem')
|
||||
{
|
||||
child.focus();
|
||||
return;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
var elem = searchResults.NavNext(0);
|
||||
if (elem) elem.focus();
|
||||
}
|
||||
}
|
||||
else if (e.keyCode==27) // Escape out of the search field
|
||||
{
|
||||
e.stopPropagation();
|
||||
this.DOMSearchField().blur();
|
||||
this.DOMPopupSearchResultsWindow().style.display = 'none';
|
||||
this.DOMSearchClose().style.display = 'none';
|
||||
this.lastSearchValue = '';
|
||||
this.Activate(false);
|
||||
return;
|
||||
}
|
||||
|
||||
// strip whitespaces
|
||||
var searchValue = this.DOMSearchField().value.replace(/ +/g, "");
|
||||
|
||||
if (searchValue != this.lastSearchValue) // search value has changed
|
||||
{
|
||||
if (searchValue != "") // non-empty search
|
||||
{
|
||||
// set timer for search update
|
||||
this.keyTimeout = setTimeout(this.Search.bind(this),
|
||||
this.keyTimeoutLength);
|
||||
}
|
||||
else // empty search field
|
||||
{
|
||||
this.DOMPopupSearchResultsWindow().style.display = 'none';
|
||||
this.DOMSearchClose().style.display = 'none';
|
||||
this.lastSearchValue = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.SelectItemCount = function(id)
|
||||
{
|
||||
var count=0;
|
||||
var win=this.DOMSearchSelectWindow();
|
||||
for (i=0;i<win.childNodes.length;i++)
|
||||
{
|
||||
var child = win.childNodes[i]; // get span within a
|
||||
if (child.className=='SelectItem')
|
||||
{
|
||||
count++;
|
||||
}
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
this.SelectItemSet = function(id)
|
||||
{
|
||||
var i,j=0;
|
||||
var win=this.DOMSearchSelectWindow();
|
||||
for (i=0;i<win.childNodes.length;i++)
|
||||
{
|
||||
var child = win.childNodes[i]; // get span within a
|
||||
if (child.className=='SelectItem')
|
||||
{
|
||||
var node = child.firstChild;
|
||||
if (j==id)
|
||||
{
|
||||
node.innerHTML='•';
|
||||
}
|
||||
else
|
||||
{
|
||||
node.innerHTML=' ';
|
||||
}
|
||||
j++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Called when an search filter selection is made.
|
||||
// set item with index id as the active item
|
||||
this.OnSelectItem = function(id)
|
||||
{
|
||||
this.searchIndex = id;
|
||||
this.SelectItemSet(id);
|
||||
var searchValue = this.DOMSearchField().value.replace(/ +/g, "");
|
||||
if (searchValue!="" && this.searchActive) // something was found -> do a search
|
||||
{
|
||||
this.Search();
|
||||
}
|
||||
}
|
||||
|
||||
this.OnSearchSelectKey = function(evt)
|
||||
{
|
||||
var e = (evt) ? evt : window.event; // for IE
|
||||
if (e.keyCode==40 && this.searchIndex<this.SelectItemCount()) // Down
|
||||
{
|
||||
this.searchIndex++;
|
||||
this.OnSelectItem(this.searchIndex);
|
||||
}
|
||||
else if (e.keyCode==38 && this.searchIndex>0) // Up
|
||||
{
|
||||
this.searchIndex--;
|
||||
this.OnSelectItem(this.searchIndex);
|
||||
}
|
||||
else if (e.keyCode==13 || e.keyCode==27)
|
||||
{
|
||||
e.stopPropagation();
|
||||
this.OnSelectItem(this.searchIndex);
|
||||
this.CloseSelectionWindow();
|
||||
this.DOMSearchField().focus();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// --------- Actions
|
||||
|
||||
// Closes the results window.
|
||||
this.CloseResultsWindow = function()
|
||||
{
|
||||
this.DOMPopupSearchResultsWindow().style.display = 'none';
|
||||
this.DOMSearchClose().style.display = 'none';
|
||||
this.Activate(false);
|
||||
}
|
||||
|
||||
this.CloseSelectionWindow = function()
|
||||
{
|
||||
this.DOMSearchSelectWindow().style.display = 'none';
|
||||
}
|
||||
|
||||
// Performs a search.
|
||||
this.Search = function()
|
||||
{
|
||||
this.keyTimeout = 0;
|
||||
|
||||
// strip leading whitespace
|
||||
var searchValue = this.DOMSearchField().value.replace(/^ +/, "");
|
||||
|
||||
var code = searchValue.toLowerCase().charCodeAt(0);
|
||||
var idxChar = searchValue.substr(0, 1).toLowerCase();
|
||||
if ( 0xD800 <= code && code <= 0xDBFF && searchValue > 1) // surrogate pair
|
||||
{
|
||||
idxChar = searchValue.substr(0, 2);
|
||||
}
|
||||
|
||||
var jsFile;
|
||||
|
||||
var idx = indexSectionsWithContent[this.searchIndex].indexOf(idxChar);
|
||||
if (idx!=-1)
|
||||
{
|
||||
var hexCode=idx.toString(16);
|
||||
jsFile = this.resultsPath + indexSectionNames[this.searchIndex] + '_' + hexCode + '.js';
|
||||
}
|
||||
|
||||
var loadJS = function(url, impl, loc){
|
||||
var scriptTag = document.createElement('script');
|
||||
scriptTag.src = url;
|
||||
scriptTag.onload = impl;
|
||||
scriptTag.onreadystatechange = impl;
|
||||
loc.appendChild(scriptTag);
|
||||
}
|
||||
|
||||
var domPopupSearchResultsWindow = this.DOMPopupSearchResultsWindow();
|
||||
var domSearchBox = this.DOMSearchBox();
|
||||
var domPopupSearchResults = this.DOMPopupSearchResults();
|
||||
var domSearchClose = this.DOMSearchClose();
|
||||
var resultsPath = this.resultsPath;
|
||||
|
||||
var handleResults = function() {
|
||||
document.getElementById("Loading").style.display="none";
|
||||
if (typeof searchData !== 'undefined') {
|
||||
createResults(resultsPath);
|
||||
document.getElementById("NoMatches").style.display="none";
|
||||
}
|
||||
|
||||
if (idx!=-1) {
|
||||
searchResults.Search(searchValue);
|
||||
} else { // no file with search results => force empty search results
|
||||
searchResults.Search('====');
|
||||
}
|
||||
|
||||
if (domPopupSearchResultsWindow.style.display!='block')
|
||||
{
|
||||
domSearchClose.style.display = 'inline-block';
|
||||
var left = getXPos(domSearchBox) + 150;
|
||||
var top = getYPos(domSearchBox) + 20;
|
||||
domPopupSearchResultsWindow.style.display = 'block';
|
||||
left -= domPopupSearchResults.offsetWidth;
|
||||
var maxWidth = document.body.clientWidth;
|
||||
var maxHeight = document.body.clientHeight;
|
||||
var width = 300;
|
||||
if (left<10) left=10;
|
||||
if (width+left+8>maxWidth) width=maxWidth-left-8;
|
||||
var height = 400;
|
||||
if (height+top+8>maxHeight) height=maxHeight-top-8;
|
||||
domPopupSearchResultsWindow.style.top = top + 'px';
|
||||
domPopupSearchResultsWindow.style.left = left + 'px';
|
||||
domPopupSearchResultsWindow.style.width = width + 'px';
|
||||
domPopupSearchResultsWindow.style.height = height + 'px';
|
||||
}
|
||||
}
|
||||
|
||||
if (jsFile) {
|
||||
loadJS(jsFile, handleResults, this.DOMPopupSearchResultsWindow());
|
||||
} else {
|
||||
handleResults();
|
||||
}
|
||||
|
||||
this.lastSearchValue = searchValue;
|
||||
}
|
||||
|
||||
// -------- Activation Functions
|
||||
|
||||
// Activates or deactivates the search panel, resetting things to
|
||||
// their default values if necessary.
|
||||
this.Activate = function(isActive)
|
||||
{
|
||||
if (isActive || // open it
|
||||
this.DOMPopupSearchResultsWindow().style.display == 'block'
|
||||
)
|
||||
{
|
||||
this.DOMSearchBox().className = 'MSearchBoxActive';
|
||||
this.searchActive = true;
|
||||
}
|
||||
else if (!isActive) // directly remove the panel
|
||||
{
|
||||
this.DOMSearchBox().className = 'MSearchBoxInactive';
|
||||
this.searchActive = false;
|
||||
this.lastSearchValue = ''
|
||||
this.lastResultsPage = '';
|
||||
this.DOMSearchField().value = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
// The class that handles everything on the search results page.
|
||||
function SearchResults(name)
|
||||
{
|
||||
// The number of matches from the last run of <Search()>.
|
||||
this.lastMatchCount = 0;
|
||||
this.lastKey = 0;
|
||||
this.repeatOn = false;
|
||||
|
||||
// Toggles the visibility of the passed element ID.
|
||||
this.FindChildElement = function(id)
|
||||
{
|
||||
var parentElement = document.getElementById(id);
|
||||
var element = parentElement.firstChild;
|
||||
|
||||
while (element && element!=parentElement)
|
||||
{
|
||||
if (element.nodeName.toLowerCase() == 'div' && element.className == 'SRChildren')
|
||||
{
|
||||
return element;
|
||||
}
|
||||
|
||||
if (element.nodeName.toLowerCase() == 'div' && element.hasChildNodes())
|
||||
{
|
||||
element = element.firstChild;
|
||||
}
|
||||
else if (element.nextSibling)
|
||||
{
|
||||
element = element.nextSibling;
|
||||
}
|
||||
else
|
||||
{
|
||||
do
|
||||
{
|
||||
element = element.parentNode;
|
||||
}
|
||||
while (element && element!=parentElement && !element.nextSibling);
|
||||
|
||||
if (element && element!=parentElement)
|
||||
{
|
||||
element = element.nextSibling;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.Toggle = function(id)
|
||||
{
|
||||
var element = this.FindChildElement(id);
|
||||
if (element)
|
||||
{
|
||||
if (element.style.display == 'block')
|
||||
{
|
||||
element.style.display = 'none';
|
||||
}
|
||||
else
|
||||
{
|
||||
element.style.display = 'block';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Searches for the passed string. If there is no parameter,
|
||||
// it takes it from the URL query.
|
||||
//
|
||||
// Always returns true, since other documents may try to call it
|
||||
// and that may or may not be possible.
|
||||
this.Search = function(search)
|
||||
{
|
||||
if (!search) // get search word from URL
|
||||
{
|
||||
search = window.location.search;
|
||||
search = search.substring(1); // Remove the leading '?'
|
||||
search = unescape(search);
|
||||
}
|
||||
|
||||
search = search.replace(/^ +/, ""); // strip leading spaces
|
||||
search = search.replace(/ +$/, ""); // strip trailing spaces
|
||||
search = search.toLowerCase();
|
||||
search = convertToId(search);
|
||||
|
||||
var resultRows = document.getElementsByTagName("div");
|
||||
var matches = 0;
|
||||
|
||||
var i = 0;
|
||||
while (i < resultRows.length)
|
||||
{
|
||||
var row = resultRows.item(i);
|
||||
if (row.className == "SRResult")
|
||||
{
|
||||
var rowMatchName = row.id.toLowerCase();
|
||||
rowMatchName = rowMatchName.replace(/^sr\d*_/, ''); // strip 'sr123_'
|
||||
|
||||
if (search.length<=rowMatchName.length &&
|
||||
rowMatchName.substr(0, search.length)==search)
|
||||
{
|
||||
row.style.display = 'block';
|
||||
matches++;
|
||||
}
|
||||
else
|
||||
{
|
||||
row.style.display = 'none';
|
||||
}
|
||||
}
|
||||
i++;
|
||||
}
|
||||
document.getElementById("Searching").style.display='none';
|
||||
if (matches == 0) // no results
|
||||
{
|
||||
document.getElementById("NoMatches").style.display='block';
|
||||
}
|
||||
else // at least one result
|
||||
{
|
||||
document.getElementById("NoMatches").style.display='none';
|
||||
}
|
||||
this.lastMatchCount = matches;
|
||||
return true;
|
||||
}
|
||||
|
||||
// return the first item with index index or higher that is visible
|
||||
this.NavNext = function(index)
|
||||
{
|
||||
var focusItem;
|
||||
while (1)
|
||||
{
|
||||
var focusName = 'Item'+index;
|
||||
focusItem = document.getElementById(focusName);
|
||||
if (focusItem && focusItem.parentNode.parentNode.style.display=='block')
|
||||
{
|
||||
break;
|
||||
}
|
||||
else if (!focusItem) // last element
|
||||
{
|
||||
break;
|
||||
}
|
||||
focusItem=null;
|
||||
index++;
|
||||
}
|
||||
return focusItem;
|
||||
}
|
||||
|
||||
this.NavPrev = function(index)
|
||||
{
|
||||
var focusItem;
|
||||
while (1)
|
||||
{
|
||||
var focusName = 'Item'+index;
|
||||
focusItem = document.getElementById(focusName);
|
||||
if (focusItem && focusItem.parentNode.parentNode.style.display=='block')
|
||||
{
|
||||
break;
|
||||
}
|
||||
else if (!focusItem) // last element
|
||||
{
|
||||
break;
|
||||
}
|
||||
focusItem=null;
|
||||
index--;
|
||||
}
|
||||
return focusItem;
|
||||
}
|
||||
|
||||
this.ProcessKeys = function(e)
|
||||
{
|
||||
if (e.type == "keydown")
|
||||
{
|
||||
this.repeatOn = false;
|
||||
this.lastKey = e.keyCode;
|
||||
}
|
||||
else if (e.type == "keypress")
|
||||
{
|
||||
if (!this.repeatOn)
|
||||
{
|
||||
if (this.lastKey) this.repeatOn = true;
|
||||
return false; // ignore first keypress after keydown
|
||||
}
|
||||
}
|
||||
else if (e.type == "keyup")
|
||||
{
|
||||
this.lastKey = 0;
|
||||
this.repeatOn = false;
|
||||
}
|
||||
return this.lastKey!=0;
|
||||
}
|
||||
|
||||
this.Nav = function(evt,itemIndex)
|
||||
{
|
||||
var e = (evt) ? evt : window.event; // for IE
|
||||
if (e.keyCode==13) return true;
|
||||
if (!this.ProcessKeys(e)) return false;
|
||||
|
||||
if (this.lastKey==38) // Up
|
||||
{
|
||||
var newIndex = itemIndex-1;
|
||||
var focusItem = this.NavPrev(newIndex);
|
||||
if (focusItem)
|
||||
{
|
||||
var child = this.FindChildElement(focusItem.parentNode.parentNode.id);
|
||||
if (child && child.style.display == 'block') // children visible
|
||||
{
|
||||
var n=0;
|
||||
var tmpElem;
|
||||
while (1) // search for last child
|
||||
{
|
||||
tmpElem = document.getElementById('Item'+newIndex+'_c'+n);
|
||||
if (tmpElem)
|
||||
{
|
||||
focusItem = tmpElem;
|
||||
}
|
||||
else // found it!
|
||||
{
|
||||
break;
|
||||
}
|
||||
n++;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (focusItem)
|
||||
{
|
||||
focusItem.focus();
|
||||
}
|
||||
else // return focus to search field
|
||||
{
|
||||
document.getElementById("MSearchField").focus();
|
||||
}
|
||||
}
|
||||
else if (this.lastKey==40) // Down
|
||||
{
|
||||
var newIndex = itemIndex+1;
|
||||
var focusItem;
|
||||
var item = document.getElementById('Item'+itemIndex);
|
||||
var elem = this.FindChildElement(item.parentNode.parentNode.id);
|
||||
if (elem && elem.style.display == 'block') // children visible
|
||||
{
|
||||
focusItem = document.getElementById('Item'+itemIndex+'_c0');
|
||||
}
|
||||
if (!focusItem) focusItem = this.NavNext(newIndex);
|
||||
if (focusItem) focusItem.focus();
|
||||
}
|
||||
else if (this.lastKey==39) // Right
|
||||
{
|
||||
var item = document.getElementById('Item'+itemIndex);
|
||||
var elem = this.FindChildElement(item.parentNode.parentNode.id);
|
||||
if (elem) elem.style.display = 'block';
|
||||
}
|
||||
else if (this.lastKey==37) // Left
|
||||
{
|
||||
var item = document.getElementById('Item'+itemIndex);
|
||||
var elem = this.FindChildElement(item.parentNode.parentNode.id);
|
||||
if (elem) elem.style.display = 'none';
|
||||
}
|
||||
else if (this.lastKey==27) // Escape
|
||||
{
|
||||
e.stopPropagation();
|
||||
searchBox.CloseResultsWindow();
|
||||
document.getElementById("MSearchField").focus();
|
||||
}
|
||||
else if (this.lastKey==13) // Enter
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
this.NavChild = function(evt,itemIndex,childIndex)
|
||||
{
|
||||
var e = (evt) ? evt : window.event; // for IE
|
||||
if (e.keyCode==13) return true;
|
||||
if (!this.ProcessKeys(e)) return false;
|
||||
|
||||
if (this.lastKey==38) // Up
|
||||
{
|
||||
if (childIndex>0)
|
||||
{
|
||||
var newIndex = childIndex-1;
|
||||
document.getElementById('Item'+itemIndex+'_c'+newIndex).focus();
|
||||
}
|
||||
else // already at first child, jump to parent
|
||||
{
|
||||
document.getElementById('Item'+itemIndex).focus();
|
||||
}
|
||||
}
|
||||
else if (this.lastKey==40) // Down
|
||||
{
|
||||
var newIndex = childIndex+1;
|
||||
var elem = document.getElementById('Item'+itemIndex+'_c'+newIndex);
|
||||
if (!elem) // last child, jump to parent next parent
|
||||
{
|
||||
elem = this.NavNext(itemIndex+1);
|
||||
}
|
||||
if (elem)
|
||||
{
|
||||
elem.focus();
|
||||
}
|
||||
}
|
||||
else if (this.lastKey==27) // Escape
|
||||
{
|
||||
e.stopPropagation();
|
||||
searchBox.CloseResultsWindow();
|
||||
document.getElementById("MSearchField").focus();
|
||||
}
|
||||
else if (this.lastKey==13) // Enter
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function setKeyActions(elem,action)
|
||||
{
|
||||
elem.setAttribute('onkeydown',action);
|
||||
elem.setAttribute('onkeypress',action);
|
||||
elem.setAttribute('onkeyup',action);
|
||||
}
|
||||
|
||||
function setClassAttr(elem,attr)
|
||||
{
|
||||
elem.setAttribute('class',attr);
|
||||
elem.setAttribute('className',attr);
|
||||
}
|
||||
|
||||
function createResults(resultsPath)
|
||||
{
|
||||
var results = document.getElementById("SRResults");
|
||||
results.innerHTML = '';
|
||||
for (var e=0; e<searchData.length; e++)
|
||||
{
|
||||
var id = searchData[e][0];
|
||||
var srResult = document.createElement('div');
|
||||
srResult.setAttribute('id','SR_'+id);
|
||||
setClassAttr(srResult,'SRResult');
|
||||
var srEntry = document.createElement('div');
|
||||
setClassAttr(srEntry,'SREntry');
|
||||
var srLink = document.createElement('a');
|
||||
srLink.setAttribute('id','Item'+e);
|
||||
setKeyActions(srLink,'return searchResults.Nav(event,'+e+')');
|
||||
setClassAttr(srLink,'SRSymbol');
|
||||
srLink.innerHTML = searchData[e][1][0];
|
||||
srEntry.appendChild(srLink);
|
||||
if (searchData[e][1].length==2) // single result
|
||||
{
|
||||
srLink.setAttribute('href',resultsPath+searchData[e][1][1][0]);
|
||||
srLink.setAttribute('onclick','searchBox.CloseResultsWindow()');
|
||||
if (searchData[e][1][1][1])
|
||||
{
|
||||
srLink.setAttribute('target','_parent');
|
||||
}
|
||||
else
|
||||
{
|
||||
srLink.setAttribute('target','_blank');
|
||||
}
|
||||
var srScope = document.createElement('span');
|
||||
setClassAttr(srScope,'SRScope');
|
||||
srScope.innerHTML = searchData[e][1][1][2];
|
||||
srEntry.appendChild(srScope);
|
||||
}
|
||||
else // multiple results
|
||||
{
|
||||
srLink.setAttribute('href','javascript:searchResults.Toggle("SR_'+id+'")');
|
||||
var srChildren = document.createElement('div');
|
||||
setClassAttr(srChildren,'SRChildren');
|
||||
for (var c=0; c<searchData[e][1].length-1; c++)
|
||||
{
|
||||
var srChild = document.createElement('a');
|
||||
srChild.setAttribute('id','Item'+e+'_c'+c);
|
||||
setKeyActions(srChild,'return searchResults.NavChild(event,'+e+','+c+')');
|
||||
setClassAttr(srChild,'SRScope');
|
||||
srChild.setAttribute('href',resultsPath+searchData[e][1][c+1][0]);
|
||||
srChild.setAttribute('onclick','searchBox.CloseResultsWindow()');
|
||||
if (searchData[e][1][c+1][1])
|
||||
{
|
||||
srChild.setAttribute('target','_parent');
|
||||
}
|
||||
else
|
||||
{
|
||||
srChild.setAttribute('target','_blank');
|
||||
}
|
||||
srChild.innerHTML = searchData[e][1][c+1][2];
|
||||
srChildren.appendChild(srChild);
|
||||
}
|
||||
srEntry.appendChild(srChildren);
|
||||
}
|
||||
srResult.appendChild(srEntry);
|
||||
results.appendChild(srResult);
|
||||
}
|
||||
}
|
||||
|
||||
function init_search()
|
||||
{
|
||||
var results = document.getElementById("MSearchSelectWindow");
|
||||
results.tabIndex=0;
|
||||
for (var key in indexSectionLabels)
|
||||
{
|
||||
var link = document.createElement('a');
|
||||
link.setAttribute('class','SelectItem');
|
||||
link.setAttribute('onclick','searchBox.OnSelectItem('+key+')');
|
||||
link.href='javascript:void(0)';
|
||||
link.innerHTML='<span class="SelectionMark"> </span>'+indexSectionLabels[key];
|
||||
results.appendChild(link);
|
||||
}
|
||||
searchBox.OnSelectItem(0);
|
||||
|
||||
var input = document.getElementById("MSearchSelect");
|
||||
var searchSelectWindow = document.getElementById("MSearchSelectWindow");
|
||||
input.tabIndex=0;
|
||||
input.addEventListener("keydown", function(event) {
|
||||
if (event.keyCode==13 || event.keyCode==40) {
|
||||
event.preventDefault();
|
||||
if (searchSelectWindow.style.display == 'block') {
|
||||
searchBox.CloseSelectionWindow();
|
||||
} else {
|
||||
searchBox.OnSearchSelectShow();
|
||||
searchBox.DOMSearchSelectWindow().focus();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
/* @license-end */
|
||||
@@ -1,36 +0,0 @@
|
||||
var indexSectionsWithContent =
|
||||
{
|
||||
0: "cdfhinortwxy",
|
||||
1: "t",
|
||||
2: "t",
|
||||
3: "cdhnortwxy",
|
||||
4: "t",
|
||||
5: "t",
|
||||
6: "t",
|
||||
7: "t"
|
||||
};
|
||||
|
||||
var indexSectionNames =
|
||||
{
|
||||
0: "all",
|
||||
1: "classes",
|
||||
2: "functions",
|
||||
3: "variables",
|
||||
4: "typedefs",
|
||||
5: "enums",
|
||||
6: "enumvalues",
|
||||
7: "groups"
|
||||
};
|
||||
|
||||
var indexSectionLabels =
|
||||
{
|
||||
0: "All",
|
||||
1: "Data Structures",
|
||||
2: "Functions",
|
||||
3: "Variables",
|
||||
4: "Typedefs",
|
||||
5: "Enumerations",
|
||||
6: "Enumerator",
|
||||
7: "Modules"
|
||||
};
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
var searchData=
|
||||
[
|
||||
['tjhandle_0',['tjhandle',['../group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763',1,'turbojpeg.h']]],
|
||||
['tjtransform_1',['tjtransform',['../group___turbo_j_p_e_g.html#ga504805ec0161f1b505397ca0118bf8fd',1,'turbojpeg.h']]]
|
||||
];
|
||||
@@ -1,4 +0,0 @@
|
||||
var searchData=
|
||||
[
|
||||
['customfilter_0',['customFilter',['../structtjtransform.html#a0dc7697d59a7abe48afc629e96cbc1d2',1,'tjtransform']]]
|
||||
];
|
||||
@@ -1,5 +0,0 @@
|
||||
var searchData=
|
||||
[
|
||||
['data_0',['data',['../structtjtransform.html#a688fe8f1a8ecc12a538d9e561cf338e3',1,'tjtransform']]],
|
||||
['denom_1',['denom',['../structtjscalingfactor.html#aefbcdf3e9e62274b2d312c695f133ce3',1,'tjscalingfactor']]]
|
||||
];
|
||||
@@ -1,4 +0,0 @@
|
||||
var searchData=
|
||||
[
|
||||
['h_0',['h',['../structtjregion.html#aecefc45a26f4d8b60dd4d825c1710115',1,'tjregion']]]
|
||||
];
|
||||
@@ -1,4 +0,0 @@
|
||||
var searchData=
|
||||
[
|
||||
['num_0',['num',['../structtjscalingfactor.html#a9b011e57f981ee23083e2c1aa5e640ec',1,'tjscalingfactor']]]
|
||||
];
|
||||