libheif
heif_text.h
Go to the documentation of this file.
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 
45 LIBHEIF_API
47 
66 LIBHEIF_API
68  heif_item_id* text_item_ids_array,
69  int max_count);
70 
71 
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 
93 LIBHEIF_API
95 
105 LIBHEIF_API
107 
116 LIBHEIF_API
118  char** out_language);
119 
120 // --- adding text items
121 
125 LIBHEIF_API
127  const char *content_type,
128  const char *text,
129  heif_text_item** out_text_item);
130 
138 LIBHEIF_API
140 
152 LIBHEIF_API
154  const char *language,
155  heif_property_id* out_optional_propertyId);
156 
157 #ifdef __cplusplus
158 }
159 #endif
160 
161 #endif
uint32_t heif_property_id
Definition: heif_library.h:93
struct heif_image_handle heif_image_handle
Definition: heif_library.h:90
uint32_t heif_item_id
Definition: heif_library.h:92
struct heif_context heif_context
Definition: heif_library.h:89
heif_error heif_text_item_set_extended_language(heif_text_item *text_item, const char *language, heif_property_id *out_optional_propertyId)
Set the extended language property to the text item.
const char * heif_text_item_get_content(heif_text_item *text_item)
Get the item content for a text item.
heif_error heif_context_get_text_item(const heif_context *context, heif_item_id text_item_id, heif_text_item **out)
Get the text item.
heif_item_id heif_text_item_get_id(heif_text_item *text_item)
Get the item identifier for a text item.
int heif_image_handle_get_list_of_text_item_ids(const heif_image_handle *image_handle, heif_item_id *text_item_ids_array, int max_count)
Get the text item identifiers for the text items attached to an image.
heif_error heif_text_item_get_property_extended_language(const heif_text_item *text_item, char **out_language)
This function is similar to heif_item_get_property_extended_language(), but takes a heif_text_item as...
heif_error heif_image_handle_add_text_item(heif_image_handle *image_handle, const char *content_type, const char *text, heif_text_item **out_text_item)
Add a text item to an image.
int heif_image_handle_get_number_of_text_items(const heif_image_handle *image_handle)
Get the number of text items that are attached to an image.
struct heif_text_item heif_text_item
Definition: heif_text.h:37
void heif_text_item_release(heif_text_item *text_item)
Release a text item.