@revizly/sharp-libvips-dev 1.0.52 → 1.0.54

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/README.md +2 -0
  2. package/include/brotli/decode.h +409 -0
  3. package/include/brotli/encode.h +505 -0
  4. package/include/brotli/port.h +302 -0
  5. package/include/brotli/shared_dictionary.h +100 -0
  6. package/include/brotli/types.h +83 -0
  7. package/include/expat.h +72 -27
  8. package/include/expat_config.h +3 -7
  9. package/include/expat_external.h +3 -0
  10. package/include/glib-2.0/glib/gutils.h +1 -1
  11. package/include/harfbuzz/hb-version.h +2 -2
  12. package/include/jxl/cms.h +24 -0
  13. package/include/jxl/cms_interface.h +255 -0
  14. package/include/jxl/codestream_header.h +433 -0
  15. package/include/jxl/color_encoding.h +161 -0
  16. package/include/jxl/compressed_icc.h +75 -0
  17. package/include/jxl/decode.h +1475 -0
  18. package/include/jxl/decode_cxx.h +58 -0
  19. package/include/jxl/encode.h +1629 -0
  20. package/include/jxl/encode_cxx.h +58 -0
  21. package/include/jxl/gain_map.h +129 -0
  22. package/include/jxl/jxl_cms_export.h +42 -0
  23. package/include/jxl/jxl_export.h +42 -0
  24. package/include/jxl/jxl_threads_export.h +42 -0
  25. package/include/jxl/memory_manager.h +73 -0
  26. package/include/jxl/parallel_runner.h +164 -0
  27. package/include/jxl/resizable_parallel_runner.h +77 -0
  28. package/include/jxl/resizable_parallel_runner_cxx.h +65 -0
  29. package/include/jxl/stats.h +103 -0
  30. package/include/jxl/thread_parallel_runner.h +71 -0
  31. package/include/jxl/thread_parallel_runner_cxx.h +66 -0
  32. package/include/jxl/types.h +154 -0
  33. package/include/jxl/version.h +44 -0
  34. package/include/libheif/heif_context.h +7 -4
  35. package/include/libheif/heif_encoding.h +5 -0
  36. package/include/libheif/heif_error.h +7 -0
  37. package/include/libheif/heif_image.h +10 -0
  38. package/include/libheif/heif_tiling.h +12 -0
  39. package/include/libheif/heif_version.h +2 -2
  40. package/include/libpng16/png.h +7 -7
  41. package/include/libpng16/pngconf.h +1 -1
  42. package/include/libpng16/pnglibconf.h +1 -1
  43. package/include/png.h +7 -7
  44. package/include/pngconf.h +1 -1
  45. package/include/pnglibconf.h +1 -1
  46. package/include/vips/version.h +1 -1
  47. package/package.json +1 -1
  48. package/versions.json +8 -6
