![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
main.color_labels: which of the five colour labels are set on an image.
More...
#include <glib.h>#include <stdint.h>
Include dependency graph for colorlabel_repository.h:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Functions | |
| G_BEGIN_DECLS int | dt_colorlabel_repository_get (const int32_t imgid) |
The colours set on imgid, as a bitmask: bit c is set when colour c is. | |
| void | dt_colorlabel_repository_set (const int32_t imgid, const int color) |
Set colour color on imgid. Setting one that is already set does nothing. | |
| void | dt_colorlabel_repository_remove (const int32_t imgid, const int color) |
Clear colour color on imgid. Clearing one that is not set does nothing. | |
| void | dt_colorlabel_repository_remove_all (const int32_t imgid) |
Clear every colour on imgid. | |
| gboolean | dt_colorlabel_repository_has (const int32_t imgid, const int color) |
TRUE when colour color is set on imgid. | |
| GList * | dt_colorlabel_repository_get_list (const int32_t imgid) |
The colours set on imgid, as a list rather than a bitmask. | |
| void | dt_colorlabel_repository_foreach (const int32_t imgid, void(*cb)(void *, const int), void *user_data) |
Every colour label of imgid, one call per row, in the order the rows come back. | |
| void | dt_colorlabel_repository_cleanup (void) |
| Finalise whatever this repository still caches – today, nothing. | |
main.color_labels: which of the five colour labels are set on an image.
One row per (image, colour). common/colorlabels.c owns everything else about colour labels – their names, the undo records, the toggle semantics, the toast – and reaches the table only through here.
Definition in file colorlabel_repository.h.
Finalise whatever this repository still caches – today, nothing.
Every repository has one of these, and the hook is not optional even when it is empty: dt_database_close() runs every repository's cleanup, because a connection cannot be closed out from under a live sqlite3_stmt – that contract is what makes a workspace swap possible, and the repositories that do cache (image, history, style) rely on it.
Definition at line 150 of file colorlabel_repository.c.
Referenced by dt_colorlabels_cleanup(), and testdb_teardown().
| void dt_colorlabel_repository_foreach | ( | const int32_t | imgid, |
| void(*)(void *, const int) | cb, | ||
| void * | user_data | ||
| ) |
Every colour label of imgid, one call per row, in the order the rows come back.
dt_colorlabel_repository_get() folds the same rows into a bitmask, which loses that order. The sidecar writer needs it, because the XMP sequence it builds is compared byte for byte against the file already on disk.
Definition at line 136 of file colorlabel_repository.c.
References dt_database_get_sqlite3_global(), DT_DEBUG_SQLITE3_BIND_INT, DT_DEBUG_SQLITE3_PREPARE_V2, and L.
Referenced by dt_set_xmp_dt_metadata().
| G_BEGIN_DECLS int dt_colorlabel_repository_get | ( | const int32_t | imgid | ) |
The colours set on imgid, as a bitmask: bit c is set when colour c is.
Returns 0 for an image with no labels, which is also what an unknown image returns – the table simply has no rows for it.
Definition at line 39 of file colorlabel_repository.c.
References _prepared(), colors, DT_DEBUG_SQLITE3_BIND_INT, IS_NULL_PTR, and L.
Referenced by dt_colorlabels_get_labels().
The colours set on imgid, as a list rather than a bitmask.
| imgid | the image, or a negative value for every selected image – the convention dt_metadata_get() uses, which is this function's only caller. |
GList of colour indices as GINT_TO_POINTER. Sorted for a single image, in table order across a selection (where duplicates are expected and kept: the caller counts them). Free with g_list_free(). Definition at line 102 of file colorlabel_repository.c.
References dt_database_get_sqlite3_global(), DT_DEBUG_SQLITE3_BIND_INT, DT_DEBUG_SQLITE3_PREPARE_V2, and L.
Referenced by dt_metadata_get().
TRUE when colour color is set on imgid.
Definition at line 83 of file colorlabel_repository.c.
References color, dt_database_get_sqlite3_global(), DT_DEBUG_SQLITE3_BIND_INT, DT_DEBUG_SQLITE3_PREPARE_V2, FALSE, and L.
Referenced by dt_colorlabels_check_label().
Clear colour color on imgid. Clearing one that is not set does nothing.
Definition at line 64 of file colorlabel_repository.c.
References _prepared(), color, DT_DEBUG_SQLITE3_BIND_INT, IS_NULL_PTR, and L.
Referenced by dt_colorlabels_remove_label(), and dt_image_repository_store().
Clear every colour on imgid.
Definition at line 74 of file colorlabel_repository.c.
References _prepared(), DT_DEBUG_SQLITE3_BIND_INT, IS_NULL_PTR, and L.
Referenced by dt_colorlabels_remove_labels().
Set colour color on imgid. Setting one that is already set does nothing.
Definition at line 54 of file colorlabel_repository.c.
References _prepared(), color, DT_DEBUG_SQLITE3_BIND_INT, IS_NULL_PTR, and L.
Referenced by dt_colorlabels_set_label(), and dt_image_repository_store().