pylibheif 1.21.2__cp312-cp312-macosx_14_0_arm64.whl
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.
Potentially problematic release.
This version of pylibheif might be problematic. Click here for more details.
- include/libheif/heif.h +41 -0
- include/libheif/heif_aux_images.h +182 -0
- include/libheif/heif_brands.h +376 -0
- include/libheif/heif_color.h +363 -0
- include/libheif/heif_context.h +329 -0
- include/libheif/heif_cxx.h +1390 -0
- include/libheif/heif_decoding.h +172 -0
- include/libheif/heif_encoding.h +395 -0
- include/libheif/heif_entity_groups.h +60 -0
- include/libheif/heif_error.h +304 -0
- include/libheif/heif_image.h +355 -0
- include/libheif/heif_image_handle.h +129 -0
- include/libheif/heif_items.h +260 -0
- include/libheif/heif_library.h +219 -0
- include/libheif/heif_metadata.h +136 -0
- include/libheif/heif_plugin.h +378 -0
- include/libheif/heif_properties.h +235 -0
- include/libheif/heif_regions.h +868 -0
- include/libheif/heif_security.h +107 -0
- include/libheif/heif_sequences.h +644 -0
- include/libheif/heif_tai_timestamps.h +202 -0
- include/libheif/heif_text.h +161 -0
- include/libheif/heif_tiling.h +137 -0
- include/libheif/heif_uncompressed.h +109 -0
- include/libheif/heif_version.h +38 -0
- lib/cmake/libheif/libheif-config-release.cmake +19 -0
- lib/cmake/libheif/libheif-config-version.cmake +83 -0
- lib/cmake/libheif/libheif-config.cmake +108 -0
- lib/libheif.a +0 -0
- lib/pkgconfig/libheif.pc +15 -0
- pylibheif-1.21.2.dist-info/METADATA +409 -0
- pylibheif-1.21.2.dist-info/RECORD +41 -0
- pylibheif-1.21.2.dist-info/WHEEL +5 -0
- pylibheif-1.21.2.dist-info/licenses/LICENSE +165 -0
- pylibheif.cpython-312-darwin.so +0 -0
- pylibheif.dylibs/libaom.3.13.1.dylib +0 -0
- pylibheif.dylibs/libdav1d.7.dylib +0 -0
- pylibheif.dylibs/libde265.0.dylib +0 -0
- pylibheif.dylibs/libopenjp2.2.5.4.dylib +0 -0
- pylibheif.dylibs/libvmaf.3.dylib +0 -0
- pylibheif.dylibs/libx265.215.dylib +0 -0
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* HEIF codec.
|
|
3
|
+
* Copyright (c) 2025 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_TAI_TIMESTAMPS_H
|
|
22
|
+
#define LIBHEIF_HEIF_TAI_TIMESTAMPS_H
|
|
23
|
+
|
|
24
|
+
#include <libheif/heif.h>
|
|
25
|
+
|
|
26
|
+
#ifdef __cplusplus
|
|
27
|
+
extern "C" {
|
|
28
|
+
#endif
|
|
29
|
+
|
|
30
|
+
typedef struct heif_tai_clock_info
|
|
31
|
+
{
|
|
32
|
+
uint8_t version;
|
|
33
|
+
|
|
34
|
+
// --- version 1
|
|
35
|
+
|
|
36
|
+
// Standard deviation for timestamp generation process.
|
|
37
|
+
// May be `heif_tai_clock_info_time_uncertainty_unknown` if unknown.
|
|
38
|
+
uint64_t time_uncertainty;
|
|
39
|
+
|
|
40
|
+
// Receptor clock resolution in nanoseconds.
|
|
41
|
+
uint32_t clock_resolution;
|
|
42
|
+
|
|
43
|
+
// Clock drift rate in picoseconds/second when synchronization is stopped.
|
|
44
|
+
// Maybe `heif_tai_clock_info_clock_drift_rate_unknown` if unknown.
|
|
45
|
+
int32_t clock_drift_rate;
|
|
46
|
+
|
|
47
|
+
// Whether clock is synchronized to an atomic source,
|
|
48
|
+
// see the clock_type defines below.
|
|
49
|
+
uint8_t clock_type;
|
|
50
|
+
} heif_tai_clock_info;
|
|
51
|
+
|
|
52
|
+
#define heif_tai_clock_info_time_uncertainty_unknown UINT64_C(0xFFFFFFFFFFFFFFFF)
|
|
53
|
+
#define heif_tai_clock_info_clock_drift_rate_unknown INT32_C(0x7FFFFFFF)
|
|
54
|
+
#define heif_tai_clock_info_clock_type_unknown 0
|
|
55
|
+
#define heif_tai_clock_info_clock_type_not_synchronized_to_atomic_source 1
|
|
56
|
+
#define heif_tai_clock_info_clock_type_synchronized_to_atomic_source 2
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Allocate a new heif_tai_clock_info object and initialize with default values.
|
|
61
|
+
*/
|
|
62
|
+
LIBHEIF_API
|
|
63
|
+
heif_tai_clock_info* heif_tai_clock_info_alloc(void);
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Copies the source object into the destination object.
|
|
67
|
+
* Only the fields that are present in both objects are copied.
|
|
68
|
+
* The version property has to be set in both structs.
|
|
69
|
+
*/
|
|
70
|
+
LIBHEIF_API
|
|
71
|
+
void heif_tai_clock_info_copy(heif_tai_clock_info* dst, const heif_tai_clock_info* src);
|
|
72
|
+
|
|
73
|
+
LIBHEIF_API
|
|
74
|
+
void heif_tai_clock_info_release(heif_tai_clock_info* clock_info);
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
typedef struct heif_tai_timestamp_packet
|
|
78
|
+
{
|
|
79
|
+
uint8_t version;
|
|
80
|
+
|
|
81
|
+
// --- version 1
|
|
82
|
+
|
|
83
|
+
// number of nanoseconds since TAI epoch (1958-01-01T00:00:00.0)
|
|
84
|
+
uint64_t tai_timestamp;
|
|
85
|
+
|
|
86
|
+
// whether the remote and receiptor clocks are in sync
|
|
87
|
+
uint8_t synchronization_state; // bool
|
|
88
|
+
|
|
89
|
+
// whether the receptor clock failed to generate a timestamp
|
|
90
|
+
uint8_t timestamp_generation_failure; // bool
|
|
91
|
+
|
|
92
|
+
// whether the original clock value has been modified
|
|
93
|
+
uint8_t timestamp_is_modified; // bool
|
|
94
|
+
} heif_tai_timestamp_packet;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Allocate a new heif_tai_timestamp_packet object and initialize with default values.
|
|
98
|
+
*/
|
|
99
|
+
LIBHEIF_API
|
|
100
|
+
heif_tai_timestamp_packet* heif_tai_timestamp_packet_alloc(void);
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Copies the source object into the destination object.
|
|
104
|
+
* Only the fields that are present in both objects are copied.
|
|
105
|
+
* The version property has to be set in both structs.
|
|
106
|
+
*/
|
|
107
|
+
LIBHEIF_API
|
|
108
|
+
void heif_tai_timestamp_packet_copy(heif_tai_timestamp_packet* dst, const heif_tai_timestamp_packet* src);
|
|
109
|
+
|
|
110
|
+
LIBHEIF_API
|
|
111
|
+
void heif_tai_timestamp_packet_release(heif_tai_timestamp_packet*);
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Creates a new clock info property if it doesn't exist yet.
|
|
117
|
+
* You can only add one tai_clock_info to an image.
|
|
118
|
+
*
|
|
119
|
+
* @param clock_info The TAI clock info to set for the item. This object will be copied.
|
|
120
|
+
* @param out_optional_propertyId Output parameter for the property ID of the tai_clock_info.
|
|
121
|
+
* This parameter may be NULL if the info is not required.
|
|
122
|
+
*/
|
|
123
|
+
LIBHEIF_API
|
|
124
|
+
heif_error heif_item_set_property_tai_clock_info(heif_context* ctx,
|
|
125
|
+
heif_item_id itemId,
|
|
126
|
+
const heif_tai_clock_info* clock_info,
|
|
127
|
+
heif_property_id* out_optional_propertyId);
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Get the heif_tai_clock_info attached to the item.
|
|
131
|
+
* This function allocates a new heif_tai_clock_info and returns it through out_clock.
|
|
132
|
+
*
|
|
133
|
+
* @param out_clock This parameter must not be nullptr. The object returned through this parameter must
|
|
134
|
+
* be released with heif_tai_clock_info_release().
|
|
135
|
+
* If no tai_clock_info property exists for the item, out_clock is set to NULL and
|
|
136
|
+
* no error is returned.
|
|
137
|
+
*/
|
|
138
|
+
LIBHEIF_API
|
|
139
|
+
heif_error heif_item_get_property_tai_clock_info(const heif_context* ctx,
|
|
140
|
+
heif_item_id itemId,
|
|
141
|
+
heif_tai_clock_info** out_clock);
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Creates a new TAI timestamp property if it doesn't exist yet.
|
|
146
|
+
* You can only add one tai_timestamp to an image.
|
|
147
|
+
*
|
|
148
|
+
* @param timestamp The TAI timestamp to set for the item. This object will be copied.
|
|
149
|
+
* @param out_optional_propertyId Output parameter for the property ID of the TAI timestamp.
|
|
150
|
+
* This parameter may be NULL if the info is not required.
|
|
151
|
+
*/
|
|
152
|
+
LIBHEIF_API
|
|
153
|
+
heif_error heif_item_set_property_tai_timestamp(heif_context* ctx,
|
|
154
|
+
heif_item_id itemId,
|
|
155
|
+
const heif_tai_timestamp_packet* timestamp,
|
|
156
|
+
heif_property_id* out_optional_propertyId);
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* Get the heif_tai_timestamp_packet attached to the item.
|
|
160
|
+
* This function allocates a new heif_tai_timestamp_packet and returns it through out_timestamp.
|
|
161
|
+
*
|
|
162
|
+
* @param out_timestamp This parameter must not be NULL. The object returned through this parameter must
|
|
163
|
+
* be released with heif_tai_timestamp_packet_release().
|
|
164
|
+
* If no tai_timestamp_packet property exists for the item, *out_timestamp is set to NULL and
|
|
165
|
+
* no error is returned.
|
|
166
|
+
*/
|
|
167
|
+
LIBHEIF_API
|
|
168
|
+
heif_error heif_item_get_property_tai_timestamp(const heif_context* ctx,
|
|
169
|
+
heif_item_id itemId,
|
|
170
|
+
heif_tai_timestamp_packet** out_timestamp);
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Attach a TAI timestamp to the image.
|
|
174
|
+
* The main use of this function is for image sequences, but it can also be used for still images.
|
|
175
|
+
* If used for still images, note that you also have to set the heif_tai_clock_info to the image item
|
|
176
|
+
* through heif_item_set_property_tai_clock_info().
|
|
177
|
+
*
|
|
178
|
+
* @param timestamp The TAI timestamp to set to the image. This object will be copied.
|
|
179
|
+
*/
|
|
180
|
+
LIBHEIF_API
|
|
181
|
+
heif_error heif_image_set_tai_timestamp(heif_image* img,
|
|
182
|
+
const heif_tai_timestamp_packet* timestamp);
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* Get the heif_tai_timestamp_packet attached to the image.
|
|
186
|
+
* The main use of this function is for image sequences, but it can also be used for still images.
|
|
187
|
+
* This function allocates a new heif_tai_timestamp_packet and returns it through out_timestamp.
|
|
188
|
+
*
|
|
189
|
+
* @param out_timestamp This parameter must not be NULL. The object returned through this parameter must
|
|
190
|
+
* be released with heif_tai_timestamp_packet_release().
|
|
191
|
+
* If no tai_timestamp_packet property exists for the image, *out_timestamp is set to NULL and
|
|
192
|
+
* no error is returned.
|
|
193
|
+
*/
|
|
194
|
+
LIBHEIF_API
|
|
195
|
+
heif_error heif_image_get_tai_timestamp(const heif_image* img,
|
|
196
|
+
heif_tai_timestamp_packet** out_timestamp);
|
|
197
|
+
|
|
198
|
+
#ifdef __cplusplus
|
|
199
|
+
}
|
|
200
|
+
#endif
|
|
201
|
+
|
|
202
|
+
#endif //LIBHEIF_HEIF_TAI_TIMESTAMPS_H
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* HEIF codec.
|
|
3
|
+
* Copyright (c) 2023 Dirk Farin <dirk.farin@gmail.com>
|
|
4
|
+
* Copyright (c) 2025 Brad Hards <bradh@frogmouth.net>
|
|
5
|
+
*
|
|
6
|
+
* This file is part of libheif.
|
|
7
|
+
*
|
|
8
|
+
* libheif is free software: you can redistribute it and/or modify
|
|
9
|
+
* it under the terms of the GNU Lesser General Public License as
|
|
10
|
+
* published by the Free Software Foundation, either version 3 of
|
|
11
|
+
* the License, or (at your option) any later version.
|
|
12
|
+
*
|
|
13
|
+
* libheif is distributed in the hope that it will be useful,
|
|
14
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
* GNU Lesser General Public License for more details.
|
|
17
|
+
*
|
|
18
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
19
|
+
* along with libheif. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
#ifndef LIBHEIF_HEIF_TEXT_H
|
|
23
|
+
#define LIBHEIF_HEIF_TEXT_H
|
|
24
|
+
|
|
25
|
+
#include "heif_image_handle.h"
|
|
26
|
+
#include "heif_library.h"
|
|
27
|
+
#include "heif_error.h"
|
|
28
|
+
|
|
29
|
+
#ifdef __cplusplus
|
|
30
|
+
extern "C" {
|
|
31
|
+
#endif
|
|
32
|
+
|
|
33
|
+
// --- text items and fonts
|
|
34
|
+
|
|
35
|
+
// See ISO/IEC 23008-12:2025 Section 6.10 "Text and font items"
|
|
36
|
+
|
|
37
|
+
typedef struct heif_text_item heif_text_item;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Get the number of text items that are attached to an image.
|
|
41
|
+
*
|
|
42
|
+
* @param image_handle the image handle for the image to query.
|
|
43
|
+
* @return the number of text items, which can be zero.
|
|
44
|
+
*/
|
|
45
|
+
LIBHEIF_API
|
|
46
|
+
int heif_image_handle_get_number_of_text_items(const heif_image_handle* image_handle);
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Get the text item identifiers for the text items attached to an image.
|
|
50
|
+
*
|
|
51
|
+
* Possible usage (in C++):
|
|
52
|
+
* @code
|
|
53
|
+
* int numTextItems = heif_image_handle_get_number_of_text_items(handle);
|
|
54
|
+
* if (numTextItems > 0) {
|
|
55
|
+
* std::vector<heif_item_id> text_item_ids(numTextItems);
|
|
56
|
+
* heif_image_handle_get_list_of_text_item_ids(handle, text_item_ids.data(), numTextItems);
|
|
57
|
+
* // use text item ids
|
|
58
|
+
* }
|
|
59
|
+
* @endcode
|
|
60
|
+
*
|
|
61
|
+
* @param image_handle the image handle for the parent image to query
|
|
62
|
+
* @param text_item_ids_array array to put the item identifiers into
|
|
63
|
+
* @param max_count the maximum number of text identifiers
|
|
64
|
+
* @return the number of text item identifiers that were returned.
|
|
65
|
+
*/
|
|
66
|
+
LIBHEIF_API
|
|
67
|
+
int heif_image_handle_get_list_of_text_item_ids(const heif_image_handle* image_handle,
|
|
68
|
+
heif_item_id* text_item_ids_array,
|
|
69
|
+
int max_count);
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Get the text item.
|
|
74
|
+
*
|
|
75
|
+
* Caller is responsible for release of the output heif_text_item with heif_text_item_release().
|
|
76
|
+
*
|
|
77
|
+
* @param context the context to get the text item from, usually from a file operation
|
|
78
|
+
* @param text_item_id the identifier for the text item
|
|
79
|
+
* @param out pointer to pointer to the resulting text item
|
|
80
|
+
* @return heif_error_ok on success, or an error value indicating the problem
|
|
81
|
+
*/
|
|
82
|
+
LIBHEIF_API
|
|
83
|
+
heif_error heif_context_get_text_item(const heif_context* context,
|
|
84
|
+
heif_item_id text_item_id,
|
|
85
|
+
heif_text_item** out);
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Get the item identifier for a text item.
|
|
89
|
+
*
|
|
90
|
+
* @param text_item the text item to query
|
|
91
|
+
* @return the text item identifier (or 0 if the text_item is null)
|
|
92
|
+
*/
|
|
93
|
+
LIBHEIF_API
|
|
94
|
+
heif_item_id heif_text_item_get_id(heif_text_item* text_item);
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Get the item content for a text item.
|
|
98
|
+
*
|
|
99
|
+
* This is the payload text, in the format given by the associated content_type.
|
|
100
|
+
*
|
|
101
|
+
* @param text_item the text item to query
|
|
102
|
+
* @return the text item content (or null if the text_item is null). The returned string shall be released
|
|
103
|
+
* with heif_string_release().
|
|
104
|
+
*/
|
|
105
|
+
LIBHEIF_API
|
|
106
|
+
const char* heif_text_item_get_content(heif_text_item* text_item);
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* This function is similar to heif_item_get_property_extended_language(), but
|
|
110
|
+
* takes a `heif_text_item` as parameter.
|
|
111
|
+
*
|
|
112
|
+
* @param text_item The text item for which we are requesting the language.
|
|
113
|
+
* @param out_language Output parameter for the text language. Free with heif_string_release().
|
|
114
|
+
* @return
|
|
115
|
+
*/
|
|
116
|
+
LIBHEIF_API
|
|
117
|
+
heif_error heif_text_item_get_property_extended_language(const heif_text_item* text_item,
|
|
118
|
+
char** out_language);
|
|
119
|
+
|
|
120
|
+
// --- adding text items
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Add a text item to an image.
|
|
124
|
+
*/
|
|
125
|
+
LIBHEIF_API
|
|
126
|
+
heif_error heif_image_handle_add_text_item(heif_image_handle *image_handle,
|
|
127
|
+
const char *content_type,
|
|
128
|
+
const char *text,
|
|
129
|
+
heif_text_item** out_text_item);
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Release a text item.
|
|
133
|
+
*
|
|
134
|
+
* This should be called on items from heif_context_add_text_item().
|
|
135
|
+
*
|
|
136
|
+
* @param text_item the item to release.
|
|
137
|
+
*/
|
|
138
|
+
LIBHEIF_API
|
|
139
|
+
void heif_text_item_release(heif_text_item* text_item);
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Set the extended language property to the text item.
|
|
143
|
+
*
|
|
144
|
+
* This adds an RFC 5346 (IETF BCP 47) extended language tag, such as "en-AU".
|
|
145
|
+
*
|
|
146
|
+
* @param text_item the text item to query
|
|
147
|
+
* @param language the language to set
|
|
148
|
+
* @param out_optional_propertyId Output parameter for the property ID of the language property.
|
|
149
|
+
* This parameter may be NULL if the info is not required.
|
|
150
|
+
* @return heif_error_ok on success, or an error value indicating the problem
|
|
151
|
+
*/
|
|
152
|
+
LIBHEIF_API
|
|
153
|
+
heif_error heif_text_item_set_extended_language(heif_text_item* text_item,
|
|
154
|
+
const char *language,
|
|
155
|
+
heif_property_id* out_optional_propertyId);
|
|
156
|
+
|
|
157
|
+
#ifdef __cplusplus
|
|
158
|
+
}
|
|
159
|
+
#endif
|
|
160
|
+
|
|
161
|
+
#endif
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* HEIF codec.
|
|
3
|
+
* Copyright (c) 2017-2025 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_TILING_H
|
|
22
|
+
#define LIBHEIF_HEIF_TILING_H
|
|
23
|
+
|
|
24
|
+
#ifdef __cplusplus
|
|
25
|
+
extern "C" {
|
|
26
|
+
#endif
|
|
27
|
+
|
|
28
|
+
#include <libheif/heif_library.h>
|
|
29
|
+
#include <libheif/heif_error.h>
|
|
30
|
+
#include <libheif/heif_image.h>
|
|
31
|
+
|
|
32
|
+
// forward declaration from other headers
|
|
33
|
+
typedef struct heif_encoder heif_encoder;
|
|
34
|
+
typedef struct heif_encoding_options heif_encoding_options;
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
typedef struct heif_image_tiling
|
|
38
|
+
{
|
|
39
|
+
int version;
|
|
40
|
+
|
|
41
|
+
// --- version 1
|
|
42
|
+
|
|
43
|
+
uint32_t num_columns;
|
|
44
|
+
uint32_t num_rows;
|
|
45
|
+
uint32_t tile_width;
|
|
46
|
+
uint32_t tile_height;
|
|
47
|
+
|
|
48
|
+
uint32_t image_width;
|
|
49
|
+
uint32_t image_height;
|
|
50
|
+
|
|
51
|
+
// Position of the top left tile.
|
|
52
|
+
// Usually, this is (0;0), but if a tiled image is rotated or cropped, it may be that the top left tile should be placed at a negative position.
|
|
53
|
+
// The offsets define this negative shift.
|
|
54
|
+
uint32_t top_offset;
|
|
55
|
+
uint32_t left_offset;
|
|
56
|
+
|
|
57
|
+
uint8_t number_of_extra_dimensions; // 0 for normal images, 1 for volumetric (3D), ...
|
|
58
|
+
uint32_t extra_dimension_size[8]; // size of extra dimensions (first 8 dimensions)
|
|
59
|
+
} heif_image_tiling;
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
// --- decoding ---
|
|
63
|
+
|
|
64
|
+
// If 'process_image_transformations' is true, this returns modified sizes.
|
|
65
|
+
// If it is false, the top_offset and left_offset will always be (0;0).
|
|
66
|
+
LIBHEIF_API
|
|
67
|
+
heif_error heif_image_handle_get_image_tiling(const heif_image_handle* handle, int process_image_transformations, struct heif_image_tiling* out_tiling);
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
// For grid images, return the image item ID of a specific grid tile.
|
|
71
|
+
// If 'process_image_transformations' is true, the tile positions are given in the transformed image coordinate system and
|
|
72
|
+
// are internally mapped to the original image tile positions.
|
|
73
|
+
LIBHEIF_API
|
|
74
|
+
heif_error heif_image_handle_get_grid_image_tile_id(const heif_image_handle* handle,
|
|
75
|
+
int process_image_transformations,
|
|
76
|
+
uint32_t tile_x, uint32_t tile_y,
|
|
77
|
+
heif_item_id* out_tile_item_id);
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
typedef struct heif_decoding_options heif_decoding_options;
|
|
81
|
+
|
|
82
|
+
// The tile position is given in tile indices, not in pixel coordinates.
|
|
83
|
+
// If the image transformations are processed (option->ignore_image_transformations==false), the tile position
|
|
84
|
+
// is given in the transformed coordinates.
|
|
85
|
+
LIBHEIF_API
|
|
86
|
+
heif_error heif_image_handle_decode_image_tile(const heif_image_handle* in_handle,
|
|
87
|
+
heif_image** out_img,
|
|
88
|
+
enum heif_colorspace colorspace,
|
|
89
|
+
enum heif_chroma chroma,
|
|
90
|
+
const heif_decoding_options* options,
|
|
91
|
+
uint32_t tile_x, uint32_t tile_y);
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
// --- encoding ---
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* @brief Encodes an array of images into a grid.
|
|
98
|
+
*
|
|
99
|
+
* @param ctx The file context
|
|
100
|
+
* @param tiles User allocated array of images that will form the grid.
|
|
101
|
+
* @param rows The number of rows in the grid.
|
|
102
|
+
* @param columns The number of columns in the grid.
|
|
103
|
+
* @param encoder Defines the encoder to use. See heif_context_get_encoder_for_format()
|
|
104
|
+
* @param input_options Optional, may be nullptr.
|
|
105
|
+
* @param out_image_handle Returns a handle to the grid. The caller is responsible for freeing it.
|
|
106
|
+
* @return Returns an error if ctx, tiles, or encoder is nullptr. If rows or columns is 0.
|
|
107
|
+
*/
|
|
108
|
+
LIBHEIF_API
|
|
109
|
+
heif_error heif_context_encode_grid(heif_context* ctx,
|
|
110
|
+
heif_image** tiles,
|
|
111
|
+
uint16_t rows,
|
|
112
|
+
uint16_t columns,
|
|
113
|
+
heif_encoder* encoder,
|
|
114
|
+
const heif_encoding_options* input_options,
|
|
115
|
+
heif_image_handle** out_image_handle);
|
|
116
|
+
|
|
117
|
+
LIBHEIF_API
|
|
118
|
+
heif_error heif_context_add_grid_image(heif_context* ctx,
|
|
119
|
+
uint32_t image_width,
|
|
120
|
+
uint32_t image_height,
|
|
121
|
+
uint32_t tile_columns,
|
|
122
|
+
uint32_t tile_rows,
|
|
123
|
+
const heif_encoding_options* encoding_options,
|
|
124
|
+
heif_image_handle** out_grid_image_handle);
|
|
125
|
+
|
|
126
|
+
LIBHEIF_API
|
|
127
|
+
heif_error heif_context_add_image_tile(heif_context* ctx,
|
|
128
|
+
heif_image_handle* tiled_image,
|
|
129
|
+
uint32_t tile_x, uint32_t tile_y,
|
|
130
|
+
const heif_image* image,
|
|
131
|
+
heif_encoder* encoder);
|
|
132
|
+
|
|
133
|
+
#ifdef __cplusplus
|
|
134
|
+
}
|
|
135
|
+
#endif
|
|
136
|
+
|
|
137
|
+
#endif
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* HEIF codec.
|
|
3
|
+
* Copyright (c) 2024-2025 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_H
|
|
22
|
+
#define LIBHEIF_HEIF_UNCOMPRESSED_H
|
|
23
|
+
|
|
24
|
+
#include "libheif/heif.h"
|
|
25
|
+
|
|
26
|
+
#ifdef __cplusplus
|
|
27
|
+
extern "C" {
|
|
28
|
+
#endif
|
|
29
|
+
|
|
30
|
+
/* @file heif_uncompressed.h
|
|
31
|
+
* @brief Functions for adding ISO 23001-17 (uncompressed) images to a HEIF file.
|
|
32
|
+
* Despite its name, this is not limited to uncompressed images.
|
|
33
|
+
* It is also possible to add images with lossless compression methods.
|
|
34
|
+
* See heif_metadata_compression for more information.
|
|
35
|
+
*/
|
|
36
|
+
|
|
37
|
+
// --- 'unci' images
|
|
38
|
+
|
|
39
|
+
// This is similar to heif_metadata_compression. We should try to keep the integers compatible, but each enum will just
|
|
40
|
+
// contain the allowed values.
|
|
41
|
+
typedef 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
|
+
} heif_unci_compression;
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
typedef struct heif_unci_image_parameters
|
|
53
|
+
{
|
|
54
|
+
int version;
|
|
55
|
+
|
|
56
|
+
// --- version 1
|
|
57
|
+
|
|
58
|
+
uint32_t image_width;
|
|
59
|
+
uint32_t image_height;
|
|
60
|
+
|
|
61
|
+
uint32_t tile_width;
|
|
62
|
+
uint32_t tile_height;
|
|
63
|
+
|
|
64
|
+
enum heif_unci_compression compression;
|
|
65
|
+
|
|
66
|
+
// TODO: interleave type, padding
|
|
67
|
+
} heif_unci_image_parameters;
|
|
68
|
+
|
|
69
|
+
LIBHEIF_API
|
|
70
|
+
heif_unci_image_parameters* heif_unci_image_parameters_alloc(void);
|
|
71
|
+
|
|
72
|
+
LIBHEIF_API
|
|
73
|
+
void heif_unci_image_parameters_copy(heif_unci_image_parameters* dst,
|
|
74
|
+
const heif_unci_image_parameters* src);
|
|
75
|
+
|
|
76
|
+
LIBHEIF_API
|
|
77
|
+
void heif_unci_image_parameters_release(heif_unci_image_parameters*);
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
/*
|
|
81
|
+
* This adds an empty iso23001-17 (uncompressed) image to the HEIF file.
|
|
82
|
+
* The actual image data is added later using heif_context_add_image_tile().
|
|
83
|
+
* If you do not need tiling, you can use heif_context_encode_image() instead.
|
|
84
|
+
* However, this will by default disable any compression and any control about
|
|
85
|
+
* the data layout.
|
|
86
|
+
*
|
|
87
|
+
* @param ctx The file context
|
|
88
|
+
* @param parameters The parameters for the image, must not be NULL.
|
|
89
|
+
* @param encoding_options Optional, may be NULL.
|
|
90
|
+
* @param prototype An image with the same channel configuration as the image data
|
|
91
|
+
* that will be later inserted. The image size need not match this.
|
|
92
|
+
* Must not be NULL.
|
|
93
|
+
* @param out_unci_image_handle Returns a handle to the image. The caller is responsible for freeing it.
|
|
94
|
+
* Must not be NULL because this is required to fill in image data.
|
|
95
|
+
* @return Returns an error if the passed parameters are incorrect.
|
|
96
|
+
* If ISO23001-17 images are not supported, returns heif_error_Unsupported_feature.
|
|
97
|
+
*/
|
|
98
|
+
LIBHEIF_API
|
|
99
|
+
heif_error heif_context_add_empty_unci_image(heif_context* ctx,
|
|
100
|
+
const heif_unci_image_parameters* parameters,
|
|
101
|
+
const heif_encoding_options* encoding_options,
|
|
102
|
+
const heif_image* prototype,
|
|
103
|
+
heif_image_handle** out_unci_image_handle);
|
|
104
|
+
|
|
105
|
+
#ifdef __cplusplus
|
|
106
|
+
}
|
|
107
|
+
#endif
|
|
108
|
+
|
|
109
|
+
#endif
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* HEIF codec.
|
|
3
|
+
* Copyright (c) 2017 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
|
+
/* heif_version.h
|
|
22
|
+
*
|
|
23
|
+
* This file was automatically generated when libheif was built.
|
|
24
|
+
*
|
|
25
|
+
* DO NOT EDIT THIS FILE.
|
|
26
|
+
*/
|
|
27
|
+
#ifndef LIBHEIF_HEIF_VERSION_H
|
|
28
|
+
#define LIBHEIF_HEIF_VERSION_H
|
|
29
|
+
|
|
30
|
+
/* Numeric representation of the version */
|
|
31
|
+
#define LIBHEIF_NUMERIC_VERSION ((1<<24) | (21<<16) | (2<<8) | 0)
|
|
32
|
+
|
|
33
|
+
/* Version string */
|
|
34
|
+
#define LIBHEIF_VERSION "1.21.2"
|
|
35
|
+
|
|
36
|
+
#define LIBHEIF_PLUGIN_DIRECTORY "/var/folders/xx/pgt1mtfn3xx3hdys7czt35bh0000gn/T/tmpcsjdgqu7/wheel/platlib/lib/libheif"
|
|
37
|
+
|
|
38
|
+
#endif // LIBHEIF_HEIF_VERSION_H
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#----------------------------------------------------------------
|
|
2
|
+
# Generated CMake target import file for configuration "Release".
|
|
3
|
+
#----------------------------------------------------------------
|
|
4
|
+
|
|
5
|
+
# Commands may need to know the format version.
|
|
6
|
+
set(CMAKE_IMPORT_FILE_VERSION 1)
|
|
7
|
+
|
|
8
|
+
# Import target "heif" for configuration "Release"
|
|
9
|
+
set_property(TARGET heif APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
|
|
10
|
+
set_target_properties(heif PROPERTIES
|
|
11
|
+
IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "CXX"
|
|
12
|
+
IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/libheif.a"
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
list(APPEND _cmake_import_check_targets heif )
|
|
16
|
+
list(APPEND _cmake_import_check_files_for_heif "${_IMPORT_PREFIX}/lib/libheif.a" )
|
|
17
|
+
|
|
18
|
+
# Commands beyond this point should not need to know the version.
|
|
19
|
+
set(CMAKE_IMPORT_FILE_VERSION)
|