libopenraw  0.3.7
metadata.h
1 /*
2  * libopenraw - metadata.h
3  *
4  * Copyright (C) 2007-2020 Hubert Figuière
5  *
6  * This library is free software: you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public License
8  * as published by the Free Software Foundation, either version 3 of
9  * the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library. If not, see
18  * <http://www.gnu.org/licenses/>.
19  */
20 
21 
22 #pragma once
23 
24 #include <stdint.h>
25 #include <stdbool.h>
26 
27 #define INCLUDE_EXIF_
28 #include <libopenraw/exif.h>
29 #undef INCLUDE_EXIF_
30 
31 #include <libopenraw/types.h>
32 #include <libopenraw/consts.h>
33 
40 #ifdef __cplusplus
41 extern "C" {
42 #endif
43 
44 typedef struct _MetadataIterator* ORMetadataIteratorRef;
46 typedef struct _MetaValue* ORMetaValueRef;
47 typedef const struct _MetaValue* ORConstMetaValueRef;
50 enum {
51  META_NS_EXIF = (1 << 16),
52  META_NS_TIFF = (2 << 16)
53 };
54 
56 #define META_NS_MASKOUT(x) (x & 0xffff)
58 #define META_INDEX_MASKOUT(x) (x & (0xffff<<16))
59 
66 const char* or_metavalue_get_string(ORConstMetaValueRef value, uint32_t idx);
67 
74 const char* or_metavalue_get_as_string(ORConstMetaValueRef value, bool full);
75 
81 
84 
90 
100 int
102  ORIfdDirRef* ifd, uint16_t* id,
103  ExifTagType* type, ORMetaValueRef* value);
104 
109 
110 #ifdef __cplusplus
111 }
112 #endif
113 
const struct _MetaValue * ORConstMetaValueRef
A const metadata value.
Definition: metadata.h:47
int or_metadata_iterator_get_entry(ORMetadataIteratorRef iterator, ORIfdDirRef *ifd, uint16_t *id, ExifTagType *type, ORMetaValueRef *value)
Get the metadata entry from the iterator.
Definition: metadata.cpp:88
uint32_t or_metavalue_get_count(ORMetaValueRef value)
Get the value count.
Definition: metadata.cpp:57
struct _MetadataIterator * ORMetadataIteratorRef
A metadata iterator.
Definition: metadata.h:44
void or_metadata_iterator_free(ORMetadataIteratorRef iterator)
Free the iterator.
Definition: metadata.cpp:133
void or_metavalue_release(ORMetaValueRef value)
Free the MetaValue.
Definition: metadata.cpp:65
const char * or_metavalue_get_string(ORConstMetaValueRef value, uint32_t idx)
Get the string out of the MetaValue.
Definition: metadata.cpp:39
const char * or_metavalue_get_as_string(ORConstMetaValueRef value, bool full)
Convert the MetaValue to a string.
Definition: metadata.cpp:50
struct _MetaValue * ORMetaValueRef
A metadata value.
Definition: metadata.h:46
int or_metadata_iterator_next(ORMetadataIteratorRef iterator)
Move to the next metadata value.
Definition: metadata.cpp:76
@ META_NS_TIFF
Definition: metadata.h:52
@ META_NS_EXIF
Definition: metadata.h:51
ExifTagType
Definition: exif.h:271
struct _IfdDir * ORIfdDirRef
IfdDir reference.
Definition: types.h:34