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#pragma once
24
25#include "common/geo.h"
26#include <glib.h>
27#include <sqlite3.h>
28#include <stdint.h>
29
37
44
52
59
60typedef struct dt_map_location_t
61{
62 guint id;
63 gchar *tag;
64 guint count;
66
67// create a new location
68guint dt_map_location_new(const char *const name);
69
70// remove a location
71void dt_map_location_delete(const guint locid);
72
73// rename a location
74void dt_map_location_rename(const guint locid, const char *const name);
75
76// does the location name already exist
77gboolean dt_map_location_name_exists(const char *const name);
78
79// gets location's images number
80int dt_map_location_get_images_count(const guint locid);
81
82// retrieve list of tags which are on that path
83// to be freed with dt_map_location_free_result()
84GList *dt_map_location_get_locations_by_path(const gchar *path,
85 const gboolean remove_root);
86
87// retrieve list of locations which are on the map
88// to be freed with g_list_free_full(list, dt_free_gpointer)
90
91// free map location list
92void dt_map_location_free_result(GList **result);
93
94// sort the tag list considering the '|' character
95GList *dt_map_location_sort(GList *tags);
96
97// get location's data
99
100// set locations's data
101void dt_map_location_set_data(const guint locid, const dt_map_location_data_t *g);
102
103// find locations which match with that image
104GList *dt_map_location_find_locations(const int32_t imgid);
105
106// update image's locations - remove old ones and add new ones
107void dt_map_location_update_locations(const int32_t imgid, const GList *tags);
108
109// update location's images - remove old ones and add new ones
111
112// return root tag for location geotagging
114
115// tell if the point (lon, lat) belongs to location
116gboolean dt_map_location_included(const float lon, const float lat,
118
119// get the map box containing the polygon + flat polygons
120GList *dt_map_location_convert_polygons(void *polygons, dt_map_box_t *bbox, int *nb_pts);
121
122// get the polygons for the given location
124
125// free flat polygons
127
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
const float g
Definition colorspaces_inline_conversions.h:925
char * name
Definition common/metadata.c:61
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)
Definition common/map_locations.c:310
GList * dt_map_location_get_locations_by_path(const gchar *path, const gboolean remove_root)
Definition common/map_locations.c:112
void dt_map_location_update_locations(const int32_t imgid, const GList *tags)
Definition common/map_locations.c:521
dt_map_location_data_t * dt_map_location_get_data(const guint locid)
Definition common/map_locations.c:331
dt_map_locations_action_t
Definition map_locations.h:39
@ MAP_LOCATION_ACTION_UPDATE_OTHERS
Definition map_locations.h:41
@ MAP_LOCATION_ACTION_REMOVE
Definition map_locations.h:40
@ MAP_LOCATION_ACTION_MAX
Definition map_locations.h:42
const char * dt_map_location_data_tag_root()
Definition common/map_locations.c:603
gboolean dt_map_location_update_images(dt_location_draw_t *ld)
Definition common/map_locations.c:567
void dt_map_location_free_result(GList **result)
Definition common/map_locations.c:292
GList * dt_map_location_convert_polygons(void *polygons, dt_map_box_t *bbox, int *nb_pts)
Definition common/map_locations.c:627
void dt_map_location_set_data(const guint locid, const dt_map_location_data_t *g)
Definition common/map_locations.c:363
dt_map_locations_type_t
Definition map_locations.h:31
@ MAP_LOCATION_SHAPE_POLYGONS
Definition map_locations.h:34
@ MAP_LOCATION_SHAPE_MAX
Definition map_locations.h:35
@ MAP_LOCATION_SHAPE_RECTANGLE
Definition map_locations.h:33
@ MAP_LOCATION_SHAPE_ELLIPSE
Definition map_locations.h:32
void dt_map_location_delete(const guint locid)
Definition common/map_locations.c:45
void dt_map_location_get_polygons(dt_location_draw_t *ld)
Definition common/map_locations.c:211
gboolean dt_map_location_included(const float lon, const float lat, dt_map_location_data_t *g)
Definition common/map_locations.c:609
void dt_map_location_free_polygons(dt_location_draw_t *ld)
Definition common/map_locations.c:239
void dt_map_location_rename(const guint locid, const char *const name)
Definition common/map_locations.c:67
GList * dt_map_location_find_locations(const int32_t imgid)
Definition common/map_locations.c:395
gboolean dt_map_location_name_exists(const char *const name)
Definition common/map_locations.c:84
int dt_map_location_get_images_count(const guint locid)
Definition common/map_locations.c:93
guint dt_map_location_new(const char *const name)
Definition common/map_locations.c:35
GList * dt_map_location_get_locations_on_map(const dt_map_box_t *const bbox)
Definition common/map_locations.c:169
Definition map_locations.h:54
dt_map_location_data_t data
Definition map_locations.h:56
guint id
Definition map_locations.h:55
void * location
Definition map_locations.h:57
Definition geo.h:39
Definition map_locations.h:46
double delta1
Definition map_locations.h:47
double ratio
Definition map_locations.h:47
int shape
Definition map_locations.h:48
double delta2
Definition map_locations.h:47
double lat
Definition map_locations.h:47
int plg_pts
Definition map_locations.h:50
double lon
Definition map_locations.h:47
GList * polygons
Definition map_locations.h:49
Definition map_locations.h:61
guint id
Definition map_locations.h:62
guint count
Definition map_locations.h:64
gchar * tag
Definition map_locations.h:63