@img/sharp-libvips-dev-wasm32 1.3.0-rc.3 → 1.3.0-rc.5
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/include/expat.h +1 -1
- package/include/expat_config.h +3 -3
- package/include/expat_external.h +1 -1
- package/include/glib-2.0/glib/gslice.h +12 -4
- package/include/libheif/heif_aux_images.h +2 -2
- package/include/libheif/heif_brands.h +13 -4
- package/include/libheif/heif_color.h +14 -14
- package/include/libheif/heif_context.h +17 -4
- package/include/libheif/heif_decoding.h +2 -2
- package/include/libheif/heif_encoding.h +29 -5
- package/include/libheif/heif_error.h +4 -4
- package/include/libheif/heif_image.h +52 -8
- package/include/libheif/heif_image_handle.h +42 -0
- package/include/libheif/heif_library.h +2 -2
- package/include/libheif/heif_metadata.h +2 -2
- package/include/libheif/heif_plugin.h +4 -4
- package/include/libheif/heif_properties.h +16 -4
- package/include/libheif/heif_regions.h +2 -2
- package/include/libheif/heif_security.h +5 -0
- package/include/libheif/heif_sequences.h +10 -10
- package/include/libheif/heif_uncompressed.h +327 -23
- package/include/libheif/heif_uncompressed_types.h +143 -0
- package/include/libpng16/png.h +8 -8
- package/include/libpng16/pngconf.h +1 -1
- package/include/libpng16/pnglibconf.h +1 -1
- package/include/png.h +8 -8
- package/include/pngconf.h +1 -1
- package/include/pnglibconf.h +1 -1
- package/include/vips/version.h +4 -4
- package/lib/glib-2.0/include/glibconfig.h +2 -2
- package/lib/libaom.a +0 -0
- package/lib/libcgif.a +0 -0
- package/lib/libexif.a +0 -0
- package/lib/libexpat.a +0 -0
- package/lib/libexpat.la +1 -1
- package/lib/libffi.a +0 -0
- package/lib/libgio-2.0.a +0 -0
- package/lib/libglib-2.0.a +0 -0
- package/lib/libgmodule-2.0.a +0 -0
- package/lib/libgobject-2.0.a +0 -0
- package/lib/libgthread-2.0.a +0 -0
- package/lib/libheif.a +0 -0
- package/lib/libhwy.a +0 -0
- package/lib/libimagequant.a +0 -0
- package/lib/libjpeg.a +0 -0
- package/lib/liblcms2.a +0 -0
- package/lib/libpng.a +0 -0
- package/lib/libpng.la +2 -2
- package/lib/libpng16.a +0 -0
- package/lib/libpng16.la +2 -2
- package/lib/libresvg.a +0 -0
- package/lib/libsharpyuv.a +0 -0
- package/lib/libtiff.a +0 -0
- package/lib/libuhdr.a +0 -0
- package/lib/libvips-cpp.a +0 -0
- package/lib/libvips.a +0 -0
- package/lib/libwebp.a +0 -0
- package/lib/libwebpdemux.a +0 -0
- package/lib/libwebpmux.a +0 -0
- package/lib/libz.a +0 -0
- package/lib/pkgconfig/aom.pc +2 -2
- package/lib/pkgconfig/cgif.pc +1 -1
- package/lib/pkgconfig/expat.pc +1 -1
- package/lib/pkgconfig/gio-2.0.pc +1 -1
- package/lib/pkgconfig/glib-2.0.pc +1 -1
- package/lib/pkgconfig/gmodule-2.0.pc +1 -1
- package/lib/pkgconfig/gmodule-export-2.0.pc +1 -1
- package/lib/pkgconfig/gmodule-no-export-2.0.pc +1 -1
- package/lib/pkgconfig/gobject-2.0.pc +1 -1
- package/lib/pkgconfig/gthread-2.0.pc +1 -1
- package/lib/pkgconfig/libheif.pc +1 -1
- package/lib/pkgconfig/libpng.pc +1 -1
- package/lib/pkgconfig/libpng16.pc +1 -1
- package/lib/pkgconfig/vips-cpp.pc +1 -1
- package/lib/pkgconfig/vips.pc +1 -1
- package/package.json +1 -1
- package/versions.json +8 -8
|
@@ -29,7 +29,7 @@ extern "C" {
|
|
|
29
29
|
|
|
30
30
|
// ------------------------- item properties -------------------------
|
|
31
31
|
|
|
32
|
-
enum heif_item_property_type
|
|
32
|
+
typedef enum heif_item_property_type
|
|
33
33
|
{
|
|
34
34
|
// heif_item_property_unknown = -1,
|
|
35
35
|
heif_item_property_type_invalid = 0,
|
|
@@ -42,7 +42,7 @@ enum heif_item_property_type
|
|
|
42
42
|
heif_item_property_type_tai_clock_info = heif_fourcc('t', 'a', 'i', 'c'),
|
|
43
43
|
heif_item_property_type_tai_timestamp = heif_fourcc('i', 't', 'a', 'i'),
|
|
44
44
|
heif_item_property_type_extended_language = heif_fourcc('e', 'l', 'n', 'g')
|
|
45
|
-
};
|
|
45
|
+
} heif_item_property_type;
|
|
46
46
|
|
|
47
47
|
// Get the heif_property_id for a heif_item_id.
|
|
48
48
|
// You may specify which property 'type' you want to receive.
|
|
@@ -105,12 +105,12 @@ heif_error heif_item_add_property_user_description(const heif_context* context,
|
|
|
105
105
|
LIBHEIF_API
|
|
106
106
|
void heif_property_user_description_release(heif_property_user_description*);
|
|
107
107
|
|
|
108
|
-
enum heif_transform_mirror_direction
|
|
108
|
+
typedef enum heif_transform_mirror_direction
|
|
109
109
|
{
|
|
110
110
|
heif_transform_mirror_direction_invalid = -1,
|
|
111
111
|
heif_transform_mirror_direction_vertical = 0, // flip image vertically
|
|
112
112
|
heif_transform_mirror_direction_horizontal = 1 // flip image horizontally
|
|
113
|
-
};
|
|
113
|
+
} heif_transform_mirror_direction;
|
|
114
114
|
|
|
115
115
|
// Will return 'heif_transform_mirror_direction_invalid' in case of error.
|
|
116
116
|
// If 'propertyId==0', it returns the first imir property found.
|
|
@@ -228,6 +228,18 @@ LIBHEIF_API
|
|
|
228
228
|
heif_error heif_camera_extrinsic_matrix_get_rotation_matrix(const heif_camera_extrinsic_matrix*,
|
|
229
229
|
double* out_matrix_row_major);
|
|
230
230
|
|
|
231
|
+
#if HEIF_WITH_OMAF
|
|
232
|
+
// ------------------------- OMAF projection information -------------------------
|
|
233
|
+
LIBHEIF_API
|
|
234
|
+
int heif_image_handle_has_omaf_image_projection(const heif_image_handle* handle);
|
|
235
|
+
|
|
236
|
+
LIBHEIF_API
|
|
237
|
+
heif_omaf_image_projection heif_image_handle_get_omaf_image_projection(const heif_image_handle* handle);
|
|
238
|
+
|
|
239
|
+
LIBHEIF_API
|
|
240
|
+
void heif_image_handle_set_omaf_image_projection(const heif_image_handle* handle, heif_omaf_image_projection image_projection);
|
|
241
|
+
#endif
|
|
242
|
+
|
|
231
243
|
#ifdef __cplusplus
|
|
232
244
|
}
|
|
233
245
|
#endif
|
|
@@ -42,7 +42,7 @@ typedef struct heif_region_item heif_region_item;
|
|
|
42
42
|
* Each region item will contain zero or more regions, which may have different geometry or
|
|
43
43
|
* mask representations.
|
|
44
44
|
*/
|
|
45
|
-
enum heif_region_type
|
|
45
|
+
typedef enum heif_region_type
|
|
46
46
|
{
|
|
47
47
|
/**
|
|
48
48
|
* Point geometry.
|
|
@@ -121,7 +121,7 @@ enum heif_region_type
|
|
|
121
121
|
* considered to form a closed surface. Only the edge is part of the region.
|
|
122
122
|
*/
|
|
123
123
|
heif_region_type_polyline = 6
|
|
124
|
-
};
|
|
124
|
+
} heif_region_type;
|
|
125
125
|
|
|
126
126
|
typedef struct heif_region heif_region;
|
|
127
127
|
|
|
@@ -45,6 +45,7 @@ typedef struct heif_security_limits
|
|
|
45
45
|
// in 1.5 GB memory need for YUV-4:2:0 or 4 GB for RGB32.
|
|
46
46
|
uint64_t max_image_size_pixels;
|
|
47
47
|
uint64_t max_number_of_tiles;
|
|
48
|
+
// Also used for polarization pattern (splz) size limit.
|
|
48
49
|
uint32_t max_bayer_pattern_pixels;
|
|
49
50
|
uint32_t max_items;
|
|
50
51
|
|
|
@@ -68,6 +69,10 @@ typedef struct heif_security_limits
|
|
|
68
69
|
|
|
69
70
|
uint32_t max_sequence_frames;
|
|
70
71
|
uint32_t max_number_of_file_brands;
|
|
72
|
+
|
|
73
|
+
// --- version 4
|
|
74
|
+
|
|
75
|
+
uint32_t max_bad_pixels;
|
|
71
76
|
} heif_security_limits;
|
|
72
77
|
|
|
73
78
|
|
|
@@ -111,13 +111,13 @@ heif_track* heif_context_get_track(const heif_context*, uint32_t id);
|
|
|
111
111
|
|
|
112
112
|
typedef uint32_t heif_track_type;
|
|
113
113
|
|
|
114
|
-
enum heif_track_type_4cc
|
|
114
|
+
typedef enum heif_track_type_4cc
|
|
115
115
|
{
|
|
116
116
|
heif_track_type_video = heif_fourcc('v', 'i', 'd', 'e'),
|
|
117
117
|
heif_track_type_image_sequence = heif_fourcc('p', 'i', 'c', 't'),
|
|
118
118
|
heif_track_type_auxiliary = heif_fourcc('a', 'u', 'x', 'v'),
|
|
119
119
|
heif_track_type_metadata = heif_fourcc('m', 'e', 't', 'a')
|
|
120
|
-
};
|
|
120
|
+
} heif_track_type_4cc;
|
|
121
121
|
|
|
122
122
|
/**
|
|
123
123
|
* Get the four-cc track handler type.
|
|
@@ -130,11 +130,11 @@ LIBHEIF_API
|
|
|
130
130
|
heif_track_type heif_track_get_track_handler_type(const heif_track*);
|
|
131
131
|
|
|
132
132
|
|
|
133
|
-
enum heif_auxiliary_track_info_type
|
|
133
|
+
typedef enum heif_auxiliary_track_info_type
|
|
134
134
|
{
|
|
135
135
|
heif_auxiliary_track_info_type_unknown = 0,
|
|
136
136
|
heif_auxiliary_track_info_type_alpha = 1
|
|
137
|
-
};
|
|
137
|
+
} heif_auxiliary_track_info_type;
|
|
138
138
|
|
|
139
139
|
LIBHEIF_API
|
|
140
140
|
enum heif_auxiliary_track_info_type heif_track_get_auxiliary_info_type(const heif_track*);
|
|
@@ -275,12 +275,12 @@ void heif_context_set_number_of_sequence_repetitions(heif_context*, uint32_t num
|
|
|
275
275
|
* The difference between `heif_sample_aux_info_presence_optional` and `heif_sample_aux_info_presence_mandatory`
|
|
276
276
|
* is that `heif_sample_aux_info_presence_mandatory` will throw an error if the data is missing when writing a sample.
|
|
277
277
|
*/
|
|
278
|
-
enum heif_sample_aux_info_presence
|
|
278
|
+
typedef enum heif_sample_aux_info_presence
|
|
279
279
|
{
|
|
280
280
|
heif_sample_aux_info_presence_none = 0,
|
|
281
281
|
heif_sample_aux_info_presence_optional = 1,
|
|
282
282
|
heif_sample_aux_info_presence_mandatory = 2
|
|
283
|
-
};
|
|
283
|
+
} heif_sample_aux_info_presence;
|
|
284
284
|
|
|
285
285
|
|
|
286
286
|
typedef struct heif_track_options heif_track_options;
|
|
@@ -338,7 +338,7 @@ void heif_track_options_set_gimi_track_id(heif_track_options*,
|
|
|
338
338
|
|
|
339
339
|
// --- writing visual tracks
|
|
340
340
|
|
|
341
|
-
enum heif_sequence_gop_structure
|
|
341
|
+
typedef enum heif_sequence_gop_structure
|
|
342
342
|
{
|
|
343
343
|
// Only independently decodable keyframes.
|
|
344
344
|
heif_sequence_gop_structure_intra_only,
|
|
@@ -349,7 +349,7 @@ enum heif_sequence_gop_structure
|
|
|
349
349
|
// All frame types are allowed, including frame reordering, to achieve
|
|
350
350
|
// the best compression ratio.
|
|
351
351
|
heif_sequence_gop_structure_unrestricted
|
|
352
|
-
};
|
|
352
|
+
} heif_sequence_gop_structure;
|
|
353
353
|
|
|
354
354
|
|
|
355
355
|
typedef struct heif_sequence_encoding_options
|
|
@@ -588,12 +588,12 @@ const heif_tai_clock_info* heif_track_get_tai_clock_info_of_first_cluster(heif_t
|
|
|
588
588
|
|
|
589
589
|
// --- track references
|
|
590
590
|
|
|
591
|
-
enum heif_track_reference_type
|
|
591
|
+
typedef enum heif_track_reference_type
|
|
592
592
|
{
|
|
593
593
|
heif_track_reference_type_description = heif_fourcc('c', 'd', 's', 'c'), // track_description
|
|
594
594
|
heif_track_reference_type_thumbnails = heif_fourcc('t', 'h', 'm', 'b'), // thumbnails
|
|
595
595
|
heif_track_reference_type_auxiliary = heif_fourcc('a', 'u', 'x', 'l') // auxiliary data (e.g. depth maps or alpha channel)
|
|
596
|
-
};
|
|
596
|
+
} heif_track_reference_type;
|
|
597
597
|
|
|
598
598
|
/**
|
|
599
599
|
* Add a reference between tracks.
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
#ifndef LIBHEIF_HEIF_UNCOMPRESSED_H
|
|
22
22
|
#define LIBHEIF_HEIF_UNCOMPRESSED_H
|
|
23
23
|
|
|
24
|
+
#include "libheif/heif_uncompressed_types.h"
|
|
24
25
|
#include "libheif/heif.h"
|
|
25
26
|
|
|
26
27
|
#ifdef __cplusplus
|
|
@@ -34,37 +35,217 @@ extern "C" {
|
|
|
34
35
|
* See heif_metadata_compression for more information.
|
|
35
36
|
*/
|
|
36
37
|
|
|
37
|
-
//
|
|
38
|
+
// heif_uncompressed_component_type and heif_bayer_pattern_pixel are defined in heif_uncompressed_types.h.
|
|
39
|
+
|
|
40
|
+
// Set a Bayer / filter array pattern on an image.
|
|
41
|
+
// The pattern is a 2D array of component indices with dimensions pattern_width x pattern_height.
|
|
42
|
+
// The number of entries in patternPixels must be pattern_width * pattern_height.
|
|
43
|
+
// The component_index values are indices into the cmpd component definition table.
|
|
44
|
+
// On the encoder path, these indices are generated by heif_image_add_component() and the
|
|
45
|
+
// encoder adds reference components to cmpd for pattern entries that don't have image planes.
|
|
46
|
+
// On the decoder path, they come directly from the cpat box.
|
|
47
|
+
LIBHEIF_API
|
|
48
|
+
heif_error heif_image_set_bayer_pattern(heif_image*,
|
|
49
|
+
uint32_t bayer_component_id,
|
|
50
|
+
uint16_t pattern_width,
|
|
51
|
+
uint16_t pattern_height,
|
|
52
|
+
const heif_bayer_pattern_pixel* patternPixels);
|
|
53
|
+
|
|
54
|
+
LIBHEIF_API
|
|
55
|
+
heif_error heif_image_add_bayer_component(heif_image*,
|
|
56
|
+
uint16_t component_type,
|
|
57
|
+
uint32_t* out_component_id);
|
|
58
|
+
|
|
59
|
+
// Returns whether the image has a Bayer / filter array pattern.
|
|
60
|
+
// If the image has a pattern, out_pattern_width and out_pattern_height are set.
|
|
61
|
+
// Either output pointer may be NULL if the caller does not need that value.
|
|
62
|
+
LIBHEIF_API
|
|
63
|
+
int heif_image_get_bayer_pattern_size(const heif_image*,
|
|
64
|
+
uint32_t bayer_component_id,
|
|
65
|
+
uint16_t* out_pattern_width,
|
|
66
|
+
uint16_t* out_pattern_height);
|
|
67
|
+
|
|
68
|
+
// Get the Bayer / filter array pattern pixels.
|
|
69
|
+
// The caller must provide an array large enough for pattern_width * pattern_height entries
|
|
70
|
+
// (use heif_image_get_bayer_pattern_size() to query the dimensions first).
|
|
71
|
+
// Returns heif_error_Ok on success, or an error if no pattern is set.
|
|
72
|
+
LIBHEIF_API
|
|
73
|
+
heif_error heif_image_get_bayer_pattern(const heif_image*,
|
|
74
|
+
uint32_t bayer_component_id,
|
|
75
|
+
heif_bayer_pattern_pixel* out_patternPixels);
|
|
38
76
|
|
|
39
|
-
//
|
|
40
|
-
// contain the allowed values.
|
|
41
|
-
enum heif_unci_compression
|
|
42
|
-
{
|
|
43
|
-
heif_unci_compression_off = 0,
|
|
44
|
-
//heif_unci_compression_auto = 1,
|
|
45
|
-
//heif_unci_compression_unknown = 2, // only used when reading unknown method from input file
|
|
46
|
-
heif_unci_compression_deflate = 3,
|
|
47
|
-
heif_unci_compression_zlib = 4,
|
|
48
|
-
heif_unci_compression_brotli = 5
|
|
49
|
-
};
|
|
77
|
+
// --- Polarization pattern (ISO 23001-17, Section 6.1.5)
|
|
50
78
|
|
|
79
|
+
// Special float value indicating "no polarization filter" at a pattern position.
|
|
80
|
+
// On the wire this is the IEEE 754 bit pattern 0xFFFFFFFF (a signaling NaN).
|
|
81
|
+
// Test with heif_polarization_angle_is_no_filter() below, or with isnan()/std::isnan().
|
|
51
82
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
83
|
+
// Returns a float with the 0xFFFFFFFF bit pattern (NaN) representing "no polarization filter".
|
|
84
|
+
LIBHEIF_API
|
|
85
|
+
float heif_polarization_angle_no_filter(void);
|
|
55
86
|
|
|
56
|
-
|
|
87
|
+
// Returns non-zero if the given angle has the "no filter" bit pattern (0xFFFFFFFF).
|
|
88
|
+
LIBHEIF_API
|
|
89
|
+
int heif_polarization_angle_is_no_filter(float angle);
|
|
57
90
|
|
|
58
|
-
|
|
59
|
-
|
|
91
|
+
// Add a polarization pattern to an image.
|
|
92
|
+
// component_indices: array of component indices this pattern applies to (may be NULL if num_component_indices == 0,
|
|
93
|
+
// meaning the pattern applies to all components).
|
|
94
|
+
// polarization_angles: array of pattern_width * pattern_height float values.
|
|
95
|
+
// Each is an angle in degrees [0.0, 360.0), or heif_polarization_angle_no_filter() for "no filter".
|
|
96
|
+
// Multiple patterns can be added (one per distinct component group).
|
|
97
|
+
LIBHEIF_API
|
|
98
|
+
heif_error heif_image_add_polarization_pattern(heif_image*,
|
|
99
|
+
uint32_t num_component_indices,
|
|
100
|
+
const uint32_t* component_indices,
|
|
101
|
+
uint16_t pattern_width,
|
|
102
|
+
uint16_t pattern_height,
|
|
103
|
+
const float* polarization_angles);
|
|
60
104
|
|
|
61
|
-
|
|
62
|
-
|
|
105
|
+
// Returns the number of polarization patterns on this image (0 if none).
|
|
106
|
+
LIBHEIF_API
|
|
107
|
+
int heif_image_get_number_of_polarization_patterns(const heif_image*);
|
|
63
108
|
|
|
64
|
-
|
|
109
|
+
// Get the sizes/dimensions of a polarization pattern (to allocate arrays for the data query).
|
|
110
|
+
LIBHEIF_API
|
|
111
|
+
heif_error heif_image_get_polarization_pattern_info(const heif_image*,
|
|
112
|
+
int pattern_index,
|
|
113
|
+
uint32_t* out_num_component_indices,
|
|
114
|
+
uint16_t* out_pattern_width,
|
|
115
|
+
uint16_t* out_pattern_height);
|
|
65
116
|
|
|
66
|
-
|
|
67
|
-
|
|
117
|
+
// Get the actual data of a polarization pattern.
|
|
118
|
+
// Caller must provide pre-allocated arrays:
|
|
119
|
+
// out_component_indices: num_component_indices entries (may be NULL if num_component_indices == 0)
|
|
120
|
+
// out_polarization_angles: pattern_width * pattern_height entries
|
|
121
|
+
LIBHEIF_API
|
|
122
|
+
heif_error heif_image_get_polarization_pattern_data(const heif_image*,
|
|
123
|
+
int pattern_index,
|
|
124
|
+
uint32_t* out_component_indices,
|
|
125
|
+
float* out_polarization_angles);
|
|
126
|
+
|
|
127
|
+
// Find the polarization pattern index that applies to a given component index.
|
|
128
|
+
// Returns the pattern index (>= 0), or -1 if no pattern matches.
|
|
129
|
+
// A pattern with an empty component list (component_count == 0) matches all components.
|
|
130
|
+
LIBHEIF_API
|
|
131
|
+
int heif_image_get_polarization_pattern_index_for_component(const heif_image*,
|
|
132
|
+
uint32_t component_index);
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
// --- Sensor bad pixels map (ISO 23001-17, Section 6.1.7)
|
|
136
|
+
|
|
137
|
+
// struct heif_bad_pixel is defined in heif_uncompressed_types.h.
|
|
138
|
+
|
|
139
|
+
// Add a sensor bad pixels map to an image.
|
|
140
|
+
// component_indices: array of component indices this map applies to (may be NULL if num_component_indices == 0,
|
|
141
|
+
// meaning the map applies to all components).
|
|
142
|
+
// Multiple maps can be added (one per distinct component group with different defects).
|
|
143
|
+
LIBHEIF_API
|
|
144
|
+
heif_error heif_image_add_sensor_bad_pixels_map(heif_image*,
|
|
145
|
+
uint32_t num_component_indices,
|
|
146
|
+
const uint32_t* component_indices,
|
|
147
|
+
int correction_applied,
|
|
148
|
+
uint32_t num_bad_rows,
|
|
149
|
+
const uint32_t* bad_rows,
|
|
150
|
+
uint32_t num_bad_columns,
|
|
151
|
+
const uint32_t* bad_columns,
|
|
152
|
+
uint32_t num_bad_pixels,
|
|
153
|
+
const heif_bad_pixel* bad_pixels);
|
|
154
|
+
|
|
155
|
+
// Returns the number of sensor bad pixels maps on this image (0 if none).
|
|
156
|
+
LIBHEIF_API
|
|
157
|
+
int heif_image_get_number_of_sensor_bad_pixels_maps(const heif_image*);
|
|
158
|
+
|
|
159
|
+
// Get the sizes of a sensor bad pixels map (to allocate arrays for the data query).
|
|
160
|
+
LIBHEIF_API
|
|
161
|
+
heif_error heif_image_get_sensor_bad_pixels_map_info(const heif_image*,
|
|
162
|
+
int map_index,
|
|
163
|
+
uint32_t* out_num_component_indices,
|
|
164
|
+
int* out_correction_applied,
|
|
165
|
+
uint32_t* out_num_bad_rows,
|
|
166
|
+
uint32_t* out_num_bad_columns,
|
|
167
|
+
uint32_t* out_num_bad_pixels);
|
|
168
|
+
|
|
169
|
+
// Get the actual data of a sensor bad pixels map.
|
|
170
|
+
// Caller must provide pre-allocated arrays:
|
|
171
|
+
// out_component_indices: num_component_indices entries (may be NULL if num_component_indices == 0)
|
|
172
|
+
// out_bad_rows: num_bad_rows entries (may be NULL if num_bad_rows == 0)
|
|
173
|
+
// out_bad_columns: num_bad_columns entries (may be NULL if num_bad_columns == 0)
|
|
174
|
+
// out_bad_pixels: num_bad_pixels entries (may be NULL if num_bad_pixels == 0)
|
|
175
|
+
LIBHEIF_API
|
|
176
|
+
heif_error heif_image_get_sensor_bad_pixels_map_data(const heif_image*,
|
|
177
|
+
int map_index,
|
|
178
|
+
uint32_t* out_component_indices,
|
|
179
|
+
uint32_t* out_bad_rows,
|
|
180
|
+
uint32_t* out_bad_columns,
|
|
181
|
+
struct heif_bad_pixel* out_bad_pixels);
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
// --- Sensor non-uniformity correction (ISO 23001-17, Section 6.1.6)
|
|
185
|
+
|
|
186
|
+
// Add a sensor non-uniformity correction table to an image.
|
|
187
|
+
// component_indices: array of component indices this NUC applies to (may be NULL if num_component_indices == 0,
|
|
188
|
+
// meaning it applies to all components).
|
|
189
|
+
// nuc_gains and nuc_offsets: arrays of image_width * image_height float values.
|
|
190
|
+
// Correction equation: y = nuc_gain * x + nuc_offset.
|
|
191
|
+
// Multiple NUC tables can be added (one per distinct component group).
|
|
192
|
+
LIBHEIF_API
|
|
193
|
+
heif_error heif_image_add_sensor_nuc(heif_image*,
|
|
194
|
+
uint32_t num_component_indices,
|
|
195
|
+
const uint32_t* component_indices,
|
|
196
|
+
int nuc_is_applied,
|
|
197
|
+
uint32_t image_width,
|
|
198
|
+
uint32_t image_height,
|
|
199
|
+
const float* nuc_gains,
|
|
200
|
+
const float* nuc_offsets);
|
|
201
|
+
|
|
202
|
+
// Returns the number of sensor NUC tables on this image (0 if none).
|
|
203
|
+
LIBHEIF_API
|
|
204
|
+
int heif_image_get_number_of_sensor_nucs(const heif_image*);
|
|
205
|
+
|
|
206
|
+
// Get the sizes of a sensor NUC table (to allocate arrays for the data query).
|
|
207
|
+
LIBHEIF_API
|
|
208
|
+
heif_error heif_image_get_sensor_nuc_info(const heif_image*,
|
|
209
|
+
int nuc_index,
|
|
210
|
+
uint32_t* out_num_component_indices,
|
|
211
|
+
int* out_nuc_is_applied,
|
|
212
|
+
uint32_t* out_image_width,
|
|
213
|
+
uint32_t* out_image_height);
|
|
214
|
+
|
|
215
|
+
// Get the actual data of a sensor NUC table.
|
|
216
|
+
// Caller must provide pre-allocated arrays:
|
|
217
|
+
// out_component_indices: num_component_indices entries (may be NULL if num_component_indices == 0)
|
|
218
|
+
// out_nuc_gains: image_width * image_height entries
|
|
219
|
+
// out_nuc_offsets: image_width * image_height entries
|
|
220
|
+
LIBHEIF_API
|
|
221
|
+
heif_error heif_image_get_sensor_nuc_data(const heif_image*,
|
|
222
|
+
int nuc_index,
|
|
223
|
+
uint32_t* out_component_indices,
|
|
224
|
+
float* out_nuc_gains,
|
|
225
|
+
float* out_nuc_offsets);
|
|
226
|
+
|
|
227
|
+
|
|
228
|
+
// heif_chroma420_sample_location is defined in heif_uncompressed_types.h.
|
|
229
|
+
|
|
230
|
+
// --- Chroma sample location (ISO 23001-17, Section 6.1.4)
|
|
231
|
+
|
|
232
|
+
// Set the chroma sample location on an image.
|
|
233
|
+
// chroma_location must be in the range 0-6 (see heif_chroma420_sample_location).
|
|
234
|
+
LIBHEIF_API
|
|
235
|
+
heif_error heif_image_set_chroma_location(heif_image*, uint8_t chroma_location);
|
|
236
|
+
|
|
237
|
+
// Returns non-zero if the image has a chroma sample location set.
|
|
238
|
+
LIBHEIF_API
|
|
239
|
+
int heif_image_has_chroma_location(const heif_image*);
|
|
240
|
+
|
|
241
|
+
// Returns the chroma sample location (0-6), or 0 if none is set.
|
|
242
|
+
LIBHEIF_API
|
|
243
|
+
uint8_t heif_image_get_chroma_location(const heif_image*);
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
// --- 'unci' images
|
|
247
|
+
|
|
248
|
+
// heif_unci_compression and heif_unci_image_parameters are defined in heif_uncompressed_types.h.
|
|
68
249
|
|
|
69
250
|
LIBHEIF_API
|
|
70
251
|
heif_unci_image_parameters* heif_unci_image_parameters_alloc(void);
|
|
@@ -102,6 +283,129 @@ heif_error heif_context_add_empty_unci_image(heif_context* ctx,
|
|
|
102
283
|
const heif_image* prototype,
|
|
103
284
|
heif_image_handle** out_unci_image_handle);
|
|
104
285
|
|
|
286
|
+
// heif_channel_datatype, heif_complex32, heif_complex64 are defined in heif_uncompressed_types.h.
|
|
287
|
+
|
|
288
|
+
// --- index-based component access (for ISO 23001-17 multi-component images)
|
|
289
|
+
|
|
290
|
+
// Returns the number of components that have pixel data (planes) in this image.
|
|
291
|
+
LIBHEIF_API
|
|
292
|
+
uint32_t heif_image_get_number_of_used_components(const heif_image*);
|
|
293
|
+
|
|
294
|
+
// Fills `out_component_indices` with the valid component indices.
|
|
295
|
+
// The caller must allocate an array of at least heif_image_get_number_of_used_components() elements.
|
|
296
|
+
LIBHEIF_API
|
|
297
|
+
void heif_image_get_used_component_ids(const heif_image*, uint32_t* out_component_ids);
|
|
298
|
+
|
|
299
|
+
LIBHEIF_API
|
|
300
|
+
enum heif_channel heif_image_get_component_channel(const heif_image*, uint32_t component_idx);
|
|
301
|
+
|
|
302
|
+
LIBHEIF_API
|
|
303
|
+
uint32_t heif_image_get_component_width(const heif_image*, uint32_t component_idx);
|
|
304
|
+
|
|
305
|
+
LIBHEIF_API
|
|
306
|
+
uint32_t heif_image_get_component_height(const heif_image*, uint32_t component_idx);
|
|
307
|
+
|
|
308
|
+
LIBHEIF_API
|
|
309
|
+
int heif_image_get_component_bits_per_pixel(const heif_image*, uint32_t component_idx);
|
|
310
|
+
|
|
311
|
+
LIBHEIF_API
|
|
312
|
+
uint16_t heif_image_get_component_type(const heif_image*, uint32_t component_idx);
|
|
313
|
+
|
|
314
|
+
// TODO
|
|
315
|
+
//LIBHEIF_API
|
|
316
|
+
//heif_error heif_image_get_component_indices_of_interleaved_channel(const heif_image* image, uint32_t* component_indices, uint8_t* nComponents_in_out);
|
|
317
|
+
|
|
318
|
+
LIBHEIF_API
|
|
319
|
+
heif_error heif_image_add_component(heif_image* image,
|
|
320
|
+
int width, int height,
|
|
321
|
+
uint16_t component_type,
|
|
322
|
+
heif_component_datatype datatype,
|
|
323
|
+
int bit_depth,
|
|
324
|
+
uint32_t* out_component_idx);
|
|
325
|
+
|
|
326
|
+
LIBHEIF_API
|
|
327
|
+
const uint8_t* heif_image_get_component_readonly(const heif_image*, uint32_t component_idx, size_t* out_stride);
|
|
328
|
+
|
|
329
|
+
LIBHEIF_API
|
|
330
|
+
uint8_t* heif_image_get_component(heif_image*, uint32_t component_idx, size_t* out_stride);
|
|
331
|
+
|
|
332
|
+
LIBHEIF_API
|
|
333
|
+
const uint16_t* heif_image_get_component_uint16_readonly(const heif_image*, uint32_t component_idx, size_t* out_stride);
|
|
334
|
+
|
|
335
|
+
LIBHEIF_API
|
|
336
|
+
uint16_t* heif_image_get_component_uint16(heif_image*, uint32_t component_idx, size_t* out_stride);
|
|
337
|
+
|
|
338
|
+
LIBHEIF_API
|
|
339
|
+
const uint32_t* heif_image_get_component_uint32_readonly(const heif_image*, uint32_t component_idx, size_t* out_stride);
|
|
340
|
+
|
|
341
|
+
LIBHEIF_API
|
|
342
|
+
uint32_t* heif_image_get_component_uint32(heif_image*, uint32_t component_idx, size_t* out_stride);
|
|
343
|
+
|
|
344
|
+
LIBHEIF_API
|
|
345
|
+
const uint64_t* heif_image_get_component_uint64_readonly(const heif_image*, uint32_t component_idx, size_t* out_stride);
|
|
346
|
+
|
|
347
|
+
LIBHEIF_API
|
|
348
|
+
uint64_t* heif_image_get_component_uint64(heif_image*, uint32_t component_idx, size_t* out_stride);
|
|
349
|
+
|
|
350
|
+
LIBHEIF_API
|
|
351
|
+
const int8_t* heif_image_get_component_int8_readonly(const heif_image*, uint32_t component_idx, size_t* out_stride);
|
|
352
|
+
|
|
353
|
+
LIBHEIF_API
|
|
354
|
+
int8_t* heif_image_get_component_int8(heif_image*, uint32_t component_idx, size_t* out_stride);
|
|
355
|
+
|
|
356
|
+
LIBHEIF_API
|
|
357
|
+
const int16_t* heif_image_get_component_int16_readonly(const heif_image*, uint32_t component_idx, size_t* out_stride);
|
|
358
|
+
|
|
359
|
+
LIBHEIF_API
|
|
360
|
+
int16_t* heif_image_get_component_int16(heif_image*, uint32_t component_idx, size_t* out_stride);
|
|
361
|
+
|
|
362
|
+
LIBHEIF_API
|
|
363
|
+
const int32_t* heif_image_get_component_int32_readonly(const heif_image*, uint32_t component_idx, size_t* out_stride);
|
|
364
|
+
|
|
365
|
+
LIBHEIF_API
|
|
366
|
+
int32_t* heif_image_get_component_int32(heif_image*, uint32_t component_idx, size_t* out_stride);
|
|
367
|
+
|
|
368
|
+
LIBHEIF_API
|
|
369
|
+
const int64_t* heif_image_get_component_int64_readonly(const heif_image*, uint32_t component_idx, size_t* out_stride);
|
|
370
|
+
|
|
371
|
+
LIBHEIF_API
|
|
372
|
+
int64_t* heif_image_get_component_int64(heif_image*, uint32_t component_idx, size_t* out_stride);
|
|
373
|
+
|
|
374
|
+
LIBHEIF_API
|
|
375
|
+
const float* heif_image_get_component_float32_readonly(const heif_image*, uint32_t component_idx, size_t* out_stride);
|
|
376
|
+
|
|
377
|
+
LIBHEIF_API
|
|
378
|
+
float* heif_image_get_component_float32(heif_image*, uint32_t component_idx, size_t* out_stride);
|
|
379
|
+
|
|
380
|
+
LIBHEIF_API
|
|
381
|
+
const double* heif_image_get_component_float64_readonly(const heif_image*, uint32_t component_idx, size_t* out_stride);
|
|
382
|
+
|
|
383
|
+
LIBHEIF_API
|
|
384
|
+
double* heif_image_get_component_float64(heif_image*, uint32_t component_idx, size_t* out_stride);
|
|
385
|
+
|
|
386
|
+
LIBHEIF_API
|
|
387
|
+
const heif_complex32* heif_image_get_component_complex32_readonly(const heif_image*, uint32_t component_idx, size_t* out_stride);
|
|
388
|
+
|
|
389
|
+
LIBHEIF_API
|
|
390
|
+
heif_complex32* heif_image_get_component_complex32(heif_image*, uint32_t component_idx, size_t* out_stride);
|
|
391
|
+
|
|
392
|
+
LIBHEIF_API
|
|
393
|
+
const heif_complex64* heif_image_get_component_complex64_readonly(const heif_image*, uint32_t component_idx, size_t* out_stride);
|
|
394
|
+
|
|
395
|
+
LIBHEIF_API
|
|
396
|
+
heif_complex64* heif_image_get_component_complex64(heif_image*, uint32_t component_idx, size_t* out_stride);
|
|
397
|
+
|
|
398
|
+
|
|
399
|
+
// --- GIMI component content IDs (set before encoding)
|
|
400
|
+
|
|
401
|
+
// Set a GIMI component content ID for a single cmpd component.
|
|
402
|
+
// If the internal array is too small, it will be resized (new entries default to empty strings).
|
|
403
|
+
// These are written into an ItemComponentContentIDProperty box during encoding.
|
|
404
|
+
LIBHEIF_API
|
|
405
|
+
void heif_image_set_gimi_component_content_id(heif_image*,
|
|
406
|
+
uint32_t component_idx,
|
|
407
|
+
const char* content_id);
|
|
408
|
+
|
|
105
409
|
#ifdef __cplusplus
|
|
106
410
|
}
|
|
107
411
|
#endif
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
/*6
|
|
2
|
+
* HEIF codec.
|
|
3
|
+
* Copyright (c) 2026 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_UNCOMPRESSED_TYPES_H
|
|
22
|
+
#define LIBHEIF_HEIF_UNCOMPRESSED_TYPES_H
|
|
23
|
+
|
|
24
|
+
#include <stdint.h>
|
|
25
|
+
|
|
26
|
+
#ifdef __cplusplus
|
|
27
|
+
extern "C" {
|
|
28
|
+
#endif
|
|
29
|
+
|
|
30
|
+
// --- ISO 23001-17 component types (Table 1)
|
|
31
|
+
|
|
32
|
+
typedef enum heif_unci_component_type
|
|
33
|
+
{
|
|
34
|
+
heif_unci_component_type_monochrome = 0,
|
|
35
|
+
heif_unci_component_type_Y = 1,
|
|
36
|
+
heif_unci_component_type_Cb = 2,
|
|
37
|
+
heif_unci_component_type_Cr = 3,
|
|
38
|
+
heif_unci_component_type_red = 4,
|
|
39
|
+
heif_unci_component_type_green = 5,
|
|
40
|
+
heif_unci_component_type_blue = 6,
|
|
41
|
+
heif_unci_component_type_alpha = 7,
|
|
42
|
+
heif_unci_component_type_depth = 8,
|
|
43
|
+
heif_unci_component_type_disparity = 9,
|
|
44
|
+
heif_unci_component_type_palette = 10,
|
|
45
|
+
heif_unci_component_type_filter_array = 11,
|
|
46
|
+
heif_unci_component_type_padded = 12,
|
|
47
|
+
heif_unci_component_type_cyan = 13,
|
|
48
|
+
heif_unci_component_type_magenta = 14,
|
|
49
|
+
heif_unci_component_type_yellow = 15,
|
|
50
|
+
heif_unci_component_type_key_black = 16
|
|
51
|
+
} heif_unci_component_type;
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
// --- Bayer / filter array pattern
|
|
55
|
+
|
|
56
|
+
typedef struct heif_bayer_pattern_pixel
|
|
57
|
+
{
|
|
58
|
+
uint32_t component_id;
|
|
59
|
+
float component_gain;
|
|
60
|
+
} heif_bayer_pattern_pixel;
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
// --- Sensor bad pixels map (ISO 23001-17, Section 6.1.7)
|
|
64
|
+
|
|
65
|
+
struct heif_bad_pixel { uint32_t row; uint32_t column; };
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
// --- Chroma sample location (ISO 23091-2 / ITU-T H.273 + ISO 23001-17)
|
|
69
|
+
|
|
70
|
+
typedef enum heif_chroma420_sample_location {
|
|
71
|
+
// values 0-5 according to ISO 23091-2 / ITU-T H.273
|
|
72
|
+
heif_chroma420_sample_location_00_05 = 0,
|
|
73
|
+
heif_chroma420_sample_location_05_05 = 1,
|
|
74
|
+
heif_chroma420_sample_location_00_00 = 2,
|
|
75
|
+
heif_chroma420_sample_location_05_00 = 3,
|
|
76
|
+
heif_chroma420_sample_location_00_10 = 4,
|
|
77
|
+
heif_chroma420_sample_location_05_10 = 5,
|
|
78
|
+
|
|
79
|
+
// value 6 according to ISO 23001-17
|
|
80
|
+
heif_chroma420_sample_location_00_00_01_00 = 6
|
|
81
|
+
} heif_chroma420_sample_location;
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
// Compression methods for 'unci' (ISO 23001-17) images.
|
|
85
|
+
// This is similar to heif_metadata_compression. We should try to keep the integers compatible, but each enum will just
|
|
86
|
+
// contain the allowed values.
|
|
87
|
+
typedef enum heif_unci_compression
|
|
88
|
+
{
|
|
89
|
+
heif_unci_compression_off = 0,
|
|
90
|
+
//heif_unci_compression_auto = 1,
|
|
91
|
+
//heif_unci_compression_unknown = 2, // only used when reading unknown method from input file
|
|
92
|
+
heif_unci_compression_deflate = 3,
|
|
93
|
+
heif_unci_compression_zlib = 4,
|
|
94
|
+
heif_unci_compression_brotli = 5
|
|
95
|
+
} heif_unci_compression;
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
// --- 'unci' image parameters
|
|
99
|
+
|
|
100
|
+
typedef struct heif_unci_image_parameters
|
|
101
|
+
{
|
|
102
|
+
int version;
|
|
103
|
+
|
|
104
|
+
// --- version 1
|
|
105
|
+
|
|
106
|
+
uint32_t image_width;
|
|
107
|
+
uint32_t image_height;
|
|
108
|
+
|
|
109
|
+
uint32_t tile_width;
|
|
110
|
+
uint32_t tile_height;
|
|
111
|
+
|
|
112
|
+
heif_unci_compression compression;
|
|
113
|
+
|
|
114
|
+
// TODO: interleave type, padding
|
|
115
|
+
} heif_unci_image_parameters;
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
// --- pixel datatype support
|
|
119
|
+
|
|
120
|
+
typedef enum heif_component_datatype
|
|
121
|
+
{
|
|
122
|
+
heif_component_datatype_undefined = 0,
|
|
123
|
+
heif_component_datatype_unsigned_integer = 1,
|
|
124
|
+
heif_component_datatype_signed_integer = 2,
|
|
125
|
+
heif_component_datatype_floating_point = 3,
|
|
126
|
+
heif_component_datatype_complex_number = 4
|
|
127
|
+
} heif_component_datatype;
|
|
128
|
+
|
|
129
|
+
typedef struct heif_complex32
|
|
130
|
+
{
|
|
131
|
+
float real, imaginary;
|
|
132
|
+
} heif_complex32;
|
|
133
|
+
|
|
134
|
+
typedef struct heif_complex64
|
|
135
|
+
{
|
|
136
|
+
double real, imaginary;
|
|
137
|
+
} heif_complex64;
|
|
138
|
+
|
|
139
|
+
#ifdef __cplusplus
|
|
140
|
+
}
|
|
141
|
+
#endif
|
|
142
|
+
|
|
143
|
+
#endif
|