EXIF library (libexif) API 0.6.22

exif-entry.h
Go to the documentation of this file.
1
4 /*
5 * Copyright (c) 2001 Lutz Mueller <lutz@users.sourceforge.net>
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
11 *
12 * This library 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 GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the
19 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 * Boston, MA 02110-1301 USA.
21 */
22
23 #ifndef __EXIF_ENTRY_H__
24 #define __EXIF_ENTRY_H__
25
26 #ifdef __cplusplus
27 extern "C" {
28 #endif /* __cplusplus */
29
35 typedef struct _ExifEntry ExifEntry;
36 typedef struct _ExifEntryPrivate ExifEntryPrivate;
37
38 #include <libexif/exif-content.h>
39 #include <libexif/exif-format.h>
40 #include <libexif/exif-mem.h>
41
43 struct _ExifEntry {
45 ExifTag tag;
46
48 ExifFormat format;
49
52 unsigned long components;
53
57 unsigned char *data;
58
61 unsigned int size;
62
65 ExifContent *parent;
66
68 ExifEntryPrivate *priv;
69 };
70
71 /* Lifecycle */
72
80 ExifEntry *exif_entry_new (void);
81
90 ExifEntry *exif_entry_new_mem (ExifMem *);
91
98 void exif_entry_ref (ExifEntry *entry);
99
105 void exif_entry_unref (ExifEntry *entry);
106
114 void exif_entry_free (ExifEntry *entry);
115
125 void exif_entry_initialize (ExifEntry *e, ExifTag tag);
126
140 void exif_entry_fix (ExifEntry *entry);
141
142
143 /* For your convenience */
144
164 const char *exif_entry_get_value (ExifEntry *entry, char *val,
165 unsigned int maxlen);
166
173 void exif_entry_dump (ExifEntry *entry, unsigned int indent);
174
180 #define exif_entry_get_ifd(e) ((e)?exif_content_get_ifd((e)->parent):EXIF_IFD_COUNT)
181
182 #ifdef __cplusplus
183 }
184 #endif /* __cplusplus */
185
186 #endif /* __EXIF_ENTRY_H__ */
_ExifEntry::components
unsigned long components
Number of elements in the array, if this is an array entry.
Definition: exif-entry.h:52
ExifRational
EXIF Unsigned Rational data type.
Definition: exif-utils.h:60
_ExifEntry
Data found in one EXIF tag.
Definition: exif-entry.h:43
ExifFormat
ExifFormat
EXIF tag data formats.
Definition: exif-format.h:32
_ExifEntry::tag
ExifTag tag
EXIF tag for this entry.
Definition: exif-entry.h:45
_ExifEntry::priv
ExifEntryPrivate * priv
Internal data to be used by libexif itself.
Definition: exif-entry.h:68
exif_format_get_name
const char * exif_format_get_name(ExifFormat format)
Return a textual representation of the given EXIF data type.
Definition: exif-format.c:53
exif_data_get_byte_order
ExifByteOrder exif_data_get_byte_order(ExifData *data)
Return the byte order in use by this EXIF structure.
Definition: exif-data.c:1148
exif_get_srational
ExifSRational exif_get_srational(const unsigned char *b, ExifByteOrder order)
Retrieve an ExifSRational value from memory.
Definition: exif-utils.c:177
exif_entry_ref
void exif_entry_ref(ExifEntry *entry)
Increase reference counter for ExifEntry.
Definition: exif-entry.c:137
exif_mem_new_default
ExifMem * exif_mem_new_default(void)
Create a new ExifMem with default values for your convenience.
Definition: exif-mem.c:95
ExifTag
ExifTag
EXIF tags.
Definition: exif-tag.h:34
_ExifEntry::data
unsigned char * data
Pointer to the raw EXIF data for this entry.
Definition: exif-entry.h:57
ExifLog
struct _ExifLog ExifLog
State maintained by the logging interface.
Definition: exif-log.h:34
_ExifContent
Definition: exif-content.h:41
exif_entry_get_value
const char * exif_entry_get_value(ExifEntry *entry, char *val, unsigned int maxlen)
Return a localized textual representation of the value of the EXIF entry.
Definition: exif-entry.c:834
exif_content_get_entry
ExifEntry * exif_content_get_entry(ExifContent *content, ExifTag tag)
Return the ExifEntry in this IFD corresponding to the given tag.
Definition: exif-content.c:202
ExifShort
uint16_t ExifShort
EXIF Unsigned Short data type.
Definition: exif-utils.h:48
exif_get_long
ExifLong exif_get_long(const unsigned char *b, ExifByteOrder order)
Retrieve an ExifLong value from memory.
Definition: exif-utils.c:165
exif-entry.h
Handling EXIF entries.
ExifSRational
EXIF Signed Rational data type.
Definition: exif-utils.h:65
exif_tag_get_name_in_ifd
const char * exif_tag_get_name_in_ifd(ExifTag tag, ExifIfd ifd)
Return a textual name of the given tag when found in the given IFD.
Definition: exif-tag.c:1001
exif-utils.h
EXIF data manipulation functions and types.
exif_mem_unref
void exif_mem_unref(ExifMem *)
Unrefcount an ExifMem.
Definition: exif-mem.c:61
exif_entry_free
void exif_entry_free(ExifEntry *entry)
Actually free the ExifEntry.
Definition: exif-entry.c:155
_ExifEntry::parent
ExifContent * parent
ExifContent containing this entry.
Definition: exif-entry.h:65
ExifSLong
int32_t ExifSLong
EXIF Signed Long data type.
Definition: exif-utils.h:57
ExifSShort
int16_t ExifSShort
EXIF Signed Short data type.
Definition: exif-utils.h:51
exif_set_srational
void exif_set_srational(unsigned char *b, ExifByteOrder order, ExifSRational value)
Store an ExifSRational value into memory in EXIF format.
Definition: exif-utils.c:208
exif_get_rational
ExifRational exif_get_rational(const unsigned char *b, ExifByteOrder order)
Retrieve an ExifRational value from memory.
Definition: exif-utils.c:188
exif-content.h
Handling EXIF IFDs.
exif_entry_unref
void exif_entry_unref(ExifEntry *entry)
Decrease reference counter for ExifEntry.
Definition: exif-entry.c:145
exif_entry_fix
void exif_entry_fix(ExifEntry *entry)
Fix the type or format of the given EXIF entry to bring it into spec.
Definition: exif-entry.c:203
exif_entry_initialize
void exif_entry_initialize(ExifEntry *e, ExifTag tag)
Initialize an empty ExifEntry with default data in the correct format for the given tag.
Definition: exif-entry.c:1411
ExifByte
unsigned char ExifByte
EXIF Unsigned Byte data type.
Definition: exif-utils.h:39
_ExifEntry::format
ExifFormat format
Type of data in this entry.
Definition: exif-entry.h:48
_ExifContent::parent
ExifData * parent
Data containing this content.
Definition: exif-content.h:46
exif-format.h
Handling native EXIF data types.
exif_convert_utf16_to_utf8
void exif_convert_utf16_to_utf8(char *out, const unsigned char *in, int maxlen)
This function converts rather UCS-2LE than UTF-16 to UTF-8.
Definition: exif-utils.c:220
exif_format_get_size
unsigned char exif_format_get_size(ExifFormat format)
Return the raw size of the given EXIF data type.
Definition: exif-format.c:66
exif_entry_new
ExifEntry * exif_entry_new(void)
Reserve memory for and initialize a new ExifEntry.
Definition: exif-entry.c:109
exif_get_short
ExifShort exif_get_short(const unsigned char *b, ExifByteOrder order)
Retrieve an ExifShort value from memory.
Definition: exif-utils.c:102
exif_entry_new_mem
ExifEntry * exif_entry_new_mem(ExifMem *)
Reserve memory for and initialize new ExifEntry using the specified memory allocator.
Definition: exif-entry.c:120
ExifByteOrder
ExifByteOrder
Which byte order to use.
Definition: exif-byte-order.h:31
exif_entry_get_ifd
#define exif_entry_get_ifd(e)
Return the IFD number of the given ExifEntry.
Definition: exif-entry.h:180
ExifMem
struct _ExifMem ExifMem
ExifMem define a memory allocator.
Definition: exif-mem.h:57
exif-mem.h
Define the ExifMem data type and the associated functions.
_ExifEntry::size
unsigned int size
Number of bytes in the buffer at data.
Definition: exif-entry.h:61
exif_entry_dump
void exif_entry_dump(ExifEntry *entry, unsigned int indent)
Dump text representation of ExifEntry to stdout.
Definition: exif-entry.c:596
ExifLong
uint32_t ExifLong
EXIF Unsigned Long data type.
Definition: exif-utils.h:54
_ExifData
Represents the entire EXIF data found in an image.
Definition: exif-data.h:47
_ExifData::ifd
ExifContent * ifd[EXIF_IFD_COUNT]
Data for each IFD.
Definition: exif-data.h:49
exif_get_slong
ExifSLong exif_get_slong(const unsigned char *b, ExifByteOrder order)
Retrieve an ExifSLong value from memory.
Definition: exif-utils.c:130
exif_mem_ref
void exif_mem_ref(ExifMem *)
Refcount an ExifMem.
Definition: exif-mem.c:54
exif_set_rational
void exif_set_rational(unsigned char *b, ExifByteOrder order, ExifRational value)
Store an ExifRational value into memory in EXIF format.
Definition: exif-utils.c:199
exif_set_short
void exif_set_short(unsigned char *b, ExifByteOrder order, ExifShort value)
Store an ExifShort value into memory in EXIF format.
Definition: exif-utils.c:124
exif_get_sshort
ExifSShort exif_get_sshort(const unsigned char *b, ExifByteOrder order)
Retrieve an ExifSShort value from memory.
Definition: exif-utils.c:87