Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
metadata.h
Go to the documentation of this file.
1/*
2 This file is part of darktable,
3 Copyright (C) 2010, 2012 johannes hanika.
4 Copyright (C) 2010, 2014, 2016 Tobias Ellinghaus.
5 Copyright (C) 2011 Henrik Andersson.
6 Copyright (C) 2012 Richard Wonka.
7 Copyright (C) 2019-2020 Pascal Obry.
8 Copyright (C) 2019-2022 Philippe Weyland.
9 Copyright (C) 2020 Aldric Renaudin.
10 Copyright (C) 2020 Chris Elston.
11 Copyright (C) 2021 Hubert Kowalski.
12 Copyright (C) 2022-2023, 2026 Aurélien PIERRE.
13 Copyright (C) 2022 Martin Bařinka.
14 Copyright (C) 2025 Alynx Zhou.
15
16 darktable is free software: you can redistribute it and/or modify
17 it under the terms of the GNU General Public License as published by
18 the Free Software Foundation, either version 3 of the License, or
19 (at your option) any later version.
20
21 darktable is distributed in the hope that it will be useful,
22 but WITHOUT ANY WARRANTY; without even the implied warranty of
23 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 GNU General Public License for more details.
25
26 You should have received a copy of the GNU General Public License
27 along with darktable. If not, see <http://www.gnu.org/licenses/>.
28*/
29
30#ifndef DT_METADATA_METADATA_H
31#define DT_METADATA_METADATA_H
32
33// Types this header's own declarations use. They used to arrive through gui/gtk.h, which
34// this file included without using a single GTK symbol -- and which it then propagated to
35// all 16 of its includers.
36#include <glib.h>
37#include <stdint.h>
38
39
40#ifdef __cplusplus
41extern "C" {
42#endif
43
44typedef enum dt_metadata_t
45{
46 // do change the order. Must match with dt_metadata_def[] in metadata.c.
47 // just add new metadata before DT_METADATA_NUMBER when needed
48 // and this must also be synchronized with the collect.c module (legacy_presets).
60
62{
63 DT_METADATA_TYPE_USER, // metadata for users
64 DT_METADATA_TYPE_OPTIONAL, // metadata hidden by default
65 DT_METADATA_TYPE_INTERNAL // metadata for dt internal usage - the user cannot see it
68
70{
71 DT_METADATA_SIGNAL_SHOWN, // metadata set as shown
72 DT_METADATA_SIGNAL_HIDDEN, // metadata set as hidden
73 DT_METADATA_SIGNAL_NEW_VALUE // metadata value changed
76
78{
79 DT_METADATA_FLAG_HIDDEN = 1 << 0, // metadata set as shown
80 DT_METADATA_FLAG_PRIVATE = 1 << 1, // metadata set as hidden
81 DT_METADATA_FLAG_IMPORTED = 1 << 2 // metadata value changed
84
87
89const char *dt_metadata_get_name_by_display_order(const uint32_t order);
90
93
96
98int dt_metadata_get_type_by_display_order(const uint32_t order);
99
101const char *dt_metadata_get_name(const uint32_t keyid);
102
105
107const char *dt_metadata_get_key(const uint32_t keyid);
108
110const char *dt_metadata_get_subkey(const uint32_t keyid);
111
113const char *dt_metadata_get_key_by_subkey(const char *subkey);
114
116int dt_metadata_get_type(const uint32_t keyid);
117
119void dt_metadata_init();
120
122void dt_metadata_set(int id, const char *key, const char *value, const gboolean undo_on); // duplicate.c, lua/image.c
123
125void dt_metadata_set_import(int id, const char *key, const char *value); // exif.cc, ligthroom.c
126
129void dt_metadata_set_list(const GList *imgs, GList *key_value, const gboolean undo_on); // libs/metadata.c
130
134void dt_metadata_set_list_id(const GList *img, const GList *metadata, const gboolean clear_on,
135 const gboolean undo_on);
139GList *dt_metadata_get(int id, const char *key, uint32_t *count); // exif.cc, variables.c, gallery.c, watermark.c, metadata_view.c, libs/metadata.c, print_settings.c
140
142GList *dt_metadata_get_list_id(int id); // libs/image.c
143
145void dt_metadata_clear(const GList *imgs, const gboolean undo_on); // libs/metadata.c
146
148int dt_metadata_already_imported(const char *filename, const char *datetime);
149
151void dt_metadata_cleanup(void);
152
153#ifdef __cplusplus
154}
155#endif
156
157#endif // DT_METADATA_METADATA_H
158
159// clang-format off
160// modelines: These editor modelines have been set for all relevant files by tools/update_modelines.py
161// vim: shiftwidth=2 expandtab tabstop=2 cindent
162// kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-spaces modified;
163// clang-format on
char * key
int dt_metadata_already_imported(const char *filename, const char *datetime)
void dt_metadata_clear(const GList *imgs, const gboolean undo_on)
void dt_metadata_set_list_id(const GList *img, const GList *metadata, const gboolean clear_on, const gboolean undo_on)
void dt_metadata_set(int id, const char *key, const char *value, const gboolean undo_on)
const char * dt_metadata_get_subkey(const uint32_t keyid)
void dt_metadata_set_import(int id, const char *key, const char *value)
const char * dt_metadata_get_key_by_subkey(const char *subkey)
const char * dt_metadata_get_key(const uint32_t keyid)
void dt_metadata_cleanup(void)
const char * dt_metadata_get_name_by_display_order(const uint32_t order)
dt_metadata_t dt_metadata_get_keyid_by_name(const char *name)
dt_metadata_flag_t
Definition metadata.h:78
@ DT_METADATA_FLAG_IMPORTED
Definition metadata.h:81
@ DT_METADATA_FLAG_HIDDEN
Definition metadata.h:79
@ DT_METADATA_FLAG_PRIVATE
Definition metadata.h:80
dt_metadata_t
Definition metadata.h:45
@ DT_METADATA_XMP_DC_PUBLISHER
Definition metadata.h:50
@ DT_METADATA_XMP_DC_RIGHTS
Definition metadata.h:53
@ DT_METADATA_XMP_ACDSEE_NOTES
Definition metadata.h:54
@ DT_METADATA_XMP_IMAGE_ID
Definition metadata.h:56
@ DT_METADATA_XMP_DC_DESCRIPTION
Definition metadata.h:52
@ DT_METADATA_XMP_VERSION_NAME
Definition metadata.h:55
@ DT_METADATA_XMP_DC_CREATOR
Definition metadata.h:49
@ DT_METADATA_NUMBER
Definition metadata.h:57
@ DT_METADATA_XMP_DC_TITLE
Definition metadata.h:51
void dt_metadata_set_list(const GList *imgs, GList *key_value, const gboolean undo_on)
dt_metadata_t dt_metadata_get_keyid(const char *key)
dt_metadata_type_t
Definition metadata.h:62
@ DT_METADATA_TYPE_OPTIONAL
Definition metadata.h:64
@ DT_METADATA_TYPE_INTERNAL
Definition metadata.h:65
@ DT_METADATA_TYPE_USER
Definition metadata.h:63
const char * dt_metadata_get_name(const uint32_t keyid)
GList * dt_metadata_get(int id, const char *key, uint32_t *count)
dt_metadata_signal_t
Definition metadata.h:70
@ DT_METADATA_SIGNAL_SHOWN
Definition metadata.h:71
@ DT_METADATA_SIGNAL_NEW_VALUE
Definition metadata.h:73
@ DT_METADATA_SIGNAL_HIDDEN
Definition metadata.h:72
GList * dt_metadata_get_list_id(int id)
void dt_metadata_init()
unsigned int dt_metadata_get_nb_user_metadata()
int dt_metadata_get_type_by_display_order(const uint32_t order)
int dt_metadata_get_type(const uint32_t keyid)
dt_metadata_t dt_metadata_get_keyid_by_display_order(const uint32_t order)
const char * name
Definition pdf.h:90
static const dt_aligned_pixel_simd_t value
Definition simd.h:144