initial commit, 4.5 stable
Some checks failed
🔗 GHA / 📊 Static checks (push) Has been cancelled
🔗 GHA / 🤖 Android (push) Has been cancelled
🔗 GHA / 🍏 iOS (push) Has been cancelled
🔗 GHA / 🐧 Linux (push) Has been cancelled
🔗 GHA / 🍎 macOS (push) Has been cancelled
🔗 GHA / 🏁 Windows (push) Has been cancelled
🔗 GHA / 🌐 Web (push) Has been cancelled
Some checks failed
🔗 GHA / 📊 Static checks (push) Has been cancelled
🔗 GHA / 🤖 Android (push) Has been cancelled
🔗 GHA / 🍏 iOS (push) Has been cancelled
🔗 GHA / 🐧 Linux (push) Has been cancelled
🔗 GHA / 🍎 macOS (push) Has been cancelled
🔗 GHA / 🏁 Windows (push) Has been cancelled
🔗 GHA / 🌐 Web (push) Has been cancelled
This commit is contained in:
545
thirdparty/libjpeg-turbo/patches/0001-cmake-generated-headers.patch
vendored
Normal file
545
thirdparty/libjpeg-turbo/patches/0001-cmake-generated-headers.patch
vendored
Normal file
@@ -0,0 +1,545 @@
|
||||
diff --git a/thirdparty/libjpeg-turbo/patches/0001-cmake-generated-headers.patch b/thirdparty/libjpeg-turbo/patches/0001-cmake-generated-headers.patch
|
||||
index 72354390a6..e69de29bb2 100644
|
||||
--- a/thirdparty/libjpeg-turbo/patches/0001-cmake-generated-headers.patch
|
||||
+++ b/thirdparty/libjpeg-turbo/patches/0001-cmake-generated-headers.patch
|
||||
@@ -1,272 +0,0 @@
|
||||
-diff --git a/thirdparty/libjpeg-turbo/src/jconfig.h b/thirdparty/libjpeg-turbo/src/jconfig.h
|
||||
-new file mode 100644
|
||||
-index 0000000000..42d9654c0f
|
||||
---- /dev/null
|
||||
-+++ b/thirdparty/libjpeg-turbo/src/jconfig.h
|
||||
-@@ -0,0 +1,62 @@
|
||||
-+// Originally generated by libjpeg-turbo's cmake build, then modified to support multiple platforms.
|
||||
-+
|
||||
-+/* Version ID for the JPEG library.
|
||||
-+ * Might be useful for tests like "#if JPEG_LIB_VERSION >= 60".
|
||||
-+ */
|
||||
-+#define JPEG_LIB_VERSION 62
|
||||
-+
|
||||
-+/* libjpeg-turbo version */
|
||||
-+#define LIBJPEG_TURBO_VERSION 3.1.0
|
||||
-+
|
||||
-+/* libjpeg-turbo version in integer form */
|
||||
-+#define LIBJPEG_TURBO_VERSION_NUMBER 3001000
|
||||
-+
|
||||
-+/* Support arithmetic encoding when using 8-bit samples */
|
||||
-+#define C_ARITH_CODING_SUPPORTED 1
|
||||
-+
|
||||
-+/* Support arithmetic decoding when using 8-bit samples */
|
||||
-+#define D_ARITH_CODING_SUPPORTED 1
|
||||
-+
|
||||
-+/* Support in-memory source/destination managers */
|
||||
-+#define MEM_SRCDST_SUPPORTED 1
|
||||
-+
|
||||
-+/* Use accelerated SIMD routines when using 8-bit samples */
|
||||
-+//#define WITH_SIMD 1
|
||||
-+
|
||||
-+/* This version of libjpeg-turbo supports run-time selection of data precision,
|
||||
-+ * so BITS_IN_JSAMPLE is no longer used to specify the data precision at build
|
||||
-+ * time. However, some downstream software expects the macro to be defined.
|
||||
-+ * Since 12-bit data precision is an opt-in feature that requires explicitly
|
||||
-+ * calling 12-bit-specific libjpeg API functions and using 12-bit-specific data
|
||||
-+ * types, the unmodified portion of the libjpeg API still behaves as if it were
|
||||
-+ * built for 8-bit precision, and JSAMPLE is still literally an 8-bit data
|
||||
-+ * type. Thus, it is correct to define BITS_IN_JSAMPLE to 8 here.
|
||||
-+ */
|
||||
-+#ifndef BITS_IN_JSAMPLE
|
||||
-+#define BITS_IN_JSAMPLE 8
|
||||
-+#endif
|
||||
-+
|
||||
-+#ifdef _WIN32
|
||||
-+
|
||||
-+#undef RIGHT_SHIFT_IS_UNSIGNED
|
||||
-+
|
||||
-+/* Define "boolean" as unsigned char, not int, per Windows custom */
|
||||
-+#ifndef __RPCNDR_H__ /* don't conflict if rpcndr.h already read */
|
||||
-+typedef unsigned char boolean;
|
||||
-+#endif
|
||||
-+#define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */
|
||||
-+
|
||||
-+/* Define "INT32" as int, not long, per Windows custom */
|
||||
-+#if !(defined(_BASETSD_H_) || defined(_BASETSD_H)) /* don't conflict if basetsd.h already read */
|
||||
-+typedef short INT16;
|
||||
-+typedef signed int INT32;
|
||||
-+#endif
|
||||
-+#define XMD_H /* prevent jmorecfg.h from redefining it */
|
||||
-+
|
||||
-+#else
|
||||
-+
|
||||
-+/* Define if your (broken) compiler shifts signed values as if they were
|
||||
-+ unsigned. */
|
||||
-+/* #undef RIGHT_SHIFT_IS_UNSIGNED */
|
||||
-+
|
||||
-+#endif
|
||||
-diff --git a/thirdparty/libjpeg-turbo/src/jconfigint.h b/thirdparty/libjpeg-turbo/src/jconfigint.h
|
||||
-new file mode 100644
|
||||
---- /dev/null
|
||||
-+++ b/thirdparty/libjpeg-turbo/src/jconfigint.h
|
||||
-@@ -0,0 +1,102 @@
|
||||
-+// Originally generated by libjpeg-turbo's cmake build, then modified to support multiple platforms.
|
||||
-+
|
||||
-+/* libjpeg-turbo build number */
|
||||
-+#define BUILD "20250317"
|
||||
-+
|
||||
-+/* How to hide global symbols. */
|
||||
-+#ifndef HIDDEN
|
||||
-+ #if defined(__GNUC__) && (__GNUC__ >= 4) && !defined(__MINGW32__)
|
||||
-+ #define HIDDEN __attribute__((visibility("hidden")))
|
||||
-+ #else
|
||||
-+ #define HIDDEN
|
||||
-+ #endif
|
||||
-+#endif
|
||||
-+
|
||||
-+/* Compiler's inline keyword */
|
||||
-+#undef inline
|
||||
-+
|
||||
-+/* How to obtain function inlining. */
|
||||
-+#if defined(__GNUC__) && (__GNUC__ >= 4) && !defined(__MINGW32__)
|
||||
-+ #define INLINE __inline__ __attribute__((always_inline))
|
||||
-+#else
|
||||
-+ #define INLINE inline
|
||||
-+#endif
|
||||
-+
|
||||
-+/* How to obtain thread-local storage */
|
||||
-+#if defined(_MSC_VER)
|
||||
-+#define THREAD_LOCAL __declspec(thread)
|
||||
-+#else
|
||||
-+#define THREAD_LOCAL __thread
|
||||
-+#endif
|
||||
-+
|
||||
-+/* Define to the full name of this package. */
|
||||
-+#define PACKAGE_NAME "libjpeg-turbo"
|
||||
-+
|
||||
-+/* Version number of package */
|
||||
-+#define VERSION "3.1.0"
|
||||
-+
|
||||
-+/* The size of `size_t', as computed by sizeof. */
|
||||
-+#if defined(__SIZEOF_SIZE_T__)
|
||||
-+ #define SIZEOF_SIZE_T __SIZEOF_SIZE_T__
|
||||
-+#elif defined(_WIN64)
|
||||
-+ #define SIZEOF_SIZE_T 8
|
||||
-+#elif defined(_WIN32)
|
||||
-+ #define SIZEOF_SIZE_T 4
|
||||
-+#else
|
||||
-+ #error "Cannot determine size of size_t"
|
||||
-+#endif
|
||||
-+
|
||||
-+/* Define if your compiler has __builtin_ctzl() and sizeof(unsigned long) == sizeof(size_t). */
|
||||
-+#if defined(__GNUC__)
|
||||
-+ #define HAVE_BUILTIN_CTZL
|
||||
-+#endif
|
||||
-+
|
||||
-+/* Define to 1 if you have the <intrin.h> header file. */
|
||||
-+/* #undef HAVE_INTRIN_H */
|
||||
-+
|
||||
-+#if defined(_MSC_VER) && defined(HAVE_INTRIN_H)
|
||||
-+#if (SIZEOF_SIZE_T == 8)
|
||||
-+#define HAVE_BITSCANFORWARD64
|
||||
-+#elif (SIZEOF_SIZE_T == 4)
|
||||
-+#define HAVE_BITSCANFORWARD
|
||||
-+#endif
|
||||
-+#endif
|
||||
-+
|
||||
-+#if defined(__has_attribute)
|
||||
-+#if __has_attribute(fallthrough)
|
||||
-+#define FALLTHROUGH __attribute__((fallthrough));
|
||||
-+#else
|
||||
-+#define FALLTHROUGH
|
||||
-+#endif
|
||||
-+#else
|
||||
-+#define FALLTHROUGH
|
||||
-+#endif
|
||||
-+
|
||||
-+/*
|
||||
-+ * 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!
|
||||
-+ */
|
||||
-+
|
||||
-+#ifndef BITS_IN_JSAMPLE
|
||||
-+#define BITS_IN_JSAMPLE 8 /* use 8 or 12 */
|
||||
-+#endif
|
||||
-+
|
||||
-+#undef C_ARITH_CODING_SUPPORTED
|
||||
-+#undef D_ARITH_CODING_SUPPORTED
|
||||
-+#undef WITH_SIMD
|
||||
-+
|
||||
-+#if BITS_IN_JSAMPLE == 8
|
||||
-+
|
||||
-+/* Support arithmetic encoding */
|
||||
-+#define C_ARITH_CODING_SUPPORTED 1
|
||||
-+
|
||||
-+/* Support arithmetic decoding */
|
||||
-+#define D_ARITH_CODING_SUPPORTED 1
|
||||
-+
|
||||
-+/* Use accelerated SIMD routines. */
|
||||
-+//#define WITH_SIMD 1
|
||||
-+
|
||||
-+#endif
|
||||
-diff --git a/thirdparty/libjpeg-turbo/src/jmorecfg.h b/thirdparty/libjpeg-turbo/src/jmorecfg.h
|
||||
---- a/thirdparty/libjpeg-turbo/src/jmorecfg.h
|
||||
-+++ b/thirdparty/libjpeg-turbo/src/jmorecfg.h
|
||||
-@@ -1,3 +1,5 @@
|
||||
-+// Modified to remove lossless jpeg support.
|
||||
-+
|
||||
- /*
|
||||
- * jmorecfg.h
|
||||
- *
|
||||
-@@ -8,6 +10,6 @@
|
||||
- * Copyright (C) 1999, Ken Murchison.
|
||||
- * libjpeg-turbo Modifications:
|
||||
- * Copyright (C) 2009, 2011, 2014-2015, 2018, 2020, 2022, D. R. Commander.
|
||||
- * For conditions of distribution and use, see the accompanying README.ijg
|
||||
- * file.
|
||||
- *
|
||||
-@@ -242,7 +244,7 @@ typedef int boolean;
|
||||
-
|
||||
- #define C_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */
|
||||
- #define C_PROGRESSIVE_SUPPORTED /* Progressive JPEG? (Requires MULTISCAN)*/
|
||||
--#define C_LOSSLESS_SUPPORTED /* Lossless JPEG? */
|
||||
-+//#define C_LOSSLESS_SUPPORTED /* Lossless JPEG? */
|
||||
- #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
|
||||
-@@ -259,7 +263,7 @@ typedef int boolean;
|
||||
-
|
||||
- #define D_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */
|
||||
- #define D_PROGRESSIVE_SUPPORTED /* Progressive JPEG? (Requires MULTISCAN)*/
|
||||
--#define D_LOSSLESS_SUPPORTED /* Lossless JPEG? */
|
||||
-+//#define D_LOSSLESS_SUPPORTED /* Lossless JPEG? */
|
||||
- #define SAVE_MARKERS_SUPPORTED /* jpeg_save_markers() needed? */
|
||||
- #define BLOCK_SMOOTHING_SUPPORTED /* Block smoothing? (Progressive only) */
|
||||
- #define IDCT_SCALING_SUPPORTED /* Output rescaling via IDCT? */
|
||||
-diff --git a/thirdparty/libjpeg-turbo/src/jversion.h b/thirdparty/libjpeg-turbo/src/jversion.h
|
||||
-new file mode 100644
|
||||
---- /dev/null
|
||||
-+++ b/thirdparty/libjpeg-turbo/src/jversion.h
|
||||
-@@ -0,0 +18446744073709551615,58 @@
|
||||
-+// Originally generated by libjpeg-turbo's cmake build, then modified to support multiple platforms.
|
||||
-+
|
||||
-+/*
|
||||
-+ * jversion.h
|
||||
-+ *
|
||||
-+ * This file was part of the Independent JPEG Group's software:
|
||||
-+ * Copyright (C) 1991-2020, Thomas G. Lane, Guido Vollbeding.
|
||||
-+ * libjpeg-turbo Modifications:
|
||||
-+ * Copyright (C) 2010, 2012-2024, D. R. Commander.
|
||||
-+ * For conditions of distribution and use, see the accompanying README.ijg
|
||||
-+ * file.
|
||||
-+ *
|
||||
-+ * This file contains software version identification.
|
||||
-+ */
|
||||
-+
|
||||
-+
|
||||
-+#if JPEG_LIB_VERSION >= 80
|
||||
-+
|
||||
-+#define JVERSION "8d 15-Jan-2012"
|
||||
-+
|
||||
-+#elif JPEG_LIB_VERSION >= 70
|
||||
-+
|
||||
-+#define JVERSION "7 27-Jun-2009"
|
||||
-+
|
||||
-+#else
|
||||
-+
|
||||
-+#define JVERSION "6b 27-Mar-1998"
|
||||
-+
|
||||
-+#endif
|
||||
-+
|
||||
-+/*
|
||||
-+ * NOTE: It is our convention to place the authors in the following order:
|
||||
-+ * - libjpeg-turbo authors (2009-) in descending order of the date of their
|
||||
-+ * most recent contribution to the project, then in ascending order of the
|
||||
-+ * date of their first contribution to the project, then in alphabetical
|
||||
-+ * order
|
||||
-+ * - Upstream authors in descending order of the date of the first inclusion of
|
||||
-+ * their code
|
||||
-+ */
|
||||
-+
|
||||
-+#define JCOPYRIGHT1 \
|
||||
-+ "Copyright (C) 2009-2024 D. R. Commander\n" \
|
||||
-+ "Copyright (C) 2015, 2020 Google, Inc.\n" \
|
||||
-+ "Copyright (C) 2019-2020 Arm Limited\n" \
|
||||
-+ "Copyright (C) 2015-2016, 2018 Matthieu Darbois\n" \
|
||||
-+ "Copyright (C) 2011-2016 Siarhei Siamashka\n" \
|
||||
-+ "Copyright (C) 2015 Intel Corporation\n"
|
||||
-+#define JCOPYRIGHT2 \
|
||||
-+ "Copyright (C) 2013-2014 Linaro Limited\n" \
|
||||
-+ "Copyright (C) 2013-2014 MIPS Technologies, Inc.\n" \
|
||||
-+ "Copyright (C) 2009, 2012 Pierre Ossman for Cendio AB\n" \
|
||||
-+ "Copyright (C) 2009-2011 Nokia Corporation and/or its subsidiary(-ies)\n" \
|
||||
-+ "Copyright (C) 1999-2006 MIYASAKA Masaru\n" \
|
||||
-+ "Copyright (C) 1999 Ken Murchison\n" \
|
||||
-+ "Copyright (C) 1991-2020 Thomas G. Lane, Guido Vollbeding\n"
|
||||
-+
|
||||
-+#define JCOPYRIGHT_SHORT \
|
||||
-+ "Copyright (C) 1991-2024 The libjpeg-turbo Project and many others"
|
||||
diff --git a/thirdparty/libjpeg-turbo/src/jconfig.h b/thirdparty/libjpeg-turbo/src/jconfig.h
|
||||
new file mode 100644
|
||||
index 0000000000..42d9654c0f
|
||||
--- /dev/null
|
||||
+++ b/thirdparty/libjpeg-turbo/src/jconfig.h
|
||||
@@ -0,0 +1,62 @@
|
||||
+// Originally generated by libjpeg-turbo's cmake build, then modified to support multiple platforms.
|
||||
+
|
||||
+/* Version ID for the JPEG library.
|
||||
+ * Might be useful for tests like "#if JPEG_LIB_VERSION >= 60".
|
||||
+ */
|
||||
+#define JPEG_LIB_VERSION 62
|
||||
+
|
||||
+/* libjpeg-turbo version */
|
||||
+#define LIBJPEG_TURBO_VERSION 3.1.0
|
||||
+
|
||||
+/* libjpeg-turbo version in integer form */
|
||||
+#define LIBJPEG_TURBO_VERSION_NUMBER 3001000
|
||||
+
|
||||
+/* Support arithmetic encoding when using 8-bit samples */
|
||||
+#define C_ARITH_CODING_SUPPORTED 1
|
||||
+
|
||||
+/* Support arithmetic decoding when using 8-bit samples */
|
||||
+#define D_ARITH_CODING_SUPPORTED 1
|
||||
+
|
||||
+/* Support in-memory source/destination managers */
|
||||
+#define MEM_SRCDST_SUPPORTED 1
|
||||
+
|
||||
+/* Use accelerated SIMD routines when using 8-bit samples */
|
||||
+//#define WITH_SIMD 1
|
||||
+
|
||||
+/* This version of libjpeg-turbo supports run-time selection of data precision,
|
||||
+ * so BITS_IN_JSAMPLE is no longer used to specify the data precision at build
|
||||
+ * time. However, some downstream software expects the macro to be defined.
|
||||
+ * Since 12-bit data precision is an opt-in feature that requires explicitly
|
||||
+ * calling 12-bit-specific libjpeg API functions and using 12-bit-specific data
|
||||
+ * types, the unmodified portion of the libjpeg API still behaves as if it were
|
||||
+ * built for 8-bit precision, and JSAMPLE is still literally an 8-bit data
|
||||
+ * type. Thus, it is correct to define BITS_IN_JSAMPLE to 8 here.
|
||||
+ */
|
||||
+#ifndef BITS_IN_JSAMPLE
|
||||
+#define BITS_IN_JSAMPLE 8
|
||||
+#endif
|
||||
+
|
||||
+#ifdef _WIN32
|
||||
+
|
||||
+#undef RIGHT_SHIFT_IS_UNSIGNED
|
||||
+
|
||||
+/* Define "boolean" as unsigned char, not int, per Windows custom */
|
||||
+#ifndef __RPCNDR_H__ /* don't conflict if rpcndr.h already read */
|
||||
+typedef unsigned char boolean;
|
||||
+#endif
|
||||
+#define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */
|
||||
+
|
||||
+/* Define "INT32" as int, not long, per Windows custom */
|
||||
+#if !(defined(_BASETSD_H_) || defined(_BASETSD_H)) /* don't conflict if basetsd.h already read */
|
||||
+typedef short INT16;
|
||||
+typedef signed int INT32;
|
||||
+#endif
|
||||
+#define XMD_H /* prevent jmorecfg.h from redefining it */
|
||||
+
|
||||
+#else
|
||||
+
|
||||
+/* Define if your (broken) compiler shifts signed values as if they were
|
||||
+ unsigned. */
|
||||
+/* #undef RIGHT_SHIFT_IS_UNSIGNED */
|
||||
+
|
||||
+#endif
|
||||
diff --git a/thirdparty/libjpeg-turbo/src/jconfigint.h b/thirdparty/libjpeg-turbo/src/jconfigint.h
|
||||
new file mode 100644
|
||||
index 0000000000..45bd3ec321
|
||||
--- /dev/null
|
||||
+++ b/thirdparty/libjpeg-turbo/src/jconfigint.h
|
||||
@@ -0,0 +1,102 @@
|
||||
+// Originally generated by libjpeg-turbo's cmake build, then modified to support multiple platforms.
|
||||
+
|
||||
+/* libjpeg-turbo build number */
|
||||
+#define BUILD "20250317"
|
||||
+
|
||||
+/* How to hide global symbols. */
|
||||
+#ifndef HIDDEN
|
||||
+ #if defined(__GNUC__) && (__GNUC__ >= 4) && !defined(__MINGW32__)
|
||||
+ #define HIDDEN __attribute__((visibility("hidden")))
|
||||
+ #else
|
||||
+ #define HIDDEN
|
||||
+ #endif
|
||||
+#endif
|
||||
+
|
||||
+/* Compiler's inline keyword */
|
||||
+#undef inline
|
||||
+
|
||||
+/* How to obtain function inlining. */
|
||||
+#if defined(__GNUC__) && (__GNUC__ >= 4) && !defined(__MINGW32__)
|
||||
+ #define INLINE __inline__ __attribute__((always_inline))
|
||||
+#else
|
||||
+ #define INLINE inline
|
||||
+#endif
|
||||
+
|
||||
+/* How to obtain thread-local storage */
|
||||
+#if defined(_MSC_VER)
|
||||
+#define THREAD_LOCAL __declspec(thread)
|
||||
+#else
|
||||
+#define THREAD_LOCAL __thread
|
||||
+#endif
|
||||
+
|
||||
+/* Define to the full name of this package. */
|
||||
+#define PACKAGE_NAME "libjpeg-turbo"
|
||||
+
|
||||
+/* Version number of package */
|
||||
+#define VERSION "3.1.0"
|
||||
+
|
||||
+/* The size of `size_t', as computed by sizeof. */
|
||||
+#if defined(__SIZEOF_SIZE_T__)
|
||||
+ #define SIZEOF_SIZE_T __SIZEOF_SIZE_T__
|
||||
+#elif defined(_WIN64)
|
||||
+ #define SIZEOF_SIZE_T 8
|
||||
+#elif defined(_WIN32)
|
||||
+ #define SIZEOF_SIZE_T 4
|
||||
+#else
|
||||
+ #error "Cannot determine size of size_t"
|
||||
+#endif
|
||||
+
|
||||
+/* Define if your compiler has __builtin_ctzl() and sizeof(unsigned long) == sizeof(size_t). */
|
||||
+#if defined(__GNUC__)
|
||||
+ #define HAVE_BUILTIN_CTZL
|
||||
+#endif
|
||||
+
|
||||
+/* Define to 1 if you have the <intrin.h> header file. */
|
||||
+/* #undef HAVE_INTRIN_H */
|
||||
+
|
||||
+#if defined(_MSC_VER) && defined(HAVE_INTRIN_H)
|
||||
+#if (SIZEOF_SIZE_T == 8)
|
||||
+#define HAVE_BITSCANFORWARD64
|
||||
+#elif (SIZEOF_SIZE_T == 4)
|
||||
+#define HAVE_BITSCANFORWARD
|
||||
+#endif
|
||||
+#endif
|
||||
+
|
||||
+#if defined(__has_attribute)
|
||||
+#if __has_attribute(fallthrough)
|
||||
+#define FALLTHROUGH __attribute__((fallthrough));
|
||||
+#else
|
||||
+#define FALLTHROUGH
|
||||
+#endif
|
||||
+#else
|
||||
+#define FALLTHROUGH
|
||||
+#endif
|
||||
+
|
||||
+/*
|
||||
+ * 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!
|
||||
+ */
|
||||
+
|
||||
+#ifndef BITS_IN_JSAMPLE
|
||||
+#define BITS_IN_JSAMPLE 8 /* use 8 or 12 */
|
||||
+#endif
|
||||
+
|
||||
+#undef C_ARITH_CODING_SUPPORTED
|
||||
+#undef D_ARITH_CODING_SUPPORTED
|
||||
+#undef WITH_SIMD
|
||||
+
|
||||
+#if BITS_IN_JSAMPLE == 8
|
||||
+
|
||||
+/* Support arithmetic encoding */
|
||||
+#define C_ARITH_CODING_SUPPORTED 1
|
||||
+
|
||||
+/* Support arithmetic decoding */
|
||||
+#define D_ARITH_CODING_SUPPORTED 1
|
||||
+
|
||||
+/* Use accelerated SIMD routines. */
|
||||
+//#define WITH_SIMD 1
|
||||
+
|
||||
+#endif
|
||||
diff --git a/thirdparty/libjpeg-turbo/src/jmorecfg.h b/thirdparty/libjpeg-turbo/src/jmorecfg.h
|
||||
index 89c7842c87..c96edd2300 100644
|
||||
--- a/thirdparty/libjpeg-turbo/src/jmorecfg.h
|
||||
+++ b/thirdparty/libjpeg-turbo/src/jmorecfg.h
|
||||
@@ -1,3 +1,5 @@
|
||||
+// Modified to remove lossless jpeg support.
|
||||
+
|
||||
/*
|
||||
* jmorecfg.h
|
||||
*
|
||||
@@ -242,7 +244,7 @@ typedef int boolean;
|
||||
|
||||
#define C_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */
|
||||
#define C_PROGRESSIVE_SUPPORTED /* Progressive JPEG? (Requires MULTISCAN)*/
|
||||
-#define C_LOSSLESS_SUPPORTED /* Lossless JPEG? */
|
||||
+//#define C_LOSSLESS_SUPPORTED /* Lossless JPEG? */
|
||||
#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
|
||||
@@ -259,7 +261,7 @@ typedef int boolean;
|
||||
|
||||
#define D_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */
|
||||
#define D_PROGRESSIVE_SUPPORTED /* Progressive JPEG? (Requires MULTISCAN)*/
|
||||
-#define D_LOSSLESS_SUPPORTED /* Lossless JPEG? */
|
||||
+//#define D_LOSSLESS_SUPPORTED /* Lossless JPEG? */
|
||||
#define SAVE_MARKERS_SUPPORTED /* jpeg_save_markers() needed? */
|
||||
#define BLOCK_SMOOTHING_SUPPORTED /* Block smoothing? (Progressive only) */
|
||||
#define IDCT_SCALING_SUPPORTED /* Output rescaling via IDCT? */
|
||||
diff --git a/thirdparty/libjpeg-turbo/src/jversion.h b/thirdparty/libjpeg-turbo/src/jversion.h
|
||||
new file mode 100644
|
||||
index 0000000000..40f7a6cc82
|
||||
--- /dev/null
|
||||
+++ b/thirdparty/libjpeg-turbo/src/jversion.h
|
||||
@@ -0,0 +1,58 @@
|
||||
+// Originally generated by libjpeg-turbo's cmake build, then modified to support multiple platforms.
|
||||
+
|
||||
+/*
|
||||
+ * jversion.h
|
||||
+ *
|
||||
+ * This file was part of the Independent JPEG Group's software:
|
||||
+ * Copyright (C) 1991-2020, Thomas G. Lane, Guido Vollbeding.
|
||||
+ * libjpeg-turbo Modifications:
|
||||
+ * Copyright (C) 2010, 2012-2024, D. R. Commander.
|
||||
+ * For conditions of distribution and use, see the accompanying README.ijg
|
||||
+ * file.
|
||||
+ *
|
||||
+ * This file contains software version identification.
|
||||
+ */
|
||||
+
|
||||
+
|
||||
+#if JPEG_LIB_VERSION >= 80
|
||||
+
|
||||
+#define JVERSION "8d 15-Jan-2012"
|
||||
+
|
||||
+#elif JPEG_LIB_VERSION >= 70
|
||||
+
|
||||
+#define JVERSION "7 27-Jun-2009"
|
||||
+
|
||||
+#else
|
||||
+
|
||||
+#define JVERSION "6b 27-Mar-1998"
|
||||
+
|
||||
+#endif
|
||||
+
|
||||
+/*
|
||||
+ * NOTE: It is our convention to place the authors in the following order:
|
||||
+ * - libjpeg-turbo authors (2009-) in descending order of the date of their
|
||||
+ * most recent contribution to the project, then in ascending order of the
|
||||
+ * date of their first contribution to the project, then in alphabetical
|
||||
+ * order
|
||||
+ * - Upstream authors in descending order of the date of the first inclusion of
|
||||
+ * their code
|
||||
+ */
|
||||
+
|
||||
+#define JCOPYRIGHT1 \
|
||||
+ "Copyright (C) 2009-2024 D. R. Commander\n" \
|
||||
+ "Copyright (C) 2015, 2020 Google, Inc.\n" \
|
||||
+ "Copyright (C) 2019-2020 Arm Limited\n" \
|
||||
+ "Copyright (C) 2015-2016, 2018 Matthieu Darbois\n" \
|
||||
+ "Copyright (C) 2011-2016 Siarhei Siamashka\n" \
|
||||
+ "Copyright (C) 2015 Intel Corporation\n"
|
||||
+#define JCOPYRIGHT2 \
|
||||
+ "Copyright (C) 2013-2014 Linaro Limited\n" \
|
||||
+ "Copyright (C) 2013-2014 MIPS Technologies, Inc.\n" \
|
||||
+ "Copyright (C) 2009, 2012 Pierre Ossman for Cendio AB\n" \
|
||||
+ "Copyright (C) 2009-2011 Nokia Corporation and/or its subsidiary(-ies)\n" \
|
||||
+ "Copyright (C) 1999-2006 MIYASAKA Masaru\n" \
|
||||
+ "Copyright (C) 1999 Ken Murchison\n" \
|
||||
+ "Copyright (C) 1991-2020 Thomas G. Lane, Guido Vollbeding\n"
|
||||
+
|
||||
+#define JCOPYRIGHT_SHORT \
|
||||
+ "Copyright (C) 1991-2024 The libjpeg-turbo Project and many others"
|
20
thirdparty/libjpeg-turbo/patches/0002-disable-16bitlossless.patch
vendored
Normal file
20
thirdparty/libjpeg-turbo/patches/0002-disable-16bitlossless.patch
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
commit 462c1cd875ae8f6b5f6406dda01881fb173ac30c
|
||||
Author: Daniel Kinsman <danielkinsman@riseup.net>
|
||||
Date: Thu Mar 20 12:21:28 2025 +1100
|
||||
|
||||
remove unneeded source files and lossless jpeg support
|
||||
|
||||
diff --git a/thirdparty/libjpeg-turbo/src/turbojpeg.c b/thirdparty/libjpeg-turbo/src/turbojpeg.c
|
||||
index 389aea55d3..eec8e2a616 100644
|
||||
--- a/thirdparty/libjpeg-turbo/src/turbojpeg.c
|
||||
+++ b/thirdparty/libjpeg-turbo/src/turbojpeg.c
|
||||
@@ -1200,9 +1200,6 @@ bailout:
|
||||
#define BITS_IN_JSAMPLE 12
|
||||
#include "turbojpeg-mp.c"
|
||||
#undef BITS_IN_JSAMPLE
|
||||
-#define BITS_IN_JSAMPLE 16
|
||||
-#include "turbojpeg-mp.c"
|
||||
-#undef BITS_IN_JSAMPLE
|
||||
|
||||
/* TurboJPEG 1.2+ */
|
||||
DLLEXPORT int tjCompress2(tjhandle handle, const unsigned char *srcBuf,
|
329
thirdparty/libjpeg-turbo/patches/0003-remove-bmp-ppm-support.patch
vendored
Normal file
329
thirdparty/libjpeg-turbo/patches/0003-remove-bmp-ppm-support.patch
vendored
Normal file
@@ -0,0 +1,329 @@
|
||||
diff --git a/thirdparty/libjpeg-turbo/src/turbojpeg-mp.c b/thirdparty/libjpeg-turbo/src/turbojpeg-mp.c
|
||||
index 1fa63b8185..72f99e236a 100644
|
||||
--- a/thirdparty/libjpeg-turbo/src/turbojpeg-mp.c
|
||||
+++ b/thirdparty/libjpeg-turbo/src/turbojpeg-mp.c
|
||||
@@ -286,271 +286,6 @@ bailout:
|
||||
return retval;
|
||||
}
|
||||
|
||||
-
|
||||
-/*************************** Packed-Pixel Image I/O **************************/
|
||||
-
|
||||
-/* TurboJPEG 3.0+ */
|
||||
-DLLEXPORT _JSAMPLE *GET_NAME(tj3LoadImage, BITS_IN_JSAMPLE)
|
||||
- (tjhandle handle, const char *filename, int *width, int align, int *height,
|
||||
- int *pixelFormat)
|
||||
-{
|
||||
- static const char FUNCTION_NAME[] =
|
||||
- GET_STRING(tj3LoadImage, BITS_IN_JSAMPLE);
|
||||
-
|
||||
-#if BITS_IN_JSAMPLE != 16 || defined(C_LOSSLESS_SUPPORTED)
|
||||
-
|
||||
- int retval = 0, tempc;
|
||||
- size_t pitch;
|
||||
- tjhandle handle2 = NULL;
|
||||
- tjinstance *this2;
|
||||
- j_compress_ptr cinfo = NULL;
|
||||
- cjpeg_source_ptr src;
|
||||
- _JSAMPLE *dstBuf = NULL;
|
||||
- FILE *file = NULL;
|
||||
- boolean invert;
|
||||
-
|
||||
- GET_TJINSTANCE(handle, NULL)
|
||||
-
|
||||
- if (!filename || !width || align < 1 || !height || !pixelFormat ||
|
||||
- *pixelFormat < TJPF_UNKNOWN || *pixelFormat >= TJ_NUMPF)
|
||||
- THROW("Invalid argument");
|
||||
- if ((align & (align - 1)) != 0)
|
||||
- THROW("Alignment must be a power of 2");
|
||||
-
|
||||
- /* The instance handle passed to this function is used only for parameter
|
||||
- retrieval. Create a new temporary instance to avoid interfering with the
|
||||
- libjpeg state of the primary instance. */
|
||||
- if ((handle2 = tj3Init(TJINIT_COMPRESS)) == NULL) return NULL;
|
||||
- this2 = (tjinstance *)handle2;
|
||||
- cinfo = &this2->cinfo;
|
||||
-
|
||||
-#ifdef _MSC_VER
|
||||
- if (fopen_s(&file, filename, "rb") || file == NULL)
|
||||
-#else
|
||||
- if ((file = fopen(filename, "rb")) == NULL)
|
||||
-#endif
|
||||
- THROW_UNIX("Cannot open input file");
|
||||
-
|
||||
- if ((tempc = getc(file)) < 0 || ungetc(tempc, file) == EOF)
|
||||
- THROW_UNIX("Could not read input file")
|
||||
- else if (tempc == EOF)
|
||||
- THROW("Input file contains no data");
|
||||
-
|
||||
- if (setjmp(this2->jerr.setjmp_buffer)) {
|
||||
- /* If we get here, the JPEG code has signaled an error. */
|
||||
- retval = -1; goto bailout;
|
||||
- }
|
||||
-
|
||||
- cinfo->data_precision = BITS_IN_JSAMPLE;
|
||||
- if (*pixelFormat == TJPF_UNKNOWN) cinfo->in_color_space = JCS_UNKNOWN;
|
||||
- else cinfo->in_color_space = pf2cs[*pixelFormat];
|
||||
- if (tempc == 'B') {
|
||||
- if ((src = jinit_read_bmp(cinfo, FALSE)) == NULL)
|
||||
- THROW("Could not initialize bitmap loader");
|
||||
- invert = !this->bottomUp;
|
||||
- } else if (tempc == 'P') {
|
||||
-#if BITS_IN_JSAMPLE == 8
|
||||
- if (this->precision >= 2 && this->precision <= BITS_IN_JSAMPLE)
|
||||
-#else
|
||||
- if (this->precision >= BITS_IN_JSAMPLE - 3 &&
|
||||
- this->precision <= BITS_IN_JSAMPLE)
|
||||
-#endif
|
||||
- cinfo->data_precision = this->precision;
|
||||
- if ((src = _jinit_read_ppm(cinfo)) == NULL)
|
||||
- THROW("Could not initialize PPM loader");
|
||||
- invert = this->bottomUp;
|
||||
- } else
|
||||
- THROW("Unsupported file type");
|
||||
-
|
||||
- cinfo->mem->max_memory_to_use = (long)this->maxMemory * 1048576L;
|
||||
-
|
||||
- src->input_file = file;
|
||||
- /* Refuse to load images larger than the specified size. */
|
||||
- src->max_pixels = this->maxPixels;
|
||||
- (*src->start_input) (cinfo, src);
|
||||
- if (tempc == 'B') {
|
||||
- if (cinfo->X_density && cinfo->Y_density) {
|
||||
- this->xDensity = cinfo->X_density;
|
||||
- this->yDensity = cinfo->Y_density;
|
||||
- this->densityUnits = cinfo->density_unit;
|
||||
- }
|
||||
- }
|
||||
- (*cinfo->mem->realize_virt_arrays) ((j_common_ptr)cinfo);
|
||||
-
|
||||
- *width = cinfo->image_width; *height = cinfo->image_height;
|
||||
- *pixelFormat = cs2pf[cinfo->in_color_space];
|
||||
-
|
||||
- pitch = PAD((*width) * tjPixelSize[*pixelFormat], align);
|
||||
- if (
|
||||
-#if ULLONG_MAX > SIZE_MAX
|
||||
- (unsigned long long)pitch * (unsigned long long)(*height) >
|
||||
- (unsigned long long)((size_t)-1) ||
|
||||
-#endif
|
||||
- (dstBuf = (_JSAMPLE *)malloc(pitch * (*height) *
|
||||
- sizeof(_JSAMPLE))) == NULL)
|
||||
- THROW("Memory allocation failure");
|
||||
-
|
||||
- if (setjmp(this2->jerr.setjmp_buffer)) {
|
||||
- /* If we get here, the JPEG code has signaled an error. */
|
||||
- retval = -1; goto bailout;
|
||||
- }
|
||||
-
|
||||
- while (cinfo->next_scanline < cinfo->image_height) {
|
||||
- int i, nlines = (*src->get_pixel_rows) (cinfo, src);
|
||||
-
|
||||
- for (i = 0; i < nlines; i++) {
|
||||
- _JSAMPLE *dstptr;
|
||||
- int row;
|
||||
-
|
||||
- row = cinfo->next_scanline + i;
|
||||
- if (invert) dstptr = &dstBuf[((*height) - row - 1) * pitch];
|
||||
- else dstptr = &dstBuf[row * pitch];
|
||||
- memcpy(dstptr, src->_buffer[i],
|
||||
- (*width) * tjPixelSize[*pixelFormat] * sizeof(_JSAMPLE));
|
||||
- }
|
||||
- cinfo->next_scanline += nlines;
|
||||
- }
|
||||
-
|
||||
- (*src->finish_input) (cinfo, src);
|
||||
-
|
||||
-bailout:
|
||||
- tj3Destroy(handle2);
|
||||
- if (file) fclose(file);
|
||||
- if (retval < 0) { free(dstBuf); dstBuf = NULL; }
|
||||
- return dstBuf;
|
||||
-
|
||||
-#else /* BITS_IN_JSAMPLE != 16 || defined(C_LOSSLESS_SUPPORTED) */
|
||||
-
|
||||
- static const char ERROR_MSG[] =
|
||||
- "16-bit data precision requires lossless JPEG,\n"
|
||||
- "which was disabled at build time.";
|
||||
- _JSAMPLE *retval = NULL;
|
||||
-
|
||||
- GET_TJINSTANCE(handle, NULL)
|
||||
- SNPRINTF(this->errStr, JMSG_LENGTH_MAX, "%s(): %s", FUNCTION_NAME,
|
||||
- ERROR_MSG);
|
||||
- this->isInstanceError = TRUE; THROWG(ERROR_MSG, NULL)
|
||||
-
|
||||
-bailout:
|
||||
- return retval;
|
||||
-
|
||||
-#endif
|
||||
-}
|
||||
-
|
||||
-
|
||||
-/* TurboJPEG 3.0+ */
|
||||
-DLLEXPORT int GET_NAME(tj3SaveImage, BITS_IN_JSAMPLE)
|
||||
- (tjhandle handle, const char *filename, const _JSAMPLE *buffer, int width,
|
||||
- int pitch, int height, int pixelFormat)
|
||||
-{
|
||||
- static const char FUNCTION_NAME[] =
|
||||
- GET_STRING(tj3SaveImage, BITS_IN_JSAMPLE);
|
||||
- int retval = 0;
|
||||
-
|
||||
-#if BITS_IN_JSAMPLE != 16 || defined(D_LOSSLESS_SUPPORTED)
|
||||
-
|
||||
- tjhandle handle2 = NULL;
|
||||
- tjinstance *this2;
|
||||
- j_decompress_ptr dinfo = NULL;
|
||||
- djpeg_dest_ptr dst;
|
||||
- FILE *file = NULL;
|
||||
- char *ptr = NULL;
|
||||
- boolean invert;
|
||||
-
|
||||
- GET_TJINSTANCE(handle, -1)
|
||||
-
|
||||
- if (!filename || !buffer || width < 1 || pitch < 0 || height < 1 ||
|
||||
- pixelFormat < 0 || pixelFormat >= TJ_NUMPF)
|
||||
- THROW("Invalid argument");
|
||||
-
|
||||
- /* The instance handle passed to this function is used only for parameter
|
||||
- retrieval. Create a new temporary instance to avoid interfering with the
|
||||
- libjpeg state of the primary instance. */
|
||||
- if ((handle2 = tj3Init(TJINIT_DECOMPRESS)) == NULL)
|
||||
- return -1;
|
||||
- this2 = (tjinstance *)handle2;
|
||||
- dinfo = &this2->dinfo;
|
||||
-
|
||||
-#ifdef _MSC_VER
|
||||
- if (fopen_s(&file, filename, "wb") || file == NULL)
|
||||
-#else
|
||||
- if ((file = fopen(filename, "wb")) == NULL)
|
||||
-#endif
|
||||
- THROW_UNIX("Cannot open output file");
|
||||
-
|
||||
- if (setjmp(this2->jerr.setjmp_buffer)) {
|
||||
- /* If we get here, the JPEG code has signaled an error. */
|
||||
- retval = -1; goto bailout;
|
||||
- }
|
||||
-
|
||||
- this2->dinfo.out_color_space = pf2cs[pixelFormat];
|
||||
- dinfo->image_width = width; dinfo->image_height = height;
|
||||
- dinfo->global_state = DSTATE_READY;
|
||||
- dinfo->scale_num = dinfo->scale_denom = 1;
|
||||
- dinfo->data_precision = BITS_IN_JSAMPLE;
|
||||
-
|
||||
- ptr = strrchr(filename, '.');
|
||||
- if (ptr && !strcasecmp(ptr, ".bmp")) {
|
||||
- if ((dst = jinit_write_bmp(dinfo, FALSE, FALSE)) == NULL)
|
||||
- THROW("Could not initialize bitmap writer");
|
||||
- invert = !this->bottomUp;
|
||||
- dinfo->X_density = (UINT16)this->xDensity;
|
||||
- dinfo->Y_density = (UINT16)this->yDensity;
|
||||
- dinfo->density_unit = (UINT8)this->densityUnits;
|
||||
- } else {
|
||||
-#if BITS_IN_JSAMPLE == 8
|
||||
- if (this->precision >= 2 && this->precision <= BITS_IN_JSAMPLE)
|
||||
-#else
|
||||
- if (this->precision >= BITS_IN_JSAMPLE - 3 &&
|
||||
- this->precision <= BITS_IN_JSAMPLE)
|
||||
-#endif
|
||||
- dinfo->data_precision = this->precision;
|
||||
- if ((dst = _jinit_write_ppm(dinfo)) == NULL)
|
||||
- THROW("Could not initialize PPM writer");
|
||||
- invert = this->bottomUp;
|
||||
- }
|
||||
-
|
||||
- dinfo->mem->max_memory_to_use = (long)this->maxMemory * 1048576L;
|
||||
-
|
||||
- dst->output_file = file;
|
||||
- (*dst->start_output) (dinfo, dst);
|
||||
- (*dinfo->mem->realize_virt_arrays) ((j_common_ptr)dinfo);
|
||||
-
|
||||
- if (pitch == 0) pitch = width * tjPixelSize[pixelFormat];
|
||||
-
|
||||
- while (dinfo->output_scanline < dinfo->output_height) {
|
||||
- _JSAMPLE *rowptr;
|
||||
-
|
||||
- if (invert)
|
||||
- rowptr =
|
||||
- (_JSAMPLE *)&buffer[(height - dinfo->output_scanline - 1) * pitch];
|
||||
- else
|
||||
- rowptr = (_JSAMPLE *)&buffer[dinfo->output_scanline * pitch];
|
||||
- memcpy(dst->_buffer[0], rowptr,
|
||||
- width * tjPixelSize[pixelFormat] * sizeof(_JSAMPLE));
|
||||
- (*dst->put_pixel_rows) (dinfo, dst, 1);
|
||||
- dinfo->output_scanline++;
|
||||
- }
|
||||
-
|
||||
- (*dst->finish_output) (dinfo, dst);
|
||||
-
|
||||
-bailout:
|
||||
- tj3Destroy(handle2);
|
||||
- if (file) fclose(file);
|
||||
- return retval;
|
||||
-
|
||||
-#else /* BITS_IN_JSAMPLE != 16 || defined(D_LOSSLESS_SUPPORTED) */
|
||||
-
|
||||
- GET_TJINSTANCE(handle, -1)
|
||||
- THROW("16-bit data precision requires lossless JPEG,\n"
|
||||
- "which was disabled at build time.")
|
||||
-bailout:
|
||||
- return retval;
|
||||
-
|
||||
-#endif
|
||||
-}
|
||||
-
|
||||
-
|
||||
#undef _JSAMPLE
|
||||
#undef _JSAMPROW
|
||||
#undef _buffer
|
||||
diff --git a/thirdparty/libjpeg-turbo/src/turbojpeg.c b/thirdparty/libjpeg-turbo/src/turbojpeg.c
|
||||
index eec8e2a616..8ce446148a 100644
|
||||
--- a/thirdparty/libjpeg-turbo/src/turbojpeg.c
|
||||
+++ b/thirdparty/libjpeg-turbo/src/turbojpeg.c
|
||||
@@ -3095,48 +3095,3 @@ bailout:
|
||||
free(sizes);
|
||||
return retval;
|
||||
}
|
||||
-
|
||||
-
|
||||
-/*************************** Packed-Pixel Image I/O **************************/
|
||||
-
|
||||
-/* tj3LoadImage*() is implemented in turbojpeg-mp.c */
|
||||
-
|
||||
-/* TurboJPEG 2.0+ */
|
||||
-DLLEXPORT unsigned char *tjLoadImage(const char *filename, int *width,
|
||||
- int align, int *height,
|
||||
- int *pixelFormat, int flags)
|
||||
-{
|
||||
- tjhandle handle = NULL;
|
||||
- unsigned char *dstBuf = NULL;
|
||||
-
|
||||
- if ((handle = tj3Init(TJINIT_COMPRESS)) == NULL) return NULL;
|
||||
-
|
||||
- processFlags(handle, flags, COMPRESS);
|
||||
-
|
||||
- dstBuf = tj3LoadImage8(handle, filename, width, align, height, pixelFormat);
|
||||
-
|
||||
- tj3Destroy(handle);
|
||||
- return dstBuf;
|
||||
-}
|
||||
-
|
||||
-
|
||||
-/* tj3SaveImage*() is implemented in turbojpeg-mp.c */
|
||||
-
|
||||
-/* TurboJPEG 2.0+ */
|
||||
-DLLEXPORT int tjSaveImage(const char *filename, unsigned char *buffer,
|
||||
- int width, int pitch, int height, int pixelFormat,
|
||||
- int flags)
|
||||
-{
|
||||
- tjhandle handle = NULL;
|
||||
- int retval = -1;
|
||||
-
|
||||
- if ((handle = tj3Init(TJINIT_DECOMPRESS)) == NULL) return -1;
|
||||
-
|
||||
- processFlags(handle, flags, DECOMPRESS);
|
||||
-
|
||||
- retval = tj3SaveImage8(handle, filename, buffer, width, pitch, height,
|
||||
- pixelFormat);
|
||||
-
|
||||
- tj3Destroy(handle);
|
||||
- return retval;
|
||||
-}
|
Reference in New Issue
Block a user