Add batch processing, and format converter

This commit is contained in:
2026-06-29 16:26:08 +07:00
parent 30d84eef72
commit 785a227bad
867 changed files with 40914 additions and 2272 deletions
+2 -2
View File
@@ -7,8 +7,8 @@
<application
android:allowBackup="true"
android:icon="@drawable/kicon_circle"
android:roundIcon="@drawable/kicon_square"
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round"
android:label="KCompressor"
android:supportsRtl="true"
android:theme="@style/AppTheme">
+79 -5
View File
@@ -20,6 +20,15 @@ set(IMAGE_COMPRESS_INCLUDE_DIR
set(IMAGE_COMPRESS_LIB_DIR
${IMAGE_COMPRESS_ROOT}/lib)
set(JPEGLI_ROOT
${CMAKE_SOURCE_DIR}/third_party/jpegli-android/${ANDROID_ABI})
set(JPEGLI_INCLUDE_DIR
${JPEGLI_ROOT}/include)
set(JPEGLI_LIB_DIR
${JPEGLI_ROOT}/lib)
set(PDF_COMPRESS_ROOT
${CMAKE_SOURCE_DIR}/third_party/pdf-android/${ANDROID_ABI})
@@ -29,11 +38,21 @@ set(PDF_COMPRESS_INCLUDE_DIR
set(PDF_COMPRESS_LIB_DIR
${PDF_COMPRESS_ROOT}/lib)
set(GHOSTSCRIPT_ROOT
${CMAKE_SOURCE_DIR}/third_party/ghostscript-android/${ANDROID_ABI})
set(GHOSTSCRIPT_INCLUDE_DIR
${GHOSTSCRIPT_ROOT}/include)
set(GHOSTSCRIPT_LIB_DIR
${GHOSTSCRIPT_ROOT}/lib)
add_library(kcompressor SHARED
native_compressor.cpp
compressor_common.cpp
video_compressor.cpp
image_compressor.cpp
jpegli_encoder.cpp
pdf_compressor.cpp)
target_include_directories(kcompressor PRIVATE
@@ -42,7 +61,10 @@ target_include_directories(kcompressor PRIVATE
${FFMPEG_INCLUDE_DIR}/x264
${FFMPEG_INCLUDE_DIR}/x265
${IMAGE_COMPRESS_INCLUDE_DIR}
${PDF_COMPRESS_INCLUDE_DIR})
${JPEGLI_INCLUDE_DIR}
${PDF_COMPRESS_INCLUDE_DIR}
${GHOSTSCRIPT_INCLUDE_DIR}
${GHOSTSCRIPT_INCLUDE_DIR}/ghostscript)
function(import_static_required target_name lib_dir lib_name)
set(full_path ${lib_dir}/${lib_name})
@@ -76,10 +98,22 @@ import_static_required(imagequant ${IMAGE_COMPRESS_LIB_DIR} libimagequant.a)
import_static_required(oxipng_ffi ${IMAGE_COMPRESS_LIB_DIR} liboxipng_ffi.a)
import_static_required(kimage_png ${IMAGE_COMPRESS_LIB_DIR} libkimage_png.a)
# Jpegli private-symbol build.
# Expected:
# app/src/main/cpp/third_party/jpegli-android/${ANDROID_ABI}/lib/libkjpegli_all_private.a
# app/src/main/cpp/third_party/jpegli-android/${ANDROID_ABI}/include/kjpegli/kjpegli_jpeglib_prefix.h
import_static_required(kjpegli ${JPEGLI_LIB_DIR} libkjpegli_all_private.a)
import_static_required(qpdf ${PDF_COMPRESS_LIB_DIR} libqpdf.a)
import_static_required(pdf_zopfli ${PDF_COMPRESS_LIB_DIR} libzopfli.a)
import_static_required(pdf_zlib ${PDF_COMPRESS_LIB_DIR} libz.a)
# Ghostscript static backend untuk PDF Recommended preserve-text.
# Expected:
# app/src/main/cpp/third_party/ghostscript-android/${ANDROID_ABI}/lib/libgs.a
# app/src/main/cpp/third_party/ghostscript-android/${ANDROID_ABI}/include/ghostscript/iapi.h
import_static_required(ghostscript ${GHOSTSCRIPT_LIB_DIR} libgs.a)
target_compile_features(kcompressor PRIVATE cxx_std_17)
target_compile_options(kcompressor PRIVATE
@@ -90,6 +124,41 @@ target_compile_options(kcompressor PRIVATE
-Wno-unused-parameter
-Wno-deprecated-declarations)
set(KCOMPRESSOR_EXPORTS
${CMAKE_CURRENT_SOURCE_DIR}/kcompressor.exports.map)
target_compile_definitions(kcompressor PRIVATE
NDEBUG
KC_RELEASE_NO_LOG=1)
target_compile_options(kcompressor PRIVATE
-fvisibility=hidden
-fvisibility-inlines-hidden
-ffunction-sections
-fdata-sections
-fno-ident
-g0
-ffile-prefix-map=${CMAKE_SOURCE_DIR}=.
-fmacro-prefix-map=${CMAKE_SOURCE_DIR}=.)
target_link_options(kcompressor PRIVATE
-Wl,--exclude-libs,ALL
-Wl,--gc-sections
-Wl,--icf=safe
-Wl,--version-script=${KCOMPRESSOR_EXPORTS}
-Wl,--strip-all
)
if (CMAKE_STRIP)
add_custom_command(TARGET kcompressor POST_BUILD
COMMAND ${CMAKE_STRIP}
--strip-all
--remove-section=.comment
--remove-section=.note.android.ident
$<TARGET_FILE:kcompressor>
COMMENT "Strip symbols and non-essential metadata from libkcompressor.so")
endif()
# --start-group penting karena semua dependency berupa static archive.
target_link_libraries(kcompressor
-Wl,--start-group
@@ -103,10 +172,9 @@ target_link_libraries(kcompressor
x264
x265
qpdf
pdf_zopfli
pdf_zlib
# Dengan Ghostscript V10 private-symbol, urutan JPEG tidak lagi menjadi
# penentu benar/salah runtime. Urutan ini tetap rapi: image stack,
# Ghostscript PDF, lalu qpdf/zlib final cleanup.
mozjpeg_turbojpeg
mozjpeg_jpeg
webp
@@ -117,6 +185,12 @@ target_link_libraries(kcompressor
imagequant
oxipng_ffi
kimage_png
kjpegli
ghostscript
qpdf
pdf_zopfli
pdf_zlib
-Wl,--end-group
+421 -34
View File
@@ -1,12 +1,18 @@
#include "image_compressor.h"
#include "compressor_common.h"
#include "jpegli_encoder.h"
#include <algorithm>
#include <cerrno>
#include <cmath>
#include <cstdint>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <cstddef>
#include <setjmp.h>
#include <string>
#include <utility>
#include <vector>
#include <android/log.h>
@@ -21,11 +27,26 @@
#include <avif/avif.h>
extern "C" {
#include <jpeglib.h>
#include <libimagequant.h>
#include <oxipng_ffi.h>
#include <kimage_png_codec.h>
#include <zlib.h>
#if defined(__has_include)
# if __has_include(<zopfli/zopfli.h>)
# include <zopfli/zopfli.h>
# define KCOMPRESSOR_HAS_ZOPFLI 1
# elif __has_include(<zopfli.h>)
# include <zopfli.h>
# define KCOMPRESSOR_HAS_ZOPFLI 1
# endif
#endif
}
#ifndef KCOMPRESSOR_HAS_ZOPFLI
#define KCOMPRESSOR_HAS_ZOPFLI 0
#endif
#include <lodepng.h>
#define LOG_TAG "KCompressorImage"
@@ -153,9 +174,104 @@ static bool looks_like_avif(const std::vector<uint8_t> &data) {
return false;
}
struct JpegErrorManager {
jpeg_error_mgr pub;
jmp_buf setjmp_buffer;
char message[JMSG_LENGTH_MAX];
};
static void jpeg_error_exit_bridge(j_common_ptr cinfo) {
JpegErrorManager *err = reinterpret_cast<JpegErrorManager *>(cinfo->err);
if (err) {
(*cinfo->err->format_message)(cinfo, err->message);
longjmp(err->setjmp_buffer, 1);
}
}
static bool decode_jpeg_rgba_libjpeg(const std::vector<uint8_t> &input, RgbaImage &out) {
jpeg_decompress_struct cinfo {};
JpegErrorManager jerr {};
cinfo.err = jpeg_std_error(&jerr.pub);
jerr.pub.error_exit = jpeg_error_exit_bridge;
if (setjmp(jerr.setjmp_buffer)) {
LOGE("libjpeg decode failed: %s", jerr.message);
jpeg_destroy_decompress(&cinfo);
return false;
}
jpeg_create_decompress(&cinfo);
jpeg_mem_src(&cinfo,
const_cast<unsigned char *>(input.data()),
static_cast<unsigned long>(input.size()));
int header = jpeg_read_header(&cinfo, TRUE);
if (header != JPEG_HEADER_OK) {
LOGE("libjpeg read header failed header=%d", header);
jpeg_destroy_decompress(&cinfo);
return false;
}
cinfo.out_color_space = JCS_RGB;
cinfo.dct_method = JDCT_ISLOW;
cinfo.do_fancy_upsampling = TRUE;
if (!jpeg_start_decompress(&cinfo)) {
LOGE("libjpeg start decompress failed");
jpeg_destroy_decompress(&cinfo);
return false;
}
const int width = static_cast<int>(cinfo.output_width);
const int height = static_cast<int>(cinfo.output_height);
const int components = static_cast<int>(cinfo.output_components);
if (width <= 0 || height <= 0 || components < 3) {
LOGE("libjpeg invalid output w=%d h=%d comp=%d", width, height, components);
jpeg_finish_decompress(&cinfo);
jpeg_destroy_decompress(&cinfo);
return false;
}
out.width = width;
out.height = height;
out.pixels.assign(static_cast<size_t>(width) * height * 4, 255);
std::vector<uint8_t> row(static_cast<size_t>(width) * components);
while (cinfo.output_scanline < cinfo.output_height) {
JSAMPROW rows[1];
rows[0] = row.data();
JDIMENSION read_count = jpeg_read_scanlines(&cinfo, rows, 1);
if (read_count != 1) {
LOGE("libjpeg read scanline failed at %u", cinfo.output_scanline);
jpeg_finish_decompress(&cinfo);
jpeg_destroy_decompress(&cinfo);
return false;
}
const size_t y = static_cast<size_t>(cinfo.output_scanline - 1);
uint8_t *dst = out.pixels.data() + y * static_cast<size_t>(width) * 4;
for (int x = 0; x < width; ++x) {
const uint8_t *src = row.data() + static_cast<size_t>(x) * components;
dst[static_cast<size_t>(x) * 4 + 0] = src[0];
dst[static_cast<size_t>(x) * 4 + 1] = src[1];
dst[static_cast<size_t>(x) * 4 + 2] = src[2];
dst[static_cast<size_t>(x) * 4 + 3] = 255;
}
}
jpeg_finish_decompress(&cinfo);
jpeg_destroy_decompress(&cinfo);
return true;
}
static bool decode_jpeg_rgba(const std::vector<uint8_t> &input, RgbaImage &out) {
tjhandle handle = tjInitDecompress();
if (!handle) return false;
if (!handle) {
LOGE("tjInitDecompress failed");
return decode_jpeg_rgba_libjpeg(input, out);
}
int width = 0;
int height = 0;
@@ -173,28 +289,71 @@ static bool decode_jpeg_rgba(const std::vector<uint8_t> &input, RgbaImage &out)
);
if (ret != 0 || width <= 0 || height <= 0) {
LOGE("TurboJPEG header failed ret=%d w=%d h=%d err=%s",
ret, width, height, tjGetErrorStr2(handle));
tjDestroy(handle);
return false;
return decode_jpeg_rgba_libjpeg(input, out);
}
LOGD("JPEG header ok w=%d h=%d subsamp=%d colorspace=%d", width, height, subsamp, colorspace);
out.width = width;
out.height = height;
out.pixels.assign(static_cast<size_t>(width) * height * 4, 255);
const int try_flags[] = {0, TJFLAG_ACCURATEDCT, TJFLAG_FASTDCT};
for (int flag : try_flags) {
ret = tjDecompress2(
handle,
const_cast<unsigned char *>(input.data()),
static_cast<unsigned long>(input.size()),
out.pixels.data(),
width,
width * 4,
height,
TJPF_RGBA,
flag
);
if (ret == 0) {
tjDestroy(handle);
return true;
}
LOGE("TurboJPEG RGBA failed flag=%d ret=%d err=%s", flag, ret, tjGetErrorStr2(handle));
}
std::vector<uint8_t> rgb(static_cast<size_t>(width) * height * 3);
ret = tjDecompress2(
handle,
const_cast<unsigned char *>(input.data()),
static_cast<unsigned long>(input.size()),
out.pixels.data(),
rgb.data(),
width,
width * 4,
width * 3,
height,
TJPF_RGBA,
TJFLAG_FASTDCT
TJPF_RGB,
TJFLAG_ACCURATEDCT
);
tjDestroy(handle);
return ret == 0;
if (ret == 0) {
for (int y = 0; y < height; ++y) {
for (int x = 0; x < width; ++x) {
const uint8_t *src = rgb.data() + (static_cast<size_t>(y) * width + x) * 3;
uint8_t *dst = out.pixels.data() + (static_cast<size_t>(y) * width + x) * 4;
dst[0] = src[0];
dst[1] = src[1];
dst[2] = src[2];
dst[3] = 255;
}
}
return true;
}
LOGE("TurboJPEG RGB fallback failed, trying libjpeg fallback");
return decode_jpeg_rgba_libjpeg(input, out);
}
static bool decode_png_rgba(const std::vector<uint8_t> &input, RgbaImage &out) {
@@ -302,28 +461,37 @@ static bool decode_input_rgba(const std::vector<uint8_t> &input,
std::string mime = input_mime;
std::transform(mime.begin(), mime.end(), mime.begin(), ::tolower);
if (mime.find("jpeg") != std::string::npos || mime.find("jpg") != std::string::npos || looks_like_jpeg(input)) {
return decode_jpeg_rgba(input, out);
}
const bool is_jpeg = looks_like_jpeg(input);
const bool is_png = looks_like_png(input);
const bool is_webp = looks_like_webp(input);
const bool is_avif = looks_like_avif(input);
if (mime.find("png") != std::string::npos || looks_like_png(input)) {
return decode_png_rgba(input, out);
}
LOGD("decode_input_rgba mime=%s magic jpeg=%d png=%d webp=%d avif=%d size=%zu",
mime.c_str(), is_jpeg ? 1 : 0, is_png ? 1 : 0, is_webp ? 1 : 0, is_avif ? 1 : 0, input.size());
if (mime.find("webp") != std::string::npos || looks_like_webp(input)) {
return decode_webp_rgba(input, out);
}
// Prioritas utama berdasarkan magic/header asli. Jangan langsung menyerah
// hanya karena decoder pertama gagal; beberapa provider bisa memberi MIME
// benar tetapi file memakai varian JPEG/PNG tertentu.
if (is_jpeg && decode_jpeg_rgba(input, out)) return true;
if (is_png && decode_png_rgba(input, out)) return true;
if (is_webp && decode_webp_rgba(input, out)) return true;
if (is_avif && decode_avif_rgba(input, out)) return true;
if (mime.find("avif") != std::string::npos || looks_like_avif(input)) {
return decode_avif_rgba(input, out);
}
if ((mime.find("jpeg") != std::string::npos || mime.find("jpg") != std::string::npos) &&
decode_jpeg_rgba(input, out)) return true;
// Fallback by magic.
if (looks_like_jpeg(input)) return decode_jpeg_rgba(input, out);
if (looks_like_png(input)) return decode_png_rgba(input, out);
if (looks_like_webp(input)) return decode_webp_rgba(input, out);
if (looks_like_avif(input)) return decode_avif_rgba(input, out);
if (mime.find("png") != std::string::npos && decode_png_rgba(input, out)) return true;
if (mime.find("webp") != std::string::npos && decode_webp_rgba(input, out)) return true;
if (mime.find("avif") != std::string::npos && decode_avif_rgba(input, out)) return true;
// Fallback terakhir: coba semua decoder supaya JPEG/PNG/WebP/AVIF tidak
// terdampak MIME provider yang salah.
if (!is_jpeg && decode_jpeg_rgba(input, out)) return true;
if (!is_png && decode_png_rgba(input, out)) return true;
if (!is_webp && decode_webp_rgba(input, out)) return true;
if (!is_avif && decode_avif_rgba(input, out)) return true;
LOGE("decode_input_rgba failed mime=%s size=%zu", mime.c_str(), input.size());
return false;
}
@@ -400,7 +568,190 @@ static bool encode_jpeg_rgba(const RgbaImage &image, int quality, std::vector<ui
return true;
}
static bool oxipng_optimize_vector(const std::vector<uint8_t> &png, std::vector<uint8_t> &out, uint8_t level) {
static uint32_t png_read_be32(const uint8_t *p) {
return (static_cast<uint32_t>(p[0]) << 24) |
(static_cast<uint32_t>(p[1]) << 16) |
(static_cast<uint32_t>(p[2]) << 8) |
static_cast<uint32_t>(p[3]);
}
static void png_append_be32(std::vector<uint8_t> &out, uint32_t value) {
out.push_back(static_cast<uint8_t>((value >> 24) & 0xFF));
out.push_back(static_cast<uint8_t>((value >> 16) & 0xFF));
out.push_back(static_cast<uint8_t>((value >> 8) & 0xFF));
out.push_back(static_cast<uint8_t>(value & 0xFF));
}
static void png_append_chunk(std::vector<uint8_t> &out,
const char type[4],
const std::vector<uint8_t> &data) {
png_append_be32(out, static_cast<uint32_t>(data.size()));
const size_t type_pos = out.size();
out.insert(out.end(), type, type + 4);
out.insert(out.end(), data.begin(), data.end());
uint32_t crc = crc32(0L, Z_NULL, 0);
crc = crc32(crc, out.data() + type_pos, static_cast<uInt>(4 + data.size()));
png_append_be32(out, crc);
}
static bool inflate_zlib_stream(const std::vector<uint8_t> &compressed,
std::vector<uint8_t> &raw) {
if (compressed.empty()) return false;
z_stream stream {};
stream.next_in = const_cast<Bytef *>(reinterpret_cast<const Bytef *>(compressed.data()));
stream.avail_in = static_cast<uInt>(compressed.size());
int ret = inflateInit(&stream);
if (ret != Z_OK) return false;
uint8_t buffer[128 * 1024];
bool ok = false;
while (true) {
stream.next_out = buffer;
stream.avail_out = sizeof(buffer);
ret = inflate(&stream, Z_NO_FLUSH);
if (ret != Z_OK && ret != Z_STREAM_END) {
break;
}
size_t produced = sizeof(buffer) - stream.avail_out;
if (produced > 0) {
raw.insert(raw.end(), buffer, buffer + produced);
}
if (ret == Z_STREAM_END) {
ok = true;
break;
}
}
inflateEnd(&stream);
return ok && !raw.empty();
}
static bool zopfli_zlib_compress(const std::vector<uint8_t> &raw,
std::vector<uint8_t> &compressed) {
#if KCOMPRESSOR_HAS_ZOPFLI
if (raw.empty()) return false;
ZopfliOptions options;
ZopfliInitOptions(&options);
options.numiterations = 15;
options.blocksplitting = 1;
unsigned char *out_ptr = nullptr;
size_t out_size = 0;
// Gunakan API publik dari zopfli.h.
// Beberapa build hanya menyalin zopfli.h, bukan zlib_container.h,
// sehingga ZopfliZlibCompress() tidak terdeklarasi walaupun object-nya
// ada di libzopfli.a. ZopfliCompress(..., ZOPFLI_FORMAT_ZLIB, ...)
// menghasilkan zlib stream yang sesuai untuk PNG IDAT.
ZopfliCompress(&options,
ZOPFLI_FORMAT_ZLIB,
raw.data(),
raw.size(),
&out_ptr,
&out_size);
if (!out_ptr || out_size == 0) {
if (out_ptr) std::free(out_ptr);
return false;
}
compressed.assign(out_ptr, out_ptr + out_size);
std::free(out_ptr);
return !compressed.empty();
#else
(void) raw;
(void) compressed;
return false;
#endif
}
struct PngChunkData {
char type[5]{};
std::vector<uint8_t> data;
};
static bool png_recompress_idat_with_zopfli(const std::vector<uint8_t> &png,
std::vector<uint8_t> &out) {
#if KCOMPRESSOR_HAS_ZOPFLI
static const uint8_t signature[] = {0x89, 'P', 'N', 'G', 0x0D, 0x0A, 0x1A, 0x0A};
if (png.size() < sizeof(signature) || memcmp(png.data(), signature, sizeof(signature)) != 0) {
return false;
}
std::vector<PngChunkData> chunks;
std::vector<uint8_t> idat_compressed;
bool seen_idat = false;
size_t pos = sizeof(signature);
while (pos + 12 <= png.size()) {
uint32_t len = png_read_be32(png.data() + pos);
pos += 4;
if (pos + 4 + len + 4 > png.size()) return false;
PngChunkData chunk;
memcpy(chunk.type, png.data() + pos, 4);
chunk.type[4] = '\0';
pos += 4;
chunk.data.assign(png.begin() + static_cast<ptrdiff_t>(pos),
png.begin() + static_cast<ptrdiff_t>(pos + len));
pos += len;
pos += 4; // CRC lama.
const bool is_idat = memcmp(chunk.type, "IDAT", 4) == 0;
if (is_idat) {
idat_compressed.insert(idat_compressed.end(), chunk.data.begin(), chunk.data.end());
seen_idat = true;
}
chunks.push_back(std::move(chunk));
if (memcmp(chunks.back().type, "IEND", 4) == 0) {
break;
}
}
if (!seen_idat || idat_compressed.empty()) return false;
std::vector<uint8_t> raw;
if (!inflate_zlib_stream(idat_compressed, raw)) return false;
std::vector<uint8_t> zopfli_idat;
if (!zopfli_zlib_compress(raw, zopfli_idat) || zopfli_idat.empty()) return false;
out.clear();
out.insert(out.end(), signature, signature + sizeof(signature));
bool inserted_new_idat = false;
for (const PngChunkData &chunk : chunks) {
const bool is_idat = memcmp(chunk.type, "IDAT", 4) == 0;
if (is_idat) {
if (!inserted_new_idat) {
png_append_chunk(out, "IDAT", zopfli_idat);
inserted_new_idat = true;
}
continue;
}
png_append_chunk(out, chunk.type, chunk.data);
}
return inserted_new_idat && out.size() > 0;
#else
(void) png;
(void) out;
return false;
#endif
}
static bool oxipng_optimize_vector(const std::vector<uint8_t> &png, std::vector<uint8_t> &out, uint8_t level, bool use_zopfli) {
uint8_t *optimized = nullptr;
size_t optimized_len = 0;
@@ -417,6 +768,18 @@ static bool oxipng_optimize_vector(const std::vector<uint8_t> &png, std::vector<
if (ret == 0 && optimized && optimized_len > 0) {
out.assign(optimized, optimized + optimized_len);
oxipng_free(optimized, optimized_len);
if (use_zopfli) {
std::vector<uint8_t> zopfli_png;
if (png_recompress_idat_with_zopfli(out, zopfli_png) &&
!zopfli_png.empty() && zopfli_png.size() < out.size()) {
LOGD("PNG Zopfli reduced size %zu -> %zu", out.size(), zopfli_png.size());
out.swap(zopfli_png);
} else {
LOGD("PNG Zopfli did not reduce size or unavailable");
}
}
return true;
}
@@ -425,10 +788,17 @@ static bool oxipng_optimize_vector(const std::vector<uint8_t> &png, std::vector<
}
out = png;
if (use_zopfli) {
std::vector<uint8_t> zopfli_png;
if (png_recompress_idat_with_zopfli(out, zopfli_png) &&
!zopfli_png.empty() && zopfli_png.size() < out.size()) {
out.swap(zopfli_png);
}
}
return true;
}
static bool encode_png_lossless_rgba(const RgbaImage &image, std::vector<uint8_t> &out) {
static bool encode_png_lossless_rgba(const RgbaImage &image, std::vector<uint8_t> &out, bool use_zopfli) {
uint8_t *png = nullptr;
size_t png_len = 0;
@@ -448,10 +818,10 @@ static bool encode_png_lossless_rgba(const RgbaImage &image, std::vector<uint8_t
std::vector<uint8_t> encoded(png, png + png_len);
kimg_free(png);
return oxipng_optimize_vector(encoded, out, 3);
return oxipng_optimize_vector(encoded, out, use_zopfli ? 6 : 3, use_zopfli);
}
static bool encode_png_lossy_quantized(const RgbaImage &image, int quality, std::vector<uint8_t> &out) {
static bool encode_png_lossy_quantized(const RgbaImage &image, int quality, std::vector<uint8_t> &out, bool use_zopfli) {
liq_attr *attr = liq_attr_create();
if (!attr) return false;
@@ -533,7 +903,7 @@ static bool encode_png_lossy_quantized(const RgbaImage &image, int quality, std:
}
std::vector<uint8_t> encoded(png.begin(), png.end());
return oxipng_optimize_vector(encoded, out, 4);
return oxipng_optimize_vector(encoded, out, use_zopfli ? 6 : 4, use_zopfli);
}
static bool encode_webp_rgba(const RgbaImage &image, int quality, bool lossless, std::vector<uint8_t> &out) {
@@ -623,25 +993,33 @@ static bool encode_avif_rgba(const RgbaImage &image, int quality, std::vector<ui
static bool encode_output(const RgbaImage &image,
const std::string &output_format,
int quality,
bool use_zopfli,
std::vector<uint8_t> &out) {
std::string fmt = output_format;
std::transform(fmt.begin(), fmt.end(), fmt.begin(), ::tolower);
if (fmt == "jpeg" || fmt == "jpg") {
if (fmt == "jpeg" || fmt == "jpg" || fmt == "jpegli") {
// JPEG default sekarang memakai Jpegli sebagai backend utama.
// MozJPEG/TurboJPEG tetap menjadi fallback agar job tetap sukses jika Jpegli gagal.
if (encode_jpegli_rgba_private(image.pixels.data(), image.width, image.height, quality, out)) {
return true;
}
LOGE("Jpegli encode failed, fallback to JPEG default encoder");
return encode_jpeg_rgba(image, quality, out);
}
if (fmt == "png_lossy") {
if (encode_png_lossy_quantized(image, quality, out)) {
if (encode_png_lossy_quantized(image, quality, out, use_zopfli)) {
return true;
}
LOGD("PNG lossy quantize failed, fallback to PNG lossless");
return encode_png_lossless_rgba(image, out);
return encode_png_lossless_rgba(image, out, use_zopfli);
}
if (fmt == "png" || fmt == "png_lossless") {
return encode_png_lossless_rgba(image, out);
return encode_png_lossless_rgba(image, out, use_zopfli);
}
if (fmt == "webp_lossless") {
@@ -666,6 +1044,7 @@ int compress_image_fd_impl(JNIEnv *env,
const std::string &output_format,
int quality,
int max_long_side,
bool use_zopfli,
jobject callback) {
if (input_fd < 0 || output_fd < 0) {
callback_progress(env, callback, 0, "FD gambar tidak valid");
@@ -712,8 +1091,16 @@ int compress_image_fd_impl(JNIEnv *env,
callback_progress(env, callback, 60, "Encode gambar...");
std::string output_fmt_lower = output_format;
std::transform(output_fmt_lower.begin(), output_fmt_lower.end(), output_fmt_lower.begin(), ::tolower);
const bool png_extreme = use_zopfli &&
(output_fmt_lower == "png" || output_fmt_lower == "png_lossless" || output_fmt_lower == "png_lossy");
if (png_extreme) {
callback_progress(env, callback, 82, "Extreme PNG compression aktif, proses bisa lebih lama...");
}
std::vector<uint8_t> encoded;
if (!encode_output(work, output_format, quality, encoded)) {
if (!encode_output(work, output_format, quality, png_extreme, encoded)) {
callback_progress(env, callback, 0, "Gagal encode gambar");
return -4;
}
+1
View File
@@ -10,4 +10,5 @@ int compress_image_fd_impl(JNIEnv *env,
const std::string &output_format,
int quality,
int max_long_side,
bool use_zopfli,
jobject callback);
+142
View File
@@ -0,0 +1,142 @@
#include "jpegli_encoder.h"
#include <algorithm>
#include <csetjmp>
#include <cstdint>
#include <cstdlib>
#include <cstring>
#include <vector>
#include <android/log.h>
// PENTING:
// Jangan include <jpeglib.h> di sini.
// Header ini dibuat oleh script build Jpegli private dan me-remap API libjpeg
// normal ke simbol private kjpegli_* agar aman berdampingan dengan MozJPEG,
// Ghostscript, dan zlib/qpdf dalam satu libkcompressor.so.
extern "C" {
#include <kjpegli/kjpegli_jpeglib_prefix.h>
}
#define LOG_TAG "KCompressorJpegli"
#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__)
#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__)
struct KJpegliErrorManager {
jpeg_error_mgr pub;
jmp_buf setjmp_buffer;
char message[JMSG_LENGTH_MAX];
};
static void kjpegli_error_exit_bridge(j_common_ptr cinfo) {
KJpegliErrorManager *err = reinterpret_cast<KJpegliErrorManager *>(cinfo->err);
if (err) {
(*cinfo->err->format_message)(cinfo, err->message);
longjmp(err->setjmp_buffer, 1);
}
}
static int clamp_quality(int quality) {
return std::max(1, std::min(100, quality));
}
bool encode_jpegli_rgba_private(const uint8_t *rgba,
int width,
int height,
int quality,
std::vector<uint8_t> &out) {
if (!rgba || width <= 0 || height <= 0) {
return false;
}
LOGD("Jpegli encode start w=%d h=%d quality=%d caller_struct=%zu",
width, height, clamp_quality(quality), sizeof(jpeg_compress_struct));
jpeg_compress_struct cinfo {};
KJpegliErrorManager jerr {};
cinfo.err = jpeg_std_error(&jerr.pub);
jerr.pub.error_exit = kjpegli_error_exit_bridge;
unsigned char *jpeg_buffer = nullptr;
unsigned long jpeg_size = 0;
if (setjmp(jerr.setjmp_buffer)) {
LOGE("Jpegli encode failed: %s", jerr.message);
if (jpeg_buffer) {
std::free(jpeg_buffer);
}
jpeg_destroy_compress(&cinfo);
return false;
}
// Jpegli build yang kamu pakai melaporkan library version 80.
// Jangan pakai macro jpeg_create_compress() dari header yang bisa membawa
// JPEG_LIB_VERSION berbeda (contoh: 62), karena akan muncul error:
// "Wrong JPEG library version: library is 80, caller expects 62".
// Prefix header tetap me-remap jpeg_CreateCompress -> kjpegli_jpeg_CreateCompress.
#ifndef KJPEGLI_JPEG_LIB_VERSION
#define KJPEGLI_JPEG_LIB_VERSION 80
#endif
jpeg_CreateCompress(&cinfo, KJPEGLI_JPEG_LIB_VERSION,
static_cast<size_t>(sizeof(jpeg_compress_struct)));
jpeg_mem_dest(&cinfo, &jpeg_buffer, &jpeg_size);
cinfo.image_width = static_cast<JDIMENSION>(width);
cinfo.image_height = static_cast<JDIMENSION>(height);
cinfo.input_components = 3;
cinfo.in_color_space = JCS_RGB;
jpeg_set_defaults(&cinfo);
jpeg_set_quality(&cinfo, clamp_quality(quality), TRUE);
// Foto umumnya lebih efisien dengan 4:2:0. Ini tetap JPEG standar.
if (cinfo.num_components >= 3 && cinfo.comp_info) {
cinfo.comp_info[0].h_samp_factor = 2;
cinfo.comp_info[0].v_samp_factor = 2;
cinfo.comp_info[1].h_samp_factor = 1;
cinfo.comp_info[1].v_samp_factor = 1;
cinfo.comp_info[2].h_samp_factor = 1;
cinfo.comp_info[2].v_samp_factor = 1;
}
cinfo.optimize_coding = TRUE;
// Progressive sering lebih efisien untuk foto dan tetap kompatibel luas.
jpeg_simple_progression(&cinfo);
jpeg_start_compress(&cinfo, TRUE);
std::vector<uint8_t> rgb_row(static_cast<size_t>(width) * 3);
while (cinfo.next_scanline < cinfo.image_height) {
const size_t y = static_cast<size_t>(cinfo.next_scanline);
const uint8_t *src = rgba + y * static_cast<size_t>(width) * 4;
for (int x = 0; x < width; ++x) {
rgb_row[static_cast<size_t>(x) * 3 + 0] = src[static_cast<size_t>(x) * 4 + 0];
rgb_row[static_cast<size_t>(x) * 3 + 1] = src[static_cast<size_t>(x) * 4 + 1];
rgb_row[static_cast<size_t>(x) * 3 + 2] = src[static_cast<size_t>(x) * 4 + 2];
}
JSAMPROW row_pointer[1];
row_pointer[0] = rgb_row.data();
jpeg_write_scanlines(&cinfo, row_pointer, 1);
}
jpeg_finish_compress(&cinfo);
if (!jpeg_buffer || jpeg_size == 0) {
if (jpeg_buffer) {
std::free(jpeg_buffer);
}
jpeg_destroy_compress(&cinfo);
return false;
}
out.assign(jpeg_buffer, jpeg_buffer + jpeg_size);
LOGD("Jpegli encode success size=%lu", jpeg_size);
std::free(jpeg_buffer);
jpeg_destroy_compress(&cinfo);
return !out.empty();
}
+13
View File
@@ -0,0 +1,13 @@
#pragma once
#include <cstdint>
#include <vector>
// Encoder JPEG alternatif berbasis Jpegli private-symbol.
// File ini dipisah dari image_compressor.cpp agar header prefix Jpegli
// tidak mengubah simbol MozJPEG/TurboJPEG yang sudah dipakai untuk mode JPEG biasa.
bool encode_jpegli_rgba_private(const uint8_t *rgba,
int width,
int height,
int quality,
std::vector<uint8_t> &out);
+6
View File
@@ -0,0 +1,6 @@
{
global:
Java_*;
local:
*;
};
+26
View File
@@ -340,6 +340,7 @@ Java_com_kikyps_kcompressor_NativeCompressor_compressImageFd(JNIEnv *env,
jstring outputFormat,
jint quality,
jint maxLongSide,
jboolean useZopfli,
jobject callback) {
std::string mime = jstring_to_string(env, inputMime, "");
std::string format = jstring_to_string(env, outputFormat, "jpeg");
@@ -358,6 +359,7 @@ Java_com_kikyps_kcompressor_NativeCompressor_compressImageFd(JNIEnv *env,
format,
static_cast<int>(quality),
static_cast<int>(maxLongSide),
useZopfli == JNI_TRUE,
callback
);
@@ -374,6 +376,29 @@ Java_com_kikyps_kcompressor_NativeCompressor_checkPdfPasswordStatus(JNIEnv *env,
return check_pdf_password_status_fd_impl(env, inputFd, password_str);
}
extern "C"
JNIEXPORT jint JNICALL
Java_com_kikyps_kcompressor_NativeCompressor_compressPdfFdToPathWithLevel(JNIEnv *env,
jclass,
jint inputFd,
jstring outputPath,
jstring password,
jint compressionLevel,
jboolean useZopfli,
jobject callback) {
std::string output_path = jstring_to_string(env, outputPath, "");
std::string password_str = jstring_to_string(env, password, "");
return compress_pdf_fd_to_path_impl(
env,
inputFd,
output_path,
password_str,
static_cast<int>(compressionLevel),
useZopfli == JNI_TRUE,
callback
);
}
extern "C"
JNIEXPORT jint JNICALL
Java_com_kikyps_kcompressor_NativeCompressor_compressPdfFdToPath(JNIEnv *env,
@@ -390,6 +415,7 @@ Java_com_kikyps_kcompressor_NativeCompressor_compressPdfFdToPath(JNIEnv *env,
inputFd,
output_path,
password_str,
3,
useZopfli == JNI_TRUE,
callback
);
+507 -105
View File
@@ -18,6 +18,25 @@
#include <qpdf/qpdfjob-c.h>
#if defined(__has_include)
# if __has_include(<ghostscript/iapi.h>)
# include <ghostscript/iapi.h>
# elif __has_include(<iapi.h>)
# include <iapi.h>
# else
# error "Ghostscript iapi.h not found. Copy ghostscript-prebuilt/<abi>/include to third_party/ghostscript-android/<abi>/include"
# endif
#else
# include <ghostscript/iapi.h>
#endif
#ifndef e_Quit
// Ghostscript normally defines e_Quit in ierrors.h through iapi.h.
// Keep a fallback for stripped/minimal headers.
#define e_Quit (-101)
#endif
#define LOG_TAG "KCompressorPDF"
#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__)
#define LOGI(...) __android_log_print(ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__)
@@ -188,6 +207,90 @@ static bool copy_fd_to_path(int input_fd, const std::string &output_path) {
return true;
}
static bool copy_path_to_path(const std::string &input_path, const std::string &output_path) {
if (input_path.empty() || output_path.empty()) {
LOGE("copy_path_to_path invalid input=%s output=%s",
input_path.c_str(), output_path.c_str());
return false;
}
if (!ensure_parent_dir_exists(output_path)) {
return false;
}
int in_fd = open(input_path.c_str(), O_RDONLY | O_CLOEXEC);
if (in_fd < 0) {
LOGE("copy_path_to_path open input failed path=%s errno=%d %s",
input_path.c_str(), errno, strerror(errno));
return false;
}
int out_fd = open(output_path.c_str(), O_CREAT | O_TRUNC | O_WRONLY | O_CLOEXEC, 0600);
if (out_fd < 0) {
LOGE("copy_path_to_path open output failed path=%s errno=%d %s",
output_path.c_str(), errno, strerror(errno));
close(in_fd);
return false;
}
uint8_t buffer[128 * 1024];
bool ok = true;
int64_t total = 0;
while (true) {
if (is_cancel_requested()) {
ok = false;
break;
}
ssize_t r = read(in_fd, buffer, sizeof(buffer));
if (r == 0) break;
if (r < 0) {
if (errno == EINTR) continue;
LOGE("copy_path_to_path read failed errno=%d %s", errno, strerror(errno));
ok = false;
break;
}
ssize_t written = 0;
while (written < r) {
ssize_t w = write(out_fd, buffer + written, static_cast<size_t>(r - written));
if (w < 0) {
if (errno == EINTR) continue;
LOGE("copy_path_to_path write failed errno=%d %s", errno, strerror(errno));
ok = false;
break;
}
if (w == 0) {
ok = false;
break;
}
written += w;
total += w;
}
if (!ok) break;
}
fsync(out_fd);
close(out_fd);
close(in_fd);
LOGI("copy_path_to_path %s input=%s output=%s bytes=%lld output_size=%lld",
ok ? "success" : "failed",
input_path.c_str(),
output_path.c_str(),
static_cast<long long>(total),
static_cast<long long>(path_size(output_path)));
return ok && total > 0 && path_size(output_path) > 0;
}
static std::string make_temp_suffix_path(const std::string &output_path, const char *suffix) {
return output_path + (suffix ? suffix : ".tmp");
}
static std::string mask_qpdf_arg_for_log(const std::string &arg) {
if (arg.rfind("--password=", 0) == 0) {
return "--password=***";
@@ -366,6 +469,252 @@ int check_pdf_password_status_fd_impl(JNIEnv *,
return status;
}
static std::string mask_gs_arg_for_log(const std::string &arg) {
if (arg.rfind("-sPDFPassword=", 0) == 0) {
return "-sPDFPassword=***";
}
return arg;
}
static std::string join_gs_args_for_log(const std::vector<std::string> &args) {
std::ostringstream oss;
for (size_t i = 0; i < args.size(); ++i) {
if (i > 0) oss << ' ';
oss << mask_gs_arg_for_log(args[i]);
}
return oss.str();
}
static int gs_stdin_callback(void *, char *, int) {
return 0;
}
static int gs_stdout_callback(void *, const char *str, int len) {
if (str && len > 0) {
std::string msg(str, static_cast<size_t>(len));
while (!msg.empty() && (msg.back() == '\n' || msg.back() == '\r')) {
msg.pop_back();
}
if (!msg.empty()) {
if (msg.size() > 900) msg.resize(900);
LOGI("ghostscript: %s", msg.c_str());
}
}
return len;
}
static int gs_stderr_callback(void *, const char *str, int len) {
if (str && len > 0) {
std::string msg(str, static_cast<size_t>(len));
while (!msg.empty() && (msg.back() == '\n' || msg.back() == '\r')) {
msg.pop_back();
}
if (!msg.empty()) {
if (msg.size() > 900) msg.resize(900);
LOGW("ghostscript: %s", msg.c_str());
}
}
return len;
}
static bool gs_code_success(int code) {
return code == 0 || code == e_Quit;
}
struct PdfCompressionProfile {
int level;
const char *name;
bool use_ghostscript;
int color_dpi;
int gray_dpi;
int mono_dpi;
int jpeg_quality;
const char *threshold;
};
static int clamp_pdf_level(int level) {
if (level < 0) return 0;
if (level > 4) return 4;
return level;
}
static PdfCompressionProfile pdf_profile_for_level(int level) {
switch (clamp_pdf_level(level)) {
case 0:
return {0, "lossless-qpdf-zlib9", false, 0, 0, 0, 0, "0"};
case 1:
return {1, "safe-180dpi-q82", true, 180, 180, 450, 82, "1.25"};
case 2:
return {2, "balanced-110dpi-q68", true, 110, 110, 300, 68, "1.05"};
case 4:
return {4, "smallest-72dpi-q50", true, 72, 72, 180, 50, "1.0"};
case 3:
default:
return {3, "recommended-80dpi-q55", true, 80, 80, 200, 55, "1.0"};
}
}
static int run_ghostscript_pdfwrite_logged(const std::string &input_path,
const std::string &output_path,
const std::string &password,
const PdfCompressionProfile &profile) {
safe_unlink(output_path);
std::string temp_dir = parent_dir_of(output_path);
if (!temp_dir.empty()) {
setenv("TMPDIR", temp_dir.c_str(), 1);
}
// Jangan biarkan GS_OPTIONS dari environment memengaruhi hasil Android.
unsetenv("GS_OPTIONS");
std::vector<std::string> args;
args.emplace_back("gs");
args.emplace_back("-q");
args.emplace_back("-dSAFER");
args.emplace_back("-dBATCH");
args.emplace_back("-dNOPAUSE");
args.emplace_back("-dNOPROMPT");
args.emplace_back("-dNOPLATFONTS");
args.emplace_back("-sDEVICE=pdfwrite");
// PDF 1.7 lebih aman untuk PDF modern yang memakai transparency/mask/image object kompleks.
args.emplace_back("-dCompatibilityLevel=1.7");
// Fokus aggressive-safe: kompres lebih kuat, tetapi tetap jangan memaksa semua gambar menjadi DCT/JPEG.
// Memaksa ColorImageFilter=/DCTEncode pada PDF dengan transparency/mask/JPX/Indexed image
// bisa membuat sebagian gambar terlihat hilang di beberapa viewer/device.
args.emplace_back("-dDetectDuplicateImages=true");
args.emplace_back("-dCompressFonts=true");
args.emplace_back("-dSubsetFonts=true");
args.emplace_back("-dEmbedAllFonts=true");
args.emplace_back("-dAutoRotatePages=/None");
args.emplace_back("-sColorConversionStrategy=LeaveColorUnchanged");
args.emplace_back("-dPreserveOverprintSettings=true");
// Profile adaptif dari slider UI.
// AutoFilter=true tetap penting agar PDF dengan mask/transparency/JPX/Indexed tidak kehilangan gambar.
// Jangan paksa -dColorImageFilter=/DCTEncode karena itu pernah membuat gambar besar hilang.
args.emplace_back("-dDownsampleColorImages=true");
args.emplace_back("-dColorImageDownsampleType=/Bicubic");
args.emplace_back(std::string("-dColorImageResolution=") + std::to_string(profile.color_dpi));
args.emplace_back(std::string("-dColorImageDownsampleThreshold=") + profile.threshold);
args.emplace_back("-dDownsampleGrayImages=true");
args.emplace_back("-dGrayImageDownsampleType=/Bicubic");
args.emplace_back(std::string("-dGrayImageResolution=") + std::to_string(profile.gray_dpi));
args.emplace_back(std::string("-dGrayImageDownsampleThreshold=") + profile.threshold);
args.emplace_back("-dDownsampleMonoImages=true");
args.emplace_back("-dMonoImageDownsampleType=/Subsample");
args.emplace_back(std::string("-dMonoImageResolution=") + std::to_string(profile.mono_dpi));
args.emplace_back(std::string("-dMonoImageDownsampleThreshold=") + profile.threshold);
args.emplace_back("-dAutoFilterColorImages=true");
args.emplace_back("-dAutoFilterGrayImages=true");
args.emplace_back(std::string("-dJPEGQ=") + std::to_string(profile.jpeg_quality));
if (!password.empty()) {
args.emplace_back("-sPDFPassword=" + password);
}
args.emplace_back("-sOutputFile=" + output_path);
args.emplace_back(input_path);
LOGI("ghostscript stage=pdfwrite profile=%s level=%d argc=%zu args=%s",
profile.name, profile.level, args.size(), join_gs_args_for_log(args).c_str());
std::vector<char *> argv;
argv.reserve(args.size());
for (std::string &arg : args) {
argv.push_back(const_cast<char *>(arg.c_str()));
}
void *instance = nullptr;
errno = 0;
auto start_time = std::chrono::steady_clock::now();
int code = gsapi_new_instance(&instance, nullptr);
if (!gs_code_success(code) || !instance) {
LOGE("ghostscript new_instance failed code=%d errno=%d %s",
code, errno, strerror(errno));
return code != 0 ? code : -9001;
}
#ifdef GS_ARG_ENCODING_UTF8
gsapi_set_arg_encoding(instance, GS_ARG_ENCODING_UTF8);
#endif
gsapi_set_stdio(instance, gs_stdin_callback, gs_stdout_callback, gs_stderr_callback);
code = gsapi_init_with_args(instance, static_cast<int>(argv.size()), argv.data());
int exit_code = gsapi_exit(instance);
gsapi_delete_instance(instance);
auto end_time = std::chrono::steady_clock::now();
long long duration_ms = std::chrono::duration_cast<std::chrono::milliseconds>(
end_time - start_time
).count();
int final_code = gs_code_success(code) ? exit_code : code;
bool success = gs_code_success(code) &&
gs_code_success(exit_code) &&
path_size(output_path) > 0;
if (success) {
LOGI("ghostscript stage=pdfwrite success code=%d exit=%d duration_ms=%lld output=%s size=%lld",
code, exit_code, duration_ms, output_path.c_str(),
static_cast<long long>(path_size(output_path)));
return 0;
}
LOGE("ghostscript stage=pdfwrite failed code=%d exit=%d final=%d duration_ms=%lld output_exists=%s output_size=%lld errno=%d %s",
code,
exit_code,
final_code,
duration_ms,
path_exists(output_path) ? "true" : "false",
static_cast<long long>(path_size(output_path)),
errno,
strerror(errno));
return final_code != 0 ? final_code : -9002;
}
static void add_common_lossless_qpdf_args(std::vector<std::string> &args);
static int run_qpdf_zlib_cleanup_logged(const std::string &input_path,
const std::string &output_path,
const std::string &password,
bool optimize_images,
bool use_zopfli,
const char *stage) {
if (use_zopfli) {
setenv("QPDF_ZOPFLI", "1", 1);
} else {
unsetenv("QPDF_ZOPFLI");
}
std::vector<std::string> args;
args.emplace_back("qpdf");
if (!password.empty()) {
args.emplace_back("--password=" + password);
}
add_common_lossless_qpdf_args(args);
args.emplace_back("--remove-unreferenced-resources=auto");
if (optimize_images) {
args.emplace_back("--optimize-images");
args.emplace_back("--jpeg-quality=88");
args.emplace_back("--oi-min-width=256");
args.emplace_back("--oi-min-height=256");
args.emplace_back("--oi-min-area=65536");
}
args.emplace_back(input_path);
args.emplace_back(output_path);
LOGI("qpdf cleanup mode=%s", use_zopfli ? "zopfli-extreme" : "zlib9");
int result = run_qpdf_job_logged(stage ? stage : "qpdf-zlib-cleanup", args);
unsetenv("QPDF_ZOPFLI");
return result;
}
static void add_common_lossless_qpdf_args(std::vector<std::string> &args) {
args.emplace_back("--warning-exit-0");
args.emplace_back("--compress-streams=y");
@@ -379,15 +728,20 @@ int compress_pdf_fd_to_path_impl(JNIEnv *env,
int input_fd,
const std::string &output_path,
const std::string &password,
int compression_level,
bool use_zopfli,
jobject callback) {
reset_cancel_requested();
LOGI("compress_pdf start input_fd=%d output_path=%s password_empty=%s engine=%s",
PdfCompressionProfile profile = pdf_profile_for_level(compression_level);
LOGI("compress_pdf start input_fd=%d output_path=%s password_empty=%s engine=%s level=%d extreme=%s",
input_fd,
output_path.c_str(),
password.empty() ? "true" : "false",
use_zopfli ? "zopfli" : "zlib");
profile.name,
profile.level,
use_zopfli ? "true" : "false");
if (input_fd < 0 || output_path.empty()) {
LOGE("compress_pdf invalid input: input_fd=%d output_path_empty=%s",
@@ -404,16 +758,16 @@ int compress_pdf_fd_to_path_impl(JNIEnv *env,
callback_progress(env, callback, 1, "Membuka PDF...");
const int64_t original_size_before = fd_size(input_fd);
const int64_t original_fd_size = fd_size(input_fd);
std::string input_temp_path = make_temp_input_path(output_path);
std::string gs_output_path = make_temp_suffix_path(output_path, ".gs.pdf");
std::string qpdf_output_path = make_temp_suffix_path(output_path, ".qpdf.pdf");
safe_unlink(input_temp_path);
safe_unlink(gs_output_path);
safe_unlink(qpdf_output_path);
safe_unlink(output_path);
// Penting:
// Jangan langsung beri /proc/self/fd ke qpdf untuk proses utama.
// Pada beberapa device/SAF, qpdf gagal code=2 tanpa pesan jelas karena path fd tidak dianggap file biasa.
// Maka input PDF disalin dulu ke cache path biasa, baru qpdf bekerja path-to-path.
callback_progress(env, callback, 5, "Menyiapkan file sementara PDF...");
if (!copy_fd_to_path(input_fd, input_temp_path)) {
LOGE("compress_pdf failed to create temp input path=%s", input_temp_path.c_str());
@@ -422,11 +776,13 @@ int compress_pdf_fd_to_path_impl(JNIEnv *env,
return -31;
}
const int64_t original_size = path_size(input_temp_path);
LOGI("compress_pdf temp input ready input_temp=%s exists=%s size=%lld original_fd_size=%lld output_path=%s",
input_temp_path.c_str(),
path_exists(input_temp_path) ? "true" : "false",
static_cast<long long>(path_size(input_temp_path)),
static_cast<long long>(original_size_before),
static_cast<long long>(original_size),
static_cast<long long>(original_fd_size),
output_path.c_str());
int pass_status = check_pdf_password_status_path_impl(input_temp_path, password);
@@ -453,141 +809,187 @@ int compress_pdf_fd_to_path_impl(JNIEnv *env,
return -10;
}
// Engine Deflate/Flate PDF:
// - zlib : cepat, cocok default Android.
// - zopfli: ukuran bisa lebih kecil sedikit, tetapi jauh lebih lambat.
// qpdf membaca QPDF_ZOPFLI saat runtime jika qpdf dibuild dengan zopfli.
if (use_zopfli) {
setenv("QPDF_ZOPFLI", "silent", 1);
LOGI("compress_pdf engine selected: zopfli");
} else {
unsetenv("QPDF_ZOPFLI");
LOGI("compress_pdf engine selected: zlib");
}
// Engine adaptif:
// Level 0 = qpdf zlib9 only, tidak downsample image.
// Level 1+ = Ghostscript pdfwrite untuk image downsample/recompress, lalu qpdf zlib9 cleanup.
callback_progress(env, callback, 12, "Menganalisis struktur PDF...");
std::vector<std::string> args;
args.emplace_back("qpdf");
if (!password.empty()) {
args.emplace_back("--password=" + password);
}
add_common_lossless_qpdf_args(args);
args.emplace_back("--remove-unreferenced-resources=auto");
args.emplace_back("--optimize-images");
args.emplace_back("--jpeg-quality=88");
args.emplace_back("--oi-min-width=256");
args.emplace_back("--oi-min-height=256");
args.emplace_back("--oi-min-area=65536");
args.emplace_back(input_temp_path);
args.emplace_back(output_path);
if (!profile.use_ghostscript) {
callback_progress(env, callback, 28, use_zopfli
? "Mode lossless extreme: qpdf + Zopfli, proses lebih lama..."
: "Mode lossless: qpdf zlib level 9...");
int qpdf_only_result = run_qpdf_zlib_cleanup_logged(
input_temp_path,
output_path,
password,
false,
use_zopfli,
use_zopfli ? "qpdf-lossless-zopfli" : "qpdf-lossless-zlib9"
);
callback_progress(env, callback, 28, use_zopfli
? "Mengompres PDF dengan Zopfli... lebih kecil tetapi bisa sangat lama"
: "Mengompres PDF dengan zlib... cepat dan tetap optimal");
int result = run_qpdf_job_logged("smart-compress-path", args);
LOGI("smart-compress-path returned code=%d output_exists=%s output_size=%lld",
result,
path_exists(output_path) ? "true" : "false",
static_cast<long long>(path_size(output_path)));
if (is_cancel_requested()) {
LOGW("compress_pdf canceled after smart-compress");
safe_unlink(input_temp_path);
safe_unlink(output_path);
return -10;
}
safe_unlink(gs_output_path);
safe_unlink(qpdf_output_path);
if (result != 0 || path_size(output_path) <= 0) {
LOGW("smart-compress failed/empty code=%d output_exists=%s output_size=%lld, trying lossless fallback",
result,
path_exists(output_path) ? "true" : "false",
static_cast<long long>(path_size(output_path)));
callback_progress(env, callback, 34, "Mode utama gagal, mencoba mode aman...");
safe_unlink(output_path);
std::vector<std::string> fallback_args;
fallback_args.emplace_back("qpdf");
if (!password.empty()) {
fallback_args.emplace_back("--password=" + password);
if (qpdf_only_result != 0 || path_size(output_path) <= 0) {
callback_progress(env, callback, 0, "PDF error: qpdf lossless gagal");
safe_unlink(output_path);
return qpdf_only_result != 0 ? qpdf_only_result : -32;
}
add_common_lossless_qpdf_args(fallback_args);
fallback_args.emplace_back(input_temp_path);
fallback_args.emplace_back(output_path);
result = run_qpdf_job_logged("lossless-fallback-path", fallback_args);
LOGI("lossless-fallback-path returned code=%d output_exists=%s output_size=%lld",
result,
path_exists(output_path) ? "true" : "false",
static_cast<long long>(path_size(output_path)));
callback_progress(env, callback, 100, "Done");
return 0;
}
callback_progress(env, callback, 18, "Mengoptimalkan gambar PDF tanpa mengubah teks...");
int gs_result = run_ghostscript_pdfwrite_logged(input_temp_path, gs_output_path, password, profile);
if (is_cancel_requested()) {
LOGW("compress_pdf canceled after fallback");
LOGW("compress_pdf canceled after ghostscript");
safe_unlink(input_temp_path);
safe_unlink(gs_output_path);
safe_unlink(qpdf_output_path);
safe_unlink(output_path);
return -10;
}
if (result != 0 || path_size(output_path) <= 0) {
int64_t failed_output_size = path_size(output_path);
LOGE("compress_pdf qpdf failed final code=%d input_temp=%s input_exists=%s input_size=%lld output_path=%s output_exists=%s output_size=%lld errno=%d %s",
result,
input_temp_path.c_str(),
path_exists(input_temp_path) ? "true" : "false",
static_cast<long long>(path_size(input_temp_path)),
output_path.c_str(),
path_exists(output_path) ? "true" : "false",
static_cast<long long>(failed_output_size),
errno,
strerror(errno));
bool ghostscript_usable = (gs_result == 0 && path_size(gs_output_path) > 0);
if (ghostscript_usable) {
callback_progress(env, callback, 78, "Merapikan struktur PDF hasil kompresi...");
std::string msg = qpdf_error_message("compress", result, input_temp_path, output_path);
safe_unlink(qpdf_output_path);
int qpdf_result = run_qpdf_zlib_cleanup_logged(
gs_output_path,
qpdf_output_path,
std::string(),
false,
use_zopfli,
use_zopfli ? "qpdf-final-after-ghostscript-zopfli" : "qpdf-final-after-ghostscript"
);
int64_t gs_size = path_size(gs_output_path);
int64_t qpdf_size = path_size(qpdf_output_path);
LOGI("compress_pdf post-gs sizes original=%lld gs=%lld qpdf=%lld qpdf_code=%d",
static_cast<long long>(original_size),
static_cast<long long>(gs_size),
static_cast<long long>(qpdf_size),
qpdf_result);
if (qpdf_result == 0 && qpdf_size > 0 && (gs_size <= 0 || qpdf_size <= gs_size)) {
copy_path_to_path(qpdf_output_path, output_path);
} else {
copy_path_to_path(gs_output_path, output_path);
}
int64_t final_size = path_size(output_path);
if (final_size > 0 && (original_size <= 0 || final_size < original_size)) {
callback_progress(env, callback, 88, "Mengecek ukuran hasil...");
LOGI("compress_pdf ghostscript success output_path=%s original=%lld final=%lld saving=%lld",
output_path.c_str(),
static_cast<long long>(original_size),
static_cast<long long>(final_size),
static_cast<long long>(original_size > 0 ? original_size - final_size : -1));
safe_unlink(input_temp_path);
safe_unlink(gs_output_path);
safe_unlink(qpdf_output_path);
if (is_cancel_requested()) {
safe_unlink(output_path);
return -10;
}
callback_progress(env, callback, 100, "Done");
return 0;
}
LOGW("compress_pdf ghostscript output not smaller/invalid original=%lld final=%lld, fallback qpdf-only",
static_cast<long long>(original_size),
static_cast<long long>(final_size));
safe_unlink(output_path);
} else {
LOGW("compress_pdf ghostscript failed/no-output code=%d, fallback qpdf-only", gs_result);
}
if (is_cancel_requested()) {
safe_unlink(input_temp_path);
safe_unlink(gs_output_path);
safe_unlink(qpdf_output_path);
safe_unlink(output_path);
return -10;
}
// Fallback aman: qpdf zlib-only. Ini tidak selalu kecil, tetapi stabil dan menjaga file tetap valid.
callback_progress(env, callback, 28, use_zopfli
? "Mencoba optimasi aman PDF dengan Zopfli..."
: "Mencoba optimasi aman PDF...");
safe_unlink(output_path);
int qpdf_result = run_qpdf_zlib_cleanup_logged(
input_temp_path,
output_path,
password,
true,
use_zopfli,
use_zopfli ? "qpdf-safe-fallback-zopfli" : "qpdf-safe-fallback"
);
if (is_cancel_requested()) {
safe_unlink(input_temp_path);
safe_unlink(gs_output_path);
safe_unlink(qpdf_output_path);
safe_unlink(output_path);
return -10;
}
if (qpdf_result != 0 || path_size(output_path) <= 0) {
LOGE("compress_pdf qpdf fallback failed code=%d input=%s output=%s output_size=%lld",
qpdf_result,
input_temp_path.c_str(),
output_path.c_str(),
static_cast<long long>(path_size(output_path)));
std::string msg = qpdf_error_message("qpdf-safe-fallback", qpdf_result, input_temp_path, output_path);
callback_progress(env, callback, 0, msg);
safe_unlink(input_temp_path);
safe_unlink(gs_output_path);
safe_unlink(qpdf_output_path);
safe_unlink(output_path);
return result != 0 ? result : -32;
return qpdf_result != 0 ? qpdf_result : -32;
}
callback_progress(env, callback, 88, "Mengecek ukuran hasil...");
int64_t original_size = path_size(input_temp_path);
int64_t compressed_size = path_size(output_path);
LOGI("compress_pdf size check original=%lld compressed=%lld input_temp=%s output_path=%s",
int64_t fallback_size = path_size(output_path);
LOGI("compress_pdf fallback size original=%lld qpdf=%lld",
static_cast<long long>(original_size),
static_cast<long long>(compressed_size),
input_temp_path.c_str(),
output_path.c_str());
static_cast<long long>(fallback_size));
// Jangan biarkan hasil akhir lebih besar dari file original.
if (original_size > 0 && compressed_size > 0 && compressed_size >= original_size) {
if (original_size > 0 && fallback_size > 0 && fallback_size >= original_size) {
callback_progress(env, callback, 92, "PDF sudah optimal, menjaga file asli...");
if (!copy_fd_to_path(input_fd, output_path)) {
if (!copy_path_to_path(input_temp_path, output_path)) {
LOGE("compress_pdf copy original fallback failed output_path=%s errno=%d %s",
output_path.c_str(), errno, strerror(errno));
callback_progress(env, callback, 0, "PDF error: gagal menjaga file asli setelah hasil lebih besar");
safe_unlink(input_temp_path);
safe_unlink(gs_output_path);
safe_unlink(qpdf_output_path);
safe_unlink(output_path);
return -23;
}
int64_t copied_size = path_size(output_path);
LOGI("compress_pdf copied original to output copied_size=%lld output_path=%s",
static_cast<long long>(copied_size), output_path.c_str());
}
safe_unlink(input_temp_path);
safe_unlink(gs_output_path);
safe_unlink(qpdf_output_path);
if (is_cancel_requested()) {
safe_unlink(output_path);
return -10;
}
LOGI("compress_pdf success output_path=%s final_size=%lld engine=%s",
LOGI("compress_pdf success output_path=%s final_size=%lld engine=%s level=%d",
output_path.c_str(),
static_cast<long long>(path_size(output_path)),
use_zopfli ? "zopfli" : "zlib");
profile.name,
profile.level);
callback_progress(env, callback, 100, "Done");
return 0;
}
+1
View File
@@ -19,5 +19,6 @@ int compress_pdf_fd_to_path_impl(JNIEnv *env,
int input_fd,
const std::string &output_path,
const std::string &password,
int compression_level,
bool use_zopfli,
jobject callback);
@@ -0,0 +1,3 @@
#pragma once
#include "iapi.h"
#include "ierrors.h"
@@ -0,0 +1,129 @@
/* Copyright (C) 2001-2026 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
implied.
This software is distributed under license and may not be copied,
modified or distributed except as expressly authorized under the terms
of the license contained in the file LICENSE in this distribution.
Refer to licensing information at http://www.artifex.com or contact
Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
CA 94129, USA, for further information.
*/
#ifndef gscdefs_INCLUDED
# define gscdefs_INCLUDED
/* This comment, the delimiting comments below, and the lines of
* source code between the delimiting comments may not be altered,
* replaced, changed, or otherwise modified for the purpose of
* misrepresenting the origin of works generated using this
* software.
*
* The supplemental term above has been added in accordance with
* Section 7(b) of the Affero General Public License version 3.
*/
/* BEGIN -- CHANGES RESTRICTED UNDER 7(b) */
/* If we are cluster testing, then we want to nobble stuff
* that might change between versions. */
#ifdef CLUSTER
#undef GS_PRODUCTFAMILY
#define GS_PRODUCTFAMILY "GPL Ghostscript"
#undef GS_PRODUCT
#define GS_PRODUCT GS_PRODUCTFAMILY
#else
/* def GS_PRODFAM */
# define GS_PRODUCTFAMILY\
"GPL Ghostscript"
/* end def GS_PRODFAM */
/* def GS_PROD */
# define GS_PRODUCT\
GS_PRODUCTFAMILY " GIT PRERELEASE"
/* end def GS_PROD */
#endif
/* END -- CHANGES RESTRICTED UNDER 7(b) */
#define GS_STRINGIZE2(s) #s
#define GS_STRINGIZE(s) GS_STRINGIZE2(s)
#ifndef GS_BUILDTIME
# define GS_BUILDTIME\
0 /* should be set in the makefile */
#endif
#ifndef GS_COPYRIGHT
# define GS_COPYRIGHT\
"Copyright (C) 2026 Artifex Software, Inc. All rights reserved."
#endif
/* Prototypes for configuration definitions in gconfig.c. */
/*
* This file may be #included in places that don't even have stdpre.h,
* so it mustn't use any Ghostscript definitions in any code that is
* actually processed here (as opposed to being part of a macro
* definition).
*/
/* Miscellaneous system constants (read-only systemparams). */
extern const long gs_buildtime;
extern const char *const gs_copyright;
extern const char *const gs_product;
extern const char *const gs_productfamily;
extern const long gs_revision;
extern const long gs_revisiondate;
extern const long gs_serialnumber;
/* Installation directories and files */
extern const char *const gs_doc_directory;
extern const char *const gs_lib_default_path;
extern const char *const gs_init_file;
extern const char *const gs_dev_defaults;
/* Resource tables. In order to avoid importing a large number of types, */
/* we only provide macros for some externs, not the externs themselves. */
#define extern_gx_device_halftone_list()\
typedef DEVICE_HALFTONE_RESOURCE_PROC((*gx_dht_proc));\
extern const gx_dht_proc gx_device_halftone_list[]
#define extern_gx_image_class_table()\
extern const gx_image_class_t gx_image_class_table[]
extern const unsigned gx_image_class_table_count;
#define extern_gx_image_type_table()\
extern const gx_image_type_t * const gx_image_type_table[]
extern const unsigned gx_image_type_table_count;
/* We need the extra typedef so that the const will apply to the table. */
#define extern_gx_init_table()\
typedef init_proc((*gx_init_proc));\
extern const gx_init_proc gx_init_table[]
#define extern_gx_io_device_table()\
extern const gx_io_device * const gx_io_device_table[]
extern const unsigned gx_io_device_table_count;
/* Return the list of device prototypes, a NULL list of their structure */
/* descriptors (no longer used), and (as the value) the length of the lists. */
#define extern_gs_lib_device_list()\
int gs_lib_device_list(const gx_device * const **plist,\
gs_memory_struct_type_t **pst)
/* find a compositor by name */
#define extern_gs_find_compositor() \
const gs_composite_type_t * gs_find_compositor(int comp_id)
#define extern_gs_get_fapi_server_inits() \
const gs_fapi_server_init_func * gs_get_fapi_server_inits(void)
#endif /* gscdefs_INCLUDED */
@@ -0,0 +1,104 @@
/* Copyright (C) 2001-2023 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
implied.
This software is distributed under license and may not be copied,
modified or distributed except as expressly authorized under the terms
of the license contained in the file LICENSE in this distribution.
Refer to licensing information at http://www.artifex.com or contact
Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
CA 94129, USA, for further information.
*/
/* This interface is deprecated and will be removed in future
* ghostscript releases. Use the interface described in
* API.htm and iapi.h.
*/
#ifndef gsdll_INCLUDED
# define gsdll_INCLUDED
#include "iapi.h"
#include "windows_.h"
#ifdef __MACOS__
#define HWND char *
#include <QDOffscreen.h>
#pragma export on
#endif
#ifdef __WINDOWS__
#define _Windows
#endif
#ifdef __IBMC__
#define GSDLLCALLLINK _System
#else
#define GSDLLCALLLINK
#endif
/* global pointer to callback */
typedef int (* GSDLLCALLLINK GSDLL_CALLBACK) (int, char *, unsigned long);
extern GSDLL_CALLBACK pgsdll_callback;
/* message values for callback */
#define GSDLL_STDIN 1 /* get count characters to str from stdin */
/* return number of characters read */
#define GSDLL_STDOUT 2 /* put count characters from str to stdout */
/* return number of characters written */
#define GSDLL_DEVICE 3 /* device = str has been opened if count=1 */
/* or closed if count=0 */
#define GSDLL_SYNC 4 /* sync_output for device str */
#define GSDLL_PAGE 5 /* output_page for device str */
#define GSDLL_SIZE 6 /* resize for device str */
/* LOWORD(count) is new xsize */
/* HIWORD(count) is new ysize */
#define GSDLL_POLL 7 /* Called from gp_check_interrupt */
/* Can be used by caller to poll the message queue */
/* Normally returns 0 */
/* To abort gsdll_execute_cont(), return a */
/* non zero error code until gsdll_execute_cont() */
/* returns */
/* return values from gsdll_init() */
#define GSDLL_INIT_IN_USE 100 /* DLL is in use */
#define GSDLL_INIT_QUIT 101 /* quit or EOF during init */
/* This is not an error. */
/* gsdll_exit() must not be called */
/* DLL exported functions */
/* for load time dynamic linking */
GSDLLEXPORT int GSDLLAPI gsdll_revision(const char * * product, const char * * copyright, long * gs_revision, long * gs_revisiondate);
GSDLLEXPORT int GSDLLAPI gsdll_init(GSDLL_CALLBACK callback, HWND hwnd, int argc, char * * argv);
GSDLLEXPORT int GSDLLAPI gsdll_execute_begin(void);
GSDLLEXPORT int GSDLLAPI gsdll_execute_cont(const char * str, int len);
GSDLLEXPORT int GSDLLAPI gsdll_execute_end(void);
GSDLLEXPORT int GSDLLAPI gsdll_exit(void);
GSDLLEXPORT int GSDLLAPI gsdll_lock_device(unsigned char *device, int flag);
/* Function pointer typedefs */
/* for run time dynamic linking */
typedef int (GSDLLAPIPTR PFN_gsdll_revision)(const char ** product,
const char ** copyright, long * revision, long * revisiondate);
typedef int (GSDLLAPIPTR PFN_gsdll_init) (GSDLL_CALLBACK, HWND, int argc, char * * argv);
typedef int (GSDLLAPIPTR PFN_gsdll_init_with_encoding) (GSDLL_CALLBACK, HWND, int argc, char * * argv, int encoding);
#ifdef __WIN32__
typedef int (GSDLLAPIPTR PFN_gsdll_initA) (GSDLL_CALLBACK, HWND, int argc, char * * argv);
typedef int (GSDLLAPIPTR PFN_gsdll_initW) (GSDLL_CALLBACK, HWND, int argc, wchar_t * * argv);
#endif
typedef int (GSDLLAPIPTR PFN_gsdll_execute_begin) (void);
typedef int (GSDLLAPIPTR PFN_gsdll_execute_cont) (const char * str, int len);
typedef int (GSDLLAPIPTR PFN_gsdll_execute_end) (void);
typedef int (GSDLLAPIPTR PFN_gsdll_exit) (void);
typedef int (GSDLLAPIPTR PFN_gsdll_lock_device) (unsigned char *, int);
#ifdef __MACOS__
#pragma export off
#endif
#endif /* gsdll_INCLUDED */
@@ -0,0 +1,280 @@
/* Copyright (C) 2001-2023 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
implied.
This software is distributed under license and may not be copied,
modified or distributed except as expressly authorized under the terms
of the license contained in the file LICENSE in this distribution.
Refer to licensing information at http://www.artifex.com or contact
Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
CA 94129, USA, for further information.
*/
/* Error code definitions */
#ifndef gserrors_INCLUDED
# define gserrors_INCLUDED
/* A procedure that may return an error always returns */
/* a non-negative value (zero, unless otherwise noted) for success, */
/* or negative for failure. */
/* We don't use a typedef internally to avoid a lot of casting. */
enum gs_error_type {
gs_error_ok = 0,
gs_error_unknownerror = -1, /* unknown error */
gs_error_dictfull = -2,
gs_error_dictstackoverflow = -3,
gs_error_dictstackunderflow = -4,
gs_error_execstackoverflow = -5,
gs_error_interrupt = -6,
gs_error_invalidaccess = -7,
gs_error_invalidexit = -8,
gs_error_invalidfileaccess = -9,
gs_error_invalidfont = -10,
gs_error_invalidrestore = -11,
gs_error_ioerror = -12,
gs_error_limitcheck = -13,
gs_error_nocurrentpoint = -14,
gs_error_rangecheck = -15,
gs_error_stackoverflow = -16,
gs_error_stackunderflow = -17,
gs_error_syntaxerror = -18,
gs_error_timeout = -19,
gs_error_typecheck = -20,
gs_error_undefined = -21,
gs_error_undefinedfilename = -22,
gs_error_undefinedresult = -23,
gs_error_unmatchedmark = -24,
gs_error_VMerror = -25, /* must be the last Level 1 error */
/* ------ Additional Level 2 errors (also in DPS, ------ */
gs_error_configurationerror = -26,
gs_error_undefinedresource = -27,
gs_error_unregistered = -28,
gs_error_invalidcontext = -29,
/* invalidid is for the NeXT DPS extension. */
gs_error_invalidid = -30,
/* We need a specific stackoverflow error for the PDF interpreter to avoid dropping into
* the Postscript interpreter's stack extending code, when the PDF interpreter is called from
* Postscript
*/
gs_error_pdf_stackoverflow = -31,
/* Internal error for the C-based PDF interpreter, to indicate a circular PDF reference */
gs_error_circular_reference = -32,
/* ------ Pseudo-errors used internally ------ */
gs_error_hit_detected = -99,
gs_error_Fatal = -100,
/*
* Internal code for the .quit operator.
* The real quit code is an integer on the operand stack.
* gs_interpret returns this only for a .quit with a zero exit code.
*/
gs_error_Quit = -101,
/*
* Internal code for a normal exit from the interpreter.
* Do not use outside of interp.c.
*/
gs_error_InterpreterExit = -102,
/* Need the remap color error for high level pattern support */
gs_error_Remap_Color = -103,
/*
* Internal code to indicate we have underflowed the top block
* of the e-stack.
*/
gs_error_ExecStackUnderflow = -104,
/*
* Internal code for the vmreclaim operator with a positive operand.
* We need to handle this as an error because otherwise the interpreter
* won't reload enough of its state when the operator returns.
*/
gs_error_VMreclaim = -105,
/*
* Internal code for requesting more input from run_string.
*/
gs_error_NeedInput = -106,
/*
* Internal code to all run_string to request that the data is rerun
* using run_file.
*/
gs_error_NeedFile = -107,
/*
* Internal code for a normal exit when usage info is displayed.
* This allows Window versions of Ghostscript to pause until
* the message can be read.
*/
gs_error_Info = -110,
/* A special 'error', like reamp color above. This is used by a subclassing
* device to indicate that it has fully processed a device method, and parent
* subclasses should not perform any further action. Currently this is limited
* to compositor creation.
*/
gs_error_handled = -111,
};
/* We do provide a typedef type for external API use */
typedef enum gs_error_type gs_error_t;
int gs_log_error(int, const char *, int);
#if !defined(DEBUG)
# define gs_log_error(err, file, line) (err)
#endif
#define gs_note_error(err) gs_log_error(err, __FILE__, __LINE__)
#define return_error(err) return gs_note_error(err)
#if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901L
# if defined(__GNUC__) && __GNUC__ >= 2
# define __func__ __FUNCTION__
# elif defined(__FUNCTION__)
# define __func__ __FUNCTION__
# elif defined(__FUNC__)
# define __func__ __FUNC__
# else
# define __func__ "<unknown>"
# endif
#endif
/*
* Error reporting macros.
*
*/
#ifndef __printflike
#if __GNUC__ > 2 || __GNUC__ == 2 && __GNUC_MINOR__ >= 7
#define __printflike(fmtarg, firstvararg) \
__attribute__((__format__ (__printf__, fmtarg, firstvararg)))
#else
#define __printflike(fmtarg, firstvararg)
#endif
#endif
const char *gs_errstr(int code);
int gs_throw_imp(const char *func, const char *file, int line,
int op, int code, const char *fmt, ...) __attribute__((__format__(__printf__, 6, 7)));
/* Use throw at origin of error
*/
#define gs_throw_code(code) \
gs_throw1((code), "%s", gs_errstr((code)))
#define gs_throw(code, fmt) \
gs_throw_imp(__func__, __FILE__, __LINE__, 0, code, fmt)
#define gs_throw1(code, fmt, arg1) \
gs_throw_imp(__func__, __FILE__, __LINE__, 0, code, fmt, arg1)
#define gs_throw2(code, fmt, arg1, arg2) \
gs_throw_imp(__func__, __FILE__, __LINE__, 0, code, fmt, arg1, arg2)
#define gs_throw3(code, fmt, arg1, arg2, arg3) \
gs_throw_imp(__func__, __FILE__, __LINE__, 0, code, fmt, arg1, arg2, arg3)
#define gs_throw4(code, fmt, arg1, arg2, arg3, arg4) \
gs_throw_imp(__func__, __FILE__, __LINE__, 0, code, fmt, arg1, arg2, arg3, arg4)
#define gs_throw5(code, fmt, arg1, arg2, arg3, arg4, arg5) \
gs_throw_imp(__func__, __FILE__, __LINE__, 0, code, fmt, arg1, arg2, arg3, arg4, arg5)
#define gs_throw6(code, fmt, arg1, arg2, arg3, arg4, arg5, arg6) \
gs_throw_imp(__func__, __FILE__, __LINE__, 0, code, fmt, arg1, arg2, arg3, arg4, arg5, arg6)
#define gs_throw7(code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7) \
gs_throw_imp(__func__, __FILE__, __LINE__, 0, code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7)
#define gs_throw8(code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) \
gs_throw_imp(__func__, __FILE__, __LINE__, 0, code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8)
#define gs_throw9(code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) \
gs_throw_imp(__func__, __FILE__, __LINE__, 0, code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9)
/* Bubble the code up the stack
*/
#define gs_rethrow_code(code) \
gs_rethrow1((code), "%s", gs_errstr((code)))
#define gs_rethrow(code, fmt) \
gs_throw_imp(__func__, __FILE__, __LINE__, 1, code, fmt)
#define gs_rethrow1(code, fmt, arg1) \
gs_throw_imp(__func__, __FILE__, __LINE__, 1, code, fmt, arg1)
#define gs_rethrow2(code, fmt, arg1, arg2) \
gs_throw_imp(__func__, __FILE__, __LINE__, 1, code, fmt, arg1, arg2)
#define gs_rethrow3(code, fmt, arg1, arg2, arg3) \
gs_throw_imp(__func__, __FILE__, __LINE__, 1, code, fmt, arg1, arg2, arg3)
#define gs_rethrow4(code, fmt, arg1, arg2, arg3, arg4) \
gs_throw_imp(__func__, __FILE__, __LINE__, 1, code, fmt, arg1, arg2, arg3, arg4)
#define gs_rethrow5(code, fmt, arg1, arg2, arg3, arg4, arg5) \
gs_throw_imp(__func__, __FILE__, __LINE__, 1, code, fmt, arg1, arg2, arg3, arg4, arg5)
#define gs_rethrow6(code, fmt, arg1, arg2, arg3, arg4, arg5, arg6) \
gs_throw_imp(__func__, __FILE__, __LINE__, 1, code, fmt, arg1, arg2, arg3, arg4, arg5, arg6)
#define gs_rethrow7(code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7) \
gs_throw_imp(__func__, __FILE__, __LINE__, 1, code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7)
#define gs_rethrow8(code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) \
gs_throw_imp(__func__, __FILE__, __LINE__, 1, code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8)
#define gs_rethrow9(code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) \
gs_throw_imp(__func__, __FILE__, __LINE__, 1, code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9)
/* This will cause trouble, as it implies you are fixing an error
* the system will spew messages
*/
#define gs_catch(code, fmt) \
gs_throw_imp(__func__, __FILE__, __LINE__, 2, code, fmt)
#define gs_catch1(code, fmt, arg1) \
gs_throw_imp(__func__, __FILE__, __LINE__, 2, code, fmt, arg1)
#define gs_catch2(code, fmt, arg1, arg2) \
gs_throw_imp(__func__, __FILE__, __LINE__, 2, code, fmt, arg1, arg2)
#define gs_catch3(code, fmt, arg1, arg2, arg3) \
gs_throw_imp(__func__, __FILE__, __LINE__, 2, code, fmt, arg1, arg2, arg3)
#define gs_catch4(code, fmt, arg1, arg2, arg3, arg4) \
gs_throw_imp(__func__, __FILE__, __LINE__, 2, code, fmt, arg1, arg2, arg3, arg4)
#define gs_catch5(code, fmt, arg1, arg2, arg3, arg4, arg5) \
gs_throw_imp(__func__, __FILE__, __LINE__, 2, code, fmt, arg1, arg2, arg3, arg4, arg5)
#define gs_catch6(code, fmt, arg1, arg2, arg3, arg4, arg5, arg6) \
gs_throw_imp(__func__, __FILE__, __LINE__, 2, code, fmt, arg1, arg2, arg3, arg4, arg5, arg6)
#define gs_catch7(code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7) \
gs_throw_imp(__func__, __FILE__, __LINE__, 2, code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7)
#define gs_catch8(code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) \
gs_throw_imp(__func__, __FILE__, __LINE__, 2, code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8)
#define gs_catch9(code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) \
gs_throw_imp(__func__, __FILE__, __LINE__, 2, code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9)
/* gs_warn is a printf
*/
#define gs_warn(fmt) \
(void)gs_throw_imp(__func__, __FILE__, __LINE__, 3, 0, fmt)
#define gs_warn1(fmt, arg1) \
(void)gs_throw_imp(__func__, __FILE__, __LINE__, 3, 0, fmt, arg1)
#define gs_warn2(fmt, arg1, arg2) \
(void)gs_throw_imp(__func__, __FILE__, __LINE__, 3, 0, fmt, arg1, arg2)
#define gs_warn3(fmt, arg1, arg2, arg3) \
(void)gs_throw_imp(__func__, __FILE__, __LINE__, 3, 0, fmt, arg1, arg2, arg3)
#define gs_warn4(fmt, arg1, arg2, arg3, arg4) \
(void)gs_throw_imp(__func__, __FILE__, __LINE__, 3, 0, fmt, arg1, arg2, arg3, arg4)
#define gs_warn5(fmt, arg1, arg2, arg3, arg4, arg5) \
(void)gs_throw_imp(__func__, __FILE__, __LINE__, 3, 0, fmt, arg1, arg2, arg3, arg4, arg5)
#define gs_warn6(fmt, arg1, arg2, arg3, arg4, arg5, arg6) \
(void)gs_throw_imp(__func__, __FILE__, __LINE__, 3, 0, fmt, arg1, arg2, arg3, arg4, arg5, arg6)
#define gs_warn7(fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7) \
(void)gs_throw_imp(__func__, __FILE__, __LINE__, 3, 0, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7)
#define gs_warn8(fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) \
(void)gs_throw_imp(__func__, __FILE__, __LINE__, 3, 0, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8)
#define gs_warn9(fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) \
(void)gs_throw_imp(__func__, __FILE__, __LINE__, 3, 0, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9)
/* just in case you don't know 0 means no error
* other return codes are errors.
*/
#define gs_okay 0
#endif /* gserrors_INCLUDED */
@@ -0,0 +1,574 @@
/* Copyright (C) 2001-2023 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
implied.
This software is distributed under license and may not be copied,
modified or distributed except as expressly authorized under the terms
of the license contained in the file LICENSE in this distribution.
Refer to licensing information at http://www.artifex.com or contact
Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
CA 94129, USA, for further information.
*/
/*
* Public API for Ghostscript interpreter
* for use both as DLL and for static linking.
*
* Should work for Windows, OS/2, Linux, Mac.
*
* DLL exported functions should be as similar as possible to imain.c
* You will need to include "ierrors.h".
*
* Current problems:
* 1. Ghostscript does not support multiple instances.
* 2. Global variables in gs_main_instance_default()
* and gsapi_instance_counter
*/
/* Exported functions may need different prefix
* GSDLLEXPORT marks functions as exported
* GSDLLAPI is the calling convention used on functions exported
* by Ghostscript
* GSDLLCALL is used on callback functions called by Ghostscript
* When you include this header file in the caller, you may
* need to change the definitions by defining these
* before including this header file.
* Make sure you get the calling convention correct, otherwise your
* program will crash either during callbacks or soon after returning
* due to stack corruption.
*/
#ifndef iapi_INCLUDED
# define iapi_INCLUDED
#ifdef __cplusplus
extern "C" {
#endif
#if defined(_WINDOWS_) || defined(__WINDOWS__)
# ifndef _Windows
# define _Windows
# endif
#endif
#ifdef _Windows
# ifndef GSDLLEXPORT
/* We don't need both the "__declspec(dllexport)" declaration
* and the listing in the .def file - having both results in
* a linker warning on x64 builds (but is incorrect on x86, too)
*/
# if 0
# define GSDLLEXPORT __declspec(dllexport)
# else
# define GSDLLEXPORT
# endif
# endif
# ifdef __MINGW32__
/* export stdcall functions as "name" instead of "_name@ordinal" */
# undef GSDLLAPI
# define GSDLLAPI
# endif
# ifndef GSDLLAPI
# define GSDLLAPI __stdcall
# endif
# ifndef GSDLLCALL
# define GSDLLCALL __stdcall
# endif
#endif /* _Windows */
#if defined(OS2) && defined(__IBMC__)
# ifndef GSDLLAPI
# define GSDLLAPI _System
# endif
# ifndef GSDLLCALL
# define GSDLLCALL _System
# endif
#endif /* OS2 && __IBMC */
#ifdef __MACOS__
# pragma export on
#endif
#ifndef GSDLLEXPORT
# ifdef __GNUC__
# define GSDLLEXPORT __attribute__ ((visibility ("default")))
# else
# define GSDLLEXPORT
# endif
#endif
#ifndef GSDLLAPI
# define GSDLLAPI
#endif
#ifndef GSDLLCALL
# define GSDLLCALL
#endif
#if defined(__IBMC__)
# define GSDLLAPIPTR * GSDLLAPI
# define GSDLLCALLPTR * GSDLLCALL
#else
# define GSDLLAPIPTR GSDLLAPI *
# define GSDLLCALLPTR GSDLLCALL *
#endif
#ifndef display_callback_DEFINED
# define display_callback_DEFINED
typedef struct display_callback_s display_callback;
#endif
#ifndef gs_memory_DEFINED
# define gs_memory_DEFINED
typedef struct gs_memory_s gs_memory_t;
#endif
#ifndef gp_file_DEFINED
# define gp_file_DEFINED
typedef struct gp_file_s gp_file;
#endif
typedef struct gsapi_revision_s {
const char *product;
const char *copyright;
long revision;
long revisiondate;
} gsapi_revision_t;
/* Get version numbers and strings.
* This is safe to call at any time.
* You should call this first to make sure that the correct version
* of the Ghostscript is being used.
* pr is a pointer to a revision structure.
* len is the size of this structure in bytes.
* Returns 0 if OK, or if len too small (additional parameters
* have been added to the structure) it will return the required
* size of the structure.
*/
GSDLLEXPORT int GSDLLAPI
gsapi_revision(gsapi_revision_t *pr, int len);
/*
* WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
* On non-threading capable platforms, Ghostscript supports only
* one instance. The current implementation uses a global static
* instance counter to make sure that only a single instance is
* used. If you try to create two instances, the second attempt
* will return < 0 and set pinstance to NULL.
* WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
*/
/* Create a new instance of Ghostscript.
* This instance is passed to most other API functions.
* The caller_handle will be provided to callback functions.
*/
GSDLLEXPORT int GSDLLAPI
gsapi_new_instance(void **pinstance, void *caller_handle);
/*
* WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
* On non-threading capable platforms, Ghostscript supports only
* one instance. The current implementation uses a global static
* instance counter to make sure that only a single instance is
* used.
* WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
*/
/* Destroy an instance of Ghostscript
* Before you call this, Ghostscript must have finished.
* If Ghostscript has been initialised, you must call gsapi_exit()
* before gsapi_delete_instance.
*/
GSDLLEXPORT void GSDLLAPI
gsapi_delete_instance(void *instance);
/* Set the callback functions for stdio
* The stdin callback function should return the number of
* characters read, 0 for EOF, or -1 for error.
* The stdout and stderr callback functions should return
* the number of characters written.
* If a callback address is NULL, the real stdio will be used.
*/
GSDLLEXPORT int GSDLLAPI
gsapi_set_stdio(void *instance,
int (GSDLLCALLPTR stdin_fn)(void *caller_handle, char *buf, int len),
int (GSDLLCALLPTR stdout_fn)(void *caller_handle, const char *str, int len),
int (GSDLLCALLPTR stderr_fn)(void *caller_handle, const char *str, int len));
/* Does the same as the above, but using the caller_handle given here,
* rather than the default one specified at gsapi_new_instance time. */
GSDLLEXPORT int GSDLLAPI
gsapi_set_stdio_with_handle(void *instance,
int (GSDLLCALLPTR stdin_fn)(void *caller_handle, char *buf, int len),
int (GSDLLCALLPTR stdout_fn)(void *caller_handle, const char *str, int len),
int (GSDLLCALLPTR stderr_fn)(void *caller_handle, const char *str, int len),
void *caller_handle);
/* Set the callback function for polling.
* This is used for handling window events or cooperative
* multitasking. This function will only be called if
* Ghostscript was compiled with CHECK_INTERRUPTS
* as described in gpcheck.h.
* The polling function should return 0 if all is well,
* and negative if it wants ghostscript to abort.
* The polling function must be fast.
*/
GSDLLEXPORT int GSDLLAPI gsapi_set_poll(void *instance,
int (GSDLLCALLPTR poll_fn)(void *caller_handle));
/* Does the same as the above, but using the caller_handle given here,
* rather than the default one specified at gsapi_new_instance time. */
GSDLLEXPORT int GSDLLAPI gsapi_set_poll_with_handle(void *instance,
int (GSDLLCALLPTR poll_fn)(void *caller_handle), void *caller_handle);
/* Set the display device callback structure.
* If the display device is used, this must be called
* after gsapi_new_instance() and before gsapi_init_with_args().
* See gdevdisp.h for more details.
* DEPRECATED: Use the gsapi_register_callback mechanism instead.
*/
GSDLLEXPORT int GSDLLAPI gsapi_set_display_callback(
void *instance, display_callback *callback);
/* The callout mechanism allows devices to query "callers" (users of the
* DLL) in device specific ways. The callout function pointer type will
* be called with:
* callout_handle = the value given at registration
* device_name = the name of the current device
* id = An integer, guaranteed to be unique within the
* callouts from a given device, identifying the
* purpose of this call.
* size = device/id specific, but typically the size of 'data'.
* data = device/id specific, but typically the pointer to
* an in/out data block.
* Returns an error code (gs_error_unknownerror (-1) if unclaimed,
* non-negative on success, standard gs error numbers recommended).
*/
typedef int (*gs_callout)(void *instance,
void *callout_handle,
const char *device_name,
int id,
int size,
void *data);
/* Register a handler for gs callouts.
* This must be called after gsapi_new_instance() and (typically)
* before gsapi_init_with_args().
*/
GSDLLEXPORT int GSDLLAPI gsapi_register_callout(
void *instance, gs_callout callout, void *callout_handle);
/* Deregister a handler for gs callouts. */
GSDLLEXPORT void GSDLLAPI gsapi_deregister_callout(
void *instance, gs_callout callout, void *callout_handle);
/* Set the string containing the list of default device names
* for example "display x11alpha x11 bbox". Allows the calling
* application to influence which device(s) gs will try in order
* to select the default device
*
* *Must* be called after gsapi_new_instance() and before
* gsapi_init_with_args().
*/
GSDLLEXPORT int GSDLLAPI
gsapi_set_default_device_list(void *instance, const char *list, int listlen);
/* Returns a pointer to the current default device string
* *Must* be called after gsapi_new_instance().
*/
GSDLLEXPORT int GSDLLAPI
gsapi_get_default_device_list(void *instance, char **list, int *listlen);
/* Set the encoding used for the args. By default we assume
* 'local' encoding. For windows this equates to whatever the current
* codepage is. For linux this is utf8.
*
* Use of this API (gsapi) with 'local' encodings (and hence without calling
* this function) is now deprecated!
*/
GSDLLEXPORT int GSDLLAPI gsapi_set_arg_encoding(void *instance,
int encoding);
enum {
GS_ARG_ENCODING_LOCAL = 0,
GS_ARG_ENCODING_UTF8 = 1,
GS_ARG_ENCODING_UTF16LE = 2
};
/* Initialise the interpreter.
* This calls gs_main_init_with_args() in imainarg.c
* 1. If quit or EOF occur during gsapi_init_with_args(),
* the return value will be gs_error_Quit. This is not an error.
* You must call gsapi_exit() and must not call any other
* gsapi_XXX functions.
* 2. If usage info should be displayed, the return value will be gs_error_Info
* which is not an error. Do not call gsapi_exit().
* 3. Under normal conditions this returns 0. You would then
* call one or more gsapi_run_*() functions and then finish
* with gsapi_exit().
*/
GSDLLEXPORT int GSDLLAPI gsapi_init_with_args(void *instance,
int argc, char **argv);
#ifdef __WIN32__
GSDLLEXPORT int GSDLLAPI gsapi_init_with_argsA(void *instance,
int argc, char **argv);
GSDLLEXPORT int GSDLLAPI gsapi_init_with_argsW(void *instance,
int argc, wchar_t **argv);
#endif
/*
* The gsapi_run_* functions are like gs_main_run_* except
* that the error_object is omitted.
* If these functions return <= -100, either quit or a fatal
* error has occured. You then call gsapi_exit() next.
* The only exception is gsapi_run_string_continue()
* which will return gs_error_NeedInput if all is well.
*/
GSDLLEXPORT int GSDLLAPI
gsapi_run_string_begin(void *instance,
int user_errors, int *pexit_code);
GSDLLEXPORT int GSDLLAPI
gsapi_run_string_continue(void *instance,
const char *str, unsigned int length, int user_errors, int *pexit_code);
GSDLLEXPORT int GSDLLAPI
gsapi_run_string_end(void *instance,
int user_errors, int *pexit_code);
GSDLLEXPORT int GSDLLAPI
gsapi_run_string_with_length(void *instance,
const char *str, unsigned int length, int user_errors, int *pexit_code);
GSDLLEXPORT int GSDLLAPI
gsapi_run_string(void *instance,
const char *str, int user_errors, int *pexit_code);
GSDLLEXPORT int GSDLLAPI
gsapi_run_file(void *instance,
const char *file_name, int user_errors, int *pexit_code);
#ifdef __WIN32__
GSDLLEXPORT int GSDLLAPI
gsapi_run_fileA(void *instance,
const char *file_name, int user_errors, int *pexit_code);
GSDLLEXPORT int GSDLLAPI
gsapi_run_fileW(void *instance,
const wchar_t *file_name, int user_errors, int *pexit_code);
#endif
/* Exit the interpreter.
* This must be called on shutdown if gsapi_init_with_args()
* has been called, and just before gsapi_delete_instance().
*/
GSDLLEXPORT int GSDLLAPI
gsapi_exit(void *instance);
typedef enum {
gs_spt_invalid = -1,
gs_spt_null = 0, /* void * is NULL */
gs_spt_bool = 1, /* void * is a pointer to an int (0 false,
* non-zero true). */
gs_spt_int = 2, /* void * is a pointer to an int */
gs_spt_float = 3, /* void * is a float * */
gs_spt_name = 4, /* void * is a char * */
gs_spt_string = 5, /* void * is a char * */
gs_spt_long = 6, /* void * is a long * */
gs_spt_i64 = 7, /* void * is an int64_t * */
gs_spt_size_t = 8, /* void * is a size_t * */
gs_spt_parsed = 9, /* void * is a pointer to a char * to be parsed */
/* Setting a typed param causes it to be instantly fed to to the
* device. This can cause the device to reinitialise itself. Hence,
* setting a sequence of typed params can cause the device to reset
* itself several times. Accordingly, if you OR the type with
* gs_spt_more_to_come, the param will held ready to be passed into
* the device, and will only actually be sent when the next typed
* param is set without this flag (or on device init). Not valid
* for get_typed_param. */
gs_spt_more_to_come = 1<<31
} gs_set_param_type;
/* gs_spt_parsed allows for a string such as "<< /Foo 0 /Bar true >>" or
* "[ 1 2 3 ]" etc to be used so more complex parameters can be set. */
GSDLLEXPORT int GSDLLAPI gsapi_set_param(void *instance, const char *param, const void *value, gs_set_param_type type);
/* Called to get a value. value points to storage of the appropriate
* type. If value is passed as NULL on entry, then the return code is
* the number of bytes storage required for the type. Thus to read a
* name/string/parsed value, call once with value=NULL, then obtain
* the storage, and call again with value=the storage to get a nul
* terminated string. (nul terminator is included in the count - hence
* an empty string requires 1 byte storage). Returns gs_error_undefined
* (-21) if not found. */
GSDLLEXPORT int GSDLLAPI gsapi_get_param(void *instance, const char *param, void *value, gs_set_param_type type);
/* Enumerator to list all the parameters.
* Caller defines void *iter = NULL, and calls with &iter.
* Each call, iter is updated to reflect the position within the
* enumeration, so passing iterator back in gets the next key. The call
* returns negative values for errors, 0 for success, and 1 for "no more
* keys".
*
* void *iter = NULL;
* gs_set_param_type type;
* const char *key;
* int code;
* while ((code = gsapi_enumerate_params(inst, &iter, &key, &type)) == 0) {
* // Process key
* }
*
* Note that the ordering of enumerations is NOT defined. key is valid
* until the next call to gsapi_enumerate_params. Only one enumeration
* at a time (starting a new enumeration will invalidate any previous
* enumeration).
*/
GSDLLEXPORT int GSDLLAPI gsapi_enumerate_params(void *instance, void **iterator, const char **key, gs_set_param_type *type);
enum {
GS_PERMIT_FILE_READING = 0,
GS_PERMIT_FILE_WRITING = 1,
GS_PERMIT_FILE_CONTROL = 2
};
/* Add a path to one of the sets of permitted paths. */
GSDLLEXPORT int GSDLLAPI
gsapi_add_control_path(void *instance, int type, const char *path);
/* Remove a path from one of the sets of permitted paths. */
GSDLLEXPORT int GSDLLAPI
gsapi_remove_control_path(void *instance, int type, const char *path);
/* Purge all the paths from the one of the sets of permitted paths. */
GSDLLEXPORT void GSDLLAPI
gsapi_purge_control_paths(void *instance, int type);
GSDLLEXPORT void GSDLLAPI
gsapi_activate_path_control(void *instance, int enable);
GSDLLEXPORT int GSDLLAPI
gsapi_is_path_control_active(void *instance);
/* Details of gp_file can be found in gp.h.
* Users wanting to use this function should include
* that file. Not included here to avoid bloating the
* API inclusions for the majority of people who won't
* want it. */
#ifndef gp_file_name_sizeof
#define gp_file_name_sizeof 4096
#endif
typedef struct
{
int (*open_file)(const gs_memory_t *mem,
void *secret,
const char *fname,
const char *mode,
gp_file **file);
int (*open_pipe)(const gs_memory_t *mem,
void *secret,
const char *fname,
char *rfname, /* 4096 bytes */
const char *mode,
gp_file **file);
int (*open_scratch)(const gs_memory_t *mem,
void *secret,
const char *prefix,
char *rfname, /* 4096 bytes */
const char *mode,
int rm,
gp_file **file);
int (*open_printer)(const gs_memory_t *mem,
void *secret,
char *fname, /* 4096 bytes */
int binary,
gp_file **file);
int (*open_handle)(const gs_memory_t *mem,
void *secret,
char *fname, /* 4096 bytes */
const char *mode,
gp_file **file);
} gsapi_fs_t;
GSDLLEXPORT int GSDLLAPI
gsapi_add_fs(void *instance, gsapi_fs_t *fs, void *secret);
GSDLLEXPORT void GSDLLAPI
gsapi_remove_fs(void *instance, gsapi_fs_t *fs, void *secret);
/* function prototypes */
typedef int (GSDLLAPIPTR PFN_gsapi_revision)(
gsapi_revision_t *pr, int len);
typedef int (GSDLLAPIPTR PFN_gsapi_new_instance)(
void **pinstance, void *caller_handle);
typedef void (GSDLLAPIPTR PFN_gsapi_delete_instance)(
void *instance);
typedef int (GSDLLAPIPTR PFN_gsapi_set_stdio)(void *instance,
int (GSDLLCALLPTR stdin_fn)(void *caller_handle, char *buf, int len),
int (GSDLLCALLPTR stdout_fn)(void *caller_handle, const char *str, int len),
int (GSDLLCALLPTR stderr_fn)(void *caller_handle, const char *str, int len));
typedef int (GSDLLAPIPTR PFN_gsapi_set_poll)(void *instance,
int(GSDLLCALLPTR poll_fn)(void *caller_handle));
typedef int (GSDLLAPIPTR PFN_gsapi_set_display_callback)(
void *instance, display_callback *callback);
typedef int (GSDLLAPIPTR PFN_gsapi_set_default_device_list)(
void *instance, char *list, int listlen);
typedef int (GSDLLAPIPTR PFN_gsapi_get_default_device_list)(
void *instance, char **list, int *listlen);
typedef int (GSDLLAPIPTR PFN_gsapi_init_with_args)(
void *instance, int argc, char **argv);
#ifdef __WIN32__
typedef int (GSDLLAPIPTR PFN_gsapi_init_with_argsA)(
void *instance, int argc, char **argv);
typedef int (GSDLLAPIPTR PFN_gsapi_init_with_argsW)(
void *instance, int argc, wchar_t **argv);
#endif
typedef int (GSDLLAPIPTR PFN_gsapi_set_arg_encoding)(
void *instance, int encoding);
typedef int (GSDLLAPIPTR PFN_gsapi_run_string_begin)(
void *instance, int user_errors, int *pexit_code);
typedef int (GSDLLAPIPTR PFN_gsapi_run_string_continue)(
void *instance, const char *str, unsigned int length,
int user_errors, int *pexit_code);
typedef int (GSDLLAPIPTR PFN_gsapi_run_string_end)(
void *instance, int user_errors, int *pexit_code);
typedef int (GSDLLAPIPTR PFN_gsapi_run_string_with_length)(
void *instance, const char *str, unsigned int length,
int user_errors, int *pexit_code);
typedef int (GSDLLAPIPTR PFN_gsapi_run_string)(
void *instance, const char *str,
int user_errors, int *pexit_code);
typedef int (GSDLLAPIPTR PFN_gsapi_run_file)(void *instance,
const char *file_name, int user_errors, int *pexit_code);
#ifdef __WIN32__
typedef int (GSDLLAPIPTR PFN_gsapi_run_fileA)(void *instance,
const char *file_name, int user_errors, int *pexit_code);
typedef int (GSDLLAPIPTR PFN_gsapi_run_fileW)(void *instance,
const wchar_t *file_name, int user_errors, int *pexit_code);
#endif
typedef int (GSDLLAPIPTR PFN_gsapi_exit)(void *instance);
typedef int (GSDLLAPIPTR PFN_gsapi_set_param)(void *instance, const char *param, const void *value, gs_set_param_type type);
typedef int (GSDLLAPIPTR PFN_gsapi_add_control_path)(void *instance, int type, const char *path);
typedef int (GSDLLAPIPTR PFN_gsapi_remove_control_path)(void *instance, int type, const char *path);
typedef void (GSDLLAPIPTR PFN_gsapi_purge_control_paths)(void *instance, int type);
typedef void (GSDLLAPIPTR PFN_gsapi_activate_path_control)(void *instance, int enable);
typedef int (GSDLLAPIPTR PFN_gsapi_is_path_control_active)(void *instance);
typedef int (GSDLLAPIPTR PFN_gsapi_add_fs)(void *instance, gsapi_fs_t *fs, void *secret);
typedef void (GSDLLAPIPTR PFN_gsapi_remove_fs)(void *instance, gsapi_fs_t *fs, void *secret);
#ifdef __MACOS__
#pragma export off
#endif
#ifdef __cplusplus
} /* extern 'C' protection */
#endif
#endif /* iapi_INCLUDED */
@@ -0,0 +1,72 @@
/* Copyright (C) 2001-2023 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
implied.
This software is distributed under license and may not be copied,
modified or distributed except as expressly authorized under the terms
of the license contained in the file LICENSE in this distribution.
Refer to licensing information at http://www.artifex.com or contact
Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
CA 94129, USA, for further information.
*/
/* Definition of error codes */
#ifndef ierrors_INCLUDED
# define ierrors_INCLUDED
#include "gserrors.h"
/*
* DO NOT USE THIS FILE IN THE GRAPHICS LIBRARY.
* THIS FILE IS PART OF THE POSTSCRIPT INTERPRETER.
* USE gserrors.h IN THE LIBRARY.
*/
/*
* A procedure that may return an error always returns
* a non-negative value (zero, unless otherwise noted) for success,
* or negative for failure.
* We use ints rather than an enum to avoid a lot of casting.
*/
/* Define the error name table */
extern const char *const gs_error_names[];
/* ------ PostScript Level 1 errors ------ */
#define LEVEL1_ERROR_NAMES\
"unknownerror", "dictfull", "dictstackoverflow", "dictstackunderflow",\
"execstackoverflow", "interrupt", "invalidaccess", "invalidexit",\
"invalidfileaccess", "invalidfont", "invalidrestore", "ioerror",\
"limitcheck", "nocurrentpoint", "rangecheck", "stackoverflow",\
"stackunderflow", "syntaxerror", "timeout", "typecheck", "undefined",\
"undefinedfilename", "undefinedresult", "unmatchedmark", "VMerror"
/* ------ Additional Level 2 errors (also in DPS) ------ */
#define LEVEL2_ERROR_NAMES\
"configurationerror", "undefinedresource", "unregistered"
/* ------ Additional DPS errors ------ */
#define DPS_ERROR_NAMES\
"invalidcontext", "invalidid"
#define PDF_ERROR_NAMES\
"pdf_stackoverflow", "pdf_circular_reference"
#define ERROR_NAMES\
LEVEL1_ERROR_NAMES, LEVEL2_ERROR_NAMES, DPS_ERROR_NAMES, PDF_ERROR_NAMES
/*
* Define which error codes require re-executing the current object.
*/
#define GS_ERROR_IS_INTERRUPT(ecode)\
((ecode) == gs_error_interrupt || (ecode) == gs_error_timeout)
#endif /* ierrors_INCLUDED */
@@ -0,0 +1,3 @@
#pragma once
#include "iapi.h"
#include "ierrors.h"
@@ -0,0 +1,129 @@
/* Copyright (C) 2001-2026 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
implied.
This software is distributed under license and may not be copied,
modified or distributed except as expressly authorized under the terms
of the license contained in the file LICENSE in this distribution.
Refer to licensing information at http://www.artifex.com or contact
Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
CA 94129, USA, for further information.
*/
#ifndef gscdefs_INCLUDED
# define gscdefs_INCLUDED
/* This comment, the delimiting comments below, and the lines of
* source code between the delimiting comments may not be altered,
* replaced, changed, or otherwise modified for the purpose of
* misrepresenting the origin of works generated using this
* software.
*
* The supplemental term above has been added in accordance with
* Section 7(b) of the Affero General Public License version 3.
*/
/* BEGIN -- CHANGES RESTRICTED UNDER 7(b) */
/* If we are cluster testing, then we want to nobble stuff
* that might change between versions. */
#ifdef CLUSTER
#undef GS_PRODUCTFAMILY
#define GS_PRODUCTFAMILY "GPL Ghostscript"
#undef GS_PRODUCT
#define GS_PRODUCT GS_PRODUCTFAMILY
#else
/* def GS_PRODFAM */
# define GS_PRODUCTFAMILY\
"GPL Ghostscript"
/* end def GS_PRODFAM */
/* def GS_PROD */
# define GS_PRODUCT\
GS_PRODUCTFAMILY " GIT PRERELEASE"
/* end def GS_PROD */
#endif
/* END -- CHANGES RESTRICTED UNDER 7(b) */
#define GS_STRINGIZE2(s) #s
#define GS_STRINGIZE(s) GS_STRINGIZE2(s)
#ifndef GS_BUILDTIME
# define GS_BUILDTIME\
0 /* should be set in the makefile */
#endif
#ifndef GS_COPYRIGHT
# define GS_COPYRIGHT\
"Copyright (C) 2026 Artifex Software, Inc. All rights reserved."
#endif
/* Prototypes for configuration definitions in gconfig.c. */
/*
* This file may be #included in places that don't even have stdpre.h,
* so it mustn't use any Ghostscript definitions in any code that is
* actually processed here (as opposed to being part of a macro
* definition).
*/
/* Miscellaneous system constants (read-only systemparams). */
extern const long gs_buildtime;
extern const char *const gs_copyright;
extern const char *const gs_product;
extern const char *const gs_productfamily;
extern const long gs_revision;
extern const long gs_revisiondate;
extern const long gs_serialnumber;
/* Installation directories and files */
extern const char *const gs_doc_directory;
extern const char *const gs_lib_default_path;
extern const char *const gs_init_file;
extern const char *const gs_dev_defaults;
/* Resource tables. In order to avoid importing a large number of types, */
/* we only provide macros for some externs, not the externs themselves. */
#define extern_gx_device_halftone_list()\
typedef DEVICE_HALFTONE_RESOURCE_PROC((*gx_dht_proc));\
extern const gx_dht_proc gx_device_halftone_list[]
#define extern_gx_image_class_table()\
extern const gx_image_class_t gx_image_class_table[]
extern const unsigned gx_image_class_table_count;
#define extern_gx_image_type_table()\
extern const gx_image_type_t * const gx_image_type_table[]
extern const unsigned gx_image_type_table_count;
/* We need the extra typedef so that the const will apply to the table. */
#define extern_gx_init_table()\
typedef init_proc((*gx_init_proc));\
extern const gx_init_proc gx_init_table[]
#define extern_gx_io_device_table()\
extern const gx_io_device * const gx_io_device_table[]
extern const unsigned gx_io_device_table_count;
/* Return the list of device prototypes, a NULL list of their structure */
/* descriptors (no longer used), and (as the value) the length of the lists. */
#define extern_gs_lib_device_list()\
int gs_lib_device_list(const gx_device * const **plist,\
gs_memory_struct_type_t **pst)
/* find a compositor by name */
#define extern_gs_find_compositor() \
const gs_composite_type_t * gs_find_compositor(int comp_id)
#define extern_gs_get_fapi_server_inits() \
const gs_fapi_server_init_func * gs_get_fapi_server_inits(void)
#endif /* gscdefs_INCLUDED */
@@ -0,0 +1,104 @@
/* Copyright (C) 2001-2023 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
implied.
This software is distributed under license and may not be copied,
modified or distributed except as expressly authorized under the terms
of the license contained in the file LICENSE in this distribution.
Refer to licensing information at http://www.artifex.com or contact
Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
CA 94129, USA, for further information.
*/
/* This interface is deprecated and will be removed in future
* ghostscript releases. Use the interface described in
* API.htm and iapi.h.
*/
#ifndef gsdll_INCLUDED
# define gsdll_INCLUDED
#include "iapi.h"
#include "windows_.h"
#ifdef __MACOS__
#define HWND char *
#include <QDOffscreen.h>
#pragma export on
#endif
#ifdef __WINDOWS__
#define _Windows
#endif
#ifdef __IBMC__
#define GSDLLCALLLINK _System
#else
#define GSDLLCALLLINK
#endif
/* global pointer to callback */
typedef int (* GSDLLCALLLINK GSDLL_CALLBACK) (int, char *, unsigned long);
extern GSDLL_CALLBACK pgsdll_callback;
/* message values for callback */
#define GSDLL_STDIN 1 /* get count characters to str from stdin */
/* return number of characters read */
#define GSDLL_STDOUT 2 /* put count characters from str to stdout */
/* return number of characters written */
#define GSDLL_DEVICE 3 /* device = str has been opened if count=1 */
/* or closed if count=0 */
#define GSDLL_SYNC 4 /* sync_output for device str */
#define GSDLL_PAGE 5 /* output_page for device str */
#define GSDLL_SIZE 6 /* resize for device str */
/* LOWORD(count) is new xsize */
/* HIWORD(count) is new ysize */
#define GSDLL_POLL 7 /* Called from gp_check_interrupt */
/* Can be used by caller to poll the message queue */
/* Normally returns 0 */
/* To abort gsdll_execute_cont(), return a */
/* non zero error code until gsdll_execute_cont() */
/* returns */
/* return values from gsdll_init() */
#define GSDLL_INIT_IN_USE 100 /* DLL is in use */
#define GSDLL_INIT_QUIT 101 /* quit or EOF during init */
/* This is not an error. */
/* gsdll_exit() must not be called */
/* DLL exported functions */
/* for load time dynamic linking */
GSDLLEXPORT int GSDLLAPI gsdll_revision(const char * * product, const char * * copyright, long * gs_revision, long * gs_revisiondate);
GSDLLEXPORT int GSDLLAPI gsdll_init(GSDLL_CALLBACK callback, HWND hwnd, int argc, char * * argv);
GSDLLEXPORT int GSDLLAPI gsdll_execute_begin(void);
GSDLLEXPORT int GSDLLAPI gsdll_execute_cont(const char * str, int len);
GSDLLEXPORT int GSDLLAPI gsdll_execute_end(void);
GSDLLEXPORT int GSDLLAPI gsdll_exit(void);
GSDLLEXPORT int GSDLLAPI gsdll_lock_device(unsigned char *device, int flag);
/* Function pointer typedefs */
/* for run time dynamic linking */
typedef int (GSDLLAPIPTR PFN_gsdll_revision)(const char ** product,
const char ** copyright, long * revision, long * revisiondate);
typedef int (GSDLLAPIPTR PFN_gsdll_init) (GSDLL_CALLBACK, HWND, int argc, char * * argv);
typedef int (GSDLLAPIPTR PFN_gsdll_init_with_encoding) (GSDLL_CALLBACK, HWND, int argc, char * * argv, int encoding);
#ifdef __WIN32__
typedef int (GSDLLAPIPTR PFN_gsdll_initA) (GSDLL_CALLBACK, HWND, int argc, char * * argv);
typedef int (GSDLLAPIPTR PFN_gsdll_initW) (GSDLL_CALLBACK, HWND, int argc, wchar_t * * argv);
#endif
typedef int (GSDLLAPIPTR PFN_gsdll_execute_begin) (void);
typedef int (GSDLLAPIPTR PFN_gsdll_execute_cont) (const char * str, int len);
typedef int (GSDLLAPIPTR PFN_gsdll_execute_end) (void);
typedef int (GSDLLAPIPTR PFN_gsdll_exit) (void);
typedef int (GSDLLAPIPTR PFN_gsdll_lock_device) (unsigned char *, int);
#ifdef __MACOS__
#pragma export off
#endif
#endif /* gsdll_INCLUDED */
@@ -0,0 +1,280 @@
/* Copyright (C) 2001-2023 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
implied.
This software is distributed under license and may not be copied,
modified or distributed except as expressly authorized under the terms
of the license contained in the file LICENSE in this distribution.
Refer to licensing information at http://www.artifex.com or contact
Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
CA 94129, USA, for further information.
*/
/* Error code definitions */
#ifndef gserrors_INCLUDED
# define gserrors_INCLUDED
/* A procedure that may return an error always returns */
/* a non-negative value (zero, unless otherwise noted) for success, */
/* or negative for failure. */
/* We don't use a typedef internally to avoid a lot of casting. */
enum gs_error_type {
gs_error_ok = 0,
gs_error_unknownerror = -1, /* unknown error */
gs_error_dictfull = -2,
gs_error_dictstackoverflow = -3,
gs_error_dictstackunderflow = -4,
gs_error_execstackoverflow = -5,
gs_error_interrupt = -6,
gs_error_invalidaccess = -7,
gs_error_invalidexit = -8,
gs_error_invalidfileaccess = -9,
gs_error_invalidfont = -10,
gs_error_invalidrestore = -11,
gs_error_ioerror = -12,
gs_error_limitcheck = -13,
gs_error_nocurrentpoint = -14,
gs_error_rangecheck = -15,
gs_error_stackoverflow = -16,
gs_error_stackunderflow = -17,
gs_error_syntaxerror = -18,
gs_error_timeout = -19,
gs_error_typecheck = -20,
gs_error_undefined = -21,
gs_error_undefinedfilename = -22,
gs_error_undefinedresult = -23,
gs_error_unmatchedmark = -24,
gs_error_VMerror = -25, /* must be the last Level 1 error */
/* ------ Additional Level 2 errors (also in DPS, ------ */
gs_error_configurationerror = -26,
gs_error_undefinedresource = -27,
gs_error_unregistered = -28,
gs_error_invalidcontext = -29,
/* invalidid is for the NeXT DPS extension. */
gs_error_invalidid = -30,
/* We need a specific stackoverflow error for the PDF interpreter to avoid dropping into
* the Postscript interpreter's stack extending code, when the PDF interpreter is called from
* Postscript
*/
gs_error_pdf_stackoverflow = -31,
/* Internal error for the C-based PDF interpreter, to indicate a circular PDF reference */
gs_error_circular_reference = -32,
/* ------ Pseudo-errors used internally ------ */
gs_error_hit_detected = -99,
gs_error_Fatal = -100,
/*
* Internal code for the .quit operator.
* The real quit code is an integer on the operand stack.
* gs_interpret returns this only for a .quit with a zero exit code.
*/
gs_error_Quit = -101,
/*
* Internal code for a normal exit from the interpreter.
* Do not use outside of interp.c.
*/
gs_error_InterpreterExit = -102,
/* Need the remap color error for high level pattern support */
gs_error_Remap_Color = -103,
/*
* Internal code to indicate we have underflowed the top block
* of the e-stack.
*/
gs_error_ExecStackUnderflow = -104,
/*
* Internal code for the vmreclaim operator with a positive operand.
* We need to handle this as an error because otherwise the interpreter
* won't reload enough of its state when the operator returns.
*/
gs_error_VMreclaim = -105,
/*
* Internal code for requesting more input from run_string.
*/
gs_error_NeedInput = -106,
/*
* Internal code to all run_string to request that the data is rerun
* using run_file.
*/
gs_error_NeedFile = -107,
/*
* Internal code for a normal exit when usage info is displayed.
* This allows Window versions of Ghostscript to pause until
* the message can be read.
*/
gs_error_Info = -110,
/* A special 'error', like reamp color above. This is used by a subclassing
* device to indicate that it has fully processed a device method, and parent
* subclasses should not perform any further action. Currently this is limited
* to compositor creation.
*/
gs_error_handled = -111,
};
/* We do provide a typedef type for external API use */
typedef enum gs_error_type gs_error_t;
int gs_log_error(int, const char *, int);
#if !defined(DEBUG)
# define gs_log_error(err, file, line) (err)
#endif
#define gs_note_error(err) gs_log_error(err, __FILE__, __LINE__)
#define return_error(err) return gs_note_error(err)
#if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901L
# if defined(__GNUC__) && __GNUC__ >= 2
# define __func__ __FUNCTION__
# elif defined(__FUNCTION__)
# define __func__ __FUNCTION__
# elif defined(__FUNC__)
# define __func__ __FUNC__
# else
# define __func__ "<unknown>"
# endif
#endif
/*
* Error reporting macros.
*
*/
#ifndef __printflike
#if __GNUC__ > 2 || __GNUC__ == 2 && __GNUC_MINOR__ >= 7
#define __printflike(fmtarg, firstvararg) \
__attribute__((__format__ (__printf__, fmtarg, firstvararg)))
#else
#define __printflike(fmtarg, firstvararg)
#endif
#endif
const char *gs_errstr(int code);
int gs_throw_imp(const char *func, const char *file, int line,
int op, int code, const char *fmt, ...) __attribute__((__format__(__printf__, 6, 7)));
/* Use throw at origin of error
*/
#define gs_throw_code(code) \
gs_throw1((code), "%s", gs_errstr((code)))
#define gs_throw(code, fmt) \
gs_throw_imp(__func__, __FILE__, __LINE__, 0, code, fmt)
#define gs_throw1(code, fmt, arg1) \
gs_throw_imp(__func__, __FILE__, __LINE__, 0, code, fmt, arg1)
#define gs_throw2(code, fmt, arg1, arg2) \
gs_throw_imp(__func__, __FILE__, __LINE__, 0, code, fmt, arg1, arg2)
#define gs_throw3(code, fmt, arg1, arg2, arg3) \
gs_throw_imp(__func__, __FILE__, __LINE__, 0, code, fmt, arg1, arg2, arg3)
#define gs_throw4(code, fmt, arg1, arg2, arg3, arg4) \
gs_throw_imp(__func__, __FILE__, __LINE__, 0, code, fmt, arg1, arg2, arg3, arg4)
#define gs_throw5(code, fmt, arg1, arg2, arg3, arg4, arg5) \
gs_throw_imp(__func__, __FILE__, __LINE__, 0, code, fmt, arg1, arg2, arg3, arg4, arg5)
#define gs_throw6(code, fmt, arg1, arg2, arg3, arg4, arg5, arg6) \
gs_throw_imp(__func__, __FILE__, __LINE__, 0, code, fmt, arg1, arg2, arg3, arg4, arg5, arg6)
#define gs_throw7(code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7) \
gs_throw_imp(__func__, __FILE__, __LINE__, 0, code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7)
#define gs_throw8(code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) \
gs_throw_imp(__func__, __FILE__, __LINE__, 0, code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8)
#define gs_throw9(code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) \
gs_throw_imp(__func__, __FILE__, __LINE__, 0, code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9)
/* Bubble the code up the stack
*/
#define gs_rethrow_code(code) \
gs_rethrow1((code), "%s", gs_errstr((code)))
#define gs_rethrow(code, fmt) \
gs_throw_imp(__func__, __FILE__, __LINE__, 1, code, fmt)
#define gs_rethrow1(code, fmt, arg1) \
gs_throw_imp(__func__, __FILE__, __LINE__, 1, code, fmt, arg1)
#define gs_rethrow2(code, fmt, arg1, arg2) \
gs_throw_imp(__func__, __FILE__, __LINE__, 1, code, fmt, arg1, arg2)
#define gs_rethrow3(code, fmt, arg1, arg2, arg3) \
gs_throw_imp(__func__, __FILE__, __LINE__, 1, code, fmt, arg1, arg2, arg3)
#define gs_rethrow4(code, fmt, arg1, arg2, arg3, arg4) \
gs_throw_imp(__func__, __FILE__, __LINE__, 1, code, fmt, arg1, arg2, arg3, arg4)
#define gs_rethrow5(code, fmt, arg1, arg2, arg3, arg4, arg5) \
gs_throw_imp(__func__, __FILE__, __LINE__, 1, code, fmt, arg1, arg2, arg3, arg4, arg5)
#define gs_rethrow6(code, fmt, arg1, arg2, arg3, arg4, arg5, arg6) \
gs_throw_imp(__func__, __FILE__, __LINE__, 1, code, fmt, arg1, arg2, arg3, arg4, arg5, arg6)
#define gs_rethrow7(code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7) \
gs_throw_imp(__func__, __FILE__, __LINE__, 1, code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7)
#define gs_rethrow8(code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) \
gs_throw_imp(__func__, __FILE__, __LINE__, 1, code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8)
#define gs_rethrow9(code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) \
gs_throw_imp(__func__, __FILE__, __LINE__, 1, code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9)
/* This will cause trouble, as it implies you are fixing an error
* the system will spew messages
*/
#define gs_catch(code, fmt) \
gs_throw_imp(__func__, __FILE__, __LINE__, 2, code, fmt)
#define gs_catch1(code, fmt, arg1) \
gs_throw_imp(__func__, __FILE__, __LINE__, 2, code, fmt, arg1)
#define gs_catch2(code, fmt, arg1, arg2) \
gs_throw_imp(__func__, __FILE__, __LINE__, 2, code, fmt, arg1, arg2)
#define gs_catch3(code, fmt, arg1, arg2, arg3) \
gs_throw_imp(__func__, __FILE__, __LINE__, 2, code, fmt, arg1, arg2, arg3)
#define gs_catch4(code, fmt, arg1, arg2, arg3, arg4) \
gs_throw_imp(__func__, __FILE__, __LINE__, 2, code, fmt, arg1, arg2, arg3, arg4)
#define gs_catch5(code, fmt, arg1, arg2, arg3, arg4, arg5) \
gs_throw_imp(__func__, __FILE__, __LINE__, 2, code, fmt, arg1, arg2, arg3, arg4, arg5)
#define gs_catch6(code, fmt, arg1, arg2, arg3, arg4, arg5, arg6) \
gs_throw_imp(__func__, __FILE__, __LINE__, 2, code, fmt, arg1, arg2, arg3, arg4, arg5, arg6)
#define gs_catch7(code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7) \
gs_throw_imp(__func__, __FILE__, __LINE__, 2, code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7)
#define gs_catch8(code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) \
gs_throw_imp(__func__, __FILE__, __LINE__, 2, code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8)
#define gs_catch9(code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) \
gs_throw_imp(__func__, __FILE__, __LINE__, 2, code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9)
/* gs_warn is a printf
*/
#define gs_warn(fmt) \
(void)gs_throw_imp(__func__, __FILE__, __LINE__, 3, 0, fmt)
#define gs_warn1(fmt, arg1) \
(void)gs_throw_imp(__func__, __FILE__, __LINE__, 3, 0, fmt, arg1)
#define gs_warn2(fmt, arg1, arg2) \
(void)gs_throw_imp(__func__, __FILE__, __LINE__, 3, 0, fmt, arg1, arg2)
#define gs_warn3(fmt, arg1, arg2, arg3) \
(void)gs_throw_imp(__func__, __FILE__, __LINE__, 3, 0, fmt, arg1, arg2, arg3)
#define gs_warn4(fmt, arg1, arg2, arg3, arg4) \
(void)gs_throw_imp(__func__, __FILE__, __LINE__, 3, 0, fmt, arg1, arg2, arg3, arg4)
#define gs_warn5(fmt, arg1, arg2, arg3, arg4, arg5) \
(void)gs_throw_imp(__func__, __FILE__, __LINE__, 3, 0, fmt, arg1, arg2, arg3, arg4, arg5)
#define gs_warn6(fmt, arg1, arg2, arg3, arg4, arg5, arg6) \
(void)gs_throw_imp(__func__, __FILE__, __LINE__, 3, 0, fmt, arg1, arg2, arg3, arg4, arg5, arg6)
#define gs_warn7(fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7) \
(void)gs_throw_imp(__func__, __FILE__, __LINE__, 3, 0, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7)
#define gs_warn8(fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) \
(void)gs_throw_imp(__func__, __FILE__, __LINE__, 3, 0, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8)
#define gs_warn9(fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) \
(void)gs_throw_imp(__func__, __FILE__, __LINE__, 3, 0, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9)
/* just in case you don't know 0 means no error
* other return codes are errors.
*/
#define gs_okay 0
#endif /* gserrors_INCLUDED */
@@ -0,0 +1,574 @@
/* Copyright (C) 2001-2023 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
implied.
This software is distributed under license and may not be copied,
modified or distributed except as expressly authorized under the terms
of the license contained in the file LICENSE in this distribution.
Refer to licensing information at http://www.artifex.com or contact
Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
CA 94129, USA, for further information.
*/
/*
* Public API for Ghostscript interpreter
* for use both as DLL and for static linking.
*
* Should work for Windows, OS/2, Linux, Mac.
*
* DLL exported functions should be as similar as possible to imain.c
* You will need to include "ierrors.h".
*
* Current problems:
* 1. Ghostscript does not support multiple instances.
* 2. Global variables in gs_main_instance_default()
* and gsapi_instance_counter
*/
/* Exported functions may need different prefix
* GSDLLEXPORT marks functions as exported
* GSDLLAPI is the calling convention used on functions exported
* by Ghostscript
* GSDLLCALL is used on callback functions called by Ghostscript
* When you include this header file in the caller, you may
* need to change the definitions by defining these
* before including this header file.
* Make sure you get the calling convention correct, otherwise your
* program will crash either during callbacks or soon after returning
* due to stack corruption.
*/
#ifndef iapi_INCLUDED
# define iapi_INCLUDED
#ifdef __cplusplus
extern "C" {
#endif
#if defined(_WINDOWS_) || defined(__WINDOWS__)
# ifndef _Windows
# define _Windows
# endif
#endif
#ifdef _Windows
# ifndef GSDLLEXPORT
/* We don't need both the "__declspec(dllexport)" declaration
* and the listing in the .def file - having both results in
* a linker warning on x64 builds (but is incorrect on x86, too)
*/
# if 0
# define GSDLLEXPORT __declspec(dllexport)
# else
# define GSDLLEXPORT
# endif
# endif
# ifdef __MINGW32__
/* export stdcall functions as "name" instead of "_name@ordinal" */
# undef GSDLLAPI
# define GSDLLAPI
# endif
# ifndef GSDLLAPI
# define GSDLLAPI __stdcall
# endif
# ifndef GSDLLCALL
# define GSDLLCALL __stdcall
# endif
#endif /* _Windows */
#if defined(OS2) && defined(__IBMC__)
# ifndef GSDLLAPI
# define GSDLLAPI _System
# endif
# ifndef GSDLLCALL
# define GSDLLCALL _System
# endif
#endif /* OS2 && __IBMC */
#ifdef __MACOS__
# pragma export on
#endif
#ifndef GSDLLEXPORT
# ifdef __GNUC__
# define GSDLLEXPORT __attribute__ ((visibility ("default")))
# else
# define GSDLLEXPORT
# endif
#endif
#ifndef GSDLLAPI
# define GSDLLAPI
#endif
#ifndef GSDLLCALL
# define GSDLLCALL
#endif
#if defined(__IBMC__)
# define GSDLLAPIPTR * GSDLLAPI
# define GSDLLCALLPTR * GSDLLCALL
#else
# define GSDLLAPIPTR GSDLLAPI *
# define GSDLLCALLPTR GSDLLCALL *
#endif
#ifndef display_callback_DEFINED
# define display_callback_DEFINED
typedef struct display_callback_s display_callback;
#endif
#ifndef gs_memory_DEFINED
# define gs_memory_DEFINED
typedef struct gs_memory_s gs_memory_t;
#endif
#ifndef gp_file_DEFINED
# define gp_file_DEFINED
typedef struct gp_file_s gp_file;
#endif
typedef struct gsapi_revision_s {
const char *product;
const char *copyright;
long revision;
long revisiondate;
} gsapi_revision_t;
/* Get version numbers and strings.
* This is safe to call at any time.
* You should call this first to make sure that the correct version
* of the Ghostscript is being used.
* pr is a pointer to a revision structure.
* len is the size of this structure in bytes.
* Returns 0 if OK, or if len too small (additional parameters
* have been added to the structure) it will return the required
* size of the structure.
*/
GSDLLEXPORT int GSDLLAPI
gsapi_revision(gsapi_revision_t *pr, int len);
/*
* WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
* On non-threading capable platforms, Ghostscript supports only
* one instance. The current implementation uses a global static
* instance counter to make sure that only a single instance is
* used. If you try to create two instances, the second attempt
* will return < 0 and set pinstance to NULL.
* WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
*/
/* Create a new instance of Ghostscript.
* This instance is passed to most other API functions.
* The caller_handle will be provided to callback functions.
*/
GSDLLEXPORT int GSDLLAPI
gsapi_new_instance(void **pinstance, void *caller_handle);
/*
* WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
* On non-threading capable platforms, Ghostscript supports only
* one instance. The current implementation uses a global static
* instance counter to make sure that only a single instance is
* used.
* WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
*/
/* Destroy an instance of Ghostscript
* Before you call this, Ghostscript must have finished.
* If Ghostscript has been initialised, you must call gsapi_exit()
* before gsapi_delete_instance.
*/
GSDLLEXPORT void GSDLLAPI
gsapi_delete_instance(void *instance);
/* Set the callback functions for stdio
* The stdin callback function should return the number of
* characters read, 0 for EOF, or -1 for error.
* The stdout and stderr callback functions should return
* the number of characters written.
* If a callback address is NULL, the real stdio will be used.
*/
GSDLLEXPORT int GSDLLAPI
gsapi_set_stdio(void *instance,
int (GSDLLCALLPTR stdin_fn)(void *caller_handle, char *buf, int len),
int (GSDLLCALLPTR stdout_fn)(void *caller_handle, const char *str, int len),
int (GSDLLCALLPTR stderr_fn)(void *caller_handle, const char *str, int len));
/* Does the same as the above, but using the caller_handle given here,
* rather than the default one specified at gsapi_new_instance time. */
GSDLLEXPORT int GSDLLAPI
gsapi_set_stdio_with_handle(void *instance,
int (GSDLLCALLPTR stdin_fn)(void *caller_handle, char *buf, int len),
int (GSDLLCALLPTR stdout_fn)(void *caller_handle, const char *str, int len),
int (GSDLLCALLPTR stderr_fn)(void *caller_handle, const char *str, int len),
void *caller_handle);
/* Set the callback function for polling.
* This is used for handling window events or cooperative
* multitasking. This function will only be called if
* Ghostscript was compiled with CHECK_INTERRUPTS
* as described in gpcheck.h.
* The polling function should return 0 if all is well,
* and negative if it wants ghostscript to abort.
* The polling function must be fast.
*/
GSDLLEXPORT int GSDLLAPI gsapi_set_poll(void *instance,
int (GSDLLCALLPTR poll_fn)(void *caller_handle));
/* Does the same as the above, but using the caller_handle given here,
* rather than the default one specified at gsapi_new_instance time. */
GSDLLEXPORT int GSDLLAPI gsapi_set_poll_with_handle(void *instance,
int (GSDLLCALLPTR poll_fn)(void *caller_handle), void *caller_handle);
/* Set the display device callback structure.
* If the display device is used, this must be called
* after gsapi_new_instance() and before gsapi_init_with_args().
* See gdevdisp.h for more details.
* DEPRECATED: Use the gsapi_register_callback mechanism instead.
*/
GSDLLEXPORT int GSDLLAPI gsapi_set_display_callback(
void *instance, display_callback *callback);
/* The callout mechanism allows devices to query "callers" (users of the
* DLL) in device specific ways. The callout function pointer type will
* be called with:
* callout_handle = the value given at registration
* device_name = the name of the current device
* id = An integer, guaranteed to be unique within the
* callouts from a given device, identifying the
* purpose of this call.
* size = device/id specific, but typically the size of 'data'.
* data = device/id specific, but typically the pointer to
* an in/out data block.
* Returns an error code (gs_error_unknownerror (-1) if unclaimed,
* non-negative on success, standard gs error numbers recommended).
*/
typedef int (*gs_callout)(void *instance,
void *callout_handle,
const char *device_name,
int id,
int size,
void *data);
/* Register a handler for gs callouts.
* This must be called after gsapi_new_instance() and (typically)
* before gsapi_init_with_args().
*/
GSDLLEXPORT int GSDLLAPI gsapi_register_callout(
void *instance, gs_callout callout, void *callout_handle);
/* Deregister a handler for gs callouts. */
GSDLLEXPORT void GSDLLAPI gsapi_deregister_callout(
void *instance, gs_callout callout, void *callout_handle);
/* Set the string containing the list of default device names
* for example "display x11alpha x11 bbox". Allows the calling
* application to influence which device(s) gs will try in order
* to select the default device
*
* *Must* be called after gsapi_new_instance() and before
* gsapi_init_with_args().
*/
GSDLLEXPORT int GSDLLAPI
gsapi_set_default_device_list(void *instance, const char *list, int listlen);
/* Returns a pointer to the current default device string
* *Must* be called after gsapi_new_instance().
*/
GSDLLEXPORT int GSDLLAPI
gsapi_get_default_device_list(void *instance, char **list, int *listlen);
/* Set the encoding used for the args. By default we assume
* 'local' encoding. For windows this equates to whatever the current
* codepage is. For linux this is utf8.
*
* Use of this API (gsapi) with 'local' encodings (and hence without calling
* this function) is now deprecated!
*/
GSDLLEXPORT int GSDLLAPI gsapi_set_arg_encoding(void *instance,
int encoding);
enum {
GS_ARG_ENCODING_LOCAL = 0,
GS_ARG_ENCODING_UTF8 = 1,
GS_ARG_ENCODING_UTF16LE = 2
};
/* Initialise the interpreter.
* This calls gs_main_init_with_args() in imainarg.c
* 1. If quit or EOF occur during gsapi_init_with_args(),
* the return value will be gs_error_Quit. This is not an error.
* You must call gsapi_exit() and must not call any other
* gsapi_XXX functions.
* 2. If usage info should be displayed, the return value will be gs_error_Info
* which is not an error. Do not call gsapi_exit().
* 3. Under normal conditions this returns 0. You would then
* call one or more gsapi_run_*() functions and then finish
* with gsapi_exit().
*/
GSDLLEXPORT int GSDLLAPI gsapi_init_with_args(void *instance,
int argc, char **argv);
#ifdef __WIN32__
GSDLLEXPORT int GSDLLAPI gsapi_init_with_argsA(void *instance,
int argc, char **argv);
GSDLLEXPORT int GSDLLAPI gsapi_init_with_argsW(void *instance,
int argc, wchar_t **argv);
#endif
/*
* The gsapi_run_* functions are like gs_main_run_* except
* that the error_object is omitted.
* If these functions return <= -100, either quit or a fatal
* error has occured. You then call gsapi_exit() next.
* The only exception is gsapi_run_string_continue()
* which will return gs_error_NeedInput if all is well.
*/
GSDLLEXPORT int GSDLLAPI
gsapi_run_string_begin(void *instance,
int user_errors, int *pexit_code);
GSDLLEXPORT int GSDLLAPI
gsapi_run_string_continue(void *instance,
const char *str, unsigned int length, int user_errors, int *pexit_code);
GSDLLEXPORT int GSDLLAPI
gsapi_run_string_end(void *instance,
int user_errors, int *pexit_code);
GSDLLEXPORT int GSDLLAPI
gsapi_run_string_with_length(void *instance,
const char *str, unsigned int length, int user_errors, int *pexit_code);
GSDLLEXPORT int GSDLLAPI
gsapi_run_string(void *instance,
const char *str, int user_errors, int *pexit_code);
GSDLLEXPORT int GSDLLAPI
gsapi_run_file(void *instance,
const char *file_name, int user_errors, int *pexit_code);
#ifdef __WIN32__
GSDLLEXPORT int GSDLLAPI
gsapi_run_fileA(void *instance,
const char *file_name, int user_errors, int *pexit_code);
GSDLLEXPORT int GSDLLAPI
gsapi_run_fileW(void *instance,
const wchar_t *file_name, int user_errors, int *pexit_code);
#endif
/* Exit the interpreter.
* This must be called on shutdown if gsapi_init_with_args()
* has been called, and just before gsapi_delete_instance().
*/
GSDLLEXPORT int GSDLLAPI
gsapi_exit(void *instance);
typedef enum {
gs_spt_invalid = -1,
gs_spt_null = 0, /* void * is NULL */
gs_spt_bool = 1, /* void * is a pointer to an int (0 false,
* non-zero true). */
gs_spt_int = 2, /* void * is a pointer to an int */
gs_spt_float = 3, /* void * is a float * */
gs_spt_name = 4, /* void * is a char * */
gs_spt_string = 5, /* void * is a char * */
gs_spt_long = 6, /* void * is a long * */
gs_spt_i64 = 7, /* void * is an int64_t * */
gs_spt_size_t = 8, /* void * is a size_t * */
gs_spt_parsed = 9, /* void * is a pointer to a char * to be parsed */
/* Setting a typed param causes it to be instantly fed to to the
* device. This can cause the device to reinitialise itself. Hence,
* setting a sequence of typed params can cause the device to reset
* itself several times. Accordingly, if you OR the type with
* gs_spt_more_to_come, the param will held ready to be passed into
* the device, and will only actually be sent when the next typed
* param is set without this flag (or on device init). Not valid
* for get_typed_param. */
gs_spt_more_to_come = 1<<31
} gs_set_param_type;
/* gs_spt_parsed allows for a string such as "<< /Foo 0 /Bar true >>" or
* "[ 1 2 3 ]" etc to be used so more complex parameters can be set. */
GSDLLEXPORT int GSDLLAPI gsapi_set_param(void *instance, const char *param, const void *value, gs_set_param_type type);
/* Called to get a value. value points to storage of the appropriate
* type. If value is passed as NULL on entry, then the return code is
* the number of bytes storage required for the type. Thus to read a
* name/string/parsed value, call once with value=NULL, then obtain
* the storage, and call again with value=the storage to get a nul
* terminated string. (nul terminator is included in the count - hence
* an empty string requires 1 byte storage). Returns gs_error_undefined
* (-21) if not found. */
GSDLLEXPORT int GSDLLAPI gsapi_get_param(void *instance, const char *param, void *value, gs_set_param_type type);
/* Enumerator to list all the parameters.
* Caller defines void *iter = NULL, and calls with &iter.
* Each call, iter is updated to reflect the position within the
* enumeration, so passing iterator back in gets the next key. The call
* returns negative values for errors, 0 for success, and 1 for "no more
* keys".
*
* void *iter = NULL;
* gs_set_param_type type;
* const char *key;
* int code;
* while ((code = gsapi_enumerate_params(inst, &iter, &key, &type)) == 0) {
* // Process key
* }
*
* Note that the ordering of enumerations is NOT defined. key is valid
* until the next call to gsapi_enumerate_params. Only one enumeration
* at a time (starting a new enumeration will invalidate any previous
* enumeration).
*/
GSDLLEXPORT int GSDLLAPI gsapi_enumerate_params(void *instance, void **iterator, const char **key, gs_set_param_type *type);
enum {
GS_PERMIT_FILE_READING = 0,
GS_PERMIT_FILE_WRITING = 1,
GS_PERMIT_FILE_CONTROL = 2
};
/* Add a path to one of the sets of permitted paths. */
GSDLLEXPORT int GSDLLAPI
gsapi_add_control_path(void *instance, int type, const char *path);
/* Remove a path from one of the sets of permitted paths. */
GSDLLEXPORT int GSDLLAPI
gsapi_remove_control_path(void *instance, int type, const char *path);
/* Purge all the paths from the one of the sets of permitted paths. */
GSDLLEXPORT void GSDLLAPI
gsapi_purge_control_paths(void *instance, int type);
GSDLLEXPORT void GSDLLAPI
gsapi_activate_path_control(void *instance, int enable);
GSDLLEXPORT int GSDLLAPI
gsapi_is_path_control_active(void *instance);
/* Details of gp_file can be found in gp.h.
* Users wanting to use this function should include
* that file. Not included here to avoid bloating the
* API inclusions for the majority of people who won't
* want it. */
#ifndef gp_file_name_sizeof
#define gp_file_name_sizeof 4096
#endif
typedef struct
{
int (*open_file)(const gs_memory_t *mem,
void *secret,
const char *fname,
const char *mode,
gp_file **file);
int (*open_pipe)(const gs_memory_t *mem,
void *secret,
const char *fname,
char *rfname, /* 4096 bytes */
const char *mode,
gp_file **file);
int (*open_scratch)(const gs_memory_t *mem,
void *secret,
const char *prefix,
char *rfname, /* 4096 bytes */
const char *mode,
int rm,
gp_file **file);
int (*open_printer)(const gs_memory_t *mem,
void *secret,
char *fname, /* 4096 bytes */
int binary,
gp_file **file);
int (*open_handle)(const gs_memory_t *mem,
void *secret,
char *fname, /* 4096 bytes */
const char *mode,
gp_file **file);
} gsapi_fs_t;
GSDLLEXPORT int GSDLLAPI
gsapi_add_fs(void *instance, gsapi_fs_t *fs, void *secret);
GSDLLEXPORT void GSDLLAPI
gsapi_remove_fs(void *instance, gsapi_fs_t *fs, void *secret);
/* function prototypes */
typedef int (GSDLLAPIPTR PFN_gsapi_revision)(
gsapi_revision_t *pr, int len);
typedef int (GSDLLAPIPTR PFN_gsapi_new_instance)(
void **pinstance, void *caller_handle);
typedef void (GSDLLAPIPTR PFN_gsapi_delete_instance)(
void *instance);
typedef int (GSDLLAPIPTR PFN_gsapi_set_stdio)(void *instance,
int (GSDLLCALLPTR stdin_fn)(void *caller_handle, char *buf, int len),
int (GSDLLCALLPTR stdout_fn)(void *caller_handle, const char *str, int len),
int (GSDLLCALLPTR stderr_fn)(void *caller_handle, const char *str, int len));
typedef int (GSDLLAPIPTR PFN_gsapi_set_poll)(void *instance,
int(GSDLLCALLPTR poll_fn)(void *caller_handle));
typedef int (GSDLLAPIPTR PFN_gsapi_set_display_callback)(
void *instance, display_callback *callback);
typedef int (GSDLLAPIPTR PFN_gsapi_set_default_device_list)(
void *instance, char *list, int listlen);
typedef int (GSDLLAPIPTR PFN_gsapi_get_default_device_list)(
void *instance, char **list, int *listlen);
typedef int (GSDLLAPIPTR PFN_gsapi_init_with_args)(
void *instance, int argc, char **argv);
#ifdef __WIN32__
typedef int (GSDLLAPIPTR PFN_gsapi_init_with_argsA)(
void *instance, int argc, char **argv);
typedef int (GSDLLAPIPTR PFN_gsapi_init_with_argsW)(
void *instance, int argc, wchar_t **argv);
#endif
typedef int (GSDLLAPIPTR PFN_gsapi_set_arg_encoding)(
void *instance, int encoding);
typedef int (GSDLLAPIPTR PFN_gsapi_run_string_begin)(
void *instance, int user_errors, int *pexit_code);
typedef int (GSDLLAPIPTR PFN_gsapi_run_string_continue)(
void *instance, const char *str, unsigned int length,
int user_errors, int *pexit_code);
typedef int (GSDLLAPIPTR PFN_gsapi_run_string_end)(
void *instance, int user_errors, int *pexit_code);
typedef int (GSDLLAPIPTR PFN_gsapi_run_string_with_length)(
void *instance, const char *str, unsigned int length,
int user_errors, int *pexit_code);
typedef int (GSDLLAPIPTR PFN_gsapi_run_string)(
void *instance, const char *str,
int user_errors, int *pexit_code);
typedef int (GSDLLAPIPTR PFN_gsapi_run_file)(void *instance,
const char *file_name, int user_errors, int *pexit_code);
#ifdef __WIN32__
typedef int (GSDLLAPIPTR PFN_gsapi_run_fileA)(void *instance,
const char *file_name, int user_errors, int *pexit_code);
typedef int (GSDLLAPIPTR PFN_gsapi_run_fileW)(void *instance,
const wchar_t *file_name, int user_errors, int *pexit_code);
#endif
typedef int (GSDLLAPIPTR PFN_gsapi_exit)(void *instance);
typedef int (GSDLLAPIPTR PFN_gsapi_set_param)(void *instance, const char *param, const void *value, gs_set_param_type type);
typedef int (GSDLLAPIPTR PFN_gsapi_add_control_path)(void *instance, int type, const char *path);
typedef int (GSDLLAPIPTR PFN_gsapi_remove_control_path)(void *instance, int type, const char *path);
typedef void (GSDLLAPIPTR PFN_gsapi_purge_control_paths)(void *instance, int type);
typedef void (GSDLLAPIPTR PFN_gsapi_activate_path_control)(void *instance, int enable);
typedef int (GSDLLAPIPTR PFN_gsapi_is_path_control_active)(void *instance);
typedef int (GSDLLAPIPTR PFN_gsapi_add_fs)(void *instance, gsapi_fs_t *fs, void *secret);
typedef void (GSDLLAPIPTR PFN_gsapi_remove_fs)(void *instance, gsapi_fs_t *fs, void *secret);
#ifdef __MACOS__
#pragma export off
#endif
#ifdef __cplusplus
} /* extern 'C' protection */
#endif
#endif /* iapi_INCLUDED */
@@ -0,0 +1,72 @@
/* Copyright (C) 2001-2023 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
implied.
This software is distributed under license and may not be copied,
modified or distributed except as expressly authorized under the terms
of the license contained in the file LICENSE in this distribution.
Refer to licensing information at http://www.artifex.com or contact
Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
CA 94129, USA, for further information.
*/
/* Definition of error codes */
#ifndef ierrors_INCLUDED
# define ierrors_INCLUDED
#include "gserrors.h"
/*
* DO NOT USE THIS FILE IN THE GRAPHICS LIBRARY.
* THIS FILE IS PART OF THE POSTSCRIPT INTERPRETER.
* USE gserrors.h IN THE LIBRARY.
*/
/*
* A procedure that may return an error always returns
* a non-negative value (zero, unless otherwise noted) for success,
* or negative for failure.
* We use ints rather than an enum to avoid a lot of casting.
*/
/* Define the error name table */
extern const char *const gs_error_names[];
/* ------ PostScript Level 1 errors ------ */
#define LEVEL1_ERROR_NAMES\
"unknownerror", "dictfull", "dictstackoverflow", "dictstackunderflow",\
"execstackoverflow", "interrupt", "invalidaccess", "invalidexit",\
"invalidfileaccess", "invalidfont", "invalidrestore", "ioerror",\
"limitcheck", "nocurrentpoint", "rangecheck", "stackoverflow",\
"stackunderflow", "syntaxerror", "timeout", "typecheck", "undefined",\
"undefinedfilename", "undefinedresult", "unmatchedmark", "VMerror"
/* ------ Additional Level 2 errors (also in DPS) ------ */
#define LEVEL2_ERROR_NAMES\
"configurationerror", "undefinedresource", "unregistered"
/* ------ Additional DPS errors ------ */
#define DPS_ERROR_NAMES\
"invalidcontext", "invalidid"
#define PDF_ERROR_NAMES\
"pdf_stackoverflow", "pdf_circular_reference"
#define ERROR_NAMES\
LEVEL1_ERROR_NAMES, LEVEL2_ERROR_NAMES, DPS_ERROR_NAMES, PDF_ERROR_NAMES
/*
* Define which error codes require re-executing the current object.
*/
#define GS_ERROR_IS_INTERRUPT(ecode)\
((ecode) == gs_error_interrupt || (ecode) == gs_error_timeout)
#endif /* ierrors_INCLUDED */
@@ -0,0 +1,3 @@
#pragma once
#include "iapi.h"
#include "ierrors.h"
@@ -0,0 +1,129 @@
/* Copyright (C) 2001-2026 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
implied.
This software is distributed under license and may not be copied,
modified or distributed except as expressly authorized under the terms
of the license contained in the file LICENSE in this distribution.
Refer to licensing information at http://www.artifex.com or contact
Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
CA 94129, USA, for further information.
*/
#ifndef gscdefs_INCLUDED
# define gscdefs_INCLUDED
/* This comment, the delimiting comments below, and the lines of
* source code between the delimiting comments may not be altered,
* replaced, changed, or otherwise modified for the purpose of
* misrepresenting the origin of works generated using this
* software.
*
* The supplemental term above has been added in accordance with
* Section 7(b) of the Affero General Public License version 3.
*/
/* BEGIN -- CHANGES RESTRICTED UNDER 7(b) */
/* If we are cluster testing, then we want to nobble stuff
* that might change between versions. */
#ifdef CLUSTER
#undef GS_PRODUCTFAMILY
#define GS_PRODUCTFAMILY "GPL Ghostscript"
#undef GS_PRODUCT
#define GS_PRODUCT GS_PRODUCTFAMILY
#else
/* def GS_PRODFAM */
# define GS_PRODUCTFAMILY\
"GPL Ghostscript"
/* end def GS_PRODFAM */
/* def GS_PROD */
# define GS_PRODUCT\
GS_PRODUCTFAMILY " GIT PRERELEASE"
/* end def GS_PROD */
#endif
/* END -- CHANGES RESTRICTED UNDER 7(b) */
#define GS_STRINGIZE2(s) #s
#define GS_STRINGIZE(s) GS_STRINGIZE2(s)
#ifndef GS_BUILDTIME
# define GS_BUILDTIME\
0 /* should be set in the makefile */
#endif
#ifndef GS_COPYRIGHT
# define GS_COPYRIGHT\
"Copyright (C) 2026 Artifex Software, Inc. All rights reserved."
#endif
/* Prototypes for configuration definitions in gconfig.c. */
/*
* This file may be #included in places that don't even have stdpre.h,
* so it mustn't use any Ghostscript definitions in any code that is
* actually processed here (as opposed to being part of a macro
* definition).
*/
/* Miscellaneous system constants (read-only systemparams). */
extern const long gs_buildtime;
extern const char *const gs_copyright;
extern const char *const gs_product;
extern const char *const gs_productfamily;
extern const long gs_revision;
extern const long gs_revisiondate;
extern const long gs_serialnumber;
/* Installation directories and files */
extern const char *const gs_doc_directory;
extern const char *const gs_lib_default_path;
extern const char *const gs_init_file;
extern const char *const gs_dev_defaults;
/* Resource tables. In order to avoid importing a large number of types, */
/* we only provide macros for some externs, not the externs themselves. */
#define extern_gx_device_halftone_list()\
typedef DEVICE_HALFTONE_RESOURCE_PROC((*gx_dht_proc));\
extern const gx_dht_proc gx_device_halftone_list[]
#define extern_gx_image_class_table()\
extern const gx_image_class_t gx_image_class_table[]
extern const unsigned gx_image_class_table_count;
#define extern_gx_image_type_table()\
extern const gx_image_type_t * const gx_image_type_table[]
extern const unsigned gx_image_type_table_count;
/* We need the extra typedef so that the const will apply to the table. */
#define extern_gx_init_table()\
typedef init_proc((*gx_init_proc));\
extern const gx_init_proc gx_init_table[]
#define extern_gx_io_device_table()\
extern const gx_io_device * const gx_io_device_table[]
extern const unsigned gx_io_device_table_count;
/* Return the list of device prototypes, a NULL list of their structure */
/* descriptors (no longer used), and (as the value) the length of the lists. */
#define extern_gs_lib_device_list()\
int gs_lib_device_list(const gx_device * const **plist,\
gs_memory_struct_type_t **pst)
/* find a compositor by name */
#define extern_gs_find_compositor() \
const gs_composite_type_t * gs_find_compositor(int comp_id)
#define extern_gs_get_fapi_server_inits() \
const gs_fapi_server_init_func * gs_get_fapi_server_inits(void)
#endif /* gscdefs_INCLUDED */
@@ -0,0 +1,104 @@
/* Copyright (C) 2001-2023 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
implied.
This software is distributed under license and may not be copied,
modified or distributed except as expressly authorized under the terms
of the license contained in the file LICENSE in this distribution.
Refer to licensing information at http://www.artifex.com or contact
Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
CA 94129, USA, for further information.
*/
/* This interface is deprecated and will be removed in future
* ghostscript releases. Use the interface described in
* API.htm and iapi.h.
*/
#ifndef gsdll_INCLUDED
# define gsdll_INCLUDED
#include "iapi.h"
#include "windows_.h"
#ifdef __MACOS__
#define HWND char *
#include <QDOffscreen.h>
#pragma export on
#endif
#ifdef __WINDOWS__
#define _Windows
#endif
#ifdef __IBMC__
#define GSDLLCALLLINK _System
#else
#define GSDLLCALLLINK
#endif
/* global pointer to callback */
typedef int (* GSDLLCALLLINK GSDLL_CALLBACK) (int, char *, unsigned long);
extern GSDLL_CALLBACK pgsdll_callback;
/* message values for callback */
#define GSDLL_STDIN 1 /* get count characters to str from stdin */
/* return number of characters read */
#define GSDLL_STDOUT 2 /* put count characters from str to stdout */
/* return number of characters written */
#define GSDLL_DEVICE 3 /* device = str has been opened if count=1 */
/* or closed if count=0 */
#define GSDLL_SYNC 4 /* sync_output for device str */
#define GSDLL_PAGE 5 /* output_page for device str */
#define GSDLL_SIZE 6 /* resize for device str */
/* LOWORD(count) is new xsize */
/* HIWORD(count) is new ysize */
#define GSDLL_POLL 7 /* Called from gp_check_interrupt */
/* Can be used by caller to poll the message queue */
/* Normally returns 0 */
/* To abort gsdll_execute_cont(), return a */
/* non zero error code until gsdll_execute_cont() */
/* returns */
/* return values from gsdll_init() */
#define GSDLL_INIT_IN_USE 100 /* DLL is in use */
#define GSDLL_INIT_QUIT 101 /* quit or EOF during init */
/* This is not an error. */
/* gsdll_exit() must not be called */
/* DLL exported functions */
/* for load time dynamic linking */
GSDLLEXPORT int GSDLLAPI gsdll_revision(const char * * product, const char * * copyright, long * gs_revision, long * gs_revisiondate);
GSDLLEXPORT int GSDLLAPI gsdll_init(GSDLL_CALLBACK callback, HWND hwnd, int argc, char * * argv);
GSDLLEXPORT int GSDLLAPI gsdll_execute_begin(void);
GSDLLEXPORT int GSDLLAPI gsdll_execute_cont(const char * str, int len);
GSDLLEXPORT int GSDLLAPI gsdll_execute_end(void);
GSDLLEXPORT int GSDLLAPI gsdll_exit(void);
GSDLLEXPORT int GSDLLAPI gsdll_lock_device(unsigned char *device, int flag);
/* Function pointer typedefs */
/* for run time dynamic linking */
typedef int (GSDLLAPIPTR PFN_gsdll_revision)(const char ** product,
const char ** copyright, long * revision, long * revisiondate);
typedef int (GSDLLAPIPTR PFN_gsdll_init) (GSDLL_CALLBACK, HWND, int argc, char * * argv);
typedef int (GSDLLAPIPTR PFN_gsdll_init_with_encoding) (GSDLL_CALLBACK, HWND, int argc, char * * argv, int encoding);
#ifdef __WIN32__
typedef int (GSDLLAPIPTR PFN_gsdll_initA) (GSDLL_CALLBACK, HWND, int argc, char * * argv);
typedef int (GSDLLAPIPTR PFN_gsdll_initW) (GSDLL_CALLBACK, HWND, int argc, wchar_t * * argv);
#endif
typedef int (GSDLLAPIPTR PFN_gsdll_execute_begin) (void);
typedef int (GSDLLAPIPTR PFN_gsdll_execute_cont) (const char * str, int len);
typedef int (GSDLLAPIPTR PFN_gsdll_execute_end) (void);
typedef int (GSDLLAPIPTR PFN_gsdll_exit) (void);
typedef int (GSDLLAPIPTR PFN_gsdll_lock_device) (unsigned char *, int);
#ifdef __MACOS__
#pragma export off
#endif
#endif /* gsdll_INCLUDED */
@@ -0,0 +1,280 @@
/* Copyright (C) 2001-2023 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
implied.
This software is distributed under license and may not be copied,
modified or distributed except as expressly authorized under the terms
of the license contained in the file LICENSE in this distribution.
Refer to licensing information at http://www.artifex.com or contact
Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
CA 94129, USA, for further information.
*/
/* Error code definitions */
#ifndef gserrors_INCLUDED
# define gserrors_INCLUDED
/* A procedure that may return an error always returns */
/* a non-negative value (zero, unless otherwise noted) for success, */
/* or negative for failure. */
/* We don't use a typedef internally to avoid a lot of casting. */
enum gs_error_type {
gs_error_ok = 0,
gs_error_unknownerror = -1, /* unknown error */
gs_error_dictfull = -2,
gs_error_dictstackoverflow = -3,
gs_error_dictstackunderflow = -4,
gs_error_execstackoverflow = -5,
gs_error_interrupt = -6,
gs_error_invalidaccess = -7,
gs_error_invalidexit = -8,
gs_error_invalidfileaccess = -9,
gs_error_invalidfont = -10,
gs_error_invalidrestore = -11,
gs_error_ioerror = -12,
gs_error_limitcheck = -13,
gs_error_nocurrentpoint = -14,
gs_error_rangecheck = -15,
gs_error_stackoverflow = -16,
gs_error_stackunderflow = -17,
gs_error_syntaxerror = -18,
gs_error_timeout = -19,
gs_error_typecheck = -20,
gs_error_undefined = -21,
gs_error_undefinedfilename = -22,
gs_error_undefinedresult = -23,
gs_error_unmatchedmark = -24,
gs_error_VMerror = -25, /* must be the last Level 1 error */
/* ------ Additional Level 2 errors (also in DPS, ------ */
gs_error_configurationerror = -26,
gs_error_undefinedresource = -27,
gs_error_unregistered = -28,
gs_error_invalidcontext = -29,
/* invalidid is for the NeXT DPS extension. */
gs_error_invalidid = -30,
/* We need a specific stackoverflow error for the PDF interpreter to avoid dropping into
* the Postscript interpreter's stack extending code, when the PDF interpreter is called from
* Postscript
*/
gs_error_pdf_stackoverflow = -31,
/* Internal error for the C-based PDF interpreter, to indicate a circular PDF reference */
gs_error_circular_reference = -32,
/* ------ Pseudo-errors used internally ------ */
gs_error_hit_detected = -99,
gs_error_Fatal = -100,
/*
* Internal code for the .quit operator.
* The real quit code is an integer on the operand stack.
* gs_interpret returns this only for a .quit with a zero exit code.
*/
gs_error_Quit = -101,
/*
* Internal code for a normal exit from the interpreter.
* Do not use outside of interp.c.
*/
gs_error_InterpreterExit = -102,
/* Need the remap color error for high level pattern support */
gs_error_Remap_Color = -103,
/*
* Internal code to indicate we have underflowed the top block
* of the e-stack.
*/
gs_error_ExecStackUnderflow = -104,
/*
* Internal code for the vmreclaim operator with a positive operand.
* We need to handle this as an error because otherwise the interpreter
* won't reload enough of its state when the operator returns.
*/
gs_error_VMreclaim = -105,
/*
* Internal code for requesting more input from run_string.
*/
gs_error_NeedInput = -106,
/*
* Internal code to all run_string to request that the data is rerun
* using run_file.
*/
gs_error_NeedFile = -107,
/*
* Internal code for a normal exit when usage info is displayed.
* This allows Window versions of Ghostscript to pause until
* the message can be read.
*/
gs_error_Info = -110,
/* A special 'error', like reamp color above. This is used by a subclassing
* device to indicate that it has fully processed a device method, and parent
* subclasses should not perform any further action. Currently this is limited
* to compositor creation.
*/
gs_error_handled = -111,
};
/* We do provide a typedef type for external API use */
typedef enum gs_error_type gs_error_t;
int gs_log_error(int, const char *, int);
#if !defined(DEBUG)
# define gs_log_error(err, file, line) (err)
#endif
#define gs_note_error(err) gs_log_error(err, __FILE__, __LINE__)
#define return_error(err) return gs_note_error(err)
#if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901L
# if defined(__GNUC__) && __GNUC__ >= 2
# define __func__ __FUNCTION__
# elif defined(__FUNCTION__)
# define __func__ __FUNCTION__
# elif defined(__FUNC__)
# define __func__ __FUNC__
# else
# define __func__ "<unknown>"
# endif
#endif
/*
* Error reporting macros.
*
*/
#ifndef __printflike
#if __GNUC__ > 2 || __GNUC__ == 2 && __GNUC_MINOR__ >= 7
#define __printflike(fmtarg, firstvararg) \
__attribute__((__format__ (__printf__, fmtarg, firstvararg)))
#else
#define __printflike(fmtarg, firstvararg)
#endif
#endif
const char *gs_errstr(int code);
int gs_throw_imp(const char *func, const char *file, int line,
int op, int code, const char *fmt, ...) __attribute__((__format__(__printf__, 6, 7)));
/* Use throw at origin of error
*/
#define gs_throw_code(code) \
gs_throw1((code), "%s", gs_errstr((code)))
#define gs_throw(code, fmt) \
gs_throw_imp(__func__, __FILE__, __LINE__, 0, code, fmt)
#define gs_throw1(code, fmt, arg1) \
gs_throw_imp(__func__, __FILE__, __LINE__, 0, code, fmt, arg1)
#define gs_throw2(code, fmt, arg1, arg2) \
gs_throw_imp(__func__, __FILE__, __LINE__, 0, code, fmt, arg1, arg2)
#define gs_throw3(code, fmt, arg1, arg2, arg3) \
gs_throw_imp(__func__, __FILE__, __LINE__, 0, code, fmt, arg1, arg2, arg3)
#define gs_throw4(code, fmt, arg1, arg2, arg3, arg4) \
gs_throw_imp(__func__, __FILE__, __LINE__, 0, code, fmt, arg1, arg2, arg3, arg4)
#define gs_throw5(code, fmt, arg1, arg2, arg3, arg4, arg5) \
gs_throw_imp(__func__, __FILE__, __LINE__, 0, code, fmt, arg1, arg2, arg3, arg4, arg5)
#define gs_throw6(code, fmt, arg1, arg2, arg3, arg4, arg5, arg6) \
gs_throw_imp(__func__, __FILE__, __LINE__, 0, code, fmt, arg1, arg2, arg3, arg4, arg5, arg6)
#define gs_throw7(code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7) \
gs_throw_imp(__func__, __FILE__, __LINE__, 0, code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7)
#define gs_throw8(code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) \
gs_throw_imp(__func__, __FILE__, __LINE__, 0, code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8)
#define gs_throw9(code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) \
gs_throw_imp(__func__, __FILE__, __LINE__, 0, code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9)
/* Bubble the code up the stack
*/
#define gs_rethrow_code(code) \
gs_rethrow1((code), "%s", gs_errstr((code)))
#define gs_rethrow(code, fmt) \
gs_throw_imp(__func__, __FILE__, __LINE__, 1, code, fmt)
#define gs_rethrow1(code, fmt, arg1) \
gs_throw_imp(__func__, __FILE__, __LINE__, 1, code, fmt, arg1)
#define gs_rethrow2(code, fmt, arg1, arg2) \
gs_throw_imp(__func__, __FILE__, __LINE__, 1, code, fmt, arg1, arg2)
#define gs_rethrow3(code, fmt, arg1, arg2, arg3) \
gs_throw_imp(__func__, __FILE__, __LINE__, 1, code, fmt, arg1, arg2, arg3)
#define gs_rethrow4(code, fmt, arg1, arg2, arg3, arg4) \
gs_throw_imp(__func__, __FILE__, __LINE__, 1, code, fmt, arg1, arg2, arg3, arg4)
#define gs_rethrow5(code, fmt, arg1, arg2, arg3, arg4, arg5) \
gs_throw_imp(__func__, __FILE__, __LINE__, 1, code, fmt, arg1, arg2, arg3, arg4, arg5)
#define gs_rethrow6(code, fmt, arg1, arg2, arg3, arg4, arg5, arg6) \
gs_throw_imp(__func__, __FILE__, __LINE__, 1, code, fmt, arg1, arg2, arg3, arg4, arg5, arg6)
#define gs_rethrow7(code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7) \
gs_throw_imp(__func__, __FILE__, __LINE__, 1, code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7)
#define gs_rethrow8(code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) \
gs_throw_imp(__func__, __FILE__, __LINE__, 1, code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8)
#define gs_rethrow9(code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) \
gs_throw_imp(__func__, __FILE__, __LINE__, 1, code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9)
/* This will cause trouble, as it implies you are fixing an error
* the system will spew messages
*/
#define gs_catch(code, fmt) \
gs_throw_imp(__func__, __FILE__, __LINE__, 2, code, fmt)
#define gs_catch1(code, fmt, arg1) \
gs_throw_imp(__func__, __FILE__, __LINE__, 2, code, fmt, arg1)
#define gs_catch2(code, fmt, arg1, arg2) \
gs_throw_imp(__func__, __FILE__, __LINE__, 2, code, fmt, arg1, arg2)
#define gs_catch3(code, fmt, arg1, arg2, arg3) \
gs_throw_imp(__func__, __FILE__, __LINE__, 2, code, fmt, arg1, arg2, arg3)
#define gs_catch4(code, fmt, arg1, arg2, arg3, arg4) \
gs_throw_imp(__func__, __FILE__, __LINE__, 2, code, fmt, arg1, arg2, arg3, arg4)
#define gs_catch5(code, fmt, arg1, arg2, arg3, arg4, arg5) \
gs_throw_imp(__func__, __FILE__, __LINE__, 2, code, fmt, arg1, arg2, arg3, arg4, arg5)
#define gs_catch6(code, fmt, arg1, arg2, arg3, arg4, arg5, arg6) \
gs_throw_imp(__func__, __FILE__, __LINE__, 2, code, fmt, arg1, arg2, arg3, arg4, arg5, arg6)
#define gs_catch7(code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7) \
gs_throw_imp(__func__, __FILE__, __LINE__, 2, code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7)
#define gs_catch8(code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) \
gs_throw_imp(__func__, __FILE__, __LINE__, 2, code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8)
#define gs_catch9(code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) \
gs_throw_imp(__func__, __FILE__, __LINE__, 2, code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9)
/* gs_warn is a printf
*/
#define gs_warn(fmt) \
(void)gs_throw_imp(__func__, __FILE__, __LINE__, 3, 0, fmt)
#define gs_warn1(fmt, arg1) \
(void)gs_throw_imp(__func__, __FILE__, __LINE__, 3, 0, fmt, arg1)
#define gs_warn2(fmt, arg1, arg2) \
(void)gs_throw_imp(__func__, __FILE__, __LINE__, 3, 0, fmt, arg1, arg2)
#define gs_warn3(fmt, arg1, arg2, arg3) \
(void)gs_throw_imp(__func__, __FILE__, __LINE__, 3, 0, fmt, arg1, arg2, arg3)
#define gs_warn4(fmt, arg1, arg2, arg3, arg4) \
(void)gs_throw_imp(__func__, __FILE__, __LINE__, 3, 0, fmt, arg1, arg2, arg3, arg4)
#define gs_warn5(fmt, arg1, arg2, arg3, arg4, arg5) \
(void)gs_throw_imp(__func__, __FILE__, __LINE__, 3, 0, fmt, arg1, arg2, arg3, arg4, arg5)
#define gs_warn6(fmt, arg1, arg2, arg3, arg4, arg5, arg6) \
(void)gs_throw_imp(__func__, __FILE__, __LINE__, 3, 0, fmt, arg1, arg2, arg3, arg4, arg5, arg6)
#define gs_warn7(fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7) \
(void)gs_throw_imp(__func__, __FILE__, __LINE__, 3, 0, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7)
#define gs_warn8(fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) \
(void)gs_throw_imp(__func__, __FILE__, __LINE__, 3, 0, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8)
#define gs_warn9(fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) \
(void)gs_throw_imp(__func__, __FILE__, __LINE__, 3, 0, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9)
/* just in case you don't know 0 means no error
* other return codes are errors.
*/
#define gs_okay 0
#endif /* gserrors_INCLUDED */
@@ -0,0 +1,574 @@
/* Copyright (C) 2001-2023 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
implied.
This software is distributed under license and may not be copied,
modified or distributed except as expressly authorized under the terms
of the license contained in the file LICENSE in this distribution.
Refer to licensing information at http://www.artifex.com or contact
Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
CA 94129, USA, for further information.
*/
/*
* Public API for Ghostscript interpreter
* for use both as DLL and for static linking.
*
* Should work for Windows, OS/2, Linux, Mac.
*
* DLL exported functions should be as similar as possible to imain.c
* You will need to include "ierrors.h".
*
* Current problems:
* 1. Ghostscript does not support multiple instances.
* 2. Global variables in gs_main_instance_default()
* and gsapi_instance_counter
*/
/* Exported functions may need different prefix
* GSDLLEXPORT marks functions as exported
* GSDLLAPI is the calling convention used on functions exported
* by Ghostscript
* GSDLLCALL is used on callback functions called by Ghostscript
* When you include this header file in the caller, you may
* need to change the definitions by defining these
* before including this header file.
* Make sure you get the calling convention correct, otherwise your
* program will crash either during callbacks or soon after returning
* due to stack corruption.
*/
#ifndef iapi_INCLUDED
# define iapi_INCLUDED
#ifdef __cplusplus
extern "C" {
#endif
#if defined(_WINDOWS_) || defined(__WINDOWS__)
# ifndef _Windows
# define _Windows
# endif
#endif
#ifdef _Windows
# ifndef GSDLLEXPORT
/* We don't need both the "__declspec(dllexport)" declaration
* and the listing in the .def file - having both results in
* a linker warning on x64 builds (but is incorrect on x86, too)
*/
# if 0
# define GSDLLEXPORT __declspec(dllexport)
# else
# define GSDLLEXPORT
# endif
# endif
# ifdef __MINGW32__
/* export stdcall functions as "name" instead of "_name@ordinal" */
# undef GSDLLAPI
# define GSDLLAPI
# endif
# ifndef GSDLLAPI
# define GSDLLAPI __stdcall
# endif
# ifndef GSDLLCALL
# define GSDLLCALL __stdcall
# endif
#endif /* _Windows */
#if defined(OS2) && defined(__IBMC__)
# ifndef GSDLLAPI
# define GSDLLAPI _System
# endif
# ifndef GSDLLCALL
# define GSDLLCALL _System
# endif
#endif /* OS2 && __IBMC */
#ifdef __MACOS__
# pragma export on
#endif
#ifndef GSDLLEXPORT
# ifdef __GNUC__
# define GSDLLEXPORT __attribute__ ((visibility ("default")))
# else
# define GSDLLEXPORT
# endif
#endif
#ifndef GSDLLAPI
# define GSDLLAPI
#endif
#ifndef GSDLLCALL
# define GSDLLCALL
#endif
#if defined(__IBMC__)
# define GSDLLAPIPTR * GSDLLAPI
# define GSDLLCALLPTR * GSDLLCALL
#else
# define GSDLLAPIPTR GSDLLAPI *
# define GSDLLCALLPTR GSDLLCALL *
#endif
#ifndef display_callback_DEFINED
# define display_callback_DEFINED
typedef struct display_callback_s display_callback;
#endif
#ifndef gs_memory_DEFINED
# define gs_memory_DEFINED
typedef struct gs_memory_s gs_memory_t;
#endif
#ifndef gp_file_DEFINED
# define gp_file_DEFINED
typedef struct gp_file_s gp_file;
#endif
typedef struct gsapi_revision_s {
const char *product;
const char *copyright;
long revision;
long revisiondate;
} gsapi_revision_t;
/* Get version numbers and strings.
* This is safe to call at any time.
* You should call this first to make sure that the correct version
* of the Ghostscript is being used.
* pr is a pointer to a revision structure.
* len is the size of this structure in bytes.
* Returns 0 if OK, or if len too small (additional parameters
* have been added to the structure) it will return the required
* size of the structure.
*/
GSDLLEXPORT int GSDLLAPI
gsapi_revision(gsapi_revision_t *pr, int len);
/*
* WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
* On non-threading capable platforms, Ghostscript supports only
* one instance. The current implementation uses a global static
* instance counter to make sure that only a single instance is
* used. If you try to create two instances, the second attempt
* will return < 0 and set pinstance to NULL.
* WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
*/
/* Create a new instance of Ghostscript.
* This instance is passed to most other API functions.
* The caller_handle will be provided to callback functions.
*/
GSDLLEXPORT int GSDLLAPI
gsapi_new_instance(void **pinstance, void *caller_handle);
/*
* WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
* On non-threading capable platforms, Ghostscript supports only
* one instance. The current implementation uses a global static
* instance counter to make sure that only a single instance is
* used.
* WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
*/
/* Destroy an instance of Ghostscript
* Before you call this, Ghostscript must have finished.
* If Ghostscript has been initialised, you must call gsapi_exit()
* before gsapi_delete_instance.
*/
GSDLLEXPORT void GSDLLAPI
gsapi_delete_instance(void *instance);
/* Set the callback functions for stdio
* The stdin callback function should return the number of
* characters read, 0 for EOF, or -1 for error.
* The stdout and stderr callback functions should return
* the number of characters written.
* If a callback address is NULL, the real stdio will be used.
*/
GSDLLEXPORT int GSDLLAPI
gsapi_set_stdio(void *instance,
int (GSDLLCALLPTR stdin_fn)(void *caller_handle, char *buf, int len),
int (GSDLLCALLPTR stdout_fn)(void *caller_handle, const char *str, int len),
int (GSDLLCALLPTR stderr_fn)(void *caller_handle, const char *str, int len));
/* Does the same as the above, but using the caller_handle given here,
* rather than the default one specified at gsapi_new_instance time. */
GSDLLEXPORT int GSDLLAPI
gsapi_set_stdio_with_handle(void *instance,
int (GSDLLCALLPTR stdin_fn)(void *caller_handle, char *buf, int len),
int (GSDLLCALLPTR stdout_fn)(void *caller_handle, const char *str, int len),
int (GSDLLCALLPTR stderr_fn)(void *caller_handle, const char *str, int len),
void *caller_handle);
/* Set the callback function for polling.
* This is used for handling window events or cooperative
* multitasking. This function will only be called if
* Ghostscript was compiled with CHECK_INTERRUPTS
* as described in gpcheck.h.
* The polling function should return 0 if all is well,
* and negative if it wants ghostscript to abort.
* The polling function must be fast.
*/
GSDLLEXPORT int GSDLLAPI gsapi_set_poll(void *instance,
int (GSDLLCALLPTR poll_fn)(void *caller_handle));
/* Does the same as the above, but using the caller_handle given here,
* rather than the default one specified at gsapi_new_instance time. */
GSDLLEXPORT int GSDLLAPI gsapi_set_poll_with_handle(void *instance,
int (GSDLLCALLPTR poll_fn)(void *caller_handle), void *caller_handle);
/* Set the display device callback structure.
* If the display device is used, this must be called
* after gsapi_new_instance() and before gsapi_init_with_args().
* See gdevdisp.h for more details.
* DEPRECATED: Use the gsapi_register_callback mechanism instead.
*/
GSDLLEXPORT int GSDLLAPI gsapi_set_display_callback(
void *instance, display_callback *callback);
/* The callout mechanism allows devices to query "callers" (users of the
* DLL) in device specific ways. The callout function pointer type will
* be called with:
* callout_handle = the value given at registration
* device_name = the name of the current device
* id = An integer, guaranteed to be unique within the
* callouts from a given device, identifying the
* purpose of this call.
* size = device/id specific, but typically the size of 'data'.
* data = device/id specific, but typically the pointer to
* an in/out data block.
* Returns an error code (gs_error_unknownerror (-1) if unclaimed,
* non-negative on success, standard gs error numbers recommended).
*/
typedef int (*gs_callout)(void *instance,
void *callout_handle,
const char *device_name,
int id,
int size,
void *data);
/* Register a handler for gs callouts.
* This must be called after gsapi_new_instance() and (typically)
* before gsapi_init_with_args().
*/
GSDLLEXPORT int GSDLLAPI gsapi_register_callout(
void *instance, gs_callout callout, void *callout_handle);
/* Deregister a handler for gs callouts. */
GSDLLEXPORT void GSDLLAPI gsapi_deregister_callout(
void *instance, gs_callout callout, void *callout_handle);
/* Set the string containing the list of default device names
* for example "display x11alpha x11 bbox". Allows the calling
* application to influence which device(s) gs will try in order
* to select the default device
*
* *Must* be called after gsapi_new_instance() and before
* gsapi_init_with_args().
*/
GSDLLEXPORT int GSDLLAPI
gsapi_set_default_device_list(void *instance, const char *list, int listlen);
/* Returns a pointer to the current default device string
* *Must* be called after gsapi_new_instance().
*/
GSDLLEXPORT int GSDLLAPI
gsapi_get_default_device_list(void *instance, char **list, int *listlen);
/* Set the encoding used for the args. By default we assume
* 'local' encoding. For windows this equates to whatever the current
* codepage is. For linux this is utf8.
*
* Use of this API (gsapi) with 'local' encodings (and hence without calling
* this function) is now deprecated!
*/
GSDLLEXPORT int GSDLLAPI gsapi_set_arg_encoding(void *instance,
int encoding);
enum {
GS_ARG_ENCODING_LOCAL = 0,
GS_ARG_ENCODING_UTF8 = 1,
GS_ARG_ENCODING_UTF16LE = 2
};
/* Initialise the interpreter.
* This calls gs_main_init_with_args() in imainarg.c
* 1. If quit or EOF occur during gsapi_init_with_args(),
* the return value will be gs_error_Quit. This is not an error.
* You must call gsapi_exit() and must not call any other
* gsapi_XXX functions.
* 2. If usage info should be displayed, the return value will be gs_error_Info
* which is not an error. Do not call gsapi_exit().
* 3. Under normal conditions this returns 0. You would then
* call one or more gsapi_run_*() functions and then finish
* with gsapi_exit().
*/
GSDLLEXPORT int GSDLLAPI gsapi_init_with_args(void *instance,
int argc, char **argv);
#ifdef __WIN32__
GSDLLEXPORT int GSDLLAPI gsapi_init_with_argsA(void *instance,
int argc, char **argv);
GSDLLEXPORT int GSDLLAPI gsapi_init_with_argsW(void *instance,
int argc, wchar_t **argv);
#endif
/*
* The gsapi_run_* functions are like gs_main_run_* except
* that the error_object is omitted.
* If these functions return <= -100, either quit or a fatal
* error has occured. You then call gsapi_exit() next.
* The only exception is gsapi_run_string_continue()
* which will return gs_error_NeedInput if all is well.
*/
GSDLLEXPORT int GSDLLAPI
gsapi_run_string_begin(void *instance,
int user_errors, int *pexit_code);
GSDLLEXPORT int GSDLLAPI
gsapi_run_string_continue(void *instance,
const char *str, unsigned int length, int user_errors, int *pexit_code);
GSDLLEXPORT int GSDLLAPI
gsapi_run_string_end(void *instance,
int user_errors, int *pexit_code);
GSDLLEXPORT int GSDLLAPI
gsapi_run_string_with_length(void *instance,
const char *str, unsigned int length, int user_errors, int *pexit_code);
GSDLLEXPORT int GSDLLAPI
gsapi_run_string(void *instance,
const char *str, int user_errors, int *pexit_code);
GSDLLEXPORT int GSDLLAPI
gsapi_run_file(void *instance,
const char *file_name, int user_errors, int *pexit_code);
#ifdef __WIN32__
GSDLLEXPORT int GSDLLAPI
gsapi_run_fileA(void *instance,
const char *file_name, int user_errors, int *pexit_code);
GSDLLEXPORT int GSDLLAPI
gsapi_run_fileW(void *instance,
const wchar_t *file_name, int user_errors, int *pexit_code);
#endif
/* Exit the interpreter.
* This must be called on shutdown if gsapi_init_with_args()
* has been called, and just before gsapi_delete_instance().
*/
GSDLLEXPORT int GSDLLAPI
gsapi_exit(void *instance);
typedef enum {
gs_spt_invalid = -1,
gs_spt_null = 0, /* void * is NULL */
gs_spt_bool = 1, /* void * is a pointer to an int (0 false,
* non-zero true). */
gs_spt_int = 2, /* void * is a pointer to an int */
gs_spt_float = 3, /* void * is a float * */
gs_spt_name = 4, /* void * is a char * */
gs_spt_string = 5, /* void * is a char * */
gs_spt_long = 6, /* void * is a long * */
gs_spt_i64 = 7, /* void * is an int64_t * */
gs_spt_size_t = 8, /* void * is a size_t * */
gs_spt_parsed = 9, /* void * is a pointer to a char * to be parsed */
/* Setting a typed param causes it to be instantly fed to to the
* device. This can cause the device to reinitialise itself. Hence,
* setting a sequence of typed params can cause the device to reset
* itself several times. Accordingly, if you OR the type with
* gs_spt_more_to_come, the param will held ready to be passed into
* the device, and will only actually be sent when the next typed
* param is set without this flag (or on device init). Not valid
* for get_typed_param. */
gs_spt_more_to_come = 1<<31
} gs_set_param_type;
/* gs_spt_parsed allows for a string such as "<< /Foo 0 /Bar true >>" or
* "[ 1 2 3 ]" etc to be used so more complex parameters can be set. */
GSDLLEXPORT int GSDLLAPI gsapi_set_param(void *instance, const char *param, const void *value, gs_set_param_type type);
/* Called to get a value. value points to storage of the appropriate
* type. If value is passed as NULL on entry, then the return code is
* the number of bytes storage required for the type. Thus to read a
* name/string/parsed value, call once with value=NULL, then obtain
* the storage, and call again with value=the storage to get a nul
* terminated string. (nul terminator is included in the count - hence
* an empty string requires 1 byte storage). Returns gs_error_undefined
* (-21) if not found. */
GSDLLEXPORT int GSDLLAPI gsapi_get_param(void *instance, const char *param, void *value, gs_set_param_type type);
/* Enumerator to list all the parameters.
* Caller defines void *iter = NULL, and calls with &iter.
* Each call, iter is updated to reflect the position within the
* enumeration, so passing iterator back in gets the next key. The call
* returns negative values for errors, 0 for success, and 1 for "no more
* keys".
*
* void *iter = NULL;
* gs_set_param_type type;
* const char *key;
* int code;
* while ((code = gsapi_enumerate_params(inst, &iter, &key, &type)) == 0) {
* // Process key
* }
*
* Note that the ordering of enumerations is NOT defined. key is valid
* until the next call to gsapi_enumerate_params. Only one enumeration
* at a time (starting a new enumeration will invalidate any previous
* enumeration).
*/
GSDLLEXPORT int GSDLLAPI gsapi_enumerate_params(void *instance, void **iterator, const char **key, gs_set_param_type *type);
enum {
GS_PERMIT_FILE_READING = 0,
GS_PERMIT_FILE_WRITING = 1,
GS_PERMIT_FILE_CONTROL = 2
};
/* Add a path to one of the sets of permitted paths. */
GSDLLEXPORT int GSDLLAPI
gsapi_add_control_path(void *instance, int type, const char *path);
/* Remove a path from one of the sets of permitted paths. */
GSDLLEXPORT int GSDLLAPI
gsapi_remove_control_path(void *instance, int type, const char *path);
/* Purge all the paths from the one of the sets of permitted paths. */
GSDLLEXPORT void GSDLLAPI
gsapi_purge_control_paths(void *instance, int type);
GSDLLEXPORT void GSDLLAPI
gsapi_activate_path_control(void *instance, int enable);
GSDLLEXPORT int GSDLLAPI
gsapi_is_path_control_active(void *instance);
/* Details of gp_file can be found in gp.h.
* Users wanting to use this function should include
* that file. Not included here to avoid bloating the
* API inclusions for the majority of people who won't
* want it. */
#ifndef gp_file_name_sizeof
#define gp_file_name_sizeof 4096
#endif
typedef struct
{
int (*open_file)(const gs_memory_t *mem,
void *secret,
const char *fname,
const char *mode,
gp_file **file);
int (*open_pipe)(const gs_memory_t *mem,
void *secret,
const char *fname,
char *rfname, /* 4096 bytes */
const char *mode,
gp_file **file);
int (*open_scratch)(const gs_memory_t *mem,
void *secret,
const char *prefix,
char *rfname, /* 4096 bytes */
const char *mode,
int rm,
gp_file **file);
int (*open_printer)(const gs_memory_t *mem,
void *secret,
char *fname, /* 4096 bytes */
int binary,
gp_file **file);
int (*open_handle)(const gs_memory_t *mem,
void *secret,
char *fname, /* 4096 bytes */
const char *mode,
gp_file **file);
} gsapi_fs_t;
GSDLLEXPORT int GSDLLAPI
gsapi_add_fs(void *instance, gsapi_fs_t *fs, void *secret);
GSDLLEXPORT void GSDLLAPI
gsapi_remove_fs(void *instance, gsapi_fs_t *fs, void *secret);
/* function prototypes */
typedef int (GSDLLAPIPTR PFN_gsapi_revision)(
gsapi_revision_t *pr, int len);
typedef int (GSDLLAPIPTR PFN_gsapi_new_instance)(
void **pinstance, void *caller_handle);
typedef void (GSDLLAPIPTR PFN_gsapi_delete_instance)(
void *instance);
typedef int (GSDLLAPIPTR PFN_gsapi_set_stdio)(void *instance,
int (GSDLLCALLPTR stdin_fn)(void *caller_handle, char *buf, int len),
int (GSDLLCALLPTR stdout_fn)(void *caller_handle, const char *str, int len),
int (GSDLLCALLPTR stderr_fn)(void *caller_handle, const char *str, int len));
typedef int (GSDLLAPIPTR PFN_gsapi_set_poll)(void *instance,
int(GSDLLCALLPTR poll_fn)(void *caller_handle));
typedef int (GSDLLAPIPTR PFN_gsapi_set_display_callback)(
void *instance, display_callback *callback);
typedef int (GSDLLAPIPTR PFN_gsapi_set_default_device_list)(
void *instance, char *list, int listlen);
typedef int (GSDLLAPIPTR PFN_gsapi_get_default_device_list)(
void *instance, char **list, int *listlen);
typedef int (GSDLLAPIPTR PFN_gsapi_init_with_args)(
void *instance, int argc, char **argv);
#ifdef __WIN32__
typedef int (GSDLLAPIPTR PFN_gsapi_init_with_argsA)(
void *instance, int argc, char **argv);
typedef int (GSDLLAPIPTR PFN_gsapi_init_with_argsW)(
void *instance, int argc, wchar_t **argv);
#endif
typedef int (GSDLLAPIPTR PFN_gsapi_set_arg_encoding)(
void *instance, int encoding);
typedef int (GSDLLAPIPTR PFN_gsapi_run_string_begin)(
void *instance, int user_errors, int *pexit_code);
typedef int (GSDLLAPIPTR PFN_gsapi_run_string_continue)(
void *instance, const char *str, unsigned int length,
int user_errors, int *pexit_code);
typedef int (GSDLLAPIPTR PFN_gsapi_run_string_end)(
void *instance, int user_errors, int *pexit_code);
typedef int (GSDLLAPIPTR PFN_gsapi_run_string_with_length)(
void *instance, const char *str, unsigned int length,
int user_errors, int *pexit_code);
typedef int (GSDLLAPIPTR PFN_gsapi_run_string)(
void *instance, const char *str,
int user_errors, int *pexit_code);
typedef int (GSDLLAPIPTR PFN_gsapi_run_file)(void *instance,
const char *file_name, int user_errors, int *pexit_code);
#ifdef __WIN32__
typedef int (GSDLLAPIPTR PFN_gsapi_run_fileA)(void *instance,
const char *file_name, int user_errors, int *pexit_code);
typedef int (GSDLLAPIPTR PFN_gsapi_run_fileW)(void *instance,
const wchar_t *file_name, int user_errors, int *pexit_code);
#endif
typedef int (GSDLLAPIPTR PFN_gsapi_exit)(void *instance);
typedef int (GSDLLAPIPTR PFN_gsapi_set_param)(void *instance, const char *param, const void *value, gs_set_param_type type);
typedef int (GSDLLAPIPTR PFN_gsapi_add_control_path)(void *instance, int type, const char *path);
typedef int (GSDLLAPIPTR PFN_gsapi_remove_control_path)(void *instance, int type, const char *path);
typedef void (GSDLLAPIPTR PFN_gsapi_purge_control_paths)(void *instance, int type);
typedef void (GSDLLAPIPTR PFN_gsapi_activate_path_control)(void *instance, int enable);
typedef int (GSDLLAPIPTR PFN_gsapi_is_path_control_active)(void *instance);
typedef int (GSDLLAPIPTR PFN_gsapi_add_fs)(void *instance, gsapi_fs_t *fs, void *secret);
typedef void (GSDLLAPIPTR PFN_gsapi_remove_fs)(void *instance, gsapi_fs_t *fs, void *secret);
#ifdef __MACOS__
#pragma export off
#endif
#ifdef __cplusplus
} /* extern 'C' protection */
#endif
#endif /* iapi_INCLUDED */
@@ -0,0 +1,72 @@
/* Copyright (C) 2001-2023 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
implied.
This software is distributed under license and may not be copied,
modified or distributed except as expressly authorized under the terms
of the license contained in the file LICENSE in this distribution.
Refer to licensing information at http://www.artifex.com or contact
Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
CA 94129, USA, for further information.
*/
/* Definition of error codes */
#ifndef ierrors_INCLUDED
# define ierrors_INCLUDED
#include "gserrors.h"
/*
* DO NOT USE THIS FILE IN THE GRAPHICS LIBRARY.
* THIS FILE IS PART OF THE POSTSCRIPT INTERPRETER.
* USE gserrors.h IN THE LIBRARY.
*/
/*
* A procedure that may return an error always returns
* a non-negative value (zero, unless otherwise noted) for success,
* or negative for failure.
* We use ints rather than an enum to avoid a lot of casting.
*/
/* Define the error name table */
extern const char *const gs_error_names[];
/* ------ PostScript Level 1 errors ------ */
#define LEVEL1_ERROR_NAMES\
"unknownerror", "dictfull", "dictstackoverflow", "dictstackunderflow",\
"execstackoverflow", "interrupt", "invalidaccess", "invalidexit",\
"invalidfileaccess", "invalidfont", "invalidrestore", "ioerror",\
"limitcheck", "nocurrentpoint", "rangecheck", "stackoverflow",\
"stackunderflow", "syntaxerror", "timeout", "typecheck", "undefined",\
"undefinedfilename", "undefinedresult", "unmatchedmark", "VMerror"
/* ------ Additional Level 2 errors (also in DPS) ------ */
#define LEVEL2_ERROR_NAMES\
"configurationerror", "undefinedresource", "unregistered"
/* ------ Additional DPS errors ------ */
#define DPS_ERROR_NAMES\
"invalidcontext", "invalidid"
#define PDF_ERROR_NAMES\
"pdf_stackoverflow", "pdf_circular_reference"
#define ERROR_NAMES\
LEVEL1_ERROR_NAMES, LEVEL2_ERROR_NAMES, DPS_ERROR_NAMES, PDF_ERROR_NAMES
/*
* Define which error codes require re-executing the current object.
*/
#define GS_ERROR_IS_INTERRUPT(ecode)\
((ecode) == gs_error_interrupt || (ecode) == gs_error_timeout)
#endif /* ierrors_INCLUDED */
Binary file not shown.
@@ -0,0 +1,3 @@
#pragma once
#include "iapi.h"
#include "ierrors.h"
@@ -0,0 +1,129 @@
/* Copyright (C) 2001-2026 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
implied.
This software is distributed under license and may not be copied,
modified or distributed except as expressly authorized under the terms
of the license contained in the file LICENSE in this distribution.
Refer to licensing information at http://www.artifex.com or contact
Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
CA 94129, USA, for further information.
*/
#ifndef gscdefs_INCLUDED
# define gscdefs_INCLUDED
/* This comment, the delimiting comments below, and the lines of
* source code between the delimiting comments may not be altered,
* replaced, changed, or otherwise modified for the purpose of
* misrepresenting the origin of works generated using this
* software.
*
* The supplemental term above has been added in accordance with
* Section 7(b) of the Affero General Public License version 3.
*/
/* BEGIN -- CHANGES RESTRICTED UNDER 7(b) */
/* If we are cluster testing, then we want to nobble stuff
* that might change between versions. */
#ifdef CLUSTER
#undef GS_PRODUCTFAMILY
#define GS_PRODUCTFAMILY "GPL Ghostscript"
#undef GS_PRODUCT
#define GS_PRODUCT GS_PRODUCTFAMILY
#else
/* def GS_PRODFAM */
# define GS_PRODUCTFAMILY\
"GPL Ghostscript"
/* end def GS_PRODFAM */
/* def GS_PROD */
# define GS_PRODUCT\
GS_PRODUCTFAMILY " GIT PRERELEASE"
/* end def GS_PROD */
#endif
/* END -- CHANGES RESTRICTED UNDER 7(b) */
#define GS_STRINGIZE2(s) #s
#define GS_STRINGIZE(s) GS_STRINGIZE2(s)
#ifndef GS_BUILDTIME
# define GS_BUILDTIME\
0 /* should be set in the makefile */
#endif
#ifndef GS_COPYRIGHT
# define GS_COPYRIGHT\
"Copyright (C) 2026 Artifex Software, Inc. All rights reserved."
#endif
/* Prototypes for configuration definitions in gconfig.c. */
/*
* This file may be #included in places that don't even have stdpre.h,
* so it mustn't use any Ghostscript definitions in any code that is
* actually processed here (as opposed to being part of a macro
* definition).
*/
/* Miscellaneous system constants (read-only systemparams). */
extern const long gs_buildtime;
extern const char *const gs_copyright;
extern const char *const gs_product;
extern const char *const gs_productfamily;
extern const long gs_revision;
extern const long gs_revisiondate;
extern const long gs_serialnumber;
/* Installation directories and files */
extern const char *const gs_doc_directory;
extern const char *const gs_lib_default_path;
extern const char *const gs_init_file;
extern const char *const gs_dev_defaults;
/* Resource tables. In order to avoid importing a large number of types, */
/* we only provide macros for some externs, not the externs themselves. */
#define extern_gx_device_halftone_list()\
typedef DEVICE_HALFTONE_RESOURCE_PROC((*gx_dht_proc));\
extern const gx_dht_proc gx_device_halftone_list[]
#define extern_gx_image_class_table()\
extern const gx_image_class_t gx_image_class_table[]
extern const unsigned gx_image_class_table_count;
#define extern_gx_image_type_table()\
extern const gx_image_type_t * const gx_image_type_table[]
extern const unsigned gx_image_type_table_count;
/* We need the extra typedef so that the const will apply to the table. */
#define extern_gx_init_table()\
typedef init_proc((*gx_init_proc));\
extern const gx_init_proc gx_init_table[]
#define extern_gx_io_device_table()\
extern const gx_io_device * const gx_io_device_table[]
extern const unsigned gx_io_device_table_count;
/* Return the list of device prototypes, a NULL list of their structure */
/* descriptors (no longer used), and (as the value) the length of the lists. */
#define extern_gs_lib_device_list()\
int gs_lib_device_list(const gx_device * const **plist,\
gs_memory_struct_type_t **pst)
/* find a compositor by name */
#define extern_gs_find_compositor() \
const gs_composite_type_t * gs_find_compositor(int comp_id)
#define extern_gs_get_fapi_server_inits() \
const gs_fapi_server_init_func * gs_get_fapi_server_inits(void)
#endif /* gscdefs_INCLUDED */
@@ -0,0 +1,104 @@
/* Copyright (C) 2001-2023 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
implied.
This software is distributed under license and may not be copied,
modified or distributed except as expressly authorized under the terms
of the license contained in the file LICENSE in this distribution.
Refer to licensing information at http://www.artifex.com or contact
Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
CA 94129, USA, for further information.
*/
/* This interface is deprecated and will be removed in future
* ghostscript releases. Use the interface described in
* API.htm and iapi.h.
*/
#ifndef gsdll_INCLUDED
# define gsdll_INCLUDED
#include "iapi.h"
#include "windows_.h"
#ifdef __MACOS__
#define HWND char *
#include <QDOffscreen.h>
#pragma export on
#endif
#ifdef __WINDOWS__
#define _Windows
#endif
#ifdef __IBMC__
#define GSDLLCALLLINK _System
#else
#define GSDLLCALLLINK
#endif
/* global pointer to callback */
typedef int (* GSDLLCALLLINK GSDLL_CALLBACK) (int, char *, unsigned long);
extern GSDLL_CALLBACK pgsdll_callback;
/* message values for callback */
#define GSDLL_STDIN 1 /* get count characters to str from stdin */
/* return number of characters read */
#define GSDLL_STDOUT 2 /* put count characters from str to stdout */
/* return number of characters written */
#define GSDLL_DEVICE 3 /* device = str has been opened if count=1 */
/* or closed if count=0 */
#define GSDLL_SYNC 4 /* sync_output for device str */
#define GSDLL_PAGE 5 /* output_page for device str */
#define GSDLL_SIZE 6 /* resize for device str */
/* LOWORD(count) is new xsize */
/* HIWORD(count) is new ysize */
#define GSDLL_POLL 7 /* Called from gp_check_interrupt */
/* Can be used by caller to poll the message queue */
/* Normally returns 0 */
/* To abort gsdll_execute_cont(), return a */
/* non zero error code until gsdll_execute_cont() */
/* returns */
/* return values from gsdll_init() */
#define GSDLL_INIT_IN_USE 100 /* DLL is in use */
#define GSDLL_INIT_QUIT 101 /* quit or EOF during init */
/* This is not an error. */
/* gsdll_exit() must not be called */
/* DLL exported functions */
/* for load time dynamic linking */
GSDLLEXPORT int GSDLLAPI gsdll_revision(const char * * product, const char * * copyright, long * gs_revision, long * gs_revisiondate);
GSDLLEXPORT int GSDLLAPI gsdll_init(GSDLL_CALLBACK callback, HWND hwnd, int argc, char * * argv);
GSDLLEXPORT int GSDLLAPI gsdll_execute_begin(void);
GSDLLEXPORT int GSDLLAPI gsdll_execute_cont(const char * str, int len);
GSDLLEXPORT int GSDLLAPI gsdll_execute_end(void);
GSDLLEXPORT int GSDLLAPI gsdll_exit(void);
GSDLLEXPORT int GSDLLAPI gsdll_lock_device(unsigned char *device, int flag);
/* Function pointer typedefs */
/* for run time dynamic linking */
typedef int (GSDLLAPIPTR PFN_gsdll_revision)(const char ** product,
const char ** copyright, long * revision, long * revisiondate);
typedef int (GSDLLAPIPTR PFN_gsdll_init) (GSDLL_CALLBACK, HWND, int argc, char * * argv);
typedef int (GSDLLAPIPTR PFN_gsdll_init_with_encoding) (GSDLL_CALLBACK, HWND, int argc, char * * argv, int encoding);
#ifdef __WIN32__
typedef int (GSDLLAPIPTR PFN_gsdll_initA) (GSDLL_CALLBACK, HWND, int argc, char * * argv);
typedef int (GSDLLAPIPTR PFN_gsdll_initW) (GSDLL_CALLBACK, HWND, int argc, wchar_t * * argv);
#endif
typedef int (GSDLLAPIPTR PFN_gsdll_execute_begin) (void);
typedef int (GSDLLAPIPTR PFN_gsdll_execute_cont) (const char * str, int len);
typedef int (GSDLLAPIPTR PFN_gsdll_execute_end) (void);
typedef int (GSDLLAPIPTR PFN_gsdll_exit) (void);
typedef int (GSDLLAPIPTR PFN_gsdll_lock_device) (unsigned char *, int);
#ifdef __MACOS__
#pragma export off
#endif
#endif /* gsdll_INCLUDED */
@@ -0,0 +1,280 @@
/* Copyright (C) 2001-2023 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
implied.
This software is distributed under license and may not be copied,
modified or distributed except as expressly authorized under the terms
of the license contained in the file LICENSE in this distribution.
Refer to licensing information at http://www.artifex.com or contact
Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
CA 94129, USA, for further information.
*/
/* Error code definitions */
#ifndef gserrors_INCLUDED
# define gserrors_INCLUDED
/* A procedure that may return an error always returns */
/* a non-negative value (zero, unless otherwise noted) for success, */
/* or negative for failure. */
/* We don't use a typedef internally to avoid a lot of casting. */
enum gs_error_type {
gs_error_ok = 0,
gs_error_unknownerror = -1, /* unknown error */
gs_error_dictfull = -2,
gs_error_dictstackoverflow = -3,
gs_error_dictstackunderflow = -4,
gs_error_execstackoverflow = -5,
gs_error_interrupt = -6,
gs_error_invalidaccess = -7,
gs_error_invalidexit = -8,
gs_error_invalidfileaccess = -9,
gs_error_invalidfont = -10,
gs_error_invalidrestore = -11,
gs_error_ioerror = -12,
gs_error_limitcheck = -13,
gs_error_nocurrentpoint = -14,
gs_error_rangecheck = -15,
gs_error_stackoverflow = -16,
gs_error_stackunderflow = -17,
gs_error_syntaxerror = -18,
gs_error_timeout = -19,
gs_error_typecheck = -20,
gs_error_undefined = -21,
gs_error_undefinedfilename = -22,
gs_error_undefinedresult = -23,
gs_error_unmatchedmark = -24,
gs_error_VMerror = -25, /* must be the last Level 1 error */
/* ------ Additional Level 2 errors (also in DPS, ------ */
gs_error_configurationerror = -26,
gs_error_undefinedresource = -27,
gs_error_unregistered = -28,
gs_error_invalidcontext = -29,
/* invalidid is for the NeXT DPS extension. */
gs_error_invalidid = -30,
/* We need a specific stackoverflow error for the PDF interpreter to avoid dropping into
* the Postscript interpreter's stack extending code, when the PDF interpreter is called from
* Postscript
*/
gs_error_pdf_stackoverflow = -31,
/* Internal error for the C-based PDF interpreter, to indicate a circular PDF reference */
gs_error_circular_reference = -32,
/* ------ Pseudo-errors used internally ------ */
gs_error_hit_detected = -99,
gs_error_Fatal = -100,
/*
* Internal code for the .quit operator.
* The real quit code is an integer on the operand stack.
* gs_interpret returns this only for a .quit with a zero exit code.
*/
gs_error_Quit = -101,
/*
* Internal code for a normal exit from the interpreter.
* Do not use outside of interp.c.
*/
gs_error_InterpreterExit = -102,
/* Need the remap color error for high level pattern support */
gs_error_Remap_Color = -103,
/*
* Internal code to indicate we have underflowed the top block
* of the e-stack.
*/
gs_error_ExecStackUnderflow = -104,
/*
* Internal code for the vmreclaim operator with a positive operand.
* We need to handle this as an error because otherwise the interpreter
* won't reload enough of its state when the operator returns.
*/
gs_error_VMreclaim = -105,
/*
* Internal code for requesting more input from run_string.
*/
gs_error_NeedInput = -106,
/*
* Internal code to all run_string to request that the data is rerun
* using run_file.
*/
gs_error_NeedFile = -107,
/*
* Internal code for a normal exit when usage info is displayed.
* This allows Window versions of Ghostscript to pause until
* the message can be read.
*/
gs_error_Info = -110,
/* A special 'error', like reamp color above. This is used by a subclassing
* device to indicate that it has fully processed a device method, and parent
* subclasses should not perform any further action. Currently this is limited
* to compositor creation.
*/
gs_error_handled = -111,
};
/* We do provide a typedef type for external API use */
typedef enum gs_error_type gs_error_t;
int gs_log_error(int, const char *, int);
#if !defined(DEBUG)
# define gs_log_error(err, file, line) (err)
#endif
#define gs_note_error(err) gs_log_error(err, __FILE__, __LINE__)
#define return_error(err) return gs_note_error(err)
#if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901L
# if defined(__GNUC__) && __GNUC__ >= 2
# define __func__ __FUNCTION__
# elif defined(__FUNCTION__)
# define __func__ __FUNCTION__
# elif defined(__FUNC__)
# define __func__ __FUNC__
# else
# define __func__ "<unknown>"
# endif
#endif
/*
* Error reporting macros.
*
*/
#ifndef __printflike
#if __GNUC__ > 2 || __GNUC__ == 2 && __GNUC_MINOR__ >= 7
#define __printflike(fmtarg, firstvararg) \
__attribute__((__format__ (__printf__, fmtarg, firstvararg)))
#else
#define __printflike(fmtarg, firstvararg)
#endif
#endif
const char *gs_errstr(int code);
int gs_throw_imp(const char *func, const char *file, int line,
int op, int code, const char *fmt, ...) __attribute__((__format__(__printf__, 6, 7)));
/* Use throw at origin of error
*/
#define gs_throw_code(code) \
gs_throw1((code), "%s", gs_errstr((code)))
#define gs_throw(code, fmt) \
gs_throw_imp(__func__, __FILE__, __LINE__, 0, code, fmt)
#define gs_throw1(code, fmt, arg1) \
gs_throw_imp(__func__, __FILE__, __LINE__, 0, code, fmt, arg1)
#define gs_throw2(code, fmt, arg1, arg2) \
gs_throw_imp(__func__, __FILE__, __LINE__, 0, code, fmt, arg1, arg2)
#define gs_throw3(code, fmt, arg1, arg2, arg3) \
gs_throw_imp(__func__, __FILE__, __LINE__, 0, code, fmt, arg1, arg2, arg3)
#define gs_throw4(code, fmt, arg1, arg2, arg3, arg4) \
gs_throw_imp(__func__, __FILE__, __LINE__, 0, code, fmt, arg1, arg2, arg3, arg4)
#define gs_throw5(code, fmt, arg1, arg2, arg3, arg4, arg5) \
gs_throw_imp(__func__, __FILE__, __LINE__, 0, code, fmt, arg1, arg2, arg3, arg4, arg5)
#define gs_throw6(code, fmt, arg1, arg2, arg3, arg4, arg5, arg6) \
gs_throw_imp(__func__, __FILE__, __LINE__, 0, code, fmt, arg1, arg2, arg3, arg4, arg5, arg6)
#define gs_throw7(code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7) \
gs_throw_imp(__func__, __FILE__, __LINE__, 0, code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7)
#define gs_throw8(code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) \
gs_throw_imp(__func__, __FILE__, __LINE__, 0, code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8)
#define gs_throw9(code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) \
gs_throw_imp(__func__, __FILE__, __LINE__, 0, code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9)
/* Bubble the code up the stack
*/
#define gs_rethrow_code(code) \
gs_rethrow1((code), "%s", gs_errstr((code)))
#define gs_rethrow(code, fmt) \
gs_throw_imp(__func__, __FILE__, __LINE__, 1, code, fmt)
#define gs_rethrow1(code, fmt, arg1) \
gs_throw_imp(__func__, __FILE__, __LINE__, 1, code, fmt, arg1)
#define gs_rethrow2(code, fmt, arg1, arg2) \
gs_throw_imp(__func__, __FILE__, __LINE__, 1, code, fmt, arg1, arg2)
#define gs_rethrow3(code, fmt, arg1, arg2, arg3) \
gs_throw_imp(__func__, __FILE__, __LINE__, 1, code, fmt, arg1, arg2, arg3)
#define gs_rethrow4(code, fmt, arg1, arg2, arg3, arg4) \
gs_throw_imp(__func__, __FILE__, __LINE__, 1, code, fmt, arg1, arg2, arg3, arg4)
#define gs_rethrow5(code, fmt, arg1, arg2, arg3, arg4, arg5) \
gs_throw_imp(__func__, __FILE__, __LINE__, 1, code, fmt, arg1, arg2, arg3, arg4, arg5)
#define gs_rethrow6(code, fmt, arg1, arg2, arg3, arg4, arg5, arg6) \
gs_throw_imp(__func__, __FILE__, __LINE__, 1, code, fmt, arg1, arg2, arg3, arg4, arg5, arg6)
#define gs_rethrow7(code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7) \
gs_throw_imp(__func__, __FILE__, __LINE__, 1, code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7)
#define gs_rethrow8(code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) \
gs_throw_imp(__func__, __FILE__, __LINE__, 1, code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8)
#define gs_rethrow9(code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) \
gs_throw_imp(__func__, __FILE__, __LINE__, 1, code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9)
/* This will cause trouble, as it implies you are fixing an error
* the system will spew messages
*/
#define gs_catch(code, fmt) \
gs_throw_imp(__func__, __FILE__, __LINE__, 2, code, fmt)
#define gs_catch1(code, fmt, arg1) \
gs_throw_imp(__func__, __FILE__, __LINE__, 2, code, fmt, arg1)
#define gs_catch2(code, fmt, arg1, arg2) \
gs_throw_imp(__func__, __FILE__, __LINE__, 2, code, fmt, arg1, arg2)
#define gs_catch3(code, fmt, arg1, arg2, arg3) \
gs_throw_imp(__func__, __FILE__, __LINE__, 2, code, fmt, arg1, arg2, arg3)
#define gs_catch4(code, fmt, arg1, arg2, arg3, arg4) \
gs_throw_imp(__func__, __FILE__, __LINE__, 2, code, fmt, arg1, arg2, arg3, arg4)
#define gs_catch5(code, fmt, arg1, arg2, arg3, arg4, arg5) \
gs_throw_imp(__func__, __FILE__, __LINE__, 2, code, fmt, arg1, arg2, arg3, arg4, arg5)
#define gs_catch6(code, fmt, arg1, arg2, arg3, arg4, arg5, arg6) \
gs_throw_imp(__func__, __FILE__, __LINE__, 2, code, fmt, arg1, arg2, arg3, arg4, arg5, arg6)
#define gs_catch7(code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7) \
gs_throw_imp(__func__, __FILE__, __LINE__, 2, code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7)
#define gs_catch8(code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) \
gs_throw_imp(__func__, __FILE__, __LINE__, 2, code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8)
#define gs_catch9(code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) \
gs_throw_imp(__func__, __FILE__, __LINE__, 2, code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9)
/* gs_warn is a printf
*/
#define gs_warn(fmt) \
(void)gs_throw_imp(__func__, __FILE__, __LINE__, 3, 0, fmt)
#define gs_warn1(fmt, arg1) \
(void)gs_throw_imp(__func__, __FILE__, __LINE__, 3, 0, fmt, arg1)
#define gs_warn2(fmt, arg1, arg2) \
(void)gs_throw_imp(__func__, __FILE__, __LINE__, 3, 0, fmt, arg1, arg2)
#define gs_warn3(fmt, arg1, arg2, arg3) \
(void)gs_throw_imp(__func__, __FILE__, __LINE__, 3, 0, fmt, arg1, arg2, arg3)
#define gs_warn4(fmt, arg1, arg2, arg3, arg4) \
(void)gs_throw_imp(__func__, __FILE__, __LINE__, 3, 0, fmt, arg1, arg2, arg3, arg4)
#define gs_warn5(fmt, arg1, arg2, arg3, arg4, arg5) \
(void)gs_throw_imp(__func__, __FILE__, __LINE__, 3, 0, fmt, arg1, arg2, arg3, arg4, arg5)
#define gs_warn6(fmt, arg1, arg2, arg3, arg4, arg5, arg6) \
(void)gs_throw_imp(__func__, __FILE__, __LINE__, 3, 0, fmt, arg1, arg2, arg3, arg4, arg5, arg6)
#define gs_warn7(fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7) \
(void)gs_throw_imp(__func__, __FILE__, __LINE__, 3, 0, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7)
#define gs_warn8(fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) \
(void)gs_throw_imp(__func__, __FILE__, __LINE__, 3, 0, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8)
#define gs_warn9(fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) \
(void)gs_throw_imp(__func__, __FILE__, __LINE__, 3, 0, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9)
/* just in case you don't know 0 means no error
* other return codes are errors.
*/
#define gs_okay 0
#endif /* gserrors_INCLUDED */
@@ -0,0 +1,574 @@
/* Copyright (C) 2001-2023 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
implied.
This software is distributed under license and may not be copied,
modified or distributed except as expressly authorized under the terms
of the license contained in the file LICENSE in this distribution.
Refer to licensing information at http://www.artifex.com or contact
Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
CA 94129, USA, for further information.
*/
/*
* Public API for Ghostscript interpreter
* for use both as DLL and for static linking.
*
* Should work for Windows, OS/2, Linux, Mac.
*
* DLL exported functions should be as similar as possible to imain.c
* You will need to include "ierrors.h".
*
* Current problems:
* 1. Ghostscript does not support multiple instances.
* 2. Global variables in gs_main_instance_default()
* and gsapi_instance_counter
*/
/* Exported functions may need different prefix
* GSDLLEXPORT marks functions as exported
* GSDLLAPI is the calling convention used on functions exported
* by Ghostscript
* GSDLLCALL is used on callback functions called by Ghostscript
* When you include this header file in the caller, you may
* need to change the definitions by defining these
* before including this header file.
* Make sure you get the calling convention correct, otherwise your
* program will crash either during callbacks or soon after returning
* due to stack corruption.
*/
#ifndef iapi_INCLUDED
# define iapi_INCLUDED
#ifdef __cplusplus
extern "C" {
#endif
#if defined(_WINDOWS_) || defined(__WINDOWS__)
# ifndef _Windows
# define _Windows
# endif
#endif
#ifdef _Windows
# ifndef GSDLLEXPORT
/* We don't need both the "__declspec(dllexport)" declaration
* and the listing in the .def file - having both results in
* a linker warning on x64 builds (but is incorrect on x86, too)
*/
# if 0
# define GSDLLEXPORT __declspec(dllexport)
# else
# define GSDLLEXPORT
# endif
# endif
# ifdef __MINGW32__
/* export stdcall functions as "name" instead of "_name@ordinal" */
# undef GSDLLAPI
# define GSDLLAPI
# endif
# ifndef GSDLLAPI
# define GSDLLAPI __stdcall
# endif
# ifndef GSDLLCALL
# define GSDLLCALL __stdcall
# endif
#endif /* _Windows */
#if defined(OS2) && defined(__IBMC__)
# ifndef GSDLLAPI
# define GSDLLAPI _System
# endif
# ifndef GSDLLCALL
# define GSDLLCALL _System
# endif
#endif /* OS2 && __IBMC */
#ifdef __MACOS__
# pragma export on
#endif
#ifndef GSDLLEXPORT
# ifdef __GNUC__
# define GSDLLEXPORT __attribute__ ((visibility ("default")))
# else
# define GSDLLEXPORT
# endif
#endif
#ifndef GSDLLAPI
# define GSDLLAPI
#endif
#ifndef GSDLLCALL
# define GSDLLCALL
#endif
#if defined(__IBMC__)
# define GSDLLAPIPTR * GSDLLAPI
# define GSDLLCALLPTR * GSDLLCALL
#else
# define GSDLLAPIPTR GSDLLAPI *
# define GSDLLCALLPTR GSDLLCALL *
#endif
#ifndef display_callback_DEFINED
# define display_callback_DEFINED
typedef struct display_callback_s display_callback;
#endif
#ifndef gs_memory_DEFINED
# define gs_memory_DEFINED
typedef struct gs_memory_s gs_memory_t;
#endif
#ifndef gp_file_DEFINED
# define gp_file_DEFINED
typedef struct gp_file_s gp_file;
#endif
typedef struct gsapi_revision_s {
const char *product;
const char *copyright;
long revision;
long revisiondate;
} gsapi_revision_t;
/* Get version numbers and strings.
* This is safe to call at any time.
* You should call this first to make sure that the correct version
* of the Ghostscript is being used.
* pr is a pointer to a revision structure.
* len is the size of this structure in bytes.
* Returns 0 if OK, or if len too small (additional parameters
* have been added to the structure) it will return the required
* size of the structure.
*/
GSDLLEXPORT int GSDLLAPI
gsapi_revision(gsapi_revision_t *pr, int len);
/*
* WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
* On non-threading capable platforms, Ghostscript supports only
* one instance. The current implementation uses a global static
* instance counter to make sure that only a single instance is
* used. If you try to create two instances, the second attempt
* will return < 0 and set pinstance to NULL.
* WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
*/
/* Create a new instance of Ghostscript.
* This instance is passed to most other API functions.
* The caller_handle will be provided to callback functions.
*/
GSDLLEXPORT int GSDLLAPI
gsapi_new_instance(void **pinstance, void *caller_handle);
/*
* WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
* On non-threading capable platforms, Ghostscript supports only
* one instance. The current implementation uses a global static
* instance counter to make sure that only a single instance is
* used.
* WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
*/
/* Destroy an instance of Ghostscript
* Before you call this, Ghostscript must have finished.
* If Ghostscript has been initialised, you must call gsapi_exit()
* before gsapi_delete_instance.
*/
GSDLLEXPORT void GSDLLAPI
gsapi_delete_instance(void *instance);
/* Set the callback functions for stdio
* The stdin callback function should return the number of
* characters read, 0 for EOF, or -1 for error.
* The stdout and stderr callback functions should return
* the number of characters written.
* If a callback address is NULL, the real stdio will be used.
*/
GSDLLEXPORT int GSDLLAPI
gsapi_set_stdio(void *instance,
int (GSDLLCALLPTR stdin_fn)(void *caller_handle, char *buf, int len),
int (GSDLLCALLPTR stdout_fn)(void *caller_handle, const char *str, int len),
int (GSDLLCALLPTR stderr_fn)(void *caller_handle, const char *str, int len));
/* Does the same as the above, but using the caller_handle given here,
* rather than the default one specified at gsapi_new_instance time. */
GSDLLEXPORT int GSDLLAPI
gsapi_set_stdio_with_handle(void *instance,
int (GSDLLCALLPTR stdin_fn)(void *caller_handle, char *buf, int len),
int (GSDLLCALLPTR stdout_fn)(void *caller_handle, const char *str, int len),
int (GSDLLCALLPTR stderr_fn)(void *caller_handle, const char *str, int len),
void *caller_handle);
/* Set the callback function for polling.
* This is used for handling window events or cooperative
* multitasking. This function will only be called if
* Ghostscript was compiled with CHECK_INTERRUPTS
* as described in gpcheck.h.
* The polling function should return 0 if all is well,
* and negative if it wants ghostscript to abort.
* The polling function must be fast.
*/
GSDLLEXPORT int GSDLLAPI gsapi_set_poll(void *instance,
int (GSDLLCALLPTR poll_fn)(void *caller_handle));
/* Does the same as the above, but using the caller_handle given here,
* rather than the default one specified at gsapi_new_instance time. */
GSDLLEXPORT int GSDLLAPI gsapi_set_poll_with_handle(void *instance,
int (GSDLLCALLPTR poll_fn)(void *caller_handle), void *caller_handle);
/* Set the display device callback structure.
* If the display device is used, this must be called
* after gsapi_new_instance() and before gsapi_init_with_args().
* See gdevdisp.h for more details.
* DEPRECATED: Use the gsapi_register_callback mechanism instead.
*/
GSDLLEXPORT int GSDLLAPI gsapi_set_display_callback(
void *instance, display_callback *callback);
/* The callout mechanism allows devices to query "callers" (users of the
* DLL) in device specific ways. The callout function pointer type will
* be called with:
* callout_handle = the value given at registration
* device_name = the name of the current device
* id = An integer, guaranteed to be unique within the
* callouts from a given device, identifying the
* purpose of this call.
* size = device/id specific, but typically the size of 'data'.
* data = device/id specific, but typically the pointer to
* an in/out data block.
* Returns an error code (gs_error_unknownerror (-1) if unclaimed,
* non-negative on success, standard gs error numbers recommended).
*/
typedef int (*gs_callout)(void *instance,
void *callout_handle,
const char *device_name,
int id,
int size,
void *data);
/* Register a handler for gs callouts.
* This must be called after gsapi_new_instance() and (typically)
* before gsapi_init_with_args().
*/
GSDLLEXPORT int GSDLLAPI gsapi_register_callout(
void *instance, gs_callout callout, void *callout_handle);
/* Deregister a handler for gs callouts. */
GSDLLEXPORT void GSDLLAPI gsapi_deregister_callout(
void *instance, gs_callout callout, void *callout_handle);
/* Set the string containing the list of default device names
* for example "display x11alpha x11 bbox". Allows the calling
* application to influence which device(s) gs will try in order
* to select the default device
*
* *Must* be called after gsapi_new_instance() and before
* gsapi_init_with_args().
*/
GSDLLEXPORT int GSDLLAPI
gsapi_set_default_device_list(void *instance, const char *list, int listlen);
/* Returns a pointer to the current default device string
* *Must* be called after gsapi_new_instance().
*/
GSDLLEXPORT int GSDLLAPI
gsapi_get_default_device_list(void *instance, char **list, int *listlen);
/* Set the encoding used for the args. By default we assume
* 'local' encoding. For windows this equates to whatever the current
* codepage is. For linux this is utf8.
*
* Use of this API (gsapi) with 'local' encodings (and hence without calling
* this function) is now deprecated!
*/
GSDLLEXPORT int GSDLLAPI gsapi_set_arg_encoding(void *instance,
int encoding);
enum {
GS_ARG_ENCODING_LOCAL = 0,
GS_ARG_ENCODING_UTF8 = 1,
GS_ARG_ENCODING_UTF16LE = 2
};
/* Initialise the interpreter.
* This calls gs_main_init_with_args() in imainarg.c
* 1. If quit or EOF occur during gsapi_init_with_args(),
* the return value will be gs_error_Quit. This is not an error.
* You must call gsapi_exit() and must not call any other
* gsapi_XXX functions.
* 2. If usage info should be displayed, the return value will be gs_error_Info
* which is not an error. Do not call gsapi_exit().
* 3. Under normal conditions this returns 0. You would then
* call one or more gsapi_run_*() functions and then finish
* with gsapi_exit().
*/
GSDLLEXPORT int GSDLLAPI gsapi_init_with_args(void *instance,
int argc, char **argv);
#ifdef __WIN32__
GSDLLEXPORT int GSDLLAPI gsapi_init_with_argsA(void *instance,
int argc, char **argv);
GSDLLEXPORT int GSDLLAPI gsapi_init_with_argsW(void *instance,
int argc, wchar_t **argv);
#endif
/*
* The gsapi_run_* functions are like gs_main_run_* except
* that the error_object is omitted.
* If these functions return <= -100, either quit or a fatal
* error has occured. You then call gsapi_exit() next.
* The only exception is gsapi_run_string_continue()
* which will return gs_error_NeedInput if all is well.
*/
GSDLLEXPORT int GSDLLAPI
gsapi_run_string_begin(void *instance,
int user_errors, int *pexit_code);
GSDLLEXPORT int GSDLLAPI
gsapi_run_string_continue(void *instance,
const char *str, unsigned int length, int user_errors, int *pexit_code);
GSDLLEXPORT int GSDLLAPI
gsapi_run_string_end(void *instance,
int user_errors, int *pexit_code);
GSDLLEXPORT int GSDLLAPI
gsapi_run_string_with_length(void *instance,
const char *str, unsigned int length, int user_errors, int *pexit_code);
GSDLLEXPORT int GSDLLAPI
gsapi_run_string(void *instance,
const char *str, int user_errors, int *pexit_code);
GSDLLEXPORT int GSDLLAPI
gsapi_run_file(void *instance,
const char *file_name, int user_errors, int *pexit_code);
#ifdef __WIN32__
GSDLLEXPORT int GSDLLAPI
gsapi_run_fileA(void *instance,
const char *file_name, int user_errors, int *pexit_code);
GSDLLEXPORT int GSDLLAPI
gsapi_run_fileW(void *instance,
const wchar_t *file_name, int user_errors, int *pexit_code);
#endif
/* Exit the interpreter.
* This must be called on shutdown if gsapi_init_with_args()
* has been called, and just before gsapi_delete_instance().
*/
GSDLLEXPORT int GSDLLAPI
gsapi_exit(void *instance);
typedef enum {
gs_spt_invalid = -1,
gs_spt_null = 0, /* void * is NULL */
gs_spt_bool = 1, /* void * is a pointer to an int (0 false,
* non-zero true). */
gs_spt_int = 2, /* void * is a pointer to an int */
gs_spt_float = 3, /* void * is a float * */
gs_spt_name = 4, /* void * is a char * */
gs_spt_string = 5, /* void * is a char * */
gs_spt_long = 6, /* void * is a long * */
gs_spt_i64 = 7, /* void * is an int64_t * */
gs_spt_size_t = 8, /* void * is a size_t * */
gs_spt_parsed = 9, /* void * is a pointer to a char * to be parsed */
/* Setting a typed param causes it to be instantly fed to to the
* device. This can cause the device to reinitialise itself. Hence,
* setting a sequence of typed params can cause the device to reset
* itself several times. Accordingly, if you OR the type with
* gs_spt_more_to_come, the param will held ready to be passed into
* the device, and will only actually be sent when the next typed
* param is set without this flag (or on device init). Not valid
* for get_typed_param. */
gs_spt_more_to_come = 1<<31
} gs_set_param_type;
/* gs_spt_parsed allows for a string such as "<< /Foo 0 /Bar true >>" or
* "[ 1 2 3 ]" etc to be used so more complex parameters can be set. */
GSDLLEXPORT int GSDLLAPI gsapi_set_param(void *instance, const char *param, const void *value, gs_set_param_type type);
/* Called to get a value. value points to storage of the appropriate
* type. If value is passed as NULL on entry, then the return code is
* the number of bytes storage required for the type. Thus to read a
* name/string/parsed value, call once with value=NULL, then obtain
* the storage, and call again with value=the storage to get a nul
* terminated string. (nul terminator is included in the count - hence
* an empty string requires 1 byte storage). Returns gs_error_undefined
* (-21) if not found. */
GSDLLEXPORT int GSDLLAPI gsapi_get_param(void *instance, const char *param, void *value, gs_set_param_type type);
/* Enumerator to list all the parameters.
* Caller defines void *iter = NULL, and calls with &iter.
* Each call, iter is updated to reflect the position within the
* enumeration, so passing iterator back in gets the next key. The call
* returns negative values for errors, 0 for success, and 1 for "no more
* keys".
*
* void *iter = NULL;
* gs_set_param_type type;
* const char *key;
* int code;
* while ((code = gsapi_enumerate_params(inst, &iter, &key, &type)) == 0) {
* // Process key
* }
*
* Note that the ordering of enumerations is NOT defined. key is valid
* until the next call to gsapi_enumerate_params. Only one enumeration
* at a time (starting a new enumeration will invalidate any previous
* enumeration).
*/
GSDLLEXPORT int GSDLLAPI gsapi_enumerate_params(void *instance, void **iterator, const char **key, gs_set_param_type *type);
enum {
GS_PERMIT_FILE_READING = 0,
GS_PERMIT_FILE_WRITING = 1,
GS_PERMIT_FILE_CONTROL = 2
};
/* Add a path to one of the sets of permitted paths. */
GSDLLEXPORT int GSDLLAPI
gsapi_add_control_path(void *instance, int type, const char *path);
/* Remove a path from one of the sets of permitted paths. */
GSDLLEXPORT int GSDLLAPI
gsapi_remove_control_path(void *instance, int type, const char *path);
/* Purge all the paths from the one of the sets of permitted paths. */
GSDLLEXPORT void GSDLLAPI
gsapi_purge_control_paths(void *instance, int type);
GSDLLEXPORT void GSDLLAPI
gsapi_activate_path_control(void *instance, int enable);
GSDLLEXPORT int GSDLLAPI
gsapi_is_path_control_active(void *instance);
/* Details of gp_file can be found in gp.h.
* Users wanting to use this function should include
* that file. Not included here to avoid bloating the
* API inclusions for the majority of people who won't
* want it. */
#ifndef gp_file_name_sizeof
#define gp_file_name_sizeof 4096
#endif
typedef struct
{
int (*open_file)(const gs_memory_t *mem,
void *secret,
const char *fname,
const char *mode,
gp_file **file);
int (*open_pipe)(const gs_memory_t *mem,
void *secret,
const char *fname,
char *rfname, /* 4096 bytes */
const char *mode,
gp_file **file);
int (*open_scratch)(const gs_memory_t *mem,
void *secret,
const char *prefix,
char *rfname, /* 4096 bytes */
const char *mode,
int rm,
gp_file **file);
int (*open_printer)(const gs_memory_t *mem,
void *secret,
char *fname, /* 4096 bytes */
int binary,
gp_file **file);
int (*open_handle)(const gs_memory_t *mem,
void *secret,
char *fname, /* 4096 bytes */
const char *mode,
gp_file **file);
} gsapi_fs_t;
GSDLLEXPORT int GSDLLAPI
gsapi_add_fs(void *instance, gsapi_fs_t *fs, void *secret);
GSDLLEXPORT void GSDLLAPI
gsapi_remove_fs(void *instance, gsapi_fs_t *fs, void *secret);
/* function prototypes */
typedef int (GSDLLAPIPTR PFN_gsapi_revision)(
gsapi_revision_t *pr, int len);
typedef int (GSDLLAPIPTR PFN_gsapi_new_instance)(
void **pinstance, void *caller_handle);
typedef void (GSDLLAPIPTR PFN_gsapi_delete_instance)(
void *instance);
typedef int (GSDLLAPIPTR PFN_gsapi_set_stdio)(void *instance,
int (GSDLLCALLPTR stdin_fn)(void *caller_handle, char *buf, int len),
int (GSDLLCALLPTR stdout_fn)(void *caller_handle, const char *str, int len),
int (GSDLLCALLPTR stderr_fn)(void *caller_handle, const char *str, int len));
typedef int (GSDLLAPIPTR PFN_gsapi_set_poll)(void *instance,
int(GSDLLCALLPTR poll_fn)(void *caller_handle));
typedef int (GSDLLAPIPTR PFN_gsapi_set_display_callback)(
void *instance, display_callback *callback);
typedef int (GSDLLAPIPTR PFN_gsapi_set_default_device_list)(
void *instance, char *list, int listlen);
typedef int (GSDLLAPIPTR PFN_gsapi_get_default_device_list)(
void *instance, char **list, int *listlen);
typedef int (GSDLLAPIPTR PFN_gsapi_init_with_args)(
void *instance, int argc, char **argv);
#ifdef __WIN32__
typedef int (GSDLLAPIPTR PFN_gsapi_init_with_argsA)(
void *instance, int argc, char **argv);
typedef int (GSDLLAPIPTR PFN_gsapi_init_with_argsW)(
void *instance, int argc, wchar_t **argv);
#endif
typedef int (GSDLLAPIPTR PFN_gsapi_set_arg_encoding)(
void *instance, int encoding);
typedef int (GSDLLAPIPTR PFN_gsapi_run_string_begin)(
void *instance, int user_errors, int *pexit_code);
typedef int (GSDLLAPIPTR PFN_gsapi_run_string_continue)(
void *instance, const char *str, unsigned int length,
int user_errors, int *pexit_code);
typedef int (GSDLLAPIPTR PFN_gsapi_run_string_end)(
void *instance, int user_errors, int *pexit_code);
typedef int (GSDLLAPIPTR PFN_gsapi_run_string_with_length)(
void *instance, const char *str, unsigned int length,
int user_errors, int *pexit_code);
typedef int (GSDLLAPIPTR PFN_gsapi_run_string)(
void *instance, const char *str,
int user_errors, int *pexit_code);
typedef int (GSDLLAPIPTR PFN_gsapi_run_file)(void *instance,
const char *file_name, int user_errors, int *pexit_code);
#ifdef __WIN32__
typedef int (GSDLLAPIPTR PFN_gsapi_run_fileA)(void *instance,
const char *file_name, int user_errors, int *pexit_code);
typedef int (GSDLLAPIPTR PFN_gsapi_run_fileW)(void *instance,
const wchar_t *file_name, int user_errors, int *pexit_code);
#endif
typedef int (GSDLLAPIPTR PFN_gsapi_exit)(void *instance);
typedef int (GSDLLAPIPTR PFN_gsapi_set_param)(void *instance, const char *param, const void *value, gs_set_param_type type);
typedef int (GSDLLAPIPTR PFN_gsapi_add_control_path)(void *instance, int type, const char *path);
typedef int (GSDLLAPIPTR PFN_gsapi_remove_control_path)(void *instance, int type, const char *path);
typedef void (GSDLLAPIPTR PFN_gsapi_purge_control_paths)(void *instance, int type);
typedef void (GSDLLAPIPTR PFN_gsapi_activate_path_control)(void *instance, int enable);
typedef int (GSDLLAPIPTR PFN_gsapi_is_path_control_active)(void *instance);
typedef int (GSDLLAPIPTR PFN_gsapi_add_fs)(void *instance, gsapi_fs_t *fs, void *secret);
typedef void (GSDLLAPIPTR PFN_gsapi_remove_fs)(void *instance, gsapi_fs_t *fs, void *secret);
#ifdef __MACOS__
#pragma export off
#endif
#ifdef __cplusplus
} /* extern 'C' protection */
#endif
#endif /* iapi_INCLUDED */
@@ -0,0 +1,72 @@
/* Copyright (C) 2001-2023 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
implied.
This software is distributed under license and may not be copied,
modified or distributed except as expressly authorized under the terms
of the license contained in the file LICENSE in this distribution.
Refer to licensing information at http://www.artifex.com or contact
Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
CA 94129, USA, for further information.
*/
/* Definition of error codes */
#ifndef ierrors_INCLUDED
# define ierrors_INCLUDED
#include "gserrors.h"
/*
* DO NOT USE THIS FILE IN THE GRAPHICS LIBRARY.
* THIS FILE IS PART OF THE POSTSCRIPT INTERPRETER.
* USE gserrors.h IN THE LIBRARY.
*/
/*
* A procedure that may return an error always returns
* a non-negative value (zero, unless otherwise noted) for success,
* or negative for failure.
* We use ints rather than an enum to avoid a lot of casting.
*/
/* Define the error name table */
extern const char *const gs_error_names[];
/* ------ PostScript Level 1 errors ------ */
#define LEVEL1_ERROR_NAMES\
"unknownerror", "dictfull", "dictstackoverflow", "dictstackunderflow",\
"execstackoverflow", "interrupt", "invalidaccess", "invalidexit",\
"invalidfileaccess", "invalidfont", "invalidrestore", "ioerror",\
"limitcheck", "nocurrentpoint", "rangecheck", "stackoverflow",\
"stackunderflow", "syntaxerror", "timeout", "typecheck", "undefined",\
"undefinedfilename", "undefinedresult", "unmatchedmark", "VMerror"
/* ------ Additional Level 2 errors (also in DPS) ------ */
#define LEVEL2_ERROR_NAMES\
"configurationerror", "undefinedresource", "unregistered"
/* ------ Additional DPS errors ------ */
#define DPS_ERROR_NAMES\
"invalidcontext", "invalidid"
#define PDF_ERROR_NAMES\
"pdf_stackoverflow", "pdf_circular_reference"
#define ERROR_NAMES\
LEVEL1_ERROR_NAMES, LEVEL2_ERROR_NAMES, DPS_ERROR_NAMES, PDF_ERROR_NAMES
/*
* Define which error codes require re-executing the current object.
*/
#define GS_ERROR_IS_INTERRUPT(ecode)\
((ecode) == gs_error_interrupt || (ecode) == gs_error_timeout)
#endif /* ierrors_INCLUDED */
@@ -0,0 +1,4 @@
Header source: /mnt/nas/builder/build-image-libs/out/android/arm64-v8a/include
JPEG_LIB_VERSION: 80
jpeg_compress_struct_size: 584
Reason: selected by compile-time probe from all available Jpegli/build/image headers.
@@ -0,0 +1,37 @@
/* Version ID for the JPEG library.
* Might be useful for tests like "#if JPEG_LIB_VERSION >= 60".
*/
#define JPEG_LIB_VERSION 80
/* libjpeg-turbo version */
#define LIBJPEG_TURBO_VERSION 4.1.5
/* libjpeg-turbo version in integer form */
#define LIBJPEG_TURBO_VERSION_NUMBER 4001005
/* Support arithmetic encoding */
#define C_ARITH_CODING_SUPPORTED 1
/* Support arithmetic decoding */
#define D_ARITH_CODING_SUPPORTED 1
/* Support in-memory source/destination managers */
/* #undef MEM_SRCDST_SUPPORTED */
/* Use accelerated SIMD routines. */
#define WITH_SIMD 1
/*
* Define BITS_IN_JSAMPLE as either
* 8 for 8-bit sample values (the usual setting)
* 12 for 12-bit sample values
* Only 8 and 12 are legal data precisions for lossy JPEG according to the
* JPEG standard, and the IJG code does not support anything else!
* We do not support run-time selection of data precision, sorry.
*/
#define BITS_IN_JSAMPLE 8 /* use 8 or 12 */
/* Define if your (broken) compiler shifts signed values as if they were
unsigned. */
/* #undef RIGHT_SHIFT_IS_UNSIGNED */
@@ -0,0 +1,335 @@
/*
* jerror.h
*
* This file was part of the Independent JPEG Group's software:
* Copyright (C) 1994-1997, Thomas G. Lane.
* Modified 1997-2009 by Guido Vollbeding.
* libjpeg-turbo Modifications:
* Copyright (C) 2014, 2017, 2021-2022, 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 JPEG library.
* Edit this file to add new codes, or to translate the message strings to
* some other language.
* A set of error-reporting macros are defined too. Some applications using
* the JPEG library may wish to include this file to get the error codes
* and/or the macros.
*/
/*
* 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 JERROR_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 /* JERROR_H */
#endif /* JMESSAGE */
#ifdef JMAKE_ENUM_LIST
typedef enum {
#define JMESSAGE(code,string) code ,
#endif /* JMAKE_ENUM_LIST */
JMESSAGE(JMSG_NOMESSAGE, "Bogus message code %d") /* Must be first entry! */
/* For maintenance convenience, list is alphabetical by message code name */
#if JPEG_LIB_VERSION < 70
JMESSAGE(JERR_ARITH_NOTIMPL, "Sorry, arithmetic coding is not implemented")
#endif
JMESSAGE(JERR_BAD_ALIGN_TYPE, "ALIGN_TYPE is wrong, please fix")
JMESSAGE(JERR_BAD_ALLOC_CHUNK, "MAX_ALLOC_CHUNK is wrong, please fix")
JMESSAGE(JERR_BAD_BUFFER_MODE, "Bogus buffer control mode")
JMESSAGE(JERR_BAD_COMPONENT_ID, "Invalid component ID %d in SOS")
#if JPEG_LIB_VERSION >= 70
JMESSAGE(JERR_BAD_CROP_SPEC, "Invalid crop request")
#endif
JMESSAGE(JERR_BAD_DCT_COEF, "DCT coefficient out of range")
JMESSAGE(JERR_BAD_DCTSIZE, "IDCT output block size %d not supported")
#if JPEG_LIB_VERSION >= 70
JMESSAGE(JERR_BAD_DROP_SAMPLING,
"Component index %d: mismatching sampling ratio %d:%d, %d:%d, %c")
#endif
JMESSAGE(JERR_BAD_HUFF_TABLE, "Bogus Huffman table definition")
JMESSAGE(JERR_BAD_IN_COLORSPACE, "Bogus input colorspace")
JMESSAGE(JERR_BAD_J_COLORSPACE, "Bogus JPEG colorspace")
JMESSAGE(JERR_BAD_LENGTH, "Bogus marker length")
JMESSAGE(JERR_BAD_LIB_VERSION,
"Wrong JPEG library version: library is %d, caller expects %d")
JMESSAGE(JERR_BAD_MCU_SIZE, "Sampling factors too large for interleaved scan")
JMESSAGE(JERR_BAD_POOL_ID, "Invalid memory pool code %d")
JMESSAGE(JERR_BAD_PRECISION, "Unsupported JPEG data precision %d")
JMESSAGE(JERR_BAD_PROGRESSION,
"Invalid progressive parameters Ss=%d Se=%d Ah=%d Al=%d")
JMESSAGE(JERR_BAD_PROG_SCRIPT,
"Invalid progressive parameters at scan script entry %d")
JMESSAGE(JERR_BAD_SAMPLING, "Bogus sampling factors")
JMESSAGE(JERR_BAD_SCAN_SCRIPT, "Invalid scan script at entry %d")
JMESSAGE(JERR_BAD_STATE, "Improper call to JPEG library in state %d")
JMESSAGE(JERR_BAD_STRUCT_SIZE,
"JPEG parameter struct mismatch: library thinks size is %u, caller expects %u")
JMESSAGE(JERR_BAD_VIRTUAL_ACCESS, "Bogus virtual array access")
JMESSAGE(JERR_BUFFER_SIZE, "Buffer passed to JPEG library is too small")
JMESSAGE(JERR_CANT_SUSPEND, "Suspension not allowed here")
JMESSAGE(JERR_CCIR601_NOTIMPL, "CCIR601 sampling not implemented yet")
JMESSAGE(JERR_COMPONENT_COUNT, "Too many color components: %d, max %d")
JMESSAGE(JERR_CONVERSION_NOTIMPL, "Unsupported color conversion request")
JMESSAGE(JERR_DAC_INDEX, "Bogus DAC index %d")
JMESSAGE(JERR_DAC_VALUE, "Bogus DAC value 0x%x")
JMESSAGE(JERR_DHT_INDEX, "Bogus DHT index %d")
JMESSAGE(JERR_DQT_INDEX, "Bogus DQT index %d")
JMESSAGE(JERR_EMPTY_IMAGE, "Empty JPEG image (DNL not supported)")
JMESSAGE(JERR_EMS_READ, "Read from EMS failed")
JMESSAGE(JERR_EMS_WRITE, "Write to EMS failed")
JMESSAGE(JERR_EOI_EXPECTED, "Didn't expect more than one scan")
JMESSAGE(JERR_FILE_READ, "Input file read error")
JMESSAGE(JERR_FILE_WRITE, "Output file write error --- out of disk space?")
JMESSAGE(JERR_FRACT_SAMPLE_NOTIMPL, "Fractional sampling not implemented yet")
JMESSAGE(JERR_HUFF_CLEN_OVERFLOW, "Huffman code size table overflow")
JMESSAGE(JERR_HUFF_MISSING_CODE, "Missing Huffman code table entry")
JMESSAGE(JERR_IMAGE_TOO_BIG, "Maximum supported image dimension is %u pixels")
JMESSAGE(JERR_INPUT_EMPTY, "Empty input file")
JMESSAGE(JERR_INPUT_EOF, "Premature end of input file")
JMESSAGE(JERR_MISMATCHED_QUANT_TABLE,
"Cannot transcode due to multiple use of quantization table %d")
JMESSAGE(JERR_MISSING_DATA, "Scan script does not transmit all data")
JMESSAGE(JERR_MODE_CHANGE, "Invalid color quantization mode change")
JMESSAGE(JERR_NOTIMPL, "Requested features are incompatible")
JMESSAGE(JERR_NOT_COMPILED, "Requested feature was omitted at compile time")
#if JPEG_LIB_VERSION >= 70
JMESSAGE(JERR_NO_ARITH_TABLE, "Arithmetic table 0x%02x was not defined")
#endif
JMESSAGE(JERR_NO_BACKING_STORE, "Backing store not supported")
JMESSAGE(JERR_NO_HUFF_TABLE, "Huffman table 0x%02x was not defined")
JMESSAGE(JERR_NO_IMAGE, "JPEG datastream contains no image")
JMESSAGE(JERR_NO_QUANT_TABLE, "Quantization table 0x%02x was not defined")
JMESSAGE(JERR_NO_SOI, "Not a JPEG file: starts with 0x%02x 0x%02x")
JMESSAGE(JERR_OUT_OF_MEMORY, "Insufficient memory (case %d)")
JMESSAGE(JERR_QUANT_COMPONENTS,
"Cannot quantize more than %d color components")
JMESSAGE(JERR_QUANT_FEW_COLORS, "Cannot quantize to fewer than %d colors")
JMESSAGE(JERR_QUANT_MANY_COLORS, "Cannot quantize to more than %d colors")
JMESSAGE(JERR_SOF_DUPLICATE, "Invalid JPEG file structure: two SOF markers")
JMESSAGE(JERR_SOF_NO_SOS, "Invalid JPEG file structure: missing SOS marker")
JMESSAGE(JERR_SOF_UNSUPPORTED, "Unsupported JPEG process: SOF type 0x%02x")
JMESSAGE(JERR_SOI_DUPLICATE, "Invalid JPEG file structure: two SOI markers")
JMESSAGE(JERR_SOS_NO_SOF, "Invalid JPEG file structure: SOS before SOF")
JMESSAGE(JERR_TFILE_CREATE, "Failed to create temporary file %s")
JMESSAGE(JERR_TFILE_READ, "Read failed on temporary file")
JMESSAGE(JERR_TFILE_SEEK, "Seek failed on temporary file")
JMESSAGE(JERR_TFILE_WRITE,
"Write failed on temporary file --- out of disk space?")
JMESSAGE(JERR_TOO_LITTLE_DATA, "Application transferred too few scanlines")
JMESSAGE(JERR_UNKNOWN_MARKER, "Unsupported marker type 0x%02x")
JMESSAGE(JERR_VIRTUAL_BUG, "Virtual array controller messed up")
JMESSAGE(JERR_WIDTH_OVERFLOW, "Image too wide for this implementation")
JMESSAGE(JERR_XMS_READ, "Read from XMS failed")
JMESSAGE(JERR_XMS_WRITE, "Write to XMS failed")
JMESSAGE(JMSG_COPYRIGHT, JCOPYRIGHT_SHORT)
JMESSAGE(JMSG_VERSION, JVERSION)
JMESSAGE(JTRC_16BIT_TABLES,
"Caution: quantization tables are too coarse for baseline JPEG")
JMESSAGE(JTRC_ADOBE,
"Adobe APP14 marker: version %d, flags 0x%04x 0x%04x, transform %d")
JMESSAGE(JTRC_APP0, "Unknown APP0 marker (not JFIF), length %u")
JMESSAGE(JTRC_APP14, "Unknown APP14 marker (not Adobe), length %u")
JMESSAGE(JTRC_DAC, "Define Arithmetic Table 0x%02x: 0x%02x")
JMESSAGE(JTRC_DHT, "Define Huffman Table 0x%02x")
JMESSAGE(JTRC_DQT, "Define Quantization Table %d precision %d")
JMESSAGE(JTRC_DRI, "Define Restart Interval %u")
JMESSAGE(JTRC_EMS_CLOSE, "Freed EMS handle %u")
JMESSAGE(JTRC_EMS_OPEN, "Obtained EMS handle %u")
JMESSAGE(JTRC_EOI, "End Of Image")
JMESSAGE(JTRC_HUFFBITS, " %3d %3d %3d %3d %3d %3d %3d %3d")
JMESSAGE(JTRC_JFIF, "JFIF APP0 marker: version %d.%02d, density %dx%d %d")
JMESSAGE(JTRC_JFIF_BADTHUMBNAILSIZE,
"Warning: thumbnail image size does not match data length %u")
JMESSAGE(JTRC_JFIF_EXTENSION, "JFIF extension marker: type 0x%02x, length %u")
JMESSAGE(JTRC_JFIF_THUMBNAIL, " with %d x %d thumbnail image")
JMESSAGE(JTRC_MISC_MARKER, "Miscellaneous marker 0x%02x, length %u")
JMESSAGE(JTRC_PARMLESS_MARKER, "Unexpected marker 0x%02x")
JMESSAGE(JTRC_QUANTVALS, " %4u %4u %4u %4u %4u %4u %4u %4u")
JMESSAGE(JTRC_QUANT_3_NCOLORS, "Quantizing to %d = %d*%d*%d colors")
JMESSAGE(JTRC_QUANT_NCOLORS, "Quantizing to %d colors")
JMESSAGE(JTRC_QUANT_SELECTED, "Selected %d colors for quantization")
JMESSAGE(JTRC_RECOVERY_ACTION, "At marker 0x%02x, recovery action %d")
JMESSAGE(JTRC_RST, "RST%d")
JMESSAGE(JTRC_SMOOTH_NOTIMPL,
"Smoothing not supported with nonstandard sampling ratios")
JMESSAGE(JTRC_SOF, "Start Of Frame 0x%02x: width=%u, height=%u, components=%d")
JMESSAGE(JTRC_SOF_COMPONENT, " Component %d: %dhx%dv q=%d")
JMESSAGE(JTRC_SOI, "Start of Image")
JMESSAGE(JTRC_SOS, "Start Of Scan: %d components")
JMESSAGE(JTRC_SOS_COMPONENT, " Component %d: dc=%d ac=%d")
JMESSAGE(JTRC_SOS_PARAMS, " Ss=%d, Se=%d, Ah=%d, Al=%d")
JMESSAGE(JTRC_TFILE_CLOSE, "Closed temporary file %s")
JMESSAGE(JTRC_TFILE_OPEN, "Opened temporary file %s")
JMESSAGE(JTRC_THUMB_JPEG,
"JFIF extension marker: JPEG-compressed thumbnail image, length %u")
JMESSAGE(JTRC_THUMB_PALETTE,
"JFIF extension marker: palette thumbnail image, length %u")
JMESSAGE(JTRC_THUMB_RGB,
"JFIF extension marker: RGB thumbnail image, length %u")
JMESSAGE(JTRC_UNKNOWN_IDS,
"Unrecognized component IDs %d %d %d, assuming YCbCr")
JMESSAGE(JTRC_XMS_CLOSE, "Freed XMS handle %u")
JMESSAGE(JTRC_XMS_OPEN, "Obtained XMS handle %u")
JMESSAGE(JWRN_ADOBE_XFORM, "Unknown Adobe color transform code %d")
#if JPEG_LIB_VERSION >= 70
JMESSAGE(JWRN_ARITH_BAD_CODE, "Corrupt JPEG data: bad arithmetic code")
#endif
JMESSAGE(JWRN_BOGUS_PROGRESSION,
"Inconsistent progression sequence for component %d coefficient %d")
JMESSAGE(JWRN_EXTRANEOUS_DATA,
"Corrupt JPEG data: %u extraneous bytes before marker 0x%02x")
JMESSAGE(JWRN_HIT_MARKER, "Corrupt JPEG data: premature end of data segment")
JMESSAGE(JWRN_HUFF_BAD_CODE, "Corrupt JPEG data: bad Huffman code")
JMESSAGE(JWRN_JFIF_MAJOR, "Warning: unknown JFIF revision number %d.%02d")
JMESSAGE(JWRN_JPEG_EOF, "Premature end of JPEG file")
JMESSAGE(JWRN_MUST_RESYNC,
"Corrupt JPEG data: found marker 0x%02x instead of RST%d")
JMESSAGE(JWRN_NOT_SEQUENTIAL, "Invalid SOS parameters for sequential JPEG")
JMESSAGE(JWRN_TOO_MUCH_DATA, "Application transferred too many scanlines")
#if JPEG_LIB_VERSION < 70
JMESSAGE(JERR_BAD_CROP_SPEC, "Invalid crop request")
#if defined(C_ARITH_CODING_SUPPORTED) || defined(D_ARITH_CODING_SUPPORTED)
JMESSAGE(JERR_NO_ARITH_TABLE, "Arithmetic table 0x%02x was not defined")
JMESSAGE(JWRN_ARITH_BAD_CODE, "Corrupt JPEG data: bad arithmetic code")
#endif
#endif
JMESSAGE(JERR_BAD_PARAM, "Bogus parameter")
JMESSAGE(JERR_BAD_PARAM_VALUE, "Bogus parameter value")
JMESSAGE(JERR_UNSUPPORTED_SUSPEND, "I/O suspension not supported in scan optimization")
JMESSAGE(JWRN_BOGUS_ICC, "Corrupt JPEG data: bad ICC marker")
#if JPEG_LIB_VERSION < 70
JMESSAGE(JERR_BAD_DROP_SAMPLING,
"Component index %d: mismatching sampling ratio %d:%d, %d:%d, %c")
#endif
#ifdef JMAKE_ENUM_LIST
JMSG_LASTMSGCODE
} J_MESSAGE_CODE;
#undef JMAKE_ENUM_LIST
#endif /* JMAKE_ENUM_LIST */
/* Zap JMESSAGE macro so that future re-inclusions do nothing by default */
#undef JMESSAGE
#ifndef JERROR_H
#define JERROR_H
/* Macros to simplify using the error and trace message stuff */
/* The first parameter is either type of cinfo pointer */
/* Fatal errors (print message and exit) */
#define ERREXIT(cinfo,code) \
((cinfo)->err->msg_code = (code), \
(*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
#define ERREXIT1(cinfo,code,p1) \
((cinfo)->err->msg_code = (code), \
(cinfo)->err->msg_parm.i[0] = (p1), \
(*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
#define ERREXIT2(cinfo,code,p1,p2) \
((cinfo)->err->msg_code = (code), \
(cinfo)->err->msg_parm.i[0] = (p1), \
(cinfo)->err->msg_parm.i[1] = (p2), \
(*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
#define ERREXIT3(cinfo,code,p1,p2,p3) \
((cinfo)->err->msg_code = (code), \
(cinfo)->err->msg_parm.i[0] = (p1), \
(cinfo)->err->msg_parm.i[1] = (p2), \
(cinfo)->err->msg_parm.i[2] = (p3), \
(*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
#define ERREXIT4(cinfo,code,p1,p2,p3,p4) \
((cinfo)->err->msg_code = (code), \
(cinfo)->err->msg_parm.i[0] = (p1), \
(cinfo)->err->msg_parm.i[1] = (p2), \
(cinfo)->err->msg_parm.i[2] = (p3), \
(cinfo)->err->msg_parm.i[3] = (p4), \
(*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
#define ERREXIT6(cinfo, code, p1, p2, p3, p4, p5, p6) \
((cinfo)->err->msg_code = (code), \
(cinfo)->err->msg_parm.i[0] = (p1), \
(cinfo)->err->msg_parm.i[1] = (p2), \
(cinfo)->err->msg_parm.i[2] = (p3), \
(cinfo)->err->msg_parm.i[3] = (p4), \
(cinfo)->err->msg_parm.i[4] = (p5), \
(cinfo)->err->msg_parm.i[5] = (p6), \
(*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
#define ERREXITS(cinfo, code, str) \
((cinfo)->err->msg_code = (code), \
strncpy((cinfo)->err->msg_parm.s, (str), JMSG_STR_PARM_MAX), \
(cinfo)->err->msg_parm.s[JMSG_STR_PARM_MAX - 1] = '\0', \
(*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
#define MAKESTMT(stuff) do { stuff } while (0)
/* Nonfatal errors (we can keep going, but the data is probably corrupt) */
#define WARNMS(cinfo,code) \
((cinfo)->err->msg_code = (code), \
(*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1))
#define WARNMS1(cinfo,code,p1) \
((cinfo)->err->msg_code = (code), \
(cinfo)->err->msg_parm.i[0] = (p1), \
(*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1))
#define WARNMS2(cinfo,code,p1,p2) \
((cinfo)->err->msg_code = (code), \
(cinfo)->err->msg_parm.i[0] = (p1), \
(cinfo)->err->msg_parm.i[1] = (p2), \
(*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1))
/* Informational/debugging messages */
#define TRACEMS(cinfo,lvl,code) \
((cinfo)->err->msg_code = (code), \
(*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)))
#define TRACEMS1(cinfo,lvl,code,p1) \
((cinfo)->err->msg_code = (code), \
(cinfo)->err->msg_parm.i[0] = (p1), \
(*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)))
#define TRACEMS2(cinfo,lvl,code,p1,p2) \
((cinfo)->err->msg_code = (code), \
(cinfo)->err->msg_parm.i[0] = (p1), \
(cinfo)->err->msg_parm.i[1] = (p2), \
(*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)))
#define TRACEMS3(cinfo,lvl,code,p1,p2,p3) \
MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \
_mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); \
(cinfo)->err->msg_code = (code); \
(*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); )
#define TRACEMS4(cinfo,lvl,code,p1,p2,p3,p4) \
MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \
_mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \
(cinfo)->err->msg_code = (code); \
(*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); )
#define TRACEMS5(cinfo,lvl,code,p1,p2,p3,p4,p5) \
MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \
_mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \
_mp[4] = (p5); \
(cinfo)->err->msg_code = (code); \
(*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); )
#define TRACEMS8(cinfo,lvl,code,p1,p2,p3,p4,p5,p6,p7,p8) \
MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \
_mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \
_mp[4] = (p5); _mp[5] = (p6); _mp[6] = (p7); _mp[7] = (p8); \
(cinfo)->err->msg_code = (code); \
(*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); )
#define TRACEMSS(cinfo,lvl,code,str) \
((cinfo)->err->msg_code = (code), \
strncpy((cinfo)->err->msg_parm.s, (str), JMSG_STR_PARM_MAX), \
(cinfo)->err->msg_parm.s[JMSG_STR_PARM_MAX - 1] = '\0', \
(*(cinfo)->err->emit_message) ((j_common_ptr)(cinfo), (lvl)))
#endif /* JERROR_H */
@@ -0,0 +1,382 @@
/*
* jmorecfg.h
*
* This file was part of the Independent JPEG Group's software:
* Copyright (C) 1991-1997, Thomas G. Lane.
* Modified 1997-2009 by Guido Vollbeding.
* libjpeg-turbo Modifications:
* Copyright (C) 2009, 2011, 2014-2015, 2018, 2020, D. R. Commander.
* For conditions of distribution and use, see the accompanying README.ijg
* file.
*
* This file contains additional configuration options that customize the
* JPEG software for special applications or support machine-dependent
* optimizations. Most users will not need to touch this file.
*/
/*
* Maximum number of components (color channels) allowed in JPEG image.
* To meet the letter of Rec. ITU-T T.81 | ISO/IEC 10918-1, set this to 255.
* However, darn few applications need more than 4 channels (maybe 5 for CMYK +
* alpha mask). We recommend 10 as a reasonable compromise; use 4 if you are
* really short on memory. (Each allowed component costs a hundred or so
* bytes of storage, whether actually used in an image or not.)
*/
#define MAX_COMPONENTS 10 /* maximum number of image components */
/*
* Basic data types.
* You may need to change these if you have a machine with unusual data
* type sizes; for example, "char" not 8 bits, "short" not 16 bits,
* or "long" not 32 bits. We don't care whether "int" is 16 or 32 bits,
* but it had better be at least 16.
*/
/* Representation of a single sample (pixel element value).
* We frequently allocate large arrays of these, so it's important to keep
* them small. But if you have memory to burn and access to char or short
* arrays is very slow on your hardware, you might want to change these.
*/
#if BITS_IN_JSAMPLE == 8
/* JSAMPLE should be the smallest type that will hold the values 0..255.
*/
typedef unsigned char JSAMPLE;
#define GETJSAMPLE(value) ((int)(value))
#define MAXJSAMPLE 255
#define CENTERJSAMPLE 128
#endif /* BITS_IN_JSAMPLE == 8 */
#if BITS_IN_JSAMPLE == 12
/* JSAMPLE should be the smallest type that will hold the values 0..4095.
* On nearly all machines "short" will do nicely.
*/
typedef short JSAMPLE;
#define GETJSAMPLE(value) ((int)(value))
#define MAXJSAMPLE 4095
#define CENTERJSAMPLE 2048
#endif /* BITS_IN_JSAMPLE == 12 */
/* Representation of a DCT frequency coefficient.
* This should be a signed value of at least 16 bits; "short" is usually OK.
* Again, we allocate large arrays of these, but you can change to int
* if you have memory to burn and "short" is really slow.
*/
typedef short JCOEF;
/* Compressed datastreams are represented as arrays of JOCTET.
* These must be EXACTLY 8 bits wide, at least once they are written to
* external storage. Note that when using the stdio data source/destination
* managers, this is also the data type passed to fread/fwrite.
*/
typedef unsigned char JOCTET;
#define GETJOCTET(value) (value)
/* These typedefs are used for various table entries and so forth.
* They must be at least as wide as specified; but making them too big
* won't cost a huge amount of memory, so we don't provide special
* extraction code like we did for JSAMPLE. (In other words, these
* typedefs live at a different point on the speed/space tradeoff curve.)
*/
/* UINT8 must hold at least the values 0..255. */
typedef unsigned char UINT8;
/* UINT16 must hold at least the values 0..65535. */
typedef unsigned short UINT16;
/* INT16 must hold at least the values -32768..32767. */
#ifndef XMD_H /* X11/xmd.h correctly defines INT16 */
typedef short INT16;
#endif
/* INT32 must hold at least signed 32-bit values.
*
* NOTE: The INT32 typedef dates back to libjpeg v5 (1994.) Integers were
* sometimes 16-bit back then (MS-DOS), which is why INT32 is typedef'd to
* long. It also wasn't common (or at least as common) in 1994 for INT32 to be
* defined by platform headers. Since then, however, INT32 is defined in
* several other common places:
*
* Xmd.h (X11 header) typedefs INT32 to int on 64-bit platforms and long on
* 32-bit platforms (i.e always a 32-bit signed type.)
*
* basetsd.h (Win32 header) typedefs INT32 to int (always a 32-bit signed type
* on modern platforms.)
*
* qglobal.h (Qt header) typedefs INT32 to int (always a 32-bit signed type on
* modern platforms.)
*
* This is a recipe for conflict, since "long" and "int" aren't always
* compatible types. Since the definition of INT32 has technically been part
* of the libjpeg API for more than 20 years, we can't remove it, but we do not
* use it internally any longer. We instead define a separate type (JLONG)
* for internal use, which ensures that internal behavior will always be the
* same regardless of any external headers that may be included.
*/
#ifndef XMD_H /* X11/xmd.h correctly defines INT32 */
#ifndef _BASETSD_H_ /* Microsoft defines it in basetsd.h */
#ifndef _BASETSD_H /* MinGW is slightly different */
#ifndef QGLOBAL_H /* Qt defines it in qglobal.h */
typedef long INT32;
#endif
#endif
#endif
#endif
/* Datatype used for image dimensions. The JPEG standard only supports
* images up to 64K*64K due to 16-bit fields in SOF markers. Therefore
* "unsigned int" is sufficient on all machines. However, if you need to
* handle larger images and you don't mind deviating from the spec, you
* can change this datatype. (Note that changing this datatype will
* potentially require modifying the SIMD code. The x86-64 SIMD extensions,
* in particular, assume a 32-bit JDIMENSION.)
*/
typedef unsigned int JDIMENSION;
#define JPEG_MAX_DIMENSION 65500L /* a tad under 64K to prevent overflows */
/* These macros are used in all function definitions and extern declarations.
* You could modify them if you need to change function linkage conventions;
* in particular, you'll need to do that to make the library a Windows DLL.
* Another application is to make all functions global for use with debuggers
* or code profilers that require it.
*/
/* a function called through method pointers: */
#define METHODDEF(type) static type
/* a function used only in its module: */
#define LOCAL(type) static type
/* a function referenced thru EXTERNs: */
#define GLOBAL(type) type
/* a reference to a GLOBAL function: */
#define EXTERN(type) extern type
/* Originally, this macro was used as a way of defining function prototypes
* for both modern compilers as well as older compilers that did not support
* prototype parameters. libjpeg-turbo has never supported these older,
* non-ANSI compilers, but the macro is still included because there is some
* software out there that uses it.
*/
#define JMETHOD(type, methodname, arglist) type (*methodname) arglist
/* libjpeg-turbo no longer supports platforms that have far symbols (MS-DOS),
* but again, some software relies on this macro.
*/
#undef FAR
#define FAR
/*
* On a few systems, type boolean and/or its values FALSE, TRUE may appear
* in standard header files. Or you may have conflicts with application-
* specific header files that you want to include together with these files.
* Defining HAVE_BOOLEAN before including jpeglib.h should make it work.
*/
#ifndef HAVE_BOOLEAN
typedef int boolean;
#endif
#ifndef FALSE /* in case these macros already exist */
#define FALSE 0 /* values of boolean */
#endif
#ifndef TRUE
#define TRUE 1
#endif
/*
* The remaining options affect code selection within the JPEG library,
* but they don't need to be visible to most applications using the library.
* To minimize application namespace pollution, the symbols won't be
* defined unless JPEG_INTERNALS or JPEG_INTERNAL_OPTIONS has been defined.
*/
#ifdef JPEG_INTERNALS
#define JPEG_INTERNAL_OPTIONS
#endif
#ifdef JPEG_INTERNAL_OPTIONS
/*
* These defines indicate whether to include various optional functions.
* Undefining some of these symbols will produce a smaller but less capable
* library. Note that you can leave certain source files out of the
* compilation/linking process if you've #undef'd the corresponding symbols.
* (You may HAVE to do that if your compiler doesn't like null source files.)
*/
/* Capability options common to encoder and decoder: */
#define DCT_ISLOW_SUPPORTED /* accurate integer method */
#define DCT_IFAST_SUPPORTED /* less accurate int method [legacy feature] */
#define DCT_FLOAT_SUPPORTED /* floating-point method [legacy feature] */
/* Encoder capability options: */
#define C_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */
#define C_PROGRESSIVE_SUPPORTED /* Progressive JPEG? (Requires MULTISCAN)*/
#define ENTROPY_OPT_SUPPORTED /* Optimization of entropy coding parms? */
/* Note: if you selected 12-bit data precision, it is dangerous to turn off
* ENTROPY_OPT_SUPPORTED. The standard Huffman tables are only good for 8-bit
* precision, so jchuff.c normally uses entropy optimization to compute
* usable tables for higher precision. If you don't want to do optimization,
* you'll have to supply different default Huffman tables.
* The exact same statements apply for progressive JPEG: the default tables
* don't work for progressive mode. (This may get fixed, however.)
*/
#define INPUT_SMOOTHING_SUPPORTED /* Input image smoothing option? */
/* Decoder capability options: */
#define D_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */
#define D_PROGRESSIVE_SUPPORTED /* Progressive JPEG? (Requires MULTISCAN)*/
#define SAVE_MARKERS_SUPPORTED /* jpeg_save_markers() needed? */
#define BLOCK_SMOOTHING_SUPPORTED /* Block smoothing? (Progressive only) */
#define IDCT_SCALING_SUPPORTED /* Output rescaling via IDCT? */
#undef UPSAMPLE_SCALING_SUPPORTED /* Output rescaling at upsample stage? */
#define UPSAMPLE_MERGING_SUPPORTED /* Fast path for sloppy upsampling? */
#define QUANT_1PASS_SUPPORTED /* 1-pass color quantization? */
#define QUANT_2PASS_SUPPORTED /* 2-pass color quantization? */
/* more capability options later, no doubt */
/*
* The RGB_RED, RGB_GREEN, RGB_BLUE, and RGB_PIXELSIZE macros are a vestigial
* feature of libjpeg. The idea was that, if an application developer needed
* to compress from/decompress to a BGR/BGRX/RGBX/XBGR/XRGB buffer, they could
* change these macros, rebuild libjpeg, and link their application statically
* with it. In reality, few people ever did this, because there were some
* severe restrictions involved (cjpeg and djpeg no longer worked properly,
* compressing/decompressing RGB JPEGs no longer worked properly, and the color
* quantizer wouldn't work with pixel sizes other than 3.) Furthermore, since
* all of the O/S-supplied versions of libjpeg were built with the default
* values of RGB_RED, RGB_GREEN, RGB_BLUE, and RGB_PIXELSIZE, many applications
* have come to regard these values as immutable.
*
* The libjpeg-turbo colorspace extensions provide a much cleaner way of
* compressing from/decompressing to buffers with arbitrary component orders
* and pixel sizes. Thus, we do not support changing the values of RGB_RED,
* RGB_GREEN, RGB_BLUE, or RGB_PIXELSIZE. In addition to the restrictions
* listed above, changing these values will also break the SIMD extensions and
* the regression tests.
*/
#define RGB_RED 0 /* Offset of Red in an RGB scanline element */
#define RGB_GREEN 1 /* Offset of Green */
#define RGB_BLUE 2 /* Offset of Blue */
#define RGB_PIXELSIZE 3 /* JSAMPLEs per RGB scanline element */
#define JPEG_NUMCS 17
#define EXT_RGB_RED 0
#define EXT_RGB_GREEN 1
#define EXT_RGB_BLUE 2
#define EXT_RGB_PIXELSIZE 3
#define EXT_RGBX_RED 0
#define EXT_RGBX_GREEN 1
#define EXT_RGBX_BLUE 2
#define EXT_RGBX_PIXELSIZE 4
#define EXT_BGR_RED 2
#define EXT_BGR_GREEN 1
#define EXT_BGR_BLUE 0
#define EXT_BGR_PIXELSIZE 3
#define EXT_BGRX_RED 2
#define EXT_BGRX_GREEN 1
#define EXT_BGRX_BLUE 0
#define EXT_BGRX_PIXELSIZE 4
#define EXT_XBGR_RED 3
#define EXT_XBGR_GREEN 2
#define EXT_XBGR_BLUE 1
#define EXT_XBGR_PIXELSIZE 4
#define EXT_XRGB_RED 1
#define EXT_XRGB_GREEN 2
#define EXT_XRGB_BLUE 3
#define EXT_XRGB_PIXELSIZE 4
static const int rgb_red[JPEG_NUMCS] = {
-1, -1, RGB_RED, -1, -1, -1, EXT_RGB_RED, EXT_RGBX_RED,
EXT_BGR_RED, EXT_BGRX_RED, EXT_XBGR_RED, EXT_XRGB_RED,
EXT_RGBX_RED, EXT_BGRX_RED, EXT_XBGR_RED, EXT_XRGB_RED,
-1
};
static const int rgb_green[JPEG_NUMCS] = {
-1, -1, RGB_GREEN, -1, -1, -1, EXT_RGB_GREEN, EXT_RGBX_GREEN,
EXT_BGR_GREEN, EXT_BGRX_GREEN, EXT_XBGR_GREEN, EXT_XRGB_GREEN,
EXT_RGBX_GREEN, EXT_BGRX_GREEN, EXT_XBGR_GREEN, EXT_XRGB_GREEN,
-1
};
static const int rgb_blue[JPEG_NUMCS] = {
-1, -1, RGB_BLUE, -1, -1, -1, EXT_RGB_BLUE, EXT_RGBX_BLUE,
EXT_BGR_BLUE, EXT_BGRX_BLUE, EXT_XBGR_BLUE, EXT_XRGB_BLUE,
EXT_RGBX_BLUE, EXT_BGRX_BLUE, EXT_XBGR_BLUE, EXT_XRGB_BLUE,
-1
};
static const int rgb_pixelsize[JPEG_NUMCS] = {
-1, -1, RGB_PIXELSIZE, -1, -1, -1, EXT_RGB_PIXELSIZE, EXT_RGBX_PIXELSIZE,
EXT_BGR_PIXELSIZE, EXT_BGRX_PIXELSIZE, EXT_XBGR_PIXELSIZE, EXT_XRGB_PIXELSIZE,
EXT_RGBX_PIXELSIZE, EXT_BGRX_PIXELSIZE, EXT_XBGR_PIXELSIZE, EXT_XRGB_PIXELSIZE,
-1
};
/* Definitions for speed-related optimizations. */
/* On some machines (notably 68000 series) "int" is 32 bits, but multiplying
* two 16-bit shorts is faster than multiplying two ints. Define MULTIPLIER
* as short on such a machine. MULTIPLIER must be at least 16 bits wide.
*/
#ifndef MULTIPLIER
#ifndef WITH_SIMD
#define MULTIPLIER int /* type for fastest integer multiply */
#else
#define MULTIPLIER short /* prefer 16-bit with SIMD for parellelism */
#endif
#endif
/* FAST_FLOAT should be either float or double, whichever is done faster
* by your compiler. (Note that this type is only used in the floating point
* DCT routines, so it only matters if you've defined DCT_FLOAT_SUPPORTED.)
*/
#ifndef FAST_FLOAT
#define FAST_FLOAT float
#endif
#endif /* JPEG_INTERNAL_OPTIONS */
@@ -0,0 +1,375 @@
/*
* jpegint.h
*
* This file was part of the Independent JPEG Group's software:
* Copyright (C) 1991-1997, Thomas G. Lane.
* Modified 1997-2009 by Guido Vollbeding.
* libjpeg-turbo Modifications:
* Copyright (C) 2015-2016, 2019, 2021, D. R. Commander.
* Copyright (C) 2015, Google, Inc.
* Copyright (C) 2021, Alex Richardson.
* For conditions of distribution and use, see the accompanying README.ijg
* file.
*
* This file provides common declarations for the various JPEG modules.
* These declarations are considered internal to the JPEG library; most
* applications using the library shouldn't need to include this file.
*/
/* Declarations for both compression & decompression */
typedef enum { /* Operating modes for buffer controllers */
JBUF_PASS_THRU, /* Plain stripwise operation */
/* Remaining modes require a full-image buffer to have been created */
JBUF_SAVE_SOURCE, /* Run source subobject only, save output */
JBUF_CRANK_DEST, /* Run dest subobject only, using saved data */
JBUF_SAVE_AND_PASS /* Run both subobjects, save output */
} J_BUF_MODE;
/* Values of global_state field (jdapi.c has some dependencies on ordering!) */
#define CSTATE_START 100 /* after create_compress */
#define CSTATE_SCANNING 101 /* start_compress done, write_scanlines OK */
#define CSTATE_RAW_OK 102 /* start_compress done, write_raw_data OK */
#define CSTATE_WRCOEFS 103 /* jpeg_write_coefficients done */
#define DSTATE_START 200 /* after create_decompress */
#define DSTATE_INHEADER 201 /* reading header markers, no SOS yet */
#define DSTATE_READY 202 /* found SOS, ready for start_decompress */
#define DSTATE_PRELOAD 203 /* reading multiscan file in start_decompress*/
#define DSTATE_PRESCAN 204 /* performing dummy pass for 2-pass quant */
#define DSTATE_SCANNING 205 /* start_decompress done, read_scanlines OK */
#define DSTATE_RAW_OK 206 /* start_decompress done, read_raw_data OK */
#define DSTATE_BUFIMAGE 207 /* expecting jpeg_start_output */
#define DSTATE_BUFPOST 208 /* looking for SOS/EOI in jpeg_finish_output */
#define DSTATE_RDCOEFS 209 /* reading file in jpeg_read_coefficients */
#define DSTATE_STOPPING 210 /* looking for EOI in jpeg_finish_decompress */
/* JLONG must hold at least signed 32-bit values. */
typedef long JLONG;
/* JUINTPTR must hold pointer values. */
#ifdef __UINTPTR_TYPE__
/*
* __UINTPTR_TYPE__ is GNU-specific and available in GCC 4.6+ and Clang 3.0+.
* Fortunately, that is sufficient to support the few architectures for which
* sizeof(void *) != sizeof(size_t). The only other options would require C99
* or Clang-specific builtins.
*/
typedef __UINTPTR_TYPE__ JUINTPTR;
#else
typedef size_t JUINTPTR;
#endif
/*
* Left shift macro that handles a negative operand without causing any
* sanitizer warnings
*/
#define LEFT_SHIFT(a, b) ((JLONG)((unsigned long)(a) << (b)))
/* Declarations for compression modules */
/* Master control module */
struct jpeg_comp_master {
void (*prepare_for_pass) (j_compress_ptr cinfo);
void (*pass_startup) (j_compress_ptr cinfo);
void (*finish_pass) (j_compress_ptr cinfo);
/* State variables made visible to other modules */
boolean call_pass_startup; /* True if pass_startup must be called */
boolean is_last_pass; /* True during last pass */
};
/* Main buffer control (downsampled-data buffer) */
struct jpeg_c_main_controller {
void (*start_pass) (j_compress_ptr cinfo, J_BUF_MODE pass_mode);
void (*process_data) (j_compress_ptr cinfo, JSAMPARRAY input_buf,
JDIMENSION *in_row_ctr, JDIMENSION in_rows_avail);
};
/* Compression preprocessing (downsampling input buffer control) */
struct jpeg_c_prep_controller {
void (*start_pass) (j_compress_ptr cinfo, J_BUF_MODE pass_mode);
void (*pre_process_data) (j_compress_ptr cinfo, JSAMPARRAY input_buf,
JDIMENSION *in_row_ctr, JDIMENSION in_rows_avail,
JSAMPIMAGE output_buf,
JDIMENSION *out_row_group_ctr,
JDIMENSION out_row_groups_avail);
};
/* Coefficient buffer control */
struct jpeg_c_coef_controller {
void (*start_pass) (j_compress_ptr cinfo, J_BUF_MODE pass_mode);
boolean (*compress_data) (j_compress_ptr cinfo, JSAMPIMAGE input_buf);
};
/* Colorspace conversion */
struct jpeg_color_converter {
void (*start_pass) (j_compress_ptr cinfo);
void (*color_convert) (j_compress_ptr cinfo, JSAMPARRAY input_buf,
JSAMPIMAGE output_buf, JDIMENSION output_row,
int num_rows);
};
/* Downsampling */
struct jpeg_downsampler {
void (*start_pass) (j_compress_ptr cinfo);
void (*downsample) (j_compress_ptr cinfo, JSAMPIMAGE input_buf,
JDIMENSION in_row_index, JSAMPIMAGE output_buf,
JDIMENSION out_row_group_index);
boolean need_context_rows; /* TRUE if need rows above & below */
};
/* Forward DCT (also controls coefficient quantization) */
struct jpeg_forward_dct {
void (*start_pass) (j_compress_ptr cinfo);
/* perhaps this should be an array??? */
void (*forward_DCT) (j_compress_ptr cinfo, jpeg_component_info *compptr,
JSAMPARRAY sample_data, JBLOCKROW coef_blocks,
JDIMENSION start_row, JDIMENSION start_col,
JDIMENSION num_blocks);
};
/* Entropy encoding */
struct jpeg_entropy_encoder {
void (*start_pass) (j_compress_ptr cinfo, boolean gather_statistics);
boolean (*encode_mcu) (j_compress_ptr cinfo, JBLOCKROW *MCU_data);
void (*finish_pass) (j_compress_ptr cinfo);
};
/* Marker writing */
struct jpeg_marker_writer {
void (*write_file_header) (j_compress_ptr cinfo);
void (*write_frame_header) (j_compress_ptr cinfo);
void (*write_scan_header) (j_compress_ptr cinfo);
void (*write_file_trailer) (j_compress_ptr cinfo);
void (*write_tables_only) (j_compress_ptr cinfo);
/* These routines are exported to allow insertion of extra markers */
/* Probably only COM and APPn markers should be written this way */
void (*write_marker_header) (j_compress_ptr cinfo, int marker,
unsigned int datalen);
void (*write_marker_byte) (j_compress_ptr cinfo, int val);
};
/* Declarations for decompression modules */
/* Master control module */
struct jpeg_decomp_master {
void (*prepare_for_output_pass) (j_decompress_ptr cinfo);
void (*finish_output_pass) (j_decompress_ptr cinfo);
/* State variables made visible to other modules */
boolean is_dummy_pass; /* True during 1st pass for 2-pass quant */
/* Partial decompression variables */
JDIMENSION first_iMCU_col;
JDIMENSION last_iMCU_col;
JDIMENSION first_MCU_col[MAX_COMPONENTS];
JDIMENSION last_MCU_col[MAX_COMPONENTS];
boolean jinit_upsampler_no_alloc;
/* Last iMCU row that was successfully decoded */
JDIMENSION last_good_iMCU_row;
};
/* Input control module */
struct jpeg_input_controller {
int (*consume_input) (j_decompress_ptr cinfo);
void (*reset_input_controller) (j_decompress_ptr cinfo);
void (*start_input_pass) (j_decompress_ptr cinfo);
void (*finish_input_pass) (j_decompress_ptr cinfo);
/* State variables made visible to other modules */
boolean has_multiple_scans; /* True if file has multiple scans */
boolean eoi_reached; /* True when EOI has been consumed */
};
/* Main buffer control (downsampled-data buffer) */
struct jpeg_d_main_controller {
void (*start_pass) (j_decompress_ptr cinfo, J_BUF_MODE pass_mode);
void (*process_data) (j_decompress_ptr cinfo, JSAMPARRAY output_buf,
JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail);
};
/* Coefficient buffer control */
struct jpeg_d_coef_controller {
void (*start_input_pass) (j_decompress_ptr cinfo);
int (*consume_data) (j_decompress_ptr cinfo);
void (*start_output_pass) (j_decompress_ptr cinfo);
int (*decompress_data) (j_decompress_ptr cinfo, JSAMPIMAGE output_buf);
/* Pointer to array of coefficient virtual arrays, or NULL if none */
jvirt_barray_ptr *coef_arrays;
};
/* Decompression postprocessing (color quantization buffer control) */
struct jpeg_d_post_controller {
void (*start_pass) (j_decompress_ptr cinfo, J_BUF_MODE pass_mode);
void (*post_process_data) (j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
JDIMENSION *in_row_group_ctr,
JDIMENSION in_row_groups_avail,
JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
JDIMENSION out_rows_avail);
};
/* Marker reading & parsing */
struct jpeg_marker_reader {
void (*reset_marker_reader) (j_decompress_ptr cinfo);
/* Read markers until SOS or EOI.
* Returns same codes as are defined for jpeg_consume_input:
* JPEG_SUSPENDED, JPEG_REACHED_SOS, or JPEG_REACHED_EOI.
*/
int (*read_markers) (j_decompress_ptr cinfo);
/* Read a restart marker --- exported for use by entropy decoder only */
jpeg_marker_parser_method read_restart_marker;
/* State of marker reader --- nominally internal, but applications
* supplying COM or APPn handlers might like to know the state.
*/
boolean saw_SOI; /* found SOI? */
boolean saw_SOF; /* found SOF? */
int next_restart_num; /* next restart number expected (0-7) */
unsigned int discarded_bytes; /* # of bytes skipped looking for a marker */
};
/* Entropy decoding */
struct jpeg_entropy_decoder {
void (*start_pass) (j_decompress_ptr cinfo);
boolean (*decode_mcu) (j_decompress_ptr cinfo, JBLOCKROW *MCU_data);
/* This is here to share code between baseline and progressive decoders; */
/* other modules probably should not use it */
boolean insufficient_data; /* set TRUE after emitting warning */
};
/* Inverse DCT (also performs dequantization) */
typedef void (*inverse_DCT_method_ptr) (j_decompress_ptr cinfo,
jpeg_component_info *compptr,
JCOEFPTR coef_block,
JSAMPARRAY output_buf,
JDIMENSION output_col);
struct jpeg_inverse_dct {
void (*start_pass) (j_decompress_ptr cinfo);
/* It is useful to allow each component to have a separate IDCT method. */
inverse_DCT_method_ptr inverse_DCT[MAX_COMPONENTS];
};
/* Upsampling (note that upsampler must also call color converter) */
struct jpeg_upsampler {
void (*start_pass) (j_decompress_ptr cinfo);
void (*upsample) (j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
JDIMENSION *in_row_group_ctr,
JDIMENSION in_row_groups_avail, JSAMPARRAY output_buf,
JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail);
boolean need_context_rows; /* TRUE if need rows above & below */
};
/* Colorspace conversion */
struct jpeg_color_deconverter {
void (*start_pass) (j_decompress_ptr cinfo);
void (*color_convert) (j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
JDIMENSION input_row, JSAMPARRAY output_buf,
int num_rows);
};
/* Color quantization or color precision reduction */
struct jpeg_color_quantizer {
void (*start_pass) (j_decompress_ptr cinfo, boolean is_pre_scan);
void (*color_quantize) (j_decompress_ptr cinfo, JSAMPARRAY input_buf,
JSAMPARRAY output_buf, int num_rows);
void (*finish_pass) (j_decompress_ptr cinfo);
void (*new_color_map) (j_decompress_ptr cinfo);
};
/* Miscellaneous useful macros */
#undef MAX
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#undef MIN
#define MIN(a, b) ((a) < (b) ? (a) : (b))
/* We assume that right shift corresponds to signed division by 2 with
* rounding towards minus infinity. This is correct for typical "arithmetic
* shift" instructions that shift in copies of the sign bit. But some
* C compilers implement >> with an unsigned shift. For these machines you
* must define RIGHT_SHIFT_IS_UNSIGNED.
* RIGHT_SHIFT provides a proper signed right shift of a JLONG quantity.
* It is only applied with constant shift counts. SHIFT_TEMPS must be
* included in the variables of any routine using RIGHT_SHIFT.
*/
#ifdef RIGHT_SHIFT_IS_UNSIGNED
#define SHIFT_TEMPS JLONG shift_temp;
#define RIGHT_SHIFT(x, shft) \
((shift_temp = (x)) < 0 ? \
(shift_temp >> (shft)) | ((~((JLONG)0)) << (32 - (shft))) : \
(shift_temp >> (shft)))
#else
#define SHIFT_TEMPS
#define RIGHT_SHIFT(x, shft) ((x) >> (shft))
#endif
/* Compression module initialization routines */
EXTERN(void) jinit_compress_master(j_compress_ptr cinfo);
EXTERN(void) jinit_c_master_control(j_compress_ptr cinfo,
boolean transcode_only);
EXTERN(void) jinit_c_main_controller(j_compress_ptr cinfo,
boolean need_full_buffer);
EXTERN(void) jinit_c_prep_controller(j_compress_ptr cinfo,
boolean need_full_buffer);
EXTERN(void) jinit_c_coef_controller(j_compress_ptr cinfo,
boolean need_full_buffer);
EXTERN(void) jinit_color_converter(j_compress_ptr cinfo);
EXTERN(void) jinit_downsampler(j_compress_ptr cinfo);
EXTERN(void) jinit_forward_dct(j_compress_ptr cinfo);
EXTERN(void) jinit_huff_encoder(j_compress_ptr cinfo);
EXTERN(void) jinit_phuff_encoder(j_compress_ptr cinfo);
EXTERN(void) jinit_arith_encoder(j_compress_ptr cinfo);
EXTERN(void) jinit_marker_writer(j_compress_ptr cinfo);
/* Decompression module initialization routines */
EXTERN(void) jinit_master_decompress(j_decompress_ptr cinfo);
EXTERN(void) jinit_d_main_controller(j_decompress_ptr cinfo,
boolean need_full_buffer);
EXTERN(void) jinit_d_coef_controller(j_decompress_ptr cinfo,
boolean need_full_buffer);
EXTERN(void) jinit_d_post_controller(j_decompress_ptr cinfo,
boolean need_full_buffer);
EXTERN(void) jinit_input_controller(j_decompress_ptr cinfo);
EXTERN(void) jinit_marker_reader(j_decompress_ptr cinfo);
EXTERN(void) jinit_huff_decoder(j_decompress_ptr cinfo);
EXTERN(void) jinit_phuff_decoder(j_decompress_ptr cinfo);
EXTERN(void) jinit_arith_decoder(j_decompress_ptr cinfo);
EXTERN(void) jinit_inverse_dct(j_decompress_ptr cinfo);
EXTERN(void) jinit_upsampler(j_decompress_ptr cinfo);
EXTERN(void) jinit_color_deconverter(j_decompress_ptr cinfo);
EXTERN(void) jinit_1pass_quantizer(j_decompress_ptr cinfo);
EXTERN(void) jinit_2pass_quantizer(j_decompress_ptr cinfo);
EXTERN(void) jinit_merged_upsampler(j_decompress_ptr cinfo);
/* Memory manager initialization */
EXTERN(void) jinit_memory_mgr(j_common_ptr cinfo);
/* Utility routines in jutils.c */
EXTERN(long) jdiv_round_up(long a, long b);
EXTERN(long) jround_up(long a, long b);
EXTERN(void) jcopy_sample_rows(JSAMPARRAY input_array, int source_row,
JSAMPARRAY output_array, int dest_row,
int num_rows, JDIMENSION num_cols);
EXTERN(void) jcopy_block_row(JBLOCKROW input_row, JBLOCKROW output_row,
JDIMENSION num_blocks);
EXTERN(void) jzero_far(void *target, size_t bytestozero);
/* Constant tables in jutils.c */
#if 0 /* This table is not actually needed in v6a */
extern const int jpeg_zigzag_order[]; /* natural coef order to zigzag order */
#endif
extern const int jpeg_natural_order[]; /* zigzag coef order to natural order */
/* Arithmetic coding probability estimation tables in jaricom.c */
extern const JLONG jpeg_aritab[];
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,202 @@
#pragma once
/* Auto-generated by build_jpegli_static_android_ndk_r26_api21_private_v10_ifs_parse_fix.sh. */
/* Include this header instead of jpegli/jpeglib.h when using the private-symbol Jpegli archive. */
/* It remaps the libjpeg-compatible API to kjpegli_* symbols to avoid collisions with MozJPEG/Ghostscript. */
#ifndef jpegli_CreateCompress
#define jpegli_CreateCompress kjpegli_jpegli_CreateCompress
#endif
#ifndef jpegli_CreateDecompress
#define jpegli_CreateDecompress kjpegli_jpegli_CreateDecompress
#endif
#ifndef jpegli_abort
#define jpegli_abort kjpegli_jpegli_abort
#endif
#ifndef jpegli_abort_compress
#define jpegli_abort_compress kjpegli_jpegli_abort_compress
#endif
#ifndef jpegli_abort_decompress
#define jpegli_abort_decompress kjpegli_jpegli_abort_decompress
#endif
#ifndef jpegli_add_quant_table
#define jpegli_add_quant_table kjpegli_jpegli_add_quant_table
#endif
#ifndef jpegli_alloc_huff_table
#define jpegli_alloc_huff_table kjpegli_jpegli_alloc_huff_table
#endif
#ifndef jpegli_alloc_quant_table
#define jpegli_alloc_quant_table kjpegli_jpegli_alloc_quant_table
#endif
#ifndef jpegli_bytes_per_sample
#define jpegli_bytes_per_sample kjpegli_jpegli_bytes_per_sample
#endif
#ifndef jpegli_calc_output_dimensions
#define jpegli_calc_output_dimensions kjpegli_jpegli_calc_output_dimensions
#endif
#ifndef jpegli_consume_input
#define jpegli_consume_input kjpegli_jpegli_consume_input
#endif
#ifndef jpegli_copy_critical_parameters
#define jpegli_copy_critical_parameters kjpegli_jpegli_copy_critical_parameters
#endif
#ifndef jpegli_crop_scanline
#define jpegli_crop_scanline kjpegli_jpegli_crop_scanline
#endif
#ifndef jpegli_default_colorspace
#define jpegli_default_colorspace kjpegli_jpegli_default_colorspace
#endif
#ifndef jpegli_destroy
#define jpegli_destroy kjpegli_jpegli_destroy
#endif
#ifndef jpegli_destroy_compress
#define jpegli_destroy_compress kjpegli_jpegli_destroy_compress
#endif
#ifndef jpegli_destroy_decompress
#define jpegli_destroy_decompress kjpegli_jpegli_destroy_decompress
#endif
#ifndef jpegli_enable_adaptive_quantization
#define jpegli_enable_adaptive_quantization kjpegli_jpegli_enable_adaptive_quantization
#endif
#ifndef jpegli_finish_compress
#define jpegli_finish_compress kjpegli_jpegli_finish_compress
#endif
#ifndef jpegli_finish_decompress
#define jpegli_finish_decompress kjpegli_jpegli_finish_decompress
#endif
#ifndef jpegli_finish_output
#define jpegli_finish_output kjpegli_jpegli_finish_output
#endif
#ifndef jpegli_has_multiple_scans
#define jpegli_has_multiple_scans kjpegli_jpegli_has_multiple_scans
#endif
#ifndef jpegli_input_complete
#define jpegli_input_complete kjpegli_jpegli_input_complete
#endif
#ifndef jpegli_mem_dest
#define jpegli_mem_dest kjpegli_jpegli_mem_dest
#endif
#ifndef jpegli_mem_src
#define jpegli_mem_src kjpegli_jpegli_mem_src
#endif
#ifndef jpegli_new_colormap
#define jpegli_new_colormap kjpegli_jpegli_new_colormap
#endif
#ifndef jpegli_quality_scaling
#define jpegli_quality_scaling kjpegli_jpegli_quality_scaling
#endif
#ifndef jpegli_quality_to_distance
#define jpegli_quality_to_distance kjpegli_jpegli_quality_to_distance
#endif
#ifndef jpegli_read_coefficients
#define jpegli_read_coefficients kjpegli_jpegli_read_coefficients
#endif
#ifndef jpegli_read_header
#define jpegli_read_header kjpegli_jpegli_read_header
#endif
#ifndef jpegli_read_icc_profile
#define jpegli_read_icc_profile kjpegli_jpegli_read_icc_profile
#endif
#ifndef jpegli_read_raw_data
#define jpegli_read_raw_data kjpegli_jpegli_read_raw_data
#endif
#ifndef jpegli_read_scanlines
#define jpegli_read_scanlines kjpegli_jpegli_read_scanlines
#endif
#ifndef jpegli_resync_to_restart
#define jpegli_resync_to_restart kjpegli_jpegli_resync_to_restart
#endif
#ifndef jpegli_save_markers
#define jpegli_save_markers kjpegli_jpegli_save_markers
#endif
#ifndef jpegli_set_cicp_transfer_function
#define jpegli_set_cicp_transfer_function kjpegli_jpegli_set_cicp_transfer_function
#endif
#ifndef jpegli_set_colorspace
#define jpegli_set_colorspace kjpegli_jpegli_set_colorspace
#endif
#ifndef jpegli_set_defaults
#define jpegli_set_defaults kjpegli_jpegli_set_defaults
#endif
#ifndef jpegli_set_distance
#define jpegli_set_distance kjpegli_jpegli_set_distance
#endif
#ifndef jpegli_set_input_format
#define jpegli_set_input_format kjpegli_jpegli_set_input_format
#endif
#ifndef jpegli_set_linear_quality
#define jpegli_set_linear_quality kjpegli_jpegli_set_linear_quality
#endif
#ifndef jpegli_set_marker_processor
#define jpegli_set_marker_processor kjpegli_jpegli_set_marker_processor
#endif
#ifndef jpegli_set_output_format
#define jpegli_set_output_format kjpegli_jpegli_set_output_format
#endif
#ifndef jpegli_set_progressive_level
#define jpegli_set_progressive_level kjpegli_jpegli_set_progressive_level
#endif
#ifndef jpegli_set_psnr
#define jpegli_set_psnr kjpegli_jpegli_set_psnr
#endif
#ifndef jpegli_set_quality
#define jpegli_set_quality kjpegli_jpegli_set_quality
#endif
#ifndef jpegli_set_xyb_mode
#define jpegli_set_xyb_mode kjpegli_jpegli_set_xyb_mode
#endif
#ifndef jpegli_simple_progression
#define jpegli_simple_progression kjpegli_jpegli_simple_progression
#endif
#ifndef jpegli_skip_scanlines
#define jpegli_skip_scanlines kjpegli_jpegli_skip_scanlines
#endif
#ifndef jpegli_start_compress
#define jpegli_start_compress kjpegli_jpegli_start_compress
#endif
#ifndef jpegli_start_decompress
#define jpegli_start_decompress kjpegli_jpegli_start_decompress
#endif
#ifndef jpegli_start_output
#define jpegli_start_output kjpegli_jpegli_start_output
#endif
#ifndef jpegli_std_error
#define jpegli_std_error kjpegli_jpegli_std_error
#endif
#ifndef jpegli_stdio_dest
#define jpegli_stdio_dest kjpegli_jpegli_stdio_dest
#endif
#ifndef jpegli_stdio_src
#define jpegli_stdio_src kjpegli_jpegli_stdio_src
#endif
#ifndef jpegli_suppress_tables
#define jpegli_suppress_tables kjpegli_jpegli_suppress_tables
#endif
#ifndef jpegli_use_standard_quant_tables
#define jpegli_use_standard_quant_tables kjpegli_jpegli_use_standard_quant_tables
#endif
#ifndef jpegli_write_coefficients
#define jpegli_write_coefficients kjpegli_jpegli_write_coefficients
#endif
#ifndef jpegli_write_icc_profile
#define jpegli_write_icc_profile kjpegli_jpegli_write_icc_profile
#endif
#ifndef jpegli_write_m_byte
#define jpegli_write_m_byte kjpegli_jpegli_write_m_byte
#endif
#ifndef jpegli_write_m_header
#define jpegli_write_m_header kjpegli_jpegli_write_m_header
#endif
#ifndef jpegli_write_marker
#define jpegli_write_marker kjpegli_jpegli_write_marker
#endif
#ifndef jpegli_write_raw_data
#define jpegli_write_raw_data kjpegli_jpegli_write_raw_data
#endif
#ifndef jpegli_write_scanlines
#define jpegli_write_scanlines kjpegli_jpegli_write_scanlines
#endif
#ifndef jpegli_write_tables
#define jpegli_write_tables kjpegli_jpegli_write_tables
#endif
#include <jpegli/jpeglib.h>
@@ -0,0 +1,65 @@
jpegli_CreateCompress kjpegli_jpegli_CreateCompress
jpegli_CreateDecompress kjpegli_jpegli_CreateDecompress
jpegli_abort kjpegli_jpegli_abort
jpegli_abort_compress kjpegli_jpegli_abort_compress
jpegli_abort_decompress kjpegli_jpegli_abort_decompress
jpegli_add_quant_table kjpegli_jpegli_add_quant_table
jpegli_alloc_huff_table kjpegli_jpegli_alloc_huff_table
jpegli_alloc_quant_table kjpegli_jpegli_alloc_quant_table
jpegli_bytes_per_sample kjpegli_jpegli_bytes_per_sample
jpegli_calc_output_dimensions kjpegli_jpegli_calc_output_dimensions
jpegli_consume_input kjpegli_jpegli_consume_input
jpegli_copy_critical_parameters kjpegli_jpegli_copy_critical_parameters
jpegli_crop_scanline kjpegli_jpegli_crop_scanline
jpegli_default_colorspace kjpegli_jpegli_default_colorspace
jpegli_destroy kjpegli_jpegli_destroy
jpegli_destroy_compress kjpegli_jpegli_destroy_compress
jpegli_destroy_decompress kjpegli_jpegli_destroy_decompress
jpegli_enable_adaptive_quantization kjpegli_jpegli_enable_adaptive_quantization
jpegli_finish_compress kjpegli_jpegli_finish_compress
jpegli_finish_decompress kjpegli_jpegli_finish_decompress
jpegli_finish_output kjpegli_jpegli_finish_output
jpegli_has_multiple_scans kjpegli_jpegli_has_multiple_scans
jpegli_input_complete kjpegli_jpegli_input_complete
jpegli_mem_dest kjpegli_jpegli_mem_dest
jpegli_mem_src kjpegli_jpegli_mem_src
jpegli_new_colormap kjpegli_jpegli_new_colormap
jpegli_quality_scaling kjpegli_jpegli_quality_scaling
jpegli_quality_to_distance kjpegli_jpegli_quality_to_distance
jpegli_read_coefficients kjpegli_jpegli_read_coefficients
jpegli_read_header kjpegli_jpegli_read_header
jpegli_read_icc_profile kjpegli_jpegli_read_icc_profile
jpegli_read_raw_data kjpegli_jpegli_read_raw_data
jpegli_read_scanlines kjpegli_jpegli_read_scanlines
jpegli_resync_to_restart kjpegli_jpegli_resync_to_restart
jpegli_save_markers kjpegli_jpegli_save_markers
jpegli_set_cicp_transfer_function kjpegli_jpegli_set_cicp_transfer_function
jpegli_set_colorspace kjpegli_jpegli_set_colorspace
jpegli_set_defaults kjpegli_jpegli_set_defaults
jpegli_set_distance kjpegli_jpegli_set_distance
jpegli_set_input_format kjpegli_jpegli_set_input_format
jpegli_set_linear_quality kjpegli_jpegli_set_linear_quality
jpegli_set_marker_processor kjpegli_jpegli_set_marker_processor
jpegli_set_output_format kjpegli_jpegli_set_output_format
jpegli_set_progressive_level kjpegli_jpegli_set_progressive_level
jpegli_set_psnr kjpegli_jpegli_set_psnr
jpegli_set_quality kjpegli_jpegli_set_quality
jpegli_set_xyb_mode kjpegli_jpegli_set_xyb_mode
jpegli_simple_progression kjpegli_jpegli_simple_progression
jpegli_skip_scanlines kjpegli_jpegli_skip_scanlines
jpegli_start_compress kjpegli_jpegli_start_compress
jpegli_start_decompress kjpegli_jpegli_start_decompress
jpegli_start_output kjpegli_jpegli_start_output
jpegli_std_error kjpegli_jpegli_std_error
jpegli_stdio_dest kjpegli_jpegli_stdio_dest
jpegli_stdio_src kjpegli_jpegli_stdio_src
jpegli_suppress_tables kjpegli_jpegli_suppress_tables
jpegli_use_standard_quant_tables kjpegli_jpegli_use_standard_quant_tables
jpegli_write_coefficients kjpegli_jpegli_write_coefficients
jpegli_write_icc_profile kjpegli_jpegli_write_icc_profile
jpegli_write_m_byte kjpegli_jpegli_write_m_byte
jpegli_write_m_header kjpegli_jpegli_write_m_header
jpegli_write_marker kjpegli_jpegli_write_marker
jpegli_write_raw_data kjpegli_jpegli_write_raw_data
jpegli_write_scanlines kjpegli_jpegli_write_scanlines
jpegli_write_tables kjpegli_jpegli_write_tables
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,4 @@
Header source: /mnt/nas/builder/build-image-libs/out/android/armeabi-v7a/include
JPEG_LIB_VERSION: 80
jpeg_compress_struct_size: 432
Reason: selected by compile-time probe from all available Jpegli/build/image headers.
@@ -0,0 +1,37 @@
/* Version ID for the JPEG library.
* Might be useful for tests like "#if JPEG_LIB_VERSION >= 60".
*/
#define JPEG_LIB_VERSION 80
/* libjpeg-turbo version */
#define LIBJPEG_TURBO_VERSION 4.1.5
/* libjpeg-turbo version in integer form */
#define LIBJPEG_TURBO_VERSION_NUMBER 4001005
/* Support arithmetic encoding */
#define C_ARITH_CODING_SUPPORTED 1
/* Support arithmetic decoding */
#define D_ARITH_CODING_SUPPORTED 1
/* Support in-memory source/destination managers */
/* #undef MEM_SRCDST_SUPPORTED */
/* Use accelerated SIMD routines. */
#define WITH_SIMD 1
/*
* Define BITS_IN_JSAMPLE as either
* 8 for 8-bit sample values (the usual setting)
* 12 for 12-bit sample values
* Only 8 and 12 are legal data precisions for lossy JPEG according to the
* JPEG standard, and the IJG code does not support anything else!
* We do not support run-time selection of data precision, sorry.
*/
#define BITS_IN_JSAMPLE 8 /* use 8 or 12 */
/* Define if your (broken) compiler shifts signed values as if they were
unsigned. */
/* #undef RIGHT_SHIFT_IS_UNSIGNED */
@@ -0,0 +1,335 @@
/*
* jerror.h
*
* This file was part of the Independent JPEG Group's software:
* Copyright (C) 1994-1997, Thomas G. Lane.
* Modified 1997-2009 by Guido Vollbeding.
* libjpeg-turbo Modifications:
* Copyright (C) 2014, 2017, 2021-2022, 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 JPEG library.
* Edit this file to add new codes, or to translate the message strings to
* some other language.
* A set of error-reporting macros are defined too. Some applications using
* the JPEG library may wish to include this file to get the error codes
* and/or the macros.
*/
/*
* 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 JERROR_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 /* JERROR_H */
#endif /* JMESSAGE */
#ifdef JMAKE_ENUM_LIST
typedef enum {
#define JMESSAGE(code,string) code ,
#endif /* JMAKE_ENUM_LIST */
JMESSAGE(JMSG_NOMESSAGE, "Bogus message code %d") /* Must be first entry! */
/* For maintenance convenience, list is alphabetical by message code name */
#if JPEG_LIB_VERSION < 70
JMESSAGE(JERR_ARITH_NOTIMPL, "Sorry, arithmetic coding is not implemented")
#endif
JMESSAGE(JERR_BAD_ALIGN_TYPE, "ALIGN_TYPE is wrong, please fix")
JMESSAGE(JERR_BAD_ALLOC_CHUNK, "MAX_ALLOC_CHUNK is wrong, please fix")
JMESSAGE(JERR_BAD_BUFFER_MODE, "Bogus buffer control mode")
JMESSAGE(JERR_BAD_COMPONENT_ID, "Invalid component ID %d in SOS")
#if JPEG_LIB_VERSION >= 70
JMESSAGE(JERR_BAD_CROP_SPEC, "Invalid crop request")
#endif
JMESSAGE(JERR_BAD_DCT_COEF, "DCT coefficient out of range")
JMESSAGE(JERR_BAD_DCTSIZE, "IDCT output block size %d not supported")
#if JPEG_LIB_VERSION >= 70
JMESSAGE(JERR_BAD_DROP_SAMPLING,
"Component index %d: mismatching sampling ratio %d:%d, %d:%d, %c")
#endif
JMESSAGE(JERR_BAD_HUFF_TABLE, "Bogus Huffman table definition")
JMESSAGE(JERR_BAD_IN_COLORSPACE, "Bogus input colorspace")
JMESSAGE(JERR_BAD_J_COLORSPACE, "Bogus JPEG colorspace")
JMESSAGE(JERR_BAD_LENGTH, "Bogus marker length")
JMESSAGE(JERR_BAD_LIB_VERSION,
"Wrong JPEG library version: library is %d, caller expects %d")
JMESSAGE(JERR_BAD_MCU_SIZE, "Sampling factors too large for interleaved scan")
JMESSAGE(JERR_BAD_POOL_ID, "Invalid memory pool code %d")
JMESSAGE(JERR_BAD_PRECISION, "Unsupported JPEG data precision %d")
JMESSAGE(JERR_BAD_PROGRESSION,
"Invalid progressive parameters Ss=%d Se=%d Ah=%d Al=%d")
JMESSAGE(JERR_BAD_PROG_SCRIPT,
"Invalid progressive parameters at scan script entry %d")
JMESSAGE(JERR_BAD_SAMPLING, "Bogus sampling factors")
JMESSAGE(JERR_BAD_SCAN_SCRIPT, "Invalid scan script at entry %d")
JMESSAGE(JERR_BAD_STATE, "Improper call to JPEG library in state %d")
JMESSAGE(JERR_BAD_STRUCT_SIZE,
"JPEG parameter struct mismatch: library thinks size is %u, caller expects %u")
JMESSAGE(JERR_BAD_VIRTUAL_ACCESS, "Bogus virtual array access")
JMESSAGE(JERR_BUFFER_SIZE, "Buffer passed to JPEG library is too small")
JMESSAGE(JERR_CANT_SUSPEND, "Suspension not allowed here")
JMESSAGE(JERR_CCIR601_NOTIMPL, "CCIR601 sampling not implemented yet")
JMESSAGE(JERR_COMPONENT_COUNT, "Too many color components: %d, max %d")
JMESSAGE(JERR_CONVERSION_NOTIMPL, "Unsupported color conversion request")
JMESSAGE(JERR_DAC_INDEX, "Bogus DAC index %d")
JMESSAGE(JERR_DAC_VALUE, "Bogus DAC value 0x%x")
JMESSAGE(JERR_DHT_INDEX, "Bogus DHT index %d")
JMESSAGE(JERR_DQT_INDEX, "Bogus DQT index %d")
JMESSAGE(JERR_EMPTY_IMAGE, "Empty JPEG image (DNL not supported)")
JMESSAGE(JERR_EMS_READ, "Read from EMS failed")
JMESSAGE(JERR_EMS_WRITE, "Write to EMS failed")
JMESSAGE(JERR_EOI_EXPECTED, "Didn't expect more than one scan")
JMESSAGE(JERR_FILE_READ, "Input file read error")
JMESSAGE(JERR_FILE_WRITE, "Output file write error --- out of disk space?")
JMESSAGE(JERR_FRACT_SAMPLE_NOTIMPL, "Fractional sampling not implemented yet")
JMESSAGE(JERR_HUFF_CLEN_OVERFLOW, "Huffman code size table overflow")
JMESSAGE(JERR_HUFF_MISSING_CODE, "Missing Huffman code table entry")
JMESSAGE(JERR_IMAGE_TOO_BIG, "Maximum supported image dimension is %u pixels")
JMESSAGE(JERR_INPUT_EMPTY, "Empty input file")
JMESSAGE(JERR_INPUT_EOF, "Premature end of input file")
JMESSAGE(JERR_MISMATCHED_QUANT_TABLE,
"Cannot transcode due to multiple use of quantization table %d")
JMESSAGE(JERR_MISSING_DATA, "Scan script does not transmit all data")
JMESSAGE(JERR_MODE_CHANGE, "Invalid color quantization mode change")
JMESSAGE(JERR_NOTIMPL, "Requested features are incompatible")
JMESSAGE(JERR_NOT_COMPILED, "Requested feature was omitted at compile time")
#if JPEG_LIB_VERSION >= 70
JMESSAGE(JERR_NO_ARITH_TABLE, "Arithmetic table 0x%02x was not defined")
#endif
JMESSAGE(JERR_NO_BACKING_STORE, "Backing store not supported")
JMESSAGE(JERR_NO_HUFF_TABLE, "Huffman table 0x%02x was not defined")
JMESSAGE(JERR_NO_IMAGE, "JPEG datastream contains no image")
JMESSAGE(JERR_NO_QUANT_TABLE, "Quantization table 0x%02x was not defined")
JMESSAGE(JERR_NO_SOI, "Not a JPEG file: starts with 0x%02x 0x%02x")
JMESSAGE(JERR_OUT_OF_MEMORY, "Insufficient memory (case %d)")
JMESSAGE(JERR_QUANT_COMPONENTS,
"Cannot quantize more than %d color components")
JMESSAGE(JERR_QUANT_FEW_COLORS, "Cannot quantize to fewer than %d colors")
JMESSAGE(JERR_QUANT_MANY_COLORS, "Cannot quantize to more than %d colors")
JMESSAGE(JERR_SOF_DUPLICATE, "Invalid JPEG file structure: two SOF markers")
JMESSAGE(JERR_SOF_NO_SOS, "Invalid JPEG file structure: missing SOS marker")
JMESSAGE(JERR_SOF_UNSUPPORTED, "Unsupported JPEG process: SOF type 0x%02x")
JMESSAGE(JERR_SOI_DUPLICATE, "Invalid JPEG file structure: two SOI markers")
JMESSAGE(JERR_SOS_NO_SOF, "Invalid JPEG file structure: SOS before SOF")
JMESSAGE(JERR_TFILE_CREATE, "Failed to create temporary file %s")
JMESSAGE(JERR_TFILE_READ, "Read failed on temporary file")
JMESSAGE(JERR_TFILE_SEEK, "Seek failed on temporary file")
JMESSAGE(JERR_TFILE_WRITE,
"Write failed on temporary file --- out of disk space?")
JMESSAGE(JERR_TOO_LITTLE_DATA, "Application transferred too few scanlines")
JMESSAGE(JERR_UNKNOWN_MARKER, "Unsupported marker type 0x%02x")
JMESSAGE(JERR_VIRTUAL_BUG, "Virtual array controller messed up")
JMESSAGE(JERR_WIDTH_OVERFLOW, "Image too wide for this implementation")
JMESSAGE(JERR_XMS_READ, "Read from XMS failed")
JMESSAGE(JERR_XMS_WRITE, "Write to XMS failed")
JMESSAGE(JMSG_COPYRIGHT, JCOPYRIGHT_SHORT)
JMESSAGE(JMSG_VERSION, JVERSION)
JMESSAGE(JTRC_16BIT_TABLES,
"Caution: quantization tables are too coarse for baseline JPEG")
JMESSAGE(JTRC_ADOBE,
"Adobe APP14 marker: version %d, flags 0x%04x 0x%04x, transform %d")
JMESSAGE(JTRC_APP0, "Unknown APP0 marker (not JFIF), length %u")
JMESSAGE(JTRC_APP14, "Unknown APP14 marker (not Adobe), length %u")
JMESSAGE(JTRC_DAC, "Define Arithmetic Table 0x%02x: 0x%02x")
JMESSAGE(JTRC_DHT, "Define Huffman Table 0x%02x")
JMESSAGE(JTRC_DQT, "Define Quantization Table %d precision %d")
JMESSAGE(JTRC_DRI, "Define Restart Interval %u")
JMESSAGE(JTRC_EMS_CLOSE, "Freed EMS handle %u")
JMESSAGE(JTRC_EMS_OPEN, "Obtained EMS handle %u")
JMESSAGE(JTRC_EOI, "End Of Image")
JMESSAGE(JTRC_HUFFBITS, " %3d %3d %3d %3d %3d %3d %3d %3d")
JMESSAGE(JTRC_JFIF, "JFIF APP0 marker: version %d.%02d, density %dx%d %d")
JMESSAGE(JTRC_JFIF_BADTHUMBNAILSIZE,
"Warning: thumbnail image size does not match data length %u")
JMESSAGE(JTRC_JFIF_EXTENSION, "JFIF extension marker: type 0x%02x, length %u")
JMESSAGE(JTRC_JFIF_THUMBNAIL, " with %d x %d thumbnail image")
JMESSAGE(JTRC_MISC_MARKER, "Miscellaneous marker 0x%02x, length %u")
JMESSAGE(JTRC_PARMLESS_MARKER, "Unexpected marker 0x%02x")
JMESSAGE(JTRC_QUANTVALS, " %4u %4u %4u %4u %4u %4u %4u %4u")
JMESSAGE(JTRC_QUANT_3_NCOLORS, "Quantizing to %d = %d*%d*%d colors")
JMESSAGE(JTRC_QUANT_NCOLORS, "Quantizing to %d colors")
JMESSAGE(JTRC_QUANT_SELECTED, "Selected %d colors for quantization")
JMESSAGE(JTRC_RECOVERY_ACTION, "At marker 0x%02x, recovery action %d")
JMESSAGE(JTRC_RST, "RST%d")
JMESSAGE(JTRC_SMOOTH_NOTIMPL,
"Smoothing not supported with nonstandard sampling ratios")
JMESSAGE(JTRC_SOF, "Start Of Frame 0x%02x: width=%u, height=%u, components=%d")
JMESSAGE(JTRC_SOF_COMPONENT, " Component %d: %dhx%dv q=%d")
JMESSAGE(JTRC_SOI, "Start of Image")
JMESSAGE(JTRC_SOS, "Start Of Scan: %d components")
JMESSAGE(JTRC_SOS_COMPONENT, " Component %d: dc=%d ac=%d")
JMESSAGE(JTRC_SOS_PARAMS, " Ss=%d, Se=%d, Ah=%d, Al=%d")
JMESSAGE(JTRC_TFILE_CLOSE, "Closed temporary file %s")
JMESSAGE(JTRC_TFILE_OPEN, "Opened temporary file %s")
JMESSAGE(JTRC_THUMB_JPEG,
"JFIF extension marker: JPEG-compressed thumbnail image, length %u")
JMESSAGE(JTRC_THUMB_PALETTE,
"JFIF extension marker: palette thumbnail image, length %u")
JMESSAGE(JTRC_THUMB_RGB,
"JFIF extension marker: RGB thumbnail image, length %u")
JMESSAGE(JTRC_UNKNOWN_IDS,
"Unrecognized component IDs %d %d %d, assuming YCbCr")
JMESSAGE(JTRC_XMS_CLOSE, "Freed XMS handle %u")
JMESSAGE(JTRC_XMS_OPEN, "Obtained XMS handle %u")
JMESSAGE(JWRN_ADOBE_XFORM, "Unknown Adobe color transform code %d")
#if JPEG_LIB_VERSION >= 70
JMESSAGE(JWRN_ARITH_BAD_CODE, "Corrupt JPEG data: bad arithmetic code")
#endif
JMESSAGE(JWRN_BOGUS_PROGRESSION,
"Inconsistent progression sequence for component %d coefficient %d")
JMESSAGE(JWRN_EXTRANEOUS_DATA,
"Corrupt JPEG data: %u extraneous bytes before marker 0x%02x")
JMESSAGE(JWRN_HIT_MARKER, "Corrupt JPEG data: premature end of data segment")
JMESSAGE(JWRN_HUFF_BAD_CODE, "Corrupt JPEG data: bad Huffman code")
JMESSAGE(JWRN_JFIF_MAJOR, "Warning: unknown JFIF revision number %d.%02d")
JMESSAGE(JWRN_JPEG_EOF, "Premature end of JPEG file")
JMESSAGE(JWRN_MUST_RESYNC,
"Corrupt JPEG data: found marker 0x%02x instead of RST%d")
JMESSAGE(JWRN_NOT_SEQUENTIAL, "Invalid SOS parameters for sequential JPEG")
JMESSAGE(JWRN_TOO_MUCH_DATA, "Application transferred too many scanlines")
#if JPEG_LIB_VERSION < 70
JMESSAGE(JERR_BAD_CROP_SPEC, "Invalid crop request")
#if defined(C_ARITH_CODING_SUPPORTED) || defined(D_ARITH_CODING_SUPPORTED)
JMESSAGE(JERR_NO_ARITH_TABLE, "Arithmetic table 0x%02x was not defined")
JMESSAGE(JWRN_ARITH_BAD_CODE, "Corrupt JPEG data: bad arithmetic code")
#endif
#endif
JMESSAGE(JERR_BAD_PARAM, "Bogus parameter")
JMESSAGE(JERR_BAD_PARAM_VALUE, "Bogus parameter value")
JMESSAGE(JERR_UNSUPPORTED_SUSPEND, "I/O suspension not supported in scan optimization")
JMESSAGE(JWRN_BOGUS_ICC, "Corrupt JPEG data: bad ICC marker")
#if JPEG_LIB_VERSION < 70
JMESSAGE(JERR_BAD_DROP_SAMPLING,
"Component index %d: mismatching sampling ratio %d:%d, %d:%d, %c")
#endif
#ifdef JMAKE_ENUM_LIST
JMSG_LASTMSGCODE
} J_MESSAGE_CODE;
#undef JMAKE_ENUM_LIST
#endif /* JMAKE_ENUM_LIST */
/* Zap JMESSAGE macro so that future re-inclusions do nothing by default */
#undef JMESSAGE
#ifndef JERROR_H
#define JERROR_H
/* Macros to simplify using the error and trace message stuff */
/* The first parameter is either type of cinfo pointer */
/* Fatal errors (print message and exit) */
#define ERREXIT(cinfo,code) \
((cinfo)->err->msg_code = (code), \
(*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
#define ERREXIT1(cinfo,code,p1) \
((cinfo)->err->msg_code = (code), \
(cinfo)->err->msg_parm.i[0] = (p1), \
(*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
#define ERREXIT2(cinfo,code,p1,p2) \
((cinfo)->err->msg_code = (code), \
(cinfo)->err->msg_parm.i[0] = (p1), \
(cinfo)->err->msg_parm.i[1] = (p2), \
(*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
#define ERREXIT3(cinfo,code,p1,p2,p3) \
((cinfo)->err->msg_code = (code), \
(cinfo)->err->msg_parm.i[0] = (p1), \
(cinfo)->err->msg_parm.i[1] = (p2), \
(cinfo)->err->msg_parm.i[2] = (p3), \
(*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
#define ERREXIT4(cinfo,code,p1,p2,p3,p4) \
((cinfo)->err->msg_code = (code), \
(cinfo)->err->msg_parm.i[0] = (p1), \
(cinfo)->err->msg_parm.i[1] = (p2), \
(cinfo)->err->msg_parm.i[2] = (p3), \
(cinfo)->err->msg_parm.i[3] = (p4), \
(*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
#define ERREXIT6(cinfo, code, p1, p2, p3, p4, p5, p6) \
((cinfo)->err->msg_code = (code), \
(cinfo)->err->msg_parm.i[0] = (p1), \
(cinfo)->err->msg_parm.i[1] = (p2), \
(cinfo)->err->msg_parm.i[2] = (p3), \
(cinfo)->err->msg_parm.i[3] = (p4), \
(cinfo)->err->msg_parm.i[4] = (p5), \
(cinfo)->err->msg_parm.i[5] = (p6), \
(*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
#define ERREXITS(cinfo, code, str) \
((cinfo)->err->msg_code = (code), \
strncpy((cinfo)->err->msg_parm.s, (str), JMSG_STR_PARM_MAX), \
(cinfo)->err->msg_parm.s[JMSG_STR_PARM_MAX - 1] = '\0', \
(*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
#define MAKESTMT(stuff) do { stuff } while (0)
/* Nonfatal errors (we can keep going, but the data is probably corrupt) */
#define WARNMS(cinfo,code) \
((cinfo)->err->msg_code = (code), \
(*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1))
#define WARNMS1(cinfo,code,p1) \
((cinfo)->err->msg_code = (code), \
(cinfo)->err->msg_parm.i[0] = (p1), \
(*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1))
#define WARNMS2(cinfo,code,p1,p2) \
((cinfo)->err->msg_code = (code), \
(cinfo)->err->msg_parm.i[0] = (p1), \
(cinfo)->err->msg_parm.i[1] = (p2), \
(*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1))
/* Informational/debugging messages */
#define TRACEMS(cinfo,lvl,code) \
((cinfo)->err->msg_code = (code), \
(*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)))
#define TRACEMS1(cinfo,lvl,code,p1) \
((cinfo)->err->msg_code = (code), \
(cinfo)->err->msg_parm.i[0] = (p1), \
(*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)))
#define TRACEMS2(cinfo,lvl,code,p1,p2) \
((cinfo)->err->msg_code = (code), \
(cinfo)->err->msg_parm.i[0] = (p1), \
(cinfo)->err->msg_parm.i[1] = (p2), \
(*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)))
#define TRACEMS3(cinfo,lvl,code,p1,p2,p3) \
MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \
_mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); \
(cinfo)->err->msg_code = (code); \
(*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); )
#define TRACEMS4(cinfo,lvl,code,p1,p2,p3,p4) \
MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \
_mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \
(cinfo)->err->msg_code = (code); \
(*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); )
#define TRACEMS5(cinfo,lvl,code,p1,p2,p3,p4,p5) \
MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \
_mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \
_mp[4] = (p5); \
(cinfo)->err->msg_code = (code); \
(*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); )
#define TRACEMS8(cinfo,lvl,code,p1,p2,p3,p4,p5,p6,p7,p8) \
MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \
_mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \
_mp[4] = (p5); _mp[5] = (p6); _mp[6] = (p7); _mp[7] = (p8); \
(cinfo)->err->msg_code = (code); \
(*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); )
#define TRACEMSS(cinfo,lvl,code,str) \
((cinfo)->err->msg_code = (code), \
strncpy((cinfo)->err->msg_parm.s, (str), JMSG_STR_PARM_MAX), \
(cinfo)->err->msg_parm.s[JMSG_STR_PARM_MAX - 1] = '\0', \
(*(cinfo)->err->emit_message) ((j_common_ptr)(cinfo), (lvl)))
#endif /* JERROR_H */
@@ -0,0 +1,382 @@
/*
* jmorecfg.h
*
* This file was part of the Independent JPEG Group's software:
* Copyright (C) 1991-1997, Thomas G. Lane.
* Modified 1997-2009 by Guido Vollbeding.
* libjpeg-turbo Modifications:
* Copyright (C) 2009, 2011, 2014-2015, 2018, 2020, D. R. Commander.
* For conditions of distribution and use, see the accompanying README.ijg
* file.
*
* This file contains additional configuration options that customize the
* JPEG software for special applications or support machine-dependent
* optimizations. Most users will not need to touch this file.
*/
/*
* Maximum number of components (color channels) allowed in JPEG image.
* To meet the letter of Rec. ITU-T T.81 | ISO/IEC 10918-1, set this to 255.
* However, darn few applications need more than 4 channels (maybe 5 for CMYK +
* alpha mask). We recommend 10 as a reasonable compromise; use 4 if you are
* really short on memory. (Each allowed component costs a hundred or so
* bytes of storage, whether actually used in an image or not.)
*/
#define MAX_COMPONENTS 10 /* maximum number of image components */
/*
* Basic data types.
* You may need to change these if you have a machine with unusual data
* type sizes; for example, "char" not 8 bits, "short" not 16 bits,
* or "long" not 32 bits. We don't care whether "int" is 16 or 32 bits,
* but it had better be at least 16.
*/
/* Representation of a single sample (pixel element value).
* We frequently allocate large arrays of these, so it's important to keep
* them small. But if you have memory to burn and access to char or short
* arrays is very slow on your hardware, you might want to change these.
*/
#if BITS_IN_JSAMPLE == 8
/* JSAMPLE should be the smallest type that will hold the values 0..255.
*/
typedef unsigned char JSAMPLE;
#define GETJSAMPLE(value) ((int)(value))
#define MAXJSAMPLE 255
#define CENTERJSAMPLE 128
#endif /* BITS_IN_JSAMPLE == 8 */
#if BITS_IN_JSAMPLE == 12
/* JSAMPLE should be the smallest type that will hold the values 0..4095.
* On nearly all machines "short" will do nicely.
*/
typedef short JSAMPLE;
#define GETJSAMPLE(value) ((int)(value))
#define MAXJSAMPLE 4095
#define CENTERJSAMPLE 2048
#endif /* BITS_IN_JSAMPLE == 12 */
/* Representation of a DCT frequency coefficient.
* This should be a signed value of at least 16 bits; "short" is usually OK.
* Again, we allocate large arrays of these, but you can change to int
* if you have memory to burn and "short" is really slow.
*/
typedef short JCOEF;
/* Compressed datastreams are represented as arrays of JOCTET.
* These must be EXACTLY 8 bits wide, at least once they are written to
* external storage. Note that when using the stdio data source/destination
* managers, this is also the data type passed to fread/fwrite.
*/
typedef unsigned char JOCTET;
#define GETJOCTET(value) (value)
/* These typedefs are used for various table entries and so forth.
* They must be at least as wide as specified; but making them too big
* won't cost a huge amount of memory, so we don't provide special
* extraction code like we did for JSAMPLE. (In other words, these
* typedefs live at a different point on the speed/space tradeoff curve.)
*/
/* UINT8 must hold at least the values 0..255. */
typedef unsigned char UINT8;
/* UINT16 must hold at least the values 0..65535. */
typedef unsigned short UINT16;
/* INT16 must hold at least the values -32768..32767. */
#ifndef XMD_H /* X11/xmd.h correctly defines INT16 */
typedef short INT16;
#endif
/* INT32 must hold at least signed 32-bit values.
*
* NOTE: The INT32 typedef dates back to libjpeg v5 (1994.) Integers were
* sometimes 16-bit back then (MS-DOS), which is why INT32 is typedef'd to
* long. It also wasn't common (or at least as common) in 1994 for INT32 to be
* defined by platform headers. Since then, however, INT32 is defined in
* several other common places:
*
* Xmd.h (X11 header) typedefs INT32 to int on 64-bit platforms and long on
* 32-bit platforms (i.e always a 32-bit signed type.)
*
* basetsd.h (Win32 header) typedefs INT32 to int (always a 32-bit signed type
* on modern platforms.)
*
* qglobal.h (Qt header) typedefs INT32 to int (always a 32-bit signed type on
* modern platforms.)
*
* This is a recipe for conflict, since "long" and "int" aren't always
* compatible types. Since the definition of INT32 has technically been part
* of the libjpeg API for more than 20 years, we can't remove it, but we do not
* use it internally any longer. We instead define a separate type (JLONG)
* for internal use, which ensures that internal behavior will always be the
* same regardless of any external headers that may be included.
*/
#ifndef XMD_H /* X11/xmd.h correctly defines INT32 */
#ifndef _BASETSD_H_ /* Microsoft defines it in basetsd.h */
#ifndef _BASETSD_H /* MinGW is slightly different */
#ifndef QGLOBAL_H /* Qt defines it in qglobal.h */
typedef long INT32;
#endif
#endif
#endif
#endif
/* Datatype used for image dimensions. The JPEG standard only supports
* images up to 64K*64K due to 16-bit fields in SOF markers. Therefore
* "unsigned int" is sufficient on all machines. However, if you need to
* handle larger images and you don't mind deviating from the spec, you
* can change this datatype. (Note that changing this datatype will
* potentially require modifying the SIMD code. The x86-64 SIMD extensions,
* in particular, assume a 32-bit JDIMENSION.)
*/
typedef unsigned int JDIMENSION;
#define JPEG_MAX_DIMENSION 65500L /* a tad under 64K to prevent overflows */
/* These macros are used in all function definitions and extern declarations.
* You could modify them if you need to change function linkage conventions;
* in particular, you'll need to do that to make the library a Windows DLL.
* Another application is to make all functions global for use with debuggers
* or code profilers that require it.
*/
/* a function called through method pointers: */
#define METHODDEF(type) static type
/* a function used only in its module: */
#define LOCAL(type) static type
/* a function referenced thru EXTERNs: */
#define GLOBAL(type) type
/* a reference to a GLOBAL function: */
#define EXTERN(type) extern type
/* Originally, this macro was used as a way of defining function prototypes
* for both modern compilers as well as older compilers that did not support
* prototype parameters. libjpeg-turbo has never supported these older,
* non-ANSI compilers, but the macro is still included because there is some
* software out there that uses it.
*/
#define JMETHOD(type, methodname, arglist) type (*methodname) arglist
/* libjpeg-turbo no longer supports platforms that have far symbols (MS-DOS),
* but again, some software relies on this macro.
*/
#undef FAR
#define FAR
/*
* On a few systems, type boolean and/or its values FALSE, TRUE may appear
* in standard header files. Or you may have conflicts with application-
* specific header files that you want to include together with these files.
* Defining HAVE_BOOLEAN before including jpeglib.h should make it work.
*/
#ifndef HAVE_BOOLEAN
typedef int boolean;
#endif
#ifndef FALSE /* in case these macros already exist */
#define FALSE 0 /* values of boolean */
#endif
#ifndef TRUE
#define TRUE 1
#endif
/*
* The remaining options affect code selection within the JPEG library,
* but they don't need to be visible to most applications using the library.
* To minimize application namespace pollution, the symbols won't be
* defined unless JPEG_INTERNALS or JPEG_INTERNAL_OPTIONS has been defined.
*/
#ifdef JPEG_INTERNALS
#define JPEG_INTERNAL_OPTIONS
#endif
#ifdef JPEG_INTERNAL_OPTIONS
/*
* These defines indicate whether to include various optional functions.
* Undefining some of these symbols will produce a smaller but less capable
* library. Note that you can leave certain source files out of the
* compilation/linking process if you've #undef'd the corresponding symbols.
* (You may HAVE to do that if your compiler doesn't like null source files.)
*/
/* Capability options common to encoder and decoder: */
#define DCT_ISLOW_SUPPORTED /* accurate integer method */
#define DCT_IFAST_SUPPORTED /* less accurate int method [legacy feature] */
#define DCT_FLOAT_SUPPORTED /* floating-point method [legacy feature] */
/* Encoder capability options: */
#define C_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */
#define C_PROGRESSIVE_SUPPORTED /* Progressive JPEG? (Requires MULTISCAN)*/
#define ENTROPY_OPT_SUPPORTED /* Optimization of entropy coding parms? */
/* Note: if you selected 12-bit data precision, it is dangerous to turn off
* ENTROPY_OPT_SUPPORTED. The standard Huffman tables are only good for 8-bit
* precision, so jchuff.c normally uses entropy optimization to compute
* usable tables for higher precision. If you don't want to do optimization,
* you'll have to supply different default Huffman tables.
* The exact same statements apply for progressive JPEG: the default tables
* don't work for progressive mode. (This may get fixed, however.)
*/
#define INPUT_SMOOTHING_SUPPORTED /* Input image smoothing option? */
/* Decoder capability options: */
#define D_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */
#define D_PROGRESSIVE_SUPPORTED /* Progressive JPEG? (Requires MULTISCAN)*/
#define SAVE_MARKERS_SUPPORTED /* jpeg_save_markers() needed? */
#define BLOCK_SMOOTHING_SUPPORTED /* Block smoothing? (Progressive only) */
#define IDCT_SCALING_SUPPORTED /* Output rescaling via IDCT? */
#undef UPSAMPLE_SCALING_SUPPORTED /* Output rescaling at upsample stage? */
#define UPSAMPLE_MERGING_SUPPORTED /* Fast path for sloppy upsampling? */
#define QUANT_1PASS_SUPPORTED /* 1-pass color quantization? */
#define QUANT_2PASS_SUPPORTED /* 2-pass color quantization? */
/* more capability options later, no doubt */
/*
* The RGB_RED, RGB_GREEN, RGB_BLUE, and RGB_PIXELSIZE macros are a vestigial
* feature of libjpeg. The idea was that, if an application developer needed
* to compress from/decompress to a BGR/BGRX/RGBX/XBGR/XRGB buffer, they could
* change these macros, rebuild libjpeg, and link their application statically
* with it. In reality, few people ever did this, because there were some
* severe restrictions involved (cjpeg and djpeg no longer worked properly,
* compressing/decompressing RGB JPEGs no longer worked properly, and the color
* quantizer wouldn't work with pixel sizes other than 3.) Furthermore, since
* all of the O/S-supplied versions of libjpeg were built with the default
* values of RGB_RED, RGB_GREEN, RGB_BLUE, and RGB_PIXELSIZE, many applications
* have come to regard these values as immutable.
*
* The libjpeg-turbo colorspace extensions provide a much cleaner way of
* compressing from/decompressing to buffers with arbitrary component orders
* and pixel sizes. Thus, we do not support changing the values of RGB_RED,
* RGB_GREEN, RGB_BLUE, or RGB_PIXELSIZE. In addition to the restrictions
* listed above, changing these values will also break the SIMD extensions and
* the regression tests.
*/
#define RGB_RED 0 /* Offset of Red in an RGB scanline element */
#define RGB_GREEN 1 /* Offset of Green */
#define RGB_BLUE 2 /* Offset of Blue */
#define RGB_PIXELSIZE 3 /* JSAMPLEs per RGB scanline element */
#define JPEG_NUMCS 17
#define EXT_RGB_RED 0
#define EXT_RGB_GREEN 1
#define EXT_RGB_BLUE 2
#define EXT_RGB_PIXELSIZE 3
#define EXT_RGBX_RED 0
#define EXT_RGBX_GREEN 1
#define EXT_RGBX_BLUE 2
#define EXT_RGBX_PIXELSIZE 4
#define EXT_BGR_RED 2
#define EXT_BGR_GREEN 1
#define EXT_BGR_BLUE 0
#define EXT_BGR_PIXELSIZE 3
#define EXT_BGRX_RED 2
#define EXT_BGRX_GREEN 1
#define EXT_BGRX_BLUE 0
#define EXT_BGRX_PIXELSIZE 4
#define EXT_XBGR_RED 3
#define EXT_XBGR_GREEN 2
#define EXT_XBGR_BLUE 1
#define EXT_XBGR_PIXELSIZE 4
#define EXT_XRGB_RED 1
#define EXT_XRGB_GREEN 2
#define EXT_XRGB_BLUE 3
#define EXT_XRGB_PIXELSIZE 4
static const int rgb_red[JPEG_NUMCS] = {
-1, -1, RGB_RED, -1, -1, -1, EXT_RGB_RED, EXT_RGBX_RED,
EXT_BGR_RED, EXT_BGRX_RED, EXT_XBGR_RED, EXT_XRGB_RED,
EXT_RGBX_RED, EXT_BGRX_RED, EXT_XBGR_RED, EXT_XRGB_RED,
-1
};
static const int rgb_green[JPEG_NUMCS] = {
-1, -1, RGB_GREEN, -1, -1, -1, EXT_RGB_GREEN, EXT_RGBX_GREEN,
EXT_BGR_GREEN, EXT_BGRX_GREEN, EXT_XBGR_GREEN, EXT_XRGB_GREEN,
EXT_RGBX_GREEN, EXT_BGRX_GREEN, EXT_XBGR_GREEN, EXT_XRGB_GREEN,
-1
};
static const int rgb_blue[JPEG_NUMCS] = {
-1, -1, RGB_BLUE, -1, -1, -1, EXT_RGB_BLUE, EXT_RGBX_BLUE,
EXT_BGR_BLUE, EXT_BGRX_BLUE, EXT_XBGR_BLUE, EXT_XRGB_BLUE,
EXT_RGBX_BLUE, EXT_BGRX_BLUE, EXT_XBGR_BLUE, EXT_XRGB_BLUE,
-1
};
static const int rgb_pixelsize[JPEG_NUMCS] = {
-1, -1, RGB_PIXELSIZE, -1, -1, -1, EXT_RGB_PIXELSIZE, EXT_RGBX_PIXELSIZE,
EXT_BGR_PIXELSIZE, EXT_BGRX_PIXELSIZE, EXT_XBGR_PIXELSIZE, EXT_XRGB_PIXELSIZE,
EXT_RGBX_PIXELSIZE, EXT_BGRX_PIXELSIZE, EXT_XBGR_PIXELSIZE, EXT_XRGB_PIXELSIZE,
-1
};
/* Definitions for speed-related optimizations. */
/* On some machines (notably 68000 series) "int" is 32 bits, but multiplying
* two 16-bit shorts is faster than multiplying two ints. Define MULTIPLIER
* as short on such a machine. MULTIPLIER must be at least 16 bits wide.
*/
#ifndef MULTIPLIER
#ifndef WITH_SIMD
#define MULTIPLIER int /* type for fastest integer multiply */
#else
#define MULTIPLIER short /* prefer 16-bit with SIMD for parellelism */
#endif
#endif
/* FAST_FLOAT should be either float or double, whichever is done faster
* by your compiler. (Note that this type is only used in the floating point
* DCT routines, so it only matters if you've defined DCT_FLOAT_SUPPORTED.)
*/
#ifndef FAST_FLOAT
#define FAST_FLOAT float
#endif
#endif /* JPEG_INTERNAL_OPTIONS */
@@ -0,0 +1,375 @@
/*
* jpegint.h
*
* This file was part of the Independent JPEG Group's software:
* Copyright (C) 1991-1997, Thomas G. Lane.
* Modified 1997-2009 by Guido Vollbeding.
* libjpeg-turbo Modifications:
* Copyright (C) 2015-2016, 2019, 2021, D. R. Commander.
* Copyright (C) 2015, Google, Inc.
* Copyright (C) 2021, Alex Richardson.
* For conditions of distribution and use, see the accompanying README.ijg
* file.
*
* This file provides common declarations for the various JPEG modules.
* These declarations are considered internal to the JPEG library; most
* applications using the library shouldn't need to include this file.
*/
/* Declarations for both compression & decompression */
typedef enum { /* Operating modes for buffer controllers */
JBUF_PASS_THRU, /* Plain stripwise operation */
/* Remaining modes require a full-image buffer to have been created */
JBUF_SAVE_SOURCE, /* Run source subobject only, save output */
JBUF_CRANK_DEST, /* Run dest subobject only, using saved data */
JBUF_SAVE_AND_PASS /* Run both subobjects, save output */
} J_BUF_MODE;
/* Values of global_state field (jdapi.c has some dependencies on ordering!) */
#define CSTATE_START 100 /* after create_compress */
#define CSTATE_SCANNING 101 /* start_compress done, write_scanlines OK */
#define CSTATE_RAW_OK 102 /* start_compress done, write_raw_data OK */
#define CSTATE_WRCOEFS 103 /* jpeg_write_coefficients done */
#define DSTATE_START 200 /* after create_decompress */
#define DSTATE_INHEADER 201 /* reading header markers, no SOS yet */
#define DSTATE_READY 202 /* found SOS, ready for start_decompress */
#define DSTATE_PRELOAD 203 /* reading multiscan file in start_decompress*/
#define DSTATE_PRESCAN 204 /* performing dummy pass for 2-pass quant */
#define DSTATE_SCANNING 205 /* start_decompress done, read_scanlines OK */
#define DSTATE_RAW_OK 206 /* start_decompress done, read_raw_data OK */
#define DSTATE_BUFIMAGE 207 /* expecting jpeg_start_output */
#define DSTATE_BUFPOST 208 /* looking for SOS/EOI in jpeg_finish_output */
#define DSTATE_RDCOEFS 209 /* reading file in jpeg_read_coefficients */
#define DSTATE_STOPPING 210 /* looking for EOI in jpeg_finish_decompress */
/* JLONG must hold at least signed 32-bit values. */
typedef long JLONG;
/* JUINTPTR must hold pointer values. */
#ifdef __UINTPTR_TYPE__
/*
* __UINTPTR_TYPE__ is GNU-specific and available in GCC 4.6+ and Clang 3.0+.
* Fortunately, that is sufficient to support the few architectures for which
* sizeof(void *) != sizeof(size_t). The only other options would require C99
* or Clang-specific builtins.
*/
typedef __UINTPTR_TYPE__ JUINTPTR;
#else
typedef size_t JUINTPTR;
#endif
/*
* Left shift macro that handles a negative operand without causing any
* sanitizer warnings
*/
#define LEFT_SHIFT(a, b) ((JLONG)((unsigned long)(a) << (b)))
/* Declarations for compression modules */
/* Master control module */
struct jpeg_comp_master {
void (*prepare_for_pass) (j_compress_ptr cinfo);
void (*pass_startup) (j_compress_ptr cinfo);
void (*finish_pass) (j_compress_ptr cinfo);
/* State variables made visible to other modules */
boolean call_pass_startup; /* True if pass_startup must be called */
boolean is_last_pass; /* True during last pass */
};
/* Main buffer control (downsampled-data buffer) */
struct jpeg_c_main_controller {
void (*start_pass) (j_compress_ptr cinfo, J_BUF_MODE pass_mode);
void (*process_data) (j_compress_ptr cinfo, JSAMPARRAY input_buf,
JDIMENSION *in_row_ctr, JDIMENSION in_rows_avail);
};
/* Compression preprocessing (downsampling input buffer control) */
struct jpeg_c_prep_controller {
void (*start_pass) (j_compress_ptr cinfo, J_BUF_MODE pass_mode);
void (*pre_process_data) (j_compress_ptr cinfo, JSAMPARRAY input_buf,
JDIMENSION *in_row_ctr, JDIMENSION in_rows_avail,
JSAMPIMAGE output_buf,
JDIMENSION *out_row_group_ctr,
JDIMENSION out_row_groups_avail);
};
/* Coefficient buffer control */
struct jpeg_c_coef_controller {
void (*start_pass) (j_compress_ptr cinfo, J_BUF_MODE pass_mode);
boolean (*compress_data) (j_compress_ptr cinfo, JSAMPIMAGE input_buf);
};
/* Colorspace conversion */
struct jpeg_color_converter {
void (*start_pass) (j_compress_ptr cinfo);
void (*color_convert) (j_compress_ptr cinfo, JSAMPARRAY input_buf,
JSAMPIMAGE output_buf, JDIMENSION output_row,
int num_rows);
};
/* Downsampling */
struct jpeg_downsampler {
void (*start_pass) (j_compress_ptr cinfo);
void (*downsample) (j_compress_ptr cinfo, JSAMPIMAGE input_buf,
JDIMENSION in_row_index, JSAMPIMAGE output_buf,
JDIMENSION out_row_group_index);
boolean need_context_rows; /* TRUE if need rows above & below */
};
/* Forward DCT (also controls coefficient quantization) */
struct jpeg_forward_dct {
void (*start_pass) (j_compress_ptr cinfo);
/* perhaps this should be an array??? */
void (*forward_DCT) (j_compress_ptr cinfo, jpeg_component_info *compptr,
JSAMPARRAY sample_data, JBLOCKROW coef_blocks,
JDIMENSION start_row, JDIMENSION start_col,
JDIMENSION num_blocks);
};
/* Entropy encoding */
struct jpeg_entropy_encoder {
void (*start_pass) (j_compress_ptr cinfo, boolean gather_statistics);
boolean (*encode_mcu) (j_compress_ptr cinfo, JBLOCKROW *MCU_data);
void (*finish_pass) (j_compress_ptr cinfo);
};
/* Marker writing */
struct jpeg_marker_writer {
void (*write_file_header) (j_compress_ptr cinfo);
void (*write_frame_header) (j_compress_ptr cinfo);
void (*write_scan_header) (j_compress_ptr cinfo);
void (*write_file_trailer) (j_compress_ptr cinfo);
void (*write_tables_only) (j_compress_ptr cinfo);
/* These routines are exported to allow insertion of extra markers */
/* Probably only COM and APPn markers should be written this way */
void (*write_marker_header) (j_compress_ptr cinfo, int marker,
unsigned int datalen);
void (*write_marker_byte) (j_compress_ptr cinfo, int val);
};
/* Declarations for decompression modules */
/* Master control module */
struct jpeg_decomp_master {
void (*prepare_for_output_pass) (j_decompress_ptr cinfo);
void (*finish_output_pass) (j_decompress_ptr cinfo);
/* State variables made visible to other modules */
boolean is_dummy_pass; /* True during 1st pass for 2-pass quant */
/* Partial decompression variables */
JDIMENSION first_iMCU_col;
JDIMENSION last_iMCU_col;
JDIMENSION first_MCU_col[MAX_COMPONENTS];
JDIMENSION last_MCU_col[MAX_COMPONENTS];
boolean jinit_upsampler_no_alloc;
/* Last iMCU row that was successfully decoded */
JDIMENSION last_good_iMCU_row;
};
/* Input control module */
struct jpeg_input_controller {
int (*consume_input) (j_decompress_ptr cinfo);
void (*reset_input_controller) (j_decompress_ptr cinfo);
void (*start_input_pass) (j_decompress_ptr cinfo);
void (*finish_input_pass) (j_decompress_ptr cinfo);
/* State variables made visible to other modules */
boolean has_multiple_scans; /* True if file has multiple scans */
boolean eoi_reached; /* True when EOI has been consumed */
};
/* Main buffer control (downsampled-data buffer) */
struct jpeg_d_main_controller {
void (*start_pass) (j_decompress_ptr cinfo, J_BUF_MODE pass_mode);
void (*process_data) (j_decompress_ptr cinfo, JSAMPARRAY output_buf,
JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail);
};
/* Coefficient buffer control */
struct jpeg_d_coef_controller {
void (*start_input_pass) (j_decompress_ptr cinfo);
int (*consume_data) (j_decompress_ptr cinfo);
void (*start_output_pass) (j_decompress_ptr cinfo);
int (*decompress_data) (j_decompress_ptr cinfo, JSAMPIMAGE output_buf);
/* Pointer to array of coefficient virtual arrays, or NULL if none */
jvirt_barray_ptr *coef_arrays;
};
/* Decompression postprocessing (color quantization buffer control) */
struct jpeg_d_post_controller {
void (*start_pass) (j_decompress_ptr cinfo, J_BUF_MODE pass_mode);
void (*post_process_data) (j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
JDIMENSION *in_row_group_ctr,
JDIMENSION in_row_groups_avail,
JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
JDIMENSION out_rows_avail);
};
/* Marker reading & parsing */
struct jpeg_marker_reader {
void (*reset_marker_reader) (j_decompress_ptr cinfo);
/* Read markers until SOS or EOI.
* Returns same codes as are defined for jpeg_consume_input:
* JPEG_SUSPENDED, JPEG_REACHED_SOS, or JPEG_REACHED_EOI.
*/
int (*read_markers) (j_decompress_ptr cinfo);
/* Read a restart marker --- exported for use by entropy decoder only */
jpeg_marker_parser_method read_restart_marker;
/* State of marker reader --- nominally internal, but applications
* supplying COM or APPn handlers might like to know the state.
*/
boolean saw_SOI; /* found SOI? */
boolean saw_SOF; /* found SOF? */
int next_restart_num; /* next restart number expected (0-7) */
unsigned int discarded_bytes; /* # of bytes skipped looking for a marker */
};
/* Entropy decoding */
struct jpeg_entropy_decoder {
void (*start_pass) (j_decompress_ptr cinfo);
boolean (*decode_mcu) (j_decompress_ptr cinfo, JBLOCKROW *MCU_data);
/* This is here to share code between baseline and progressive decoders; */
/* other modules probably should not use it */
boolean insufficient_data; /* set TRUE after emitting warning */
};
/* Inverse DCT (also performs dequantization) */
typedef void (*inverse_DCT_method_ptr) (j_decompress_ptr cinfo,
jpeg_component_info *compptr,
JCOEFPTR coef_block,
JSAMPARRAY output_buf,
JDIMENSION output_col);
struct jpeg_inverse_dct {
void (*start_pass) (j_decompress_ptr cinfo);
/* It is useful to allow each component to have a separate IDCT method. */
inverse_DCT_method_ptr inverse_DCT[MAX_COMPONENTS];
};
/* Upsampling (note that upsampler must also call color converter) */
struct jpeg_upsampler {
void (*start_pass) (j_decompress_ptr cinfo);
void (*upsample) (j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
JDIMENSION *in_row_group_ctr,
JDIMENSION in_row_groups_avail, JSAMPARRAY output_buf,
JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail);
boolean need_context_rows; /* TRUE if need rows above & below */
};
/* Colorspace conversion */
struct jpeg_color_deconverter {
void (*start_pass) (j_decompress_ptr cinfo);
void (*color_convert) (j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
JDIMENSION input_row, JSAMPARRAY output_buf,
int num_rows);
};
/* Color quantization or color precision reduction */
struct jpeg_color_quantizer {
void (*start_pass) (j_decompress_ptr cinfo, boolean is_pre_scan);
void (*color_quantize) (j_decompress_ptr cinfo, JSAMPARRAY input_buf,
JSAMPARRAY output_buf, int num_rows);
void (*finish_pass) (j_decompress_ptr cinfo);
void (*new_color_map) (j_decompress_ptr cinfo);
};
/* Miscellaneous useful macros */
#undef MAX
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#undef MIN
#define MIN(a, b) ((a) < (b) ? (a) : (b))
/* We assume that right shift corresponds to signed division by 2 with
* rounding towards minus infinity. This is correct for typical "arithmetic
* shift" instructions that shift in copies of the sign bit. But some
* C compilers implement >> with an unsigned shift. For these machines you
* must define RIGHT_SHIFT_IS_UNSIGNED.
* RIGHT_SHIFT provides a proper signed right shift of a JLONG quantity.
* It is only applied with constant shift counts. SHIFT_TEMPS must be
* included in the variables of any routine using RIGHT_SHIFT.
*/
#ifdef RIGHT_SHIFT_IS_UNSIGNED
#define SHIFT_TEMPS JLONG shift_temp;
#define RIGHT_SHIFT(x, shft) \
((shift_temp = (x)) < 0 ? \
(shift_temp >> (shft)) | ((~((JLONG)0)) << (32 - (shft))) : \
(shift_temp >> (shft)))
#else
#define SHIFT_TEMPS
#define RIGHT_SHIFT(x, shft) ((x) >> (shft))
#endif
/* Compression module initialization routines */
EXTERN(void) jinit_compress_master(j_compress_ptr cinfo);
EXTERN(void) jinit_c_master_control(j_compress_ptr cinfo,
boolean transcode_only);
EXTERN(void) jinit_c_main_controller(j_compress_ptr cinfo,
boolean need_full_buffer);
EXTERN(void) jinit_c_prep_controller(j_compress_ptr cinfo,
boolean need_full_buffer);
EXTERN(void) jinit_c_coef_controller(j_compress_ptr cinfo,
boolean need_full_buffer);
EXTERN(void) jinit_color_converter(j_compress_ptr cinfo);
EXTERN(void) jinit_downsampler(j_compress_ptr cinfo);
EXTERN(void) jinit_forward_dct(j_compress_ptr cinfo);
EXTERN(void) jinit_huff_encoder(j_compress_ptr cinfo);
EXTERN(void) jinit_phuff_encoder(j_compress_ptr cinfo);
EXTERN(void) jinit_arith_encoder(j_compress_ptr cinfo);
EXTERN(void) jinit_marker_writer(j_compress_ptr cinfo);
/* Decompression module initialization routines */
EXTERN(void) jinit_master_decompress(j_decompress_ptr cinfo);
EXTERN(void) jinit_d_main_controller(j_decompress_ptr cinfo,
boolean need_full_buffer);
EXTERN(void) jinit_d_coef_controller(j_decompress_ptr cinfo,
boolean need_full_buffer);
EXTERN(void) jinit_d_post_controller(j_decompress_ptr cinfo,
boolean need_full_buffer);
EXTERN(void) jinit_input_controller(j_decompress_ptr cinfo);
EXTERN(void) jinit_marker_reader(j_decompress_ptr cinfo);
EXTERN(void) jinit_huff_decoder(j_decompress_ptr cinfo);
EXTERN(void) jinit_phuff_decoder(j_decompress_ptr cinfo);
EXTERN(void) jinit_arith_decoder(j_decompress_ptr cinfo);
EXTERN(void) jinit_inverse_dct(j_decompress_ptr cinfo);
EXTERN(void) jinit_upsampler(j_decompress_ptr cinfo);
EXTERN(void) jinit_color_deconverter(j_decompress_ptr cinfo);
EXTERN(void) jinit_1pass_quantizer(j_decompress_ptr cinfo);
EXTERN(void) jinit_2pass_quantizer(j_decompress_ptr cinfo);
EXTERN(void) jinit_merged_upsampler(j_decompress_ptr cinfo);
/* Memory manager initialization */
EXTERN(void) jinit_memory_mgr(j_common_ptr cinfo);
/* Utility routines in jutils.c */
EXTERN(long) jdiv_round_up(long a, long b);
EXTERN(long) jround_up(long a, long b);
EXTERN(void) jcopy_sample_rows(JSAMPARRAY input_array, int source_row,
JSAMPARRAY output_array, int dest_row,
int num_rows, JDIMENSION num_cols);
EXTERN(void) jcopy_block_row(JBLOCKROW input_row, JBLOCKROW output_row,
JDIMENSION num_blocks);
EXTERN(void) jzero_far(void *target, size_t bytestozero);
/* Constant tables in jutils.c */
#if 0 /* This table is not actually needed in v6a */
extern const int jpeg_zigzag_order[]; /* natural coef order to zigzag order */
#endif
extern const int jpeg_natural_order[]; /* zigzag coef order to natural order */
/* Arithmetic coding probability estimation tables in jaricom.c */
extern const JLONG jpeg_aritab[];
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,202 @@
#pragma once
/* Auto-generated by build_jpegli_static_android_ndk_r26_api21_private_v10_ifs_parse_fix.sh. */
/* Include this header instead of jpegli/jpeglib.h when using the private-symbol Jpegli archive. */
/* It remaps the libjpeg-compatible API to kjpegli_* symbols to avoid collisions with MozJPEG/Ghostscript. */
#ifndef jpegli_CreateCompress
#define jpegli_CreateCompress kjpegli_jpegli_CreateCompress
#endif
#ifndef jpegli_CreateDecompress
#define jpegli_CreateDecompress kjpegli_jpegli_CreateDecompress
#endif
#ifndef jpegli_abort
#define jpegli_abort kjpegli_jpegli_abort
#endif
#ifndef jpegli_abort_compress
#define jpegli_abort_compress kjpegli_jpegli_abort_compress
#endif
#ifndef jpegli_abort_decompress
#define jpegli_abort_decompress kjpegli_jpegli_abort_decompress
#endif
#ifndef jpegli_add_quant_table
#define jpegli_add_quant_table kjpegli_jpegli_add_quant_table
#endif
#ifndef jpegli_alloc_huff_table
#define jpegli_alloc_huff_table kjpegli_jpegli_alloc_huff_table
#endif
#ifndef jpegli_alloc_quant_table
#define jpegli_alloc_quant_table kjpegli_jpegli_alloc_quant_table
#endif
#ifndef jpegli_bytes_per_sample
#define jpegli_bytes_per_sample kjpegli_jpegli_bytes_per_sample
#endif
#ifndef jpegli_calc_output_dimensions
#define jpegli_calc_output_dimensions kjpegli_jpegli_calc_output_dimensions
#endif
#ifndef jpegli_consume_input
#define jpegli_consume_input kjpegli_jpegli_consume_input
#endif
#ifndef jpegli_copy_critical_parameters
#define jpegli_copy_critical_parameters kjpegli_jpegli_copy_critical_parameters
#endif
#ifndef jpegli_crop_scanline
#define jpegli_crop_scanline kjpegli_jpegli_crop_scanline
#endif
#ifndef jpegli_default_colorspace
#define jpegli_default_colorspace kjpegli_jpegli_default_colorspace
#endif
#ifndef jpegli_destroy
#define jpegli_destroy kjpegli_jpegli_destroy
#endif
#ifndef jpegli_destroy_compress
#define jpegli_destroy_compress kjpegli_jpegli_destroy_compress
#endif
#ifndef jpegli_destroy_decompress
#define jpegli_destroy_decompress kjpegli_jpegli_destroy_decompress
#endif
#ifndef jpegli_enable_adaptive_quantization
#define jpegli_enable_adaptive_quantization kjpegli_jpegli_enable_adaptive_quantization
#endif
#ifndef jpegli_finish_compress
#define jpegli_finish_compress kjpegli_jpegli_finish_compress
#endif
#ifndef jpegli_finish_decompress
#define jpegli_finish_decompress kjpegli_jpegli_finish_decompress
#endif
#ifndef jpegli_finish_output
#define jpegli_finish_output kjpegli_jpegli_finish_output
#endif
#ifndef jpegli_has_multiple_scans
#define jpegli_has_multiple_scans kjpegli_jpegli_has_multiple_scans
#endif
#ifndef jpegli_input_complete
#define jpegli_input_complete kjpegli_jpegli_input_complete
#endif
#ifndef jpegli_mem_dest
#define jpegli_mem_dest kjpegli_jpegli_mem_dest
#endif
#ifndef jpegli_mem_src
#define jpegli_mem_src kjpegli_jpegli_mem_src
#endif
#ifndef jpegli_new_colormap
#define jpegli_new_colormap kjpegli_jpegli_new_colormap
#endif
#ifndef jpegli_quality_scaling
#define jpegli_quality_scaling kjpegli_jpegli_quality_scaling
#endif
#ifndef jpegli_quality_to_distance
#define jpegli_quality_to_distance kjpegli_jpegli_quality_to_distance
#endif
#ifndef jpegli_read_coefficients
#define jpegli_read_coefficients kjpegli_jpegli_read_coefficients
#endif
#ifndef jpegli_read_header
#define jpegli_read_header kjpegli_jpegli_read_header
#endif
#ifndef jpegli_read_icc_profile
#define jpegli_read_icc_profile kjpegli_jpegli_read_icc_profile
#endif
#ifndef jpegli_read_raw_data
#define jpegli_read_raw_data kjpegli_jpegli_read_raw_data
#endif
#ifndef jpegli_read_scanlines
#define jpegli_read_scanlines kjpegli_jpegli_read_scanlines
#endif
#ifndef jpegli_resync_to_restart
#define jpegli_resync_to_restart kjpegli_jpegli_resync_to_restart
#endif
#ifndef jpegli_save_markers
#define jpegli_save_markers kjpegli_jpegli_save_markers
#endif
#ifndef jpegli_set_cicp_transfer_function
#define jpegli_set_cicp_transfer_function kjpegli_jpegli_set_cicp_transfer_function
#endif
#ifndef jpegli_set_colorspace
#define jpegli_set_colorspace kjpegli_jpegli_set_colorspace
#endif
#ifndef jpegli_set_defaults
#define jpegli_set_defaults kjpegli_jpegli_set_defaults
#endif
#ifndef jpegli_set_distance
#define jpegli_set_distance kjpegli_jpegli_set_distance
#endif
#ifndef jpegli_set_input_format
#define jpegli_set_input_format kjpegli_jpegli_set_input_format
#endif
#ifndef jpegli_set_linear_quality
#define jpegli_set_linear_quality kjpegli_jpegli_set_linear_quality
#endif
#ifndef jpegli_set_marker_processor
#define jpegli_set_marker_processor kjpegli_jpegli_set_marker_processor
#endif
#ifndef jpegli_set_output_format
#define jpegli_set_output_format kjpegli_jpegli_set_output_format
#endif
#ifndef jpegli_set_progressive_level
#define jpegli_set_progressive_level kjpegli_jpegli_set_progressive_level
#endif
#ifndef jpegli_set_psnr
#define jpegli_set_psnr kjpegli_jpegli_set_psnr
#endif
#ifndef jpegli_set_quality
#define jpegli_set_quality kjpegli_jpegli_set_quality
#endif
#ifndef jpegli_set_xyb_mode
#define jpegli_set_xyb_mode kjpegli_jpegli_set_xyb_mode
#endif
#ifndef jpegli_simple_progression
#define jpegli_simple_progression kjpegli_jpegli_simple_progression
#endif
#ifndef jpegli_skip_scanlines
#define jpegli_skip_scanlines kjpegli_jpegli_skip_scanlines
#endif
#ifndef jpegli_start_compress
#define jpegli_start_compress kjpegli_jpegli_start_compress
#endif
#ifndef jpegli_start_decompress
#define jpegli_start_decompress kjpegli_jpegli_start_decompress
#endif
#ifndef jpegli_start_output
#define jpegli_start_output kjpegli_jpegli_start_output
#endif
#ifndef jpegli_std_error
#define jpegli_std_error kjpegli_jpegli_std_error
#endif
#ifndef jpegli_stdio_dest
#define jpegli_stdio_dest kjpegli_jpegli_stdio_dest
#endif
#ifndef jpegli_stdio_src
#define jpegli_stdio_src kjpegli_jpegli_stdio_src
#endif
#ifndef jpegli_suppress_tables
#define jpegli_suppress_tables kjpegli_jpegli_suppress_tables
#endif
#ifndef jpegli_use_standard_quant_tables
#define jpegli_use_standard_quant_tables kjpegli_jpegli_use_standard_quant_tables
#endif
#ifndef jpegli_write_coefficients
#define jpegli_write_coefficients kjpegli_jpegli_write_coefficients
#endif
#ifndef jpegli_write_icc_profile
#define jpegli_write_icc_profile kjpegli_jpegli_write_icc_profile
#endif
#ifndef jpegli_write_m_byte
#define jpegli_write_m_byte kjpegli_jpegli_write_m_byte
#endif
#ifndef jpegli_write_m_header
#define jpegli_write_m_header kjpegli_jpegli_write_m_header
#endif
#ifndef jpegli_write_marker
#define jpegli_write_marker kjpegli_jpegli_write_marker
#endif
#ifndef jpegli_write_raw_data
#define jpegli_write_raw_data kjpegli_jpegli_write_raw_data
#endif
#ifndef jpegli_write_scanlines
#define jpegli_write_scanlines kjpegli_jpegli_write_scanlines
#endif
#ifndef jpegli_write_tables
#define jpegli_write_tables kjpegli_jpegli_write_tables
#endif
#include <jpegli/jpeglib.h>
@@ -0,0 +1,65 @@
jpegli_CreateCompress kjpegli_jpegli_CreateCompress
jpegli_CreateDecompress kjpegli_jpegli_CreateDecompress
jpegli_abort kjpegli_jpegli_abort
jpegli_abort_compress kjpegli_jpegli_abort_compress
jpegli_abort_decompress kjpegli_jpegli_abort_decompress
jpegli_add_quant_table kjpegli_jpegli_add_quant_table
jpegli_alloc_huff_table kjpegli_jpegli_alloc_huff_table
jpegli_alloc_quant_table kjpegli_jpegli_alloc_quant_table
jpegli_bytes_per_sample kjpegli_jpegli_bytes_per_sample
jpegli_calc_output_dimensions kjpegli_jpegli_calc_output_dimensions
jpegli_consume_input kjpegli_jpegli_consume_input
jpegli_copy_critical_parameters kjpegli_jpegli_copy_critical_parameters
jpegli_crop_scanline kjpegli_jpegli_crop_scanline
jpegli_default_colorspace kjpegli_jpegli_default_colorspace
jpegli_destroy kjpegli_jpegli_destroy
jpegli_destroy_compress kjpegli_jpegli_destroy_compress
jpegli_destroy_decompress kjpegli_jpegli_destroy_decompress
jpegli_enable_adaptive_quantization kjpegli_jpegli_enable_adaptive_quantization
jpegli_finish_compress kjpegli_jpegli_finish_compress
jpegli_finish_decompress kjpegli_jpegli_finish_decompress
jpegli_finish_output kjpegli_jpegli_finish_output
jpegli_has_multiple_scans kjpegli_jpegli_has_multiple_scans
jpegli_input_complete kjpegli_jpegli_input_complete
jpegli_mem_dest kjpegli_jpegli_mem_dest
jpegli_mem_src kjpegli_jpegli_mem_src
jpegli_new_colormap kjpegli_jpegli_new_colormap
jpegli_quality_scaling kjpegli_jpegli_quality_scaling
jpegli_quality_to_distance kjpegli_jpegli_quality_to_distance
jpegli_read_coefficients kjpegli_jpegli_read_coefficients
jpegli_read_header kjpegli_jpegli_read_header
jpegli_read_icc_profile kjpegli_jpegli_read_icc_profile
jpegli_read_raw_data kjpegli_jpegli_read_raw_data
jpegli_read_scanlines kjpegli_jpegli_read_scanlines
jpegli_resync_to_restart kjpegli_jpegli_resync_to_restart
jpegli_save_markers kjpegli_jpegli_save_markers
jpegli_set_cicp_transfer_function kjpegli_jpegli_set_cicp_transfer_function
jpegli_set_colorspace kjpegli_jpegli_set_colorspace
jpegli_set_defaults kjpegli_jpegli_set_defaults
jpegli_set_distance kjpegli_jpegli_set_distance
jpegli_set_input_format kjpegli_jpegli_set_input_format
jpegli_set_linear_quality kjpegli_jpegli_set_linear_quality
jpegli_set_marker_processor kjpegli_jpegli_set_marker_processor
jpegli_set_output_format kjpegli_jpegli_set_output_format
jpegli_set_progressive_level kjpegli_jpegli_set_progressive_level
jpegli_set_psnr kjpegli_jpegli_set_psnr
jpegli_set_quality kjpegli_jpegli_set_quality
jpegli_set_xyb_mode kjpegli_jpegli_set_xyb_mode
jpegli_simple_progression kjpegli_jpegli_simple_progression
jpegli_skip_scanlines kjpegli_jpegli_skip_scanlines
jpegli_start_compress kjpegli_jpegli_start_compress
jpegli_start_decompress kjpegli_jpegli_start_decompress
jpegli_start_output kjpegli_jpegli_start_output
jpegli_std_error kjpegli_jpegli_std_error
jpegli_stdio_dest kjpegli_jpegli_stdio_dest
jpegli_stdio_src kjpegli_jpegli_stdio_src
jpegli_suppress_tables kjpegli_jpegli_suppress_tables
jpegli_use_standard_quant_tables kjpegli_jpegli_use_standard_quant_tables
jpegli_write_coefficients kjpegli_jpegli_write_coefficients
jpegli_write_icc_profile kjpegli_jpegli_write_icc_profile
jpegli_write_m_byte kjpegli_jpegli_write_m_byte
jpegli_write_m_header kjpegli_jpegli_write_m_header
jpegli_write_marker kjpegli_jpegli_write_marker
jpegli_write_raw_data kjpegli_jpegli_write_raw_data
jpegli_write_scanlines kjpegli_jpegli_write_scanlines
jpegli_write_tables kjpegli_jpegli_write_tables
@@ -0,0 +1,828 @@
0_libjpegli_static_adaptive_quantization.cc.o:
00000000 W _ZN3hwy8N_EMU1285FloorIfLj1EEENS0_6Vec128IT_XT0_EEES4_
00000000 T _ZN6jpegli25ComputeAdaptiveQuantFieldEP20jpeg_compress_struct
00000000 W _ZN6jpegli9RowBufferIfE6PadRowEjji
00000000 W _ZN6jpegli9RowBufferIfE7CopyRowEiii
00000000 W _ZNK6jpegli9RowBufferIfE3RowEi
10_libjpegli_static_downsample.cc.o:
00000000 T _ZN6jpegli14NullDownsampleEPPfjS0_
00000000 T _ZN6jpegli19ApplyInputSmoothingEP20jpeg_compress_struct
00000000 T _ZN6jpegli21DownsampleInputBufferEP20jpeg_compress_struct
00000000 T _ZN6jpegli23ChooseDownsampleMethodsEP20jpeg_compress_struct
00000000 T _ZN6jpegli8N_EMU12813Downsample1x2EPPfjS1_
00000000 T _ZN6jpegli8N_EMU12813Downsample1x3EPPfjS1_
00000000 T _ZN6jpegli8N_EMU12813Downsample1x4EPPfjS1_
00000000 T _ZN6jpegli8N_EMU12813Downsample2x1EPPfjS1_
00000000 T _ZN6jpegli8N_EMU12813Downsample2x2EPPfjS1_
00000000 T _ZN6jpegli8N_EMU12813Downsample2x3EPPfjS1_
00000000 T _ZN6jpegli8N_EMU12813Downsample2x4EPPfjS1_
00000000 T _ZN6jpegli8N_EMU12813Downsample3x1EPPfjS1_
00000000 T _ZN6jpegli8N_EMU12813Downsample3x2EPPfjS1_
00000000 T _ZN6jpegli8N_EMU12813Downsample3x3EPPfjS1_
00000000 T _ZN6jpegli8N_EMU12813Downsample3x4EPPfjS1_
00000000 T _ZN6jpegli8N_EMU12813Downsample4x1EPPfjS1_
00000000 T _ZN6jpegli8N_EMU12813Downsample4x2EPPfjS1_
00000000 T _ZN6jpegli8N_EMU12813Downsample4x3EPPfjS1_
00000000 T _ZN6jpegli8N_EMU12813Downsample4x4EPPfjS1_
00000000 T _ZN6jpegli8N_EMU12816DownsampleRow2x1EPKfjPf
00000000 T _ZN6jpegli8N_EMU12816DownsampleRow3x1EPKfjPf
00000000 T _ZN6jpegli8N_EMU12816DownsampleRow4x1EPKfjPf
00000000 W _ZN6jpegli9RowBufferIfE7CopyRowEiii
00000000 W _ZNK6jpegli9RowBufferIfE3RowEi
11_libjpegli_static_encode.cc.o:
00000000 T _ZN6jpegli10CheckStateEP20jpeg_compress_structi
00000000 T _ZN6jpegli10CheckStateEP20jpeg_compress_structii
00000000 W _ZN6jpegli11GetBlockRowIP20jpeg_compress_structEEPPA64_sT_ij
00000000 T _ZN6jpegli12InitCompressEP20jpeg_compress_structi
00000000 T _ZN6jpegli12ReadInputRowEP20jpeg_compress_structPKhPPf
00000000 T _ZN6jpegli14PadInputBufferEP20jpeg_compress_structPPf
00000000 T _ZN6jpegli14ProcessiMCURowEP20jpeg_compress_struct
00000000 T _ZN6jpegli15AllocateBuffersEP20jpeg_compress_struct
00000000 T _ZN6jpegli15ProcessiMCURowsEP20jpeg_compress_struct
00000000 W _ZN6jpegli16SetSentTableFlagI10JQUANT_TBLEEvPPT_ji
00000000 W _ZN6jpegli16SetSentTableFlagI9JHUFF_TBLEEvPPT_ji
00000000 T _ZN6jpegli18ValidateScanScriptEP20jpeg_compress_struct
00000000 T _ZN6jpegli19InitProgressMonitorEP20jpeg_compress_struct
00000000 T _ZN6jpegli19ZigZagShuffleBlocksEP20jpeg_compress_struct
00000000 T _ZN6jpegli20IsStreamingSupportedEP20jpeg_compress_struct
00000000 T _ZN6jpegli20SetDefaultScanScriptEP20jpeg_compress_struct
00000000 T _ZN6jpegli23LinearQualityToDistanceEi
00000000 T _ZN6jpegli24InitializeCompressParamsEP20jpeg_compress_struct
00000000 T _ZN6jpegli24ProcessCompressionParamsEP20jpeg_compress_struct
00000000 T _ZN6jpegli24ProgressMonitorInputPassEP20jpeg_compress_struct
00000000 W _ZN6jpegli9RowBufferIfE6PadRowEjji
00000000 W _ZN6jpegli9RowBufferIfE7FillRowEifj
00000000 W _ZN6jpegli9RowBufferIfE8AllocateIP20jpeg_compress_structEEvT_jj
00000000 W _ZNK6jpegli9RowBufferIfE3RowEi
00000000 W _ZNKSt6__ndk16vectorIN6jpegli15ProgressiveScanENS_9allocatorIS2_EEE11__recommendB7v170000Ej
00000000 W _ZNSt6__ndk114__split_bufferIN6jpegli15ProgressiveScanERNS_9allocatorIS2_EEE17__destruct_at_endB7v170000EPS2_NS_17integral_constantIbLb0EEE
00000000 W _ZNSt6__ndk114__split_bufferIN6jpegli15ProgressiveScanERNS_9allocatorIS2_EEE5clearB7v170000Ev
00000000 W _ZNSt6__ndk114__split_bufferIN6jpegli15ProgressiveScanERNS_9allocatorIS2_EEEC2EjjS5_
00000000 W _ZNSt6__ndk114__split_bufferIN6jpegli15ProgressiveScanERNS_9allocatorIS2_EEED2Ev
00000000 W _ZNSt6__ndk121__unwrap_and_dispatchB7v170000INS_10__overloadINS_11__move_loopINS_17_ClassicAlgPolicyEEENS_14__move_trivialEEENS_16reverse_iteratorIPN6jpegli15ProgressiveScanEEESB_SB_Li0EEENS_4pairIT0_T2_EESD_T1_SE_
00000000 W _ZNSt6__ndk14moveB7v170000INS_16reverse_iteratorIPN6jpegli15ProgressiveScanEEES5_EET0_T_S7_S6_
00000000 W _ZNSt6__ndk16vectorIN6jpegli15ProgressiveScanENS_9allocatorIS2_EEE16__destroy_vectorclB7v170000Ev
00000000 W _ZNSt6__ndk16vectorIN6jpegli15ProgressiveScanENS_9allocatorIS2_EEE21__push_back_slow_pathIS2_EEvOT_
00000000 W _ZNSt6__ndk16vectorIN6jpegli15ProgressiveScanENS_9allocatorIS2_EEE26__swap_out_circular_bufferERNS_14__split_bufferIS2_RS4_EE
00000000 W _ZNSt6__ndk16vectorIN6jpegli15ProgressiveScanENS_9allocatorIS2_EEE9push_backB7v170000EOS2_
00000000 W _ZNSt6__ndk16vectorIN6jpegli15ProgressiveScanENS_9allocatorIS2_EEED2B7v170000Ev
00000000 W _ZNSt6__ndk16vectorIhNS_9allocatorIhEEE11__vallocateB7v170000Ej
00000000 W _ZNSt6__ndk16vectorIhNS_9allocatorIhEEE16__destroy_vectorclB7v170000Ev
00000000 W _ZNSt6__ndk16vectorIhNS_9allocatorIhEEE18__construct_at_endEj
00000000 W _ZNSt6__ndk16vectorIhNS_9allocatorIhEEEC2Ej
00000000 W _ZNSt6__ndk16vectorIhNS_9allocatorIhEEED2B7v170000Ev
00000000 W _ZNSt6__ndk19allocatorIN6jpegli15ProgressiveScanEE8allocateB7v170000Ej
00000000 W _ZSt28__throw_bad_array_new_lengthB7v170000v
00000000 T jpegli_CreateCompress
00000000 T jpegli_abort_compress
00000000 T jpegli_add_quant_table
00000000 T jpegli_copy_critical_parameters
00000000 T jpegli_default_colorspace
00000000 T jpegli_destroy_compress
00000000 T jpegli_enable_adaptive_quantization
00000000 T jpegli_finish_compress
00000000 T jpegli_quality_scaling
00000000 T jpegli_quality_to_distance
00000000 T jpegli_set_cicp_transfer_function
00000000 T jpegli_set_colorspace
00000000 T jpegli_set_defaults
00000000 T jpegli_set_distance
00000000 T jpegli_set_input_format
00000000 T jpegli_set_linear_quality
00000000 T jpegli_set_progressive_level
00000000 T jpegli_set_psnr
00000000 T jpegli_set_quality
00000000 T jpegli_set_xyb_mode
00000000 T jpegli_simple_progression
00000000 T jpegli_start_compress
00000000 T jpegli_suppress_tables
00000000 T jpegli_use_standard_quant_tables
00000000 T jpegli_write_coefficients
00000000 T jpegli_write_icc_profile
00000000 T jpegli_write_m_byte
00000000 T jpegli_write_m_header
00000000 T jpegli_write_marker
00000000 T jpegli_write_raw_data
00000000 T jpegli_write_scanlines
00000000 T jpegli_write_tables
12_libjpegli_static_encode_finish.cc.o:
00000000 W _ZN6jpegli11GetBlockRowIP20jpeg_compress_structEEPPA64_sT_ij
00000000 T _ZN6jpegli14QuantizetoPSNREP20jpeg_compress_struct
00000000 T _ZN6jpegli8N_EMU12810BlockErrorEPKsPKfS4_fS4_S4_
00000000 T _ZN6jpegli8N_EMU12811ComputePSNREP20jpeg_compress_structi
00000000 T _ZN6jpegli8N_EMU12815ReQuantizeBlockEPsPKffS3_S3_
00000000 T _ZN6jpegli8N_EMU12816ReQuantizeCoeffsEP20jpeg_compress_struct
00000000 T _ZN6jpegli8N_EMU12821ComputeInverseWeightsEPKfPf
00000000 W _ZNK6jpegli9RowBufferIfE3RowEi
13_libjpegli_static_encode_streaming.cc.o:
00000000 W _ZN3hwy8N_EMU1283ShlINS0_6Vec128IiLj4EEEEET_S4_S4_
00000000 T _ZN6jpegli12WriteiMCURowEP20jpeg_compress_struct
00000000 T _ZN6jpegli23ComputeTokensForiMCURowEP20jpeg_compress_struct
00000000 T _ZN6jpegli29ComputeCoefficientsForiMCURowEP20jpeg_compress_struct
00000000 T _ZN6jpegli8N_EMU12812WriteiMCURowEP20jpeg_compress_struct
00000000 W _ZN6jpegli8N_EMU12814ProcessiMCURowILi0EEEvP20jpeg_compress_struct
00000000 W _ZN6jpegli8N_EMU12814ProcessiMCURowILi1EEEvP20jpeg_compress_struct
00000000 W _ZN6jpegli8N_EMU12814ProcessiMCURowILi2EEEvP20jpeg_compress_struct
00000000 T _ZN6jpegli8N_EMU12823ComputeTokensForiMCURowEP20jpeg_compress_struct
00000000 T _ZN6jpegli8N_EMU12829ComputeCoefficientsForiMCURowEP20jpeg_compress_struct
00000000 W _ZNK6jpegli9RowBufferIfE3RowEi
14_libjpegli_static_entropy_coding.cc.o:
00000000 T _ZN6jpegli12TokenizeJpegEP20jpeg_compress_struct
00000000 T _ZN6jpegli16InitEntropyCoderEP20jpeg_compress_struct
00000000 T _ZN6jpegli17CopyHuffmanTablesEP20jpeg_compress_struct
00000000 T _ZN6jpegli17EstimateNumTokensEP20jpeg_compress_structjjjj
00000000 T _ZN6jpegli20OptimizeHuffmanCodesEP20jpeg_compress_struct
00000000 T _ZN6jpegli21MaxNumTokensPerMCURowEP20jpeg_compress_struct
00000000 T _ZN6jpegli8N_EMU12823ComputeTokensSequentialEPKsiiiPPNS_5TokenE
00000000 W _ZNKSt6__ndk16vectorIfNS_9allocatorIfEEE11__recommendB7v170000Ej
00000000 W _ZNKSt6__ndk16vectorIjNS_9allocatorIjEEE11__recommendB7v170000Ej
00000000 W _ZNSt6__ndk114__split_bufferIfRNS_9allocatorIfEEE17__destruct_at_endB7v170000EPfNS_17integral_constantIbLb0EEE
00000000 W _ZNSt6__ndk114__split_bufferIfRNS_9allocatorIfEEE5clearB7v170000Ev
00000000 W _ZNSt6__ndk114__split_bufferIfRNS_9allocatorIfEEEC2EjjS3_
00000000 W _ZNSt6__ndk114__split_bufferIfRNS_9allocatorIfEEED2Ev
00000000 W _ZNSt6__ndk114__split_bufferIjRNS_9allocatorIjEEE17__destruct_at_endB7v170000EPjNS_17integral_constantIbLb0EEE
00000000 W _ZNSt6__ndk114__split_bufferIjRNS_9allocatorIjEEE5clearB7v170000Ev
00000000 W _ZNSt6__ndk114__split_bufferIjRNS_9allocatorIjEEED2Ev
00000000 W _ZNSt6__ndk121__unwrap_and_dispatchB7v170000INS_10__overloadINS_11__move_loopINS_17_ClassicAlgPolicyEEENS_14__move_trivialEEENS_16reverse_iteratorIPfEES9_S9_Li0EEENS_4pairIT0_T2_EESB_T1_SC_
00000000 W _ZNSt6__ndk121__unwrap_and_dispatchB7v170000INS_10__overloadINS_11__move_loopINS_17_ClassicAlgPolicyEEENS_14__move_trivialEEENS_16reverse_iteratorIPjEES9_S9_Li0EEENS_4pairIT0_T2_EESB_T1_SC_
00000000 W _ZNSt6__ndk14moveB7v170000INS_16reverse_iteratorIPfEES3_EET0_T_S5_S4_
00000000 W _ZNSt6__ndk14moveB7v170000INS_16reverse_iteratorIPjEES3_EET0_T_S5_S4_
00000000 W _ZNSt6__ndk16vectorIfNS_9allocatorIfEEE16__destroy_vectorclB7v170000Ev
00000000 W _ZNSt6__ndk16vectorIfNS_9allocatorIfEEE21__push_back_slow_pathIRKfEEvOT_
00000000 W _ZNSt6__ndk16vectorIfNS_9allocatorIfEEE26__swap_out_circular_bufferERNS_14__split_bufferIfRS2_EE
00000000 W _ZNSt6__ndk16vectorIfNS_9allocatorIfEEE9push_backB7v170000ERKf
00000000 W _ZNSt6__ndk16vectorIfNS_9allocatorIfEEED2B7v170000Ev
00000000 W _ZNSt6__ndk16vectorIhNS_9allocatorIhEEE11__vallocateB7v170000Ej
00000000 W _ZNSt6__ndk16vectorIhNS_9allocatorIhEEE16__destroy_vectorclB7v170000Ev
00000000 W _ZNSt6__ndk16vectorIhNS_9allocatorIhEEE18__construct_at_endEj
00000000 W _ZNSt6__ndk16vectorIhNS_9allocatorIhEEEC2Ej
00000000 W _ZNSt6__ndk16vectorIhNS_9allocatorIhEEED2B7v170000Ev
00000000 W _ZNSt6__ndk16vectorIiNS_9allocatorIiEEE11__vallocateB7v170000Ej
00000000 W _ZNSt6__ndk16vectorIiNS_9allocatorIiEEE16__destroy_vectorclB7v170000Ev
00000000 W _ZNSt6__ndk16vectorIiNS_9allocatorIiEEE18__construct_at_endEj
00000000 W _ZNSt6__ndk16vectorIiNS_9allocatorIiEEEC2Ej
00000000 W _ZNSt6__ndk16vectorIiNS_9allocatorIiEEED2B7v170000Ev
00000000 W _ZNSt6__ndk16vectorIjNS_9allocatorIjEEE11__vallocateB7v170000Ej
00000000 W _ZNSt6__ndk16vectorIjNS_9allocatorIjEEE16__destroy_vectorclB7v170000Ev
00000000 W _ZNSt6__ndk16vectorIjNS_9allocatorIjEEE18__construct_at_endEj
00000000 W _ZNSt6__ndk16vectorIjNS_9allocatorIjEEE21__push_back_slow_pathIRKjEEvOT_
00000000 W _ZNSt6__ndk16vectorIjNS_9allocatorIjEEE26__swap_out_circular_bufferERNS_14__split_bufferIjRS2_EE
00000000 W _ZNSt6__ndk16vectorIjNS_9allocatorIjEEE6resizeEj
00000000 W _ZNSt6__ndk16vectorIjNS_9allocatorIjEEE8__appendEj
00000000 W _ZNSt6__ndk16vectorIjNS_9allocatorIjEEE9push_backB7v170000ERKj
00000000 W _ZNSt6__ndk16vectorIjNS_9allocatorIjEEEC2Ej
00000000 W _ZNSt6__ndk16vectorIjNS_9allocatorIjEEED2B7v170000Ev
00000000 W _ZNSt6__ndk19allocatorIfE8allocateB7v170000Ej
00000000 W _ZNSt6__ndk19allocatorIiE8allocateB7v170000Ej
00000000 W _ZNSt6__ndk19allocatorIjE8allocateB7v170000Ej
00000000 W _ZSt28__throw_bad_array_new_lengthB7v170000v
15_libjpegli_static_error.cc.o:
00000000 T _ZN6jpegli11EmitMessageEP18jpeg_common_structi
00000000 T _ZN6jpegli12FormatStringEPcPKcz
00000000 T _ZN6jpegli13ExitWithAbortEP18jpeg_common_struct
00000000 T _ZN6jpegli13FormatMessageEP18jpeg_common_structPc
00000000 T _ZN6jpegli13OutputMessageEP18jpeg_common_struct
00000000 T _ZN6jpegli17ResetErrorManagerEP18jpeg_common_struct
00000000 W _ZNKSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4findB7v170000EPKcj
00000000 W _ZNSt6__ndk110__str_findB7v170000IcjNS_11char_traitsIcEELj4294967295EEET0_PKT_S3_S6_S3_S3_
00000000 W _ZNSt6__ndk111char_traitsIcE4findEPKcjRS2_
00000000 W _ZNSt6__ndk111char_traitsIcE7compareEPKcS3_j
00000000 W _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v170000IDnEEPKc
00000000 W _ZNSt6__ndk118__search_substringB7v170000IcNS_11char_traitsIcEEEEPKT_S5_S5_S5_S5_
00000000 T jpegli_std_error
16_libjpegli_static_huffman.cc.o:
00000000 T _ZN6jpegli17CreateHuffmanTreeEPKjjiPh
00000000 T _ZN6jpegli20ValidateHuffmanTableEP18jpeg_common_structPK9JHUFF_TBLb
00000000 T _ZN6jpegli21BuildJpegHuffmanTableEPKjS1_PNS_17HuffmanTableEntryE
00000000 T _ZN6jpegli24AddStandardHuffmanTablesEP18jpeg_common_structb
00000000 T _ZN6jpegli8SetDepthERKNS_11HuffmanTreeEPS0_Phh
00000000 W _ZNKSt6__ndk16vectorIN6jpegli11HuffmanTreeENS_9allocatorIS2_EEE11__recommendB7v170000Ej
00000000 W _ZNSt6__ndk110__pop_heapB7v170000INS_17_ClassicAlgPolicyEPFbRKN6jpegli11HuffmanTreeES5_EPS3_EEvT1_S9_RT0_NS_15iterator_traitsIS9_E15difference_typeE
00000000 W _ZNSt6__ndk111__introsortINS_17_ClassicAlgPolicyERPFbRKN6jpegli11HuffmanTreeES5_EPS3_Lb0EEEvT1_SA_T0_NS_15iterator_traitsISA_E15difference_typeEb
00000000 W _ZNSt6__ndk111__make_heapB7v170000INS_17_ClassicAlgPolicyERPFbRKN6jpegli11HuffmanTreeES5_EPS3_EEvT1_SA_OT0_
00000000 W _ZNSt6__ndk111__sift_downB7v170000INS_17_ClassicAlgPolicyERPFbRKN6jpegli11HuffmanTreeES5_EPS3_EEvT1_OT0_NS_15iterator_traitsISA_E15difference_typeESA_
00000000 W _ZNSt6__ndk111__sort_heapB7v170000INS_17_ClassicAlgPolicyERPFbRKN6jpegli11HuffmanTreeES5_EPS3_EEvT1_SA_OT0_
00000000 W _ZNSt6__ndk111max_elementB7v170000IPhNS_6__lessIhhEEEET_S4_S4_T0_
00000000 W _ZNSt6__ndk113__max_elementB7v170000IRNS_6__lessIhhEEPhEET0_S5_S5_T_
00000000 W _ZNSt6__ndk114__partial_sortB7v170000INS_17_ClassicAlgPolicyERPFbRKN6jpegli11HuffmanTreeES5_EPS3_S9_EET1_SA_SA_T2_RT0_
00000000 W _ZNSt6__ndk114__split_bufferIN6jpegli11HuffmanTreeERNS_9allocatorIS2_EEE17__destruct_at_endB7v170000EPS2_NS_17integral_constantIbLb0EEE
00000000 W _ZNSt6__ndk114__split_bufferIN6jpegli11HuffmanTreeERNS_9allocatorIS2_EEE5clearB7v170000Ev
00000000 W _ZNSt6__ndk114__split_bufferIN6jpegli11HuffmanTreeERNS_9allocatorIS2_EEEC2EjjS5_
00000000 W _ZNSt6__ndk114__split_bufferIN6jpegli11HuffmanTreeERNS_9allocatorIS2_EEED2Ev
00000000 W _ZNSt6__ndk116__insertion_sortB7v170000INS_17_ClassicAlgPolicyERPFbRKN6jpegli11HuffmanTreeES5_EPS3_EEvT1_SA_T0_
00000000 W _ZNSt6__ndk117__floyd_sift_downB7v170000INS_17_ClassicAlgPolicyERPFbRKN6jpegli11HuffmanTreeES5_EPS3_EET1_SA_OT0_NS_15iterator_traitsISA_E15difference_typeE
00000000 W _ZNSt6__ndk119__partial_sort_implB7v170000INS_17_ClassicAlgPolicyERPFbRKN6jpegli11HuffmanTreeES5_EPS3_S9_EET1_SA_SA_T2_OT0_
00000000 W _ZNSt6__ndk121__unwrap_and_dispatchB7v170000INS_10__overloadINS_11__move_loopINS_17_ClassicAlgPolicyEEENS_14__move_trivialEEENS_16reverse_iteratorIPN6jpegli11HuffmanTreeEEESB_SB_Li0EEENS_4pairIT0_T2_EESD_T1_SE_
00000000 W _ZNSt6__ndk126__insertion_sort_unguardedB7v170000INS_17_ClassicAlgPolicyERPFbRKN6jpegli11HuffmanTreeES5_EPS3_EEvT1_SA_T0_
00000000 W _ZNSt6__ndk127__insertion_sort_incompleteIRPFbRKN6jpegli11HuffmanTreeES4_EPS2_EEbT0_S9_T_
00000000 W _ZNSt6__ndk131__partition_with_equals_on_leftB7v170000INS_17_ClassicAlgPolicyEPN6jpegli11HuffmanTreeERPFbRKS3_S6_EEET0_SA_SA_T1_
00000000 W _ZNSt6__ndk132__partition_with_equals_on_rightB7v170000INS_17_ClassicAlgPolicyEPN6jpegli11HuffmanTreeERPFbRKS3_S6_EEENS_4pairIT0_bEESB_SB_T1_
00000000 W _ZNSt6__ndk14moveB7v170000INS_16reverse_iteratorIPN6jpegli11HuffmanTreeEEES5_EET0_T_S7_S6_
00000000 W _ZNSt6__ndk14sortB7v170000INS_11__wrap_iterIPN6jpegli11HuffmanTreeEEEPFbRKS3_S7_EEEvT_SA_T0_
00000000 W _ZNSt6__ndk16__sortIRPFbRKN6jpegli11HuffmanTreeES4_EPS2_EEvT0_S9_T_
00000000 W _ZNSt6__ndk16vectorIN6jpegli11HuffmanTreeENS_9allocatorIS2_EEE12emplace_backIJRKjisEEERS2_DpOT_
00000000 W _ZNSt6__ndk16vectorIN6jpegli11HuffmanTreeENS_9allocatorIS2_EEE16__destroy_vectorclB7v170000Ev
00000000 W _ZNSt6__ndk16vectorIN6jpegli11HuffmanTreeENS_9allocatorIS2_EEE21__push_back_slow_pathIRKS2_EEvOT_
00000000 W _ZNSt6__ndk16vectorIN6jpegli11HuffmanTreeENS_9allocatorIS2_EEE24__emplace_back_slow_pathIJRKjisEEEvDpOT_
00000000 W _ZNSt6__ndk16vectorIN6jpegli11HuffmanTreeENS_9allocatorIS2_EEE26__swap_out_circular_bufferERNS_14__split_bufferIS2_RS4_EE
00000000 W _ZNSt6__ndk16vectorIN6jpegli11HuffmanTreeENS_9allocatorIS2_EEE7reserveEj
00000000 W _ZNSt6__ndk16vectorIN6jpegli11HuffmanTreeENS_9allocatorIS2_EEE9push_backB7v170000ERKS2_
00000000 W _ZNSt6__ndk16vectorIN6jpegli11HuffmanTreeENS_9allocatorIS2_EEED2B7v170000Ev
00000000 W _ZNSt6__ndk17__sort3B7v170000INS_17_ClassicAlgPolicyERPFbRKN6jpegli11HuffmanTreeES5_EPS3_EEjT1_SA_SA_T0_
00000000 W _ZNSt6__ndk17__sort4B7v170000INS_17_ClassicAlgPolicyERPFbRKN6jpegli11HuffmanTreeES5_EPS3_EEjT1_SA_SA_SA_T0_
00000000 W _ZNSt6__ndk17__sort5IRPFbRKN6jpegli11HuffmanTreeES4_EPS2_EEjT0_S9_S9_S9_S9_T_
00000000 W _ZNSt6__ndk19__sift_upB7v170000INS_17_ClassicAlgPolicyERPFbRKN6jpegli11HuffmanTreeES5_EPS3_EEvT1_SA_OT0_NS_15iterator_traitsISA_E15difference_typeE
00000000 W _ZNSt6__ndk19allocatorIN6jpegli11HuffmanTreeEE8allocateB7v170000Ej
00000000 W _ZSt28__throw_bad_array_new_lengthB7v170000v
17_libjpegli_static_idct.cc.o:
00000000 T _ZN6jpegli22ChooseInverseTransformEP22jpeg_decompress_struct
00000000 W _ZN6jpegli8N_EMU12810BTransposeILj2EEEvPf
00000000 W _ZN6jpegli8N_EMU12810BTransposeILj4EEEvPf
00000000 W _ZN6jpegli8N_EMU12810IDCT1DImplILj4EEclEPKfjPfj
00000000 W _ZN6jpegli8N_EMU12810IDCT1DImplILj8EEclEPKfjPfj
00000000 T _ZN6jpegli8N_EMU12812DequantBlockEPKsPKfS4_Pf
00000000 T _ZN6jpegli8N_EMU12813Compute1dIDCTEPKfPfj
00000000 V _ZN6jpegli8N_EMU12813WcMultipliersILj4EE12kMultipliersE
00000000 V _ZN6jpegli8N_EMU12813WcMultipliersILj8EE12kMultipliersE
00000000 W _ZN6jpegli8N_EMU12814ForwardEvenOddILj4EEEvPKfjPf
00000000 W _ZN6jpegli8N_EMU12814ForwardEvenOddILj8EEEvPKfjPf
00000000 W _ZN6jpegli8N_EMU12814MultiplyAndAddILj4EEEvPKfPfj
00000000 W _ZN6jpegli8N_EMU12814MultiplyAndAddILj8EEEvPKfPfj
00000000 T _ZN6jpegli8N_EMU12817ComputeScaledIDCTEPfS1_S1_j
00000000 T _ZN6jpegli8N_EMU12824InverseTransformBlock8x8EPKsPKfS4_PfS5_jj
00000000 T _ZN6jpegli8N_EMU12828InverseTransformBlockGenericEPKsPKfS4_PfS5_jj
00000000 W _ZN6jpegli8N_EMU1286IDCT1DILj8EEEvPfS2_j
18_libjpegli_static_input.cc.o:
00000000 T _ZN6jpegli17ChooseInputMethodEP20jpeg_compress_struct
00000000 W _ZN6jpegli8N_EMU12812ReadFloatRowILj1ELb0EEEvPKhjjPPf
00000000 W _ZN6jpegli8N_EMU12812ReadFloatRowILj1ELb1EEEvPKhjjPPf
00000000 W _ZN6jpegli8N_EMU12812ReadFloatRowILj2ELb0EEEvPKhjjPPf
00000000 W _ZN6jpegli8N_EMU12812ReadFloatRowILj2ELb1EEEvPKhjjPPf
00000000 W _ZN6jpegli8N_EMU12812ReadFloatRowILj3ELb0EEEvPKhjjPPf
00000000 W _ZN6jpegli8N_EMU12812ReadFloatRowILj3ELb1EEEvPKhjjPPf
00000000 W _ZN6jpegli8N_EMU12812ReadFloatRowILj4ELb0EEEvPKhjjPPf
00000000 W _ZN6jpegli8N_EMU12812ReadFloatRowILj4ELb1EEEvPKhjjPPf
00000000 W _ZN6jpegli8N_EMU12812ReadUint8RowILj1EEEvPKhjjPPf
00000000 W _ZN6jpegli8N_EMU12812ReadUint8RowILj2EEEvPKhjjPPf
00000000 W _ZN6jpegli8N_EMU12812ReadUint8RowILj3EEEvPKhjjPPf
00000000 W _ZN6jpegli8N_EMU12812ReadUint8RowILj4EEEvPKhjjPPf
00000000 W _ZN6jpegli8N_EMU12813ReadUint16RowILj1ELb0EEEvPKhjjPPf
00000000 W _ZN6jpegli8N_EMU12813ReadUint16RowILj1ELb1EEEvPKhjjPPf
00000000 W _ZN6jpegli8N_EMU12813ReadUint16RowILj2ELb0EEEvPKhjjPPf
00000000 W _ZN6jpegli8N_EMU12813ReadUint16RowILj2ELb1EEEvPKhjjPPf
00000000 W _ZN6jpegli8N_EMU12813ReadUint16RowILj3ELb0EEEvPKhjjPPf
00000000 W _ZN6jpegli8N_EMU12813ReadUint16RowILj3ELb1EEEvPKhjjPPf
00000000 W _ZN6jpegli8N_EMU12813ReadUint16RowILj4ELb0EEEvPKhjjPPf
00000000 W _ZN6jpegli8N_EMU12813ReadUint16RowILj4ELb1EEEvPKhjjPPf
00000000 T _ZN6jpegli8N_EMU12818ReadFloatRowSingleEPKhjPPf
00000000 T _ZN6jpegli8N_EMU12818ReadUint8RowSingleEPKhjPPf
00000000 T _ZN6jpegli8N_EMU12819ReadUint16RowSingleEPKhjPPf
00000000 T _ZN6jpegli8N_EMU12822ReadFloatRowSingleSwapEPKhjPPf
00000000 T _ZN6jpegli8N_EMU12823ReadUint16RowSingleSwapEPKhjPPf
00000000 T _ZN6jpegli8N_EMU12824ReadFloatRowInterleaved2EPKhjPPf
00000000 T _ZN6jpegli8N_EMU12824ReadFloatRowInterleaved3EPKhjPPf
00000000 T _ZN6jpegli8N_EMU12824ReadFloatRowInterleaved4EPKhjPPf
00000000 T _ZN6jpegli8N_EMU12824ReadUint8RowInterleaved2EPKhjPPf
00000000 T _ZN6jpegli8N_EMU12824ReadUint8RowInterleaved3EPKhjPPf
00000000 T _ZN6jpegli8N_EMU12824ReadUint8RowInterleaved4EPKhjPPf
00000000 T _ZN6jpegli8N_EMU12825ReadUint16RowInterleaved2EPKhjPPf
00000000 T _ZN6jpegli8N_EMU12825ReadUint16RowInterleaved3EPKhjPPf
00000000 T _ZN6jpegli8N_EMU12825ReadUint16RowInterleaved4EPKhjPPf
00000000 T _ZN6jpegli8N_EMU12828ReadFloatRowInterleaved2SwapEPKhjPPf
00000000 T _ZN6jpegli8N_EMU12828ReadFloatRowInterleaved3SwapEPKhjPPf
00000000 T _ZN6jpegli8N_EMU12828ReadFloatRowInterleaved4SwapEPKhjPPf
00000000 T _ZN6jpegli8N_EMU12829ReadUint16RowInterleaved2SwapEPKhjPPf
00000000 T _ZN6jpegli8N_EMU12829ReadUint16RowInterleaved3SwapEPKhjPPf
00000000 T _ZN6jpegli8N_EMU12829ReadUint16RowInterleaved4SwapEPKhjPPf
19_libjpegli_static_memory_manager.cc.o:
00000000 T _ZN6jpegli17InitMemoryManagerEP18jpeg_common_struct
00000000 W _ZNKSt6__ndk16vectorIPvNS_9allocatorIS1_EEE11__recommendB7v170000Ej
00000000 W _ZNSt6__ndk114__split_bufferIPvRNS_9allocatorIS1_EEE17__destruct_at_endB7v170000EPS1_NS_17integral_constantIbLb0EEE
00000000 W _ZNSt6__ndk114__split_bufferIPvRNS_9allocatorIS1_EEE5clearB7v170000Ev
00000000 W _ZNSt6__ndk114__split_bufferIPvRNS_9allocatorIS1_EEED2Ev
00000000 W _ZNSt6__ndk121__unwrap_and_dispatchB7v170000INS_10__overloadINS_11__move_loopINS_17_ClassicAlgPolicyEEENS_14__move_trivialEEENS_16reverse_iteratorIPPvEESA_SA_Li0EEENS_4pairIT0_T2_EESC_T1_SD_
00000000 W _ZNSt6__ndk14moveB7v170000INS_16reverse_iteratorIPPvEES4_EET0_T_S6_S5_
00000000 W _ZNSt6__ndk16vectorIPvNS_9allocatorIS1_EEE16__destroy_vectorclB7v170000Ev
00000000 W _ZNSt6__ndk16vectorIPvNS_9allocatorIS1_EEE21__push_back_slow_pathIRKS1_EEvOT_
00000000 W _ZNSt6__ndk16vectorIPvNS_9allocatorIS1_EEE26__swap_out_circular_bufferERNS_14__split_bufferIS1_RS3_EE
00000000 W _ZNSt6__ndk16vectorIPvNS_9allocatorIS1_EEE9push_backB7v170000ERKS1_
00000000 W _ZNSt6__ndk16vectorIPvNS_9allocatorIS1_EEED2B7v170000Ev
00000000 W _ZNSt6__ndk19allocatorIPvE8allocateB7v170000Ej
00000000 W _ZSt28__throw_bad_array_new_lengthB7v170000v
1_libjpegli_static_bitstream.cc.o:
00000000 T _ZN6jpegli10EncodeAPP0EP20jpeg_compress_struct
00000000 T _ZN6jpegli10WriteBlockEPKiS1_ibPKNS_16HuffmanCodeTableES4_PNS_13JpegBitWriterE
00000000 T _ZN6jpegli11EncodeAPP14EP20jpeg_compress_struct
00000000 T _ZN6jpegli11WriteOutputEP20jpeg_compress_structPKhj
00000000 T _ZN6jpegli11WriteOutputEP20jpeg_compress_structRKNSt6__ndk16vectorIhNS2_9allocatorIhEEEE
00000000 T _ZN6jpegli11WriteOutputEP20jpeg_compress_structSt16initializer_listIhE
00000000 T _ZN6jpegli13WriteScanDataEP20jpeg_compress_structi
00000000 T _ZN6jpegli15WriteFileHeaderEP20jpeg_compress_struct
00000000 T _ZN6jpegli15WriteScanHeaderEP20jpeg_compress_structi
00000000 T _ZN6jpegli16WriteFrameHeaderEP20jpeg_compress_struct
00000000 T _ZN6jpegli9EncodeDHTEP20jpeg_compress_structjj
00000000 T _ZN6jpegli9EncodeDQTEP20jpeg_compress_structb
00000000 T _ZN6jpegli9EncodeDRIEP20jpeg_compress_struct
00000000 T _ZN6jpegli9EncodeSOFEP20jpeg_compress_structb
00000000 T _ZN6jpegli9EncodeSOSEP20jpeg_compress_structi
00000000 W _ZNSt6__ndk16vectorIhNS_9allocatorIhEEE11__vallocateB7v170000Ej
00000000 W _ZNSt6__ndk16vectorIhNS_9allocatorIhEEE16__destroy_vectorclB7v170000Ev
00000000 W _ZNSt6__ndk16vectorIhNS_9allocatorIhEEE18__construct_at_endEj
00000000 W _ZNSt6__ndk16vectorIhNS_9allocatorIhEEEC2Ej
00000000 W _ZNSt6__ndk16vectorIhNS_9allocatorIhEEED2B7v170000Ev
20_libjpegli_static_quant.cc.o:
00000000 T _ZN6jpegli13InitQuantizerEP20jpeg_compress_structNS_9QuantPassE
00000000 T _ZN6jpegli16SetQuantMatricesEP20jpeg_compress_structPfb
21_libjpegli_static_render.cc.o:
00000000 T _ZN6jpegli11DecenterRowEPfj
00000000 T _ZN6jpegli12do_smoothingEP22jpeg_decompress_struct
00000000 T _ZN6jpegli13PredictSmoothEP22jpeg_decompress_structPPA64_siji
00000000 T _ZN6jpegli13ProcessOutputEP22jpeg_decompress_structPjPPhj
00000000 T _ZN6jpegli13WriteToOutputEP22jpeg_decompress_structPrPfjjjPh
00000000 T _ZN6jpegli16GatherBlockStatsEPKsjPiS2_
00000000 T _ZN6jpegli16PrepareForOutputEP22jpeg_decompress_struct
00000000 T _ZN6jpegli16ProcessRawOutputEP22jpeg_decompress_structPPPh
00000000 T _ZN6jpegli20DecodeCurrentiMCURowEP22jpeg_decompress_struct
00000000 T _ZN6jpegli21is_nonzero_quantizersEPK10JQUANT_TBL
00000000 T _ZN6jpegli24ShouldApplyDequantBiasesEP22jpeg_decompress_structi
00000000 T _ZN6jpegli29ComputeOptimalLaplacianBiasesEiPKiS1_Pf
00000000 T _ZN6jpegli8N_EMU12810LimitErrorEf
00000000 T _ZN6jpegli8N_EMU12811DecenterRowEPfj
00000000 T _ZN6jpegli8N_EMU12813StoreFloatRowEPrPfjjjS1_
00000000 T _ZN6jpegli8N_EMU12813WriteToOutputEP22jpeg_decompress_structPrPfjjjPh
00000000 T _ZN6jpegli8N_EMU12816GatherBlockStatsEPKsjPiS3_
00000000 W _ZN6jpegli8N_EMU12816StoreUnsignedRowIhEEvPrPfjjjfPT_
00000000 W _ZN6jpegli8N_EMU12816StoreUnsignedRowItEEvPrPfjjjfPT_
00000000 T _ZN6jpegli8N_EMU1289DitherRowEP22jpeg_decompress_structPfijj
00000000 W _ZNK6jpegli9RowBufferIfE3RowEi
00000000 W _ZNSt6__ndk16vectorIiNS_9allocatorIiEEE11__vallocateB7v170000Ej
00000000 W _ZNSt6__ndk16vectorIiNS_9allocatorIiEEE16__destroy_vectorclB7v170000Ev
00000000 W _ZNSt6__ndk16vectorIiNS_9allocatorIiEEE18__construct_at_endEj
00000000 W _ZNSt6__ndk16vectorIiNS_9allocatorIiEEEC2Ej
00000000 W _ZNSt6__ndk16vectorIiNS_9allocatorIiEEED2B7v170000Ev
00000000 W _ZNSt6__ndk19allocatorIiE8allocateB7v170000Ej
00000000 W _ZSt28__throw_bad_array_new_lengthB7v170000v
22_libjpegli_static_simd.cc.o:
00000000 T _ZN6jpegli10VectorSizeEv
00000000 T _ZN6jpegli8N_EMU12813GetVectorSizeEv
23_libjpegli_static_source_manager.cc.o:
00000000 T _ZN6jpegli11term_sourceEP22jpeg_decompress_struct
00000000 T _ZN6jpegli15init_mem_sourceEP22jpeg_decompress_struct
00000000 T _ZN6jpegli15skip_input_dataEP22jpeg_decompress_structl
00000000 T _ZN6jpegli17EmitFakeEoiMarkerEP22jpeg_decompress_struct
00000000 T _ZN6jpegli17init_stdio_sourceEP22jpeg_decompress_struct
00000000 W _ZN6jpegli18StdioSourceManager17fill_input_bufferEP22jpeg_decompress_struct
00000000 T jpegli_mem_src
00000000 T jpegli_stdio_src
24_libjpegli_static_upsample.cc.o:
00000000 T _ZN6jpegli17Upsample2VerticalEPKfS1_S1_PfS2_j
00000000 T _ZN6jpegli19Upsample2HorizontalEPfS0_j
00000000 W _ZN6jpegli8N_EMU12816StoreInterleavedIN3hwy8N_EMU1284SimdIfLj4ELi0EEENS3_6Vec128IfLj4EEEfEEvT_T0_S9_PT1_
00000000 T _ZN6jpegli8N_EMU12817Upsample2VerticalEPKfS2_S2_PfS3_j
00000000 T _ZN6jpegli8N_EMU12819Upsample2HorizontalEPfS1_j
25_libhwy_abort.cc.o:
00000000 T _ZN3hwy11GetWarnFuncEv
00000000 T _ZN3hwy11SetWarnFuncEPFvPKciS1_E
00000000 T _ZN3hwy12GetAbortFuncEv
00000000 T _ZN3hwy12SetAbortFuncEPFvPKciS1_E
00000000 T _ZN3hwy4WarnEPKciS1_z
00000000 T _ZN3hwy5AbortEPKciS1_z
00000000 W _ZNKSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE12find_last_ofB7v170000EPKcj
00000000 W _ZNKSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6substrB7v170000Ejj
00000000 W _ZNSt6__ndk111char_traitsIcE4findEPKcjRS2_
00000000 W _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v170000IDnEEPKc
00000000 W _ZNSt6__ndk118__str_find_last_ofB7v170000IcjNS_11char_traitsIcEELj4294967295EEET0_PKT_S3_S6_S3_S3_
26_libhwy_aligned_allocator.cc.o:
00000000 T _ZN3hwy14AlignedDeleter18DeleteAlignedArrayEPvPFvS1_S1_ES1_PFvS1_jE
00000000 T _ZN3hwy16FreeAlignedBytesEPKvPFvPvS2_ES2_
00000000 T _ZN3hwy20AllocateAlignedBytesEjPFPvS0_jES0_
27_libhwy_nanobenchmark.cc.o:
00000000 T _ZN3hwy14Unpredictable1Ev
00000000 W _ZN3hwy17robust_statistics12CountingSortIyEEvPT_j
00000000 W _ZN3hwy17robust_statistics12ModeOfSortedIyEET_PKS2_j
00000000 W _ZN3hwy17robust_statistics23MedianAbsoluteDeviationIyEET_PKS2_jS2_
00000000 W _ZN3hwy17robust_statistics4ModeIyEET_PS2_j
00000000 W _ZN3hwy17robust_statistics6MedianIyEET_PS2_j
00000000 W _ZN3hwy17robust_statistics8MinRangeIyEEjPKT_jj
00000000 T _ZN3hwy7MeasureEPFyPKvjEPKhPKjjPNS_6ResultERKNS_6ParamsE
00000000 W _ZNKSt6__ndk16vectorINS_4pairIyiEENS_9allocatorIS2_EEE11__recommendB7v170000Ej
00000000 W _ZNKSt6__ndk16vectorIjNS_9allocatorIjEEE11__recommendB7v170000Ej
00000000 W _ZNKSt6__ndk16vectorIyNS_9allocatorIyEEE11__recommendB7v170000Ej
00000000 W _ZNSt6__ndk110__pop_heapB7v170000INS_17_ClassicAlgPolicyENS_6__lessINS_4pairIyiEES4_EEPS4_EEvT1_S7_RT0_NS_15iterator_traitsIS7_E15difference_typeE
00000000 W _ZNSt6__ndk111__introsortINS_17_ClassicAlgPolicyERNS_6__lessINS_4pairIyiEES4_EEPS4_Lb0EEEvT1_S8_T0_NS_15iterator_traitsIS8_E15difference_typeEb
00000000 W _ZNSt6__ndk111__make_heapB7v170000INS_17_ClassicAlgPolicyERNS_6__lessINS_4pairIyiEES4_EEPS4_EEvT1_S8_OT0_
00000000 W _ZNSt6__ndk111__sift_downB7v170000INS_17_ClassicAlgPolicyERNS_6__lessINS_4pairIyiEES4_EEPS4_EEvT1_OT0_NS_15iterator_traitsIS8_E15difference_typeES8_
00000000 W _ZNSt6__ndk111__sort_heapB7v170000INS_17_ClassicAlgPolicyERNS_6__lessINS_4pairIyiEES4_EEPS4_EEvT1_S8_OT0_
00000000 W _ZNSt6__ndk114__partial_sortB7v170000INS_17_ClassicAlgPolicyERNS_6__lessINS_4pairIyiEES4_EEPS4_S7_EET1_S8_S8_T2_RT0_
00000000 W _ZNSt6__ndk114__split_bufferINS_4pairIyiEERNS_9allocatorIS2_EEE17__destruct_at_endB7v170000EPS2_NS_17integral_constantIbLb0EEE
00000000 W _ZNSt6__ndk114__split_bufferINS_4pairIyiEERNS_9allocatorIS2_EEE5clearB7v170000Ev
00000000 W _ZNSt6__ndk114__split_bufferINS_4pairIyiEERNS_9allocatorIS2_EEEC2EjjS5_
00000000 W _ZNSt6__ndk114__split_bufferINS_4pairIyiEERNS_9allocatorIS2_EEED2Ev
00000000 W _ZNSt6__ndk114__split_bufferIjRNS_9allocatorIjEEE17__destruct_at_endB7v170000EPjNS_17integral_constantIbLb0EEE
00000000 W _ZNSt6__ndk114__split_bufferIjRNS_9allocatorIjEEE18__construct_at_endIPKjEENS_9enable_ifIXsr27__is_cpp17_forward_iteratorIT_EE5valueEvE4typeES9_S9_
00000000 W _ZNSt6__ndk114__split_bufferIjRNS_9allocatorIjEEE5clearB7v170000Ev
00000000 W _ZNSt6__ndk114__split_bufferIjRNS_9allocatorIjEEED2Ev
00000000 W _ZNSt6__ndk114__split_bufferIyRNS_9allocatorIyEEE17__destruct_at_endB7v170000EPyNS_17integral_constantIbLb0EEE
00000000 W _ZNSt6__ndk114__split_bufferIyRNS_9allocatorIyEEE5clearB7v170000Ev
00000000 W _ZNSt6__ndk114__split_bufferIyRNS_9allocatorIyEEEC2EjjS3_
00000000 W _ZNSt6__ndk114__split_bufferIyRNS_9allocatorIyEEED2Ev
00000000 W _ZNSt6__ndk115__adjacent_findB7v170000INS_11__wrap_iterIPjEES3_RNS_10__equal_toEEET_S6_T0_OT1_
00000000 W _ZNSt6__ndk116__insertion_sortB7v170000INS_17_ClassicAlgPolicyERNS_6__lessINS_4pairIyiEES4_EEPS4_EEvT1_S8_T0_
00000000 W _ZNSt6__ndk117__floyd_sift_downB7v170000INS_17_ClassicAlgPolicyERNS_6__lessINS_4pairIyiEES4_EEPS4_EET1_S8_OT0_NS_15iterator_traitsIS8_E15difference_typeE
00000000 W _ZNSt6__ndk119__partial_sort_implB7v170000INS_17_ClassicAlgPolicyERNS_6__lessINS_4pairIyiEES4_EEPS4_S7_EET1_S8_S8_T2_OT0_
00000000 W _ZNSt6__ndk121__unwrap_and_dispatchB7v170000INS_10__overloadINS_11__move_loopINS_17_ClassicAlgPolicyEEENS_14__move_trivialEEENS_16reverse_iteratorIPjEES9_S9_Li0EEENS_4pairIT0_T2_EESB_T1_SC_
00000000 W _ZNSt6__ndk121__unwrap_and_dispatchB7v170000INS_10__overloadINS_11__move_loopINS_17_ClassicAlgPolicyEEENS_14__move_trivialEEENS_16reverse_iteratorIPyEES9_S9_Li0EEENS_4pairIT0_T2_EESB_T1_SC_
00000000 W _ZNSt6__ndk123mersenne_twister_engineIjLj32ELj624ELj397ELj31ELj2567483615ELj11ELj4294967295ELj7ELj2636928640ELj15ELj4022730752ELj18ELj1812433253EE4seedEj
00000000 W _ZNSt6__ndk123mersenne_twister_engineIjLj32ELj624ELj397ELj31ELj2567483615ELj11ELj4294967295ELj7ELj2636928640ELj15ELj4022730752ELj18ELj1812433253EEC2B7v170000Ev
00000000 W _ZNSt6__ndk123mersenne_twister_engineIjLj32ELj624ELj397ELj31ELj2567483615ELj11ELj4294967295ELj7ELj2636928640ELj15ELj4022730752ELj18ELj1812433253EEclEv
00000000 W _ZNSt6__ndk124uniform_int_distributionIiEclINS_23mersenne_twister_engineIjLj32ELj624ELj397ELj31ELj2567483615ELj11ELj4294967295ELj7ELj2636928640ELj15ELj4022730752ELj18ELj1812433253EEEEEiRT_RKNS1_10param_typeE
00000000 W _ZNSt6__ndk125__independent_bits_engineINS_23mersenne_twister_engineIjLj32ELj624ELj397ELj31ELj2567483615ELj11ELj4294967295ELj7ELj2636928640ELj15ELj4022730752ELj18ELj1812433253EEEjE6__evalENS_17integral_constantIbLb0EEE
00000000 W _ZNSt6__ndk125__independent_bits_engineINS_23mersenne_twister_engineIjLj32ELj624ELj397ELj31ELj2567483615ELj11ELj4294967295ELj7ELj2636928640ELj15ELj4022730752ELj18ELj1812433253EEEjEC2ERS2_j
00000000 W _ZNSt6__ndk126__insertion_sort_unguardedB7v170000INS_17_ClassicAlgPolicyERNS_6__lessINS_4pairIyiEES4_EEPS4_EEvT1_S8_T0_
00000000 W _ZNSt6__ndk127__insertion_sort_incompleteIRNS_6__lessINS_4pairIyiEES3_EEPS3_EEbT0_S7_T_
00000000 W _ZNSt6__ndk131__partition_with_equals_on_leftB7v170000INS_17_ClassicAlgPolicyEPNS_4pairIyiEERNS_6__lessIS3_S3_EEEET0_S8_S8_T1_
00000000 W _ZNSt6__ndk132__partition_with_equals_on_rightB7v170000INS_17_ClassicAlgPolicyEPNS_4pairIyiEERNS_6__lessIS3_S3_EEEENS2_IT0_bEES8_S8_T1_
00000000 W _ZNSt6__ndk14moveB7v170000INS_16reverse_iteratorIPjEES3_EET0_T_S5_S4_
00000000 W _ZNSt6__ndk14moveB7v170000INS_16reverse_iteratorIPyEES3_EET0_T_S5_S4_
00000000 W _ZNSt6__ndk14sortB7v170000INS_11__wrap_iterIPNS_4pairIyiEEEENS_6__lessIS3_S3_EEEEvT_S8_T0_
00000000 W _ZNSt6__ndk14sortB7v170000INS_11__wrap_iterIPjEENS_6__lessIjjEEEEvT_S6_T0_
00000000 W _ZNSt6__ndk14sortB7v170000IPyNS_6__lessIyyEEEEvT_S4_T0_
00000000 W _ZNSt6__ndk15countB7v170000INS_11__wrap_iterIPKjEEjEENS_15iterator_traitsIT_E15difference_typeES6_S6_RKT0_
00000000 W _ZNSt6__ndk16__fillB7v170000IPyyEEvT_S2_RKT0_NS_26random_access_iterator_tagE
00000000 W _ZNSt6__ndk16__sortIRNS_6__lessINS_4pairIyiEES3_EEPS3_EEvT0_S7_T_
00000000 W _ZNSt6__ndk16uniqueB7v170000INS_11__wrap_iterIPjEENS_10__equal_toEEET_S5_S5_T0_
00000000 W _ZNSt6__ndk16vectorINS_4pairIyiEENS_9allocatorIS2_EEE16__destroy_vectorclB7v170000Ev
00000000 W _ZNSt6__ndk16vectorINS_4pairIyiEENS_9allocatorIS2_EEE21__push_back_slow_pathIS2_EEvOT_
00000000 W _ZNSt6__ndk16vectorINS_4pairIyiEENS_9allocatorIS2_EEE26__swap_out_circular_bufferERNS_14__split_bufferIS2_RS4_EE
00000000 W _ZNSt6__ndk16vectorINS_4pairIyiEENS_9allocatorIS2_EEE9push_backB7v170000EOS2_
00000000 W _ZNSt6__ndk16vectorINS_4pairIyiEENS_9allocatorIS2_EEED2B7v170000Ev
00000000 W _ZNSt6__ndk16vectorIjNS_9allocatorIjEEE11__vallocateB7v170000Ej
00000000 W _ZNSt6__ndk16vectorIjNS_9allocatorIjEEE12__move_rangeEPjS4_S4_
00000000 W _ZNSt6__ndk16vectorIjNS_9allocatorIjEEE13__vdeallocateEv
00000000 W _ZNSt6__ndk16vectorIjNS_9allocatorIjEEE16__destroy_vectorclB7v170000Ev
00000000 W _ZNSt6__ndk16vectorIjNS_9allocatorIjEEE18__construct_at_endEj
00000000 W _ZNSt6__ndk16vectorIjNS_9allocatorIjEEE18__construct_at_endEjRKj
00000000 W _ZNSt6__ndk16vectorIjNS_9allocatorIjEEE26__swap_out_circular_bufferERNS_14__split_bufferIjRS2_EE
00000000 W _ZNSt6__ndk16vectorIjNS_9allocatorIjEEE26__swap_out_circular_bufferERNS_14__split_bufferIjRS2_EEPj
00000000 W _ZNSt6__ndk16vectorIjNS_9allocatorIjEEE6assignEjRKj
00000000 W _ZNSt6__ndk16vectorIjNS_9allocatorIjEEE6insertIPKjLi0EEENS_11__wrap_iterIPjEENS7_IS6_EET_SB_
00000000 W _ZNSt6__ndk16vectorIjNS_9allocatorIjEEE6resizeEj
00000000 W _ZNSt6__ndk16vectorIjNS_9allocatorIjEEE7reserveEj
00000000 W _ZNSt6__ndk16vectorIjNS_9allocatorIjEEE8__appendEj
00000000 W _ZNSt6__ndk16vectorIjNS_9allocatorIjEEEC2Ej
00000000 W _ZNSt6__ndk16vectorIjNS_9allocatorIjEEEC2IPKjLi0EEET_S7_
00000000 W _ZNSt6__ndk16vectorIjNS_9allocatorIjEEED2B7v170000Ev
00000000 W _ZNSt6__ndk16vectorIyNS_9allocatorIyEEE16__destroy_vectorclB7v170000Ev
00000000 W _ZNSt6__ndk16vectorIyNS_9allocatorIyEEE21__push_back_slow_pathIRKyEEvOT_
00000000 W _ZNSt6__ndk16vectorIyNS_9allocatorIyEEE21__push_back_slow_pathIyEEvOT_
00000000 W _ZNSt6__ndk16vectorIyNS_9allocatorIyEEE26__swap_out_circular_bufferERNS_14__split_bufferIyRS2_EE
00000000 W _ZNSt6__ndk16vectorIyNS_9allocatorIyEEE7reserveEj
00000000 W _ZNSt6__ndk16vectorIyNS_9allocatorIyEEE9push_backB7v170000EOy
00000000 W _ZNSt6__ndk16vectorIyNS_9allocatorIyEEE9push_backB7v170000ERKy
00000000 W _ZNSt6__ndk16vectorIyNS_9allocatorIyEEED2B7v170000Ev
00000000 W _ZNSt6__ndk17__sort3B7v170000INS_17_ClassicAlgPolicyERNS_6__lessINS_4pairIyiEES4_EEPS4_EEjT1_S8_S8_T0_
00000000 W _ZNSt6__ndk17__sort4B7v170000INS_17_ClassicAlgPolicyERNS_6__lessINS_4pairIyiEES4_EEPS4_EEjT1_S8_S8_S8_T0_
00000000 W _ZNSt6__ndk17__sort5IRNS_6__lessINS_4pairIyiEES3_EEPS3_EEjT0_S7_S7_S7_S7_T_
00000000 W _ZNSt6__ndk17find_ifB7v170000INS_11__wrap_iterIPNS_4pairIyiEEEEZN3hwy17robust_statistics12CountingSortIyEEvPT_jEUlS3_E_EES9_S9_S9_T0_
00000000 W _ZNSt6__ndk18__fill_nB7v170000IPjjjEET_S2_T0_RKT1_
00000000 W _ZNSt6__ndk18__fill_nB7v170000IPyiyEET_S2_T0_RKT1_
00000000 W _ZNSt6__ndk18__uniqueB7v170000INS_17_ClassicAlgPolicyENS_11__wrap_iterIPjEES4_RNS_10__equal_toEEENS_4pairIT0_S8_EES8_T1_OT2_
00000000 W _ZNSt6__ndk19__shuffleB7v170000INS_17_ClassicAlgPolicyENS_11__wrap_iterIPjEES4_RNS_23mersenne_twister_engineIjLj32ELj624ELj397ELj31ELj2567483615ELj11ELj4294967295ELj7ELj2636928640ELj15ELj4022730752ELj18ELj1812433253EEEEET0_S8_T1_OT2_
00000000 W _ZNSt6__ndk19__sift_upB7v170000INS_17_ClassicAlgPolicyERNS_6__lessINS_4pairIyiEES4_EEPS4_EEvT1_S8_OT0_NS_15iterator_traitsIS8_E15difference_typeE
00000000 W _ZNSt6__ndk19allocatorINS_4pairIyiEEE8allocateB7v170000Ej
00000000 W _ZNSt6__ndk19allocatorIjE8allocateB7v170000Ej
00000000 W _ZNSt6__ndk19allocatorIyE8allocateB7v170000Ej
00000000 W _ZNSt6__ndk1ltB7v170000IyiEEbRKNS_4pairIT_T0_EES6_
00000000 W _ZSt28__throw_bad_array_new_lengthB7v170000v
28_libhwy_perf_counters.cc.o:
00000000 T _ZN3hwy8platform12PerfCounters15IndexForCounterENS1_7CounterE
00000000 T _ZN3hwy8platform12PerfCounters15StopAllAndResetEv
00000000 T _ZN3hwy8platform12PerfCounters4InitEv
00000000 W _ZN3hwy8platform12PerfCounters4NameENS1_7CounterE
00000000 T _ZN3hwy8platform12PerfCounters8StartAllEv
00000000 T _ZN3hwy8platform12PerfCountersC1Ev
00000000 T _ZN3hwy8platform12PerfCountersC2Ev
00000000 W _ZNKSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5rfindB7v170000EPKcj
00000000 W _ZNKSt6__ndk16vectorIiNS_9allocatorIiEEE11__recommendB7v170000Ej
00000000 W _ZNSt6__ndk111__str_rfindB7v170000IcjNS_11char_traitsIcEELj4294967295EEET0_PKT_S3_S6_S3_S3_
00000000 W _ZNSt6__ndk111char_traitsIcE2eqEcc
00000000 W _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v170000IDnEEPKc
00000000 W _ZNSt6__ndk114__split_bufferIiRNS_9allocatorIiEEE17__destruct_at_endB7v170000EPiNS_17integral_constantIbLb0EEE
00000000 W _ZNSt6__ndk114__split_bufferIiRNS_9allocatorIiEEE5clearB7v170000Ev
00000000 W _ZNSt6__ndk114__split_bufferIiRNS_9allocatorIiEEED2Ev
00000000 W _ZNSt6__ndk115__find_end_implB7v170000INS_17_ClassicAlgPolicyEPKcS3_S3_S3_DoFbccENS_10__identityES5_EENS_4pairIT0_S7_EES7_T1_T2_T3_RT4_RT5_RT6_NS_20forward_iterator_tagESI_
00000000 W _ZNSt6__ndk118__find_end_classicB7v170000IPKcS2_DoFbccEEET_S4_S4_T0_S5_RT1_
00000000 W _ZNSt6__ndk121__unwrap_and_dispatchB7v170000INS_10__overloadINS_11__move_loopINS_17_ClassicAlgPolicyEEENS_14__move_trivialEEENS_16reverse_iteratorIPiEES9_S9_Li0EEENS_4pairIT0_T2_EESB_T1_SC_
00000000 W _ZNSt6__ndk14moveB7v170000INS_16reverse_iteratorIPiEES3_EET0_T_S5_S4_
00000000 W _ZNSt6__ndk16vectorIiNS_9allocatorIiEEE21__push_back_slow_pathIRKiEEvOT_
00000000 W _ZNSt6__ndk16vectorIiNS_9allocatorIiEEE26__swap_out_circular_bufferERNS_14__split_bufferIiRS2_EE
00000000 W _ZNSt6__ndk16vectorIiNS_9allocatorIiEEE7reserveEj
00000000 W _ZNSt6__ndk16vectorIiNS_9allocatorIiEEE9push_backB7v170000ERKi
00000000 W _ZNSt6__ndk19allocatorIiE8allocateB7v170000Ej
00000000 W _ZNSt6__ndk1eqB7v170000IcNS_11char_traitsIcEENS_9allocatorIcEEEEbRKNS_12basic_stringIT_T0_T1_EEPKS6_
00000000 W _ZNSt6__ndk1neB7v170000IcNS_11char_traitsIcEENS_9allocatorIcEEEEbRKNS_12basic_stringIT_T0_T1_EEPKS6_
00000000 W _ZSt28__throw_bad_array_new_lengthB7v170000v
29_libhwy_per_target.cc.o:
00000000 T _ZN3hwy11HaveFloat16Ev
00000000 T _ZN3hwy11HaveFloat64Ev
00000000 T _ZN3hwy11VectorBytesEv
00000000 T _ZN3hwy13HaveInteger64Ev
00000000 T _ZN3hwy16DispatchedTargetEv
2_libjpegli_static_bit_writer.cc.o:
00000000 T _ZN6jpegli17JpegBitWriterInitEP20jpeg_compress_struct
00000000 T _ZN6jpegli18JumpToByteBoundaryEPNS_13JpegBitWriterE
00000000 T _ZN6jpegli20EmptyBitWriterBufferEPNS_13JpegBitWriterE
30_libhwy_print.cc.o:
00000000 T _ZN3hwy6detail10PrintArrayERKNS0_8TypeInfoEPKcPKvjjj
00000000 T _ZN3hwy6detail8ToStringERKNS0_8TypeInfoEPKvPc
00000000 T _ZN3hwy6detail8TypeNameERKNS0_8TypeInfoEjPc
31_libhwy_profiler.cc.o:
00000000 T _ZN3hwy8Profiler3GetEv
32_libhwy_targets.cc.o:
00000000 T _ZN3hwy14DisableTargetsEx
00000000 T _ZN3hwy15GetChosenTargetEv
00000000 T _ZN3hwy16SupportedTargetsEv
00000000 T _ZN3hwy26SetSupportedTargetsForTestEx
33_libhwy_timer.cc.o:
00000000 W _ZN3hwy17robust_statistics12CountingSortIyEEvPT_j
00000000 W _ZN3hwy17robust_statistics12ModeOfSortedIyEET_PKS2_j
00000000 W _ZN3hwy17robust_statistics4ModeIyEET_PS2_j
00000000 W _ZN3hwy17robust_statistics4ModeIyLj256EEET_RAT0__S2_
00000000 W _ZN3hwy17robust_statistics8MinRangeIyEEjPKT_jj
00000000 T _ZN3hwy8platform12GetCpuStringEPc
00000000 T _ZN3hwy8platform13HaveTimerStopEPc
00000000 T _ZN3hwy8platform15TimerResolutionEv
00000000 T _ZN3hwy8platform23InvariantTicksPerSecondEv
00000000 T _ZN3hwy8platform3NowEv
00000000 W _ZNKSt6__ndk16vectorINS_4pairIyiEENS_9allocatorIS2_EEE11__recommendB7v170000Ej
00000000 W _ZNSt6__ndk110__pop_heapB7v170000INS_17_ClassicAlgPolicyENS_6__lessINS_4pairIyiEES4_EEPS4_EEvT1_S7_RT0_NS_15iterator_traitsIS7_E15difference_typeE
00000000 W _ZNSt6__ndk111__introsortINS_17_ClassicAlgPolicyERNS_6__lessINS_4pairIyiEES4_EEPS4_Lb0EEEvT1_S8_T0_NS_15iterator_traitsIS8_E15difference_typeEb
00000000 W _ZNSt6__ndk111__make_heapB7v170000INS_17_ClassicAlgPolicyERNS_6__lessINS_4pairIyiEES4_EEPS4_EEvT1_S8_OT0_
00000000 W _ZNSt6__ndk111__sift_downB7v170000INS_17_ClassicAlgPolicyERNS_6__lessINS_4pairIyiEES4_EEPS4_EEvT1_OT0_NS_15iterator_traitsIS8_E15difference_typeES8_
00000000 W _ZNSt6__ndk111__sort_heapB7v170000INS_17_ClassicAlgPolicyERNS_6__lessINS_4pairIyiEES4_EEPS4_EEvT1_S8_OT0_
00000000 W _ZNSt6__ndk114__partial_sortB7v170000INS_17_ClassicAlgPolicyERNS_6__lessINS_4pairIyiEES4_EEPS4_S7_EET1_S8_S8_T2_RT0_
00000000 W _ZNSt6__ndk114__split_bufferINS_4pairIyiEERNS_9allocatorIS2_EEE17__destruct_at_endB7v170000EPS2_NS_17integral_constantIbLb0EEE
00000000 W _ZNSt6__ndk114__split_bufferINS_4pairIyiEERNS_9allocatorIS2_EEE5clearB7v170000Ev
00000000 W _ZNSt6__ndk114__split_bufferINS_4pairIyiEERNS_9allocatorIS2_EEEC2EjjS5_
00000000 W _ZNSt6__ndk114__split_bufferINS_4pairIyiEERNS_9allocatorIS2_EEED2Ev
00000000 W _ZNSt6__ndk116__insertion_sortB7v170000INS_17_ClassicAlgPolicyERNS_6__lessINS_4pairIyiEES4_EEPS4_EEvT1_S8_T0_
00000000 W _ZNSt6__ndk117__floyd_sift_downB7v170000INS_17_ClassicAlgPolicyERNS_6__lessINS_4pairIyiEES4_EEPS4_EET1_S8_OT0_NS_15iterator_traitsIS8_E15difference_typeE
00000000 W _ZNSt6__ndk119__partial_sort_implB7v170000INS_17_ClassicAlgPolicyERNS_6__lessINS_4pairIyiEES4_EEPS4_S7_EET1_S8_S8_T2_OT0_
00000000 W _ZNSt6__ndk126__insertion_sort_unguardedB7v170000INS_17_ClassicAlgPolicyERNS_6__lessINS_4pairIyiEES4_EEPS4_EEvT1_S8_T0_
00000000 W _ZNSt6__ndk127__insertion_sort_incompleteIRNS_6__lessINS_4pairIyiEES3_EEPS3_EEbT0_S7_T_
00000000 W _ZNSt6__ndk131__partition_with_equals_on_leftB7v170000INS_17_ClassicAlgPolicyEPNS_4pairIyiEERNS_6__lessIS3_S3_EEEET0_S8_S8_T1_
00000000 W _ZNSt6__ndk132__partition_with_equals_on_rightB7v170000INS_17_ClassicAlgPolicyEPNS_4pairIyiEERNS_6__lessIS3_S3_EEEENS2_IT0_bEES8_S8_T1_
00000000 W _ZNSt6__ndk14sortB7v170000INS_11__wrap_iterIPNS_4pairIyiEEEENS_6__lessIS3_S3_EEEEvT_S8_T0_
00000000 W _ZNSt6__ndk16__fillB7v170000IPyyEEvT_S2_RKT0_NS_26random_access_iterator_tagE
00000000 W _ZNSt6__ndk16__sortIRNS_6__lessINS_4pairIyiEES3_EEPS3_EEvT0_S7_T_
00000000 W _ZNSt6__ndk16vectorINS_4pairIyiEENS_9allocatorIS2_EEE16__destroy_vectorclB7v170000Ev
00000000 W _ZNSt6__ndk16vectorINS_4pairIyiEENS_9allocatorIS2_EEE21__push_back_slow_pathIS2_EEvOT_
00000000 W _ZNSt6__ndk16vectorINS_4pairIyiEENS_9allocatorIS2_EEE26__swap_out_circular_bufferERNS_14__split_bufferIS2_RS4_EE
00000000 W _ZNSt6__ndk16vectorINS_4pairIyiEENS_9allocatorIS2_EEE9push_backB7v170000EOS2_
00000000 W _ZNSt6__ndk16vectorINS_4pairIyiEENS_9allocatorIS2_EEED2B7v170000Ev
00000000 W _ZNSt6__ndk17__sort3B7v170000INS_17_ClassicAlgPolicyERNS_6__lessINS_4pairIyiEES4_EEPS4_EEjT1_S8_S8_T0_
00000000 W _ZNSt6__ndk17__sort4B7v170000INS_17_ClassicAlgPolicyERNS_6__lessINS_4pairIyiEES4_EEPS4_EEjT1_S8_S8_S8_T0_
00000000 W _ZNSt6__ndk17__sort5IRNS_6__lessINS_4pairIyiEES3_EEPS3_EEjT0_S7_S7_S7_S7_T_
00000000 W _ZNSt6__ndk17find_ifB7v170000INS_11__wrap_iterIPNS_4pairIyiEEEEZN3hwy17robust_statistics12CountingSortIyEEvPT_jEUlS3_E_EES9_S9_S9_T0_
00000000 W _ZNSt6__ndk18__fill_nB7v170000IPyiyEET_S2_T0_RKT1_
00000000 W _ZNSt6__ndk19__sift_upB7v170000INS_17_ClassicAlgPolicyERNS_6__lessINS_4pairIyiEES4_EEPS4_EEvT1_S8_OT0_NS_15iterator_traitsIS8_E15difference_typeE
00000000 W _ZNSt6__ndk19allocatorINS_4pairIyiEEE8allocateB7v170000Ej
00000000 W _ZNSt6__ndk1ltB7v170000IyiEEbRKNS_4pairIT_T0_EES6_
00000000 W _ZSt28__throw_bad_array_new_lengthB7v170000v
3_libjpegli_static_color_quantize.cc.o:
00000000 T _ZN6jpegli16LookupColorIndexEP22jpeg_decompress_structPKh
00000000 T _ZN6jpegli17InitFSDitherStateEP22jpeg_decompress_struct
00000000 T _ZN6jpegli19ChooseColorMap1PassEP22jpeg_decompress_struct
00000000 T _ZN6jpegli19ChooseColorMap2PassEP22jpeg_decompress_struct
00000000 T _ZN6jpegli21CreateInverseColorMapEP22jpeg_decompress_struct
00000000 T _ZN6jpegli25CreateOrderedDitherTablesEP22jpeg_decompress_struct
00000000 W _ZN6jpegli25make_uninitialized_vectorIhEENSt6__ndk16vectorIT_NS_22UninitializedAllocatorIS3_EEEEj
00000000 W _ZNKSt6__ndk114default_deleteIA_NS_6vectorIiNS_9allocatorIiEEEEEclB7v170000IS4_EENS6_20_EnableIfConvertibleIT_E4typeEPS9_
00000000 W _ZNKSt6__ndk16vectorINS0_IhNS_9allocatorIhEEEENS1_IS3_EEE11__recommendB7v170000Ej
00000000 W _ZNKSt6__ndk16vectorIhNS_9allocatorIhEEE11__recommendB7v170000Ej
00000000 W _ZNKSt6__ndk16vectorIiNS_9allocatorIiEEE11__recommendB7v170000Ej
00000000 W _ZNSt6__ndk110unique_ptrIA_NS_6vectorIiNS_9allocatorIiEEEENS_14default_deleteIS5_EEE5resetB7v170000EDn
00000000 W _ZNSt6__ndk110unique_ptrIA_NS_6vectorIiNS_9allocatorIiEEEENS_14default_deleteIS5_EEED2B7v170000Ev
00000000 W _ZNSt6__ndk110unique_ptrIA_PNS_16__hash_node_baseIPNS_11__hash_nodeINS_17__hash_value_typeIjiEEPvEEEENS_25__bucket_list_deallocatorINS_9allocatorIS9_EEEEE5resetB7v170000EDn
00000000 W _ZNSt6__ndk110unique_ptrIA_PNS_16__hash_node_baseIPNS_11__hash_nodeINS_17__hash_value_typeIjiEEPvEEEENS_25__bucket_list_deallocatorINS_9allocatorIS9_EEEEE5resetB7v170000IPS9_EENS_9enable_ifIXsr28_CheckArrayPointerConversionIT_EE5valueEvE4typeESJ_
00000000 W _ZNSt6__ndk110unique_ptrIA_PNS_16__hash_node_baseIPNS_11__hash_nodeINS_17__hash_value_typeIjiEEPvEEEENS_25__bucket_list_deallocatorINS_9allocatorIS9_EEEEED2B7v170000Ev
00000000 W _ZNSt6__ndk110unique_ptrINS_11__hash_nodeINS_17__hash_value_typeIjiEEPvEENS_22__hash_node_destructorINS_9allocatorIS5_EEEEE5resetB7v170000EPS5_
00000000 W _ZNSt6__ndk110unique_ptrINS_11__hash_nodeINS_17__hash_value_typeIjiEEPvEENS_22__hash_node_destructorINS_9allocatorIS5_EEEEED2B7v170000Ev
00000000 W _ZNSt6__ndk113__fill_n_trueB7v170000INS_6vectorIbNS_9allocatorIbEEEEEEvNS_14__bit_iteratorIT_Lb0ELi0EEENS6_9size_typeE
00000000 W _ZNSt6__ndk114__fill_n_falseB7v170000INS_6vectorIbNS_9allocatorIbEEEEEEvNS_14__bit_iteratorIT_Lb0ELi0EEENS6_9size_typeE
00000000 W _ZNSt6__ndk114__split_bufferINS_6vectorIhNS_9allocatorIhEEEERNS2_IS4_EEE17__destruct_at_endB7v170000EPS4_NS_17integral_constantIbLb0EEE
00000000 W _ZNSt6__ndk114__split_bufferINS_6vectorIhNS_9allocatorIhEEEERNS2_IS4_EEE18__construct_at_endEj
00000000 W _ZNSt6__ndk114__split_bufferINS_6vectorIhNS_9allocatorIhEEEERNS2_IS4_EEE5clearB7v170000Ev
00000000 W _ZNSt6__ndk114__split_bufferINS_6vectorIhNS_9allocatorIhEEEERNS2_IS4_EEEC2EjjS6_
00000000 W _ZNSt6__ndk114__split_bufferINS_6vectorIhNS_9allocatorIhEEEERNS2_IS4_EEED2Ev
00000000 W _ZNSt6__ndk114__split_bufferIhRNS_9allocatorIhEEE17__destruct_at_endB7v170000EPhNS_17integral_constantIbLb0EEE
00000000 W _ZNSt6__ndk114__split_bufferIhRNS_9allocatorIhEEE5clearB7v170000Ev
00000000 W _ZNSt6__ndk114__split_bufferIhRNS_9allocatorIhEEED2Ev
00000000 W _ZNSt6__ndk114__split_bufferIiRNS_9allocatorIiEEE17__destruct_at_endB7v170000EPiNS_17integral_constantIbLb0EEE
00000000 W _ZNSt6__ndk114__split_bufferIiRNS_9allocatorIiEEE5clearB7v170000Ev
00000000 W _ZNSt6__ndk114__split_bufferIiRNS_9allocatorIiEEED2Ev
00000000 W _ZNSt6__ndk121__unwrap_and_dispatchB7v170000INS_10__overloadINS_11__move_loopINS_17_ClassicAlgPolicyEEENS_14__move_trivialEEENS_16reverse_iteratorIPhEES9_S9_Li0EEENS_4pairIT0_T2_EESB_T1_SC_
00000000 W _ZNSt6__ndk121__unwrap_and_dispatchB7v170000INS_10__overloadINS_11__move_loopINS_17_ClassicAlgPolicyEEENS_14__move_trivialEEENS_16reverse_iteratorIPiEES9_S9_Li0EEENS_4pairIT0_T2_EESB_T1_SC_
00000000 W _ZNSt6__ndk125__bucket_list_deallocatorINS_9allocatorIPNS_16__hash_node_baseIPNS_11__hash_nodeINS_17__hash_value_typeIjiEEPvEEEEEEEclB7v170000EPSA_
00000000 W _ZNSt6__ndk142__uninitialized_allocator_move_if_noexceptB7v170000INS_9allocatorINS_6vectorIhNS1_IhEEEEEENS_16reverse_iteratorIPS4_EES8_S8_EET2_RT_T0_T1_S9_
00000000 W _ZNSt6__ndk14moveB7v170000INS_16reverse_iteratorIPhEES3_EET0_T_S5_S4_
00000000 W _ZNSt6__ndk14moveB7v170000INS_16reverse_iteratorIPiEES3_EET0_T_S5_S4_
00000000 W _ZNSt6__ndk16fill_nB7v170000INS_6vectorIbNS_9allocatorIbEEEEEEvNS_14__bit_iteratorIT_Lb0ELi0EEENS6_9size_typeEb
00000000 W _ZNSt6__ndk16vectorINS0_IhNS_9allocatorIhEEEENS1_IS3_EEE18__construct_at_endEj
00000000 W _ZNSt6__ndk16vectorINS0_IhNS_9allocatorIhEEEENS1_IS3_EEE22__base_destruct_at_endB7v170000EPS3_
00000000 W _ZNSt6__ndk16vectorINS0_IhNS_9allocatorIhEEEENS1_IS3_EEE26__swap_out_circular_bufferERNS_14__split_bufferIS3_RS4_EE
00000000 W _ZNSt6__ndk16vectorINS0_IhNS_9allocatorIhEEEENS1_IS3_EEE6resizeEj
00000000 W _ZNSt6__ndk16vectorINS0_IhNS_9allocatorIhEEEENS1_IS3_EEE8__appendEj
00000000 W _ZNSt6__ndk16vectorIbNS_9allocatorIbEEE11__vallocateB7v170000Ej
00000000 W _ZNSt6__ndk16vectorIbNS_9allocatorIbEEE16__destroy_vectorclB7v170000Ev
00000000 W _ZNSt6__ndk16vectorIbNS_9allocatorIbEEE18__construct_at_endB7v170000Ejb
00000000 W _ZNSt6__ndk16vectorIbNS_9allocatorIbEEEC2EjRKb
00000000 W _ZNSt6__ndk16vectorIbNS_9allocatorIbEEED2B7v170000Ev
00000000 W _ZNSt6__ndk16vectorIhN6jpegli22UninitializedAllocatorIhEEE11__vallocateB7v170000Ej
00000000 W _ZNSt6__ndk16vectorIhN6jpegli22UninitializedAllocatorIhEEE16__destroy_vectorclB7v170000Ev
00000000 W _ZNSt6__ndk16vectorIhN6jpegli22UninitializedAllocatorIhEEEC2EjRKS3_
00000000 W _ZNSt6__ndk16vectorIhN6jpegli22UninitializedAllocatorIhEEED2B7v170000Ev
00000000 W _ZNSt6__ndk16vectorIhNS_9allocatorIhEEE16__destroy_vectorclB7v170000Ev
00000000 W _ZNSt6__ndk16vectorIhNS_9allocatorIhEEE21__push_back_slow_pathIhEEvOT_
00000000 W _ZNSt6__ndk16vectorIhNS_9allocatorIhEEE26__swap_out_circular_bufferERNS_14__split_bufferIhRS2_EE
00000000 W _ZNSt6__ndk16vectorIhNS_9allocatorIhEEE9push_backB7v170000EOh
00000000 W _ZNSt6__ndk16vectorIhNS_9allocatorIhEEEC2B7v170000EOS3_
00000000 W _ZNSt6__ndk16vectorIhNS_9allocatorIhEEED2B7v170000Ev
00000000 W _ZNSt6__ndk16vectorIiNS_9allocatorIiEEE11__vallocateB7v170000Ej
00000000 W _ZNSt6__ndk16vectorIiNS_9allocatorIiEEE16__destroy_vectorclB7v170000Ev
00000000 W _ZNSt6__ndk16vectorIiNS_9allocatorIiEEE18__construct_at_endEj
00000000 W _ZNSt6__ndk16vectorIiNS_9allocatorIiEEE18__construct_at_endEjRKi
00000000 W _ZNSt6__ndk16vectorIiNS_9allocatorIiEEE21__push_back_slow_pathIRKiEEvOT_
00000000 W _ZNSt6__ndk16vectorIiNS_9allocatorIiEEE26__swap_out_circular_bufferERNS_14__split_bufferIiRS2_EE
00000000 W _ZNSt6__ndk16vectorIiNS_9allocatorIiEEE9push_backB7v170000ERKi
00000000 W _ZNSt6__ndk16vectorIiNS_9allocatorIiEEEC2Ej
00000000 W _ZNSt6__ndk16vectorIiNS_9allocatorIiEEEC2EjRKi
00000000 W _ZNSt6__ndk16vectorIiNS_9allocatorIiEEED2B7v170000Ev
00000000 W _ZNSt6__ndk19allocatorINS_6vectorIhNS0_IhEEEEE8allocateB7v170000Ej
00000000 W _ZNSt6__ndk19allocatorIPNS_16__hash_node_baseIPNS_11__hash_nodeINS_17__hash_value_typeIjiEEPvEEEEE8allocateB7v170000Ej
00000000 W _ZNSt6__ndk19allocatorIiE8allocateB7v170000Ej
00000000 W _ZNSt6__ndk19allocatorIjE8allocateB7v170000Ej
00000000 W _ZSt28__throw_bad_array_new_lengthB7v170000v
4_libjpegli_static_color_transform.cc.o:
00000000 T _ZN6jpegli13NullTransformEPPfj
00000000 T _ZN6jpegli14GrayscaleToRGBEPPfj
00000000 T _ZN6jpegli15GrayscaleToARGBEPPfj
00000000 T _ZN6jpegli15GrayscaleToRGBAEPPfj
00000000 T _ZN6jpegli16GrayscaleToYCbCrEPPfj
00000000 T _ZN6jpegli20ChooseColorTransformEP20jpeg_compress_struct
00000000 T _ZN6jpegli20ChooseColorTransformEP22jpeg_decompress_struct
00000000 T _ZN6jpegli25CheckColorSpaceComponentsEi13J_COLOR_SPACE
00000000 T _ZN6jpegli8N_EMU12810BGRToYCbCrEPPfj
00000000 T _ZN6jpegli8N_EMU12810CMYKToYCCKEPPfj
00000000 T _ZN6jpegli8N_EMU12810RGBToYCbCrEPPfj
00000000 T _ZN6jpegli8N_EMU12810YCCKToCMYKEPPfj
00000000 T _ZN6jpegli8N_EMU12810YCbCrToBGREPPfj
00000000 T _ZN6jpegli8N_EMU12810YCbCrToRGBEPPfj
00000000 T _ZN6jpegli8N_EMU12811ABGRToYCbCrEPPfj
00000000 T _ZN6jpegli8N_EMU12811ARGBToYCbCrEPPfj
00000000 T _ZN6jpegli8N_EMU12811YCbCrToABGREPPfj
00000000 T _ZN6jpegli8N_EMU12811YCbCrToARGBEPPfj
00000000 T _ZN6jpegli8N_EMU12811YCbCrToBGRAEPPfj
00000000 T _ZN6jpegli8N_EMU12811YCbCrToRGBAEPPfj
00000000 W _ZN6jpegli8N_EMU12813ExtRGBToYCbCrILi0ELi1ELi2EEEvPPfj
00000000 W _ZN6jpegli8N_EMU12813ExtRGBToYCbCrILi1ELi2ELi3EEEvPPfj
00000000 W _ZN6jpegli8N_EMU12813ExtRGBToYCbCrILi2ELi1ELi0EEEvPPfj
00000000 W _ZN6jpegli8N_EMU12813ExtRGBToYCbCrILi3ELi2ELi1EEEvPPfj
00000000 W _ZN6jpegli8N_EMU12813YCbCrToExtRGBILi0ELi1ELi2ELi3EEEvPPfj
00000000 W _ZN6jpegli8N_EMU12813YCbCrToExtRGBILi0ELi1ELi2ELin1EEEvPPfj
00000000 W _ZN6jpegli8N_EMU12813YCbCrToExtRGBILi1ELi2ELi3ELi0EEEvPPfj
00000000 W _ZN6jpegli8N_EMU12813YCbCrToExtRGBILi2ELi1ELi0ELi3EEEvPPfj
00000000 W _ZN6jpegli8N_EMU12813YCbCrToExtRGBILi2ELi1ELi0ELin1EEEvPPfj
00000000 W _ZN6jpegli8N_EMU12813YCbCrToExtRGBILi3ELi2ELi1ELi0EEEvPPfj
00000000 T _ZN6jpegli8RGBToBGREPPfj
00000000 T _ZN6jpegli9FillAlphaEPfj
00000000 T _ZN6jpegli9RGBToABGREPPfj
00000000 T _ZN6jpegli9RGBToARGBEPPfj
00000000 T _ZN6jpegli9RGBToBGRAEPPfj
00000000 T _ZN6jpegli9RGBToRGBAEPPfj
5_libjpegli_static_common.cc.o:
00000000 W _ZN18jpeg_decomp_masterD2Ev
00000000 W _ZNSt6__ndk16vectorINS0_IhNS_9allocatorIhEEEENS1_IS3_EEE16__destroy_vectorclB7v170000Ev
00000000 W _ZNSt6__ndk16vectorINS0_IhNS_9allocatorIhEEEENS1_IS3_EEE22__base_destruct_at_endB7v170000EPS3_
00000000 W _ZNSt6__ndk16vectorINS0_IhNS_9allocatorIhEEEENS1_IS3_EEE7__clearB7v170000Ev
00000000 W _ZNSt6__ndk16vectorINS0_IhNS_9allocatorIhEEEENS1_IS3_EEED2B7v170000Ev
00000000 W _ZNSt6__ndk16vectorIhNS_9allocatorIhEEE16__destroy_vectorclB7v170000Ev
00000000 W _ZNSt6__ndk16vectorIhNS_9allocatorIhEEED2B7v170000Ev
00000000 T jpegli_abort
00000000 T jpegli_alloc_huff_table
00000000 T jpegli_alloc_quant_table
00000000 T jpegli_bytes_per_sample
00000000 T jpegli_destroy
6_libjpegli_static_decode.cc.o:
00000000 T _Z29jpegli_core_output_dimensionsP22jpeg_decompress_struct
00000000 W _ZN18jpeg_decomp_masterC2Ev
00000000 T _ZN6jpegli12ConsumeInputEP22jpeg_decompress_struct
00000000 T _ZN6jpegli12IsInputReadyEP22jpeg_decompress_struct
00000000 T _ZN6jpegli14PrepareForScanEP22jpeg_decompress_struct
00000000 T _ZN6jpegli14ReadOutputPassEP22jpeg_decompress_struct
00000000 T _ZN6jpegli15InitializeImageEP22jpeg_decompress_struct
00000000 T _ZN6jpegli19InitProgressMonitorEP22jpeg_decompress_structb
00000000 T _ZN6jpegli21AllocateOutputBuffersEP22jpeg_decompress_struct
00000000 T _ZN6jpegli22PrepareQuantizedOutputEP22jpeg_decompress_struct
00000000 T _ZN6jpegli23BuildHuffmanLookupTableEP22jpeg_decompress_structP9JHUFF_TBLPNS_17HuffmanTableEntryE
00000000 T _ZN6jpegli24ProgressMonitorInputPassEP22jpeg_decompress_struct
00000000 T _ZN6jpegli25AllocateCoefficientBufferEP22jpeg_decompress_struct
00000000 T _ZN6jpegli25ProgressMonitorOutputPassEP22jpeg_decompress_struct
00000000 T _ZN6jpegli26InitializeDecompressParamsEP22jpeg_decompress_struct
00000000 T _ZN6jpegli28InitProgressMonitorForOutputEP22jpeg_decompress_struct
00000000 W _ZN6jpegli9RowBufferIfE8AllocateIP22jpeg_decompress_structEEvT_jj
00000000 W _ZNKSt6__ndk16vectorIhNS_9allocatorIhEEE11__recommendB7v170000Ej
00000000 W _ZNSt6__ndk114__split_bufferIhRNS_9allocatorIhEEE17__destruct_at_endB7v170000EPhNS_17integral_constantIbLb0EEE
00000000 W _ZNSt6__ndk114__split_bufferIhRNS_9allocatorIhEEE18__construct_at_endIPKhEENS_9enable_ifIXsr27__is_cpp17_forward_iteratorIT_EE5valueEvE4typeES9_S9_
00000000 W _ZNSt6__ndk114__split_bufferIhRNS_9allocatorIhEEE5clearB7v170000Ev
00000000 W _ZNSt6__ndk114__split_bufferIhRNS_9allocatorIhEEED2Ev
00000000 W _ZNSt6__ndk121__unwrap_and_dispatchB7v170000INS_10__overloadINS_11__move_loopINS_17_ClassicAlgPolicyEEENS_14__move_trivialEEENS_16reverse_iteratorIPhEES9_S9_Li0EEENS_4pairIT0_T2_EESB_T1_SC_
00000000 W _ZNSt6__ndk14moveB7v170000INS_16reverse_iteratorIPhEES3_EET0_T_S5_S4_
00000000 W _ZNSt6__ndk16vectorIhNS_9allocatorIhEEE11__vallocateB7v170000Ej
00000000 W _ZNSt6__ndk16vectorIhNS_9allocatorIhEEE12__move_rangeEPhS4_S4_
00000000 W _ZNSt6__ndk16vectorIhNS_9allocatorIhEEE13__vdeallocateEv
00000000 W _ZNSt6__ndk16vectorIhNS_9allocatorIhEEE26__swap_out_circular_bufferERNS_14__split_bufferIhRS2_EEPh
00000000 W _ZNSt6__ndk16vectorIhNS_9allocatorIhEEE6assignIPKhLi0EEEvT_S7_
00000000 W _ZNSt6__ndk16vectorIhNS_9allocatorIhEEE6insertIPKhLi0EEENS_11__wrap_iterIPhEENS7_IS6_EET_SB_
00000000 T jpegli_CreateDecompress
00000000 T jpegli_abort_decompress
00000000 T jpegli_calc_output_dimensions
00000000 T jpegli_consume_input
00000000 T jpegli_crop_scanline
00000000 T jpegli_destroy_decompress
00000000 T jpegli_finish_decompress
00000000 T jpegli_finish_output
00000000 T jpegli_has_multiple_scans
00000000 T jpegli_input_complete
00000000 T jpegli_new_colormap
00000000 T jpegli_read_coefficients
00000000 T jpegli_read_header
00000000 T jpegli_read_icc_profile
00000000 T jpegli_read_raw_data
00000000 T jpegli_read_scanlines
00000000 T jpegli_resync_to_restart
00000000 T jpegli_save_markers
00000000 T jpegli_set_marker_processor
00000000 T jpegli_set_output_format
00000000 T jpegli_skip_scanlines
00000000 T jpegli_start_decompress
00000000 T jpegli_start_output
7_libjpegli_static_decode_marker.cc.o:
00000000 T _ZN6jpegli14ProcessMarkersEP22jpeg_decompress_structPKhjPj
00000000 T _ZN6jpegli18GetMarkerProcessorEP22jpeg_decompress_struct
00000000 W _ZNKSt6__ndk16vectorIhNS_9allocatorIhEEE11__recommendB7v170000Ej
00000000 W _ZNSt6__ndk114__split_bufferIhRNS_9allocatorIhEEE17__destruct_at_endB7v170000EPhNS_17integral_constantIbLb0EEE
00000000 W _ZNSt6__ndk114__split_bufferIhRNS_9allocatorIhEEE18__construct_at_endIPKhEENS_9enable_ifIXsr27__is_cpp17_forward_iteratorIT_EE5valueEvE4typeES9_S9_
00000000 W _ZNSt6__ndk114__split_bufferIhRNS_9allocatorIhEEE5clearB7v170000Ev
00000000 W _ZNSt6__ndk114__split_bufferIhRNS_9allocatorIhEEED2Ev
00000000 W _ZNSt6__ndk121__unwrap_and_dispatchB7v170000INS_10__overloadINS_11__move_loopINS_17_ClassicAlgPolicyEEENS_14__move_trivialEEENS_16reverse_iteratorIPhEES9_S9_Li0EEENS_4pairIT0_T2_EESB_T1_SC_
00000000 W _ZNSt6__ndk14moveB7v170000INS_16reverse_iteratorIPhEES3_EET0_T_S5_S4_
00000000 W _ZNSt6__ndk16vectorIhNS_9allocatorIhEEE12__move_rangeEPhS4_S4_
00000000 W _ZNSt6__ndk16vectorIhNS_9allocatorIhEEE26__swap_out_circular_bufferERNS_14__split_bufferIhRS2_EEPh
00000000 W _ZNSt6__ndk16vectorIhNS_9allocatorIhEEE6insertIPKhLi0EEENS_11__wrap_iterIPhEENS7_IS6_EET_SB_
8_libjpegli_static_decode_scan.cc.o:
00000000 T _ZN6jpegli11ProcessScanEP22jpeg_decompress_structPKhjPjS4_
00000000 T _ZN6jpegli17PrepareForiMCURowEP22jpeg_decompress_struct
9_libjpegli_static_destination_manager.cc.o:
00000000 W _ZN6jpegli23StdioDestinationManager16init_destinationEP20jpeg_compress_struct
00000000 W _ZN6jpegli23StdioDestinationManager16term_destinationEP20jpeg_compress_struct
00000000 W _ZN6jpegli23StdioDestinationManager19empty_output_bufferEP20jpeg_compress_struct
00000000 W _ZN6jpegli24MemoryDestinationManager16init_destinationEP20jpeg_compress_struct
00000000 W _ZN6jpegli24MemoryDestinationManager16term_destinationEP20jpeg_compress_struct
00000000 W _ZN6jpegli24MemoryDestinationManager19empty_output_bufferEP20jpeg_compress_struct
00000000 T jpegli_mem_dest
00000000 T jpegli_stdio_dest
@@ -0,0 +1,4 @@
Header source: /mnt/nas/builder/build-image-libs/out/android/x86/include
JPEG_LIB_VERSION: 80
jpeg_compress_struct_size: 428
Reason: selected by compile-time probe from all available Jpegli/build/image headers.
@@ -0,0 +1,37 @@
/* Version ID for the JPEG library.
* Might be useful for tests like "#if JPEG_LIB_VERSION >= 60".
*/
#define JPEG_LIB_VERSION 80
/* libjpeg-turbo version */
#define LIBJPEG_TURBO_VERSION 4.1.5
/* libjpeg-turbo version in integer form */
#define LIBJPEG_TURBO_VERSION_NUMBER 4001005
/* Support arithmetic encoding */
#define C_ARITH_CODING_SUPPORTED 1
/* Support arithmetic decoding */
#define D_ARITH_CODING_SUPPORTED 1
/* Support in-memory source/destination managers */
/* #undef MEM_SRCDST_SUPPORTED */
/* Use accelerated SIMD routines. */
#define WITH_SIMD 1
/*
* Define BITS_IN_JSAMPLE as either
* 8 for 8-bit sample values (the usual setting)
* 12 for 12-bit sample values
* Only 8 and 12 are legal data precisions for lossy JPEG according to the
* JPEG standard, and the IJG code does not support anything else!
* We do not support run-time selection of data precision, sorry.
*/
#define BITS_IN_JSAMPLE 8 /* use 8 or 12 */
/* Define if your (broken) compiler shifts signed values as if they were
unsigned. */
/* #undef RIGHT_SHIFT_IS_UNSIGNED */
@@ -0,0 +1,335 @@
/*
* jerror.h
*
* This file was part of the Independent JPEG Group's software:
* Copyright (C) 1994-1997, Thomas G. Lane.
* Modified 1997-2009 by Guido Vollbeding.
* libjpeg-turbo Modifications:
* Copyright (C) 2014, 2017, 2021-2022, 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 JPEG library.
* Edit this file to add new codes, or to translate the message strings to
* some other language.
* A set of error-reporting macros are defined too. Some applications using
* the JPEG library may wish to include this file to get the error codes
* and/or the macros.
*/
/*
* 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 JERROR_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 /* JERROR_H */
#endif /* JMESSAGE */
#ifdef JMAKE_ENUM_LIST
typedef enum {
#define JMESSAGE(code,string) code ,
#endif /* JMAKE_ENUM_LIST */
JMESSAGE(JMSG_NOMESSAGE, "Bogus message code %d") /* Must be first entry! */
/* For maintenance convenience, list is alphabetical by message code name */
#if JPEG_LIB_VERSION < 70
JMESSAGE(JERR_ARITH_NOTIMPL, "Sorry, arithmetic coding is not implemented")
#endif
JMESSAGE(JERR_BAD_ALIGN_TYPE, "ALIGN_TYPE is wrong, please fix")
JMESSAGE(JERR_BAD_ALLOC_CHUNK, "MAX_ALLOC_CHUNK is wrong, please fix")
JMESSAGE(JERR_BAD_BUFFER_MODE, "Bogus buffer control mode")
JMESSAGE(JERR_BAD_COMPONENT_ID, "Invalid component ID %d in SOS")
#if JPEG_LIB_VERSION >= 70
JMESSAGE(JERR_BAD_CROP_SPEC, "Invalid crop request")
#endif
JMESSAGE(JERR_BAD_DCT_COEF, "DCT coefficient out of range")
JMESSAGE(JERR_BAD_DCTSIZE, "IDCT output block size %d not supported")
#if JPEG_LIB_VERSION >= 70
JMESSAGE(JERR_BAD_DROP_SAMPLING,
"Component index %d: mismatching sampling ratio %d:%d, %d:%d, %c")
#endif
JMESSAGE(JERR_BAD_HUFF_TABLE, "Bogus Huffman table definition")
JMESSAGE(JERR_BAD_IN_COLORSPACE, "Bogus input colorspace")
JMESSAGE(JERR_BAD_J_COLORSPACE, "Bogus JPEG colorspace")
JMESSAGE(JERR_BAD_LENGTH, "Bogus marker length")
JMESSAGE(JERR_BAD_LIB_VERSION,
"Wrong JPEG library version: library is %d, caller expects %d")
JMESSAGE(JERR_BAD_MCU_SIZE, "Sampling factors too large for interleaved scan")
JMESSAGE(JERR_BAD_POOL_ID, "Invalid memory pool code %d")
JMESSAGE(JERR_BAD_PRECISION, "Unsupported JPEG data precision %d")
JMESSAGE(JERR_BAD_PROGRESSION,
"Invalid progressive parameters Ss=%d Se=%d Ah=%d Al=%d")
JMESSAGE(JERR_BAD_PROG_SCRIPT,
"Invalid progressive parameters at scan script entry %d")
JMESSAGE(JERR_BAD_SAMPLING, "Bogus sampling factors")
JMESSAGE(JERR_BAD_SCAN_SCRIPT, "Invalid scan script at entry %d")
JMESSAGE(JERR_BAD_STATE, "Improper call to JPEG library in state %d")
JMESSAGE(JERR_BAD_STRUCT_SIZE,
"JPEG parameter struct mismatch: library thinks size is %u, caller expects %u")
JMESSAGE(JERR_BAD_VIRTUAL_ACCESS, "Bogus virtual array access")
JMESSAGE(JERR_BUFFER_SIZE, "Buffer passed to JPEG library is too small")
JMESSAGE(JERR_CANT_SUSPEND, "Suspension not allowed here")
JMESSAGE(JERR_CCIR601_NOTIMPL, "CCIR601 sampling not implemented yet")
JMESSAGE(JERR_COMPONENT_COUNT, "Too many color components: %d, max %d")
JMESSAGE(JERR_CONVERSION_NOTIMPL, "Unsupported color conversion request")
JMESSAGE(JERR_DAC_INDEX, "Bogus DAC index %d")
JMESSAGE(JERR_DAC_VALUE, "Bogus DAC value 0x%x")
JMESSAGE(JERR_DHT_INDEX, "Bogus DHT index %d")
JMESSAGE(JERR_DQT_INDEX, "Bogus DQT index %d")
JMESSAGE(JERR_EMPTY_IMAGE, "Empty JPEG image (DNL not supported)")
JMESSAGE(JERR_EMS_READ, "Read from EMS failed")
JMESSAGE(JERR_EMS_WRITE, "Write to EMS failed")
JMESSAGE(JERR_EOI_EXPECTED, "Didn't expect more than one scan")
JMESSAGE(JERR_FILE_READ, "Input file read error")
JMESSAGE(JERR_FILE_WRITE, "Output file write error --- out of disk space?")
JMESSAGE(JERR_FRACT_SAMPLE_NOTIMPL, "Fractional sampling not implemented yet")
JMESSAGE(JERR_HUFF_CLEN_OVERFLOW, "Huffman code size table overflow")
JMESSAGE(JERR_HUFF_MISSING_CODE, "Missing Huffman code table entry")
JMESSAGE(JERR_IMAGE_TOO_BIG, "Maximum supported image dimension is %u pixels")
JMESSAGE(JERR_INPUT_EMPTY, "Empty input file")
JMESSAGE(JERR_INPUT_EOF, "Premature end of input file")
JMESSAGE(JERR_MISMATCHED_QUANT_TABLE,
"Cannot transcode due to multiple use of quantization table %d")
JMESSAGE(JERR_MISSING_DATA, "Scan script does not transmit all data")
JMESSAGE(JERR_MODE_CHANGE, "Invalid color quantization mode change")
JMESSAGE(JERR_NOTIMPL, "Requested features are incompatible")
JMESSAGE(JERR_NOT_COMPILED, "Requested feature was omitted at compile time")
#if JPEG_LIB_VERSION >= 70
JMESSAGE(JERR_NO_ARITH_TABLE, "Arithmetic table 0x%02x was not defined")
#endif
JMESSAGE(JERR_NO_BACKING_STORE, "Backing store not supported")
JMESSAGE(JERR_NO_HUFF_TABLE, "Huffman table 0x%02x was not defined")
JMESSAGE(JERR_NO_IMAGE, "JPEG datastream contains no image")
JMESSAGE(JERR_NO_QUANT_TABLE, "Quantization table 0x%02x was not defined")
JMESSAGE(JERR_NO_SOI, "Not a JPEG file: starts with 0x%02x 0x%02x")
JMESSAGE(JERR_OUT_OF_MEMORY, "Insufficient memory (case %d)")
JMESSAGE(JERR_QUANT_COMPONENTS,
"Cannot quantize more than %d color components")
JMESSAGE(JERR_QUANT_FEW_COLORS, "Cannot quantize to fewer than %d colors")
JMESSAGE(JERR_QUANT_MANY_COLORS, "Cannot quantize to more than %d colors")
JMESSAGE(JERR_SOF_DUPLICATE, "Invalid JPEG file structure: two SOF markers")
JMESSAGE(JERR_SOF_NO_SOS, "Invalid JPEG file structure: missing SOS marker")
JMESSAGE(JERR_SOF_UNSUPPORTED, "Unsupported JPEG process: SOF type 0x%02x")
JMESSAGE(JERR_SOI_DUPLICATE, "Invalid JPEG file structure: two SOI markers")
JMESSAGE(JERR_SOS_NO_SOF, "Invalid JPEG file structure: SOS before SOF")
JMESSAGE(JERR_TFILE_CREATE, "Failed to create temporary file %s")
JMESSAGE(JERR_TFILE_READ, "Read failed on temporary file")
JMESSAGE(JERR_TFILE_SEEK, "Seek failed on temporary file")
JMESSAGE(JERR_TFILE_WRITE,
"Write failed on temporary file --- out of disk space?")
JMESSAGE(JERR_TOO_LITTLE_DATA, "Application transferred too few scanlines")
JMESSAGE(JERR_UNKNOWN_MARKER, "Unsupported marker type 0x%02x")
JMESSAGE(JERR_VIRTUAL_BUG, "Virtual array controller messed up")
JMESSAGE(JERR_WIDTH_OVERFLOW, "Image too wide for this implementation")
JMESSAGE(JERR_XMS_READ, "Read from XMS failed")
JMESSAGE(JERR_XMS_WRITE, "Write to XMS failed")
JMESSAGE(JMSG_COPYRIGHT, JCOPYRIGHT_SHORT)
JMESSAGE(JMSG_VERSION, JVERSION)
JMESSAGE(JTRC_16BIT_TABLES,
"Caution: quantization tables are too coarse for baseline JPEG")
JMESSAGE(JTRC_ADOBE,
"Adobe APP14 marker: version %d, flags 0x%04x 0x%04x, transform %d")
JMESSAGE(JTRC_APP0, "Unknown APP0 marker (not JFIF), length %u")
JMESSAGE(JTRC_APP14, "Unknown APP14 marker (not Adobe), length %u")
JMESSAGE(JTRC_DAC, "Define Arithmetic Table 0x%02x: 0x%02x")
JMESSAGE(JTRC_DHT, "Define Huffman Table 0x%02x")
JMESSAGE(JTRC_DQT, "Define Quantization Table %d precision %d")
JMESSAGE(JTRC_DRI, "Define Restart Interval %u")
JMESSAGE(JTRC_EMS_CLOSE, "Freed EMS handle %u")
JMESSAGE(JTRC_EMS_OPEN, "Obtained EMS handle %u")
JMESSAGE(JTRC_EOI, "End Of Image")
JMESSAGE(JTRC_HUFFBITS, " %3d %3d %3d %3d %3d %3d %3d %3d")
JMESSAGE(JTRC_JFIF, "JFIF APP0 marker: version %d.%02d, density %dx%d %d")
JMESSAGE(JTRC_JFIF_BADTHUMBNAILSIZE,
"Warning: thumbnail image size does not match data length %u")
JMESSAGE(JTRC_JFIF_EXTENSION, "JFIF extension marker: type 0x%02x, length %u")
JMESSAGE(JTRC_JFIF_THUMBNAIL, " with %d x %d thumbnail image")
JMESSAGE(JTRC_MISC_MARKER, "Miscellaneous marker 0x%02x, length %u")
JMESSAGE(JTRC_PARMLESS_MARKER, "Unexpected marker 0x%02x")
JMESSAGE(JTRC_QUANTVALS, " %4u %4u %4u %4u %4u %4u %4u %4u")
JMESSAGE(JTRC_QUANT_3_NCOLORS, "Quantizing to %d = %d*%d*%d colors")
JMESSAGE(JTRC_QUANT_NCOLORS, "Quantizing to %d colors")
JMESSAGE(JTRC_QUANT_SELECTED, "Selected %d colors for quantization")
JMESSAGE(JTRC_RECOVERY_ACTION, "At marker 0x%02x, recovery action %d")
JMESSAGE(JTRC_RST, "RST%d")
JMESSAGE(JTRC_SMOOTH_NOTIMPL,
"Smoothing not supported with nonstandard sampling ratios")
JMESSAGE(JTRC_SOF, "Start Of Frame 0x%02x: width=%u, height=%u, components=%d")
JMESSAGE(JTRC_SOF_COMPONENT, " Component %d: %dhx%dv q=%d")
JMESSAGE(JTRC_SOI, "Start of Image")
JMESSAGE(JTRC_SOS, "Start Of Scan: %d components")
JMESSAGE(JTRC_SOS_COMPONENT, " Component %d: dc=%d ac=%d")
JMESSAGE(JTRC_SOS_PARAMS, " Ss=%d, Se=%d, Ah=%d, Al=%d")
JMESSAGE(JTRC_TFILE_CLOSE, "Closed temporary file %s")
JMESSAGE(JTRC_TFILE_OPEN, "Opened temporary file %s")
JMESSAGE(JTRC_THUMB_JPEG,
"JFIF extension marker: JPEG-compressed thumbnail image, length %u")
JMESSAGE(JTRC_THUMB_PALETTE,
"JFIF extension marker: palette thumbnail image, length %u")
JMESSAGE(JTRC_THUMB_RGB,
"JFIF extension marker: RGB thumbnail image, length %u")
JMESSAGE(JTRC_UNKNOWN_IDS,
"Unrecognized component IDs %d %d %d, assuming YCbCr")
JMESSAGE(JTRC_XMS_CLOSE, "Freed XMS handle %u")
JMESSAGE(JTRC_XMS_OPEN, "Obtained XMS handle %u")
JMESSAGE(JWRN_ADOBE_XFORM, "Unknown Adobe color transform code %d")
#if JPEG_LIB_VERSION >= 70
JMESSAGE(JWRN_ARITH_BAD_CODE, "Corrupt JPEG data: bad arithmetic code")
#endif
JMESSAGE(JWRN_BOGUS_PROGRESSION,
"Inconsistent progression sequence for component %d coefficient %d")
JMESSAGE(JWRN_EXTRANEOUS_DATA,
"Corrupt JPEG data: %u extraneous bytes before marker 0x%02x")
JMESSAGE(JWRN_HIT_MARKER, "Corrupt JPEG data: premature end of data segment")
JMESSAGE(JWRN_HUFF_BAD_CODE, "Corrupt JPEG data: bad Huffman code")
JMESSAGE(JWRN_JFIF_MAJOR, "Warning: unknown JFIF revision number %d.%02d")
JMESSAGE(JWRN_JPEG_EOF, "Premature end of JPEG file")
JMESSAGE(JWRN_MUST_RESYNC,
"Corrupt JPEG data: found marker 0x%02x instead of RST%d")
JMESSAGE(JWRN_NOT_SEQUENTIAL, "Invalid SOS parameters for sequential JPEG")
JMESSAGE(JWRN_TOO_MUCH_DATA, "Application transferred too many scanlines")
#if JPEG_LIB_VERSION < 70
JMESSAGE(JERR_BAD_CROP_SPEC, "Invalid crop request")
#if defined(C_ARITH_CODING_SUPPORTED) || defined(D_ARITH_CODING_SUPPORTED)
JMESSAGE(JERR_NO_ARITH_TABLE, "Arithmetic table 0x%02x was not defined")
JMESSAGE(JWRN_ARITH_BAD_CODE, "Corrupt JPEG data: bad arithmetic code")
#endif
#endif
JMESSAGE(JERR_BAD_PARAM, "Bogus parameter")
JMESSAGE(JERR_BAD_PARAM_VALUE, "Bogus parameter value")
JMESSAGE(JERR_UNSUPPORTED_SUSPEND, "I/O suspension not supported in scan optimization")
JMESSAGE(JWRN_BOGUS_ICC, "Corrupt JPEG data: bad ICC marker")
#if JPEG_LIB_VERSION < 70
JMESSAGE(JERR_BAD_DROP_SAMPLING,
"Component index %d: mismatching sampling ratio %d:%d, %d:%d, %c")
#endif
#ifdef JMAKE_ENUM_LIST
JMSG_LASTMSGCODE
} J_MESSAGE_CODE;
#undef JMAKE_ENUM_LIST
#endif /* JMAKE_ENUM_LIST */
/* Zap JMESSAGE macro so that future re-inclusions do nothing by default */
#undef JMESSAGE
#ifndef JERROR_H
#define JERROR_H
/* Macros to simplify using the error and trace message stuff */
/* The first parameter is either type of cinfo pointer */
/* Fatal errors (print message and exit) */
#define ERREXIT(cinfo,code) \
((cinfo)->err->msg_code = (code), \
(*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
#define ERREXIT1(cinfo,code,p1) \
((cinfo)->err->msg_code = (code), \
(cinfo)->err->msg_parm.i[0] = (p1), \
(*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
#define ERREXIT2(cinfo,code,p1,p2) \
((cinfo)->err->msg_code = (code), \
(cinfo)->err->msg_parm.i[0] = (p1), \
(cinfo)->err->msg_parm.i[1] = (p2), \
(*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
#define ERREXIT3(cinfo,code,p1,p2,p3) \
((cinfo)->err->msg_code = (code), \
(cinfo)->err->msg_parm.i[0] = (p1), \
(cinfo)->err->msg_parm.i[1] = (p2), \
(cinfo)->err->msg_parm.i[2] = (p3), \
(*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
#define ERREXIT4(cinfo,code,p1,p2,p3,p4) \
((cinfo)->err->msg_code = (code), \
(cinfo)->err->msg_parm.i[0] = (p1), \
(cinfo)->err->msg_parm.i[1] = (p2), \
(cinfo)->err->msg_parm.i[2] = (p3), \
(cinfo)->err->msg_parm.i[3] = (p4), \
(*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
#define ERREXIT6(cinfo, code, p1, p2, p3, p4, p5, p6) \
((cinfo)->err->msg_code = (code), \
(cinfo)->err->msg_parm.i[0] = (p1), \
(cinfo)->err->msg_parm.i[1] = (p2), \
(cinfo)->err->msg_parm.i[2] = (p3), \
(cinfo)->err->msg_parm.i[3] = (p4), \
(cinfo)->err->msg_parm.i[4] = (p5), \
(cinfo)->err->msg_parm.i[5] = (p6), \
(*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
#define ERREXITS(cinfo, code, str) \
((cinfo)->err->msg_code = (code), \
strncpy((cinfo)->err->msg_parm.s, (str), JMSG_STR_PARM_MAX), \
(cinfo)->err->msg_parm.s[JMSG_STR_PARM_MAX - 1] = '\0', \
(*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
#define MAKESTMT(stuff) do { stuff } while (0)
/* Nonfatal errors (we can keep going, but the data is probably corrupt) */
#define WARNMS(cinfo,code) \
((cinfo)->err->msg_code = (code), \
(*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1))
#define WARNMS1(cinfo,code,p1) \
((cinfo)->err->msg_code = (code), \
(cinfo)->err->msg_parm.i[0] = (p1), \
(*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1))
#define WARNMS2(cinfo,code,p1,p2) \
((cinfo)->err->msg_code = (code), \
(cinfo)->err->msg_parm.i[0] = (p1), \
(cinfo)->err->msg_parm.i[1] = (p2), \
(*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1))
/* Informational/debugging messages */
#define TRACEMS(cinfo,lvl,code) \
((cinfo)->err->msg_code = (code), \
(*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)))
#define TRACEMS1(cinfo,lvl,code,p1) \
((cinfo)->err->msg_code = (code), \
(cinfo)->err->msg_parm.i[0] = (p1), \
(*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)))
#define TRACEMS2(cinfo,lvl,code,p1,p2) \
((cinfo)->err->msg_code = (code), \
(cinfo)->err->msg_parm.i[0] = (p1), \
(cinfo)->err->msg_parm.i[1] = (p2), \
(*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)))
#define TRACEMS3(cinfo,lvl,code,p1,p2,p3) \
MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \
_mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); \
(cinfo)->err->msg_code = (code); \
(*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); )
#define TRACEMS4(cinfo,lvl,code,p1,p2,p3,p4) \
MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \
_mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \
(cinfo)->err->msg_code = (code); \
(*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); )
#define TRACEMS5(cinfo,lvl,code,p1,p2,p3,p4,p5) \
MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \
_mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \
_mp[4] = (p5); \
(cinfo)->err->msg_code = (code); \
(*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); )
#define TRACEMS8(cinfo,lvl,code,p1,p2,p3,p4,p5,p6,p7,p8) \
MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \
_mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \
_mp[4] = (p5); _mp[5] = (p6); _mp[6] = (p7); _mp[7] = (p8); \
(cinfo)->err->msg_code = (code); \
(*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); )
#define TRACEMSS(cinfo,lvl,code,str) \
((cinfo)->err->msg_code = (code), \
strncpy((cinfo)->err->msg_parm.s, (str), JMSG_STR_PARM_MAX), \
(cinfo)->err->msg_parm.s[JMSG_STR_PARM_MAX - 1] = '\0', \
(*(cinfo)->err->emit_message) ((j_common_ptr)(cinfo), (lvl)))
#endif /* JERROR_H */
@@ -0,0 +1,382 @@
/*
* jmorecfg.h
*
* This file was part of the Independent JPEG Group's software:
* Copyright (C) 1991-1997, Thomas G. Lane.
* Modified 1997-2009 by Guido Vollbeding.
* libjpeg-turbo Modifications:
* Copyright (C) 2009, 2011, 2014-2015, 2018, 2020, D. R. Commander.
* For conditions of distribution and use, see the accompanying README.ijg
* file.
*
* This file contains additional configuration options that customize the
* JPEG software for special applications or support machine-dependent
* optimizations. Most users will not need to touch this file.
*/
/*
* Maximum number of components (color channels) allowed in JPEG image.
* To meet the letter of Rec. ITU-T T.81 | ISO/IEC 10918-1, set this to 255.
* However, darn few applications need more than 4 channels (maybe 5 for CMYK +
* alpha mask). We recommend 10 as a reasonable compromise; use 4 if you are
* really short on memory. (Each allowed component costs a hundred or so
* bytes of storage, whether actually used in an image or not.)
*/
#define MAX_COMPONENTS 10 /* maximum number of image components */
/*
* Basic data types.
* You may need to change these if you have a machine with unusual data
* type sizes; for example, "char" not 8 bits, "short" not 16 bits,
* or "long" not 32 bits. We don't care whether "int" is 16 or 32 bits,
* but it had better be at least 16.
*/
/* Representation of a single sample (pixel element value).
* We frequently allocate large arrays of these, so it's important to keep
* them small. But if you have memory to burn and access to char or short
* arrays is very slow on your hardware, you might want to change these.
*/
#if BITS_IN_JSAMPLE == 8
/* JSAMPLE should be the smallest type that will hold the values 0..255.
*/
typedef unsigned char JSAMPLE;
#define GETJSAMPLE(value) ((int)(value))
#define MAXJSAMPLE 255
#define CENTERJSAMPLE 128
#endif /* BITS_IN_JSAMPLE == 8 */
#if BITS_IN_JSAMPLE == 12
/* JSAMPLE should be the smallest type that will hold the values 0..4095.
* On nearly all machines "short" will do nicely.
*/
typedef short JSAMPLE;
#define GETJSAMPLE(value) ((int)(value))
#define MAXJSAMPLE 4095
#define CENTERJSAMPLE 2048
#endif /* BITS_IN_JSAMPLE == 12 */
/* Representation of a DCT frequency coefficient.
* This should be a signed value of at least 16 bits; "short" is usually OK.
* Again, we allocate large arrays of these, but you can change to int
* if you have memory to burn and "short" is really slow.
*/
typedef short JCOEF;
/* Compressed datastreams are represented as arrays of JOCTET.
* These must be EXACTLY 8 bits wide, at least once they are written to
* external storage. Note that when using the stdio data source/destination
* managers, this is also the data type passed to fread/fwrite.
*/
typedef unsigned char JOCTET;
#define GETJOCTET(value) (value)
/* These typedefs are used for various table entries and so forth.
* They must be at least as wide as specified; but making them too big
* won't cost a huge amount of memory, so we don't provide special
* extraction code like we did for JSAMPLE. (In other words, these
* typedefs live at a different point on the speed/space tradeoff curve.)
*/
/* UINT8 must hold at least the values 0..255. */
typedef unsigned char UINT8;
/* UINT16 must hold at least the values 0..65535. */
typedef unsigned short UINT16;
/* INT16 must hold at least the values -32768..32767. */
#ifndef XMD_H /* X11/xmd.h correctly defines INT16 */
typedef short INT16;
#endif
/* INT32 must hold at least signed 32-bit values.
*
* NOTE: The INT32 typedef dates back to libjpeg v5 (1994.) Integers were
* sometimes 16-bit back then (MS-DOS), which is why INT32 is typedef'd to
* long. It also wasn't common (or at least as common) in 1994 for INT32 to be
* defined by platform headers. Since then, however, INT32 is defined in
* several other common places:
*
* Xmd.h (X11 header) typedefs INT32 to int on 64-bit platforms and long on
* 32-bit platforms (i.e always a 32-bit signed type.)
*
* basetsd.h (Win32 header) typedefs INT32 to int (always a 32-bit signed type
* on modern platforms.)
*
* qglobal.h (Qt header) typedefs INT32 to int (always a 32-bit signed type on
* modern platforms.)
*
* This is a recipe for conflict, since "long" and "int" aren't always
* compatible types. Since the definition of INT32 has technically been part
* of the libjpeg API for more than 20 years, we can't remove it, but we do not
* use it internally any longer. We instead define a separate type (JLONG)
* for internal use, which ensures that internal behavior will always be the
* same regardless of any external headers that may be included.
*/
#ifndef XMD_H /* X11/xmd.h correctly defines INT32 */
#ifndef _BASETSD_H_ /* Microsoft defines it in basetsd.h */
#ifndef _BASETSD_H /* MinGW is slightly different */
#ifndef QGLOBAL_H /* Qt defines it in qglobal.h */
typedef long INT32;
#endif
#endif
#endif
#endif
/* Datatype used for image dimensions. The JPEG standard only supports
* images up to 64K*64K due to 16-bit fields in SOF markers. Therefore
* "unsigned int" is sufficient on all machines. However, if you need to
* handle larger images and you don't mind deviating from the spec, you
* can change this datatype. (Note that changing this datatype will
* potentially require modifying the SIMD code. The x86-64 SIMD extensions,
* in particular, assume a 32-bit JDIMENSION.)
*/
typedef unsigned int JDIMENSION;
#define JPEG_MAX_DIMENSION 65500L /* a tad under 64K to prevent overflows */
/* These macros are used in all function definitions and extern declarations.
* You could modify them if you need to change function linkage conventions;
* in particular, you'll need to do that to make the library a Windows DLL.
* Another application is to make all functions global for use with debuggers
* or code profilers that require it.
*/
/* a function called through method pointers: */
#define METHODDEF(type) static type
/* a function used only in its module: */
#define LOCAL(type) static type
/* a function referenced thru EXTERNs: */
#define GLOBAL(type) type
/* a reference to a GLOBAL function: */
#define EXTERN(type) extern type
/* Originally, this macro was used as a way of defining function prototypes
* for both modern compilers as well as older compilers that did not support
* prototype parameters. libjpeg-turbo has never supported these older,
* non-ANSI compilers, but the macro is still included because there is some
* software out there that uses it.
*/
#define JMETHOD(type, methodname, arglist) type (*methodname) arglist
/* libjpeg-turbo no longer supports platforms that have far symbols (MS-DOS),
* but again, some software relies on this macro.
*/
#undef FAR
#define FAR
/*
* On a few systems, type boolean and/or its values FALSE, TRUE may appear
* in standard header files. Or you may have conflicts with application-
* specific header files that you want to include together with these files.
* Defining HAVE_BOOLEAN before including jpeglib.h should make it work.
*/
#ifndef HAVE_BOOLEAN
typedef int boolean;
#endif
#ifndef FALSE /* in case these macros already exist */
#define FALSE 0 /* values of boolean */
#endif
#ifndef TRUE
#define TRUE 1
#endif
/*
* The remaining options affect code selection within the JPEG library,
* but they don't need to be visible to most applications using the library.
* To minimize application namespace pollution, the symbols won't be
* defined unless JPEG_INTERNALS or JPEG_INTERNAL_OPTIONS has been defined.
*/
#ifdef JPEG_INTERNALS
#define JPEG_INTERNAL_OPTIONS
#endif
#ifdef JPEG_INTERNAL_OPTIONS
/*
* These defines indicate whether to include various optional functions.
* Undefining some of these symbols will produce a smaller but less capable
* library. Note that you can leave certain source files out of the
* compilation/linking process if you've #undef'd the corresponding symbols.
* (You may HAVE to do that if your compiler doesn't like null source files.)
*/
/* Capability options common to encoder and decoder: */
#define DCT_ISLOW_SUPPORTED /* accurate integer method */
#define DCT_IFAST_SUPPORTED /* less accurate int method [legacy feature] */
#define DCT_FLOAT_SUPPORTED /* floating-point method [legacy feature] */
/* Encoder capability options: */
#define C_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */
#define C_PROGRESSIVE_SUPPORTED /* Progressive JPEG? (Requires MULTISCAN)*/
#define ENTROPY_OPT_SUPPORTED /* Optimization of entropy coding parms? */
/* Note: if you selected 12-bit data precision, it is dangerous to turn off
* ENTROPY_OPT_SUPPORTED. The standard Huffman tables are only good for 8-bit
* precision, so jchuff.c normally uses entropy optimization to compute
* usable tables for higher precision. If you don't want to do optimization,
* you'll have to supply different default Huffman tables.
* The exact same statements apply for progressive JPEG: the default tables
* don't work for progressive mode. (This may get fixed, however.)
*/
#define INPUT_SMOOTHING_SUPPORTED /* Input image smoothing option? */
/* Decoder capability options: */
#define D_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */
#define D_PROGRESSIVE_SUPPORTED /* Progressive JPEG? (Requires MULTISCAN)*/
#define SAVE_MARKERS_SUPPORTED /* jpeg_save_markers() needed? */
#define BLOCK_SMOOTHING_SUPPORTED /* Block smoothing? (Progressive only) */
#define IDCT_SCALING_SUPPORTED /* Output rescaling via IDCT? */
#undef UPSAMPLE_SCALING_SUPPORTED /* Output rescaling at upsample stage? */
#define UPSAMPLE_MERGING_SUPPORTED /* Fast path for sloppy upsampling? */
#define QUANT_1PASS_SUPPORTED /* 1-pass color quantization? */
#define QUANT_2PASS_SUPPORTED /* 2-pass color quantization? */
/* more capability options later, no doubt */
/*
* The RGB_RED, RGB_GREEN, RGB_BLUE, and RGB_PIXELSIZE macros are a vestigial
* feature of libjpeg. The idea was that, if an application developer needed
* to compress from/decompress to a BGR/BGRX/RGBX/XBGR/XRGB buffer, they could
* change these macros, rebuild libjpeg, and link their application statically
* with it. In reality, few people ever did this, because there were some
* severe restrictions involved (cjpeg and djpeg no longer worked properly,
* compressing/decompressing RGB JPEGs no longer worked properly, and the color
* quantizer wouldn't work with pixel sizes other than 3.) Furthermore, since
* all of the O/S-supplied versions of libjpeg were built with the default
* values of RGB_RED, RGB_GREEN, RGB_BLUE, and RGB_PIXELSIZE, many applications
* have come to regard these values as immutable.
*
* The libjpeg-turbo colorspace extensions provide a much cleaner way of
* compressing from/decompressing to buffers with arbitrary component orders
* and pixel sizes. Thus, we do not support changing the values of RGB_RED,
* RGB_GREEN, RGB_BLUE, or RGB_PIXELSIZE. In addition to the restrictions
* listed above, changing these values will also break the SIMD extensions and
* the regression tests.
*/
#define RGB_RED 0 /* Offset of Red in an RGB scanline element */
#define RGB_GREEN 1 /* Offset of Green */
#define RGB_BLUE 2 /* Offset of Blue */
#define RGB_PIXELSIZE 3 /* JSAMPLEs per RGB scanline element */
#define JPEG_NUMCS 17
#define EXT_RGB_RED 0
#define EXT_RGB_GREEN 1
#define EXT_RGB_BLUE 2
#define EXT_RGB_PIXELSIZE 3
#define EXT_RGBX_RED 0
#define EXT_RGBX_GREEN 1
#define EXT_RGBX_BLUE 2
#define EXT_RGBX_PIXELSIZE 4
#define EXT_BGR_RED 2
#define EXT_BGR_GREEN 1
#define EXT_BGR_BLUE 0
#define EXT_BGR_PIXELSIZE 3
#define EXT_BGRX_RED 2
#define EXT_BGRX_GREEN 1
#define EXT_BGRX_BLUE 0
#define EXT_BGRX_PIXELSIZE 4
#define EXT_XBGR_RED 3
#define EXT_XBGR_GREEN 2
#define EXT_XBGR_BLUE 1
#define EXT_XBGR_PIXELSIZE 4
#define EXT_XRGB_RED 1
#define EXT_XRGB_GREEN 2
#define EXT_XRGB_BLUE 3
#define EXT_XRGB_PIXELSIZE 4
static const int rgb_red[JPEG_NUMCS] = {
-1, -1, RGB_RED, -1, -1, -1, EXT_RGB_RED, EXT_RGBX_RED,
EXT_BGR_RED, EXT_BGRX_RED, EXT_XBGR_RED, EXT_XRGB_RED,
EXT_RGBX_RED, EXT_BGRX_RED, EXT_XBGR_RED, EXT_XRGB_RED,
-1
};
static const int rgb_green[JPEG_NUMCS] = {
-1, -1, RGB_GREEN, -1, -1, -1, EXT_RGB_GREEN, EXT_RGBX_GREEN,
EXT_BGR_GREEN, EXT_BGRX_GREEN, EXT_XBGR_GREEN, EXT_XRGB_GREEN,
EXT_RGBX_GREEN, EXT_BGRX_GREEN, EXT_XBGR_GREEN, EXT_XRGB_GREEN,
-1
};
static const int rgb_blue[JPEG_NUMCS] = {
-1, -1, RGB_BLUE, -1, -1, -1, EXT_RGB_BLUE, EXT_RGBX_BLUE,
EXT_BGR_BLUE, EXT_BGRX_BLUE, EXT_XBGR_BLUE, EXT_XRGB_BLUE,
EXT_RGBX_BLUE, EXT_BGRX_BLUE, EXT_XBGR_BLUE, EXT_XRGB_BLUE,
-1
};
static const int rgb_pixelsize[JPEG_NUMCS] = {
-1, -1, RGB_PIXELSIZE, -1, -1, -1, EXT_RGB_PIXELSIZE, EXT_RGBX_PIXELSIZE,
EXT_BGR_PIXELSIZE, EXT_BGRX_PIXELSIZE, EXT_XBGR_PIXELSIZE, EXT_XRGB_PIXELSIZE,
EXT_RGBX_PIXELSIZE, EXT_BGRX_PIXELSIZE, EXT_XBGR_PIXELSIZE, EXT_XRGB_PIXELSIZE,
-1
};
/* Definitions for speed-related optimizations. */
/* On some machines (notably 68000 series) "int" is 32 bits, but multiplying
* two 16-bit shorts is faster than multiplying two ints. Define MULTIPLIER
* as short on such a machine. MULTIPLIER must be at least 16 bits wide.
*/
#ifndef MULTIPLIER
#ifndef WITH_SIMD
#define MULTIPLIER int /* type for fastest integer multiply */
#else
#define MULTIPLIER short /* prefer 16-bit with SIMD for parellelism */
#endif
#endif
/* FAST_FLOAT should be either float or double, whichever is done faster
* by your compiler. (Note that this type is only used in the floating point
* DCT routines, so it only matters if you've defined DCT_FLOAT_SUPPORTED.)
*/
#ifndef FAST_FLOAT
#define FAST_FLOAT float
#endif
#endif /* JPEG_INTERNAL_OPTIONS */
@@ -0,0 +1,375 @@
/*
* jpegint.h
*
* This file was part of the Independent JPEG Group's software:
* Copyright (C) 1991-1997, Thomas G. Lane.
* Modified 1997-2009 by Guido Vollbeding.
* libjpeg-turbo Modifications:
* Copyright (C) 2015-2016, 2019, 2021, D. R. Commander.
* Copyright (C) 2015, Google, Inc.
* Copyright (C) 2021, Alex Richardson.
* For conditions of distribution and use, see the accompanying README.ijg
* file.
*
* This file provides common declarations for the various JPEG modules.
* These declarations are considered internal to the JPEG library; most
* applications using the library shouldn't need to include this file.
*/
/* Declarations for both compression & decompression */
typedef enum { /* Operating modes for buffer controllers */
JBUF_PASS_THRU, /* Plain stripwise operation */
/* Remaining modes require a full-image buffer to have been created */
JBUF_SAVE_SOURCE, /* Run source subobject only, save output */
JBUF_CRANK_DEST, /* Run dest subobject only, using saved data */
JBUF_SAVE_AND_PASS /* Run both subobjects, save output */
} J_BUF_MODE;
/* Values of global_state field (jdapi.c has some dependencies on ordering!) */
#define CSTATE_START 100 /* after create_compress */
#define CSTATE_SCANNING 101 /* start_compress done, write_scanlines OK */
#define CSTATE_RAW_OK 102 /* start_compress done, write_raw_data OK */
#define CSTATE_WRCOEFS 103 /* jpeg_write_coefficients done */
#define DSTATE_START 200 /* after create_decompress */
#define DSTATE_INHEADER 201 /* reading header markers, no SOS yet */
#define DSTATE_READY 202 /* found SOS, ready for start_decompress */
#define DSTATE_PRELOAD 203 /* reading multiscan file in start_decompress*/
#define DSTATE_PRESCAN 204 /* performing dummy pass for 2-pass quant */
#define DSTATE_SCANNING 205 /* start_decompress done, read_scanlines OK */
#define DSTATE_RAW_OK 206 /* start_decompress done, read_raw_data OK */
#define DSTATE_BUFIMAGE 207 /* expecting jpeg_start_output */
#define DSTATE_BUFPOST 208 /* looking for SOS/EOI in jpeg_finish_output */
#define DSTATE_RDCOEFS 209 /* reading file in jpeg_read_coefficients */
#define DSTATE_STOPPING 210 /* looking for EOI in jpeg_finish_decompress */
/* JLONG must hold at least signed 32-bit values. */
typedef long JLONG;
/* JUINTPTR must hold pointer values. */
#ifdef __UINTPTR_TYPE__
/*
* __UINTPTR_TYPE__ is GNU-specific and available in GCC 4.6+ and Clang 3.0+.
* Fortunately, that is sufficient to support the few architectures for which
* sizeof(void *) != sizeof(size_t). The only other options would require C99
* or Clang-specific builtins.
*/
typedef __UINTPTR_TYPE__ JUINTPTR;
#else
typedef size_t JUINTPTR;
#endif
/*
* Left shift macro that handles a negative operand without causing any
* sanitizer warnings
*/
#define LEFT_SHIFT(a, b) ((JLONG)((unsigned long)(a) << (b)))
/* Declarations for compression modules */
/* Master control module */
struct jpeg_comp_master {
void (*prepare_for_pass) (j_compress_ptr cinfo);
void (*pass_startup) (j_compress_ptr cinfo);
void (*finish_pass) (j_compress_ptr cinfo);
/* State variables made visible to other modules */
boolean call_pass_startup; /* True if pass_startup must be called */
boolean is_last_pass; /* True during last pass */
};
/* Main buffer control (downsampled-data buffer) */
struct jpeg_c_main_controller {
void (*start_pass) (j_compress_ptr cinfo, J_BUF_MODE pass_mode);
void (*process_data) (j_compress_ptr cinfo, JSAMPARRAY input_buf,
JDIMENSION *in_row_ctr, JDIMENSION in_rows_avail);
};
/* Compression preprocessing (downsampling input buffer control) */
struct jpeg_c_prep_controller {
void (*start_pass) (j_compress_ptr cinfo, J_BUF_MODE pass_mode);
void (*pre_process_data) (j_compress_ptr cinfo, JSAMPARRAY input_buf,
JDIMENSION *in_row_ctr, JDIMENSION in_rows_avail,
JSAMPIMAGE output_buf,
JDIMENSION *out_row_group_ctr,
JDIMENSION out_row_groups_avail);
};
/* Coefficient buffer control */
struct jpeg_c_coef_controller {
void (*start_pass) (j_compress_ptr cinfo, J_BUF_MODE pass_mode);
boolean (*compress_data) (j_compress_ptr cinfo, JSAMPIMAGE input_buf);
};
/* Colorspace conversion */
struct jpeg_color_converter {
void (*start_pass) (j_compress_ptr cinfo);
void (*color_convert) (j_compress_ptr cinfo, JSAMPARRAY input_buf,
JSAMPIMAGE output_buf, JDIMENSION output_row,
int num_rows);
};
/* Downsampling */
struct jpeg_downsampler {
void (*start_pass) (j_compress_ptr cinfo);
void (*downsample) (j_compress_ptr cinfo, JSAMPIMAGE input_buf,
JDIMENSION in_row_index, JSAMPIMAGE output_buf,
JDIMENSION out_row_group_index);
boolean need_context_rows; /* TRUE if need rows above & below */
};
/* Forward DCT (also controls coefficient quantization) */
struct jpeg_forward_dct {
void (*start_pass) (j_compress_ptr cinfo);
/* perhaps this should be an array??? */
void (*forward_DCT) (j_compress_ptr cinfo, jpeg_component_info *compptr,
JSAMPARRAY sample_data, JBLOCKROW coef_blocks,
JDIMENSION start_row, JDIMENSION start_col,
JDIMENSION num_blocks);
};
/* Entropy encoding */
struct jpeg_entropy_encoder {
void (*start_pass) (j_compress_ptr cinfo, boolean gather_statistics);
boolean (*encode_mcu) (j_compress_ptr cinfo, JBLOCKROW *MCU_data);
void (*finish_pass) (j_compress_ptr cinfo);
};
/* Marker writing */
struct jpeg_marker_writer {
void (*write_file_header) (j_compress_ptr cinfo);
void (*write_frame_header) (j_compress_ptr cinfo);
void (*write_scan_header) (j_compress_ptr cinfo);
void (*write_file_trailer) (j_compress_ptr cinfo);
void (*write_tables_only) (j_compress_ptr cinfo);
/* These routines are exported to allow insertion of extra markers */
/* Probably only COM and APPn markers should be written this way */
void (*write_marker_header) (j_compress_ptr cinfo, int marker,
unsigned int datalen);
void (*write_marker_byte) (j_compress_ptr cinfo, int val);
};
/* Declarations for decompression modules */
/* Master control module */
struct jpeg_decomp_master {
void (*prepare_for_output_pass) (j_decompress_ptr cinfo);
void (*finish_output_pass) (j_decompress_ptr cinfo);
/* State variables made visible to other modules */
boolean is_dummy_pass; /* True during 1st pass for 2-pass quant */
/* Partial decompression variables */
JDIMENSION first_iMCU_col;
JDIMENSION last_iMCU_col;
JDIMENSION first_MCU_col[MAX_COMPONENTS];
JDIMENSION last_MCU_col[MAX_COMPONENTS];
boolean jinit_upsampler_no_alloc;
/* Last iMCU row that was successfully decoded */
JDIMENSION last_good_iMCU_row;
};
/* Input control module */
struct jpeg_input_controller {
int (*consume_input) (j_decompress_ptr cinfo);
void (*reset_input_controller) (j_decompress_ptr cinfo);
void (*start_input_pass) (j_decompress_ptr cinfo);
void (*finish_input_pass) (j_decompress_ptr cinfo);
/* State variables made visible to other modules */
boolean has_multiple_scans; /* True if file has multiple scans */
boolean eoi_reached; /* True when EOI has been consumed */
};
/* Main buffer control (downsampled-data buffer) */
struct jpeg_d_main_controller {
void (*start_pass) (j_decompress_ptr cinfo, J_BUF_MODE pass_mode);
void (*process_data) (j_decompress_ptr cinfo, JSAMPARRAY output_buf,
JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail);
};
/* Coefficient buffer control */
struct jpeg_d_coef_controller {
void (*start_input_pass) (j_decompress_ptr cinfo);
int (*consume_data) (j_decompress_ptr cinfo);
void (*start_output_pass) (j_decompress_ptr cinfo);
int (*decompress_data) (j_decompress_ptr cinfo, JSAMPIMAGE output_buf);
/* Pointer to array of coefficient virtual arrays, or NULL if none */
jvirt_barray_ptr *coef_arrays;
};
/* Decompression postprocessing (color quantization buffer control) */
struct jpeg_d_post_controller {
void (*start_pass) (j_decompress_ptr cinfo, J_BUF_MODE pass_mode);
void (*post_process_data) (j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
JDIMENSION *in_row_group_ctr,
JDIMENSION in_row_groups_avail,
JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
JDIMENSION out_rows_avail);
};
/* Marker reading & parsing */
struct jpeg_marker_reader {
void (*reset_marker_reader) (j_decompress_ptr cinfo);
/* Read markers until SOS or EOI.
* Returns same codes as are defined for jpeg_consume_input:
* JPEG_SUSPENDED, JPEG_REACHED_SOS, or JPEG_REACHED_EOI.
*/
int (*read_markers) (j_decompress_ptr cinfo);
/* Read a restart marker --- exported for use by entropy decoder only */
jpeg_marker_parser_method read_restart_marker;
/* State of marker reader --- nominally internal, but applications
* supplying COM or APPn handlers might like to know the state.
*/
boolean saw_SOI; /* found SOI? */
boolean saw_SOF; /* found SOF? */
int next_restart_num; /* next restart number expected (0-7) */
unsigned int discarded_bytes; /* # of bytes skipped looking for a marker */
};
/* Entropy decoding */
struct jpeg_entropy_decoder {
void (*start_pass) (j_decompress_ptr cinfo);
boolean (*decode_mcu) (j_decompress_ptr cinfo, JBLOCKROW *MCU_data);
/* This is here to share code between baseline and progressive decoders; */
/* other modules probably should not use it */
boolean insufficient_data; /* set TRUE after emitting warning */
};
/* Inverse DCT (also performs dequantization) */
typedef void (*inverse_DCT_method_ptr) (j_decompress_ptr cinfo,
jpeg_component_info *compptr,
JCOEFPTR coef_block,
JSAMPARRAY output_buf,
JDIMENSION output_col);
struct jpeg_inverse_dct {
void (*start_pass) (j_decompress_ptr cinfo);
/* It is useful to allow each component to have a separate IDCT method. */
inverse_DCT_method_ptr inverse_DCT[MAX_COMPONENTS];
};
/* Upsampling (note that upsampler must also call color converter) */
struct jpeg_upsampler {
void (*start_pass) (j_decompress_ptr cinfo);
void (*upsample) (j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
JDIMENSION *in_row_group_ctr,
JDIMENSION in_row_groups_avail, JSAMPARRAY output_buf,
JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail);
boolean need_context_rows; /* TRUE if need rows above & below */
};
/* Colorspace conversion */
struct jpeg_color_deconverter {
void (*start_pass) (j_decompress_ptr cinfo);
void (*color_convert) (j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
JDIMENSION input_row, JSAMPARRAY output_buf,
int num_rows);
};
/* Color quantization or color precision reduction */
struct jpeg_color_quantizer {
void (*start_pass) (j_decompress_ptr cinfo, boolean is_pre_scan);
void (*color_quantize) (j_decompress_ptr cinfo, JSAMPARRAY input_buf,
JSAMPARRAY output_buf, int num_rows);
void (*finish_pass) (j_decompress_ptr cinfo);
void (*new_color_map) (j_decompress_ptr cinfo);
};
/* Miscellaneous useful macros */
#undef MAX
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#undef MIN
#define MIN(a, b) ((a) < (b) ? (a) : (b))
/* We assume that right shift corresponds to signed division by 2 with
* rounding towards minus infinity. This is correct for typical "arithmetic
* shift" instructions that shift in copies of the sign bit. But some
* C compilers implement >> with an unsigned shift. For these machines you
* must define RIGHT_SHIFT_IS_UNSIGNED.
* RIGHT_SHIFT provides a proper signed right shift of a JLONG quantity.
* It is only applied with constant shift counts. SHIFT_TEMPS must be
* included in the variables of any routine using RIGHT_SHIFT.
*/
#ifdef RIGHT_SHIFT_IS_UNSIGNED
#define SHIFT_TEMPS JLONG shift_temp;
#define RIGHT_SHIFT(x, shft) \
((shift_temp = (x)) < 0 ? \
(shift_temp >> (shft)) | ((~((JLONG)0)) << (32 - (shft))) : \
(shift_temp >> (shft)))
#else
#define SHIFT_TEMPS
#define RIGHT_SHIFT(x, shft) ((x) >> (shft))
#endif
/* Compression module initialization routines */
EXTERN(void) jinit_compress_master(j_compress_ptr cinfo);
EXTERN(void) jinit_c_master_control(j_compress_ptr cinfo,
boolean transcode_only);
EXTERN(void) jinit_c_main_controller(j_compress_ptr cinfo,
boolean need_full_buffer);
EXTERN(void) jinit_c_prep_controller(j_compress_ptr cinfo,
boolean need_full_buffer);
EXTERN(void) jinit_c_coef_controller(j_compress_ptr cinfo,
boolean need_full_buffer);
EXTERN(void) jinit_color_converter(j_compress_ptr cinfo);
EXTERN(void) jinit_downsampler(j_compress_ptr cinfo);
EXTERN(void) jinit_forward_dct(j_compress_ptr cinfo);
EXTERN(void) jinit_huff_encoder(j_compress_ptr cinfo);
EXTERN(void) jinit_phuff_encoder(j_compress_ptr cinfo);
EXTERN(void) jinit_arith_encoder(j_compress_ptr cinfo);
EXTERN(void) jinit_marker_writer(j_compress_ptr cinfo);
/* Decompression module initialization routines */
EXTERN(void) jinit_master_decompress(j_decompress_ptr cinfo);
EXTERN(void) jinit_d_main_controller(j_decompress_ptr cinfo,
boolean need_full_buffer);
EXTERN(void) jinit_d_coef_controller(j_decompress_ptr cinfo,
boolean need_full_buffer);
EXTERN(void) jinit_d_post_controller(j_decompress_ptr cinfo,
boolean need_full_buffer);
EXTERN(void) jinit_input_controller(j_decompress_ptr cinfo);
EXTERN(void) jinit_marker_reader(j_decompress_ptr cinfo);
EXTERN(void) jinit_huff_decoder(j_decompress_ptr cinfo);
EXTERN(void) jinit_phuff_decoder(j_decompress_ptr cinfo);
EXTERN(void) jinit_arith_decoder(j_decompress_ptr cinfo);
EXTERN(void) jinit_inverse_dct(j_decompress_ptr cinfo);
EXTERN(void) jinit_upsampler(j_decompress_ptr cinfo);
EXTERN(void) jinit_color_deconverter(j_decompress_ptr cinfo);
EXTERN(void) jinit_1pass_quantizer(j_decompress_ptr cinfo);
EXTERN(void) jinit_2pass_quantizer(j_decompress_ptr cinfo);
EXTERN(void) jinit_merged_upsampler(j_decompress_ptr cinfo);
/* Memory manager initialization */
EXTERN(void) jinit_memory_mgr(j_common_ptr cinfo);
/* Utility routines in jutils.c */
EXTERN(long) jdiv_round_up(long a, long b);
EXTERN(long) jround_up(long a, long b);
EXTERN(void) jcopy_sample_rows(JSAMPARRAY input_array, int source_row,
JSAMPARRAY output_array, int dest_row,
int num_rows, JDIMENSION num_cols);
EXTERN(void) jcopy_block_row(JBLOCKROW input_row, JBLOCKROW output_row,
JDIMENSION num_blocks);
EXTERN(void) jzero_far(void *target, size_t bytestozero);
/* Constant tables in jutils.c */
#if 0 /* This table is not actually needed in v6a */
extern const int jpeg_zigzag_order[]; /* natural coef order to zigzag order */
#endif
extern const int jpeg_natural_order[]; /* zigzag coef order to natural order */
/* Arithmetic coding probability estimation tables in jaricom.c */
extern const JLONG jpeg_aritab[];
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,202 @@
#pragma once
/* Auto-generated by build_jpegli_static_android_ndk_r26_api21_private_v10_ifs_parse_fix.sh. */
/* Include this header instead of jpegli/jpeglib.h when using the private-symbol Jpegli archive. */
/* It remaps the libjpeg-compatible API to kjpegli_* symbols to avoid collisions with MozJPEG/Ghostscript. */
#ifndef jpegli_CreateCompress
#define jpegli_CreateCompress kjpegli_jpegli_CreateCompress
#endif
#ifndef jpegli_CreateDecompress
#define jpegli_CreateDecompress kjpegli_jpegli_CreateDecompress
#endif
#ifndef jpegli_abort
#define jpegli_abort kjpegli_jpegli_abort
#endif
#ifndef jpegli_abort_compress
#define jpegli_abort_compress kjpegli_jpegli_abort_compress
#endif
#ifndef jpegli_abort_decompress
#define jpegli_abort_decompress kjpegli_jpegli_abort_decompress
#endif
#ifndef jpegli_add_quant_table
#define jpegli_add_quant_table kjpegli_jpegli_add_quant_table
#endif
#ifndef jpegli_alloc_huff_table
#define jpegli_alloc_huff_table kjpegli_jpegli_alloc_huff_table
#endif
#ifndef jpegli_alloc_quant_table
#define jpegli_alloc_quant_table kjpegli_jpegli_alloc_quant_table
#endif
#ifndef jpegli_bytes_per_sample
#define jpegli_bytes_per_sample kjpegli_jpegli_bytes_per_sample
#endif
#ifndef jpegli_calc_output_dimensions
#define jpegli_calc_output_dimensions kjpegli_jpegli_calc_output_dimensions
#endif
#ifndef jpegli_consume_input
#define jpegli_consume_input kjpegli_jpegli_consume_input
#endif
#ifndef jpegli_copy_critical_parameters
#define jpegli_copy_critical_parameters kjpegli_jpegli_copy_critical_parameters
#endif
#ifndef jpegli_crop_scanline
#define jpegli_crop_scanline kjpegli_jpegli_crop_scanline
#endif
#ifndef jpegli_default_colorspace
#define jpegli_default_colorspace kjpegli_jpegli_default_colorspace
#endif
#ifndef jpegli_destroy
#define jpegli_destroy kjpegli_jpegli_destroy
#endif
#ifndef jpegli_destroy_compress
#define jpegli_destroy_compress kjpegli_jpegli_destroy_compress
#endif
#ifndef jpegli_destroy_decompress
#define jpegli_destroy_decompress kjpegli_jpegli_destroy_decompress
#endif
#ifndef jpegli_enable_adaptive_quantization
#define jpegli_enable_adaptive_quantization kjpegli_jpegli_enable_adaptive_quantization
#endif
#ifndef jpegli_finish_compress
#define jpegli_finish_compress kjpegli_jpegli_finish_compress
#endif
#ifndef jpegli_finish_decompress
#define jpegli_finish_decompress kjpegli_jpegli_finish_decompress
#endif
#ifndef jpegli_finish_output
#define jpegli_finish_output kjpegli_jpegli_finish_output
#endif
#ifndef jpegli_has_multiple_scans
#define jpegli_has_multiple_scans kjpegli_jpegli_has_multiple_scans
#endif
#ifndef jpegli_input_complete
#define jpegli_input_complete kjpegli_jpegli_input_complete
#endif
#ifndef jpegli_mem_dest
#define jpegli_mem_dest kjpegli_jpegli_mem_dest
#endif
#ifndef jpegli_mem_src
#define jpegli_mem_src kjpegli_jpegli_mem_src
#endif
#ifndef jpegli_new_colormap
#define jpegli_new_colormap kjpegli_jpegli_new_colormap
#endif
#ifndef jpegli_quality_scaling
#define jpegli_quality_scaling kjpegli_jpegli_quality_scaling
#endif
#ifndef jpegli_quality_to_distance
#define jpegli_quality_to_distance kjpegli_jpegli_quality_to_distance
#endif
#ifndef jpegli_read_coefficients
#define jpegli_read_coefficients kjpegli_jpegli_read_coefficients
#endif
#ifndef jpegli_read_header
#define jpegli_read_header kjpegli_jpegli_read_header
#endif
#ifndef jpegli_read_icc_profile
#define jpegli_read_icc_profile kjpegli_jpegli_read_icc_profile
#endif
#ifndef jpegli_read_raw_data
#define jpegli_read_raw_data kjpegli_jpegli_read_raw_data
#endif
#ifndef jpegli_read_scanlines
#define jpegli_read_scanlines kjpegli_jpegli_read_scanlines
#endif
#ifndef jpegli_resync_to_restart
#define jpegli_resync_to_restart kjpegli_jpegli_resync_to_restart
#endif
#ifndef jpegli_save_markers
#define jpegli_save_markers kjpegli_jpegli_save_markers
#endif
#ifndef jpegli_set_cicp_transfer_function
#define jpegli_set_cicp_transfer_function kjpegli_jpegli_set_cicp_transfer_function
#endif
#ifndef jpegli_set_colorspace
#define jpegli_set_colorspace kjpegli_jpegli_set_colorspace
#endif
#ifndef jpegli_set_defaults
#define jpegli_set_defaults kjpegli_jpegli_set_defaults
#endif
#ifndef jpegli_set_distance
#define jpegli_set_distance kjpegli_jpegli_set_distance
#endif
#ifndef jpegli_set_input_format
#define jpegli_set_input_format kjpegli_jpegli_set_input_format
#endif
#ifndef jpegli_set_linear_quality
#define jpegli_set_linear_quality kjpegli_jpegli_set_linear_quality
#endif
#ifndef jpegli_set_marker_processor
#define jpegli_set_marker_processor kjpegli_jpegli_set_marker_processor
#endif
#ifndef jpegli_set_output_format
#define jpegli_set_output_format kjpegli_jpegli_set_output_format
#endif
#ifndef jpegli_set_progressive_level
#define jpegli_set_progressive_level kjpegli_jpegli_set_progressive_level
#endif
#ifndef jpegli_set_psnr
#define jpegli_set_psnr kjpegli_jpegli_set_psnr
#endif
#ifndef jpegli_set_quality
#define jpegli_set_quality kjpegli_jpegli_set_quality
#endif
#ifndef jpegli_set_xyb_mode
#define jpegli_set_xyb_mode kjpegli_jpegli_set_xyb_mode
#endif
#ifndef jpegli_simple_progression
#define jpegli_simple_progression kjpegli_jpegli_simple_progression
#endif
#ifndef jpegli_skip_scanlines
#define jpegli_skip_scanlines kjpegli_jpegli_skip_scanlines
#endif
#ifndef jpegli_start_compress
#define jpegli_start_compress kjpegli_jpegli_start_compress
#endif
#ifndef jpegli_start_decompress
#define jpegli_start_decompress kjpegli_jpegli_start_decompress
#endif
#ifndef jpegli_start_output
#define jpegli_start_output kjpegli_jpegli_start_output
#endif
#ifndef jpegli_std_error
#define jpegli_std_error kjpegli_jpegli_std_error
#endif
#ifndef jpegli_stdio_dest
#define jpegli_stdio_dest kjpegli_jpegli_stdio_dest
#endif
#ifndef jpegli_stdio_src
#define jpegli_stdio_src kjpegli_jpegli_stdio_src
#endif
#ifndef jpegli_suppress_tables
#define jpegli_suppress_tables kjpegli_jpegli_suppress_tables
#endif
#ifndef jpegli_use_standard_quant_tables
#define jpegli_use_standard_quant_tables kjpegli_jpegli_use_standard_quant_tables
#endif
#ifndef jpegli_write_coefficients
#define jpegli_write_coefficients kjpegli_jpegli_write_coefficients
#endif
#ifndef jpegli_write_icc_profile
#define jpegli_write_icc_profile kjpegli_jpegli_write_icc_profile
#endif
#ifndef jpegli_write_m_byte
#define jpegli_write_m_byte kjpegli_jpegli_write_m_byte
#endif
#ifndef jpegli_write_m_header
#define jpegli_write_m_header kjpegli_jpegli_write_m_header
#endif
#ifndef jpegli_write_marker
#define jpegli_write_marker kjpegli_jpegli_write_marker
#endif
#ifndef jpegli_write_raw_data
#define jpegli_write_raw_data kjpegli_jpegli_write_raw_data
#endif
#ifndef jpegli_write_scanlines
#define jpegli_write_scanlines kjpegli_jpegli_write_scanlines
#endif
#ifndef jpegli_write_tables
#define jpegli_write_tables kjpegli_jpegli_write_tables
#endif
#include <jpegli/jpeglib.h>
@@ -0,0 +1,65 @@
jpegli_CreateCompress kjpegli_jpegli_CreateCompress
jpegli_CreateDecompress kjpegli_jpegli_CreateDecompress
jpegli_abort kjpegli_jpegli_abort
jpegli_abort_compress kjpegli_jpegli_abort_compress
jpegli_abort_decompress kjpegli_jpegli_abort_decompress
jpegli_add_quant_table kjpegli_jpegli_add_quant_table
jpegli_alloc_huff_table kjpegli_jpegli_alloc_huff_table
jpegli_alloc_quant_table kjpegli_jpegli_alloc_quant_table
jpegli_bytes_per_sample kjpegli_jpegli_bytes_per_sample
jpegli_calc_output_dimensions kjpegli_jpegli_calc_output_dimensions
jpegli_consume_input kjpegli_jpegli_consume_input
jpegli_copy_critical_parameters kjpegli_jpegli_copy_critical_parameters
jpegli_crop_scanline kjpegli_jpegli_crop_scanline
jpegli_default_colorspace kjpegli_jpegli_default_colorspace
jpegli_destroy kjpegli_jpegli_destroy
jpegli_destroy_compress kjpegli_jpegli_destroy_compress
jpegli_destroy_decompress kjpegli_jpegli_destroy_decompress
jpegli_enable_adaptive_quantization kjpegli_jpegli_enable_adaptive_quantization
jpegli_finish_compress kjpegli_jpegli_finish_compress
jpegli_finish_decompress kjpegli_jpegli_finish_decompress
jpegli_finish_output kjpegli_jpegli_finish_output
jpegli_has_multiple_scans kjpegli_jpegli_has_multiple_scans
jpegli_input_complete kjpegli_jpegli_input_complete
jpegli_mem_dest kjpegli_jpegli_mem_dest
jpegli_mem_src kjpegli_jpegli_mem_src
jpegli_new_colormap kjpegli_jpegli_new_colormap
jpegli_quality_scaling kjpegli_jpegli_quality_scaling
jpegli_quality_to_distance kjpegli_jpegli_quality_to_distance
jpegli_read_coefficients kjpegli_jpegli_read_coefficients
jpegli_read_header kjpegli_jpegli_read_header
jpegli_read_icc_profile kjpegli_jpegli_read_icc_profile
jpegli_read_raw_data kjpegli_jpegli_read_raw_data
jpegli_read_scanlines kjpegli_jpegli_read_scanlines
jpegli_resync_to_restart kjpegli_jpegli_resync_to_restart
jpegli_save_markers kjpegli_jpegli_save_markers
jpegli_set_cicp_transfer_function kjpegli_jpegli_set_cicp_transfer_function
jpegli_set_colorspace kjpegli_jpegli_set_colorspace
jpegli_set_defaults kjpegli_jpegli_set_defaults
jpegli_set_distance kjpegli_jpegli_set_distance
jpegli_set_input_format kjpegli_jpegli_set_input_format
jpegli_set_linear_quality kjpegli_jpegli_set_linear_quality
jpegli_set_marker_processor kjpegli_jpegli_set_marker_processor
jpegli_set_output_format kjpegli_jpegli_set_output_format
jpegli_set_progressive_level kjpegli_jpegli_set_progressive_level
jpegli_set_psnr kjpegli_jpegli_set_psnr
jpegli_set_quality kjpegli_jpegli_set_quality
jpegli_set_xyb_mode kjpegli_jpegli_set_xyb_mode
jpegli_simple_progression kjpegli_jpegli_simple_progression
jpegli_skip_scanlines kjpegli_jpegli_skip_scanlines
jpegli_start_compress kjpegli_jpegli_start_compress
jpegli_start_decompress kjpegli_jpegli_start_decompress
jpegli_start_output kjpegli_jpegli_start_output
jpegli_std_error kjpegli_jpegli_std_error
jpegli_stdio_dest kjpegli_jpegli_stdio_dest
jpegli_stdio_src kjpegli_jpegli_stdio_src
jpegli_suppress_tables kjpegli_jpegli_suppress_tables
jpegli_use_standard_quant_tables kjpegli_jpegli_use_standard_quant_tables
jpegli_write_coefficients kjpegli_jpegli_write_coefficients
jpegli_write_icc_profile kjpegli_jpegli_write_icc_profile
jpegli_write_m_byte kjpegli_jpegli_write_m_byte
jpegli_write_m_header kjpegli_jpegli_write_m_header
jpegli_write_marker kjpegli_jpegli_write_marker
jpegli_write_raw_data kjpegli_jpegli_write_raw_data
jpegli_write_scanlines kjpegli_jpegli_write_scanlines
jpegli_write_tables kjpegli_jpegli_write_tables
@@ -0,0 +1,903 @@
0_libjpegli_static_adaptive_quantization.cc.o:
00000000 T _ZN6jpegli25ComputeAdaptiveQuantFieldEP20jpeg_compress_struct
00000000 W _ZN6jpegli9RowBufferIfE6PadRowEjji
00000000 W _ZN6jpegli9RowBufferIfE7CopyRowEiii
10_libjpegli_static_downsample.cc.o:
00000000 T _ZN6jpegli14NullDownsampleEPPfjS0_
00000000 T _ZN6jpegli19ApplyInputSmoothingEP20jpeg_compress_struct
00000000 T _ZN6jpegli21DownsampleInputBufferEP20jpeg_compress_struct
00000000 T _ZN6jpegli23ChooseDownsampleMethodsEP20jpeg_compress_struct
00000000 T _ZN6jpegli6N_SSE213Downsample1x2EPPfjS1_
00000000 T _ZN6jpegli6N_SSE213Downsample1x3EPPfjS1_
00000000 T _ZN6jpegli6N_SSE213Downsample1x4EPPfjS1_
00000000 T _ZN6jpegli6N_SSE213Downsample2x1EPPfjS1_
00000000 T _ZN6jpegli6N_SSE213Downsample2x2EPPfjS1_
00000000 T _ZN6jpegli6N_SSE213Downsample2x3EPPfjS1_
00000000 T _ZN6jpegli6N_SSE213Downsample2x4EPPfjS1_
00000000 T _ZN6jpegli6N_SSE213Downsample3x1EPPfjS1_
00000000 T _ZN6jpegli6N_SSE213Downsample3x2EPPfjS1_
00000000 T _ZN6jpegli6N_SSE213Downsample3x3EPPfjS1_
00000000 T _ZN6jpegli6N_SSE213Downsample3x4EPPfjS1_
00000000 T _ZN6jpegli6N_SSE213Downsample4x1EPPfjS1_
00000000 T _ZN6jpegli6N_SSE213Downsample4x2EPPfjS1_
00000000 T _ZN6jpegli6N_SSE213Downsample4x3EPPfjS1_
00000000 T _ZN6jpegli6N_SSE213Downsample4x4EPPfjS1_
00000000 T _ZN6jpegli6N_SSE216DownsampleRow2x1EPKfjPf
00000000 T _ZN6jpegli6N_SSE216DownsampleRow3x1EPKfjPf
00000000 T _ZN6jpegli6N_SSE216DownsampleRow4x1EPKfjPf
00000000 T _ZN6jpegli6N_SSE413Downsample1x2EPPfjS1_
00000000 T _ZN6jpegli6N_SSE413Downsample1x3EPPfjS1_
00000000 T _ZN6jpegli6N_SSE413Downsample1x4EPPfjS1_
00000000 T _ZN6jpegli6N_SSE413Downsample2x1EPPfjS1_
00000000 T _ZN6jpegli6N_SSE413Downsample2x2EPPfjS1_
00000000 T _ZN6jpegli6N_SSE413Downsample2x3EPPfjS1_
00000000 T _ZN6jpegli6N_SSE413Downsample2x4EPPfjS1_
00000000 T _ZN6jpegli6N_SSE413Downsample3x1EPPfjS1_
00000000 T _ZN6jpegli6N_SSE413Downsample3x2EPPfjS1_
00000000 T _ZN6jpegli6N_SSE413Downsample3x3EPPfjS1_
00000000 T _ZN6jpegli6N_SSE413Downsample3x4EPPfjS1_
00000000 T _ZN6jpegli6N_SSE413Downsample4x1EPPfjS1_
00000000 T _ZN6jpegli6N_SSE413Downsample4x2EPPfjS1_
00000000 T _ZN6jpegli6N_SSE413Downsample4x3EPPfjS1_
00000000 T _ZN6jpegli6N_SSE413Downsample4x4EPPfjS1_
00000000 T _ZN6jpegli6N_SSE416DownsampleRow2x1EPKfjPf
00000000 T _ZN6jpegli6N_SSE416DownsampleRow3x1EPKfjPf
00000000 T _ZN6jpegli6N_SSE416DownsampleRow4x1EPKfjPf
00000000 W _ZN6jpegli9RowBufferIfE7CopyRowEiii
11_libjpegli_static_encode.cc.o:
00000000 T _ZN6jpegli10CheckStateEP20jpeg_compress_structi
00000000 T _ZN6jpegli10CheckStateEP20jpeg_compress_structii
00000000 W _ZN6jpegli11GetBlockRowIP20jpeg_compress_structEEPPA64_sT_ij
00000000 T _ZN6jpegli12InitCompressEP20jpeg_compress_structi
00000000 T _ZN6jpegli12ReadInputRowEP20jpeg_compress_structPKhPPf
00000000 T _ZN6jpegli14PadInputBufferEP20jpeg_compress_structPPf
00000000 T _ZN6jpegli14ProcessiMCURowEP20jpeg_compress_struct
00000000 T _ZN6jpegli15AllocateBuffersEP20jpeg_compress_struct
00000000 T _ZN6jpegli15ProcessiMCURowsEP20jpeg_compress_struct
00000000 W _ZN6jpegli16SetSentTableFlagI10JQUANT_TBLEEvPPT_ji
00000000 W _ZN6jpegli16SetSentTableFlagI9JHUFF_TBLEEvPPT_ji
00000000 T _ZN6jpegli18ValidateScanScriptEP20jpeg_compress_struct
00000000 T _ZN6jpegli19InitProgressMonitorEP20jpeg_compress_struct
00000000 T _ZN6jpegli19ZigZagShuffleBlocksEP20jpeg_compress_struct
00000000 T _ZN6jpegli20IsStreamingSupportedEP20jpeg_compress_struct
00000000 T _ZN6jpegli20SetDefaultScanScriptEP20jpeg_compress_struct
00000000 T _ZN6jpegli23LinearQualityToDistanceEi
00000000 T _ZN6jpegli24InitializeCompressParamsEP20jpeg_compress_struct
00000000 T _ZN6jpegli24ProcessCompressionParamsEP20jpeg_compress_struct
00000000 T _ZN6jpegli24ProgressMonitorInputPassEP20jpeg_compress_struct
00000000 W _ZN6jpegli9RowBufferIfE6PadRowEjji
00000000 W _ZN6jpegli9RowBufferIfE7FillRowEifj
00000000 W _ZN6jpegli9RowBufferIfE8AllocateIP20jpeg_compress_structEEvT_jj
00000000 W _ZNKSt6__ndk16vectorIN6jpegli15ProgressiveScanENS_9allocatorIS2_EEE11__recommendB7v170000Ej
00000000 W _ZNSt6__ndk114__split_bufferIN6jpegli15ProgressiveScanERNS_9allocatorIS2_EEE17__destruct_at_endB7v170000EPS2_NS_17integral_constantIbLb0EEE
00000000 W _ZNSt6__ndk114__split_bufferIN6jpegli15ProgressiveScanERNS_9allocatorIS2_EEE5clearB7v170000Ev
00000000 W _ZNSt6__ndk114__split_bufferIN6jpegli15ProgressiveScanERNS_9allocatorIS2_EEEC2EjjS5_
00000000 W _ZNSt6__ndk114__split_bufferIN6jpegli15ProgressiveScanERNS_9allocatorIS2_EEED2Ev
00000000 W _ZNSt6__ndk16vectorIN6jpegli15ProgressiveScanENS_9allocatorIS2_EEE16__destroy_vectorclB7v170000Ev
00000000 W _ZNSt6__ndk16vectorIN6jpegli15ProgressiveScanENS_9allocatorIS2_EEE21__push_back_slow_pathIS2_EEvOT_
00000000 W _ZNSt6__ndk16vectorIN6jpegli15ProgressiveScanENS_9allocatorIS2_EEE26__swap_out_circular_bufferERNS_14__split_bufferIS2_RS4_EE
00000000 W _ZNSt6__ndk16vectorIN6jpegli15ProgressiveScanENS_9allocatorIS2_EEE9push_backB7v170000EOS2_
00000000 W _ZNSt6__ndk16vectorIN6jpegli15ProgressiveScanENS_9allocatorIS2_EEED2B7v170000Ev
00000000 W _ZNSt6__ndk16vectorIhNS_9allocatorIhEEE11__vallocateB7v170000Ej
00000000 W _ZNSt6__ndk16vectorIhNS_9allocatorIhEEE16__destroy_vectorclB7v170000Ev
00000000 W _ZNSt6__ndk16vectorIhNS_9allocatorIhEEE18__construct_at_endEj
00000000 W _ZNSt6__ndk16vectorIhNS_9allocatorIhEEEC2Ej
00000000 W _ZNSt6__ndk16vectorIhNS_9allocatorIhEEED2B7v170000Ev
00000000 W _ZNSt6__ndk19allocatorIN6jpegli15ProgressiveScanEE8allocateB7v170000Ej
00000000 W _ZSt28__throw_bad_array_new_lengthB7v170000v
00000000 T jpegli_CreateCompress
00000000 T jpegli_abort_compress
00000000 T jpegli_add_quant_table
00000000 T jpegli_copy_critical_parameters
00000000 T jpegli_default_colorspace
00000000 T jpegli_destroy_compress
00000000 T jpegli_enable_adaptive_quantization
00000000 T jpegli_finish_compress
00000000 T jpegli_quality_scaling
00000000 T jpegli_quality_to_distance
00000000 T jpegli_set_cicp_transfer_function
00000000 T jpegli_set_colorspace
00000000 T jpegli_set_defaults
00000000 T jpegli_set_distance
00000000 T jpegli_set_input_format
00000000 T jpegli_set_linear_quality
00000000 T jpegli_set_progressive_level
00000000 T jpegli_set_psnr
00000000 T jpegli_set_quality
00000000 T jpegli_set_xyb_mode
00000000 T jpegli_simple_progression
00000000 T jpegli_start_compress
00000000 T jpegli_suppress_tables
00000000 T jpegli_use_standard_quant_tables
00000000 T jpegli_write_coefficients
00000000 T jpegli_write_icc_profile
00000000 T jpegli_write_m_byte
00000000 T jpegli_write_m_header
00000000 T jpegli_write_marker
00000000 T jpegli_write_raw_data
00000000 T jpegli_write_scanlines
00000000 T jpegli_write_tables
12_libjpegli_static_encode_finish.cc.o:
00000000 W _ZN6jpegli11GetBlockRowIP20jpeg_compress_structEEPPA64_sT_ij
00000000 T _ZN6jpegli14QuantizetoPSNREP20jpeg_compress_struct
00000000 T _ZN6jpegli6N_SSE210BlockErrorEPKsPKfS4_fS4_S4_
00000000 T _ZN6jpegli6N_SSE211ComputePSNREP20jpeg_compress_structi
00000000 T _ZN6jpegli6N_SSE215ReQuantizeBlockEPsPKffS3_S3_
00000000 T _ZN6jpegli6N_SSE216ReQuantizeCoeffsEP20jpeg_compress_struct
00000000 T _ZN6jpegli6N_SSE221ComputeInverseWeightsEPKfPf
00000000 T _ZN6jpegli6N_SSE410BlockErrorEPKsPKfS4_fS4_S4_
00000000 T _ZN6jpegli6N_SSE411ComputePSNREP20jpeg_compress_structi
00000000 T _ZN6jpegli6N_SSE415ReQuantizeBlockEPsPKffS3_S3_
00000000 T _ZN6jpegli6N_SSE416ReQuantizeCoeffsEP20jpeg_compress_struct
00000000 T _ZN6jpegli6N_SSE421ComputeInverseWeightsEPKfPf
13_libjpegli_static_encode_streaming.cc.o:
00000000 T _ZN6jpegli12WriteiMCURowEP20jpeg_compress_struct
00000000 T _ZN6jpegli23ComputeTokensForiMCURowEP20jpeg_compress_struct
00000000 T _ZN6jpegli29ComputeCoefficientsForiMCURowEP20jpeg_compress_struct
00000000 T _ZN6jpegli6N_SSE212WriteiMCURowEP20jpeg_compress_struct
00000000 W _ZN6jpegli6N_SSE214ProcessiMCURowILi0EEEvP20jpeg_compress_struct
00000000 W _ZN6jpegli6N_SSE214ProcessiMCURowILi1EEEvP20jpeg_compress_struct
00000000 W _ZN6jpegli6N_SSE214ProcessiMCURowILi2EEEvP20jpeg_compress_struct
00000000 T _ZN6jpegli6N_SSE223ComputeTokensForiMCURowEP20jpeg_compress_struct
00000000 T _ZN6jpegli6N_SSE229ComputeCoefficientsForiMCURowEP20jpeg_compress_struct
00000000 T _ZN6jpegli6N_SSE412WriteiMCURowEP20jpeg_compress_struct
00000000 W _ZN6jpegli6N_SSE414ProcessiMCURowILi0EEEvP20jpeg_compress_struct
00000000 W _ZN6jpegli6N_SSE414ProcessiMCURowILi1EEEvP20jpeg_compress_struct
00000000 W _ZN6jpegli6N_SSE414ProcessiMCURowILi2EEEvP20jpeg_compress_struct
00000000 T _ZN6jpegli6N_SSE423ComputeTokensForiMCURowEP20jpeg_compress_struct
00000000 T _ZN6jpegli6N_SSE429ComputeCoefficientsForiMCURowEP20jpeg_compress_struct
00000000 V _ZZN3hwy6N_SSE26detail18IndicesFromBits128INS0_4SimdIiLj4ELi0EEELPv0EEEDTcl4ZerocvT__EEES6_yE10u8_indices
00000000 V _ZZN3hwy6N_SSE46detail18IndicesFromBits128INS0_4SimdIiLj4ELi0EEELPv0EEEDTcl4ZerocvT__EEES6_yE10u8_indices
14_libjpegli_static_entropy_coding.cc.o:
00000000 T _ZN6jpegli12TokenizeJpegEP20jpeg_compress_struct
00000000 T _ZN6jpegli16InitEntropyCoderEP20jpeg_compress_struct
00000000 T _ZN6jpegli17CopyHuffmanTablesEP20jpeg_compress_struct
00000000 T _ZN6jpegli17EstimateNumTokensEP20jpeg_compress_structjjjj
00000000 T _ZN6jpegli20OptimizeHuffmanCodesEP20jpeg_compress_struct
00000000 T _ZN6jpegli21MaxNumTokensPerMCURowEP20jpeg_compress_struct
00000000 T _ZN6jpegli6N_SSE223ComputeTokensSequentialEPKsiiiPPNS_5TokenE
00000000 T _ZN6jpegli6N_SSE423ComputeTokensSequentialEPKsiiiPPNS_5TokenE
00000000 W _ZNKSt6__ndk16vectorIfNS_9allocatorIfEEE11__recommendB7v170000Ej
00000000 W _ZNKSt6__ndk16vectorIjNS_9allocatorIjEEE11__recommendB7v170000Ej
00000000 W _ZNSt6__ndk114__split_bufferIfRNS_9allocatorIfEEE17__destruct_at_endB7v170000EPfNS_17integral_constantIbLb0EEE
00000000 W _ZNSt6__ndk114__split_bufferIfRNS_9allocatorIfEEE5clearB7v170000Ev
00000000 W _ZNSt6__ndk114__split_bufferIfRNS_9allocatorIfEEED2Ev
00000000 W _ZNSt6__ndk114__split_bufferIjRNS_9allocatorIjEEE17__destruct_at_endB7v170000EPjNS_17integral_constantIbLb0EEE
00000000 W _ZNSt6__ndk114__split_bufferIjRNS_9allocatorIjEEE5clearB7v170000Ev
00000000 W _ZNSt6__ndk114__split_bufferIjRNS_9allocatorIjEEED2Ev
00000000 W _ZNSt6__ndk16vectorIfNS_9allocatorIfEEE16__destroy_vectorclB7v170000Ev
00000000 W _ZNSt6__ndk16vectorIfNS_9allocatorIfEEE21__push_back_slow_pathIRKfEEvOT_
00000000 W _ZNSt6__ndk16vectorIfNS_9allocatorIfEEE26__swap_out_circular_bufferERNS_14__split_bufferIfRS2_EE
00000000 W _ZNSt6__ndk16vectorIfNS_9allocatorIfEEE9push_backB7v170000ERKf
00000000 W _ZNSt6__ndk16vectorIfNS_9allocatorIfEEED2B7v170000Ev
00000000 W _ZNSt6__ndk16vectorIhNS_9allocatorIhEEE11__vallocateB7v170000Ej
00000000 W _ZNSt6__ndk16vectorIhNS_9allocatorIhEEE16__destroy_vectorclB7v170000Ev
00000000 W _ZNSt6__ndk16vectorIhNS_9allocatorIhEEE18__construct_at_endEj
00000000 W _ZNSt6__ndk16vectorIhNS_9allocatorIhEEEC2Ej
00000000 W _ZNSt6__ndk16vectorIhNS_9allocatorIhEEED2B7v170000Ev
00000000 W _ZNSt6__ndk16vectorIiNS_9allocatorIiEEE11__vallocateB7v170000Ej
00000000 W _ZNSt6__ndk16vectorIiNS_9allocatorIiEEE16__destroy_vectorclB7v170000Ev
00000000 W _ZNSt6__ndk16vectorIiNS_9allocatorIiEEE18__construct_at_endEj
00000000 W _ZNSt6__ndk16vectorIiNS_9allocatorIiEEEC2Ej
00000000 W _ZNSt6__ndk16vectorIiNS_9allocatorIiEEED2B7v170000Ev
00000000 W _ZNSt6__ndk16vectorIjNS_9allocatorIjEEE11__vallocateB7v170000Ej
00000000 W _ZNSt6__ndk16vectorIjNS_9allocatorIjEEE16__destroy_vectorclB7v170000Ev
00000000 W _ZNSt6__ndk16vectorIjNS_9allocatorIjEEE18__construct_at_endEj
00000000 W _ZNSt6__ndk16vectorIjNS_9allocatorIjEEE21__push_back_slow_pathIRKjEEvOT_
00000000 W _ZNSt6__ndk16vectorIjNS_9allocatorIjEEE26__swap_out_circular_bufferERNS_14__split_bufferIjRS2_EE
00000000 W _ZNSt6__ndk16vectorIjNS_9allocatorIjEEE6resizeEj
00000000 W _ZNSt6__ndk16vectorIjNS_9allocatorIjEEE8__appendEj
00000000 W _ZNSt6__ndk16vectorIjNS_9allocatorIjEEE9push_backB7v170000ERKj
00000000 W _ZNSt6__ndk16vectorIjNS_9allocatorIjEEEC2Ej
00000000 W _ZNSt6__ndk16vectorIjNS_9allocatorIjEEED2B7v170000Ev
00000000 W _ZNSt6__ndk19allocatorIfE8allocateB7v170000Ej
00000000 W _ZNSt6__ndk19allocatorIiE8allocateB7v170000Ej
00000000 W _ZNSt6__ndk19allocatorIjE8allocateB7v170000Ej
00000000 W _ZSt28__throw_bad_array_new_lengthB7v170000v
15_libjpegli_static_error.cc.o:
00000000 T _ZN6jpegli11EmitMessageEP18jpeg_common_structi
00000000 T _ZN6jpegli12FormatStringEPcPKcz
00000000 T _ZN6jpegli13ExitWithAbortEP18jpeg_common_struct
00000000 T _ZN6jpegli13FormatMessageEP18jpeg_common_structPc
00000000 T _ZN6jpegli13OutputMessageEP18jpeg_common_struct
00000000 T _ZN6jpegli17ResetErrorManagerEP18jpeg_common_struct
00000000 W _ZNKSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4findB7v170000EPKcj
00000000 W _ZNSt6__ndk110__str_findB7v170000IcjNS_11char_traitsIcEELj4294967295EEET0_PKT_S3_S6_S3_S3_
00000000 W _ZNSt6__ndk111char_traitsIcE4findEPKcjRS2_
00000000 W _ZNSt6__ndk111char_traitsIcE7compareEPKcS3_j
00000000 W _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v170000IDnEEPKc
00000000 W _ZNSt6__ndk118__search_substringB7v170000IcNS_11char_traitsIcEEEEPKT_S5_S5_S5_S5_
00000000 T jpegli_std_error
16_libjpegli_static_huffman.cc.o:
00000000 T _ZN6jpegli17CreateHuffmanTreeEPKjjiPh
00000000 T _ZN6jpegli20ValidateHuffmanTableEP18jpeg_common_structPK9JHUFF_TBLb
00000000 T _ZN6jpegli21BuildJpegHuffmanTableEPKjS1_PNS_17HuffmanTableEntryE
00000000 T _ZN6jpegli24AddStandardHuffmanTablesEP18jpeg_common_structb
00000000 T _ZN6jpegli8SetDepthERKNS_11HuffmanTreeEPS0_Phh
00000000 W _ZNKSt6__ndk16vectorIN6jpegli11HuffmanTreeENS_9allocatorIS2_EEE11__recommendB7v170000Ej
00000000 W _ZNSt6__ndk110__pop_heapB7v170000INS_17_ClassicAlgPolicyEPFbRKN6jpegli11HuffmanTreeES5_EPS3_EEvT1_S9_RT0_NS_15iterator_traitsIS9_E15difference_typeE
00000000 W _ZNSt6__ndk111__introsortINS_17_ClassicAlgPolicyERPFbRKN6jpegli11HuffmanTreeES5_EPS3_Lb0EEEvT1_SA_T0_NS_15iterator_traitsISA_E15difference_typeEb
00000000 W _ZNSt6__ndk111__make_heapB7v170000INS_17_ClassicAlgPolicyERPFbRKN6jpegli11HuffmanTreeES5_EPS3_EEvT1_SA_OT0_
00000000 W _ZNSt6__ndk111__sift_downB7v170000INS_17_ClassicAlgPolicyERPFbRKN6jpegli11HuffmanTreeES5_EPS3_EEvT1_OT0_NS_15iterator_traitsISA_E15difference_typeESA_
00000000 W _ZNSt6__ndk111__sort_heapB7v170000INS_17_ClassicAlgPolicyERPFbRKN6jpegli11HuffmanTreeES5_EPS3_EEvT1_SA_OT0_
00000000 W _ZNSt6__ndk111max_elementB7v170000IPhNS_6__lessIhhEEEET_S4_S4_T0_
00000000 W _ZNSt6__ndk113__max_elementB7v170000IRNS_6__lessIhhEEPhEET0_S5_S5_T_
00000000 W _ZNSt6__ndk114__partial_sortB7v170000INS_17_ClassicAlgPolicyERPFbRKN6jpegli11HuffmanTreeES5_EPS3_S9_EET1_SA_SA_T2_RT0_
00000000 W _ZNSt6__ndk114__split_bufferIN6jpegli11HuffmanTreeERNS_9allocatorIS2_EEE17__destruct_at_endB7v170000EPS2_NS_17integral_constantIbLb0EEE
00000000 W _ZNSt6__ndk114__split_bufferIN6jpegli11HuffmanTreeERNS_9allocatorIS2_EEE5clearB7v170000Ev
00000000 W _ZNSt6__ndk114__split_bufferIN6jpegli11HuffmanTreeERNS_9allocatorIS2_EEED2Ev
00000000 W _ZNSt6__ndk116__insertion_sortB7v170000INS_17_ClassicAlgPolicyERPFbRKN6jpegli11HuffmanTreeES5_EPS3_EEvT1_SA_T0_
00000000 W _ZNSt6__ndk117__floyd_sift_downB7v170000INS_17_ClassicAlgPolicyERPFbRKN6jpegli11HuffmanTreeES5_EPS3_EET1_SA_OT0_NS_15iterator_traitsISA_E15difference_typeE
00000000 W _ZNSt6__ndk119__partial_sort_implB7v170000INS_17_ClassicAlgPolicyERPFbRKN6jpegli11HuffmanTreeES5_EPS3_S9_EET1_SA_SA_T2_OT0_
00000000 W _ZNSt6__ndk126__insertion_sort_unguardedB7v170000INS_17_ClassicAlgPolicyERPFbRKN6jpegli11HuffmanTreeES5_EPS3_EEvT1_SA_T0_
00000000 W _ZNSt6__ndk127__insertion_sort_incompleteIRPFbRKN6jpegli11HuffmanTreeES4_EPS2_EEbT0_S9_T_
00000000 W _ZNSt6__ndk131__partition_with_equals_on_leftB7v170000INS_17_ClassicAlgPolicyEPN6jpegli11HuffmanTreeERPFbRKS3_S6_EEET0_SA_SA_T1_
00000000 W _ZNSt6__ndk132__partition_with_equals_on_rightB7v170000INS_17_ClassicAlgPolicyEPN6jpegli11HuffmanTreeERPFbRKS3_S6_EEENS_4pairIT0_bEESB_SB_T1_
00000000 W _ZNSt6__ndk16__sortIRPFbRKN6jpegli11HuffmanTreeES4_EPS2_EEvT0_S9_T_
00000000 W _ZNSt6__ndk16vectorIN6jpegli11HuffmanTreeENS_9allocatorIS2_EEE12emplace_backIJRKjisEEERS2_DpOT_
00000000 W _ZNSt6__ndk16vectorIN6jpegli11HuffmanTreeENS_9allocatorIS2_EEE16__destroy_vectorclB7v170000Ev
00000000 W _ZNSt6__ndk16vectorIN6jpegli11HuffmanTreeENS_9allocatorIS2_EEE21__push_back_slow_pathIRKS2_EEvOT_
00000000 W _ZNSt6__ndk16vectorIN6jpegli11HuffmanTreeENS_9allocatorIS2_EEE24__emplace_back_slow_pathIJRKjisEEEvDpOT_
00000000 W _ZNSt6__ndk16vectorIN6jpegli11HuffmanTreeENS_9allocatorIS2_EEE26__swap_out_circular_bufferERNS_14__split_bufferIS2_RS4_EE
00000000 W _ZNSt6__ndk16vectorIN6jpegli11HuffmanTreeENS_9allocatorIS2_EEE7reserveEj
00000000 W _ZNSt6__ndk16vectorIN6jpegli11HuffmanTreeENS_9allocatorIS2_EEE9push_backB7v170000ERKS2_
00000000 W _ZNSt6__ndk16vectorIN6jpegli11HuffmanTreeENS_9allocatorIS2_EEED2B7v170000Ev
00000000 W _ZNSt6__ndk17__sort3B7v170000INS_17_ClassicAlgPolicyERPFbRKN6jpegli11HuffmanTreeES5_EPS3_EEjT1_SA_SA_T0_
00000000 W _ZNSt6__ndk17__sort4B7v170000INS_17_ClassicAlgPolicyERPFbRKN6jpegli11HuffmanTreeES5_EPS3_EEjT1_SA_SA_SA_T0_
00000000 W _ZNSt6__ndk17__sort5IRPFbRKN6jpegli11HuffmanTreeES4_EPS2_EEjT0_S9_S9_S9_S9_T_
00000000 W _ZNSt6__ndk19__sift_upB7v170000INS_17_ClassicAlgPolicyERPFbRKN6jpegli11HuffmanTreeES5_EPS3_EEvT1_SA_OT0_NS_15iterator_traitsISA_E15difference_typeE
00000000 W _ZNSt6__ndk19allocatorIN6jpegli11HuffmanTreeEE8allocateB7v170000Ej
00000000 W _ZSt28__throw_bad_array_new_lengthB7v170000v
17_libjpegli_static_idct.cc.o:
00000000 T _ZN6jpegli22ChooseInverseTransformEP22jpeg_decompress_struct
00000000 W _ZN6jpegli6N_SSE210BTransposeILj4EEEvPf
00000000 W _ZN6jpegli6N_SSE210IDCT1DImplILj4EEclEPKfjPfj
00000000 W _ZN6jpegli6N_SSE210IDCT1DImplILj8EEclEPKfjPfj
00000000 T _ZN6jpegli6N_SSE212DequantBlockEPKsPKfS4_Pf
00000000 T _ZN6jpegli6N_SSE213Compute1dIDCTEPKfPfj
00000000 V _ZN6jpegli6N_SSE213WcMultipliersILj4EE12kMultipliersE
00000000 V _ZN6jpegli6N_SSE213WcMultipliersILj8EE12kMultipliersE
00000000 W _ZN6jpegli6N_SSE214ForwardEvenOddILj8EEEvPKfjPf
00000000 W _ZN6jpegli6N_SSE214MultiplyAndAddILj4EEEvPKfPfj
00000000 W _ZN6jpegli6N_SSE214MultiplyAndAddILj8EEEvPKfPfj
00000000 T _ZN6jpegli6N_SSE217ComputeScaledIDCTEPfS1_S1_j
00000000 T _ZN6jpegli6N_SSE224InverseTransformBlock8x8EPKsPKfS4_PfS5_jj
00000000 T _ZN6jpegli6N_SSE228InverseTransformBlockGenericEPKsPKfS4_PfS5_jj
00000000 W _ZN6jpegli6N_SSE26IDCT1DILj8EEEvPfS2_j
00000000 W _ZN6jpegli6N_SSE410BTransposeILj4EEEvPf
00000000 W _ZN6jpegli6N_SSE410IDCT1DImplILj4EEclEPKfjPfj
00000000 W _ZN6jpegli6N_SSE410IDCT1DImplILj8EEclEPKfjPfj
00000000 T _ZN6jpegli6N_SSE412DequantBlockEPKsPKfS4_Pf
00000000 T _ZN6jpegli6N_SSE413Compute1dIDCTEPKfPfj
00000000 V _ZN6jpegli6N_SSE413WcMultipliersILj4EE12kMultipliersE
00000000 V _ZN6jpegli6N_SSE413WcMultipliersILj8EE12kMultipliersE
00000000 W _ZN6jpegli6N_SSE414ForwardEvenOddILj8EEEvPKfjPf
00000000 W _ZN6jpegli6N_SSE414MultiplyAndAddILj4EEEvPKfPfj
00000000 W _ZN6jpegli6N_SSE414MultiplyAndAddILj8EEEvPKfPfj
00000000 T _ZN6jpegli6N_SSE417ComputeScaledIDCTEPfS1_S1_j
00000000 T _ZN6jpegli6N_SSE424InverseTransformBlock8x8EPKsPKfS4_PfS5_jj
00000000 T _ZN6jpegli6N_SSE428InverseTransformBlockGenericEPKsPKfS4_PfS5_jj
00000000 W _ZN6jpegli6N_SSE46IDCT1DILj8EEEvPfS2_j
18_libjpegli_static_input.cc.o:
00000000 T _ZN6jpegli17ChooseInputMethodEP20jpeg_compress_struct
00000000 W _ZN6jpegli6N_SSE212ReadFloatRowILj1ELb0EEEvPKhjjPPf
00000000 W _ZN6jpegli6N_SSE212ReadFloatRowILj1ELb1EEEvPKhjjPPf
00000000 W _ZN6jpegli6N_SSE212ReadFloatRowILj2ELb0EEEvPKhjjPPf
00000000 W _ZN6jpegli6N_SSE212ReadFloatRowILj2ELb1EEEvPKhjjPPf
00000000 W _ZN6jpegli6N_SSE212ReadFloatRowILj3ELb0EEEvPKhjjPPf
00000000 W _ZN6jpegli6N_SSE212ReadFloatRowILj3ELb1EEEvPKhjjPPf
00000000 W _ZN6jpegli6N_SSE212ReadFloatRowILj4ELb0EEEvPKhjjPPf
00000000 W _ZN6jpegli6N_SSE212ReadFloatRowILj4ELb1EEEvPKhjjPPf
00000000 W _ZN6jpegli6N_SSE212ReadUint8RowILj1EEEvPKhjjPPf
00000000 W _ZN6jpegli6N_SSE212ReadUint8RowILj2EEEvPKhjjPPf
00000000 W _ZN6jpegli6N_SSE212ReadUint8RowILj3EEEvPKhjjPPf
00000000 W _ZN6jpegli6N_SSE212ReadUint8RowILj4EEEvPKhjjPPf
00000000 W _ZN6jpegli6N_SSE213ReadUint16RowILj1ELb0EEEvPKhjjPPf
00000000 W _ZN6jpegli6N_SSE213ReadUint16RowILj1ELb1EEEvPKhjjPPf
00000000 W _ZN6jpegli6N_SSE213ReadUint16RowILj2ELb0EEEvPKhjjPPf
00000000 W _ZN6jpegli6N_SSE213ReadUint16RowILj2ELb1EEEvPKhjjPPf
00000000 W _ZN6jpegli6N_SSE213ReadUint16RowILj3ELb0EEEvPKhjjPPf
00000000 W _ZN6jpegli6N_SSE213ReadUint16RowILj3ELb1EEEvPKhjjPPf
00000000 W _ZN6jpegli6N_SSE213ReadUint16RowILj4ELb0EEEvPKhjjPPf
00000000 W _ZN6jpegli6N_SSE213ReadUint16RowILj4ELb1EEEvPKhjjPPf
00000000 T _ZN6jpegli6N_SSE218ReadFloatRowSingleEPKhjPPf
00000000 T _ZN6jpegli6N_SSE218ReadUint8RowSingleEPKhjPPf
00000000 T _ZN6jpegli6N_SSE219ReadUint16RowSingleEPKhjPPf
00000000 T _ZN6jpegli6N_SSE222ReadFloatRowSingleSwapEPKhjPPf
00000000 T _ZN6jpegli6N_SSE223ReadUint16RowSingleSwapEPKhjPPf
00000000 T _ZN6jpegli6N_SSE224ReadFloatRowInterleaved2EPKhjPPf
00000000 T _ZN6jpegli6N_SSE224ReadFloatRowInterleaved3EPKhjPPf
00000000 T _ZN6jpegli6N_SSE224ReadFloatRowInterleaved4EPKhjPPf
00000000 T _ZN6jpegli6N_SSE224ReadUint8RowInterleaved2EPKhjPPf
00000000 T _ZN6jpegli6N_SSE224ReadUint8RowInterleaved3EPKhjPPf
00000000 T _ZN6jpegli6N_SSE224ReadUint8RowInterleaved4EPKhjPPf
00000000 T _ZN6jpegli6N_SSE225ReadUint16RowInterleaved2EPKhjPPf
00000000 T _ZN6jpegli6N_SSE225ReadUint16RowInterleaved3EPKhjPPf
00000000 T _ZN6jpegli6N_SSE225ReadUint16RowInterleaved4EPKhjPPf
00000000 T _ZN6jpegli6N_SSE228ReadFloatRowInterleaved2SwapEPKhjPPf
00000000 T _ZN6jpegli6N_SSE228ReadFloatRowInterleaved3SwapEPKhjPPf
00000000 T _ZN6jpegli6N_SSE228ReadFloatRowInterleaved4SwapEPKhjPPf
00000000 T _ZN6jpegli6N_SSE229ReadUint16RowInterleaved2SwapEPKhjPPf
00000000 T _ZN6jpegli6N_SSE229ReadUint16RowInterleaved3SwapEPKhjPPf
00000000 T _ZN6jpegli6N_SSE229ReadUint16RowInterleaved4SwapEPKhjPPf
00000000 W _ZN6jpegli6N_SSE412ReadFloatRowILj1ELb0EEEvPKhjjPPf
00000000 W _ZN6jpegli6N_SSE412ReadFloatRowILj1ELb1EEEvPKhjjPPf
00000000 W _ZN6jpegli6N_SSE412ReadFloatRowILj2ELb0EEEvPKhjjPPf
00000000 W _ZN6jpegli6N_SSE412ReadFloatRowILj2ELb1EEEvPKhjjPPf
00000000 W _ZN6jpegli6N_SSE412ReadFloatRowILj3ELb0EEEvPKhjjPPf
00000000 W _ZN6jpegli6N_SSE412ReadFloatRowILj3ELb1EEEvPKhjjPPf
00000000 W _ZN6jpegli6N_SSE412ReadFloatRowILj4ELb0EEEvPKhjjPPf
00000000 W _ZN6jpegli6N_SSE412ReadFloatRowILj4ELb1EEEvPKhjjPPf
00000000 W _ZN6jpegli6N_SSE412ReadUint8RowILj1EEEvPKhjjPPf
00000000 W _ZN6jpegli6N_SSE412ReadUint8RowILj2EEEvPKhjjPPf
00000000 W _ZN6jpegli6N_SSE412ReadUint8RowILj3EEEvPKhjjPPf
00000000 W _ZN6jpegli6N_SSE412ReadUint8RowILj4EEEvPKhjjPPf
00000000 W _ZN6jpegli6N_SSE413ReadUint16RowILj1ELb0EEEvPKhjjPPf
00000000 W _ZN6jpegli6N_SSE413ReadUint16RowILj1ELb1EEEvPKhjjPPf
00000000 W _ZN6jpegli6N_SSE413ReadUint16RowILj2ELb0EEEvPKhjjPPf
00000000 W _ZN6jpegli6N_SSE413ReadUint16RowILj2ELb1EEEvPKhjjPPf
00000000 W _ZN6jpegli6N_SSE413ReadUint16RowILj3ELb0EEEvPKhjjPPf
00000000 W _ZN6jpegli6N_SSE413ReadUint16RowILj3ELb1EEEvPKhjjPPf
00000000 W _ZN6jpegli6N_SSE413ReadUint16RowILj4ELb0EEEvPKhjjPPf
00000000 W _ZN6jpegli6N_SSE413ReadUint16RowILj4ELb1EEEvPKhjjPPf
00000000 T _ZN6jpegli6N_SSE418ReadFloatRowSingleEPKhjPPf
00000000 T _ZN6jpegli6N_SSE418ReadUint8RowSingleEPKhjPPf
00000000 T _ZN6jpegli6N_SSE419ReadUint16RowSingleEPKhjPPf
00000000 T _ZN6jpegli6N_SSE422ReadFloatRowSingleSwapEPKhjPPf
00000000 T _ZN6jpegli6N_SSE423ReadUint16RowSingleSwapEPKhjPPf
00000000 T _ZN6jpegli6N_SSE424ReadFloatRowInterleaved2EPKhjPPf
00000000 T _ZN6jpegli6N_SSE424ReadFloatRowInterleaved3EPKhjPPf
00000000 T _ZN6jpegli6N_SSE424ReadFloatRowInterleaved4EPKhjPPf
00000000 T _ZN6jpegli6N_SSE424ReadUint8RowInterleaved2EPKhjPPf
00000000 T _ZN6jpegli6N_SSE424ReadUint8RowInterleaved3EPKhjPPf
00000000 T _ZN6jpegli6N_SSE424ReadUint8RowInterleaved4EPKhjPPf
00000000 T _ZN6jpegli6N_SSE425ReadUint16RowInterleaved2EPKhjPPf
00000000 T _ZN6jpegli6N_SSE425ReadUint16RowInterleaved3EPKhjPPf
00000000 T _ZN6jpegli6N_SSE425ReadUint16RowInterleaved4EPKhjPPf
00000000 T _ZN6jpegli6N_SSE428ReadFloatRowInterleaved2SwapEPKhjPPf
00000000 T _ZN6jpegli6N_SSE428ReadFloatRowInterleaved3SwapEPKhjPPf
00000000 T _ZN6jpegli6N_SSE428ReadFloatRowInterleaved4SwapEPKhjPPf
00000000 T _ZN6jpegli6N_SSE429ReadUint16RowInterleaved2SwapEPKhjPPf
00000000 T _ZN6jpegli6N_SSE429ReadUint16RowInterleaved3SwapEPKhjPPf
00000000 T _ZN6jpegli6N_SSE429ReadUint16RowInterleaved4SwapEPKhjPPf
19_libjpegli_static_memory_manager.cc.o:
00000000 T _ZN6jpegli17InitMemoryManagerEP18jpeg_common_struct
00000000 W _ZNKSt6__ndk16vectorIPvNS_9allocatorIS1_EEE11__recommendB7v170000Ej
00000000 W _ZNSt6__ndk114__split_bufferIPvRNS_9allocatorIS1_EEE17__destruct_at_endB7v170000EPS1_NS_17integral_constantIbLb0EEE
00000000 W _ZNSt6__ndk114__split_bufferIPvRNS_9allocatorIS1_EEE5clearB7v170000Ev
00000000 W _ZNSt6__ndk114__split_bufferIPvRNS_9allocatorIS1_EEED2Ev
00000000 W _ZNSt6__ndk16vectorIPvNS_9allocatorIS1_EEE16__destroy_vectorclB7v170000Ev
00000000 W _ZNSt6__ndk16vectorIPvNS_9allocatorIS1_EEE21__push_back_slow_pathIRKS1_EEvOT_
00000000 W _ZNSt6__ndk16vectorIPvNS_9allocatorIS1_EEE26__swap_out_circular_bufferERNS_14__split_bufferIS1_RS3_EE
00000000 W _ZNSt6__ndk16vectorIPvNS_9allocatorIS1_EEE9push_backB7v170000ERKS1_
00000000 W _ZNSt6__ndk16vectorIPvNS_9allocatorIS1_EEED2B7v170000Ev
00000000 W _ZNSt6__ndk19allocatorIPvE8allocateB7v170000Ej
00000000 W _ZSt28__throw_bad_array_new_lengthB7v170000v
1_libjpegli_static_bitstream.cc.o:
00000000 T _ZN6jpegli10EncodeAPP0EP20jpeg_compress_struct
00000000 T _ZN6jpegli10WriteBlockEPKiS1_ibPKNS_16HuffmanCodeTableES4_PNS_13JpegBitWriterE
00000000 T _ZN6jpegli11EncodeAPP14EP20jpeg_compress_struct
00000000 T _ZN6jpegli11WriteOutputEP20jpeg_compress_structPKhj
00000000 T _ZN6jpegli11WriteOutputEP20jpeg_compress_structRKNSt6__ndk16vectorIhNS2_9allocatorIhEEEE
00000000 T _ZN6jpegli11WriteOutputEP20jpeg_compress_structSt16initializer_listIhE
00000000 T _ZN6jpegli13WriteScanDataEP20jpeg_compress_structi
00000000 T _ZN6jpegli15WriteFileHeaderEP20jpeg_compress_struct
00000000 T _ZN6jpegli15WriteScanHeaderEP20jpeg_compress_structi
00000000 T _ZN6jpegli16WriteFrameHeaderEP20jpeg_compress_struct
00000000 T _ZN6jpegli9EncodeDHTEP20jpeg_compress_structjj
00000000 T _ZN6jpegli9EncodeDQTEP20jpeg_compress_structb
00000000 T _ZN6jpegli9EncodeDRIEP20jpeg_compress_struct
00000000 T _ZN6jpegli9EncodeSOFEP20jpeg_compress_structb
00000000 T _ZN6jpegli9EncodeSOSEP20jpeg_compress_structi
00000000 W _ZNSt6__ndk16vectorIhNS_9allocatorIhEEE11__vallocateB7v170000Ej
00000000 W _ZNSt6__ndk16vectorIhNS_9allocatorIhEEE16__destroy_vectorclB7v170000Ev
00000000 W _ZNSt6__ndk16vectorIhNS_9allocatorIhEEE18__construct_at_endEj
00000000 W _ZNSt6__ndk16vectorIhNS_9allocatorIhEEEC2Ej
00000000 W _ZNSt6__ndk16vectorIhNS_9allocatorIhEEED2B7v170000Ev
20_libjpegli_static_quant.cc.o:
00000000 T _ZN6jpegli13InitQuantizerEP20jpeg_compress_structNS_9QuantPassE
00000000 T _ZN6jpegli16SetQuantMatricesEP20jpeg_compress_structPfb
21_libjpegli_static_render.cc.o:
00000000 T _ZN6jpegli11DecenterRowEPfj
00000000 T _ZN6jpegli12do_smoothingEP22jpeg_decompress_struct
00000000 T _ZN6jpegli13PredictSmoothEP22jpeg_decompress_structPPA64_siji
00000000 T _ZN6jpegli13ProcessOutputEP22jpeg_decompress_structPjPPhj
00000000 T _ZN6jpegli13WriteToOutputEP22jpeg_decompress_structPrPfjjjPh
00000000 T _ZN6jpegli16GatherBlockStatsEPKsjPiS2_
00000000 T _ZN6jpegli16PrepareForOutputEP22jpeg_decompress_struct
00000000 T _ZN6jpegli16ProcessRawOutputEP22jpeg_decompress_structPPPh
00000000 T _ZN6jpegli20DecodeCurrentiMCURowEP22jpeg_decompress_struct
00000000 T _ZN6jpegli21is_nonzero_quantizersEPK10JQUANT_TBL
00000000 T _ZN6jpegli24ShouldApplyDequantBiasesEP22jpeg_decompress_structi
00000000 T _ZN6jpegli29ComputeOptimalLaplacianBiasesEiPKiS1_Pf
00000000 T _ZN6jpegli6N_SSE210LimitErrorEf
00000000 T _ZN6jpegli6N_SSE211DecenterRowEPfj
00000000 T _ZN6jpegli6N_SSE213StoreFloatRowEPrPfjjjS1_
00000000 T _ZN6jpegli6N_SSE213WriteToOutputEP22jpeg_decompress_structPrPfjjjPh
00000000 T _ZN6jpegli6N_SSE216GatherBlockStatsEPKsjPiS3_
00000000 W _ZN6jpegli6N_SSE216StoreUnsignedRowIhEEvPrPfjjjfPT_
00000000 W _ZN6jpegli6N_SSE216StoreUnsignedRowItEEvPrPfjjjfPT_
00000000 T _ZN6jpegli6N_SSE29DitherRowEP22jpeg_decompress_structPfijj
00000000 T _ZN6jpegli6N_SSE410LimitErrorEf
00000000 T _ZN6jpegli6N_SSE411DecenterRowEPfj
00000000 T _ZN6jpegli6N_SSE413StoreFloatRowEPrPfjjjS1_
00000000 T _ZN6jpegli6N_SSE413WriteToOutputEP22jpeg_decompress_structPrPfjjjPh
00000000 T _ZN6jpegli6N_SSE416GatherBlockStatsEPKsjPiS3_
00000000 W _ZN6jpegli6N_SSE416StoreUnsignedRowIhEEvPrPfjjjfPT_
00000000 W _ZN6jpegli6N_SSE416StoreUnsignedRowItEEvPrPfjjjfPT_
00000000 T _ZN6jpegli6N_SSE49DitherRowEP22jpeg_decompress_structPfijj
00000000 W _ZNSt6__ndk16vectorIiNS_9allocatorIiEEE11__vallocateB7v170000Ej
00000000 W _ZNSt6__ndk16vectorIiNS_9allocatorIiEEE16__destroy_vectorclB7v170000Ev
00000000 W _ZNSt6__ndk16vectorIiNS_9allocatorIiEEE18__construct_at_endEj
00000000 W _ZNSt6__ndk16vectorIiNS_9allocatorIiEEEC2Ej
00000000 W _ZNSt6__ndk16vectorIiNS_9allocatorIiEEED2B7v170000Ev
00000000 W _ZNSt6__ndk19allocatorIiE8allocateB7v170000Ej
00000000 W _ZSt28__throw_bad_array_new_lengthB7v170000v
22_libjpegli_static_simd.cc.o:
00000000 T _ZN6jpegli10VectorSizeEv
00000000 T _ZN6jpegli6N_SSE213GetVectorSizeEv
00000000 T _ZN6jpegli6N_SSE413GetVectorSizeEv
23_libjpegli_static_source_manager.cc.o:
00000000 T _ZN6jpegli11term_sourceEP22jpeg_decompress_struct
00000000 T _ZN6jpegli15init_mem_sourceEP22jpeg_decompress_struct
00000000 T _ZN6jpegli15skip_input_dataEP22jpeg_decompress_structl
00000000 T _ZN6jpegli17EmitFakeEoiMarkerEP22jpeg_decompress_struct
00000000 T _ZN6jpegli17init_stdio_sourceEP22jpeg_decompress_struct
00000000 W _ZN6jpegli18StdioSourceManager17fill_input_bufferEP22jpeg_decompress_struct
00000000 T jpegli_mem_src
00000000 T jpegli_stdio_src
24_libjpegli_static_upsample.cc.o:
00000000 T _ZN6jpegli17Upsample2VerticalEPKfS1_S1_PfS2_j
00000000 T _ZN6jpegli19Upsample2HorizontalEPfS0_j
00000000 T _ZN6jpegli6N_SSE217Upsample2VerticalEPKfS2_S2_PfS3_j
00000000 T _ZN6jpegli6N_SSE219Upsample2HorizontalEPfS1_j
00000000 T _ZN6jpegli6N_SSE417Upsample2VerticalEPKfS2_S2_PfS3_j
00000000 T _ZN6jpegli6N_SSE419Upsample2HorizontalEPfS1_j
25_libhwy_abort.cc.o:
00000000 T _ZN3hwy11GetWarnFuncEv
00000000 T _ZN3hwy11SetWarnFuncEPFvPKciS1_E
00000000 T _ZN3hwy12GetAbortFuncEv
00000000 T _ZN3hwy12SetAbortFuncEPFvPKciS1_E
00000000 T _ZN3hwy4WarnEPKciS1_z
00000000 T _ZN3hwy5AbortEPKciS1_z
00000000 W _ZNKSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE12find_last_ofB7v170000EPKcj
00000000 W _ZNKSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6substrB7v170000Ejj
00000000 W _ZNSt6__ndk111char_traitsIcE4findEPKcjRS2_
00000000 W _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v170000IDnEEPKc
00000000 W _ZNSt6__ndk118__str_find_last_ofB7v170000IcjNS_11char_traitsIcEELj4294967295EEET0_PKT_S3_S6_S3_S3_
26_libhwy_aligned_allocator.cc.o:
00000000 T _ZN3hwy14AlignedDeleter18DeleteAlignedArrayEPvPFvS1_S1_ES1_PFvS1_jE
00000000 T _ZN3hwy16FreeAlignedBytesEPKvPFvPvS2_ES2_
00000000 T _ZN3hwy20AllocateAlignedBytesEjPFPvS0_jES0_
27_libhwy_nanobenchmark.cc.o:
00000000 T _ZN3hwy14Unpredictable1Ev
00000000 W _ZN3hwy17robust_statistics12CountingSortIyEEvPT_j
00000000 W _ZN3hwy17robust_statistics12ModeOfSortedIyEET_PKS2_j
00000000 W _ZN3hwy17robust_statistics23MedianAbsoluteDeviationIyEET_PKS2_jS2_
00000000 W _ZN3hwy17robust_statistics4ModeIyEET_PS2_j
00000000 W _ZN3hwy17robust_statistics6MedianIyEET_PS2_j
00000000 W _ZN3hwy17robust_statistics8MinRangeIyEEjPKT_jj
00000000 T _ZN3hwy7MeasureEPFyPKvjEPKhPKjjPNS_6ResultERKNS_6ParamsE
00000000 W _ZNKSt6__ndk16vectorINS_4pairIyiEENS_9allocatorIS2_EEE11__recommendB7v170000Ej
00000000 W _ZNKSt6__ndk16vectorIjNS_9allocatorIjEEE11__recommendB7v170000Ej
00000000 W _ZNKSt6__ndk16vectorIyNS_9allocatorIyEEE11__recommendB7v170000Ej
00000000 W _ZNSt6__ndk110__pop_heapB7v170000INS_17_ClassicAlgPolicyENS_6__lessINS_4pairIyiEES4_EEPS4_EEvT1_S7_RT0_NS_15iterator_traitsIS7_E15difference_typeE
00000000 W _ZNSt6__ndk111__introsortINS_17_ClassicAlgPolicyERNS_6__lessINS_4pairIyiEES4_EEPS4_Lb0EEEvT1_S8_T0_NS_15iterator_traitsIS8_E15difference_typeEb
00000000 W _ZNSt6__ndk111__make_heapB7v170000INS_17_ClassicAlgPolicyERNS_6__lessINS_4pairIyiEES4_EEPS4_EEvT1_S8_OT0_
00000000 W _ZNSt6__ndk111__sift_downB7v170000INS_17_ClassicAlgPolicyERNS_6__lessINS_4pairIyiEES4_EEPS4_EEvT1_OT0_NS_15iterator_traitsIS8_E15difference_typeES8_
00000000 W _ZNSt6__ndk111__sort_heapB7v170000INS_17_ClassicAlgPolicyERNS_6__lessINS_4pairIyiEES4_EEPS4_EEvT1_S8_OT0_
00000000 W _ZNSt6__ndk114__partial_sortB7v170000INS_17_ClassicAlgPolicyERNS_6__lessINS_4pairIyiEES4_EEPS4_S7_EET1_S8_S8_T2_RT0_
00000000 W _ZNSt6__ndk114__split_bufferINS_4pairIyiEERNS_9allocatorIS2_EEE17__destruct_at_endB7v170000EPS2_NS_17integral_constantIbLb0EEE
00000000 W _ZNSt6__ndk114__split_bufferINS_4pairIyiEERNS_9allocatorIS2_EEE5clearB7v170000Ev
00000000 W _ZNSt6__ndk114__split_bufferINS_4pairIyiEERNS_9allocatorIS2_EEEC2EjjS5_
00000000 W _ZNSt6__ndk114__split_bufferINS_4pairIyiEERNS_9allocatorIS2_EEED2Ev
00000000 W _ZNSt6__ndk114__split_bufferIjRNS_9allocatorIjEEE17__destruct_at_endB7v170000EPjNS_17integral_constantIbLb0EEE
00000000 W _ZNSt6__ndk114__split_bufferIjRNS_9allocatorIjEEE18__construct_at_endIPKjEENS_9enable_ifIXsr27__is_cpp17_forward_iteratorIT_EE5valueEvE4typeES9_S9_
00000000 W _ZNSt6__ndk114__split_bufferIjRNS_9allocatorIjEEE5clearB7v170000Ev
00000000 W _ZNSt6__ndk114__split_bufferIjRNS_9allocatorIjEEED2Ev
00000000 W _ZNSt6__ndk114__split_bufferIyRNS_9allocatorIyEEE17__destruct_at_endB7v170000EPyNS_17integral_constantIbLb0EEE
00000000 W _ZNSt6__ndk114__split_bufferIyRNS_9allocatorIyEEE5clearB7v170000Ev
00000000 W _ZNSt6__ndk114__split_bufferIyRNS_9allocatorIyEEED2Ev
00000000 W _ZNSt6__ndk115__adjacent_findB7v170000INS_11__wrap_iterIPjEES3_RNS_10__equal_toEEET_S6_T0_OT1_
00000000 W _ZNSt6__ndk116__insertion_sortB7v170000INS_17_ClassicAlgPolicyERNS_6__lessINS_4pairIyiEES4_EEPS4_EEvT1_S8_T0_
00000000 W _ZNSt6__ndk117__floyd_sift_downB7v170000INS_17_ClassicAlgPolicyERNS_6__lessINS_4pairIyiEES4_EEPS4_EET1_S8_OT0_NS_15iterator_traitsIS8_E15difference_typeE
00000000 W _ZNSt6__ndk119__partial_sort_implB7v170000INS_17_ClassicAlgPolicyERNS_6__lessINS_4pairIyiEES4_EEPS4_S7_EET1_S8_S8_T2_OT0_
00000000 W _ZNSt6__ndk123mersenne_twister_engineIjLj32ELj624ELj397ELj31ELj2567483615ELj11ELj4294967295ELj7ELj2636928640ELj15ELj4022730752ELj18ELj1812433253EE4seedEj
00000000 W _ZNSt6__ndk123mersenne_twister_engineIjLj32ELj624ELj397ELj31ELj2567483615ELj11ELj4294967295ELj7ELj2636928640ELj15ELj4022730752ELj18ELj1812433253EEC2B7v170000Ev
00000000 W _ZNSt6__ndk123mersenne_twister_engineIjLj32ELj624ELj397ELj31ELj2567483615ELj11ELj4294967295ELj7ELj2636928640ELj15ELj4022730752ELj18ELj1812433253EEclEv
00000000 W _ZNSt6__ndk124uniform_int_distributionIiEclINS_23mersenne_twister_engineIjLj32ELj624ELj397ELj31ELj2567483615ELj11ELj4294967295ELj7ELj2636928640ELj15ELj4022730752ELj18ELj1812433253EEEEEiRT_RKNS1_10param_typeE
00000000 W _ZNSt6__ndk125__independent_bits_engineINS_23mersenne_twister_engineIjLj32ELj624ELj397ELj31ELj2567483615ELj11ELj4294967295ELj7ELj2636928640ELj15ELj4022730752ELj18ELj1812433253EEEjE6__evalENS_17integral_constantIbLb0EEE
00000000 W _ZNSt6__ndk125__independent_bits_engineINS_23mersenne_twister_engineIjLj32ELj624ELj397ELj31ELj2567483615ELj11ELj4294967295ELj7ELj2636928640ELj15ELj4022730752ELj18ELj1812433253EEEjEC2ERS2_j
00000000 W _ZNSt6__ndk126__insertion_sort_unguardedB7v170000INS_17_ClassicAlgPolicyERNS_6__lessINS_4pairIyiEES4_EEPS4_EEvT1_S8_T0_
00000000 W _ZNSt6__ndk127__insertion_sort_incompleteIRNS_6__lessINS_4pairIyiEES3_EEPS3_EEbT0_S7_T_
00000000 W _ZNSt6__ndk131__partition_with_equals_on_leftB7v170000INS_17_ClassicAlgPolicyEPNS_4pairIyiEERNS_6__lessIS3_S3_EEEET0_S8_S8_T1_
00000000 W _ZNSt6__ndk132__partition_with_equals_on_rightB7v170000INS_17_ClassicAlgPolicyEPNS_4pairIyiEERNS_6__lessIS3_S3_EEEENS2_IT0_bEES8_S8_T1_
00000000 W _ZNSt6__ndk14sortB7v170000IPyNS_6__lessIyyEEEEvT_S4_T0_
00000000 W _ZNSt6__ndk16__fillB7v170000IPyyEEvT_S2_RKT0_NS_26random_access_iterator_tagE
00000000 W _ZNSt6__ndk16__sortIRNS_6__lessINS_4pairIyiEES3_EEPS3_EEvT0_S7_T_
00000000 W _ZNSt6__ndk16uniqueB7v170000INS_11__wrap_iterIPjEEEET_S4_S4_
00000000 W _ZNSt6__ndk16uniqueB7v170000INS_11__wrap_iterIPjEENS_10__equal_toEEET_S5_S5_T0_
00000000 W _ZNSt6__ndk16vectorINS_4pairIyiEENS_9allocatorIS2_EEE16__destroy_vectorclB7v170000Ev
00000000 W _ZNSt6__ndk16vectorINS_4pairIyiEENS_9allocatorIS2_EEE21__push_back_slow_pathIS2_EEvOT_
00000000 W _ZNSt6__ndk16vectorINS_4pairIyiEENS_9allocatorIS2_EEE26__swap_out_circular_bufferERNS_14__split_bufferIS2_RS4_EE
00000000 W _ZNSt6__ndk16vectorINS_4pairIyiEENS_9allocatorIS2_EEE9push_backB7v170000EOS2_
00000000 W _ZNSt6__ndk16vectorINS_4pairIyiEENS_9allocatorIS2_EEED2B7v170000Ev
00000000 W _ZNSt6__ndk16vectorIjNS_9allocatorIjEEE11__vallocateB7v170000Ej
00000000 W _ZNSt6__ndk16vectorIjNS_9allocatorIjEEE12__move_rangeEPjS4_S4_
00000000 W _ZNSt6__ndk16vectorIjNS_9allocatorIjEEE13__vdeallocateEv
00000000 W _ZNSt6__ndk16vectorIjNS_9allocatorIjEEE16__destroy_vectorclB7v170000Ev
00000000 W _ZNSt6__ndk16vectorIjNS_9allocatorIjEEE18__construct_at_endEj
00000000 W _ZNSt6__ndk16vectorIjNS_9allocatorIjEEE18__construct_at_endEjRKj
00000000 W _ZNSt6__ndk16vectorIjNS_9allocatorIjEEE26__swap_out_circular_bufferERNS_14__split_bufferIjRS2_EE
00000000 W _ZNSt6__ndk16vectorIjNS_9allocatorIjEEE26__swap_out_circular_bufferERNS_14__split_bufferIjRS2_EEPj
00000000 W _ZNSt6__ndk16vectorIjNS_9allocatorIjEEE6assignEjRKj
00000000 W _ZNSt6__ndk16vectorIjNS_9allocatorIjEEE6insertIPKjLi0EEENS_11__wrap_iterIPjEENS7_IS6_EET_SB_
00000000 W _ZNSt6__ndk16vectorIjNS_9allocatorIjEEE6resizeEj
00000000 W _ZNSt6__ndk16vectorIjNS_9allocatorIjEEE7reserveEj
00000000 W _ZNSt6__ndk16vectorIjNS_9allocatorIjEEE8__appendEj
00000000 W _ZNSt6__ndk16vectorIjNS_9allocatorIjEEEC2Ej
00000000 W _ZNSt6__ndk16vectorIjNS_9allocatorIjEEEC2IPKjLi0EEET_S7_
00000000 W _ZNSt6__ndk16vectorIjNS_9allocatorIjEEED2B7v170000Ev
00000000 W _ZNSt6__ndk16vectorIyNS_9allocatorIyEEE16__destroy_vectorclB7v170000Ev
00000000 W _ZNSt6__ndk16vectorIyNS_9allocatorIyEEE21__push_back_slow_pathIRKyEEvOT_
00000000 W _ZNSt6__ndk16vectorIyNS_9allocatorIyEEE21__push_back_slow_pathIyEEvOT_
00000000 W _ZNSt6__ndk16vectorIyNS_9allocatorIyEEE26__swap_out_circular_bufferERNS_14__split_bufferIyRS2_EE
00000000 W _ZNSt6__ndk16vectorIyNS_9allocatorIyEEE7reserveEj
00000000 W _ZNSt6__ndk16vectorIyNS_9allocatorIyEEE9push_backB7v170000EOy
00000000 W _ZNSt6__ndk16vectorIyNS_9allocatorIyEEE9push_backB7v170000ERKy
00000000 W _ZNSt6__ndk16vectorIyNS_9allocatorIyEEED2B7v170000Ev
00000000 W _ZNSt6__ndk17__sort3B7v170000INS_17_ClassicAlgPolicyERNS_6__lessINS_4pairIyiEES4_EEPS4_EEjT1_S8_S8_T0_
00000000 W _ZNSt6__ndk17__sort4B7v170000INS_17_ClassicAlgPolicyERNS_6__lessINS_4pairIyiEES4_EEPS4_EEjT1_S8_S8_S8_T0_
00000000 W _ZNSt6__ndk17__sort5IRNS_6__lessINS_4pairIyiEES3_EEPS3_EEjT0_S7_S7_S7_S7_T_
00000000 W _ZNSt6__ndk17shuffleB7v170000INS_11__wrap_iterIPjEERNS_23mersenne_twister_engineIjLj32ELj624ELj397ELj31ELj2567483615ELj11ELj4294967295ELj7ELj2636928640ELj15ELj4022730752ELj18ELj1812433253EEEEEvT_S7_OT0_
00000000 W _ZNSt6__ndk18__fill_nB7v170000IPjjjEET_S2_T0_RKT1_
00000000 W _ZNSt6__ndk18__fill_nB7v170000IPyiyEET_S2_T0_RKT1_
00000000 W _ZNSt6__ndk18__uniqueB7v170000INS_17_ClassicAlgPolicyENS_11__wrap_iterIPjEES4_RNS_10__equal_toEEENS_4pairIT0_S8_EES8_T1_OT2_
00000000 W _ZNSt6__ndk19__shuffleB7v170000INS_17_ClassicAlgPolicyENS_11__wrap_iterIPjEES4_RNS_23mersenne_twister_engineIjLj32ELj624ELj397ELj31ELj2567483615ELj11ELj4294967295ELj7ELj2636928640ELj15ELj4022730752ELj18ELj1812433253EEEEET0_S8_T1_OT2_
00000000 W _ZNSt6__ndk19__sift_upB7v170000INS_17_ClassicAlgPolicyERNS_6__lessINS_4pairIyiEES4_EEPS4_EEvT1_S8_OT0_NS_15iterator_traitsIS8_E15difference_typeE
00000000 W _ZNSt6__ndk19allocatorINS_4pairIyiEEE8allocateB7v170000Ej
00000000 W _ZNSt6__ndk19allocatorIjE8allocateB7v170000Ej
00000000 W _ZNSt6__ndk19allocatorIyE8allocateB7v170000Ej
00000000 W _ZNSt6__ndk1ltB7v170000IyiEEbRKNS_4pairIT_T0_EES6_
00000000 W _ZSt28__throw_bad_array_new_lengthB7v170000v
28_libhwy_perf_counters.cc.o:
00000000 T _ZN3hwy8platform12PerfCounters15IndexForCounterENS1_7CounterE
00000000 T _ZN3hwy8platform12PerfCounters15StopAllAndResetEv
00000000 T _ZN3hwy8platform12PerfCounters4InitEv
00000000 W _ZN3hwy8platform12PerfCounters4NameENS1_7CounterE
00000000 T _ZN3hwy8platform12PerfCounters8StartAllEv
00000000 T _ZN3hwy8platform12PerfCountersC1Ev
00000000 T _ZN3hwy8platform12PerfCountersC2Ev
00000000 W _ZNKSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5rfindB7v170000EPKcj
00000000 W _ZNKSt6__ndk16vectorIiNS_9allocatorIiEEE11__recommendB7v170000Ej
00000000 W _ZNSt6__ndk111__str_rfindB7v170000IcjNS_11char_traitsIcEELj4294967295EEET0_PKT_S3_S6_S3_S3_
00000000 W _ZNSt6__ndk111char_traitsIcE2eqEcc
00000000 W _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v170000IDnEEPKc
00000000 W _ZNSt6__ndk114__split_bufferIiRNS_9allocatorIiEEE17__destruct_at_endB7v170000EPiNS_17integral_constantIbLb0EEE
00000000 W _ZNSt6__ndk114__split_bufferIiRNS_9allocatorIiEEE5clearB7v170000Ev
00000000 W _ZNSt6__ndk114__split_bufferIiRNS_9allocatorIiEEED2Ev
00000000 W _ZNSt6__ndk115__find_end_implB7v170000INS_17_ClassicAlgPolicyEPKcS3_S3_S3_DoFbccENS_10__identityES5_EENS_4pairIT0_S7_EES7_T1_T2_T3_RT4_RT5_RT6_NS_20forward_iterator_tagESI_
00000000 W _ZNSt6__ndk118__find_end_classicB7v170000IPKcS2_DoFbccEEET_S4_S4_T0_S5_RT1_
00000000 W _ZNSt6__ndk16vectorIiNS_9allocatorIiEEE21__push_back_slow_pathIRKiEEvOT_
00000000 W _ZNSt6__ndk16vectorIiNS_9allocatorIiEEE26__swap_out_circular_bufferERNS_14__split_bufferIiRS2_EE
00000000 W _ZNSt6__ndk16vectorIiNS_9allocatorIiEEE7reserveEj
00000000 W _ZNSt6__ndk16vectorIiNS_9allocatorIiEEE9push_backB7v170000ERKi
00000000 W _ZNSt6__ndk19allocatorIiE8allocateB7v170000Ej
00000000 W _ZNSt6__ndk1eqB7v170000IcNS_11char_traitsIcEENS_9allocatorIcEEEEbRKNS_12basic_stringIT_T0_T1_EEPKS6_
00000000 W _ZNSt6__ndk1neB7v170000IcNS_11char_traitsIcEENS_9allocatorIcEEEEbRKNS_12basic_stringIT_T0_T1_EEPKS6_
00000000 W _ZSt28__throw_bad_array_new_lengthB7v170000v
29_libhwy_per_target.cc.o:
00000000 T _ZN3hwy11HaveFloat16Ev
00000000 T _ZN3hwy11HaveFloat64Ev
00000000 T _ZN3hwy11VectorBytesEv
00000000 T _ZN3hwy13HaveInteger64Ev
00000000 T _ZN3hwy16DispatchedTargetEv
2_libjpegli_static_bit_writer.cc.o:
00000000 T _ZN6jpegli17JpegBitWriterInitEP20jpeg_compress_struct
00000000 T _ZN6jpegli18JumpToByteBoundaryEPNS_13JpegBitWriterE
00000000 T _ZN6jpegli20EmptyBitWriterBufferEPNS_13JpegBitWriterE
30_libhwy_print.cc.o:
00000000 T _ZN3hwy6detail10PrintArrayERKNS0_8TypeInfoEPKcPKvjjj
00000000 T _ZN3hwy6detail8ToStringERKNS0_8TypeInfoEPKvPc
00000000 T _ZN3hwy6detail8TypeNameERKNS0_8TypeInfoEjPc
31_libhwy_profiler.cc.o:
00000000 T _ZN3hwy8Profiler3GetEv
32_libhwy_targets.cc.o:
00000000 T _ZN3hwy14DisableTargetsEx
00000000 T _ZN3hwy15GetChosenTargetEv
00000000 T _ZN3hwy16SupportedTargetsEv
00000000 T _ZN3hwy26SetSupportedTargetsForTestEx
33_libhwy_timer.cc.o:
00000000 W _ZN3hwy17robust_statistics12CountingSortIyEEvPT_j
00000000 W _ZN3hwy17robust_statistics12ModeOfSortedIyEET_PKS2_j
00000000 W _ZN3hwy17robust_statistics4ModeIyEET_PS2_j
00000000 W _ZN3hwy17robust_statistics4ModeIyLj256EEET_RAT0__S2_
00000000 W _ZN3hwy17robust_statistics8MinRangeIyEEjPKT_jj
00000000 T _ZN3hwy8platform12GetCpuStringEPc
00000000 T _ZN3hwy8platform13HaveTimerStopEPc
00000000 T _ZN3hwy8platform15TimerResolutionEv
00000000 T _ZN3hwy8platform23InvariantTicksPerSecondEv
00000000 T _ZN3hwy8platform3NowEv
00000000 W _ZNKSt6__ndk16vectorINS_4pairIyiEENS_9allocatorIS2_EEE11__recommendB7v170000Ej
00000000 W _ZNSt6__ndk110__pop_heapB7v170000INS_17_ClassicAlgPolicyENS_6__lessINS_4pairIyiEES4_EEPS4_EEvT1_S7_RT0_NS_15iterator_traitsIS7_E15difference_typeE
00000000 W _ZNSt6__ndk111__introsortINS_17_ClassicAlgPolicyERNS_6__lessINS_4pairIyiEES4_EEPS4_Lb0EEEvT1_S8_T0_NS_15iterator_traitsIS8_E15difference_typeEb
00000000 W _ZNSt6__ndk111__make_heapB7v170000INS_17_ClassicAlgPolicyERNS_6__lessINS_4pairIyiEES4_EEPS4_EEvT1_S8_OT0_
00000000 W _ZNSt6__ndk111__sift_downB7v170000INS_17_ClassicAlgPolicyERNS_6__lessINS_4pairIyiEES4_EEPS4_EEvT1_OT0_NS_15iterator_traitsIS8_E15difference_typeES8_
00000000 W _ZNSt6__ndk111__sort_heapB7v170000INS_17_ClassicAlgPolicyERNS_6__lessINS_4pairIyiEES4_EEPS4_EEvT1_S8_OT0_
00000000 W _ZNSt6__ndk114__partial_sortB7v170000INS_17_ClassicAlgPolicyERNS_6__lessINS_4pairIyiEES4_EEPS4_S7_EET1_S8_S8_T2_RT0_
00000000 W _ZNSt6__ndk114__split_bufferINS_4pairIyiEERNS_9allocatorIS2_EEE17__destruct_at_endB7v170000EPS2_NS_17integral_constantIbLb0EEE
00000000 W _ZNSt6__ndk114__split_bufferINS_4pairIyiEERNS_9allocatorIS2_EEE5clearB7v170000Ev
00000000 W _ZNSt6__ndk114__split_bufferINS_4pairIyiEERNS_9allocatorIS2_EEEC2EjjS5_
00000000 W _ZNSt6__ndk114__split_bufferINS_4pairIyiEERNS_9allocatorIS2_EEED2Ev
00000000 W _ZNSt6__ndk116__insertion_sortB7v170000INS_17_ClassicAlgPolicyERNS_6__lessINS_4pairIyiEES4_EEPS4_EEvT1_S8_T0_
00000000 W _ZNSt6__ndk117__floyd_sift_downB7v170000INS_17_ClassicAlgPolicyERNS_6__lessINS_4pairIyiEES4_EEPS4_EET1_S8_OT0_NS_15iterator_traitsIS8_E15difference_typeE
00000000 W _ZNSt6__ndk119__partial_sort_implB7v170000INS_17_ClassicAlgPolicyERNS_6__lessINS_4pairIyiEES4_EEPS4_S7_EET1_S8_S8_T2_OT0_
00000000 W _ZNSt6__ndk126__insertion_sort_unguardedB7v170000INS_17_ClassicAlgPolicyERNS_6__lessINS_4pairIyiEES4_EEPS4_EEvT1_S8_T0_
00000000 W _ZNSt6__ndk127__insertion_sort_incompleteIRNS_6__lessINS_4pairIyiEES3_EEPS3_EEbT0_S7_T_
00000000 W _ZNSt6__ndk131__partition_with_equals_on_leftB7v170000INS_17_ClassicAlgPolicyEPNS_4pairIyiEERNS_6__lessIS3_S3_EEEET0_S8_S8_T1_
00000000 W _ZNSt6__ndk132__partition_with_equals_on_rightB7v170000INS_17_ClassicAlgPolicyEPNS_4pairIyiEERNS_6__lessIS3_S3_EEEENS2_IT0_bEES8_S8_T1_
00000000 W _ZNSt6__ndk16__fillB7v170000IPyyEEvT_S2_RKT0_NS_26random_access_iterator_tagE
00000000 W _ZNSt6__ndk16__sortIRNS_6__lessINS_4pairIyiEES3_EEPS3_EEvT0_S7_T_
00000000 W _ZNSt6__ndk16vectorINS_4pairIyiEENS_9allocatorIS2_EEE16__destroy_vectorclB7v170000Ev
00000000 W _ZNSt6__ndk16vectorINS_4pairIyiEENS_9allocatorIS2_EEE21__push_back_slow_pathIS2_EEvOT_
00000000 W _ZNSt6__ndk16vectorINS_4pairIyiEENS_9allocatorIS2_EEE26__swap_out_circular_bufferERNS_14__split_bufferIS2_RS4_EE
00000000 W _ZNSt6__ndk16vectorINS_4pairIyiEENS_9allocatorIS2_EEE9push_backB7v170000EOS2_
00000000 W _ZNSt6__ndk16vectorINS_4pairIyiEENS_9allocatorIS2_EEED2B7v170000Ev
00000000 W _ZNSt6__ndk17__sort3B7v170000INS_17_ClassicAlgPolicyERNS_6__lessINS_4pairIyiEES4_EEPS4_EEjT1_S8_S8_T0_
00000000 W _ZNSt6__ndk17__sort4B7v170000INS_17_ClassicAlgPolicyERNS_6__lessINS_4pairIyiEES4_EEPS4_EEjT1_S8_S8_S8_T0_
00000000 W _ZNSt6__ndk17__sort5IRNS_6__lessINS_4pairIyiEES3_EEPS3_EEjT0_S7_S7_S7_S7_T_
00000000 W _ZNSt6__ndk18__fill_nB7v170000IPyiyEET_S2_T0_RKT1_
00000000 W _ZNSt6__ndk19__sift_upB7v170000INS_17_ClassicAlgPolicyERNS_6__lessINS_4pairIyiEES4_EEPS4_EEvT1_S8_OT0_NS_15iterator_traitsIS8_E15difference_typeE
00000000 W _ZNSt6__ndk19allocatorINS_4pairIyiEEE8allocateB7v170000Ej
00000000 W _ZNSt6__ndk1ltB7v170000IyiEEbRKNS_4pairIT_T0_EES6_
00000000 W _ZSt28__throw_bad_array_new_lengthB7v170000v
3_libjpegli_static_color_quantize.cc.o:
00000000 T _ZN6jpegli16LookupColorIndexEP22jpeg_decompress_structPKh
00000000 T _ZN6jpegli17InitFSDitherStateEP22jpeg_decompress_struct
00000000 T _ZN6jpegli19ChooseColorMap1PassEP22jpeg_decompress_struct
00000000 T _ZN6jpegli19ChooseColorMap2PassEP22jpeg_decompress_struct
00000000 T _ZN6jpegli21CreateInverseColorMapEP22jpeg_decompress_struct
00000000 T _ZN6jpegli25CreateOrderedDitherTablesEP22jpeg_decompress_struct
00000000 W _ZN6jpegli25make_uninitialized_vectorIhEENSt6__ndk16vectorIT_NS_22UninitializedAllocatorIS3_EEEEj
00000000 W _ZNKSt6__ndk114default_deleteIA_NS_6vectorIiNS_9allocatorIiEEEEEclB7v170000IS4_EENS6_20_EnableIfConvertibleIT_E4typeEPS9_
00000000 W _ZNKSt6__ndk16vectorINS0_IhNS_9allocatorIhEEEENS1_IS3_EEE11__recommendB7v170000Ej
00000000 W _ZNKSt6__ndk16vectorIhNS_9allocatorIhEEE11__recommendB7v170000Ej
00000000 W _ZNKSt6__ndk16vectorIiNS_9allocatorIiEEE11__recommendB7v170000Ej
00000000 W _ZNSt6__ndk110unique_ptrIA_NS_6vectorIiNS_9allocatorIiEEEENS_14default_deleteIS5_EEE5resetB7v170000EDn
00000000 W _ZNSt6__ndk110unique_ptrIA_NS_6vectorIiNS_9allocatorIiEEEENS_14default_deleteIS5_EEED2B7v170000Ev
00000000 W _ZNSt6__ndk110unique_ptrIA_PNS_16__hash_node_baseIPNS_11__hash_nodeINS_17__hash_value_typeIjiEEPvEEEENS_25__bucket_list_deallocatorINS_9allocatorIS9_EEEEE5resetB7v170000EDn
00000000 W _ZNSt6__ndk110unique_ptrIA_PNS_16__hash_node_baseIPNS_11__hash_nodeINS_17__hash_value_typeIjiEEPvEEEENS_25__bucket_list_deallocatorINS_9allocatorIS9_EEEEE5resetB7v170000IPS9_EENS_9enable_ifIXsr28_CheckArrayPointerConversionIT_EE5valueEvE4typeESJ_
00000000 W _ZNSt6__ndk110unique_ptrIA_PNS_16__hash_node_baseIPNS_11__hash_nodeINS_17__hash_value_typeIjiEEPvEEEENS_25__bucket_list_deallocatorINS_9allocatorIS9_EEEEED2B7v170000Ev
00000000 W _ZNSt6__ndk110unique_ptrINS_11__hash_nodeINS_17__hash_value_typeIjiEEPvEENS_22__hash_node_destructorINS_9allocatorIS5_EEEEE5resetB7v170000EPS5_
00000000 W _ZNSt6__ndk110unique_ptrINS_11__hash_nodeINS_17__hash_value_typeIjiEEPvEENS_22__hash_node_destructorINS_9allocatorIS5_EEEEED2B7v170000Ev
00000000 W _ZNSt6__ndk113__fill_n_trueB7v170000INS_6vectorIbNS_9allocatorIbEEEEEEvNS_14__bit_iteratorIT_Lb0ELi0EEENS6_9size_typeE
00000000 W _ZNSt6__ndk114__fill_n_falseB7v170000INS_6vectorIbNS_9allocatorIbEEEEEEvNS_14__bit_iteratorIT_Lb0ELi0EEENS6_9size_typeE
00000000 W _ZNSt6__ndk114__split_bufferINS_6vectorIhNS_9allocatorIhEEEERNS2_IS4_EEE17__destruct_at_endB7v170000EPS4_NS_17integral_constantIbLb0EEE
00000000 W _ZNSt6__ndk114__split_bufferINS_6vectorIhNS_9allocatorIhEEEERNS2_IS4_EEE18__construct_at_endEj
00000000 W _ZNSt6__ndk114__split_bufferINS_6vectorIhNS_9allocatorIhEEEERNS2_IS4_EEE5clearB7v170000Ev
00000000 W _ZNSt6__ndk114__split_bufferINS_6vectorIhNS_9allocatorIhEEEERNS2_IS4_EEEC2EjjS6_
00000000 W _ZNSt6__ndk114__split_bufferINS_6vectorIhNS_9allocatorIhEEEERNS2_IS4_EEED2Ev
00000000 W _ZNSt6__ndk114__split_bufferIhRNS_9allocatorIhEEE17__destruct_at_endB7v170000EPhNS_17integral_constantIbLb0EEE
00000000 W _ZNSt6__ndk114__split_bufferIhRNS_9allocatorIhEEE5clearB7v170000Ev
00000000 W _ZNSt6__ndk114__split_bufferIhRNS_9allocatorIhEEED2Ev
00000000 W _ZNSt6__ndk114__split_bufferIiRNS_9allocatorIiEEE17__destruct_at_endB7v170000EPiNS_17integral_constantIbLb0EEE
00000000 W _ZNSt6__ndk114__split_bufferIiRNS_9allocatorIiEEE5clearB7v170000Ev
00000000 W _ZNSt6__ndk114__split_bufferIiRNS_9allocatorIiEEED2Ev
00000000 W _ZNSt6__ndk125__bucket_list_deallocatorINS_9allocatorIPNS_16__hash_node_baseIPNS_11__hash_nodeINS_17__hash_value_typeIjiEEPvEEEEEEEclB7v170000EPSA_
00000000 W _ZNSt6__ndk16fill_nB7v170000INS_6vectorIbNS_9allocatorIbEEEEEEvNS_14__bit_iteratorIT_Lb0ELi0EEENS6_9size_typeEb
00000000 W _ZNSt6__ndk16vectorINS0_IhNS_9allocatorIhEEEENS1_IS3_EEE18__construct_at_endEj
00000000 W _ZNSt6__ndk16vectorINS0_IhNS_9allocatorIhEEEENS1_IS3_EEE22__base_destruct_at_endB7v170000EPS3_
00000000 W _ZNSt6__ndk16vectorINS0_IhNS_9allocatorIhEEEENS1_IS3_EEE26__swap_out_circular_bufferERNS_14__split_bufferIS3_RS4_EE
00000000 W _ZNSt6__ndk16vectorINS0_IhNS_9allocatorIhEEEENS1_IS3_EEE6resizeEj
00000000 W _ZNSt6__ndk16vectorINS0_IhNS_9allocatorIhEEEENS1_IS3_EEE8__appendEj
00000000 W _ZNSt6__ndk16vectorIbNS_9allocatorIbEEE11__vallocateB7v170000Ej
00000000 W _ZNSt6__ndk16vectorIbNS_9allocatorIbEEE16__destroy_vectorclB7v170000Ev
00000000 W _ZNSt6__ndk16vectorIbNS_9allocatorIbEEE18__construct_at_endB7v170000Ejb
00000000 W _ZNSt6__ndk16vectorIbNS_9allocatorIbEEEC2EjRKb
00000000 W _ZNSt6__ndk16vectorIbNS_9allocatorIbEEED2B7v170000Ev
00000000 W _ZNSt6__ndk16vectorIhN6jpegli22UninitializedAllocatorIhEEE11__vallocateB7v170000Ej
00000000 W _ZNSt6__ndk16vectorIhN6jpegli22UninitializedAllocatorIhEEE16__destroy_vectorclB7v170000Ev
00000000 W _ZNSt6__ndk16vectorIhN6jpegli22UninitializedAllocatorIhEEEC2EjRKS3_
00000000 W _ZNSt6__ndk16vectorIhN6jpegli22UninitializedAllocatorIhEEED2B7v170000Ev
00000000 W _ZNSt6__ndk16vectorIhNS_9allocatorIhEEE16__destroy_vectorclB7v170000Ev
00000000 W _ZNSt6__ndk16vectorIhNS_9allocatorIhEEE21__push_back_slow_pathIhEEvOT_
00000000 W _ZNSt6__ndk16vectorIhNS_9allocatorIhEEE26__swap_out_circular_bufferERNS_14__split_bufferIhRS2_EE
00000000 W _ZNSt6__ndk16vectorIhNS_9allocatorIhEEE9push_backB7v170000EOh
00000000 W _ZNSt6__ndk16vectorIhNS_9allocatorIhEEEC2B7v170000EOS3_
00000000 W _ZNSt6__ndk16vectorIhNS_9allocatorIhEEED2B7v170000Ev
00000000 W _ZNSt6__ndk16vectorIiNS_9allocatorIiEEE11__vallocateB7v170000Ej
00000000 W _ZNSt6__ndk16vectorIiNS_9allocatorIiEEE16__destroy_vectorclB7v170000Ev
00000000 W _ZNSt6__ndk16vectorIiNS_9allocatorIiEEE18__construct_at_endEj
00000000 W _ZNSt6__ndk16vectorIiNS_9allocatorIiEEE18__construct_at_endEjRKi
00000000 W _ZNSt6__ndk16vectorIiNS_9allocatorIiEEE21__push_back_slow_pathIRKiEEvOT_
00000000 W _ZNSt6__ndk16vectorIiNS_9allocatorIiEEE26__swap_out_circular_bufferERNS_14__split_bufferIiRS2_EE
00000000 W _ZNSt6__ndk16vectorIiNS_9allocatorIiEEE9push_backB7v170000ERKi
00000000 W _ZNSt6__ndk16vectorIiNS_9allocatorIiEEEC2Ej
00000000 W _ZNSt6__ndk16vectorIiNS_9allocatorIiEEEC2EjRKi
00000000 W _ZNSt6__ndk16vectorIiNS_9allocatorIiEEED2B7v170000Ev
00000000 W _ZNSt6__ndk19allocatorINS_6vectorIhNS0_IhEEEEE8allocateB7v170000Ej
00000000 W _ZNSt6__ndk19allocatorIPNS_16__hash_node_baseIPNS_11__hash_nodeINS_17__hash_value_typeIjiEEPvEEEEE8allocateB7v170000Ej
00000000 W _ZNSt6__ndk19allocatorIiE8allocateB7v170000Ej
00000000 W _ZNSt6__ndk19allocatorIjE8allocateB7v170000Ej
00000000 W _ZSt28__throw_bad_array_new_lengthB7v170000v
4_libjpegli_static_color_transform.cc.o:
00000000 T _ZN6jpegli13NullTransformEPPfj
00000000 T _ZN6jpegli14GrayscaleToRGBEPPfj
00000000 T _ZN6jpegli15GrayscaleToARGBEPPfj
00000000 T _ZN6jpegli15GrayscaleToRGBAEPPfj
00000000 T _ZN6jpegli16GrayscaleToYCbCrEPPfj
00000000 T _ZN6jpegli20ChooseColorTransformEP20jpeg_compress_struct
00000000 T _ZN6jpegli20ChooseColorTransformEP22jpeg_decompress_struct
00000000 T _ZN6jpegli25CheckColorSpaceComponentsEi13J_COLOR_SPACE
00000000 T _ZN6jpegli6N_SSE210BGRToYCbCrEPPfj
00000000 T _ZN6jpegli6N_SSE210CMYKToYCCKEPPfj
00000000 T _ZN6jpegli6N_SSE210RGBToYCbCrEPPfj
00000000 T _ZN6jpegli6N_SSE210YCCKToCMYKEPPfj
00000000 T _ZN6jpegli6N_SSE210YCbCrToBGREPPfj
00000000 T _ZN6jpegli6N_SSE210YCbCrToRGBEPPfj
00000000 T _ZN6jpegli6N_SSE211ABGRToYCbCrEPPfj
00000000 T _ZN6jpegli6N_SSE211ARGBToYCbCrEPPfj
00000000 T _ZN6jpegli6N_SSE211YCbCrToABGREPPfj
00000000 T _ZN6jpegli6N_SSE211YCbCrToARGBEPPfj
00000000 T _ZN6jpegli6N_SSE211YCbCrToBGRAEPPfj
00000000 T _ZN6jpegli6N_SSE211YCbCrToRGBAEPPfj
00000000 W _ZN6jpegli6N_SSE213ExtRGBToYCbCrILi0ELi1ELi2EEEvPPfj
00000000 W _ZN6jpegli6N_SSE213ExtRGBToYCbCrILi1ELi2ELi3EEEvPPfj
00000000 W _ZN6jpegli6N_SSE213ExtRGBToYCbCrILi2ELi1ELi0EEEvPPfj
00000000 W _ZN6jpegli6N_SSE213ExtRGBToYCbCrILi3ELi2ELi1EEEvPPfj
00000000 W _ZN6jpegli6N_SSE213YCbCrToExtRGBILi0ELi1ELi2ELi3EEEvPPfj
00000000 W _ZN6jpegli6N_SSE213YCbCrToExtRGBILi0ELi1ELi2ELin1EEEvPPfj
00000000 W _ZN6jpegli6N_SSE213YCbCrToExtRGBILi1ELi2ELi3ELi0EEEvPPfj
00000000 W _ZN6jpegli6N_SSE213YCbCrToExtRGBILi2ELi1ELi0ELi3EEEvPPfj
00000000 W _ZN6jpegli6N_SSE213YCbCrToExtRGBILi2ELi1ELi0ELin1EEEvPPfj
00000000 W _ZN6jpegli6N_SSE213YCbCrToExtRGBILi3ELi2ELi1ELi0EEEvPPfj
00000000 T _ZN6jpegli6N_SSE410BGRToYCbCrEPPfj
00000000 T _ZN6jpegli6N_SSE410CMYKToYCCKEPPfj
00000000 T _ZN6jpegli6N_SSE410RGBToYCbCrEPPfj
00000000 T _ZN6jpegli6N_SSE410YCCKToCMYKEPPfj
00000000 T _ZN6jpegli6N_SSE410YCbCrToBGREPPfj
00000000 T _ZN6jpegli6N_SSE410YCbCrToRGBEPPfj
00000000 T _ZN6jpegli6N_SSE411ABGRToYCbCrEPPfj
00000000 T _ZN6jpegli6N_SSE411ARGBToYCbCrEPPfj
00000000 T _ZN6jpegli6N_SSE411YCbCrToABGREPPfj
00000000 T _ZN6jpegli6N_SSE411YCbCrToARGBEPPfj
00000000 T _ZN6jpegli6N_SSE411YCbCrToBGRAEPPfj
00000000 T _ZN6jpegli6N_SSE411YCbCrToRGBAEPPfj
00000000 W _ZN6jpegli6N_SSE413ExtRGBToYCbCrILi0ELi1ELi2EEEvPPfj
00000000 W _ZN6jpegli6N_SSE413ExtRGBToYCbCrILi1ELi2ELi3EEEvPPfj
00000000 W _ZN6jpegli6N_SSE413ExtRGBToYCbCrILi2ELi1ELi0EEEvPPfj
00000000 W _ZN6jpegli6N_SSE413ExtRGBToYCbCrILi3ELi2ELi1EEEvPPfj
00000000 W _ZN6jpegli6N_SSE413YCbCrToExtRGBILi0ELi1ELi2ELi3EEEvPPfj
00000000 W _ZN6jpegli6N_SSE413YCbCrToExtRGBILi0ELi1ELi2ELin1EEEvPPfj
00000000 W _ZN6jpegli6N_SSE413YCbCrToExtRGBILi1ELi2ELi3ELi0EEEvPPfj
00000000 W _ZN6jpegli6N_SSE413YCbCrToExtRGBILi2ELi1ELi0ELi3EEEvPPfj
00000000 W _ZN6jpegli6N_SSE413YCbCrToExtRGBILi2ELi1ELi0ELin1EEEvPPfj
00000000 W _ZN6jpegli6N_SSE413YCbCrToExtRGBILi3ELi2ELi1ELi0EEEvPPfj
00000000 T _ZN6jpegli8RGBToBGREPPfj
00000000 T _ZN6jpegli9FillAlphaEPfj
00000000 T _ZN6jpegli9RGBToABGREPPfj
00000000 T _ZN6jpegli9RGBToARGBEPPfj
00000000 T _ZN6jpegli9RGBToBGRAEPPfj
00000000 T _ZN6jpegli9RGBToRGBAEPPfj
5_libjpegli_static_common.cc.o:
00000000 W _ZN18jpeg_decomp_masterD2Ev
00000000 W _ZNSt6__ndk16vectorINS0_IhNS_9allocatorIhEEEENS1_IS3_EEE16__destroy_vectorclB7v170000Ev
00000000 W _ZNSt6__ndk16vectorINS0_IhNS_9allocatorIhEEEENS1_IS3_EEE22__base_destruct_at_endB7v170000EPS3_
00000000 W _ZNSt6__ndk16vectorINS0_IhNS_9allocatorIhEEEENS1_IS3_EEE7__clearB7v170000Ev
00000000 W _ZNSt6__ndk16vectorINS0_IhNS_9allocatorIhEEEENS1_IS3_EEED2B7v170000Ev
00000000 W _ZNSt6__ndk16vectorIhNS_9allocatorIhEEE16__destroy_vectorclB7v170000Ev
00000000 W _ZNSt6__ndk16vectorIhNS_9allocatorIhEEED2B7v170000Ev
00000000 T jpegli_abort
00000000 T jpegli_alloc_huff_table
00000000 T jpegli_alloc_quant_table
00000000 T jpegli_bytes_per_sample
00000000 T jpegli_destroy
6_libjpegli_static_decode.cc.o:
00000000 T _Z29jpegli_core_output_dimensionsP22jpeg_decompress_struct
00000000 W _ZN18jpeg_decomp_masterC2Ev
00000000 T _ZN6jpegli12ConsumeInputEP22jpeg_decompress_struct
00000000 T _ZN6jpegli12IsInputReadyEP22jpeg_decompress_struct
00000000 T _ZN6jpegli14PrepareForScanEP22jpeg_decompress_struct
00000000 T _ZN6jpegli14ReadOutputPassEP22jpeg_decompress_struct
00000000 T _ZN6jpegli15InitializeImageEP22jpeg_decompress_struct
00000000 T _ZN6jpegli19InitProgressMonitorEP22jpeg_decompress_structb
00000000 T _ZN6jpegli21AllocateOutputBuffersEP22jpeg_decompress_struct
00000000 T _ZN6jpegli22PrepareQuantizedOutputEP22jpeg_decompress_struct
00000000 T _ZN6jpegli23BuildHuffmanLookupTableEP22jpeg_decompress_structP9JHUFF_TBLPNS_17HuffmanTableEntryE
00000000 T _ZN6jpegli24ProgressMonitorInputPassEP22jpeg_decompress_struct
00000000 T _ZN6jpegli25AllocateCoefficientBufferEP22jpeg_decompress_struct
00000000 T _ZN6jpegli25ProgressMonitorOutputPassEP22jpeg_decompress_struct
00000000 T _ZN6jpegli26InitializeDecompressParamsEP22jpeg_decompress_struct
00000000 T _ZN6jpegli28InitProgressMonitorForOutputEP22jpeg_decompress_struct
00000000 W _ZN6jpegli9RowBufferIfE8AllocateIP22jpeg_decompress_structEEvT_jj
00000000 W _ZNKSt6__ndk16vectorIhNS_9allocatorIhEEE11__recommendB7v170000Ej
00000000 W _ZNSt6__ndk114__split_bufferIhRNS_9allocatorIhEEE17__destruct_at_endB7v170000EPhNS_17integral_constantIbLb0EEE
00000000 W _ZNSt6__ndk114__split_bufferIhRNS_9allocatorIhEEE18__construct_at_endIPKhEENS_9enable_ifIXsr27__is_cpp17_forward_iteratorIT_EE5valueEvE4typeES9_S9_
00000000 W _ZNSt6__ndk114__split_bufferIhRNS_9allocatorIhEEE5clearB7v170000Ev
00000000 W _ZNSt6__ndk114__split_bufferIhRNS_9allocatorIhEEED2Ev
00000000 W _ZNSt6__ndk16vectorIhNS_9allocatorIhEEE11__vallocateB7v170000Ej
00000000 W _ZNSt6__ndk16vectorIhNS_9allocatorIhEEE12__move_rangeEPhS4_S4_
00000000 W _ZNSt6__ndk16vectorIhNS_9allocatorIhEEE13__vdeallocateEv
00000000 W _ZNSt6__ndk16vectorIhNS_9allocatorIhEEE26__swap_out_circular_bufferERNS_14__split_bufferIhRS2_EEPh
00000000 W _ZNSt6__ndk16vectorIhNS_9allocatorIhEEE6assignIPKhLi0EEEvT_S7_
00000000 W _ZNSt6__ndk16vectorIhNS_9allocatorIhEEE6insertIPKhLi0EEENS_11__wrap_iterIPhEENS7_IS6_EET_SB_
00000000 T jpegli_CreateDecompress
00000000 T jpegli_abort_decompress
00000000 T jpegli_calc_output_dimensions
00000000 T jpegli_consume_input
00000000 T jpegli_crop_scanline
00000000 T jpegli_destroy_decompress
00000000 T jpegli_finish_decompress
00000000 T jpegli_finish_output
00000000 T jpegli_has_multiple_scans
00000000 T jpegli_input_complete
00000000 T jpegli_new_colormap
00000000 T jpegli_read_coefficients
00000000 T jpegli_read_header
00000000 T jpegli_read_icc_profile
00000000 T jpegli_read_raw_data
00000000 T jpegli_read_scanlines
00000000 T jpegli_resync_to_restart
00000000 T jpegli_save_markers
00000000 T jpegli_set_marker_processor
00000000 T jpegli_set_output_format
00000000 T jpegli_skip_scanlines
00000000 T jpegli_start_decompress
00000000 T jpegli_start_output
7_libjpegli_static_decode_marker.cc.o:
00000000 T _ZN6jpegli14ProcessMarkersEP22jpeg_decompress_structPKhjPj
00000000 T _ZN6jpegli18GetMarkerProcessorEP22jpeg_decompress_struct
00000000 W _ZNKSt6__ndk16vectorIhNS_9allocatorIhEEE11__recommendB7v170000Ej
00000000 W _ZNSt6__ndk114__split_bufferIhRNS_9allocatorIhEEE17__destruct_at_endB7v170000EPhNS_17integral_constantIbLb0EEE
00000000 W _ZNSt6__ndk114__split_bufferIhRNS_9allocatorIhEEE18__construct_at_endIPKhEENS_9enable_ifIXsr27__is_cpp17_forward_iteratorIT_EE5valueEvE4typeES9_S9_
00000000 W _ZNSt6__ndk114__split_bufferIhRNS_9allocatorIhEEE5clearB7v170000Ev
00000000 W _ZNSt6__ndk114__split_bufferIhRNS_9allocatorIhEEED2Ev
00000000 W _ZNSt6__ndk16vectorIhNS_9allocatorIhEEE12__move_rangeEPhS4_S4_
00000000 W _ZNSt6__ndk16vectorIhNS_9allocatorIhEEE26__swap_out_circular_bufferERNS_14__split_bufferIhRS2_EEPh
00000000 W _ZNSt6__ndk16vectorIhNS_9allocatorIhEEE6insertIPKhLi0EEENS_11__wrap_iterIPhEENS7_IS6_EET_SB_
8_libjpegli_static_decode_scan.cc.o:
00000000 T _ZN6jpegli11ProcessScanEP22jpeg_decompress_structPKhjPjS4_
00000000 T _ZN6jpegli17PrepareForiMCURowEP22jpeg_decompress_struct
9_libjpegli_static_destination_manager.cc.o:
00000000 W _ZN6jpegli23StdioDestinationManager16init_destinationEP20jpeg_compress_struct
00000000 W _ZN6jpegli23StdioDestinationManager16term_destinationEP20jpeg_compress_struct
00000000 W _ZN6jpegli23StdioDestinationManager19empty_output_bufferEP20jpeg_compress_struct
00000000 W _ZN6jpegli24MemoryDestinationManager16init_destinationEP20jpeg_compress_struct
00000000 W _ZN6jpegli24MemoryDestinationManager16term_destinationEP20jpeg_compress_struct
00000000 W _ZN6jpegli24MemoryDestinationManager19empty_output_bufferEP20jpeg_compress_struct
00000000 T jpegli_mem_dest
00000000 T jpegli_stdio_dest
@@ -0,0 +1,4 @@
Header source: /mnt/nas/builder/build-image-libs/out/android/x86_64/include
JPEG_LIB_VERSION: 80
jpeg_compress_struct_size: 584
Reason: selected by compile-time probe from all available Jpegli/build/image headers.
@@ -0,0 +1,37 @@
/* Version ID for the JPEG library.
* Might be useful for tests like "#if JPEG_LIB_VERSION >= 60".
*/
#define JPEG_LIB_VERSION 80
/* libjpeg-turbo version */
#define LIBJPEG_TURBO_VERSION 4.1.5
/* libjpeg-turbo version in integer form */
#define LIBJPEG_TURBO_VERSION_NUMBER 4001005
/* Support arithmetic encoding */
#define C_ARITH_CODING_SUPPORTED 1
/* Support arithmetic decoding */
#define D_ARITH_CODING_SUPPORTED 1
/* Support in-memory source/destination managers */
/* #undef MEM_SRCDST_SUPPORTED */
/* Use accelerated SIMD routines. */
#define WITH_SIMD 1
/*
* Define BITS_IN_JSAMPLE as either
* 8 for 8-bit sample values (the usual setting)
* 12 for 12-bit sample values
* Only 8 and 12 are legal data precisions for lossy JPEG according to the
* JPEG standard, and the IJG code does not support anything else!
* We do not support run-time selection of data precision, sorry.
*/
#define BITS_IN_JSAMPLE 8 /* use 8 or 12 */
/* Define if your (broken) compiler shifts signed values as if they were
unsigned. */
/* #undef RIGHT_SHIFT_IS_UNSIGNED */
@@ -0,0 +1,335 @@
/*
* jerror.h
*
* This file was part of the Independent JPEG Group's software:
* Copyright (C) 1994-1997, Thomas G. Lane.
* Modified 1997-2009 by Guido Vollbeding.
* libjpeg-turbo Modifications:
* Copyright (C) 2014, 2017, 2021-2022, 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 JPEG library.
* Edit this file to add new codes, or to translate the message strings to
* some other language.
* A set of error-reporting macros are defined too. Some applications using
* the JPEG library may wish to include this file to get the error codes
* and/or the macros.
*/
/*
* 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 JERROR_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 /* JERROR_H */
#endif /* JMESSAGE */
#ifdef JMAKE_ENUM_LIST
typedef enum {
#define JMESSAGE(code,string) code ,
#endif /* JMAKE_ENUM_LIST */
JMESSAGE(JMSG_NOMESSAGE, "Bogus message code %d") /* Must be first entry! */
/* For maintenance convenience, list is alphabetical by message code name */
#if JPEG_LIB_VERSION < 70
JMESSAGE(JERR_ARITH_NOTIMPL, "Sorry, arithmetic coding is not implemented")
#endif
JMESSAGE(JERR_BAD_ALIGN_TYPE, "ALIGN_TYPE is wrong, please fix")
JMESSAGE(JERR_BAD_ALLOC_CHUNK, "MAX_ALLOC_CHUNK is wrong, please fix")
JMESSAGE(JERR_BAD_BUFFER_MODE, "Bogus buffer control mode")
JMESSAGE(JERR_BAD_COMPONENT_ID, "Invalid component ID %d in SOS")
#if JPEG_LIB_VERSION >= 70
JMESSAGE(JERR_BAD_CROP_SPEC, "Invalid crop request")
#endif
JMESSAGE(JERR_BAD_DCT_COEF, "DCT coefficient out of range")
JMESSAGE(JERR_BAD_DCTSIZE, "IDCT output block size %d not supported")
#if JPEG_LIB_VERSION >= 70
JMESSAGE(JERR_BAD_DROP_SAMPLING,
"Component index %d: mismatching sampling ratio %d:%d, %d:%d, %c")
#endif
JMESSAGE(JERR_BAD_HUFF_TABLE, "Bogus Huffman table definition")
JMESSAGE(JERR_BAD_IN_COLORSPACE, "Bogus input colorspace")
JMESSAGE(JERR_BAD_J_COLORSPACE, "Bogus JPEG colorspace")
JMESSAGE(JERR_BAD_LENGTH, "Bogus marker length")
JMESSAGE(JERR_BAD_LIB_VERSION,
"Wrong JPEG library version: library is %d, caller expects %d")
JMESSAGE(JERR_BAD_MCU_SIZE, "Sampling factors too large for interleaved scan")
JMESSAGE(JERR_BAD_POOL_ID, "Invalid memory pool code %d")
JMESSAGE(JERR_BAD_PRECISION, "Unsupported JPEG data precision %d")
JMESSAGE(JERR_BAD_PROGRESSION,
"Invalid progressive parameters Ss=%d Se=%d Ah=%d Al=%d")
JMESSAGE(JERR_BAD_PROG_SCRIPT,
"Invalid progressive parameters at scan script entry %d")
JMESSAGE(JERR_BAD_SAMPLING, "Bogus sampling factors")
JMESSAGE(JERR_BAD_SCAN_SCRIPT, "Invalid scan script at entry %d")
JMESSAGE(JERR_BAD_STATE, "Improper call to JPEG library in state %d")
JMESSAGE(JERR_BAD_STRUCT_SIZE,
"JPEG parameter struct mismatch: library thinks size is %u, caller expects %u")
JMESSAGE(JERR_BAD_VIRTUAL_ACCESS, "Bogus virtual array access")
JMESSAGE(JERR_BUFFER_SIZE, "Buffer passed to JPEG library is too small")
JMESSAGE(JERR_CANT_SUSPEND, "Suspension not allowed here")
JMESSAGE(JERR_CCIR601_NOTIMPL, "CCIR601 sampling not implemented yet")
JMESSAGE(JERR_COMPONENT_COUNT, "Too many color components: %d, max %d")
JMESSAGE(JERR_CONVERSION_NOTIMPL, "Unsupported color conversion request")
JMESSAGE(JERR_DAC_INDEX, "Bogus DAC index %d")
JMESSAGE(JERR_DAC_VALUE, "Bogus DAC value 0x%x")
JMESSAGE(JERR_DHT_INDEX, "Bogus DHT index %d")
JMESSAGE(JERR_DQT_INDEX, "Bogus DQT index %d")
JMESSAGE(JERR_EMPTY_IMAGE, "Empty JPEG image (DNL not supported)")
JMESSAGE(JERR_EMS_READ, "Read from EMS failed")
JMESSAGE(JERR_EMS_WRITE, "Write to EMS failed")
JMESSAGE(JERR_EOI_EXPECTED, "Didn't expect more than one scan")
JMESSAGE(JERR_FILE_READ, "Input file read error")
JMESSAGE(JERR_FILE_WRITE, "Output file write error --- out of disk space?")
JMESSAGE(JERR_FRACT_SAMPLE_NOTIMPL, "Fractional sampling not implemented yet")
JMESSAGE(JERR_HUFF_CLEN_OVERFLOW, "Huffman code size table overflow")
JMESSAGE(JERR_HUFF_MISSING_CODE, "Missing Huffman code table entry")
JMESSAGE(JERR_IMAGE_TOO_BIG, "Maximum supported image dimension is %u pixels")
JMESSAGE(JERR_INPUT_EMPTY, "Empty input file")
JMESSAGE(JERR_INPUT_EOF, "Premature end of input file")
JMESSAGE(JERR_MISMATCHED_QUANT_TABLE,
"Cannot transcode due to multiple use of quantization table %d")
JMESSAGE(JERR_MISSING_DATA, "Scan script does not transmit all data")
JMESSAGE(JERR_MODE_CHANGE, "Invalid color quantization mode change")
JMESSAGE(JERR_NOTIMPL, "Requested features are incompatible")
JMESSAGE(JERR_NOT_COMPILED, "Requested feature was omitted at compile time")
#if JPEG_LIB_VERSION >= 70
JMESSAGE(JERR_NO_ARITH_TABLE, "Arithmetic table 0x%02x was not defined")
#endif
JMESSAGE(JERR_NO_BACKING_STORE, "Backing store not supported")
JMESSAGE(JERR_NO_HUFF_TABLE, "Huffman table 0x%02x was not defined")
JMESSAGE(JERR_NO_IMAGE, "JPEG datastream contains no image")
JMESSAGE(JERR_NO_QUANT_TABLE, "Quantization table 0x%02x was not defined")
JMESSAGE(JERR_NO_SOI, "Not a JPEG file: starts with 0x%02x 0x%02x")
JMESSAGE(JERR_OUT_OF_MEMORY, "Insufficient memory (case %d)")
JMESSAGE(JERR_QUANT_COMPONENTS,
"Cannot quantize more than %d color components")
JMESSAGE(JERR_QUANT_FEW_COLORS, "Cannot quantize to fewer than %d colors")
JMESSAGE(JERR_QUANT_MANY_COLORS, "Cannot quantize to more than %d colors")
JMESSAGE(JERR_SOF_DUPLICATE, "Invalid JPEG file structure: two SOF markers")
JMESSAGE(JERR_SOF_NO_SOS, "Invalid JPEG file structure: missing SOS marker")
JMESSAGE(JERR_SOF_UNSUPPORTED, "Unsupported JPEG process: SOF type 0x%02x")
JMESSAGE(JERR_SOI_DUPLICATE, "Invalid JPEG file structure: two SOI markers")
JMESSAGE(JERR_SOS_NO_SOF, "Invalid JPEG file structure: SOS before SOF")
JMESSAGE(JERR_TFILE_CREATE, "Failed to create temporary file %s")
JMESSAGE(JERR_TFILE_READ, "Read failed on temporary file")
JMESSAGE(JERR_TFILE_SEEK, "Seek failed on temporary file")
JMESSAGE(JERR_TFILE_WRITE,
"Write failed on temporary file --- out of disk space?")
JMESSAGE(JERR_TOO_LITTLE_DATA, "Application transferred too few scanlines")
JMESSAGE(JERR_UNKNOWN_MARKER, "Unsupported marker type 0x%02x")
JMESSAGE(JERR_VIRTUAL_BUG, "Virtual array controller messed up")
JMESSAGE(JERR_WIDTH_OVERFLOW, "Image too wide for this implementation")
JMESSAGE(JERR_XMS_READ, "Read from XMS failed")
JMESSAGE(JERR_XMS_WRITE, "Write to XMS failed")
JMESSAGE(JMSG_COPYRIGHT, JCOPYRIGHT_SHORT)
JMESSAGE(JMSG_VERSION, JVERSION)
JMESSAGE(JTRC_16BIT_TABLES,
"Caution: quantization tables are too coarse for baseline JPEG")
JMESSAGE(JTRC_ADOBE,
"Adobe APP14 marker: version %d, flags 0x%04x 0x%04x, transform %d")
JMESSAGE(JTRC_APP0, "Unknown APP0 marker (not JFIF), length %u")
JMESSAGE(JTRC_APP14, "Unknown APP14 marker (not Adobe), length %u")
JMESSAGE(JTRC_DAC, "Define Arithmetic Table 0x%02x: 0x%02x")
JMESSAGE(JTRC_DHT, "Define Huffman Table 0x%02x")
JMESSAGE(JTRC_DQT, "Define Quantization Table %d precision %d")
JMESSAGE(JTRC_DRI, "Define Restart Interval %u")
JMESSAGE(JTRC_EMS_CLOSE, "Freed EMS handle %u")
JMESSAGE(JTRC_EMS_OPEN, "Obtained EMS handle %u")
JMESSAGE(JTRC_EOI, "End Of Image")
JMESSAGE(JTRC_HUFFBITS, " %3d %3d %3d %3d %3d %3d %3d %3d")
JMESSAGE(JTRC_JFIF, "JFIF APP0 marker: version %d.%02d, density %dx%d %d")
JMESSAGE(JTRC_JFIF_BADTHUMBNAILSIZE,
"Warning: thumbnail image size does not match data length %u")
JMESSAGE(JTRC_JFIF_EXTENSION, "JFIF extension marker: type 0x%02x, length %u")
JMESSAGE(JTRC_JFIF_THUMBNAIL, " with %d x %d thumbnail image")
JMESSAGE(JTRC_MISC_MARKER, "Miscellaneous marker 0x%02x, length %u")
JMESSAGE(JTRC_PARMLESS_MARKER, "Unexpected marker 0x%02x")
JMESSAGE(JTRC_QUANTVALS, " %4u %4u %4u %4u %4u %4u %4u %4u")
JMESSAGE(JTRC_QUANT_3_NCOLORS, "Quantizing to %d = %d*%d*%d colors")
JMESSAGE(JTRC_QUANT_NCOLORS, "Quantizing to %d colors")
JMESSAGE(JTRC_QUANT_SELECTED, "Selected %d colors for quantization")
JMESSAGE(JTRC_RECOVERY_ACTION, "At marker 0x%02x, recovery action %d")
JMESSAGE(JTRC_RST, "RST%d")
JMESSAGE(JTRC_SMOOTH_NOTIMPL,
"Smoothing not supported with nonstandard sampling ratios")
JMESSAGE(JTRC_SOF, "Start Of Frame 0x%02x: width=%u, height=%u, components=%d")
JMESSAGE(JTRC_SOF_COMPONENT, " Component %d: %dhx%dv q=%d")
JMESSAGE(JTRC_SOI, "Start of Image")
JMESSAGE(JTRC_SOS, "Start Of Scan: %d components")
JMESSAGE(JTRC_SOS_COMPONENT, " Component %d: dc=%d ac=%d")
JMESSAGE(JTRC_SOS_PARAMS, " Ss=%d, Se=%d, Ah=%d, Al=%d")
JMESSAGE(JTRC_TFILE_CLOSE, "Closed temporary file %s")
JMESSAGE(JTRC_TFILE_OPEN, "Opened temporary file %s")
JMESSAGE(JTRC_THUMB_JPEG,
"JFIF extension marker: JPEG-compressed thumbnail image, length %u")
JMESSAGE(JTRC_THUMB_PALETTE,
"JFIF extension marker: palette thumbnail image, length %u")
JMESSAGE(JTRC_THUMB_RGB,
"JFIF extension marker: RGB thumbnail image, length %u")
JMESSAGE(JTRC_UNKNOWN_IDS,
"Unrecognized component IDs %d %d %d, assuming YCbCr")
JMESSAGE(JTRC_XMS_CLOSE, "Freed XMS handle %u")
JMESSAGE(JTRC_XMS_OPEN, "Obtained XMS handle %u")
JMESSAGE(JWRN_ADOBE_XFORM, "Unknown Adobe color transform code %d")
#if JPEG_LIB_VERSION >= 70
JMESSAGE(JWRN_ARITH_BAD_CODE, "Corrupt JPEG data: bad arithmetic code")
#endif
JMESSAGE(JWRN_BOGUS_PROGRESSION,
"Inconsistent progression sequence for component %d coefficient %d")
JMESSAGE(JWRN_EXTRANEOUS_DATA,
"Corrupt JPEG data: %u extraneous bytes before marker 0x%02x")
JMESSAGE(JWRN_HIT_MARKER, "Corrupt JPEG data: premature end of data segment")
JMESSAGE(JWRN_HUFF_BAD_CODE, "Corrupt JPEG data: bad Huffman code")
JMESSAGE(JWRN_JFIF_MAJOR, "Warning: unknown JFIF revision number %d.%02d")
JMESSAGE(JWRN_JPEG_EOF, "Premature end of JPEG file")
JMESSAGE(JWRN_MUST_RESYNC,
"Corrupt JPEG data: found marker 0x%02x instead of RST%d")
JMESSAGE(JWRN_NOT_SEQUENTIAL, "Invalid SOS parameters for sequential JPEG")
JMESSAGE(JWRN_TOO_MUCH_DATA, "Application transferred too many scanlines")
#if JPEG_LIB_VERSION < 70
JMESSAGE(JERR_BAD_CROP_SPEC, "Invalid crop request")
#if defined(C_ARITH_CODING_SUPPORTED) || defined(D_ARITH_CODING_SUPPORTED)
JMESSAGE(JERR_NO_ARITH_TABLE, "Arithmetic table 0x%02x was not defined")
JMESSAGE(JWRN_ARITH_BAD_CODE, "Corrupt JPEG data: bad arithmetic code")
#endif
#endif
JMESSAGE(JERR_BAD_PARAM, "Bogus parameter")
JMESSAGE(JERR_BAD_PARAM_VALUE, "Bogus parameter value")
JMESSAGE(JERR_UNSUPPORTED_SUSPEND, "I/O suspension not supported in scan optimization")
JMESSAGE(JWRN_BOGUS_ICC, "Corrupt JPEG data: bad ICC marker")
#if JPEG_LIB_VERSION < 70
JMESSAGE(JERR_BAD_DROP_SAMPLING,
"Component index %d: mismatching sampling ratio %d:%d, %d:%d, %c")
#endif
#ifdef JMAKE_ENUM_LIST
JMSG_LASTMSGCODE
} J_MESSAGE_CODE;
#undef JMAKE_ENUM_LIST
#endif /* JMAKE_ENUM_LIST */
/* Zap JMESSAGE macro so that future re-inclusions do nothing by default */
#undef JMESSAGE
#ifndef JERROR_H
#define JERROR_H
/* Macros to simplify using the error and trace message stuff */
/* The first parameter is either type of cinfo pointer */
/* Fatal errors (print message and exit) */
#define ERREXIT(cinfo,code) \
((cinfo)->err->msg_code = (code), \
(*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
#define ERREXIT1(cinfo,code,p1) \
((cinfo)->err->msg_code = (code), \
(cinfo)->err->msg_parm.i[0] = (p1), \
(*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
#define ERREXIT2(cinfo,code,p1,p2) \
((cinfo)->err->msg_code = (code), \
(cinfo)->err->msg_parm.i[0] = (p1), \
(cinfo)->err->msg_parm.i[1] = (p2), \
(*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
#define ERREXIT3(cinfo,code,p1,p2,p3) \
((cinfo)->err->msg_code = (code), \
(cinfo)->err->msg_parm.i[0] = (p1), \
(cinfo)->err->msg_parm.i[1] = (p2), \
(cinfo)->err->msg_parm.i[2] = (p3), \
(*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
#define ERREXIT4(cinfo,code,p1,p2,p3,p4) \
((cinfo)->err->msg_code = (code), \
(cinfo)->err->msg_parm.i[0] = (p1), \
(cinfo)->err->msg_parm.i[1] = (p2), \
(cinfo)->err->msg_parm.i[2] = (p3), \
(cinfo)->err->msg_parm.i[3] = (p4), \
(*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
#define ERREXIT6(cinfo, code, p1, p2, p3, p4, p5, p6) \
((cinfo)->err->msg_code = (code), \
(cinfo)->err->msg_parm.i[0] = (p1), \
(cinfo)->err->msg_parm.i[1] = (p2), \
(cinfo)->err->msg_parm.i[2] = (p3), \
(cinfo)->err->msg_parm.i[3] = (p4), \
(cinfo)->err->msg_parm.i[4] = (p5), \
(cinfo)->err->msg_parm.i[5] = (p6), \
(*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
#define ERREXITS(cinfo, code, str) \
((cinfo)->err->msg_code = (code), \
strncpy((cinfo)->err->msg_parm.s, (str), JMSG_STR_PARM_MAX), \
(cinfo)->err->msg_parm.s[JMSG_STR_PARM_MAX - 1] = '\0', \
(*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
#define MAKESTMT(stuff) do { stuff } while (0)
/* Nonfatal errors (we can keep going, but the data is probably corrupt) */
#define WARNMS(cinfo,code) \
((cinfo)->err->msg_code = (code), \
(*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1))
#define WARNMS1(cinfo,code,p1) \
((cinfo)->err->msg_code = (code), \
(cinfo)->err->msg_parm.i[0] = (p1), \
(*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1))
#define WARNMS2(cinfo,code,p1,p2) \
((cinfo)->err->msg_code = (code), \
(cinfo)->err->msg_parm.i[0] = (p1), \
(cinfo)->err->msg_parm.i[1] = (p2), \
(*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1))
/* Informational/debugging messages */
#define TRACEMS(cinfo,lvl,code) \
((cinfo)->err->msg_code = (code), \
(*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)))
#define TRACEMS1(cinfo,lvl,code,p1) \
((cinfo)->err->msg_code = (code), \
(cinfo)->err->msg_parm.i[0] = (p1), \
(*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)))
#define TRACEMS2(cinfo,lvl,code,p1,p2) \
((cinfo)->err->msg_code = (code), \
(cinfo)->err->msg_parm.i[0] = (p1), \
(cinfo)->err->msg_parm.i[1] = (p2), \
(*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)))
#define TRACEMS3(cinfo,lvl,code,p1,p2,p3) \
MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \
_mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); \
(cinfo)->err->msg_code = (code); \
(*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); )
#define TRACEMS4(cinfo,lvl,code,p1,p2,p3,p4) \
MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \
_mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \
(cinfo)->err->msg_code = (code); \
(*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); )
#define TRACEMS5(cinfo,lvl,code,p1,p2,p3,p4,p5) \
MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \
_mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \
_mp[4] = (p5); \
(cinfo)->err->msg_code = (code); \
(*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); )
#define TRACEMS8(cinfo,lvl,code,p1,p2,p3,p4,p5,p6,p7,p8) \
MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \
_mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \
_mp[4] = (p5); _mp[5] = (p6); _mp[6] = (p7); _mp[7] = (p8); \
(cinfo)->err->msg_code = (code); \
(*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); )
#define TRACEMSS(cinfo,lvl,code,str) \
((cinfo)->err->msg_code = (code), \
strncpy((cinfo)->err->msg_parm.s, (str), JMSG_STR_PARM_MAX), \
(cinfo)->err->msg_parm.s[JMSG_STR_PARM_MAX - 1] = '\0', \
(*(cinfo)->err->emit_message) ((j_common_ptr)(cinfo), (lvl)))
#endif /* JERROR_H */
@@ -0,0 +1,382 @@
/*
* jmorecfg.h
*
* This file was part of the Independent JPEG Group's software:
* Copyright (C) 1991-1997, Thomas G. Lane.
* Modified 1997-2009 by Guido Vollbeding.
* libjpeg-turbo Modifications:
* Copyright (C) 2009, 2011, 2014-2015, 2018, 2020, D. R. Commander.
* For conditions of distribution and use, see the accompanying README.ijg
* file.
*
* This file contains additional configuration options that customize the
* JPEG software for special applications or support machine-dependent
* optimizations. Most users will not need to touch this file.
*/
/*
* Maximum number of components (color channels) allowed in JPEG image.
* To meet the letter of Rec. ITU-T T.81 | ISO/IEC 10918-1, set this to 255.
* However, darn few applications need more than 4 channels (maybe 5 for CMYK +
* alpha mask). We recommend 10 as a reasonable compromise; use 4 if you are
* really short on memory. (Each allowed component costs a hundred or so
* bytes of storage, whether actually used in an image or not.)
*/
#define MAX_COMPONENTS 10 /* maximum number of image components */
/*
* Basic data types.
* You may need to change these if you have a machine with unusual data
* type sizes; for example, "char" not 8 bits, "short" not 16 bits,
* or "long" not 32 bits. We don't care whether "int" is 16 or 32 bits,
* but it had better be at least 16.
*/
/* Representation of a single sample (pixel element value).
* We frequently allocate large arrays of these, so it's important to keep
* them small. But if you have memory to burn and access to char or short
* arrays is very slow on your hardware, you might want to change these.
*/
#if BITS_IN_JSAMPLE == 8
/* JSAMPLE should be the smallest type that will hold the values 0..255.
*/
typedef unsigned char JSAMPLE;
#define GETJSAMPLE(value) ((int)(value))
#define MAXJSAMPLE 255
#define CENTERJSAMPLE 128
#endif /* BITS_IN_JSAMPLE == 8 */
#if BITS_IN_JSAMPLE == 12
/* JSAMPLE should be the smallest type that will hold the values 0..4095.
* On nearly all machines "short" will do nicely.
*/
typedef short JSAMPLE;
#define GETJSAMPLE(value) ((int)(value))
#define MAXJSAMPLE 4095
#define CENTERJSAMPLE 2048
#endif /* BITS_IN_JSAMPLE == 12 */
/* Representation of a DCT frequency coefficient.
* This should be a signed value of at least 16 bits; "short" is usually OK.
* Again, we allocate large arrays of these, but you can change to int
* if you have memory to burn and "short" is really slow.
*/
typedef short JCOEF;
/* Compressed datastreams are represented as arrays of JOCTET.
* These must be EXACTLY 8 bits wide, at least once they are written to
* external storage. Note that when using the stdio data source/destination
* managers, this is also the data type passed to fread/fwrite.
*/
typedef unsigned char JOCTET;
#define GETJOCTET(value) (value)
/* These typedefs are used for various table entries and so forth.
* They must be at least as wide as specified; but making them too big
* won't cost a huge amount of memory, so we don't provide special
* extraction code like we did for JSAMPLE. (In other words, these
* typedefs live at a different point on the speed/space tradeoff curve.)
*/
/* UINT8 must hold at least the values 0..255. */
typedef unsigned char UINT8;
/* UINT16 must hold at least the values 0..65535. */
typedef unsigned short UINT16;
/* INT16 must hold at least the values -32768..32767. */
#ifndef XMD_H /* X11/xmd.h correctly defines INT16 */
typedef short INT16;
#endif
/* INT32 must hold at least signed 32-bit values.
*
* NOTE: The INT32 typedef dates back to libjpeg v5 (1994.) Integers were
* sometimes 16-bit back then (MS-DOS), which is why INT32 is typedef'd to
* long. It also wasn't common (or at least as common) in 1994 for INT32 to be
* defined by platform headers. Since then, however, INT32 is defined in
* several other common places:
*
* Xmd.h (X11 header) typedefs INT32 to int on 64-bit platforms and long on
* 32-bit platforms (i.e always a 32-bit signed type.)
*
* basetsd.h (Win32 header) typedefs INT32 to int (always a 32-bit signed type
* on modern platforms.)
*
* qglobal.h (Qt header) typedefs INT32 to int (always a 32-bit signed type on
* modern platforms.)
*
* This is a recipe for conflict, since "long" and "int" aren't always
* compatible types. Since the definition of INT32 has technically been part
* of the libjpeg API for more than 20 years, we can't remove it, but we do not
* use it internally any longer. We instead define a separate type (JLONG)
* for internal use, which ensures that internal behavior will always be the
* same regardless of any external headers that may be included.
*/
#ifndef XMD_H /* X11/xmd.h correctly defines INT32 */
#ifndef _BASETSD_H_ /* Microsoft defines it in basetsd.h */
#ifndef _BASETSD_H /* MinGW is slightly different */
#ifndef QGLOBAL_H /* Qt defines it in qglobal.h */
typedef long INT32;
#endif
#endif
#endif
#endif
/* Datatype used for image dimensions. The JPEG standard only supports
* images up to 64K*64K due to 16-bit fields in SOF markers. Therefore
* "unsigned int" is sufficient on all machines. However, if you need to
* handle larger images and you don't mind deviating from the spec, you
* can change this datatype. (Note that changing this datatype will
* potentially require modifying the SIMD code. The x86-64 SIMD extensions,
* in particular, assume a 32-bit JDIMENSION.)
*/
typedef unsigned int JDIMENSION;
#define JPEG_MAX_DIMENSION 65500L /* a tad under 64K to prevent overflows */
/* These macros are used in all function definitions and extern declarations.
* You could modify them if you need to change function linkage conventions;
* in particular, you'll need to do that to make the library a Windows DLL.
* Another application is to make all functions global for use with debuggers
* or code profilers that require it.
*/
/* a function called through method pointers: */
#define METHODDEF(type) static type
/* a function used only in its module: */
#define LOCAL(type) static type
/* a function referenced thru EXTERNs: */
#define GLOBAL(type) type
/* a reference to a GLOBAL function: */
#define EXTERN(type) extern type
/* Originally, this macro was used as a way of defining function prototypes
* for both modern compilers as well as older compilers that did not support
* prototype parameters. libjpeg-turbo has never supported these older,
* non-ANSI compilers, but the macro is still included because there is some
* software out there that uses it.
*/
#define JMETHOD(type, methodname, arglist) type (*methodname) arglist
/* libjpeg-turbo no longer supports platforms that have far symbols (MS-DOS),
* but again, some software relies on this macro.
*/
#undef FAR
#define FAR
/*
* On a few systems, type boolean and/or its values FALSE, TRUE may appear
* in standard header files. Or you may have conflicts with application-
* specific header files that you want to include together with these files.
* Defining HAVE_BOOLEAN before including jpeglib.h should make it work.
*/
#ifndef HAVE_BOOLEAN
typedef int boolean;
#endif
#ifndef FALSE /* in case these macros already exist */
#define FALSE 0 /* values of boolean */
#endif
#ifndef TRUE
#define TRUE 1
#endif
/*
* The remaining options affect code selection within the JPEG library,
* but they don't need to be visible to most applications using the library.
* To minimize application namespace pollution, the symbols won't be
* defined unless JPEG_INTERNALS or JPEG_INTERNAL_OPTIONS has been defined.
*/
#ifdef JPEG_INTERNALS
#define JPEG_INTERNAL_OPTIONS
#endif
#ifdef JPEG_INTERNAL_OPTIONS
/*
* These defines indicate whether to include various optional functions.
* Undefining some of these symbols will produce a smaller but less capable
* library. Note that you can leave certain source files out of the
* compilation/linking process if you've #undef'd the corresponding symbols.
* (You may HAVE to do that if your compiler doesn't like null source files.)
*/
/* Capability options common to encoder and decoder: */
#define DCT_ISLOW_SUPPORTED /* accurate integer method */
#define DCT_IFAST_SUPPORTED /* less accurate int method [legacy feature] */
#define DCT_FLOAT_SUPPORTED /* floating-point method [legacy feature] */
/* Encoder capability options: */
#define C_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */
#define C_PROGRESSIVE_SUPPORTED /* Progressive JPEG? (Requires MULTISCAN)*/
#define ENTROPY_OPT_SUPPORTED /* Optimization of entropy coding parms? */
/* Note: if you selected 12-bit data precision, it is dangerous to turn off
* ENTROPY_OPT_SUPPORTED. The standard Huffman tables are only good for 8-bit
* precision, so jchuff.c normally uses entropy optimization to compute
* usable tables for higher precision. If you don't want to do optimization,
* you'll have to supply different default Huffman tables.
* The exact same statements apply for progressive JPEG: the default tables
* don't work for progressive mode. (This may get fixed, however.)
*/
#define INPUT_SMOOTHING_SUPPORTED /* Input image smoothing option? */
/* Decoder capability options: */
#define D_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */
#define D_PROGRESSIVE_SUPPORTED /* Progressive JPEG? (Requires MULTISCAN)*/
#define SAVE_MARKERS_SUPPORTED /* jpeg_save_markers() needed? */
#define BLOCK_SMOOTHING_SUPPORTED /* Block smoothing? (Progressive only) */
#define IDCT_SCALING_SUPPORTED /* Output rescaling via IDCT? */
#undef UPSAMPLE_SCALING_SUPPORTED /* Output rescaling at upsample stage? */
#define UPSAMPLE_MERGING_SUPPORTED /* Fast path for sloppy upsampling? */
#define QUANT_1PASS_SUPPORTED /* 1-pass color quantization? */
#define QUANT_2PASS_SUPPORTED /* 2-pass color quantization? */
/* more capability options later, no doubt */
/*
* The RGB_RED, RGB_GREEN, RGB_BLUE, and RGB_PIXELSIZE macros are a vestigial
* feature of libjpeg. The idea was that, if an application developer needed
* to compress from/decompress to a BGR/BGRX/RGBX/XBGR/XRGB buffer, they could
* change these macros, rebuild libjpeg, and link their application statically
* with it. In reality, few people ever did this, because there were some
* severe restrictions involved (cjpeg and djpeg no longer worked properly,
* compressing/decompressing RGB JPEGs no longer worked properly, and the color
* quantizer wouldn't work with pixel sizes other than 3.) Furthermore, since
* all of the O/S-supplied versions of libjpeg were built with the default
* values of RGB_RED, RGB_GREEN, RGB_BLUE, and RGB_PIXELSIZE, many applications
* have come to regard these values as immutable.
*
* The libjpeg-turbo colorspace extensions provide a much cleaner way of
* compressing from/decompressing to buffers with arbitrary component orders
* and pixel sizes. Thus, we do not support changing the values of RGB_RED,
* RGB_GREEN, RGB_BLUE, or RGB_PIXELSIZE. In addition to the restrictions
* listed above, changing these values will also break the SIMD extensions and
* the regression tests.
*/
#define RGB_RED 0 /* Offset of Red in an RGB scanline element */
#define RGB_GREEN 1 /* Offset of Green */
#define RGB_BLUE 2 /* Offset of Blue */
#define RGB_PIXELSIZE 3 /* JSAMPLEs per RGB scanline element */
#define JPEG_NUMCS 17
#define EXT_RGB_RED 0
#define EXT_RGB_GREEN 1
#define EXT_RGB_BLUE 2
#define EXT_RGB_PIXELSIZE 3
#define EXT_RGBX_RED 0
#define EXT_RGBX_GREEN 1
#define EXT_RGBX_BLUE 2
#define EXT_RGBX_PIXELSIZE 4
#define EXT_BGR_RED 2
#define EXT_BGR_GREEN 1
#define EXT_BGR_BLUE 0
#define EXT_BGR_PIXELSIZE 3
#define EXT_BGRX_RED 2
#define EXT_BGRX_GREEN 1
#define EXT_BGRX_BLUE 0
#define EXT_BGRX_PIXELSIZE 4
#define EXT_XBGR_RED 3
#define EXT_XBGR_GREEN 2
#define EXT_XBGR_BLUE 1
#define EXT_XBGR_PIXELSIZE 4
#define EXT_XRGB_RED 1
#define EXT_XRGB_GREEN 2
#define EXT_XRGB_BLUE 3
#define EXT_XRGB_PIXELSIZE 4
static const int rgb_red[JPEG_NUMCS] = {
-1, -1, RGB_RED, -1, -1, -1, EXT_RGB_RED, EXT_RGBX_RED,
EXT_BGR_RED, EXT_BGRX_RED, EXT_XBGR_RED, EXT_XRGB_RED,
EXT_RGBX_RED, EXT_BGRX_RED, EXT_XBGR_RED, EXT_XRGB_RED,
-1
};
static const int rgb_green[JPEG_NUMCS] = {
-1, -1, RGB_GREEN, -1, -1, -1, EXT_RGB_GREEN, EXT_RGBX_GREEN,
EXT_BGR_GREEN, EXT_BGRX_GREEN, EXT_XBGR_GREEN, EXT_XRGB_GREEN,
EXT_RGBX_GREEN, EXT_BGRX_GREEN, EXT_XBGR_GREEN, EXT_XRGB_GREEN,
-1
};
static const int rgb_blue[JPEG_NUMCS] = {
-1, -1, RGB_BLUE, -1, -1, -1, EXT_RGB_BLUE, EXT_RGBX_BLUE,
EXT_BGR_BLUE, EXT_BGRX_BLUE, EXT_XBGR_BLUE, EXT_XRGB_BLUE,
EXT_RGBX_BLUE, EXT_BGRX_BLUE, EXT_XBGR_BLUE, EXT_XRGB_BLUE,
-1
};
static const int rgb_pixelsize[JPEG_NUMCS] = {
-1, -1, RGB_PIXELSIZE, -1, -1, -1, EXT_RGB_PIXELSIZE, EXT_RGBX_PIXELSIZE,
EXT_BGR_PIXELSIZE, EXT_BGRX_PIXELSIZE, EXT_XBGR_PIXELSIZE, EXT_XRGB_PIXELSIZE,
EXT_RGBX_PIXELSIZE, EXT_BGRX_PIXELSIZE, EXT_XBGR_PIXELSIZE, EXT_XRGB_PIXELSIZE,
-1
};
/* Definitions for speed-related optimizations. */
/* On some machines (notably 68000 series) "int" is 32 bits, but multiplying
* two 16-bit shorts is faster than multiplying two ints. Define MULTIPLIER
* as short on such a machine. MULTIPLIER must be at least 16 bits wide.
*/
#ifndef MULTIPLIER
#ifndef WITH_SIMD
#define MULTIPLIER int /* type for fastest integer multiply */
#else
#define MULTIPLIER short /* prefer 16-bit with SIMD for parellelism */
#endif
#endif
/* FAST_FLOAT should be either float or double, whichever is done faster
* by your compiler. (Note that this type is only used in the floating point
* DCT routines, so it only matters if you've defined DCT_FLOAT_SUPPORTED.)
*/
#ifndef FAST_FLOAT
#define FAST_FLOAT float
#endif
#endif /* JPEG_INTERNAL_OPTIONS */
@@ -0,0 +1,375 @@
/*
* jpegint.h
*
* This file was part of the Independent JPEG Group's software:
* Copyright (C) 1991-1997, Thomas G. Lane.
* Modified 1997-2009 by Guido Vollbeding.
* libjpeg-turbo Modifications:
* Copyright (C) 2015-2016, 2019, 2021, D. R. Commander.
* Copyright (C) 2015, Google, Inc.
* Copyright (C) 2021, Alex Richardson.
* For conditions of distribution and use, see the accompanying README.ijg
* file.
*
* This file provides common declarations for the various JPEG modules.
* These declarations are considered internal to the JPEG library; most
* applications using the library shouldn't need to include this file.
*/
/* Declarations for both compression & decompression */
typedef enum { /* Operating modes for buffer controllers */
JBUF_PASS_THRU, /* Plain stripwise operation */
/* Remaining modes require a full-image buffer to have been created */
JBUF_SAVE_SOURCE, /* Run source subobject only, save output */
JBUF_CRANK_DEST, /* Run dest subobject only, using saved data */
JBUF_SAVE_AND_PASS /* Run both subobjects, save output */
} J_BUF_MODE;
/* Values of global_state field (jdapi.c has some dependencies on ordering!) */
#define CSTATE_START 100 /* after create_compress */
#define CSTATE_SCANNING 101 /* start_compress done, write_scanlines OK */
#define CSTATE_RAW_OK 102 /* start_compress done, write_raw_data OK */
#define CSTATE_WRCOEFS 103 /* jpeg_write_coefficients done */
#define DSTATE_START 200 /* after create_decompress */
#define DSTATE_INHEADER 201 /* reading header markers, no SOS yet */
#define DSTATE_READY 202 /* found SOS, ready for start_decompress */
#define DSTATE_PRELOAD 203 /* reading multiscan file in start_decompress*/
#define DSTATE_PRESCAN 204 /* performing dummy pass for 2-pass quant */
#define DSTATE_SCANNING 205 /* start_decompress done, read_scanlines OK */
#define DSTATE_RAW_OK 206 /* start_decompress done, read_raw_data OK */
#define DSTATE_BUFIMAGE 207 /* expecting jpeg_start_output */
#define DSTATE_BUFPOST 208 /* looking for SOS/EOI in jpeg_finish_output */
#define DSTATE_RDCOEFS 209 /* reading file in jpeg_read_coefficients */
#define DSTATE_STOPPING 210 /* looking for EOI in jpeg_finish_decompress */
/* JLONG must hold at least signed 32-bit values. */
typedef long JLONG;
/* JUINTPTR must hold pointer values. */
#ifdef __UINTPTR_TYPE__
/*
* __UINTPTR_TYPE__ is GNU-specific and available in GCC 4.6+ and Clang 3.0+.
* Fortunately, that is sufficient to support the few architectures for which
* sizeof(void *) != sizeof(size_t). The only other options would require C99
* or Clang-specific builtins.
*/
typedef __UINTPTR_TYPE__ JUINTPTR;
#else
typedef size_t JUINTPTR;
#endif
/*
* Left shift macro that handles a negative operand without causing any
* sanitizer warnings
*/
#define LEFT_SHIFT(a, b) ((JLONG)((unsigned long)(a) << (b)))
/* Declarations for compression modules */
/* Master control module */
struct jpeg_comp_master {
void (*prepare_for_pass) (j_compress_ptr cinfo);
void (*pass_startup) (j_compress_ptr cinfo);
void (*finish_pass) (j_compress_ptr cinfo);
/* State variables made visible to other modules */
boolean call_pass_startup; /* True if pass_startup must be called */
boolean is_last_pass; /* True during last pass */
};
/* Main buffer control (downsampled-data buffer) */
struct jpeg_c_main_controller {
void (*start_pass) (j_compress_ptr cinfo, J_BUF_MODE pass_mode);
void (*process_data) (j_compress_ptr cinfo, JSAMPARRAY input_buf,
JDIMENSION *in_row_ctr, JDIMENSION in_rows_avail);
};
/* Compression preprocessing (downsampling input buffer control) */
struct jpeg_c_prep_controller {
void (*start_pass) (j_compress_ptr cinfo, J_BUF_MODE pass_mode);
void (*pre_process_data) (j_compress_ptr cinfo, JSAMPARRAY input_buf,
JDIMENSION *in_row_ctr, JDIMENSION in_rows_avail,
JSAMPIMAGE output_buf,
JDIMENSION *out_row_group_ctr,
JDIMENSION out_row_groups_avail);
};
/* Coefficient buffer control */
struct jpeg_c_coef_controller {
void (*start_pass) (j_compress_ptr cinfo, J_BUF_MODE pass_mode);
boolean (*compress_data) (j_compress_ptr cinfo, JSAMPIMAGE input_buf);
};
/* Colorspace conversion */
struct jpeg_color_converter {
void (*start_pass) (j_compress_ptr cinfo);
void (*color_convert) (j_compress_ptr cinfo, JSAMPARRAY input_buf,
JSAMPIMAGE output_buf, JDIMENSION output_row,
int num_rows);
};
/* Downsampling */
struct jpeg_downsampler {
void (*start_pass) (j_compress_ptr cinfo);
void (*downsample) (j_compress_ptr cinfo, JSAMPIMAGE input_buf,
JDIMENSION in_row_index, JSAMPIMAGE output_buf,
JDIMENSION out_row_group_index);
boolean need_context_rows; /* TRUE if need rows above & below */
};
/* Forward DCT (also controls coefficient quantization) */
struct jpeg_forward_dct {
void (*start_pass) (j_compress_ptr cinfo);
/* perhaps this should be an array??? */
void (*forward_DCT) (j_compress_ptr cinfo, jpeg_component_info *compptr,
JSAMPARRAY sample_data, JBLOCKROW coef_blocks,
JDIMENSION start_row, JDIMENSION start_col,
JDIMENSION num_blocks);
};
/* Entropy encoding */
struct jpeg_entropy_encoder {
void (*start_pass) (j_compress_ptr cinfo, boolean gather_statistics);
boolean (*encode_mcu) (j_compress_ptr cinfo, JBLOCKROW *MCU_data);
void (*finish_pass) (j_compress_ptr cinfo);
};
/* Marker writing */
struct jpeg_marker_writer {
void (*write_file_header) (j_compress_ptr cinfo);
void (*write_frame_header) (j_compress_ptr cinfo);
void (*write_scan_header) (j_compress_ptr cinfo);
void (*write_file_trailer) (j_compress_ptr cinfo);
void (*write_tables_only) (j_compress_ptr cinfo);
/* These routines are exported to allow insertion of extra markers */
/* Probably only COM and APPn markers should be written this way */
void (*write_marker_header) (j_compress_ptr cinfo, int marker,
unsigned int datalen);
void (*write_marker_byte) (j_compress_ptr cinfo, int val);
};
/* Declarations for decompression modules */
/* Master control module */
struct jpeg_decomp_master {
void (*prepare_for_output_pass) (j_decompress_ptr cinfo);
void (*finish_output_pass) (j_decompress_ptr cinfo);
/* State variables made visible to other modules */
boolean is_dummy_pass; /* True during 1st pass for 2-pass quant */
/* Partial decompression variables */
JDIMENSION first_iMCU_col;
JDIMENSION last_iMCU_col;
JDIMENSION first_MCU_col[MAX_COMPONENTS];
JDIMENSION last_MCU_col[MAX_COMPONENTS];
boolean jinit_upsampler_no_alloc;
/* Last iMCU row that was successfully decoded */
JDIMENSION last_good_iMCU_row;
};
/* Input control module */
struct jpeg_input_controller {
int (*consume_input) (j_decompress_ptr cinfo);
void (*reset_input_controller) (j_decompress_ptr cinfo);
void (*start_input_pass) (j_decompress_ptr cinfo);
void (*finish_input_pass) (j_decompress_ptr cinfo);
/* State variables made visible to other modules */
boolean has_multiple_scans; /* True if file has multiple scans */
boolean eoi_reached; /* True when EOI has been consumed */
};
/* Main buffer control (downsampled-data buffer) */
struct jpeg_d_main_controller {
void (*start_pass) (j_decompress_ptr cinfo, J_BUF_MODE pass_mode);
void (*process_data) (j_decompress_ptr cinfo, JSAMPARRAY output_buf,
JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail);
};
/* Coefficient buffer control */
struct jpeg_d_coef_controller {
void (*start_input_pass) (j_decompress_ptr cinfo);
int (*consume_data) (j_decompress_ptr cinfo);
void (*start_output_pass) (j_decompress_ptr cinfo);
int (*decompress_data) (j_decompress_ptr cinfo, JSAMPIMAGE output_buf);
/* Pointer to array of coefficient virtual arrays, or NULL if none */
jvirt_barray_ptr *coef_arrays;
};
/* Decompression postprocessing (color quantization buffer control) */
struct jpeg_d_post_controller {
void (*start_pass) (j_decompress_ptr cinfo, J_BUF_MODE pass_mode);
void (*post_process_data) (j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
JDIMENSION *in_row_group_ctr,
JDIMENSION in_row_groups_avail,
JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
JDIMENSION out_rows_avail);
};
/* Marker reading & parsing */
struct jpeg_marker_reader {
void (*reset_marker_reader) (j_decompress_ptr cinfo);
/* Read markers until SOS or EOI.
* Returns same codes as are defined for jpeg_consume_input:
* JPEG_SUSPENDED, JPEG_REACHED_SOS, or JPEG_REACHED_EOI.
*/
int (*read_markers) (j_decompress_ptr cinfo);
/* Read a restart marker --- exported for use by entropy decoder only */
jpeg_marker_parser_method read_restart_marker;
/* State of marker reader --- nominally internal, but applications
* supplying COM or APPn handlers might like to know the state.
*/
boolean saw_SOI; /* found SOI? */
boolean saw_SOF; /* found SOF? */
int next_restart_num; /* next restart number expected (0-7) */
unsigned int discarded_bytes; /* # of bytes skipped looking for a marker */
};
/* Entropy decoding */
struct jpeg_entropy_decoder {
void (*start_pass) (j_decompress_ptr cinfo);
boolean (*decode_mcu) (j_decompress_ptr cinfo, JBLOCKROW *MCU_data);
/* This is here to share code between baseline and progressive decoders; */
/* other modules probably should not use it */
boolean insufficient_data; /* set TRUE after emitting warning */
};
/* Inverse DCT (also performs dequantization) */
typedef void (*inverse_DCT_method_ptr) (j_decompress_ptr cinfo,
jpeg_component_info *compptr,
JCOEFPTR coef_block,
JSAMPARRAY output_buf,
JDIMENSION output_col);
struct jpeg_inverse_dct {
void (*start_pass) (j_decompress_ptr cinfo);
/* It is useful to allow each component to have a separate IDCT method. */
inverse_DCT_method_ptr inverse_DCT[MAX_COMPONENTS];
};
/* Upsampling (note that upsampler must also call color converter) */
struct jpeg_upsampler {
void (*start_pass) (j_decompress_ptr cinfo);
void (*upsample) (j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
JDIMENSION *in_row_group_ctr,
JDIMENSION in_row_groups_avail, JSAMPARRAY output_buf,
JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail);
boolean need_context_rows; /* TRUE if need rows above & below */
};
/* Colorspace conversion */
struct jpeg_color_deconverter {
void (*start_pass) (j_decompress_ptr cinfo);
void (*color_convert) (j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
JDIMENSION input_row, JSAMPARRAY output_buf,
int num_rows);
};
/* Color quantization or color precision reduction */
struct jpeg_color_quantizer {
void (*start_pass) (j_decompress_ptr cinfo, boolean is_pre_scan);
void (*color_quantize) (j_decompress_ptr cinfo, JSAMPARRAY input_buf,
JSAMPARRAY output_buf, int num_rows);
void (*finish_pass) (j_decompress_ptr cinfo);
void (*new_color_map) (j_decompress_ptr cinfo);
};
/* Miscellaneous useful macros */
#undef MAX
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#undef MIN
#define MIN(a, b) ((a) < (b) ? (a) : (b))
/* We assume that right shift corresponds to signed division by 2 with
* rounding towards minus infinity. This is correct for typical "arithmetic
* shift" instructions that shift in copies of the sign bit. But some
* C compilers implement >> with an unsigned shift. For these machines you
* must define RIGHT_SHIFT_IS_UNSIGNED.
* RIGHT_SHIFT provides a proper signed right shift of a JLONG quantity.
* It is only applied with constant shift counts. SHIFT_TEMPS must be
* included in the variables of any routine using RIGHT_SHIFT.
*/
#ifdef RIGHT_SHIFT_IS_UNSIGNED
#define SHIFT_TEMPS JLONG shift_temp;
#define RIGHT_SHIFT(x, shft) \
((shift_temp = (x)) < 0 ? \
(shift_temp >> (shft)) | ((~((JLONG)0)) << (32 - (shft))) : \
(shift_temp >> (shft)))
#else
#define SHIFT_TEMPS
#define RIGHT_SHIFT(x, shft) ((x) >> (shft))
#endif
/* Compression module initialization routines */
EXTERN(void) jinit_compress_master(j_compress_ptr cinfo);
EXTERN(void) jinit_c_master_control(j_compress_ptr cinfo,
boolean transcode_only);
EXTERN(void) jinit_c_main_controller(j_compress_ptr cinfo,
boolean need_full_buffer);
EXTERN(void) jinit_c_prep_controller(j_compress_ptr cinfo,
boolean need_full_buffer);
EXTERN(void) jinit_c_coef_controller(j_compress_ptr cinfo,
boolean need_full_buffer);
EXTERN(void) jinit_color_converter(j_compress_ptr cinfo);
EXTERN(void) jinit_downsampler(j_compress_ptr cinfo);
EXTERN(void) jinit_forward_dct(j_compress_ptr cinfo);
EXTERN(void) jinit_huff_encoder(j_compress_ptr cinfo);
EXTERN(void) jinit_phuff_encoder(j_compress_ptr cinfo);
EXTERN(void) jinit_arith_encoder(j_compress_ptr cinfo);
EXTERN(void) jinit_marker_writer(j_compress_ptr cinfo);
/* Decompression module initialization routines */
EXTERN(void) jinit_master_decompress(j_decompress_ptr cinfo);
EXTERN(void) jinit_d_main_controller(j_decompress_ptr cinfo,
boolean need_full_buffer);
EXTERN(void) jinit_d_coef_controller(j_decompress_ptr cinfo,
boolean need_full_buffer);
EXTERN(void) jinit_d_post_controller(j_decompress_ptr cinfo,
boolean need_full_buffer);
EXTERN(void) jinit_input_controller(j_decompress_ptr cinfo);
EXTERN(void) jinit_marker_reader(j_decompress_ptr cinfo);
EXTERN(void) jinit_huff_decoder(j_decompress_ptr cinfo);
EXTERN(void) jinit_phuff_decoder(j_decompress_ptr cinfo);
EXTERN(void) jinit_arith_decoder(j_decompress_ptr cinfo);
EXTERN(void) jinit_inverse_dct(j_decompress_ptr cinfo);
EXTERN(void) jinit_upsampler(j_decompress_ptr cinfo);
EXTERN(void) jinit_color_deconverter(j_decompress_ptr cinfo);
EXTERN(void) jinit_1pass_quantizer(j_decompress_ptr cinfo);
EXTERN(void) jinit_2pass_quantizer(j_decompress_ptr cinfo);
EXTERN(void) jinit_merged_upsampler(j_decompress_ptr cinfo);
/* Memory manager initialization */
EXTERN(void) jinit_memory_mgr(j_common_ptr cinfo);
/* Utility routines in jutils.c */
EXTERN(long) jdiv_round_up(long a, long b);
EXTERN(long) jround_up(long a, long b);
EXTERN(void) jcopy_sample_rows(JSAMPARRAY input_array, int source_row,
JSAMPARRAY output_array, int dest_row,
int num_rows, JDIMENSION num_cols);
EXTERN(void) jcopy_block_row(JBLOCKROW input_row, JBLOCKROW output_row,
JDIMENSION num_blocks);
EXTERN(void) jzero_far(void *target, size_t bytestozero);
/* Constant tables in jutils.c */
#if 0 /* This table is not actually needed in v6a */
extern const int jpeg_zigzag_order[]; /* natural coef order to zigzag order */
#endif
extern const int jpeg_natural_order[]; /* zigzag coef order to natural order */
/* Arithmetic coding probability estimation tables in jaricom.c */
extern const JLONG jpeg_aritab[];
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,202 @@
#pragma once
/* Auto-generated by build_jpegli_static_android_ndk_r26_api21_private_v10_ifs_parse_fix.sh. */
/* Include this header instead of jpegli/jpeglib.h when using the private-symbol Jpegli archive. */
/* It remaps the libjpeg-compatible API to kjpegli_* symbols to avoid collisions with MozJPEG/Ghostscript. */
#ifndef jpegli_CreateCompress
#define jpegli_CreateCompress kjpegli_jpegli_CreateCompress
#endif
#ifndef jpegli_CreateDecompress
#define jpegli_CreateDecompress kjpegli_jpegli_CreateDecompress
#endif
#ifndef jpegli_abort
#define jpegli_abort kjpegli_jpegli_abort
#endif
#ifndef jpegli_abort_compress
#define jpegli_abort_compress kjpegli_jpegli_abort_compress
#endif
#ifndef jpegli_abort_decompress
#define jpegli_abort_decompress kjpegli_jpegli_abort_decompress
#endif
#ifndef jpegli_add_quant_table
#define jpegli_add_quant_table kjpegli_jpegli_add_quant_table
#endif
#ifndef jpegli_alloc_huff_table
#define jpegli_alloc_huff_table kjpegli_jpegli_alloc_huff_table
#endif
#ifndef jpegli_alloc_quant_table
#define jpegli_alloc_quant_table kjpegli_jpegli_alloc_quant_table
#endif
#ifndef jpegli_bytes_per_sample
#define jpegli_bytes_per_sample kjpegli_jpegli_bytes_per_sample
#endif
#ifndef jpegli_calc_output_dimensions
#define jpegli_calc_output_dimensions kjpegli_jpegli_calc_output_dimensions
#endif
#ifndef jpegli_consume_input
#define jpegli_consume_input kjpegli_jpegli_consume_input
#endif
#ifndef jpegli_copy_critical_parameters
#define jpegli_copy_critical_parameters kjpegli_jpegli_copy_critical_parameters
#endif
#ifndef jpegli_crop_scanline
#define jpegli_crop_scanline kjpegli_jpegli_crop_scanline
#endif
#ifndef jpegli_default_colorspace
#define jpegli_default_colorspace kjpegli_jpegli_default_colorspace
#endif
#ifndef jpegli_destroy
#define jpegli_destroy kjpegli_jpegli_destroy
#endif
#ifndef jpegli_destroy_compress
#define jpegli_destroy_compress kjpegli_jpegli_destroy_compress
#endif
#ifndef jpegli_destroy_decompress
#define jpegli_destroy_decompress kjpegli_jpegli_destroy_decompress
#endif
#ifndef jpegli_enable_adaptive_quantization
#define jpegli_enable_adaptive_quantization kjpegli_jpegli_enable_adaptive_quantization
#endif
#ifndef jpegli_finish_compress
#define jpegli_finish_compress kjpegli_jpegli_finish_compress
#endif
#ifndef jpegli_finish_decompress
#define jpegli_finish_decompress kjpegli_jpegli_finish_decompress
#endif
#ifndef jpegli_finish_output
#define jpegli_finish_output kjpegli_jpegli_finish_output
#endif
#ifndef jpegli_has_multiple_scans
#define jpegli_has_multiple_scans kjpegli_jpegli_has_multiple_scans
#endif
#ifndef jpegli_input_complete
#define jpegli_input_complete kjpegli_jpegli_input_complete
#endif
#ifndef jpegli_mem_dest
#define jpegli_mem_dest kjpegli_jpegli_mem_dest
#endif
#ifndef jpegli_mem_src
#define jpegli_mem_src kjpegli_jpegli_mem_src
#endif
#ifndef jpegli_new_colormap
#define jpegli_new_colormap kjpegli_jpegli_new_colormap
#endif
#ifndef jpegli_quality_scaling
#define jpegli_quality_scaling kjpegli_jpegli_quality_scaling
#endif
#ifndef jpegli_quality_to_distance
#define jpegli_quality_to_distance kjpegli_jpegli_quality_to_distance
#endif
#ifndef jpegli_read_coefficients
#define jpegli_read_coefficients kjpegli_jpegli_read_coefficients
#endif
#ifndef jpegli_read_header
#define jpegli_read_header kjpegli_jpegli_read_header
#endif
#ifndef jpegli_read_icc_profile
#define jpegli_read_icc_profile kjpegli_jpegli_read_icc_profile
#endif
#ifndef jpegli_read_raw_data
#define jpegli_read_raw_data kjpegli_jpegli_read_raw_data
#endif
#ifndef jpegli_read_scanlines
#define jpegli_read_scanlines kjpegli_jpegli_read_scanlines
#endif
#ifndef jpegli_resync_to_restart
#define jpegli_resync_to_restart kjpegli_jpegli_resync_to_restart
#endif
#ifndef jpegli_save_markers
#define jpegli_save_markers kjpegli_jpegli_save_markers
#endif
#ifndef jpegli_set_cicp_transfer_function
#define jpegli_set_cicp_transfer_function kjpegli_jpegli_set_cicp_transfer_function
#endif
#ifndef jpegli_set_colorspace
#define jpegli_set_colorspace kjpegli_jpegli_set_colorspace
#endif
#ifndef jpegli_set_defaults
#define jpegli_set_defaults kjpegli_jpegli_set_defaults
#endif
#ifndef jpegli_set_distance
#define jpegli_set_distance kjpegli_jpegli_set_distance
#endif
#ifndef jpegli_set_input_format
#define jpegli_set_input_format kjpegli_jpegli_set_input_format
#endif
#ifndef jpegli_set_linear_quality
#define jpegli_set_linear_quality kjpegli_jpegli_set_linear_quality
#endif
#ifndef jpegli_set_marker_processor
#define jpegli_set_marker_processor kjpegli_jpegli_set_marker_processor
#endif
#ifndef jpegli_set_output_format
#define jpegli_set_output_format kjpegli_jpegli_set_output_format
#endif
#ifndef jpegli_set_progressive_level
#define jpegli_set_progressive_level kjpegli_jpegli_set_progressive_level
#endif
#ifndef jpegli_set_psnr
#define jpegli_set_psnr kjpegli_jpegli_set_psnr
#endif
#ifndef jpegli_set_quality
#define jpegli_set_quality kjpegli_jpegli_set_quality
#endif
#ifndef jpegli_set_xyb_mode
#define jpegli_set_xyb_mode kjpegli_jpegli_set_xyb_mode
#endif
#ifndef jpegli_simple_progression
#define jpegli_simple_progression kjpegli_jpegli_simple_progression
#endif
#ifndef jpegli_skip_scanlines
#define jpegli_skip_scanlines kjpegli_jpegli_skip_scanlines
#endif
#ifndef jpegli_start_compress
#define jpegli_start_compress kjpegli_jpegli_start_compress
#endif
#ifndef jpegli_start_decompress
#define jpegli_start_decompress kjpegli_jpegli_start_decompress
#endif
#ifndef jpegli_start_output
#define jpegli_start_output kjpegli_jpegli_start_output
#endif
#ifndef jpegli_std_error
#define jpegli_std_error kjpegli_jpegli_std_error
#endif
#ifndef jpegli_stdio_dest
#define jpegli_stdio_dest kjpegli_jpegli_stdio_dest
#endif
#ifndef jpegli_stdio_src
#define jpegli_stdio_src kjpegli_jpegli_stdio_src
#endif
#ifndef jpegli_suppress_tables
#define jpegli_suppress_tables kjpegli_jpegli_suppress_tables
#endif
#ifndef jpegli_use_standard_quant_tables
#define jpegli_use_standard_quant_tables kjpegli_jpegli_use_standard_quant_tables
#endif
#ifndef jpegli_write_coefficients
#define jpegli_write_coefficients kjpegli_jpegli_write_coefficients
#endif
#ifndef jpegli_write_icc_profile
#define jpegli_write_icc_profile kjpegli_jpegli_write_icc_profile
#endif
#ifndef jpegli_write_m_byte
#define jpegli_write_m_byte kjpegli_jpegli_write_m_byte
#endif
#ifndef jpegli_write_m_header
#define jpegli_write_m_header kjpegli_jpegli_write_m_header
#endif
#ifndef jpegli_write_marker
#define jpegli_write_marker kjpegli_jpegli_write_marker
#endif
#ifndef jpegli_write_raw_data
#define jpegli_write_raw_data kjpegli_jpegli_write_raw_data
#endif
#ifndef jpegli_write_scanlines
#define jpegli_write_scanlines kjpegli_jpegli_write_scanlines
#endif
#ifndef jpegli_write_tables
#define jpegli_write_tables kjpegli_jpegli_write_tables
#endif
#include <jpegli/jpeglib.h>
@@ -0,0 +1,65 @@
jpegli_CreateCompress kjpegli_jpegli_CreateCompress
jpegli_CreateDecompress kjpegli_jpegli_CreateDecompress
jpegli_abort kjpegli_jpegli_abort
jpegli_abort_compress kjpegli_jpegli_abort_compress
jpegli_abort_decompress kjpegli_jpegli_abort_decompress
jpegli_add_quant_table kjpegli_jpegli_add_quant_table
jpegli_alloc_huff_table kjpegli_jpegli_alloc_huff_table
jpegli_alloc_quant_table kjpegli_jpegli_alloc_quant_table
jpegli_bytes_per_sample kjpegli_jpegli_bytes_per_sample
jpegli_calc_output_dimensions kjpegli_jpegli_calc_output_dimensions
jpegli_consume_input kjpegli_jpegli_consume_input
jpegli_copy_critical_parameters kjpegli_jpegli_copy_critical_parameters
jpegli_crop_scanline kjpegli_jpegli_crop_scanline
jpegli_default_colorspace kjpegli_jpegli_default_colorspace
jpegli_destroy kjpegli_jpegli_destroy
jpegli_destroy_compress kjpegli_jpegli_destroy_compress
jpegli_destroy_decompress kjpegli_jpegli_destroy_decompress
jpegli_enable_adaptive_quantization kjpegli_jpegli_enable_adaptive_quantization
jpegli_finish_compress kjpegli_jpegli_finish_compress
jpegli_finish_decompress kjpegli_jpegli_finish_decompress
jpegli_finish_output kjpegli_jpegli_finish_output
jpegli_has_multiple_scans kjpegli_jpegli_has_multiple_scans
jpegli_input_complete kjpegli_jpegli_input_complete
jpegli_mem_dest kjpegli_jpegli_mem_dest
jpegli_mem_src kjpegli_jpegli_mem_src
jpegli_new_colormap kjpegli_jpegli_new_colormap
jpegli_quality_scaling kjpegli_jpegli_quality_scaling
jpegli_quality_to_distance kjpegli_jpegli_quality_to_distance
jpegli_read_coefficients kjpegli_jpegli_read_coefficients
jpegli_read_header kjpegli_jpegli_read_header
jpegli_read_icc_profile kjpegli_jpegli_read_icc_profile
jpegli_read_raw_data kjpegli_jpegli_read_raw_data
jpegli_read_scanlines kjpegli_jpegli_read_scanlines
jpegli_resync_to_restart kjpegli_jpegli_resync_to_restart
jpegli_save_markers kjpegli_jpegli_save_markers
jpegli_set_cicp_transfer_function kjpegli_jpegli_set_cicp_transfer_function
jpegli_set_colorspace kjpegli_jpegli_set_colorspace
jpegli_set_defaults kjpegli_jpegli_set_defaults
jpegli_set_distance kjpegli_jpegli_set_distance
jpegli_set_input_format kjpegli_jpegli_set_input_format
jpegli_set_linear_quality kjpegli_jpegli_set_linear_quality
jpegli_set_marker_processor kjpegli_jpegli_set_marker_processor
jpegli_set_output_format kjpegli_jpegli_set_output_format
jpegli_set_progressive_level kjpegli_jpegli_set_progressive_level
jpegli_set_psnr kjpegli_jpegli_set_psnr
jpegli_set_quality kjpegli_jpegli_set_quality
jpegli_set_xyb_mode kjpegli_jpegli_set_xyb_mode
jpegli_simple_progression kjpegli_jpegli_simple_progression
jpegli_skip_scanlines kjpegli_jpegli_skip_scanlines
jpegli_start_compress kjpegli_jpegli_start_compress
jpegli_start_decompress kjpegli_jpegli_start_decompress
jpegli_start_output kjpegli_jpegli_start_output
jpegli_std_error kjpegli_jpegli_std_error
jpegli_stdio_dest kjpegli_jpegli_stdio_dest
jpegli_stdio_src kjpegli_jpegli_stdio_src
jpegli_suppress_tables kjpegli_jpegli_suppress_tables
jpegli_use_standard_quant_tables kjpegli_jpegli_use_standard_quant_tables
jpegli_write_coefficients kjpegli_jpegli_write_coefficients
jpegli_write_icc_profile kjpegli_jpegli_write_icc_profile
jpegli_write_m_byte kjpegli_jpegli_write_m_byte
jpegli_write_m_header kjpegli_jpegli_write_m_header
jpegli_write_marker kjpegli_jpegli_write_marker
jpegli_write_raw_data kjpegli_jpegli_write_raw_data
jpegli_write_scanlines kjpegli_jpegli_write_scanlines
jpegli_write_tables kjpegli_jpegli_write_tables
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -96,7 +96,7 @@ public final class NativeCompressor {
/**
* outputFormat:
* jpeg = MozJPEG/TurboJPEG output .jpg
* jpeg = JPEG output .jpg. Backend utama Jpegli, fallback MozJPEG.
* png_lossless = PNG RGBA + OxiPNG lossless
* png_lossy = libimagequant palette PNG + OxiPNG, mirip TinyPNG
* webp = WebP lossy
@@ -119,9 +119,31 @@ public final class NativeCompressor {
String outputFormat,
int quality,
int maxLongSide,
boolean useZopfli,
ProgressCallback callback
);
public static int compressImageFd(
int inputFd,
int outputFd,
String inputMime,
String outputFormat,
int quality,
int maxLongSide,
ProgressCallback callback
) {
return compressImageFd(
inputFd,
outputFd,
inputMime,
outputFormat,
quality,
maxLongSide,
false,
callback
);
}
/**
* Cek status password PDF:
* PDF_PASSWORD_NOT_ENCRYPTED = PDF tidak terenkripsi.
@@ -141,13 +163,52 @@ public final class NativeCompressor {
* ProcessingActivity akan menyalin hasil temp file ke MediaStore/Downloads.
* Ini lebih aman daripada output langsung ke FD SAF karena proses PDF membutuhkan path seekable.
*/
public static native int compressPdfFdToPath(
public static native int compressPdfFdToPathWithLevel(
int inputFd,
String outputPath,
String password,
int compressionLevel,
boolean useZopfli,
ProgressCallback callback
);
public static int compressPdfFdToPathWithLevel(
int inputFd,
String outputPath,
String password,
int compressionLevel,
ProgressCallback callback
) {
return compressPdfFdToPathWithLevel(
inputFd,
outputPath,
password,
compressionLevel,
false,
callback
);
}
/**
* Wrapper kompatibilitas untuk caller lama.
* Default memakai level 3 Recommended: 80 DPI / JPEGQ 55.
*/
public static int compressPdfFdToPath(
int inputFd,
String outputPath,
String password,
boolean useZopfli,
ProgressCallback callback
);
) {
return compressPdfFdToPathWithLevel(
inputFd,
outputPath,
password,
3,
useZopfli,
callback
);
}
/**
* Cek apakah FFmpeg build native memiliki encoder tertentu.
@@ -32,6 +32,7 @@ import java.io.File;
import java.io.FileInputStream;
import java.io.OutputStream;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.Locale;
@@ -62,6 +63,8 @@ public class ProcessingActivity extends Activity {
private long endTimeMs = 0L;
private Uri inputUri;
private final ArrayList<Uri> imageInputUris = new ArrayList<>();
private final ArrayList<String> imageInputMimes = new ArrayList<>();
private Uri outputUri;
private String outputMime = "video/mp4";
private boolean imageJob = false;
@@ -90,12 +93,15 @@ public class ProcessingActivity extends Activity {
private String imageResolutionLabel;
private int imageQuality;
private String imageQualityLabel;
private boolean imageExtremeCompression;
private String pdfPassword;
private boolean pdfPasswordRequired;
private String pdfDisplayName;
private String pdfCompressionEngine;
private String pdfCompressionLabel;
private int pdfCompressionLevel;
private boolean pdfExtremeCompression;
private volatile boolean cancelRequested = false;
private volatile boolean finished = false;
@@ -175,7 +181,9 @@ public class ProcessingActivity extends Activity {
readIntentExtras();
updateConfigCard();
txtProcessingTitle.setText(pdfJob ? "Compressing PDF" : (imageJob ? "Compressing Image" : "Compressing Video"));
txtProcessingTitle.setText(pdfJob ? "Compressing PDF" : (imageJob
? (getImageJobCount() > 1 ? "Processing Images" : "Compressing Image")
: "Compressing Video"));
btnShareVideo.setText(imageJob ? "Share Image" : "Share Video");
btnShareDoc.setText(pdfJob ? "Share Doc" : "Share Doc");
@@ -199,6 +207,27 @@ public class ProcessingActivity extends Activity {
imageJob = MainActivity.JOB_TYPE_IMAGE.equals(jobType);
pdfJob = MainActivity.JOB_TYPE_PDF.equals(jobType);
if (imageJob) {
ArrayList<String> uriStrings = getIntent().getStringArrayListExtra(MainActivity.EXTRA_INPUT_URIS);
ArrayList<String> mimeStrings = getIntent().getStringArrayListExtra(MainActivity.EXTRA_INPUT_MIMES);
if (uriStrings != null) {
for (String uriString : uriStrings) {
if (uriString != null && uriString.length() > 0) {
imageInputUris.add(Uri.parse(uriString));
}
}
}
if (mimeStrings != null) {
imageInputMimes.addAll(mimeStrings);
}
if (imageInputUris.isEmpty() && inputUri != null) {
imageInputUris.add(inputUri);
}
if (inputUri == null && !imageInputUris.isEmpty()) {
inputUri = imageInputUris.get(0);
}
}
targetShortSide = getIntent().getIntExtra(MainActivity.EXTRA_TARGET_SHORT, 0);
inputRotationDegrees = getIntent().getIntExtra(MainActivity.EXTRA_VIDEO_ROTATION, 0);
crf = getIntent().getIntExtra(MainActivity.EXTRA_CRF, 26);
@@ -222,12 +251,15 @@ public class ProcessingActivity extends Activity {
imageResolutionLabel = getIntent().getStringExtra(MainActivity.EXTRA_IMAGE_RESOLUTION_LABEL);
imageQuality = getIntent().getIntExtra(MainActivity.EXTRA_IMAGE_QUALITY, 82);
imageQualityLabel = getIntent().getStringExtra(MainActivity.EXTRA_IMAGE_QUALITY_LABEL);
imageExtremeCompression = getIntent().getBooleanExtra(MainActivity.EXTRA_IMAGE_EXTREME_COMPRESSION, false);
pdfPassword = getIntent().getStringExtra(MainActivity.EXTRA_PDF_PASSWORD);
pdfPasswordRequired = getIntent().getBooleanExtra(MainActivity.EXTRA_PDF_PASSWORD_REQUIRED, false);
pdfDisplayName = getIntent().getStringExtra(MainActivity.EXTRA_PDF_DISPLAY_NAME);
pdfCompressionEngine = getIntent().getStringExtra(MainActivity.EXTRA_PDF_COMPRESSION_ENGINE);
pdfCompressionLabel = getIntent().getStringExtra(MainActivity.EXTRA_PDF_COMPRESSION_LABEL);
pdfCompressionLevel = getIntent().getIntExtra(MainActivity.EXTRA_PDF_COMPRESSION_LEVEL, 3);
pdfExtremeCompression = getIntent().getBooleanExtra(MainActivity.EXTRA_PDF_EXTREME_COMPRESSION, false);
if (encoderName == null) encoderName = "libx264";
if (codecLabel == null) codecLabel = "H.264 / AVC";
@@ -243,11 +275,14 @@ public class ProcessingActivity extends Activity {
if (inputMime == null) inputMime = "";
if (outputFormat == null) outputFormat = "jpeg";
if (imageFormatLabel == null) imageFormatLabel = "JPEG / MozJPEG";
if (imageFormatLabel == null) imageFormatLabel = "JPEG";
if (imageResolutionLabel == null) imageResolutionLabel = "Original";
if (imageQualityLabel == null) imageQualityLabel = "Quality " + imageQuality;
if (pdfPassword == null) pdfPassword = "";
if (pdfDisplayName == null) pdfDisplayName = "";
if (pdfExtremeCompression) {
pdfCompressionEngine = "zopfli";
}
if (pdfCompressionEngine == null || pdfCompressionEngine.length() == 0) pdfCompressionEngine = "zlib";
if (pdfCompressionLabel == null || pdfCompressionLabel.length() == 0) {
pdfCompressionLabel = "zopfli".equalsIgnoreCase(pdfCompressionEngine)
@@ -263,6 +298,7 @@ public class ProcessingActivity extends Activity {
"Format : PDF\n" +
"Mode : Smart PDF Compress\n" +
"Engine : " + pdfCompressionLabel + "\n" +
"Level : " + pdfCompressionLevel + (pdfExtremeCompression ? " + Extreme" : "") + "\n" +
"Kualitas : Visually lossless\n" +
"Password : " + (pdfPasswordRequired ? "Ya, tervalidasi" : "Tidak") +
(pdfDisplayName != null && pdfDisplayName.length() > 0
@@ -277,7 +313,9 @@ public class ProcessingActivity extends Activity {
"Format : " + imageFormatLabel + "\n" +
"Resolusi : " + imageResolutionLabel + "\n" +
"Quality : " + imageQualityLabel + "\n" +
"Input MIME : " + (inputMime.length() == 0 ? "-" : inputMime)
"Extreme : " + (imageExtremeCompression ? "Aktif" : "Tidak") + "\n" +
"Jumlah : " + getImageJobCount() + "\n" +
"Input MIME : " + getImageInputMimeSummary()
);
return;
}
@@ -332,6 +370,34 @@ public class ProcessingActivity extends Activity {
return "\nAuto : " + sourceNote;
}
private int getImageJobCount() {
return imageInputUris.isEmpty() ? (inputUri == null ? 0 : 1) : imageInputUris.size();
}
private String getImageInputMimeSummary() {
if (getImageJobCount() <= 1) {
return inputMime != null && inputMime.length() > 0 ? inputMime : "-";
}
ArrayList<String> labels = new ArrayList<>();
for (String mime : imageInputMimes) {
if (mime != null && mime.length() > 0 && !labels.contains(mime)) {
labels.add(mime);
}
}
if (labels.isEmpty()) {
return "Batch";
}
StringBuilder builder = new StringBuilder();
for (int i = 0; i < labels.size(); i++) {
if (i > 0) builder.append(", ");
builder.append(labels.get(i));
}
return builder.toString();
}
private void startCompression() {
if (inputUri == null) {
allowScreenOffAfterProcessing();
@@ -353,6 +419,11 @@ public class ProcessingActivity extends Activity {
handler.post(elapsedRunnable);
workerThread = new Thread(() -> {
if (imageJob && getImageJobCount() > 1) {
runImageBatchCompression();
return;
}
ParcelFileDescriptor inputPfd = null;
ParcelFileDescriptor outputPfd = null;
File tempOutputFile = null;
@@ -366,14 +437,20 @@ public class ProcessingActivity extends Activity {
}
final long originalSizeBytes = getUriSize(inputUri);
final String actualImageOutputFormat = imageJob
? resolveActualImageOutputFormat(outputFormat, inputMime)
: outputFormat;
final String jobOutputMime = imageJob
? mimeForImageFormat(actualImageOutputFormat)
: outputMime;
String outputName = pdfJob
? makePdfOutputName()
: (imageJob
? makeImageOutputName(outputFormat, targetShortSide, imageQuality)
? makeImageOutputName(actualImageOutputFormat, targetShortSide, imageQuality)
: makeVideoOutputName(encoderName, targetShortSide, crf, videoBitrate));
outputPfd = createOutputFile(outputName, outputMime, imageJob, pdfJob);
outputPfd = createOutputFile(outputName, jobOutputMime, imageJob, pdfJob);
if (outputPfd == null) {
throw new IllegalStateException("Output PFD null");
}
@@ -400,23 +477,26 @@ public class ProcessingActivity extends Activity {
inputPfd.getFd(),
outputPfd.getFd(),
inputMime,
outputFormat,
actualImageOutputFormat,
imageQuality,
targetShortSide,
imageExtremeCompression,
(percent, message) -> runOnUiThread(() ->
updateCompressionProgress(percent, message)
)
);
} else if (pdfJob) {
final boolean useZopfli = "zopfli".equalsIgnoreCase(pdfCompressionEngine);
Log.i(TAG, "call compressPdfFdToPath inputFd=" + inputPfd.getFd()
final boolean useZopfli = pdfExtremeCompression || "zopfli".equalsIgnoreCase(pdfCompressionEngine);
Log.i(TAG, "call compressPdfFdToPathWithLevel inputFd=" + inputPfd.getFd()
+ " output=" + (tempOutputFile != null ? tempOutputFile.getAbsolutePath() : "null")
+ " passwordEmpty=" + (pdfPassword == null || pdfPassword.length() == 0)
+ " engine=" + pdfCompressionEngine);
result = NativeCompressor.compressPdfFdToPath(
+ " level=" + pdfCompressionLevel
+ " extreme=" + useZopfli);
result = NativeCompressor.compressPdfFdToPathWithLevel(
inputPfd.getFd(),
tempOutputFile.getAbsolutePath(),
pdfPassword,
pdfCompressionLevel,
useZopfli,
(percent, message) -> runOnUiThread(() ->
updateCompressionProgress(percent, message)
@@ -468,7 +548,7 @@ public class ProcessingActivity extends Activity {
tempOutputFile = null;
}
publishOutput(finalOutputUri, outputMime, imageJob, pdfJob);
publishOutput(finalOutputUri, jobOutputMime, imageJob, pdfJob);
final long compressedSizeBytes = getUriSize(finalOutputUri);
final String outputResultText = buildOutputResultText(
@@ -536,6 +616,184 @@ public class ProcessingActivity extends Activity {
workerThread.start();
}
private void runImageBatchCompression() {
int total = getImageJobCount();
int successCount = 0;
int failedCount = 0;
long originalTotalBytes = 0L;
long outputTotalBytes = 0L;
try {
for (int i = 0; i < total; i++) {
if (cancelRequested) {
cancelRequested = true;
break;
}
Uri itemInputUri = imageInputUris.get(i);
String itemInputMime = i < imageInputMimes.size() ? imageInputMimes.get(i) : "";
String actualOutputFormat = resolveActualImageOutputFormat(outputFormat, itemInputMime);
String itemOutputMime = mimeForImageFormat(actualOutputFormat);
String outputName = makeImageOutputName(
actualOutputFormat,
targetShortSide,
imageQuality,
readDisplayName(itemInputUri),
i + 1,
total
);
ParcelFileDescriptor inputPfd = null;
ParcelFileDescriptor outputPfd = null;
Uri itemOutputUri = null;
int result = -1;
try {
final int itemIndex = i;
runOnUiThread(() -> updateCompressionProgress(
(itemIndex * 100) / total,
"Gambar " + (itemIndex + 1) + "/" + total + ": Membaca gambar..."
));
inputPfd = getContentResolver().openFileDescriptor(itemInputUri, "r");
if (inputPfd == null) {
throw new IllegalStateException("Input PFD null");
}
long originalSize = getUriSize(itemInputUri);
if (originalSize > 0L) {
originalTotalBytes += originalSize;
}
outputPfd = createOutputFile(outputName, itemOutputMime, true, false);
itemOutputUri = outputUri;
if (outputPfd == null || itemOutputUri == null) {
throw new IllegalStateException("Output PFD null");
}
final int progressBase = (i * 100) / total;
final int progressSpan = Math.max(1, 100 / total);
result = NativeCompressor.compressImageFd(
inputPfd.getFd(),
outputPfd.getFd(),
itemInputMime,
actualOutputFormat,
imageQuality,
targetShortSide,
imageExtremeCompression,
(percent, message) -> {
int mapped = progressBase + Math.max(0, Math.min(99, percent)) * progressSpan / 100;
if (mapped >= 100) mapped = 99;
final int mappedProgress = mapped;
String safeMessage = message == null ? "" : message;
runOnUiThread(() -> updateCompressionProgress(
mappedProgress,
"Gambar " + (itemIndex + 1) + "/" + total + ": " + safeMessage
));
}
);
closeQuietly(outputPfd);
outputPfd = null;
closeQuietly(inputPfd);
inputPfd = null;
if (result == 0 && itemOutputUri != null && !cancelRequested) {
publishOutput(itemOutputUri, itemOutputMime, true, false);
long outputSize = getUriSize(itemOutputUri);
if (outputSize > 0L) {
outputTotalBytes += outputSize;
}
successCount++;
outputUri = itemOutputUri;
} else {
deleteFailedOutput(itemOutputUri);
if (cancelRequested || result == -125) {
cancelRequested = true;
break;
}
failedCount++;
}
} catch (Exception itemError) {
Log.e(TAG, "batch image item failed index=" + i, itemError);
deleteFailedOutput(itemOutputUri);
failedCount++;
} finally {
closeQuietly(inputPfd);
closeQuietly(outputPfd);
}
}
endTimeMs = System.currentTimeMillis();
final int finalSuccessCount = successCount;
final int finalFailedCount = failedCount;
final long finalOriginalTotalBytes = originalTotalBytes;
final long finalOutputTotalBytes = outputTotalBytes;
if (cancelRequested) {
runOnUiThread(() -> {
handler.removeCallbacks(elapsedRunnable);
handler.removeCallbacks(smoothProgressRunnable);
allowScreenOffAfterProcessing();
txtStatus.setText("Batch gambar dibatalkan");
txtElapsed.setText("Total waktu: " + formatElapsed(endTimeMs - startTimeMs));
toast("Batch gambar dibatalkan");
finish();
});
return;
}
if (finalSuccessCount > 0) {
final String outputResultText = buildBatchImageOutputResultText(
total,
finalSuccessCount,
finalFailedCount,
finalOriginalTotalBytes,
finalOutputTotalBytes
);
runOnUiThread(() -> {
finished = true;
handler.removeCallbacks(elapsedRunnable);
handler.removeCallbacks(smoothProgressRunnable);
allowScreenOffAfterProcessing();
showSuccessVisualState();
txtElapsed.setText("Total waktu: " + formatElapsed(endTimeMs - startTimeMs));
if (layoutOutputCard != null) {
layoutOutputCard.setVisibility(View.VISIBLE);
}
txtOutput.setText(outputResultText);
btnShareVideo.setVisibility(View.GONE);
btnShareDoc.setVisibility(View.GONE);
btnCancel.setText("Selesai");
btnCancel.setEnabled(true);
btnCancel.setOnClickListener(v -> finish());
toast("Batch gambar selesai");
});
} else {
runOnUiThread(() -> showFailed(-4));
}
} catch (Exception e) {
Log.e(TAG, "batch worker exception", e);
endTimeMs = System.currentTimeMillis();
runOnUiThread(() -> {
finished = true;
handler.removeCallbacks(elapsedRunnable);
handler.removeCallbacks(smoothProgressRunnable);
allowScreenOffAfterProcessing();
btnShareVideo.setVisibility(View.GONE);
btnShareDoc.setVisibility(View.GONE);
txtStatus.setText("Error: " + e.getMessage());
txtElapsed.setText("Total waktu: " + formatElapsed(endTimeMs - startTimeMs));
btnCancel.setText("Kembali");
btnCancel.setEnabled(true);
btnCancel.setOnClickListener(v -> finish());
toast("Error: " + e.getMessage());
});
}
}
private void resetProcessingVisualState() {
circleProgress.setVisibility(View.VISIBLE);
if (layoutOutputCard != null) {
@@ -951,6 +1209,15 @@ public class ProcessingActivity extends Activity {
}
private String makeImageOutputName(String format, int targetShortSide, int quality) {
return makeImageOutputName(format, targetShortSide, quality, null, 0, 1);
}
private String makeImageOutputName(String format,
int targetShortSide,
int quality,
String sourceName,
int batchIndex,
int batchTotal) {
String safeFormat = format == null ? "jpeg" : format.toLowerCase(Locale.US);
String ext;
String tag;
@@ -977,8 +1244,22 @@ public class ProcessingActivity extends Activity {
String res = targetShortSide <= 0 ? "original" : targetShortSide + "p";
String stamp = new SimpleDateFormat("yyyyMMdd_HHmmss", Locale.US).format(new Date());
boolean hasSourceName = sourceName != null && sourceName.length() > 0;
String base = hasSourceName ? sourceName : "";
int dot = base.lastIndexOf('.');
if (dot > 0) {
base = base.substring(0, dot);
}
base = base.replaceAll("[^a-zA-Z0-9._-]", "_");
if (hasSourceName && base.length() == 0) {
base = "KCompressor";
}
String prefix = hasSourceName ? base + "_KCompressor" : "KCompressor";
String batchSuffix = batchTotal > 1 && batchIndex > 0
? "_" + String.format(Locale.US, "%03d", batchIndex)
: "";
return "KCompressor_" + tag + "_" + res + "_q" + quality + "_" + stamp + "." + ext;
return prefix + "_" + tag + "_" + res + "_q" + quality + batchSuffix + "_" + stamp + "." + ext;
}
@@ -1083,6 +1364,92 @@ public class ProcessingActivity extends Activity {
return "image/jpeg";
}
private String resolveActualImageOutputFormat(String requestedFormat, String sourceMime) {
String safeFormat = requestedFormat == null ? "" : requestedFormat.toLowerCase(Locale.US);
if (!"original".equals(safeFormat)) {
return safeFormat.length() > 0 ? safeFormat : "jpeg";
}
String mime = sourceMime == null ? "" : sourceMime.toLowerCase(Locale.US);
if (mime.contains("png")) {
return "png_lossy";
}
if (mime.contains("webp")) {
return "webp";
}
if (mime.contains("avif")) {
return "avif";
}
return "jpeg";
}
private String buildBatchImageOutputResultText(int total,
int success,
int failed,
long originalSizeBytes,
long compressedSizeBytes) {
StringBuilder builder = new StringBuilder();
builder.append("Batch gambar selesai\n\n");
builder.append("Berhasil : ").append(success).append(" dari ").append(total).append("\n");
builder.append("Gagal : ").append(failed).append("\n");
if (originalSizeBytes <= 0L || compressedSizeBytes <= 0L) {
builder.append("Original : ")
.append(originalSizeBytes > 0L ? formatFileSize(originalSizeBytes) : "tidak diketahui")
.append("\n");
builder.append("Compressed : ")
.append(compressedSizeBytes > 0L ? formatFileSize(compressedSizeBytes) : "tidak diketahui")
.append("\n");
builder.append("Hemat : tidak diketahui");
return builder.toString();
}
long delta = originalSizeBytes - compressedSizeBytes;
builder.append("Original : ").append(formatFileSize(originalSizeBytes)).append("\n");
builder.append("Compressed : ").append(formatFileSize(compressedSizeBytes)).append("\n");
if (delta >= 0L) {
double savedPercent = (delta * 100.0) / originalSizeBytes;
builder.append("Hemat : ")
.append(formatFileSize(delta))
.append(" (")
.append(formatPercent(savedPercent))
.append("%)");
} else {
double largerPercent = ((-delta) * 100.0) / originalSizeBytes;
builder.append("Hemat : -")
.append(formatFileSize(-delta))
.append(" (lebih besar ")
.append(formatPercent(largerPercent))
.append("%)");
}
return builder.toString();
}
private String readDisplayName(Uri uri) {
Cursor cursor = null;
try {
cursor = getContentResolver().query(
uri,
new String[]{OpenableColumns.DISPLAY_NAME},
null,
null,
null
);
if (cursor != null && cursor.moveToFirst()) {
int index = cursor.getColumnIndex(OpenableColumns.DISPLAY_NAME);
if (index >= 0 && !cursor.isNull(index)) {
return cursor.getString(index);
}
}
} catch (Throwable ignored) {
} finally {
if (cursor != null) {
cursor.close();
}
}
return "";
}
private long getUriSize(Uri uri) {
if (uri == null) {
return -1L;
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path
android:fillColor="#020617"
android:pathData="M0,0 L108,0 L108,108 L0,108 Z" />
<path
android:fillColor="#063A32"
android:fillAlpha="0.9"
android:pathData="M0,62 C20,46 42,44 60,58 C75,70 90,67 108,52 L108,108 L0,108 Z" />
</vector>
@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path
android:fillColor="#30000000"
android:pathData="M27,82 C35,90 76,90 84,82 C89,77 84,73 72,71 C58,69 41,69 31,72 C23,75 22,79 27,82 Z" />
<path
android:fillColor="#F8FAFC"
android:pathData="M28,23 C23,23 20,26 20,31 L20,77 C20,82 23,85 28,85 L38,85 C43,85 46,82 46,77 L46,66 L57,82 C59,84 62,85 65,85 L79,85 C84,85 87,80 84,76 L68,55 L83,33 C86,29 83,23 78,23 L64,23 C61,23 58,24 56,27 L46,42 L46,31 C46,26 43,23 38,23 Z" />
<path
android:fillColor="#020617"
android:pathData="M32,31 L38,31 L38,77 L32,77 Z" />
<path
android:fillColor="#020617"
android:pathData="M45,55 L63,31 L72,31 L55,54 L74,77 L64,77 Z" />
<path
android:fillColor="#22C55E"
android:pathData="M70,40 L94,52 L70,64 Z" />
<path
android:fillColor="#38BDF8"
android:pathData="M70,57 L94,69 L70,81 Z" />
<path
android:fillColor="#020617"
android:pathData="M76,74 L90,74 C94,74 97,77 97,81 L97,88 C97,92 94,95 90,95 L76,95 C72,95 69,92 69,88 L69,81 C69,77 72,74 76,74 Z" />
<path
android:fillColor="#22C55E"
android:pathData="M78,80 L89,80 C90.66,80 91,80.34 91,82 L91,87 C91,88.66 90.66,89 89,89 L78,89 C76.34,89 76,88.66 76,87 L76,82 C76,80.34 76.34,80 78,80 Z" />
</vector>
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<!-- Fully transparent: avoids extra OS/launcher frame or rounded-square background. -->
<path android:fillColor="#00000000" android:pathData="M0,0h108v108h-108z" />
</vector>
@@ -0,0 +1,112 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<!-- Transparent canvas. The launcher mask clips this; there is no launcher frame/background box. -->
<path android:fillColor="#00000000" android:pathData="M0,0h108v108h-108z" />
<!-- Soft neon center glow, simulated with layered transparent circles. -->
<path android:fillColor="#FF97FF00" android:fillAlpha="0.10" android:pathData="M54,54 m-42,0 a42,42 0,1 0 84,0 a42,42 0,1 0 -84,0" />
<path android:fillColor="#FF97FF00" android:fillAlpha="0.08" android:pathData="M54,54 m-28,0 a28,28 0,1 0 56,0 a28,28 0,1 0 -56,0" />
<path android:fillColor="#FF000000" android:fillAlpha="0.26" android:pathData="M54,54 m-47,0 a47,47 0,1 0 94,0 a47,47 0,1 0 -94,0" />
<!-- Neon corner scan marks. -->
<path android:pathData="M18,32 C18,23 23,18 32,18 H40 M90,32 C90,23 85,18 76,18 H68 M18,76 C18,85 23,90 32,90 H40 M90,76 C90,85 85,90 76,90 H68"
android:strokeColor="#FFB7FF31" android:strokeAlpha="0.30" android:strokeWidth="3.2" android:strokeLineCap="round" android:fillColor="#00000000" />
<path android:pathData="M18,32 C18,23 23,18 32,18 H40 M90,32 C90,23 85,18 76,18 H68 M18,76 C18,85 23,90 32,90 H40 M90,76 C90,85 85,90 76,90 H68"
android:strokeColor="#FFB7FF31" android:strokeWidth="1.2" android:strokeLineCap="round" android:fillColor="#00000000" />
<!-- Compression arrows, glow layer. -->
<path android:pathData="M10,54 H24 M24,54 L19,49 M24,54 L19,59 M98,54 H84 M84,54 L89,49 M84,54 L89,59 M54,10 V24 M54,24 L49,19 M54,24 L59,19 M54,98 V84 M54,84 L49,89 M54,84 L59,89"
android:strokeColor="#FFB7FF31" android:strokeAlpha="0.35" android:strokeWidth="4.6" android:strokeLineCap="round" android:strokeLineJoin="round" android:fillColor="#00000000" />
<path android:pathData="M10,54 H24 M24,54 L19,49 M24,54 L19,59 M98,54 H84 M84,54 L89,49 M84,54 L89,59 M54,10 V24 M54,24 L49,19 M54,24 L59,19 M54,98 V84 M54,84 L49,89 M54,84 L59,89"
android:strokeColor="#FFC8FF45" android:strokeWidth="2.0" android:strokeLineCap="round" android:strokeLineJoin="round" android:fillColor="#00000000" />
<!-- Dotted direction marks. -->
<path android:fillColor="#FF95FF17" android:fillAlpha="0.45" android:pathData="M8,53 h2 v2 h-2z M12,53 h2 v2 h-2z M16,53 h2 v2 h-2z M90,53 h2 v2 h-2z M94,53 h2 v2 h-2z M98,53 h2 v2 h-2z M53,8 h2 v2 h-2z M53,12 h2 v2 h-2z M53,16 h2 v2 h-2z M53,90 h2 v2 h-2z M53,94 h2 v2 h-2z M53,98 h2 v2 h-2z" />
<!-- Logo shadow/glow. -->
<path android:pathData="M28,27 H45 L45,45 L61,27 H84 L61,54 L85,81 H67 L54,67 L43,81 H28 Z"
android:strokeColor="#FF8CFF00" android:strokeAlpha="0.30" android:strokeWidth="2.6" android:strokeLineJoin="round" android:fillColor="#00000000" />
<path android:fillColor="#FF7BFF00" android:fillAlpha="0.12" android:pathData="M26,25 H46 Q49,25 49,28 V45 L62,25 H88 L65,54 L89,84 H66 L54,71 L43,84 H26 Z" />
<!-- Metallic K main silhouettes. -->
<path android:fillColor="#FF1C2427" android:pathData="M28,27 H45 Q47,27 47,30 V45 L62,27 H84 L61,54 L85,81 H67 L54,67 L43,81 H28 Q25,81 25,78 V30 Q25,27 28,27 Z" />
<path android:fillColor="#FFDEE5E6" android:pathData="M33,28 H45 Q46,28 46,30 V43 L61,28 H81 L58,54 L81,80 H68 L54,65 L43,78 H33 Z" />
<path android:fillColor="#FF657176" android:fillAlpha="0.65" android:pathData="M34,31 H44 V46 L50,41 L43,52 L43,76 H34 Z" />
<path android:fillColor="#FF263036" android:fillAlpha="0.96" android:pathData="M46,48 L63,28 H82 L58,53 L81,80 H68 L54,65 L46,74 Z" />
<path android:fillColor="#FFF5F8F9" android:fillAlpha="0.78" android:pathData="M47,48 L64,29 H81 L59,53 L55,57 Z" />
<path android:fillColor="#FFBFC9CA" android:fillAlpha="0.80" android:pathData="M57,57 L82,81 H69 L55,66 Z" />
<!-- Film strip left side. -->
<path android:fillColor="#FF05090B" android:pathData="M27,29 H34 Q35.2,29 35.2,30.2 V77.8 Q35.2,79 34,79 H27 Q26,79 26,77.8 V30.2 Q26,29 27,29 Z" />
<path android:strokeColor="#FFFFFFFF" android:strokeAlpha="0.55" android:strokeWidth="0.7" android:fillColor="#00000000" android:pathData="M28,28 H45 Q47,28 47,30 V45 L62,28 H82 L59,54 L82,80 H68 L54,66 L43,80 H28 Q26,80 26,78 V30 Q26,28 28,28 Z" />
<path android:fillColor="#FFE9EEF0" android:fillAlpha="0.90" android:pathData="M29.0,32 H30.699999999999996 Q31.299999999999997,32 31.299999999999997,32.6 V35.4 Q31.299999999999997,36.0 30.699999999999996,36.0 H29.0 Q28.4,36.0 28.4,35.4 V32.6 Q28.4,32 29.0,32 Z"/>
<path android:fillColor="#FF1C2427" android:fillAlpha="0.60" android:pathData="M29.099999999999998,32.3 H30.55 Q31.0,32.3 31.0,32.75 V35.24999999999999 Q31.0,35.699999999999996 30.55,35.699999999999996 H29.099999999999998 Q28.65,35.699999999999996 28.65,35.24999999999999 V32.75 Q28.65,32.3 29.099999999999998,32.3 Z"/>
<path android:fillColor="#FFE9EEF0" android:fillAlpha="0.90" android:pathData="M29.0,39 H30.699999999999996 Q31.299999999999997,39 31.299999999999997,39.6 V42.4 Q31.299999999999997,43.0 30.699999999999996,43.0 H29.0 Q28.4,43.0 28.4,42.4 V39.6 Q28.4,39 29.0,39 Z"/>
<path android:fillColor="#FF1C2427" android:fillAlpha="0.60" android:pathData="M29.099999999999998,39.3 H30.55 Q31.0,39.3 31.0,39.75 V42.24999999999999 Q31.0,42.699999999999996 30.55,42.699999999999996 H29.099999999999998 Q28.65,42.699999999999996 28.65,42.24999999999999 V39.75 Q28.65,39.3 29.099999999999998,39.3 Z"/>
<path android:fillColor="#FFE9EEF0" android:fillAlpha="0.90" android:pathData="M29.0,46 H30.699999999999996 Q31.299999999999997,46 31.299999999999997,46.6 V49.4 Q31.299999999999997,50.0 30.699999999999996,50.0 H29.0 Q28.4,50.0 28.4,49.4 V46.6 Q28.4,46 29.0,46 Z"/>
<path android:fillColor="#FF1C2427" android:fillAlpha="0.60" android:pathData="M29.099999999999998,46.3 H30.55 Q31.0,46.3 31.0,46.75 V49.24999999999999 Q31.0,49.699999999999996 30.55,49.699999999999996 H29.099999999999998 Q28.65,49.699999999999996 28.65,49.24999999999999 V46.75 Q28.65,46.3 29.099999999999998,46.3 Z"/>
<path android:fillColor="#FFE9EEF0" android:fillAlpha="0.90" android:pathData="M29.0,53 H30.699999999999996 Q31.299999999999997,53 31.299999999999997,53.6 V56.4 Q31.299999999999997,57.0 30.699999999999996,57.0 H29.0 Q28.4,57.0 28.4,56.4 V53.6 Q28.4,53 29.0,53 Z"/>
<path android:fillColor="#FF1C2427" android:fillAlpha="0.60" android:pathData="M29.099999999999998,53.3 H30.55 Q31.0,53.3 31.0,53.75 V56.24999999999999 Q31.0,56.699999999999996 30.55,56.699999999999996 H29.099999999999998 Q28.65,56.699999999999996 28.65,56.24999999999999 V53.75 Q28.65,53.3 29.099999999999998,53.3 Z"/>
<path android:fillColor="#FFE9EEF0" android:fillAlpha="0.90" android:pathData="M29.0,60 H30.699999999999996 Q31.299999999999997,60 31.299999999999997,60.6 V63.4 Q31.299999999999997,64.0 30.699999999999996,64.0 H29.0 Q28.4,64.0 28.4,63.4 V60.6 Q28.4,60 29.0,60 Z"/>
<path android:fillColor="#FF1C2427" android:fillAlpha="0.60" android:pathData="M29.099999999999998,60.3 H30.55 Q31.0,60.3 31.0,60.75 V63.24999999999999 Q31.0,63.699999999999996 30.55,63.699999999999996 H29.099999999999998 Q28.65,63.699999999999996 28.65,63.24999999999999 V60.75 Q28.65,60.3 29.099999999999998,60.3 Z"/>
<path android:fillColor="#FFE9EEF0" android:fillAlpha="0.90" android:pathData="M29.0,67 H30.699999999999996 Q31.299999999999997,67 31.299999999999997,67.6 V70.4 Q31.299999999999997,71.0 30.699999999999996,71.0 H29.0 Q28.4,71.0 28.4,70.4 V67.6 Q28.4,67 29.0,67 Z"/>
<path android:fillColor="#FF1C2427" android:fillAlpha="0.60" android:pathData="M29.099999999999998,67.3 H30.55 Q31.0,67.3 31.0,67.75 V70.25 Q31.0,70.7 30.55,70.7 H29.099999999999998 Q28.65,70.7 28.65,70.25 V67.75 Q28.65,67.3 29.099999999999998,67.3 Z"/>
<path android:fillColor="#FFE9EEF0" android:fillAlpha="0.90" android:pathData="M29.0,74 H30.699999999999996 Q31.299999999999997,74 31.299999999999997,74.6 V77.4 Q31.299999999999997,78.0 30.699999999999996,78.0 H29.0 Q28.4,78.0 28.4,77.4 V74.6 Q28.4,74 29.0,74 Z"/>
<path android:fillColor="#FF1C2427" android:fillAlpha="0.60" android:pathData="M29.099999999999998,74.3 H30.55 Q31.0,74.3 31.0,74.75 V77.25 Q31.0,77.7 30.55,77.7 H29.099999999999998 Q28.65,77.7 28.65,77.25 V74.75 Q28.65,74.3 29.099999999999998,74.3 Z"/>
<!-- Play button. -->
<path android:fillColor="#FF9EFF00" android:fillAlpha="0.26" android:pathData="M36,50 L46,56 L36,62 Z" />
<path android:fillColor="#FFC8FF45" android:pathData="M36,49 L47,56 L36,63 Z" />
<path android:strokeColor="#FFFFFFFF" android:strokeAlpha="0.55" android:strokeWidth="0.7" android:fillColor="#00000000" android:pathData="M36,49 L47,56 L36,63 Z" />
<!-- Image/photo panel inside lower arm. -->
<path android:fillColor="#FF12191C" android:pathData="M61,58 L85,82 L78,89 L54,65 Z" />
<path android:fillColor="#FF6CFF00" android:fillAlpha="0.25" android:pathData="M62,59 L84,81 L77,87 L55,65 Z" />
<path android:fillColor="#FFC5FF3D" android:pathData="M63,80 L72,69 L86,83 L79,89 L57,89 Z" />
<path android:fillColor="#FF6BFF00" android:fillAlpha="0.72" android:pathData="M59,86 L69,75 L80,89 H60 Z" />
<path android:fillColor="#FFC8FF45" android:pathData="M64,63 m-3,0 a3,3 0,1 0 6,0 a3,3 0,1 0 -6,0" />
<path android:strokeColor="#FFFFFFFF" android:strokeAlpha="0.75" android:strokeWidth="0.8" android:strokeLineJoin="round" android:fillColor="#00000000" android:pathData="M61,58 L85,82 L78,89 L54,65 Z" />
<path android:strokeColor="#FF7BFF00" android:strokeAlpha="0.60" android:strokeWidth="0.6" android:fillColor="#00000000" android:pathData="M64,80 L72,69 L85,82" />
<!-- Fine brushed-metal texture. -->
<path android:pathData="M32.2,21 L70.2,-17" android:strokeColor="#FFFFFFFF" android:strokeAlpha="0.085" android:strokeWidth="0.45" android:strokeLineCap="round"/>
<path android:pathData="M34.5,25 L72.5,-13" android:strokeColor="#FFFFFFFF" android:strokeAlpha="0.085" android:strokeWidth="0.45" android:strokeLineCap="round"/>
<path android:pathData="M36.6,29 L74.7,-9" android:strokeColor="#FFFFFFFF" android:strokeAlpha="0.085" android:strokeWidth="0.45" android:strokeLineCap="round"/>
<path android:pathData="M38.9,33 L76.8,-5" android:strokeColor="#FFFFFFFF" android:strokeAlpha="0.085" android:strokeWidth="0.45" android:strokeLineCap="round"/>
<path android:pathData="M41.0,37 L79.0,-1" android:strokeColor="#FFFFFFFF" android:strokeAlpha="0.085" android:strokeWidth="0.45" android:strokeLineCap="round"/>
<path android:pathData="M43.2,41 L81.2,3" android:strokeColor="#FFFFFFFF" android:strokeAlpha="0.085" android:strokeWidth="0.45" android:strokeLineCap="round"/>
<path android:pathData="M45.5,45 L83.5,7" android:strokeColor="#FFFFFFFF" android:strokeAlpha="0.085" android:strokeWidth="0.45" android:strokeLineCap="round"/>
<path android:pathData="M47.6,49 L85.7,11" android:strokeColor="#FFFFFFFF" android:strokeAlpha="0.085" android:strokeWidth="0.45" android:strokeLineCap="round"/>
<path android:pathData="M49.9,53 L87.8,15" android:strokeColor="#FFFFFFFF" android:strokeAlpha="0.085" android:strokeWidth="0.45" android:strokeLineCap="round"/>
<path android:pathData="M52.0,57 L90.0,19" android:strokeColor="#FFFFFFFF" android:strokeAlpha="0.085" android:strokeWidth="0.45" android:strokeLineCap="round"/>
<path android:pathData="M54.2,61 L92.2,23" android:strokeColor="#FFFFFFFF" android:strokeAlpha="0.085" android:strokeWidth="0.45" android:strokeLineCap="round"/>
<path android:pathData="M56.5,65 L94.5,27" android:strokeColor="#FFFFFFFF" android:strokeAlpha="0.085" android:strokeWidth="0.45" android:strokeLineCap="round"/>
<path android:pathData="M58.7,69 L96.7,31" android:strokeColor="#FFFFFFFF" android:strokeAlpha="0.085" android:strokeWidth="0.45" android:strokeLineCap="round"/>
<path android:pathData="M60.9,73 L98.8,35" android:strokeColor="#FFFFFFFF" android:strokeAlpha="0.085" android:strokeWidth="0.45" android:strokeLineCap="round"/>
<path android:pathData="M63.0,77 L101.0,39" android:strokeColor="#FFFFFFFF" android:strokeAlpha="0.085" android:strokeWidth="0.45" android:strokeLineCap="round"/>
<path android:pathData="M65.2,81 L103.2,43" android:strokeColor="#FFFFFFFF" android:strokeAlpha="0.085" android:strokeWidth="0.45" android:strokeLineCap="round"/>
<path android:pathData="M67.5,85 L105.5,47" android:strokeColor="#FFFFFFFF" android:strokeAlpha="0.085" android:strokeWidth="0.45" android:strokeLineCap="round"/>
<path android:pathData="M69.7,89 L107.7,51" android:strokeColor="#FFFFFFFF" android:strokeAlpha="0.085" android:strokeWidth="0.45" android:strokeLineCap="round"/>
<path android:pathData="M71.8,93 L109.8,55" android:strokeColor="#FFFFFFFF" android:strokeAlpha="0.085" android:strokeWidth="0.45" android:strokeLineCap="round"/>
<path android:pathData="M48.0,82.0 L72.0,58.0" android:strokeColor="#FF000000" android:strokeAlpha="0.12" android:strokeWidth="0.55" android:strokeLineCap="round"/>
<path android:pathData="M50.0,78.5 L74.0,54.5" android:strokeColor="#FF000000" android:strokeAlpha="0.12" android:strokeWidth="0.55" android:strokeLineCap="round"/>
<path android:pathData="M52.0,75.0 L76.0,51.0" android:strokeColor="#FF000000" android:strokeAlpha="0.12" android:strokeWidth="0.55" android:strokeLineCap="round"/>
<path android:pathData="M54.0,71.5 L78.0,47.5" android:strokeColor="#FF000000" android:strokeAlpha="0.12" android:strokeWidth="0.55" android:strokeLineCap="round"/>
<path android:pathData="M56.0,68.0 L80.0,44.0" android:strokeColor="#FF000000" android:strokeAlpha="0.12" android:strokeWidth="0.55" android:strokeLineCap="round"/>
<path android:pathData="M58.0,64.5 L82.0,40.5" android:strokeColor="#FF000000" android:strokeAlpha="0.12" android:strokeWidth="0.55" android:strokeLineCap="round"/>
<path android:pathData="M60.0,61.0 L84.0,37.0" android:strokeColor="#FF000000" android:strokeAlpha="0.12" android:strokeWidth="0.55" android:strokeLineCap="round"/>
<path android:pathData="M62.0,57.5 L86.0,33.5" android:strokeColor="#FF000000" android:strokeAlpha="0.12" android:strokeWidth="0.55" android:strokeLineCap="round"/>
<path android:pathData="M64.0,54.0 L88.0,30.0" android:strokeColor="#FF000000" android:strokeAlpha="0.12" android:strokeWidth="0.55" android:strokeLineCap="round"/>
<path android:pathData="M66.0,50.5 L90.0,26.5" android:strokeColor="#FF000000" android:strokeAlpha="0.12" android:strokeWidth="0.55" android:strokeLineCap="round"/>
<path android:pathData="M68.0,47.0 L92.0,23.0" android:strokeColor="#FF000000" android:strokeAlpha="0.12" android:strokeWidth="0.55" android:strokeLineCap="round"/>
<path android:pathData="M70.0,43.5 L94.0,19.5" android:strokeColor="#FF000000" android:strokeAlpha="0.12" android:strokeWidth="0.55" android:strokeLineCap="round"/>
<!-- Extra highlight and depth lines. -->
<path android:strokeColor="#FFFFFFFF" android:strokeAlpha="0.52" android:strokeWidth="1.0" android:strokeLineCap="round" android:fillColor="#00000000" android:pathData="M33,28 H45 Q46,28 46,30 V43 M47,48 L64,29 H80 M58,54 L80,79 M33,79 H43" />
<path android:strokeColor="#FF000000" android:strokeAlpha="0.45" android:strokeWidth="1.1" android:strokeLineCap="round" android:fillColor="#00000000" android:pathData="M46,48 L58,54 L46,74 M55,66 L68,80" />
</vector>
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path android:fillColor="#FFFFFFFF" android:pathData="M28,27 H45 Q47,27 47,30 V45 L62,27 H84 L61,54 L85,81 H67 L54,67 L43,81 H28 Q25,81 25,78 V30 Q25,27 28,27 Z" />
<path android:fillColor="#FF000000" android:fillAlpha="0.55" android:pathData="M27,29 H34 Q35.2,29 35.2,30.2 V77.8 Q35.2,79 34,79 H27 Q26,79 26,77.8 V30.2 Q26,29 27,29 Z" />
<path android:fillColor="#FFFFFFFF" android:pathData="M36,49 L47,56 L36,63 Z" />
</vector>
+199 -81
View File
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/bg_amoled_screen"
@@ -270,7 +269,7 @@
android:layout_marginTop="18dp"
android:background="@drawable/bg_button_green"
android:enabled="false"
android:text="Compress"
android:text="Compress Video"
android:textAllCaps="false"
android:textColor="#020617"
android:textStyle="bold"
@@ -348,6 +347,7 @@
android:textStyle="bold" />
<LinearLayout
android:id="@+id/layoutImageCompressionModeRow"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="14dp"
@@ -355,10 +355,11 @@
android:orientation="horizontal">
<TextView
android:id="@+id/txtImageCompressionModeLabel"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Format Output"
android:text="Mode Kompresi"
android:textColor="#9CA3AF"
android:textSize="13sp" />
@@ -367,7 +368,7 @@
android:layout_width="32dp"
android:layout_height="32dp"
android:background="@android:color/transparent"
android:contentDescription="Info format output gambar"
android:contentDescription="Info mode kompresi gambar"
android:padding="6dp"
android:src="@android:drawable/ic_menu_help" />
@@ -382,22 +383,6 @@
android:paddingStart="12dp"
android:paddingEnd="12dp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="Ukuran Output"
android:textColor="#9CA3AF"
android:textSize="13sp" />
<Spinner
android:id="@+id/spImageResolution"
android:layout_width="match_parent"
android:layout_height="48dp"
android:layout_marginTop="4dp"
android:background="@drawable/bg_spinner_dark"
android:paddingStart="12dp"
android:paddingEnd="12dp" />
<TextView
android:id="@+id/txtImageCompressionSummary"
@@ -405,7 +390,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:lineSpacingExtra="3dp"
android:text="Output: JPEG / MozJPEG • Original • Q82"
android:text="Mode: Kompresi Foto • Ukuran: Original • Kualitas 82"
android:textColor="#9CA3AF"
android:textSize="13sp" />
@@ -429,26 +414,96 @@
android:visibility="gone">
<TextView
android:id="@+id/txtImageQualityValue"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Quality 82 • Seimbang"
android:text="Konversi Format"
android:textColor="#9CA3AF"
android:textSize="13sp" />
<SeekBar
android:id="@+id/seekImageQuality"
<Spinner
android:id="@+id/spImageConvertFormat"
android:layout_width="match_parent"
android:layout_height="48dp"
android:layout_marginTop="2dp" />
android:layout_marginTop="4dp"
android:background="@drawable/bg_spinner_dark"
android:paddingStart="12dp"
android:paddingEnd="12dp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:lineSpacingExtra="3dp"
android:text="Catatan: PNG Lossless tidak menurunkan kualitas visual. PNG TinyPNG Style memakai quantization palette agar ukuran lebih kecil."
android:textColor="#6B7280"
android:textSize="12sp" />
android:layout_marginTop="12dp"
android:text="Ukuran Output"
android:textColor="#9CA3AF"
android:textSize="13sp" />
<Spinner
android:id="@+id/spImageResolution"
android:layout_width="match_parent"
android:layout_height="48dp"
android:layout_marginTop="4dp"
android:background="@drawable/bg_spinner_dark"
android:paddingStart="12dp"
android:paddingEnd="12dp" />
<LinearLayout
android:id="@+id/layoutImageQualityControls"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:orientation="vertical">
<TextView
android:id="@+id/txtImageQualityValue"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Kualitas 82 • Seimbang"
android:textColor="#9CA3AF"
android:textSize="13sp" />
<SeekBar
android:id="@+id/seekImageQuality"
android:layout_width="match_parent"
android:layout_height="48dp"
android:layout_marginTop="2dp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:lineSpacingExtra="3dp"
android:text="Catatan: kualitas tinggi menjaga detail, sedangkan kualitas rendah menekan file lebih kuat."
android:textColor="#6B7280"
android:textSize="12sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/layoutImageExtremeCompression"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:orientation="vertical"
android:visibility="gone">
<CheckBox
android:id="@+id/checkImageExtremeCompression"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:buttonTint="#22C55E"
android:text="Extreme compression"
android:textColor="#FFFFFF"
android:textSize="14sp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:lineSpacingExtra="3dp"
android:text="Mode extreme membutuhkan waktu lebih lama, tepi bisa membuat ukuran sedikit lebih kecil"
android:textColor="#FBBF24"
android:textSize="12sp" />
</LinearLayout>
</LinearLayout>
@@ -469,7 +524,6 @@
</LinearLayout>
<LinearLayout
android:id="@+id/cardPdfCompression"
android:layout_width="match_parent"
@@ -502,7 +556,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:lineSpacingExtra="3dp"
android:text="Pilih PDF menggunakan SAF. Jika PDF memakai password, input password akan muncul otomatis."
android:text="Pilih PDF untuk membaca ukuran file, status password, lalu atur level kompresi."
android:textColor="#9CA3AF"
android:textSize="13sp" />
@@ -517,10 +571,49 @@
android:textColor="#FFFFFF" />
<LinearLayout
android:id="@+id/layoutPdfEngineRow"
android:id="@+id/pdfPasswordLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="14dp"
android:orientation="vertical"
android:visibility="gone">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Password PDF"
android:textColor="#9CA3AF"
android:textSize="13sp" />
<EditText
android:id="@+id/pdfPasswordInput"
android:layout_width="match_parent"
android:layout_height="48dp"
android:layout_marginTop="4dp"
android:background="@drawable/bg_spinner_dark"
android:hint="Masukkan password"
android:inputType="textPassword"
android:paddingStart="12dp"
android:paddingEnd="12dp"
android:textColor="#FFFFFF"
android:textColorHint="#6B7280" />
<TextView
android:id="@+id/txtPdfPasswordError"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:textColor="#F87171"
android:textSize="12sp"
android:visibility="gone" />
</LinearLayout>
<LinearLayout
android:id="@+id/layoutPdfEngineRow"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="18dp"
android:gravity="center_vertical"
android:orientation="horizontal"
android:visibility="gone">
@@ -533,78 +626,103 @@
android:textColor="#9CA3AF"
android:textSize="13sp" />
<ImageButton
android:id="@+id/btnPdfCompressionHelp"
android:layout_width="32dp"
android:layout_height="32dp"
android:background="@android:color/transparent"
android:contentDescription="Info engine kompresi PDF"
android:padding="6dp"
android:src="@android:drawable/ic_menu_help" />
<Spinner
android:id="@+id/spPdfCompressionMode"
android:layout_width="1dp"
android:layout_height="1dp"
android:visibility="gone" />
</LinearLayout>
<Spinner
android:id="@+id/spPdfCompressionMode"
android:layout_width="match_parent"
android:layout_height="48dp"
android:layout_marginTop="4dp"
android:background="@drawable/bg_spinner_dark"
android:paddingStart="12dp"
android:paddingEnd="12dp"
android:visibility="gone" />
<TextView
android:id="@+id/txtPdfCompressionSummary"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:layout_marginTop="16dp"
android:lineSpacingExtra="3dp"
android:text="Mode: Smart PDF Compress • zlib level 9 • cepat dan stabil"
android:text=""
android:textColor="#9CA3AF"
android:textSize="13sp"
android:visibility="gone" />
<LinearLayout
android:id="@+id/pdfPasswordLayout"
android:id="@+id/layoutPdfCompressionLevel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="14dp"
android:layout_marginTop="12dp"
android:orientation="vertical"
android:visibility="gone">
<TextView
android:id="@+id/txtPdfPasswordLabel"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Password PDF"
android:textColor="#9CA3AF"
android:textSize="13sp" />
android:gravity="center_vertical"
android:orientation="horizontal">
<EditText
android:id="@+id/pdfPasswordInput"
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Level Kompresi PDF"
android:textColor="#FFFFFF"
android:textSize="15sp"
android:textStyle="bold" />
<ImageButton
android:id="@+id/btnPdfCompressionHelp"
android:layout_width="32dp"
android:layout_height="32dp"
android:background="@android:color/transparent"
android:contentDescription="Info level kompresi PDF"
android:padding="6dp"
android:src="@android:drawable/ic_menu_help" />
</LinearLayout>
<TextView
android:id="@+id/txtPdfCompressionLevelValue"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:text="Recommended"
android:textColor="#E5E7EB"
android:textSize="14sp"
android:textStyle="bold" />
<SeekBar
android:id="@+id/seekPdfCompressionLevel"
android:layout_width="match_parent"
android:layout_height="48dp"
android:layout_marginTop="6dp"
android:background="@drawable/bg_spinner_dark"
android:hint="Masukkan password PDF"
android:inputType="textPassword"
android:paddingStart="14dp"
android:paddingEnd="14dp"
android:singleLine="true"
android:textColor="#FFFFFF"
android:textColorHint="#6B7280"
android:textSize="14sp" />
android:layout_marginTop="2dp" />
<LinearLayout
android:id="@+id/layoutPdfExtremeCompression"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:orientation="vertical"
android:visibility="gone">
<CheckBox
android:id="@+id/checkPdfExtremeCompression"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:buttonTint="#22C55E"
android:text="Extreme compression"
android:textColor="#FFFFFF"
android:textSize="14sp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:lineSpacingExtra="3dp"
android:text="Mode extreme membutuhkan waktu lebih lama, tepi bisa membuat ukuran sedikit lebih kecil"
android:textColor="#FBBF24"
android:textSize="12sp" />
</LinearLayout>
<TextView
android:id="@+id/txtPdfPasswordError"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:text="Password salah"
android:textColor="#EF4444"
android:textSize="12sp"
android:visibility="gone" />
</LinearLayout>
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_kicon_background" />
<foreground android:drawable="@drawable/ic_kicon_foreground" />
</adaptive-icon>
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_kicon_background" />
<foreground android:drawable="@drawable/ic_kicon_foreground" />
</adaptive-icon>
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/ic_kicon_foreground" />
</layer-list>
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/ic_kicon_foreground" />
</layer-list>
+4
View File
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="kicon_transparent">#00000000</color>
</resources>