Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
map_locations.h
Go to the documentation of this file.
1/*
2 This file is part of darktable,
3 Copyright (C) 2020-2021 Philippe Weyland.
4 Copyright (C) 2021 Hubert Kowalski.
5 Copyright (C) 2021 Pascal Obry.
6 Copyright (C) 2022 Martin Bařinka.
7 Copyright (C) 2025 Aurélien PIERRE.
8
9 darktable is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
13
14 darktable is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with darktable. If not, see <http://www.gnu.org/licenses/>.
21*/
22
23#ifndef DT_METADATA_MAP_LOCATIONS_H
24#define DT_METADATA_MAP_LOCATIONS_H
25
26#include "metadata/geo.h"
27#include <glib.h>
28#include <sqlite3.h>
29#include <stdint.h>
30
38
45
53
60
61typedef struct dt_map_location_t
62{
63 guint id;
64 gchar *tag;
65 guint count;
67
68// create a new location
69guint dt_map_location_new(const char *const name);
70
71// remove a location
72void dt_map_location_delete(const guint locid);
73
74// rename a location
75void dt_map_location_rename(const guint locid, const char *const name);
76
77// does the location name already exist
78gboolean dt_map_location_name_exists(const char *const name);
79
80// gets location's images number
81int dt_map_location_get_images_count(const guint locid);
82
83// retrieve list of tags which are on that path
84// to be freed with dt_map_location_free_result()
85GList *dt_map_location_get_locations_by_path(const gchar *path,
86 const gboolean remove_root);
87
88// retrieve list of locations which are on the map
89// to be freed with g_list_free_full(list, dt_free_gpointer)
91
92// free map location list
93void dt_map_location_free_result(GList **result);
94
95// sort the tag list considering the '|' character
96GList *dt_map_location_sort(GList *tags);
97
98// get location's data
100
101// set locations's data
102void dt_map_location_set_data(const guint locid, const dt_map_location_data_t *g);
103
104// find locations which match with that image
105GList *dt_map_location_find_locations(const int32_t imgid);
106
107// update image's locations - remove old ones and add new ones
108void dt_map_location_update_locations(const int32_t imgid, const GList *tags);
109
110// update location's images - remove old ones and add new ones
112
113// return root tag for location geotagging
115
116// tell if the point (lon, lat) belongs to location
117gboolean dt_map_location_included(const float lon, const float lat,
119
120// get the map box containing the polygon + flat polygons
121GList *dt_map_location_convert_polygons(void *polygons, dt_map_box_t *bbox, int *nb_pts);
122
123// get the polygons for the given location
125
126// free flat polygons
128
129#endif // DT_METADATA_MAP_LOCATIONS_H
130
131// clang-format off
132// modelines: These editor modelines have been set for all relevant files by tools/update_modelines.py
133// vim: shiftwidth=2 expandtab tabstop=2 cindent
134// kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-spaces modified;
135// clang-format on
dt_map_box_t bbox
Definition location.c:4
float lat
Definition location.c:3
float lon
Definition location.c:2
GList * dt_map_location_sort(GList *tags)
GList * dt_map_location_get_locations_by_path(const gchar *path, const gboolean remove_root)
void dt_map_location_update_locations(const int32_t imgid, const GList *tags)
dt_map_location_data_t * dt_map_location_get_data(const guint locid)
dt_map_locations_action_t
@ MAP_LOCATION_ACTION_UPDATE_OTHERS
@ MAP_LOCATION_ACTION_REMOVE
@ MAP_LOCATION_ACTION_MAX
const char * dt_map_location_data_tag_root()
gboolean dt_map_location_update_images(dt_location_draw_t *ld)
void dt_map_location_free_result(GList **result)
GList * dt_map_location_convert_polygons(void *polygons, dt_map_box_t *bbox, int *nb_pts)
void dt_map_location_set_data(const guint locid, const dt_map_location_data_t *g)
dt_map_locations_type_t
@ MAP_LOCATION_SHAPE_POLYGONS
@ MAP_LOCATION_SHAPE_MAX
@ MAP_LOCATION_SHAPE_RECTANGLE
@ MAP_LOCATION_SHAPE_ELLIPSE
void dt_map_location_delete(const guint locid)
void dt_map_location_get_polygons(dt_location_draw_t *ld)
gboolean dt_map_location_included(const float lon, const float lat, dt_map_location_data_t *g)
void dt_map_location_free_polygons(dt_location_draw_t *ld)
void dt_map_location_rename(const guint locid, const char *const name)
GList * dt_map_location_find_locations(const int32_t imgid)
gboolean dt_map_location_name_exists(const char *const name)
int dt_map_location_get_images_count(const guint locid)
guint dt_map_location_new(const char *const name)
GList * dt_map_location_get_locations_on_map(const dt_map_box_t *const bbox)
const char * name
Definition pdf.h:90
dt_map_location_data_t data