LibexifCustomMakernotes.h
Go to the documentation of this file.
1 // SPDX-License-Identifier: BSD-3-Clause
2 // SPDX-FileCopyrightText: Czech Technical University in Prague
3 
10 #pragma once
11 
12 #include <functional>
13 #include <memory>
14 #include <string>
15 #include <unordered_map>
16 
17 #include <libexif/exif-data.h>
18 #include <libexif/exif-mnote-data.h>
19 
20 // A few struct definitions from libexif had to be copied here because they are defined in headers which are not
21 // installed. libexif is issued under LGPL, but I hope just copying the structs (aka API) does not necessarily mean
22 // this whole would need to be under LGPL.
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif /* __cplusplus */
27 
28 #include <libexif/exif-byte-order.h>
29 #include <libexif/exif-log.h>
30 
33 
36  /* Life cycle */
37  void (* free) (ExifMnoteData *); // NOLINT
38 
39  /* Modification */
40  void (* save) (ExifMnoteData *, unsigned char **, unsigned int *); // NOLINT
41  void (* load) (ExifMnoteData *, const unsigned char *, unsigned int); // NOLINT
42  void (* set_offset) (ExifMnoteData *, unsigned int); // NOLINT
43  void (* set_byte_order) (ExifMnoteData *, ExifByteOrder); // NOLINT
44 
45  /* Query */
46  unsigned int (* count) (ExifMnoteData *); // NOLINT
47  unsigned int (* get_id) (ExifMnoteData *, unsigned int); // NOLINT
48  const char * (* get_name) (ExifMnoteData *, unsigned int); // NOLINT
49  const char * (* get_title) (ExifMnoteData *, unsigned int); // NOLINT
50  const char * (* get_description) (ExifMnoteData *, unsigned int); // NOLINT
51  char * (* get_value) (ExifMnoteData *, unsigned int, char *val, unsigned int maxlen); // NOLINT
52 };
53 
55 typedef struct _ExifMnoteDataPriv ExifMnoteDataPriv;
56 
59 {
61 
63 
64  /* Logging */
65  ExifLog *log;
66 
67  /* Memory management */
68  ExifMem *mem;
69 };
70 
72 void exif_mnote_data_construct (ExifMnoteData *, ExifMem *mem); // NOLINT
73 
75 void exif_mnote_data_set_byte_order (ExifMnoteData *, ExifByteOrder); // NOLINT
76 
78 void exif_mnote_data_set_offset (ExifMnoteData *, unsigned int); // NOLINT
79 
80 #ifdef __cplusplus
81 }
82 #endif /* __cplusplus */
83 
84 namespace movie_publisher
85 {
90 {
97  std::function<int(const ::ExifData* exifData, const ::ExifEntry* exifEntry)> identify;
98 
103  std::function<::ExifMnoteData*(::ExifMem* mem)> create;
104 };
105 
110 {
111 public:
113 
115  std::unordered_map<std::string, LibexifCustomMakerNote> customMakerNotes;
116 };
117 
118 }
_ExifMnoteDataMethods::free
void(* free)(ExifMnoteData *)
Definition: LibexifCustomMakernotes.h:37
movie_publisher::LibexifCustomMakernotes::customMakerNotes
std::unordered_map< std::string, LibexifCustomMakerNote > customMakerNotes
All registered custom MakerNote parsers.
Definition: LibexifCustomMakernotes.h:115
_ExifMnoteData::priv
ExifMnoteDataPriv * priv
Definition: LibexifCustomMakernotes.h:60
exif_mnote_data_set_byte_order
void exif_mnote_data_set_byte_order(ExifMnoteData *, ExifByteOrder)
ExifMnoteDataPriv
struct _ExifMnoteDataPriv ExifMnoteDataPriv
Definition: LibexifCustomMakernotes.h:55
_ExifMnoteDataMethods::save
void(* save)(ExifMnoteData *, unsigned char **, unsigned int *)
Definition: LibexifCustomMakernotes.h:40
movie_publisher::LibexifCustomMakernotes::LibexifCustomMakernotes
LibexifCustomMakernotes()
_ExifMnoteDataMethods::set_byte_order
void(* set_byte_order)(ExifMnoteData *, ExifByteOrder)
Definition: LibexifCustomMakernotes.h:43
_ExifMnoteData::methods
ExifMnoteDataMethods methods
Definition: LibexifCustomMakernotes.h:62
movie_publisher::LibexifCustomMakerNote
Description of a custom MakerNote parser for one vendor.
Definition: LibexifCustomMakernotes.h:89
_ExifMnoteData
Definition: LibexifCustomMakernotes.h:58
exif_mnote_data_construct
void exif_mnote_data_construct(ExifMnoteData *, ExifMem *mem)
int
int
_ExifMnoteData::log
ExifLog * log
Definition: LibexifCustomMakernotes.h:65
movie_publisher::LibexifCustomMakerNote::identify
std::function< int(const ::ExifData *exifData, const ::ExifEntry *exifEntry)> identify
Function that identifies the MakerNote.
Definition: LibexifCustomMakernotes.h:97
exif_mnote_data_set_offset
void exif_mnote_data_set_offset(ExifMnoteData *, unsigned int)
_ExifMnoteDataMethods::set_offset
void(* set_offset)(ExifMnoteData *, unsigned int)
Definition: LibexifCustomMakernotes.h:42
movie_publisher
_ExifMnoteDataMethods::load
void(* load)(ExifMnoteData *, const unsigned char *, unsigned int)
Definition: LibexifCustomMakernotes.h:41
_ExifMnoteDataMethods
Definition: LibexifCustomMakernotes.h:35
_ExifMnoteData::mem
ExifMem * mem
Definition: LibexifCustomMakernotes.h:68
movie_publisher::LibexifCustomMakerNote::create
std::function<::ExifMnoteData *(::ExifMem *mem)> create
Create a new instance of the custom MakerNote.
Definition: LibexifCustomMakernotes.h:103
movie_publisher::LibexifCustomMakernotes
Container of all implemented custom MakerNote parsers.
Definition: LibexifCustomMakernotes.h:109
_ExifMnoteDataMethods::get_id
unsigned int(* get_id)(ExifMnoteData *, unsigned int)
Definition: LibexifCustomMakernotes.h:47
_ExifMnoteDataMethods::count
unsigned int(* count)(ExifMnoteData *)
Definition: LibexifCustomMakernotes.h:46


libexif_metadata_extractor
Author(s): Martin Pecka
autogenerated on Fri Apr 4 2025 02:06:52