@@ -0,0 +1,65 @@
1
+ // Copyright (c) the JPEG XL Project Authors. All rights reserved.
2
+ //
3
+ // Use of this source code is governed by a BSD-style
4
+ // license that can be found in the LICENSE file.
5
+
6
+ /// @addtogroup libjxl_cpp
7
+ /// @{
8
+ ///
9
+ /// @file resizable_parallel_runner_cxx.h
10
+ /// @ingroup libjxl_threads
11
+ /// @brief C++ header-only helper for @ref resizable_parallel_runner.h.
12
+ ///
13
+ /// There's no binary library associated with the header since this is a header
14
+ /// only library.
15
+
16
+ #ifndef JXL_RESIZABLE_PARALLEL_RUNNER_CXX_H_
17
+ #define JXL_RESIZABLE_PARALLEL_RUNNER_CXX_H_
18
+
19
+ #include <jxl/memory_manager.h>
20
+ #include <jxl/resizable_parallel_runner.h>
21
+
22
+ #include <memory>
23
+
24
+ #ifndef __cplusplus
25
+ #error \
26
+ "This a C++ only header. Use jxl/jxl_resizable_parallel_runner.h from C" \
27
+ "sources."
28
+ #endif
29
+
30
+ /// Struct to call JxlResizableParallelRunnerDestroy from the
31
+ /// JxlResizableParallelRunnerPtr unique_ptr.
32
+ struct JxlResizableParallelRunnerDestroyStruct {
33
+ /// Calls @ref JxlResizableParallelRunnerDestroy() on the passed runner.
34
+ void operator()(void* runner) { JxlResizableParallelRunnerDestroy(runner); }
35
+ };
36
+
37
+ /// std::unique_ptr<> type that calls JxlResizableParallelRunnerDestroy() when
38
+ /// releasing the runner.
39
+ ///
40
+ /// Use this helper type from C++ sources to ensure the runner is destroyed and
41
+ /// their internal resources released.
42
+ typedef std::unique_ptr<void, JxlResizableParallelRunnerDestroyStruct>
43
+ JxlResizableParallelRunnerPtr;
44
+
45
+ /// Creates an instance of JxlResizableParallelRunner into a
46
+ /// JxlResizableParallelRunnerPtr and initializes it.
47
+ ///
48
+ /// This function returns a unique_ptr that will call
49
+ /// JxlResizableParallelRunnerDestroy() when releasing the pointer. See @ref
50
+ /// JxlResizableParallelRunnerCreate for details on the instance creation.
51
+ ///
52
+ /// @param memory_manager custom allocator function. It may be NULL. The memory
53
+ /// manager will be copied internally.
54
+ /// @return a @c NULL JxlResizableParallelRunnerPtr if the instance can not be
55
+ /// allocated or initialized
56
+ /// @return initialized JxlResizableParallelRunnerPtr instance otherwise.
57
+ static inline JxlResizableParallelRunnerPtr JxlResizableParallelRunnerMake(
58
+ const JxlMemoryManager* memory_manager) {
59
+ return JxlResizableParallelRunnerPtr(
60
+ JxlResizableParallelRunnerCreate(memory_manager));
61
+ }
62
+
63
+ #endif // JXL_RESIZABLE_PARALLEL_RUNNER_CXX_H_
64
+
65
+ /// @}
@@ -0,0 +1,103 @@
1
+ /* Copyright (c) the JPEG XL Project Authors. All rights reserved.
2
+ *
3
+ * Use of this source code is governed by a BSD-style
4
+ * license that can be found in the LICENSE file.
5
+ */
6
+
7
+ /** @addtogroup libjxl_encoder
8
+ * @{
9
+ * @file stats.h
10
+ * @brief API to collect various statistics from JXL encoder.
11
+ */
12
+
13
+ #ifndef JXL_STATS_H_
14
+ #define JXL_STATS_H_
15
+
16
+ #include <jxl/jxl_export.h>
17
+ #include <stddef.h>
18
+
19
+ #ifdef __cplusplus
20
+ extern "C" {
21
+ #endif
22
+
23
+ /**
24
+ * Opaque structure that holds the encoder statistics.
25
+ *
26
+ * Allocated and initialized with @ref JxlEncoderStatsCreate().
27
+ * Cleaned up and deallocated with @ref JxlEncoderStatsDestroy().
28
+ */
29
+ typedef struct JxlEncoderStats JxlEncoderStats;
30
+
31
+ /**
32
+ * Creates an instance of JxlEncoderStats and initializes it.
33
+ *
34
+ * @return pointer to initialized @ref JxlEncoderStats instance
35
+ */
36
+ JXL_EXPORT JxlEncoderStats* JxlEncoderStatsCreate(void);
37
+
38
+ /**
39
+ * Deinitializes and frees JxlEncoderStats instance.
40
+ *
41
+ * @param stats instance to be cleaned up and deallocated. No-op if stats is
42
+ * null pointer.
43
+ */
44
+ JXL_EXPORT void JxlEncoderStatsDestroy(JxlEncoderStats* stats);
45
+
46
+ /** Data type for querying @ref JxlEncoderStats object
47
+ */
48
+ typedef enum {
49
+ JXL_ENC_STAT_HEADER_BITS,
50
+ JXL_ENC_STAT_TOC_BITS,
51
+ JXL_ENC_STAT_DICTIONARY_BITS,
52
+ JXL_ENC_STAT_SPLINES_BITS,
53
+ JXL_ENC_STAT_NOISE_BITS,
54
+ JXL_ENC_STAT_QUANT_BITS,
55
+ JXL_ENC_STAT_MODULAR_TREE_BITS,
56
+ JXL_ENC_STAT_MODULAR_GLOBAL_BITS,
57
+ JXL_ENC_STAT_DC_BITS,
58
+ JXL_ENC_STAT_MODULAR_DC_GROUP_BITS,
59
+ JXL_ENC_STAT_CONTROL_FIELDS_BITS,
60
+ JXL_ENC_STAT_COEF_ORDER_BITS,
61
+ JXL_ENC_STAT_AC_HISTOGRAM_BITS,
62
+ JXL_ENC_STAT_AC_BITS,
63
+ JXL_ENC_STAT_MODULAR_AC_GROUP_BITS,
64
+ JXL_ENC_STAT_NUM_SMALL_BLOCKS,
65
+ JXL_ENC_STAT_NUM_DCT4X8_BLOCKS,
66
+ JXL_ENC_STAT_NUM_AFV_BLOCKS,
67
+ JXL_ENC_STAT_NUM_DCT8_BLOCKS,
68
+ JXL_ENC_STAT_NUM_DCT8X32_BLOCKS,
69
+ JXL_ENC_STAT_NUM_DCT16_BLOCKS,
70
+ JXL_ENC_STAT_NUM_DCT16X32_BLOCKS,
71
+ JXL_ENC_STAT_NUM_DCT32_BLOCKS,
72
+ JXL_ENC_STAT_NUM_DCT32X64_BLOCKS,
73
+ JXL_ENC_STAT_NUM_DCT64_BLOCKS,
74
+ JXL_ENC_STAT_NUM_BUTTERAUGLI_ITERS,
75
+ JXL_ENC_NUM_STATS,
76
+ } JxlEncoderStatsKey;
77
+
78
+ /** Returns the value of the statistics corresponding the given key.
79
+ *
80
+ * @param stats object that was passed to the encoder with a
81
+ * @ref JxlEncoderCollectStats function
82
+ * @param key the particular statistics to query
83
+ *
84
+ * @return the value of the statistics
85
+ */
86
+ JXL_EXPORT size_t JxlEncoderStatsGet(const JxlEncoderStats* stats,
87
+ JxlEncoderStatsKey key);
88
+
89
+ /** Updates the values of the given stats object with that of an other.
90
+ *
91
+ * @param stats object whose values will be updated (usually added together)
92
+ * @param other stats object whose values will be merged with stats
93
+ */
94
+ JXL_EXPORT void JxlEncoderStatsMerge(JxlEncoderStats* stats,
95
+ const JxlEncoderStats* other);
96
+
97
+ #ifdef __cplusplus
98
+ }
99
+ #endif
100
+
101
+ #endif /* JXL_STATS_H_ */
102
+
103
+ /** @}*/
@@ -0,0 +1,71 @@
1
+ /* Copyright (c) the JPEG XL Project Authors. All rights reserved.
2
+ *
3
+ * Use of this source code is governed by a BSD-style
4
+ * license that can be found in the LICENSE file.
5
+ */
6
+
7
+ /** @addtogroup libjxl_threads
8
+ * @{
9
+ * @file thread_parallel_runner.h
10
+ * @brief implementation using std::thread of a ::JxlParallelRunner.
11
+ */
12
+
13
+ /** Implementation of JxlParallelRunner than can be used to enable
14
+ * multithreading when using the JPEG XL library. This uses std::thread
15
+ * internally and related synchronization functions. The number of threads
16
+ * created is fixed at construction time and the threads are re-used for every
17
+ * ThreadParallelRunner::Runner call. Only one concurrent
18
+ * JxlThreadParallelRunner call per instance is allowed at a time.
19
+ *
20
+ * This is a scalable, lower-overhead thread pool runner, especially suitable
21
+ * for data-parallel computations in the fork-join model, where clients need to
22
+ * know when all tasks have completed.
23
+ *
24
+ * This thread pool can efficiently load-balance millions of tasks using an
25
+ * atomic counter, thus avoiding per-task virtual or system calls. With 48
26
+ * hyperthreads and 1M tasks that add to an atomic counter, overall runtime is
27
+ * 10-20x higher when using std::async, and ~200x for a queue-based thread
28
+ */
29
+
30
+ #ifndef JXL_THREAD_PARALLEL_RUNNER_H_
31
+ #define JXL_THREAD_PARALLEL_RUNNER_H_
32
+
33
+ #include <jxl/jxl_threads_export.h>
34
+ #include <jxl/memory_manager.h>
35
+ #include <jxl/parallel_runner.h>
36
+ #include <stddef.h>
37
+ #include <stdint.h>
38
+ #include <stdlib.h>
39
+
40
+ #ifdef __cplusplus
41
+ extern "C" {
42
+ #endif
43
+
44
+ /** Parallel runner internally using std::thread. Use as @ref JxlParallelRunner.
45
+ */
46
+ JXL_THREADS_EXPORT JxlParallelRetCode JxlThreadParallelRunner(
47
+ void* runner_opaque, void* jpegxl_opaque, JxlParallelRunInit init,
48
+ JxlParallelRunFunction func, uint32_t start_range, uint32_t end_range);
49
+
50
+ /** Creates the runner for @ref JxlThreadParallelRunner. Use as the opaque
51
+ * runner.
52
+ */
53
+ JXL_THREADS_EXPORT void* JxlThreadParallelRunnerCreate(
54
+ const JxlMemoryManager* memory_manager, size_t num_worker_threads);
55
+
56
+ /** Destroys the runner created by @ref JxlThreadParallelRunnerCreate.
57
+ */
58
+ JXL_THREADS_EXPORT void JxlThreadParallelRunnerDestroy(void* runner_opaque);
59
+
60
+ /** Returns a default num_worker_threads value for
61
+ * @ref JxlThreadParallelRunnerCreate.
62
+ */
63
+ JXL_THREADS_EXPORT size_t JxlThreadParallelRunnerDefaultNumWorkerThreads(void);
64
+
65
+ #ifdef __cplusplus
66
+ }
67
+ #endif
68
+
69
+ #endif /* JXL_THREAD_PARALLEL_RUNNER_H_ */
70
+
71
+ /** @}*/
@@ -0,0 +1,66 @@
1
+ // Copyright (c) the JPEG XL Project Authors. All rights reserved.
2
+ //
3
+ // Use of this source code is governed by a BSD-style
4
+ // license that can be found in the LICENSE file.
5
+
6
+ /// @addtogroup libjxl_cpp
7
+ /// @{
8
+ ///
9
+ /// @file thread_parallel_runner_cxx.h
10
+ /// @brief C++ header-only helper for @ref thread_parallel_runner.h.
11
+ ///
12
+ /// There's no binary library associated with the header since this is a header
13
+ /// only library.
14
+
15
+ #ifndef JXL_THREAD_PARALLEL_RUNNER_CXX_H_
16
+ #define JXL_THREAD_PARALLEL_RUNNER_CXX_H_
17
+
18
+ #include <jxl/memory_manager.h>
19
+ #include <jxl/thread_parallel_runner.h>
20
+
21
+ #include <cstddef>
22
+ #include <memory>
23
+
24
+ #ifndef __cplusplus
25
+ #error \
26
+ "This a C++ only header. Use jxl/jxl_thread_parallel_runner.h from C" \
27
+ "sources."
28
+ #endif
29
+
30
+ /// Struct to call JxlThreadParallelRunnerDestroy from the
31
+ /// JxlThreadParallelRunnerPtr unique_ptr.
32
+ struct JxlThreadParallelRunnerDestroyStruct {
33
+ /// Calls @ref JxlThreadParallelRunnerDestroy() on the passed runner.
34
+ void operator()(void* runner) { JxlThreadParallelRunnerDestroy(runner); }
35
+ };
36
+
37
+ /// std::unique_ptr<> type that calls JxlThreadParallelRunnerDestroy() when
38
+ /// releasing the runner.
39
+ ///
40
+ /// Use this helper type from C++ sources to ensure the runner is destroyed and
41
+ /// their internal resources released.
42
+ typedef std::unique_ptr<void, JxlThreadParallelRunnerDestroyStruct>
43
+ JxlThreadParallelRunnerPtr;
44
+
45
+ /// Creates an instance of JxlThreadParallelRunner into a
46
+ /// JxlThreadParallelRunnerPtr and initializes it.
47
+ ///
48
+ /// This function returns a unique_ptr that will call
49
+ /// JxlThreadParallelRunnerDestroy() when releasing the pointer. See @ref
50
+ /// JxlThreadParallelRunnerCreate for details on the instance creation.
51
+ ///
52
+ /// @param memory_manager custom allocator function. It may be NULL. The memory
53
+ /// manager will be copied internally.
54
+ /// @param num_worker_threads the number of worker threads to create.
55
+ /// @return a @c NULL JxlThreadParallelRunnerPtr if the instance can not be
56
+ /// allocated or initialized
57
+ /// @return initialized JxlThreadParallelRunnerPtr instance otherwise.
58
+ static inline JxlThreadParallelRunnerPtr JxlThreadParallelRunnerMake(
59
+ const JxlMemoryManager* memory_manager, size_t num_worker_threads) {
60
+ return JxlThreadParallelRunnerPtr(
61
+ JxlThreadParallelRunnerCreate(memory_manager, num_worker_threads));
62
+ }
63
+
64
+ #endif // JXL_THREAD_PARALLEL_RUNNER_CXX_H_
65
+
66
+ /// @}
@@ -0,0 +1,154 @@
1
+ /* Copyright (c) the JPEG XL Project Authors. All rights reserved.
2
+ *
3
+ * Use of this source code is governed by a BSD-style
4
+ * license that can be found in the LICENSE file.
5
+ */
6
+
7
+ /** @addtogroup libjxl_common
8
+ * @{
9
+ * @file types.h
10
+ * @brief Data types for the JPEG XL API, for both encoding and decoding.
11
+ */
12
+
13
+ #ifndef JXL_TYPES_H_
14
+ #define JXL_TYPES_H_
15
+
16
+ #include <stddef.h>
17
+ #include <stdint.h>
18
+
19
+ #ifdef __cplusplus
20
+ extern "C" {
21
+ #endif
22
+
23
+ /**
24
+ * A portable @c bool replacement.
25
+ *
26
+ * ::JXL_BOOL is a "documentation" type: actually it is @c int, but in API it
27
+ * denotes a type, whose only values are ::JXL_TRUE and ::JXL_FALSE.
28
+ */
29
+ #define JXL_BOOL int
30
+ /** Portable @c true replacement. */
31
+ #define JXL_TRUE 1
32
+ /** Portable @c false replacement. */
33
+ #define JXL_FALSE 0
34
+ /** Converts of bool-like value to either ::JXL_TRUE or ::JXL_FALSE. */
35
+ #define TO_JXL_BOOL(C) (!!(C) ? JXL_TRUE : JXL_FALSE)
36
+ /** Converts JXL_BOOL to C++ bool. */
37
+ #define FROM_JXL_BOOL(C) (static_cast<bool>(C))
38
+
39
+ /** Data type for the sample values per channel per pixel.
40
+ */
41
+ typedef enum {
42
+ /** Use 32-bit single-precision floating point values, with range 0.0-1.0
43
+ * (within gamut, may go outside this range for wide color gamut). Floating
44
+ * point output, either ::JXL_TYPE_FLOAT or ::JXL_TYPE_FLOAT16, is recommended
45
+ * for HDR and wide gamut images when color profile conversion is required. */
46
+ JXL_TYPE_FLOAT = 0,
47
+
48
+ /** Use type uint8_t. May clip wide color gamut data.
49
+ */
50
+ JXL_TYPE_UINT8 = 2,
51
+
52
+ /** Use type uint16_t. May clip wide color gamut data.
53
+ */
54
+ JXL_TYPE_UINT16 = 3,
55
+
56
+ /** Use 16-bit IEEE 754 half-precision floating point values */
57
+ JXL_TYPE_FLOAT16 = 5,
58
+ } JxlDataType;
59
+
60
+ /** Ordering of multi-byte data.
61
+ */
62
+ typedef enum {
63
+ /** Use the endianness of the system, either little endian or big endian,
64
+ * without forcing either specific endianness. Do not use if pixel data
65
+ * should be exported to a well defined format.
66
+ */
67
+ JXL_NATIVE_ENDIAN = 0,
68
+ /** Force little endian */
69
+ JXL_LITTLE_ENDIAN = 1,
70
+ /** Force big endian */
71
+ JXL_BIG_ENDIAN = 2,
72
+ } JxlEndianness;
73
+
74
+ /** Data type for the sample values per channel per pixel for the output buffer
75
+ * for pixels. This is not necessarily the same as the data type encoded in the
76
+ * codestream. The channels are interleaved per pixel. The pixels are
77
+ * organized row by row, left to right, top to bottom.
78
+ * TODO(lode): support different channel orders if needed (RGB, BGR, ...)
79
+ */
80
+ typedef struct {
81
+ /** Amount of channels available in a pixel buffer.
82
+ * 1: single-channel data, e.g. grayscale or a single extra channel
83
+ * 2: single-channel + alpha
84
+ * 3: trichromatic, e.g. RGB
85
+ * 4: trichromatic + alpha
86
+ * TODO(lode): this needs finetuning. It is not yet defined how the user
87
+ * chooses output color space. CMYK+alpha needs 5 channels.
88
+ */
89
+ uint32_t num_channels;
90
+
91
+ /** Data type of each channel.
92
+ */
93
+ JxlDataType data_type;
94
+
95
+ /** Whether multi-byte data types are represented in big endian or little
96
+ * endian format. This applies to ::JXL_TYPE_UINT16 and ::JXL_TYPE_FLOAT.
97
+ */
98
+ JxlEndianness endianness;
99
+
100
+ /** Align scanlines to a multiple of align bytes, or 0 to require no
101
+ * alignment at all (which has the same effect as value 1)
102
+ */
103
+ size_t align;
104
+ } JxlPixelFormat;
105
+
106
+ /** Settings for the interpretation of UINT input and output buffers.
107
+ * (buffers using a FLOAT data type are not affected by this)
108
+ */
109
+ typedef enum {
110
+ /** This is the default setting, where the encoder expects the input pixels
111
+ * to use the full range of the pixel format data type (e.g. for UINT16, the
112
+ * input range is 0 .. 65535 and the value 65535 is mapped to 1.0 when
113
+ * converting to float), and the decoder uses the full range to output
114
+ * pixels. If the bit depth in the basic info is different from this, the
115
+ * encoder expects the values to be rescaled accordingly (e.g. multiplied by
116
+ * 65535/4095 for a 12-bit image using UINT16 input data type). */
117
+ JXL_BIT_DEPTH_FROM_PIXEL_FORMAT = 0,
118
+
119
+ /** If this setting is selected, the encoder expects the input pixels to be
120
+ * in the range defined by the bits_per_sample value of the basic info (e.g.
121
+ * for 12-bit images using UINT16 input data types, the allowed range is
122
+ * 0 .. 4095 and the value 4095 is mapped to 1.0 when converting to float),
123
+ * and the decoder outputs pixels in this range. */
124
+ JXL_BIT_DEPTH_FROM_CODESTREAM = 1,
125
+
126
+ /** This setting can only be used in the decoder to select a custom range for
127
+ * pixel output */
128
+ JXL_BIT_DEPTH_CUSTOM = 2,
129
+ } JxlBitDepthType;
130
+
131
+ /** Data type for describing the interpretation of the input and output buffers
132
+ * in terms of the range of allowed input and output pixel values. */
133
+ typedef struct {
134
+ /** Bit depth setting, see comment on @ref JxlBitDepthType */
135
+ JxlBitDepthType type;
136
+
137
+ /** Custom bits per sample */
138
+ uint32_t bits_per_sample;
139
+
140
+ /** Custom exponent bits per sample */
141
+ uint32_t exponent_bits_per_sample;
142
+ } JxlBitDepth;
143
+
144
+ /** Data type holding the 4-character type name of an ISOBMFF box.
145
+ */
146
+ typedef char JxlBoxType[4];
147
+
148
+ #ifdef __cplusplus
149
+ }
150
+ #endif
151
+
152
+ #endif /* JXL_TYPES_H_ */
153
+
154
+ /** @}*/
@@ -0,0 +1,44 @@
1
+ /* Copyright (c) the JPEG XL Project Authors. All rights reserved.
2
+ *
3
+ * Use of this source code is governed by a BSD-style
4
+ * license that can be found in the LICENSE file.
5
+ */
6
+
7
+ /** @addtogroup libjxl_common
8
+ * @{
9
+ * @file version.h
10
+ * @brief libjxl version information
11
+ */
12
+
13
+ #ifndef JXL_VERSION_H_
14
+ #define JXL_VERSION_H_
15
+
16
+ #if defined(JPEGXL_MAJOR_VERSION) || defined(JPEGXL_MINOR_VERSION) || \
17
+ defined(JPEGXL_PATCH_VERSION)
18
+ #error JPEGXL_VERSION is already defined
19
+ #endif
20
+
21
+ #define JPEGXL_MAJOR_VERSION 0 ///< JPEG XL Major version
22
+ #define JPEGXL_MINOR_VERSION 12 ///< JPEG XL Minor version
23
+ #define JPEGXL_PATCH_VERSION 0 ///< JPEG XL Patch version
24
+
25
+ /** Can be used to conditionally compile code for a specific JXL version
26
+ * @param[maj] major version
27
+ * @param[min] minor version
28
+ *
29
+ * @code
30
+ * #if JPEGXL_NUMERIC_VERSION < JPEGXL_COMPUTE_NUMERIC_VERSION(0,8,0)
31
+ * // use old/deprecated api
32
+ * #else
33
+ * // use current api
34
+ * #endif
35
+ * @endcode
36
+ */
37
+ #define JPEGXL_COMPUTE_NUMERIC_VERSION(major,minor,patch) (((major)<<24) | ((minor)<<16) | ((patch)<<8) | 0)
38
+
39
+ /* Numeric representation of the version */
40
+ #define JPEGXL_NUMERIC_VERSION JPEGXL_COMPUTE_NUMERIC_VERSION(JPEGXL_MAJOR_VERSION, JPEGXL_MINOR_VERSION, JPEGXL_PATCH_VERSION)
41
+
42
+ #endif /* JXL_VERSION_H_ */
43
+
44
+ /** @}*/
@@ -119,12 +119,15 @@ typedef enum heif_compression_format
119
119
 
