@img/sharp-libvips-dev 1.0.2 → 1.0.4
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.
- package/README.md +1 -2
- package/include/aom/aom_decoder.h +1 -1
- package/include/aom/aom_encoder.h +7 -1
- package/include/aom/aom_image.h +24 -12
- package/include/aom/aom_integer.h +3 -3
- package/include/aom/aomcx.h +15 -0
- package/include/aom/aomdx.h +5 -2
- package/include/archive.h +7 -5
- package/include/archive_entry.h +5 -3
- package/include/cgif.h +3 -0
- package/include/freetype2/freetype/config/ftoption.h +1 -1
- package/include/fribidi/fribidi-config.h +2 -2
- package/include/fribidi/fribidi-unicode-version.h +3 -3
- package/include/glib-2.0/gio/gappinfo.h +40 -25
- package/include/glib-2.0/gio/gasyncresult.h +1 -1
- package/include/glib-2.0/gio/gconverter.h +5 -0
- package/include/glib-2.0/gio/gdbusintrospection.h +1 -1
- package/include/glib-2.0/gio/gfile.h +16 -0
- package/include/glib-2.0/gio/gio-visibility.h +34 -0
- package/include/glib-2.0/gio/gsettings.h +8 -0
- package/include/glib-2.0/gio/gvfs.h +2 -2
- package/include/glib-2.0/girepository/gi-visibility.h +34 -0
- package/include/glib-2.0/glib/gbookmarkfile.h +1 -1
- package/include/glib-2.0/glib/giochannel.h +2 -2
- package/include/glib-2.0/glib/glib-visibility.h +34 -0
- package/include/glib-2.0/glib/gmacros.h +12 -5
- package/include/glib-2.0/glib/gmain.h +93 -7
- package/include/glib-2.0/glib/gqsort.h +8 -1
- package/include/glib-2.0/glib/gstrfuncs.h +0 -12
- package/include/glib-2.0/glib/gstrvbuilder.h +3 -0
- package/include/glib-2.0/glib/gunicode.h +1 -1
- package/include/glib-2.0/glib/gversionmacros.h +9 -0
- package/include/glib-2.0/gmodule/gmodule-visibility.h +34 -0
- package/include/glib-2.0/gobject/gobject-visibility.h +34 -0
- package/include/glib-2.0/gobject/gtype.h +6 -6
- package/include/harfbuzz/hb-buffer.h +6 -0
- package/include/harfbuzz/hb-common.h +6 -9
- package/include/harfbuzz/hb-cplusplus.hh +8 -11
- package/include/harfbuzz/hb-subset.h +17 -4
- package/include/harfbuzz/hb-version.h +3 -3
- package/include/hwy/abort.h +28 -0
- package/include/hwy/aligned_allocator.h +48 -1
- package/include/hwy/base.h +235 -34
- package/include/hwy/detect_compiler_arch.h +84 -10
- package/include/hwy/detect_targets.h +95 -29
- package/include/hwy/foreach_target.h +12 -1
- package/include/hwy/highway.h +205 -50
- package/include/hwy/ops/arm_neon-inl.h +841 -99
- package/include/hwy/ops/arm_sve-inl.h +413 -141
- package/include/hwy/ops/emu128-inl.h +373 -360
- package/include/hwy/ops/generic_ops-inl.h +804 -401
- package/include/hwy/ops/inside-inl.h +691 -0
- package/include/hwy/ops/ppc_vsx-inl.h +456 -166
- package/include/hwy/ops/rvv-inl.h +537 -249
- package/include/hwy/ops/scalar-inl.h +169 -79
- package/include/hwy/ops/set_macros-inl.h +106 -18
- package/include/hwy/ops/shared-inl.h +23 -0
- package/include/hwy/ops/wasm_128-inl.h +130 -108
- package/include/hwy/ops/x86_128-inl.h +1892 -577
- package/include/hwy/ops/x86_256-inl.h +625 -184
- package/include/hwy/ops/x86_512-inl.h +733 -131
- package/include/hwy/targets.h +22 -21
- package/include/hwy/timer-inl.h +3 -3
- package/include/hwy/timer.h +5 -1
- package/include/libheif/heif.h +170 -15
- package/include/libheif/heif_items.h +237 -0
- package/include/libheif/heif_properties.h +38 -2
- package/include/libheif/heif_regions.h +1 -1
- package/include/libheif/heif_version.h +2 -2
- package/include/libpng16/pnglibconf.h +1 -1
- package/include/librsvg-2.0/librsvg/rsvg-cairo.h +1 -1
- package/include/librsvg-2.0/librsvg/rsvg-features.h +3 -4
- package/include/librsvg-2.0/librsvg/rsvg-pixbuf.h +235 -0
- package/include/librsvg-2.0/librsvg/rsvg-version.h +3 -3
- package/include/librsvg-2.0/librsvg/rsvg.h +55 -176
- package/include/libxml2/libxml/HTMLparser.h +12 -19
- package/include/libxml2/libxml/c14n.h +1 -12
- package/include/libxml2/libxml/debugXML.h +1 -1
- package/include/libxml2/libxml/encoding.h +9 -0
- package/include/libxml2/libxml/entities.h +12 -1
- package/include/libxml2/libxml/hash.h +19 -0
- package/include/libxml2/libxml/list.h +2 -2
- package/include/libxml2/libxml/nanohttp.h +17 -0
- package/include/libxml2/libxml/parser.h +61 -55
- package/include/libxml2/libxml/parserInternals.h +9 -1
- package/include/libxml2/libxml/pattern.h +6 -0
- package/include/libxml2/libxml/tree.h +32 -12
- package/include/libxml2/libxml/uri.h +11 -0
- package/include/libxml2/libxml/valid.h +29 -2
- package/include/libxml2/libxml/xinclude.h +7 -0
- package/include/libxml2/libxml/xmlIO.h +21 -4
- package/include/libxml2/libxml/xmlerror.h +14 -0
- package/include/libxml2/libxml/xmlexports.h +111 -15
- package/include/libxml2/libxml/xmlmemory.h +8 -45
- package/include/libxml2/libxml/xmlreader.h +2 -0
- package/include/libxml2/libxml/xmlsave.h +5 -0
- package/include/libxml2/libxml/xmlunicode.h +165 -1
- package/include/libxml2/libxml/xmlversion.h +15 -179
- package/include/libxml2/libxml/xmlwriter.h +1 -0
- package/include/libxml2/libxml/xpath.h +4 -0
- package/include/pango-1.0/pango/pango-features.h +3 -3
- package/include/pango-1.0/pango/pango-item.h +4 -2
- package/include/pango-1.0/pango/pango-version-macros.h +25 -0
- package/include/pango-1.0/pango/pangofc-font.h +2 -1
- package/include/pnglibconf.h +1 -1
- package/include/vips/util.h +1 -2
- package/include/vips/version.h +4 -4
- package/include/webp/decode.h +58 -56
- package/include/webp/demux.h +25 -21
- package/include/webp/encode.h +44 -39
- package/include/webp/mux.h +76 -15
- package/include/webp/mux_types.h +2 -1
- package/include/webp/sharpyuv/sharpyuv.h +77 -8
- package/include/webp/types.h +29 -8
- package/include/zconf.h +1 -1
- package/include/zlib.h +12 -12
- package/package.json +1 -1
- package/versions.json +14 -15
package/include/hwy/targets.h
CHANGED
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
#include "hwy/detect_targets.h"
|
|
30
30
|
#include "hwy/highway_export.h"
|
|
31
31
|
|
|
32
|
-
#if !
|
|
32
|
+
#if !defined(HWY_NO_LIBCXX)
|
|
33
33
|
#include <atomic>
|
|
34
34
|
#endif
|
|
35
35
|
|
|
@@ -112,6 +112,8 @@ static inline HWY_MAYBE_UNUSED const char* TargetName(int64_t target) {
|
|
|
112
112
|
return "SVE2";
|
|
113
113
|
case HWY_SVE:
|
|
114
114
|
return "SVE";
|
|
115
|
+
case HWY_NEON_BF16:
|
|
116
|
+
return "NEON_BF16";
|
|
115
117
|
case HWY_NEON:
|
|
116
118
|
return "NEON";
|
|
117
119
|
case HWY_NEON_WITHOUT_AES:
|
|
@@ -141,7 +143,7 @@ static inline HWY_MAYBE_UNUSED const char* TargetName(int64_t target) {
|
|
|
141
143
|
return "WASM_EMU256";
|
|
142
144
|
#endif
|
|
143
145
|
|
|
144
|
-
#if
|
|
146
|
+
#if HWY_ARCH_RISCV
|
|
145
147
|
case HWY_RVV:
|
|
146
148
|
return "RVV";
|
|
147
149
|
#endif
|
|
@@ -220,24 +222,24 @@ static inline HWY_MAYBE_UNUSED const char* TargetName(int64_t target) {
|
|
|
220
222
|
// See HWY_ARCH_X86 above for details.
|
|
221
223
|
#define HWY_MAX_DYNAMIC_TARGETS 15
|
|
222
224
|
#define HWY_HIGHEST_TARGET_BIT HWY_HIGHEST_TARGET_BIT_ARM
|
|
223
|
-
#define HWY_CHOOSE_TARGET_LIST(func_name)
|
|
224
|
-
nullptr, /* reserved */
|
|
225
|
-
nullptr, /* reserved */
|
|
226
|
-
nullptr, /* reserved */
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
nullptr, /* reserved */
|
|
230
|
-
nullptr, /* reserved */
|
|
231
|
-
nullptr, /* reserved */
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
HWY_CHOOSE_NEON(func_name), /* NEON */
|
|
225
|
+
#define HWY_CHOOSE_TARGET_LIST(func_name) \
|
|
226
|
+
nullptr, /* reserved */ \
|
|
227
|
+
nullptr, /* reserved */ \
|
|
228
|
+
nullptr, /* reserved */ \
|
|
229
|
+
HWY_CHOOSE_SVE2_128(func_name), /* SVE2 128-bit */ \
|
|
230
|
+
HWY_CHOOSE_SVE_256(func_name), /* SVE 256-bit */ \
|
|
231
|
+
nullptr, /* reserved */ \
|
|
232
|
+
nullptr, /* reserved */ \
|
|
233
|
+
nullptr, /* reserved */ \
|
|
234
|
+
HWY_CHOOSE_SVE2(func_name), /* SVE2 */ \
|
|
235
|
+
HWY_CHOOSE_SVE(func_name), /* SVE */ \
|
|
236
|
+
nullptr, /* reserved */ \
|
|
237
|
+
HWY_CHOOSE_NEON_BF16(func_name), /* NEON + f16/dot/bf16 */ \
|
|
238
|
+
nullptr, /* reserved */ \
|
|
239
|
+
HWY_CHOOSE_NEON(func_name), /* NEON */ \
|
|
238
240
|
HWY_CHOOSE_NEON_WITHOUT_AES(func_name) /* NEON without AES */
|
|
239
241
|
|
|
240
|
-
#elif
|
|
242
|
+
#elif HWY_ARCH_RISCV
|
|
241
243
|
// See HWY_ARCH_X86 above for details.
|
|
242
244
|
#define HWY_MAX_DYNAMIC_TARGETS 9
|
|
243
245
|
#define HWY_HIGHEST_TARGET_BIT HWY_HIGHEST_TARGET_BIT_RVV
|
|
@@ -323,8 +325,7 @@ struct ChosenTarget {
|
|
|
323
325
|
}
|
|
324
326
|
|
|
325
327
|
private:
|
|
326
|
-
|
|
327
|
-
#if HWY_ARCH_RVV || defined(HWY_NO_LIBCXX)
|
|
328
|
+
#if defined(HWY_NO_LIBCXX)
|
|
328
329
|
int64_t LoadMask() const { return mask_; }
|
|
329
330
|
void StoreMask(int64_t mask) { mask_ = mask; }
|
|
330
331
|
|
|
@@ -334,7 +335,7 @@ struct ChosenTarget {
|
|
|
334
335
|
void StoreMask(int64_t mask) { mask_.store(mask); }
|
|
335
336
|
|
|
336
337
|
std::atomic<int64_t> mask_{1}; // Initialized to 1 so GetIndex() returns 0.
|
|
337
|
-
#endif //
|
|
338
|
+
#endif // HWY_ARCH_RISCV
|
|
338
339
|
};
|
|
339
340
|
|
|
340
341
|
// For internal use (e.g. by FunctionCache and DisableTargets).
|
package/include/hwy/timer-inl.h
CHANGED
|
@@ -24,7 +24,6 @@
|
|
|
24
24
|
#endif
|
|
25
25
|
|
|
26
26
|
#include "hwy/highway.h"
|
|
27
|
-
#include "hwy/timer.h"
|
|
28
27
|
|
|
29
28
|
#if defined(_WIN32) || defined(_WIN64)
|
|
30
29
|
#ifndef NOMINMAX
|
|
@@ -50,6 +49,7 @@
|
|
|
50
49
|
#include <intrin.h>
|
|
51
50
|
#endif
|
|
52
51
|
|
|
52
|
+
#include <stdint.h>
|
|
53
53
|
#include <time.h> // clock_gettime
|
|
54
54
|
|
|
55
55
|
HWY_BEFORE_NAMESPACE();
|
|
@@ -139,8 +139,8 @@ inline Ticks Start() {
|
|
|
139
139
|
// "memory" avoids reordering. rdx = TSC >> 32.
|
|
140
140
|
// "cc" = flags modified by SHL.
|
|
141
141
|
: "rdx", "memory", "cc");
|
|
142
|
-
#elif
|
|
143
|
-
asm volatile("rdtime %0" : "=r"(t));
|
|
142
|
+
#elif HWY_ARCH_RISCV
|
|
143
|
+
asm volatile("fence; rdtime %0" : "=r"(t));
|
|
144
144
|
#elif defined(_WIN32) || defined(_WIN64)
|
|
145
145
|
LARGE_INTEGER counter;
|
|
146
146
|
(void)QueryPerformanceCounter(&counter);
|
package/include/hwy/timer.h
CHANGED
|
@@ -36,7 +36,7 @@ HWY_DLLEXPORT double Now();
|
|
|
36
36
|
|
|
37
37
|
// Returns whether it is safe to call timer::Stop without executing an illegal
|
|
38
38
|
// instruction; if false, fills cpu100 (a pointer to a 100 character buffer)
|
|
39
|
-
//
|
|
39
|
+
// via GetCpuString().
|
|
40
40
|
HWY_DLLEXPORT bool HaveTimerStop(char* cpu100);
|
|
41
41
|
|
|
42
42
|
// Returns tick rate, useful for converting timer::Ticks to seconds. Invariant
|
|
@@ -49,6 +49,10 @@ HWY_DLLEXPORT double InvariantTicksPerSecond();
|
|
|
49
49
|
// This call is expensive, callers should cache the result.
|
|
50
50
|
HWY_DLLEXPORT uint64_t TimerResolution();
|
|
51
51
|
|
|
52
|
+
// Returns false if no detailed description is available, otherwise fills
|
|
53
|
+
// `cpu100` with up to 100 characters (including \0) identifying the CPU model.
|
|
54
|
+
HWY_DLLEXPORT bool GetCpuString(char* cpu100);
|
|
55
|
+
|
|
52
56
|
} // namespace platform
|
|
53
57
|
|
|
54
58
|
struct Timestamp {
|
package/include/libheif/heif.h
CHANGED
|
@@ -229,6 +229,23 @@ enum heif_suberror_code
|
|
|
229
229
|
// Invalid specification of region item
|
|
230
230
|
heif_suberror_Invalid_region_data = 136,
|
|
231
231
|
|
|
232
|
+
// Image has no ispe property
|
|
233
|
+
heif_suberror_No_ispe_property = 137,
|
|
234
|
+
|
|
235
|
+
heif_suberror_Camera_intrinsic_matrix_undefined = 138,
|
|
236
|
+
|
|
237
|
+
heif_suberror_Camera_extrinsic_matrix_undefined = 139,
|
|
238
|
+
|
|
239
|
+
// Invalid JPEG 2000 codestream - usually a missing marker
|
|
240
|
+
heif_suberror_Invalid_J2K_codestream = 140,
|
|
241
|
+
|
|
242
|
+
heif_suberror_No_vvcC_box = 141,
|
|
243
|
+
|
|
244
|
+
// icbr is only needed in some situations, this error is for those cases
|
|
245
|
+
heif_suberror_No_icbr_box = 142,
|
|
246
|
+
|
|
247
|
+
// Decompressing generic compression or header compression data failed (e.g. bitstream corruption)
|
|
248
|
+
heif_suberror_Decompression_invalid_data = 150,
|
|
232
249
|
|
|
233
250
|
// --- Memory_allocation_error ---
|
|
234
251
|
|
|
@@ -237,6 +254,9 @@ enum heif_suberror_code
|
|
|
237
254
|
// security limits further.
|
|
238
255
|
heif_suberror_Security_limit_exceeded = 1000,
|
|
239
256
|
|
|
257
|
+
// There was an error from the underlying compression / decompression library.
|
|
258
|
+
// One possibility is lack of resources (e.g. memory).
|
|
259
|
+
heif_suberror_Compression_initialisation_error = 1001,
|
|
240
260
|
|
|
241
261
|
// --- Usage_error ---
|
|
242
262
|
|
|
@@ -285,6 +305,8 @@ enum heif_suberror_code
|
|
|
285
305
|
|
|
286
306
|
heif_suberror_Unsupported_header_compression_method = 3005,
|
|
287
307
|
|
|
308
|
+
// Generically compressed data used an unsupported compression method
|
|
309
|
+
heif_suberror_Unsupported_generic_compression_method = 3006,
|
|
288
310
|
|
|
289
311
|
// --- Encoder_plugin_error ---
|
|
290
312
|
|
|
@@ -304,9 +326,10 @@ enum heif_suberror_code
|
|
|
304
326
|
|
|
305
327
|
// --- Plugin loading error ---
|
|
306
328
|
|
|
307
|
-
heif_suberror_Plugin_loading_error = 6000,
|
|
308
|
-
heif_suberror_Plugin_is_not_loaded = 6001,
|
|
309
|
-
heif_suberror_Cannot_read_plugin_directory = 6002 // error while scanning the directory for plugins
|
|
329
|
+
heif_suberror_Plugin_loading_error = 6000, // a specific plugin file cannot be loaded
|
|
330
|
+
heif_suberror_Plugin_is_not_loaded = 6001, // trying to remove a plugin that is not loaded
|
|
331
|
+
heif_suberror_Cannot_read_plugin_directory = 6002, // error while scanning the directory for plugins
|
|
332
|
+
heif_suberror_No_matching_decoder_installed = 6003 // no decoder found for that compression format
|
|
310
333
|
};
|
|
311
334
|
|
|
312
335
|
|
|
@@ -408,7 +431,14 @@ enum heif_compression_format
|
|
|
408
431
|
*
|
|
409
432
|
* See ISO/IEC 23008-12:2022 Section 6.10.2
|
|
410
433
|
*/
|
|
411
|
-
heif_compression_mask = 9
|
|
434
|
+
heif_compression_mask = 9,
|
|
435
|
+
/**
|
|
436
|
+
* High Throughput JPEG 2000 (HT-J2K) compression.
|
|
437
|
+
*
|
|
438
|
+
* The encapsulation of HT-J2K is specified in ISO/IEC 15444-16:2021.
|
|
439
|
+
* The core encoding is defined in ISO/IEC 15444-15, or ITU-T T.814.
|
|
440
|
+
*/
|
|
441
|
+
heif_compression_HTJ2K = 10
|
|
412
442
|
};
|
|
413
443
|
|
|
414
444
|
enum heif_chroma
|
|
@@ -564,6 +594,18 @@ enum heif_filetype_result
|
|
|
564
594
|
LIBHEIF_API
|
|
565
595
|
enum heif_filetype_result heif_check_filetype(const uint8_t* data, int len);
|
|
566
596
|
|
|
597
|
+
/**
|
|
598
|
+
* Check the filetype box content for a supported file type.
|
|
599
|
+
*
|
|
600
|
+
* <p>The data is assumed to start from the start of the `ftyp` box.
|
|
601
|
+
*
|
|
602
|
+
* <p>This function checks the compatible brands.
|
|
603
|
+
*
|
|
604
|
+
* @returns heif_error_ok if a supported brand is found, or other error if not.
|
|
605
|
+
*/
|
|
606
|
+
LIBHEIF_API
|
|
607
|
+
struct heif_error heif_has_compatible_filetype(const uint8_t* data, int len);
|
|
608
|
+
|
|
567
609
|
LIBHEIF_API
|
|
568
610
|
int heif_check_jpeg_filetype(const uint8_t* data, int len);
|
|
569
611
|
|
|
@@ -1368,6 +1410,44 @@ struct heif_error heif_image_get_nclx_color_profile(const struct heif_image* ima
|
|
|
1368
1410
|
struct heif_color_profile_nclx** out_data);
|
|
1369
1411
|
|
|
1370
1412
|
|
|
1413
|
+
// ------------------------- intrinsic and extrinsic matrices -------------------------
|
|
1414
|
+
|
|
1415
|
+
struct heif_camera_intrinsic_matrix
|
|
1416
|
+
{
|
|
1417
|
+
double focal_length_x;
|
|
1418
|
+
double focal_length_y;
|
|
1419
|
+
double principal_point_x;
|
|
1420
|
+
double principal_point_y;
|
|
1421
|
+
double skew;
|
|
1422
|
+
};
|
|
1423
|
+
|
|
1424
|
+
|
|
1425
|
+
LIBHEIF_API
|
|
1426
|
+
int heif_image_handle_has_camera_intrinsic_matrix(const struct heif_image_handle* handle);
|
|
1427
|
+
|
|
1428
|
+
LIBHEIF_API
|
|
1429
|
+
struct heif_error heif_image_handle_get_camera_intrinsic_matrix(const struct heif_image_handle* handle,
|
|
1430
|
+
struct heif_camera_intrinsic_matrix* out_matrix);
|
|
1431
|
+
|
|
1432
|
+
|
|
1433
|
+
struct heif_camera_extrinsic_matrix;
|
|
1434
|
+
|
|
1435
|
+
LIBHEIF_API
|
|
1436
|
+
int heif_image_handle_has_camera_extrinsic_matrix(const struct heif_image_handle* handle);
|
|
1437
|
+
|
|
1438
|
+
LIBHEIF_API
|
|
1439
|
+
struct heif_error heif_image_handle_get_camera_extrinsic_matrix(const struct heif_image_handle* handle,
|
|
1440
|
+
struct heif_camera_extrinsic_matrix** out_matrix);
|
|
1441
|
+
|
|
1442
|
+
LIBHEIF_API
|
|
1443
|
+
void heif_camera_extrinsic_matrix_release(struct heif_camera_extrinsic_matrix*);
|
|
1444
|
+
|
|
1445
|
+
LIBHEIF_API
|
|
1446
|
+
struct heif_error heif_camera_extrinsic_matrix_get_rotation_matrix(const struct heif_camera_extrinsic_matrix*,
|
|
1447
|
+
double* out_matrix_row_major);
|
|
1448
|
+
|
|
1449
|
+
|
|
1450
|
+
|
|
1371
1451
|
// ========================= heif_image =========================
|
|
1372
1452
|
|
|
1373
1453
|
// An heif_image contains a decoded pixel image in various colorspaces, chroma formats,
|
|
@@ -1711,6 +1791,10 @@ struct heif_error heif_context_write(struct heif_context*,
|
|
|
1711
1791
|
struct heif_writer* writer,
|
|
1712
1792
|
void* userdata);
|
|
1713
1793
|
|
|
1794
|
+
// Add a compatible brand that is now added automatically by libheif when encoding images (e.g. some application brands like 'geo1').
|
|
1795
|
+
LIBHEIF_API
|
|
1796
|
+
void heif_context_add_compatible_brand(struct heif_context* ctx,
|
|
1797
|
+
heif_brand2 compatible_brand);
|
|
1714
1798
|
|
|
1715
1799
|
// ----- encoder -----
|
|
1716
1800
|
|
|
@@ -2016,6 +2100,11 @@ struct heif_encoding_options
|
|
|
2016
2100
|
// version 6 options
|
|
2017
2101
|
|
|
2018
2102
|
struct heif_color_conversion_options color_conversion_options;
|
|
2103
|
+
|
|
2104
|
+
// version 7 options
|
|
2105
|
+
|
|
2106
|
+
// Set this to true to use compressed form of uncC where possible
|
|
2107
|
+
uint8_t prefer_uncC_short_form;
|
|
2019
2108
|
};
|
|
2020
2109
|
|
|
2021
2110
|
LIBHEIF_API
|
|
@@ -2037,6 +2126,27 @@ struct heif_error heif_context_encode_image(struct heif_context*,
|
|
|
2037
2126
|
const struct heif_encoding_options* options,
|
|
2038
2127
|
struct heif_image_handle** out_image_handle);
|
|
2039
2128
|
|
|
2129
|
+
/**
|
|
2130
|
+
* @brief Encodes an array of images into a grid.
|
|
2131
|
+
*
|
|
2132
|
+
* @param ctx The file context
|
|
2133
|
+
* @param tiles User allocated array of images that will form the grid.
|
|
2134
|
+
* @param rows The number of rows in the grid.
|
|
2135
|
+
* @param columns The number of columns in the grid.
|
|
2136
|
+
* @param encoder Defines the encoder to use. See heif_context_get_encoder_for_format()
|
|
2137
|
+
* @param input_options Optional, may be nullptr.
|
|
2138
|
+
* @param out_image_handle Returns a handle to the grid. The caller is responsible for freeing it.
|
|
2139
|
+
* @return Returns an error if ctx, tiles, or encoder is nullptr. If rows or columns is 0.
|
|
2140
|
+
*/
|
|
2141
|
+
LIBHEIF_API
|
|
2142
|
+
struct heif_error heif_context_encode_grid(struct heif_context* ctx,
|
|
2143
|
+
struct heif_image** tiles,
|
|
2144
|
+
uint16_t rows,
|
|
2145
|
+
uint16_t columns,
|
|
2146
|
+
struct heif_encoder* encoder,
|
|
2147
|
+
const struct heif_encoding_options* input_options,
|
|
2148
|
+
struct heif_image_handle** out_image_handle);
|
|
2149
|
+
|
|
2040
2150
|
LIBHEIF_API
|
|
2041
2151
|
struct heif_error heif_context_set_primary_image(struct heif_context*,
|
|
2042
2152
|
struct heif_image_handle* image_handle);
|
|
@@ -2059,9 +2169,12 @@ struct heif_error heif_context_encode_thumbnail(struct heif_context*,
|
|
|
2059
2169
|
|
|
2060
2170
|
enum heif_metadata_compression
|
|
2061
2171
|
{
|
|
2062
|
-
heif_metadata_compression_off,
|
|
2063
|
-
heif_metadata_compression_auto,
|
|
2064
|
-
|
|
2172
|
+
heif_metadata_compression_off = 0,
|
|
2173
|
+
heif_metadata_compression_auto = 1,
|
|
2174
|
+
heif_metadata_compression_unknown = 2, // only used when reading unknown method from input file
|
|
2175
|
+
heif_metadata_compression_deflate = 3,
|
|
2176
|
+
heif_metadata_compression_zlib = 4, // do not use for header data
|
|
2177
|
+
heif_metadata_compression_brotli = 5
|
|
2065
2178
|
};
|
|
2066
2179
|
|
|
2067
2180
|
// Assign 'thumbnail_image' as the thumbnail image of 'master_image'.
|
|
@@ -2099,22 +2212,64 @@ struct heif_error heif_context_add_generic_metadata(struct heif_context* ctx,
|
|
|
2099
2212
|
const void* data, int size,
|
|
2100
2213
|
const char* item_type, const char* content_type);
|
|
2101
2214
|
|
|
2215
|
+
// Add generic metadata with item_type "uri ". Items with this type do not have a content_type, but
|
|
2216
|
+
// an item_uri_type and they have no content_encoding (they are always stored uncompressed).
|
|
2217
|
+
LIBHEIF_API
|
|
2218
|
+
struct heif_error heif_context_add_generic_uri_metadata(struct heif_context* ctx,
|
|
2219
|
+
const struct heif_image_handle* image_handle,
|
|
2220
|
+
const void* data, int size,
|
|
2221
|
+
const char* item_uri_type,
|
|
2222
|
+
heif_item_id* out_item_id);
|
|
2223
|
+
|
|
2102
2224
|
// --- heif_image allocation
|
|
2103
2225
|
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2226
|
+
/**
|
|
2227
|
+
* Create a new image of the specified resolution and colorspace.
|
|
2228
|
+
*
|
|
2229
|
+
* <p>This does not allocate memory for the image data. Use {@link heif_image_add_plane} to
|
|
2230
|
+
* add the corresponding planes to match the specified {@code colorspace} and {@code chroma}.
|
|
2231
|
+
*
|
|
2232
|
+
* @param width the width of the image in pixels
|
|
2233
|
+
* @param height the height of the image in pixels
|
|
2234
|
+
* @param colorspace the colorspace of the image
|
|
2235
|
+
* @param chroma the chroma of the image
|
|
2236
|
+
* @param out_image pointer to pointer of the resulting image
|
|
2237
|
+
* @return whether the creation succeeded or there was an error
|
|
2238
|
+
*/
|
|
2107
2239
|
LIBHEIF_API
|
|
2108
2240
|
struct heif_error heif_image_create(int width, int height,
|
|
2109
2241
|
enum heif_colorspace colorspace,
|
|
2110
2242
|
enum heif_chroma chroma,
|
|
2111
2243
|
struct heif_image** out_image);
|
|
2112
2244
|
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2245
|
+
/**
|
|
2246
|
+
* Add an image plane to the image.
|
|
2247
|
+
*
|
|
2248
|
+
* <p>The image plane needs to match the colorspace and chroma of the image. Note
|
|
2249
|
+
* that this does not need to be a single "planar" format - interleaved pixel channels
|
|
2250
|
+
* can also be used if the chroma is interleaved.
|
|
2251
|
+
*
|
|
2252
|
+
* <p>The indicated bit_depth corresponds to the bit depth per channel. For example,
|
|
2253
|
+
* with an interleaved format like RRGGBB where each color is represented by 10 bits,
|
|
2254
|
+
* the {@code bit_depth} would be {@code 10} rather than {@code 30}.
|
|
2255
|
+
*
|
|
2256
|
+
* <p>For backward compatibility, one can also specify 24bits for RGB and 32bits for RGBA,
|
|
2257
|
+
* instead of the preferred 8 bits. However, this use is deprecated.
|
|
2258
|
+
*
|
|
2259
|
+
* @param image the parent image to add the channel plane to
|
|
2260
|
+
* @param channel the channel of the plane to add
|
|
2261
|
+
* @param width the width of the plane
|
|
2262
|
+
* @param height the height of the plane
|
|
2263
|
+
* @param bit_depth the bit depth per color channel
|
|
2264
|
+
* @return whether the addition succeeded or there was an error
|
|
2265
|
+
*
|
|
2266
|
+
* @note The width and height are usually the same as the parent image, but can be
|
|
2267
|
+
* less for subsampling.
|
|
2268
|
+
*
|
|
2269
|
+
* @note The specified width can differ from the row stride of the resulting image plane.
|
|
2270
|
+
* Always use the result of {@link heif_image_get_plane} or {@link heif_image_get_plane_readonly}
|
|
2271
|
+
* to determine row stride.
|
|
2272
|
+
*/
|
|
2118
2273
|
LIBHEIF_API
|
|
2119
2274
|
struct heif_error heif_image_add_plane(struct heif_image* image,
|
|
2120
2275
|
enum heif_channel channel,
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* HEIF codec.
|
|
3
|
+
* Copyright (c) 2023 Dirk Farin <dirk.farin@gmail.com>
|
|
4
|
+
*
|
|
5
|
+
* This file is part of libheif.
|
|
6
|
+
*
|
|
7
|
+
* libheif is free software: you can redistribute it and/or modify
|
|
8
|
+
* it under the terms of the GNU Lesser General Public License as
|
|
9
|
+
* published by the Free Software Foundation, either version 3 of
|
|
10
|
+
* the License, or (at your option) any later version.
|
|
11
|
+
*
|
|
12
|
+
* libheif is distributed in the hope that it will be useful,
|
|
13
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15
|
+
* GNU Lesser General Public License for more details.
|
|
16
|
+
*
|
|
17
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
18
|
+
* along with libheif. If not, see <http://www.gnu.org/licenses/>.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
#ifndef LIBHEIF_HEIF_ITEMS_H
|
|
22
|
+
#define LIBHEIF_HEIF_ITEMS_H
|
|
23
|
+
|
|
24
|
+
#include "libheif/heif.h"
|
|
25
|
+
|
|
26
|
+
#ifdef __cplusplus
|
|
27
|
+
extern "C" {
|
|
28
|
+
#endif
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Gets the number of items.
|
|
33
|
+
*
|
|
34
|
+
* This is not the same as the number of images, since there can be other types of items,
|
|
35
|
+
* such as metadata.
|
|
36
|
+
*
|
|
37
|
+
* @param ctx the file context
|
|
38
|
+
* @return the number of items
|
|
39
|
+
*/
|
|
40
|
+
LIBHEIF_API
|
|
41
|
+
int heif_context_get_number_of_items(const struct heif_context* ctx);
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Get the item identifiers.
|
|
45
|
+
*
|
|
46
|
+
* Fills in the item IDs into the user-supplied array {@code ID_array}, preallocated with {@code count} entries.
|
|
47
|
+
*
|
|
48
|
+
* @param ctx the file context
|
|
49
|
+
* @param ID_array the output array.
|
|
50
|
+
* @param count the number of items allocated within {@code ID_array}.
|
|
51
|
+
* @return the total number of IDs filled into the array, which may be less than {@code count}.
|
|
52
|
+
*/
|
|
53
|
+
LIBHEIF_API
|
|
54
|
+
int heif_context_get_list_of_item_IDs(const struct heif_context* ctx,
|
|
55
|
+
heif_item_id* ID_array,
|
|
56
|
+
int count);
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Gets the item type.
|
|
60
|
+
*
|
|
61
|
+
* Usually, this is a four character code (e.g. `mime` or `uri `), but it can theoretically be
|
|
62
|
+
* any 4-byte number. Thus, the type is returned as an integer. You can use {@link heif_fourcc} to map
|
|
63
|
+
* between the two representations.
|
|
64
|
+
*
|
|
65
|
+
* @param ctx the file context
|
|
66
|
+
* @param item_id the item identifier for the item
|
|
67
|
+
* @return the item type
|
|
68
|
+
*/
|
|
69
|
+
LIBHEIF_API
|
|
70
|
+
uint32_t heif_item_get_item_type(const struct heif_context* ctx, heif_item_id item_id);
|
|
71
|
+
|
|
72
|
+
#define heif_item_type_mime heif_fourcc('m','i','m','e')
|
|
73
|
+
#define heif_item_type_uri heif_fourcc('u','r','i',' ')
|
|
74
|
+
|
|
75
|
+
LIBHEIF_API
|
|
76
|
+
int heif_item_is_item_hidden(const struct heif_context* ctx, heif_item_id item_id);
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Gets the MIME content_type for an item.
|
|
81
|
+
*
|
|
82
|
+
* Only valid if the item type is `mime`.
|
|
83
|
+
* If the item does not exist, or if it is not a `mime` item, NULL is returned.
|
|
84
|
+
*
|
|
85
|
+
* @param ctx the file context
|
|
86
|
+
* @param item_id the item identifier for the item
|
|
87
|
+
* @return the item content_type
|
|
88
|
+
*/
|
|
89
|
+
LIBHEIF_API
|
|
90
|
+
const char* heif_item_get_mime_item_content_type(const struct heif_context* ctx, heif_item_id item_id);
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Gets the content_encoding for a MIME item.
|
|
94
|
+
*
|
|
95
|
+
* Only valid if the item type is `mime`.
|
|
96
|
+
* If the item does not exist, or if it is not a `mime` item, NULL is returned.
|
|
97
|
+
*
|
|
98
|
+
* If the item is not encoded, the returned value will be an empty string (not null).
|
|
99
|
+
*
|
|
100
|
+
* @param ctx the file context
|
|
101
|
+
* @param item_id the item identifier for the item
|
|
102
|
+
* @return the item content_type
|
|
103
|
+
*/
|
|
104
|
+
LIBHEIF_API
|
|
105
|
+
const char* heif_item_get_mime_item_content_encoding(const struct heif_context* ctx, heif_item_id item_id);
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Gets the item_uri_type for an item.
|
|
109
|
+
*
|
|
110
|
+
* Only valid if the item type is `uri `.
|
|
111
|
+
* If the item does not exist, or if it is not a `uri ` item, NULL is returned.
|
|
112
|
+
*
|
|
113
|
+
* @param ctx the file context
|
|
114
|
+
* @param item_id the item identifier for the item
|
|
115
|
+
* @return the item item_uri_type
|
|
116
|
+
*/
|
|
117
|
+
LIBHEIF_API
|
|
118
|
+
const char* heif_item_get_uri_item_uri_type(const struct heif_context* ctx, heif_item_id item_id);
|
|
119
|
+
|
|
120
|
+
LIBHEIF_API
|
|
121
|
+
const char* heif_item_get_item_name(const struct heif_context* ctx, heif_item_id item_id);
|
|
122
|
+
|
|
123
|
+
LIBHEIF_API
|
|
124
|
+
struct heif_error heif_item_set_item_name(struct heif_context* ctx,
|
|
125
|
+
heif_item_id item,
|
|
126
|
+
const char* item_name);
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Gets the raw metadata, as stored in the HEIF file.
|
|
131
|
+
*
|
|
132
|
+
* Data in a "mime" item with "content_encoding" can be compressed.
|
|
133
|
+
* When `out_compression_format` is NULL, the decompressed data will be returned.
|
|
134
|
+
* Otherwise, the compressed data is returned and `out_compression_format` will be filled with the
|
|
135
|
+
* compression format.
|
|
136
|
+
* If the compression method is not supported, an error will be returned.
|
|
137
|
+
*
|
|
138
|
+
* It is valid to set `out_data` to NULL. In that case, only the `out_data_size` is filled.
|
|
139
|
+
* Note that it is inefficient to use `out_data=NULL` just to get the size of compressed data.
|
|
140
|
+
* In general, this should be avoided.
|
|
141
|
+
*
|
|
142
|
+
* If there is no data assigned to the item or there is an error, `out_data_size` is set to zero.
|
|
143
|
+
*
|
|
144
|
+
* @param ctx the file context
|
|
145
|
+
* @param item_id the item identifier for the item
|
|
146
|
+
* @param out_compression_format how the data is compressed. If the pointer is NULL, the decompressed data will be returned.
|
|
147
|
+
* @param out_data the corresponding raw metadata
|
|
148
|
+
* @param out_data_size the size of the metadata in bytes
|
|
149
|
+
* @return whether the call succeeded, or there was an error
|
|
150
|
+
*/
|
|
151
|
+
LIBHEIF_API
|
|
152
|
+
struct heif_error heif_item_get_item_data(const struct heif_context* ctx,
|
|
153
|
+
heif_item_id item_id,
|
|
154
|
+
heif_metadata_compression* out_compression_format,
|
|
155
|
+
uint8_t** out_data, size_t* out_data_size);
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Free the item data.
|
|
159
|
+
*
|
|
160
|
+
* This is used to free memory associated with the data returned by
|
|
161
|
+
* {@link heif_item_get_item_data} in 'out_data' and set the pointer to NULL.
|
|
162
|
+
*
|
|
163
|
+
* @param ctx the file context
|
|
164
|
+
* @param item_data the data to free
|
|
165
|
+
*/
|
|
166
|
+
LIBHEIF_API
|
|
167
|
+
void heif_release_item_data(const struct heif_context* ctx, uint8_t** item_data);
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
// ------------------------- item references -------------------------
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Get the item ids that reference the given item.
|
|
174
|
+
*
|
|
175
|
+
* @param ctx the file context.
|
|
176
|
+
* @param from_item_id the item identifier for the item.
|
|
177
|
+
* @param index the index of the reference to get.
|
|
178
|
+
* @param out_reference_type_4cc The 4cc of the reference. (e.g dimg, thmb, cdsc, or auxl)
|
|
179
|
+
* @param out_references_to the item references. Use {@link heif_release_item_references} to free the memory.
|
|
180
|
+
* @return the number of items that reference the given item. Returns 0 if the index exceeds the number of references.
|
|
181
|
+
*/
|
|
182
|
+
LIBHEIF_API
|
|
183
|
+
size_t heif_context_get_item_references(const struct heif_context* ctx,
|
|
184
|
+
heif_item_id from_item_id,
|
|
185
|
+
int index,
|
|
186
|
+
uint32_t* out_reference_type_4cc,
|
|
187
|
+
heif_item_id** out_references_to);
|
|
188
|
+
|
|
189
|
+
LIBHEIF_API
|
|
190
|
+
void heif_release_item_references(const struct heif_context* ctx, heif_item_id** references);
|
|
191
|
+
|
|
192
|
+
LIBHEIF_API
|
|
193
|
+
struct heif_error heif_context_add_item_reference(struct heif_context* ctx,
|
|
194
|
+
uint32_t reference_type,
|
|
195
|
+
heif_item_id from_item,
|
|
196
|
+
heif_item_id to_item);
|
|
197
|
+
|
|
198
|
+
LIBHEIF_API
|
|
199
|
+
struct heif_error heif_context_add_item_references(struct heif_context* ctx,
|
|
200
|
+
uint32_t reference_type,
|
|
201
|
+
heif_item_id from_item,
|
|
202
|
+
const heif_item_id* to_item,
|
|
203
|
+
int num_to_items);
|
|
204
|
+
|
|
205
|
+
// ------------------------- adding new items -------------------------
|
|
206
|
+
|
|
207
|
+
LIBHEIF_API
|
|
208
|
+
struct heif_error heif_context_add_item(struct heif_context* ctx,
|
|
209
|
+
const char* item_type,
|
|
210
|
+
const void* data, int size,
|
|
211
|
+
heif_item_id* out_item_id);
|
|
212
|
+
|
|
213
|
+
LIBHEIF_API
|
|
214
|
+
struct heif_error heif_context_add_mime_item(struct heif_context* ctx,
|
|
215
|
+
const char* content_type,
|
|
216
|
+
heif_metadata_compression content_encoding,
|
|
217
|
+
const void* data, int size,
|
|
218
|
+
heif_item_id* out_item_id);
|
|
219
|
+
|
|
220
|
+
LIBHEIF_API
|
|
221
|
+
struct heif_error heif_context_add_precompressed_mime_item(struct heif_context* ctx,
|
|
222
|
+
const char* content_type,
|
|
223
|
+
const char* content_encoding,
|
|
224
|
+
const void* data, int size,
|
|
225
|
+
heif_item_id* out_item_id);
|
|
226
|
+
|
|
227
|
+
LIBHEIF_API
|
|
228
|
+
struct heif_error heif_context_add_uri_item(struct heif_context* ctx,
|
|
229
|
+
const char* item_uri_type,
|
|
230
|
+
const void* data, int size,
|
|
231
|
+
heif_item_id* out_item_id);
|
|
232
|
+
|
|
233
|
+
#ifdef __cplusplus
|
|
234
|
+
}
|
|
235
|
+
#endif
|
|
236
|
+
|
|
237
|
+
#endif
|