Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
metadata_repository.h
Go to the documentation of this file.
1/*
2 This file is part of darktable,
3 Copyright (C) 2026 Aurélien PIERRE.
4
5 darktable is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
9
10 darktable is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with darktable. If not, see <http://www.gnu.org/licenses/>.
17*/
18
35#ifndef DT_DATABASE_METADATA_REPOSITORY_H
36#define DT_DATABASE_METADATA_REPOSITORY_H
37
38#include <glib.h>
39#include <stdint.h>
40
41#ifdef __cplusplus
42extern "C" {
43#endif
44
46
54GList *dt_metadata_repository_get_values(const int32_t imgid, const int keyid);
55
63GList *dt_metadata_repository_get_all(const int32_t imgid);
64
67void dt_metadata_repository_remove(const int32_t imgid, const char *keyid_list);
68
70typedef struct dt_metadata_row_t
71{
72 int32_t imgid;
73 int keyid;
74 const char *value;
76
85void dt_metadata_repository_add(const dt_metadata_row_t *rows, const size_t count);
86
94
96typedef void (*dt_metadata_repository_row_cb)(void *user_data, const int keyid, const char *value);
97
100 void *user_data);
101
104typedef void (*dt_metadata_repository_selected_cb)(void *user_data, const int keyid,
105 const char *value, const uint32_t count);
106
115 void *user_data);
116
119
121
122
123#ifdef __cplusplus
124}
125#endif
126
127#endif // DT_DATABASE_METADATA_REPOSITORY_H
128
129// clang-format off
130// modelines: These editor modelines have been set for all relevant files by tools/update_modelines.py
131// vim: shiftwidth=2 expandtab tabstop=2 cindent
132// kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-spaces modified;
133// clang-format on
typedef void((*dt_cache_allocate_t)(void *userdata, dt_cache_entry_t *entry))
G_BEGIN_DECLS GList * dt_metadata_repository_get_values(const int32_t imgid, const int keyid)
Values stored under keyid, ordered by value.
void dt_metadata_repository_remove(const int32_t imgid, const char *keyid_list)
Delete the rows of imgid whose key is in keyid_list, a comma-separated list of decimal key ids....
GList * dt_metadata_repository_get_all(const int32_t imgid)
Every (key, value) pair of imgid, as a flat list.
void(* dt_metadata_repository_selected_cb)(void *user_data, const int keyid, const char *value, const uint32_t count)
One distinct (key, value) across the selection, and how many selected images carry it.
void dt_metadata_repository_foreach_selected(dt_metadata_repository_selected_cb cb, void *user_data)
Every distinct (key, value) pair across main.selected_images, ordered by value.
void(* dt_metadata_repository_row_cb)(void *user_data, const int keyid, const char *value)
One main.meta_data row: its key id and its value.
void dt_metadata_repository_cleanup(void)
Finalise the prepared statements. See dt_colorlabel_repository_cleanup().
void dt_metadata_repository_foreach(const int32_t imgid, dt_metadata_repository_row_cb cb, void *user_data)
Every metadata row of imgid, in row order.
int32_t dt_metadata_repository_find_image_by_value(const char *value)
The first image carrying value under any key, or -1.
void dt_metadata_repository_add(const dt_metadata_row_t *rows, const size_t count)
Insert count rows as a single multi-VALUES statement.
static const dt_aligned_pixel_simd_t value
Definition simd.h:144