120
120
 
121
121
  // ========================= heif_context =========================
122
- // A heif_context represents a HEIF file that has been read.
123
- // In the future, you will also be able to add pictures to a heif_context
124
- // and write it into a file again.
122
+ // A heif_context represents a HEIF file. It is used either for reading a file
123
+ // (heif_context_read_from_...() and decoding its images), or for writing a new file
124
+ // (encoding images into the context and heif_context_write()), but not for both.
125
+ // A context that has been read from a file cannot be written, and an image that has been
126
+ // added to a context by encoding cannot be decoded from that context: write the file and
127
+ // read it into a new context for that.
125
128
 
126
129
 
127
- // Allocate a new context for reading HEIF files.
130
+ // Allocate a new context for reading or for writing a HEIF file.
128
131
  // Has to be freed again with heif_context_free().
129
132
  LIBHEIF_API
130
133
  heif_context* heif_context_alloc(void);
@@ -346,6 +346,11 @@ void heif_encoding_options_free(heif_encoding_options*);
346
346
  // 'options' should be NULL for now.
347
347
  // The first image added to the context is also automatically set the primary image, but
348
348
  // you can change the primary image later with heif_context_set_primary_image().
349
+ //
350
+ // The returned handle refers to an image that is being written. Use it to attach thumbnails,
351
+ // metadata or properties to the image, or to make it the primary image. It cannot be used
352
+ // to decode the image, and the functions that report the coded format of an image (bit
353
+ // depths, preferred colorspace, alpha channel) return an error or "unknown" for it.
349
354
  LIBHEIF_API
