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) 2010-2021 darktable developers.
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
19#pragma once
20
21#include "common/geo.h"
22#include <glib.h>
23#include <sqlite3.h>
24#include <stdint.h>
25
33
40
48
55
56typedef struct dt_map_location_t
57{
58 guint id;
59 gchar *tag;
60 guint count;
62
63// create a new location
64guint dt_map_location_new(const char *const name);
65
66// remove a location
67void dt_map_location_delete(const guint locid);
68
69// rename a location
70void dt_map_location_rename(const guint locid, const char *const name);
71
72// does the location name already exist
73gboolean dt_map_location_name_exists(const char *const name);
74
75// gets location's images number
76int dt_map_location_get_images_count(const guint locid);
77
78// retrieve list of tags which are on that path
79// to be freed with dt_map_location_free_result()
80GList *dt_map_location_get_locations_by_path(const gchar *path,
81 const gboolean remove_root);
82
83// retrieve list of locations which are on the map
84// to be freed with g_list_free_full(list, g_free)
86
87// free map location list
88void dt_map_location_free_result(GList **result);
89
90// sort the tag list considering the '|' character
91GList *dt_map_location_sort(GList *tags);
92
93// get location's data
95
96// set locations's data
97void dt_map_location_set_data(const guint locid, const dt_map_location_data_t *g);
98
99// find locations which match with that image
100GList *dt_map_location_find_locations(const int32_t imgid);
101
102// update image's locations - remove old ones and add new ones
103void dt_map_location_update_locations(const int32_t imgid, const GList *tags);
104
105// update location's images - remove old ones and add new ones
107
108// return root tag for location geotagging
110
111// tell if the point (lon, lat) belongs to location
112gboolean dt_map_location_included(const float lon, const float lat,
114
115// get the map box containing the polygon + flat polygons
116GList *dt_map_location_convert_polygons(void *polygons, dt_map_box_t *bbox, int *nb_pts);
117
118// get the polygons for the given location
120
121// free flat polygons
123
124
125// clang-format off
126// modelines: These editor modelines have been set for all relevant files by tools/update_modelines.py
127// vim: shiftwidth=2 expandtab tabstop=2 cindent
128// kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-spaces modified;
129// clang-format on
char * name
Definition common/metadata.c:41
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:303
GList * dt_map_location_get_locations_by_path(const gchar *path, const gboolean remove_root)
Definition common/map_locations.c:107
void dt_map_location_update_locations(const int32_t imgid, const GList *tags)
Definition common/map_locations.c:514
dt_map_location_data_t * dt_map_location_get_data(const guint locid)
Definition common/map_locations.c:324
dt_map_locations_action_t
Definition map_locations.h:35
@ MAP_LOCATION_ACTION_UPDATE_OTHERS
Definition map_locations.h:37
@ MAP_LOCATION_ACTION_REMOVE
Definition map_locations.h:36
@ MAP_LOCATION_ACTION_MAX
Definition map_locations.h:38
const char * dt_map_location_data_tag_root()
Definition common/map_locations.c:593
gboolean dt_map_location_update_images(dt_location_draw_t *ld)
Definition common/map_locations.c:559
void dt_map_location_free_result(GList **result)
Definition common/map_locations.c:286
GList * dt_map_location_convert_polygons(void *polygons, dt_map_box_t *bbox, int *nb_pts)
Definition common/map_locations.c:617
void dt_map_location_set_data(const guint locid, const dt_map_location_data_t *g)
Definition common/map_locations.c:356
dt_map_locations_type_t
Definition map_locations.h:27
@ MAP_LOCATION_SHAPE_POLYGONS
Definition map_locations.h:30
@ MAP_LOCATION_SHAPE_MAX
Definition map_locations.h:31
@ MAP_LOCATION_SHAPE_RECTANGLE
Definition map_locations.h:29
@ MAP_LOCATION_SHAPE_ELLIPSE
Definition map_locations.h:28
void dt_map_location_delete(const guint locid)
Definition common/map_locations.c:40
void dt_map_location_get_polygons(dt_location_draw_t *ld)
Definition common/map_locations.c:206
gboolean dt_map_location_included(const float lon, const float lat, dt_map_location_data_t *g)
Definition common/map_locations.c:599
void dt_map_location_free_polygons(dt_location_draw_t *ld)
Definition common/map_locations.c:234
void dt_map_location_rename(const guint locid, const char *const name)
Definition common/map_locations.c:62
GList * dt_map_location_find_locations(const int32_t imgid)
Definition common/map_locations.c:388
gboolean dt_map_location_name_exists(const char *const name)
Definition common/map_locations.c:79
int dt_map_location_get_images_count(const guint locid)
Definition common/map_locations.c:88
guint dt_map_location_new(const char *const name)
Definition common/map_locations.c:30
GList * dt_map_location_get_locations_on_map(const dt_map_box_t *const bbox)
Definition common/map_locations.c:164
Definition map_locations.h:50
dt_map_location_data_t data
Definition map_locations.h:52
guint id
Definition map_locations.h:51
void * location
Definition map_locations.h:53
Definition geo.h:36
Definition map_locations.h:42
double delta1
Definition map_locations.h:43
double ratio
Definition map_locations.h:43
int shape
Definition map_locations.h:44
double delta2
Definition map_locations.h:43
double lat
Definition map_locations.h:43
int plg_pts
Definition map_locations.h:46
double lon
Definition map_locations.h:43
GList * polygons
Definition map_locations.h:45
Definition map_locations.h:57
guint id
Definition map_locations.h:58
guint count
Definition map_locations.h:60
gchar * tag
Definition map_locations.h:59