350
355
  heif_error heif_context_encode_image(heif_context*,
351
356
  const heif_image* image,
@@ -297,6 +297,13 @@ typedef struct heif_error
297
297
  heif_suberror_code subcode;
298
298
 
299
299
  // textual error message (is always defined, you do not have to check for NULL)
300
+ //
301
+ // The string is owned by libheif. For many errors, it is stored in the object on which the
302
+ // function that returned the error was called (the heif_context, heif_image_handle,
303
+ // heif_image, heif_track, ...). It is only valid until the next function is called on that
304
+ // object, and at most until that object or the heif_context it belongs to is released.
305
+ // If you need the message for longer, copy it. In particular, read or copy it before you
306
+ // free the heif_context or release the image whose function returned the error.
300
307
  const char* message;
301
308
  } heif_error;
302
309
 
@@ -368,9 +368,19 @@ heif_error heif_image_create(int width, int height,
368
368
  * with an interleaved format like RRGGBB where each color is represented by 10 bits,
369
369
  * the {@code bit_depth} would be {@code 10} rather than {@code 30}.
370
370
  *
371
+ * <p>The interleaved formats define the bit depth of their components:
372
+ * {@code heif_chroma_interleaved_RGB} and {@code heif_chroma_interleaved_RGBA} have 8 bits,
373
+ * the {@code heif_chroma_interleaved_RRGGBB...} formats have 9 to 16 bits.
374
+ * Other bit depths are rejected for these formats.
375
+ *
371
376
  * <p>For backward compatibility, one can also specify 24bits for RGB and 32bits for RGBA,
372
377
  * instead of the preferred 8 bits. However, this use is deprecated.
373
378
  *
379
+ * <p>Planes with a bit depth of 9 to 16 bits store each sample in a 16-bit word. The sample
380
+ * values that are written into the plane have to be within the range of {@code bit_depth} bits,
381
+ * i.e. the unused upper bits must be zero. The encoding functions return an error for an image
382
+ * that contains larger values.
383
+ *
374
384
  * <p>An image with an interleaved chroma format carries its alpha inside the interleaved
375
385
  * plane. Adding a separate {@code heif_channel_Alpha} plane to such an image is rejected
376
386
  * with an error. Use one of the interleaved formats with alpha
@@ -63,6 +63,9 @@ typedef struct heif_image_tiling
63
63
 
64
64
  // If 'process_image_transformations' is true, this returns modified sizes.
65
65
  // If it is false, the top_offset and left_offset will always be (0;0).
66
+ // The tiling describes the tiles that can be decoded independently. An image is reported
67
+ // as a single tile when its internal tiles cannot be decoded on their own, or when its
68
+ // alpha channel is stored with a different tiling.
66
69
  LIBHEIF_API
67
70
  heif_error heif_image_handle_get_image_tiling(const heif_image_handle* handle, int process_image_transformations, struct heif_image_tiling* out_tiling);
68
71
 
@@ -96,6 +99,10 @@ heif_error heif_image_handle_decode_image_tile(const heif_image_handle* in_handl
96
99
  /**
97
100
  * @brief Encodes an array of images into a grid.
98
101
  *
102
+ * All tiles have to have the same size, colorspace, chroma format and bit depths, and they have
103
+ * to consist of the same components. For example, either all tiles have an alpha channel or
104
+ * none of them has. A grid whose tiles differ in this is refused when it is decoded.
105
+ *
99
106
  * @param ctx The file context
100
107
  * @param tiles User allocated array of images that will form the grid.
101
108
  * @param rows The number of rows in the grid.
@@ -123,6 +130,11 @@ heif_error heif_context_add_grid_image(heif_context* ctx,
123
130
  const heif_encoding_options* encoding_options,
124
131
  heif_image_handle** out_grid_image_handle);
125
132
 
133
+ // Encodes an image and adds it as the tile at position (tile_x; tile_y) of a tiled image,
134
+ // for example one that was created with heif_context_add_grid_image().
135
+ // All tiles of an image have to have the same colorspace, chroma format and bit depths, and
136
+ // they have to consist of the same components. For example, either all tiles have an alpha
137
+ // channel or none of them has. A grid whose tiles differ in this is refused when it is decoded.
126
138
  LIBHEIF_API
127
139
  heif_error heif_context_add_image_tile(heif_context* ctx,
128
140
  heif_image_handle* tiled_image,
@@ -28,10 +28,10 @@
28
28
  #define LIBHEIF_HEIF_VERSION_H
29
29
 
30
30
  /* Numeric representation of the version */
31
- #define LIBHEIF_NUMERIC_VERSION ((1<<24) | (23<<16) | (5<<8) | 0)
31
+ #define LIBHEIF_NUMERIC_VERSION ((1<<24) | (23<<16) | (6<<8) | 0)
32
32
 
33
33
  /* Version string */
34
- #define LIBHEIF_VERSION "1.23.5"
34
+ #define LIBHEIF_VERSION "1.23.6"
35
35
 
36
36
  #define LIBHEIF_PLUGIN_DIRECTORY "/target/lib/libheif"
37
37
 
@@ -1,6 +1,6 @@
1
1
  /* png.h - header file for PNG reference library
2
2
  *
3
- * libpng version 1.6.58
3
+ * libpng version 1.6.59
4
4
  *
5
5
  * Copyright (c) 2018-2026 Cosmin Truta
6
6
  * Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
@@ -14,7 +14,7 @@
14
14
  * libpng versions 0.89, June 1996, through 0.96, May 1997: Andreas Dilger
15
15
  * libpng versions 0.97, January 1998, through 1.6.35, July 2018:
16
16
  * Glenn Randers-Pehrson
17
- * libpng versions 1.6.36, December 2018, through 1.6.58, April 2026:
17
+ * libpng versions 1.6.36, December 2018, through 1.6.59, September 2026:
18
18
  * Cosmin Truta
19
19
  * See also "Contributing Authors", below.
20
20
  */
@@ -238,7 +238,7 @@
238
238
  * ...
239
239
  * 1.5.30 15 10530 15.so.15.30[.0]
240
240
  * ...
241
- * 1.6.58 16 10658 16.so.16.58[.0]
241
+ * 1.6.59 16 10659 16.so.16.59[.0]
242
242
  *
243
243
  * Henceforth the source version will match the shared-library major and
244
244
  * minor numbers; the shared-library major version number will be used for
@@ -274,7 +274,7 @@
274
274
  */
275
275
 
276
276
  /* Version information for png.h - this should match the version in png.c */
277
- #define PNG_LIBPNG_VER_STRING "1.6.58"
277
+ #define PNG_LIBPNG_VER_STRING "1.6.59"
278
278
  #define PNG_HEADER_VERSION_STRING " libpng version " PNG_LIBPNG_VER_STRING "\n"
279
279
 
280
280
  /* The versions of shared library builds should stay in sync, going forward */
@@ -285,7 +285,7 @@
285
285
  /* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */
286
286
  #define PNG_LIBPNG_VER_MAJOR 1
287
287
  #define PNG_LIBPNG_VER_MINOR 6
288
- #define PNG_LIBPNG_VER_RELEASE 58
288
+ #define PNG_LIBPNG_VER_RELEASE 59
289
289
 
290
290
  /* This should be zero for a public release, or non-zero for a
291
291
  * development version.
@@ -316,7 +316,7 @@
316
316
  * From version 1.0.1 it is:
317
317
  * XXYYZZ, where XX=major, YY=minor, ZZ=release
318
318
  */
319
- #define PNG_LIBPNG_VER 10658 /* 1.6.58 */
319
+ #define PNG_LIBPNG_VER 10659 /* 1.6.59 */
320
320
 
321
321
  /* Library configuration: these options cannot be changed after
322
322
  * the library has been built.
@@ -426,7 +426,7 @@ extern "C" {
426
426
  /* This triggers a compiler error in png.c, if png.c and png.h
427
427
  * do not agree upon the version number.
428
428
  */
429
- typedef char *png_libpng_version_1_6_58;
429
+ typedef char *png_libpng_version_1_6_59;
430
430
 
431
431
  /* Basic control structions. Read libpng-manual.txt or libpng.3 for more info.
432
432
  *