Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
gpx.h
Go to the documentation of this file.
1/*
2 This file is part of darktable,
3 Copyright (C) 2010-2011 Henrik Andersson.
4 Copyright (C) 2010 johannes hanika.
5 Copyright (C) 2015-2016 Roman Lebedev.
6 Copyright (C) 2016 Tobias Ellinghaus.
7 Copyright (C) 2019-2021 Pascal Obry.
8 Copyright (C) 2021 Paolo Benvenuto.
9 Copyright (C) 2021 Philippe Weyland.
10 Copyright (C) 2022 Martin Baƙinka.
11
12 darktable is free software: you can redistribute it and/or modify
13 it under the terms of the GNU General Public License as published by
14 the Free Software Foundation, either version 3 of the License, or
15 (at your option) any later version.
16
17 darktable is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 GNU General Public License for more details.
21
22 You should have received a copy of the GNU General Public License
23 along with darktable. If not, see <http://www.gnu.org/licenses/>.
24*/
25
26#pragma once
27
28#include <glib.h>
29#include "common/image.h"
30
31#define EARTH_RADIUS 6378100.0 /* in meters */
32#define DT_MINIMUM_DISTANCE_FOR_GEODESIC 100000.0 /* in meters */
33#define DT_MINIMUM_ANGULAR_DELTA_FOR_GEODESIC 1.0
34/* DT_MINIMUM_ANGULAR_DELTA_FOR_GEODESIC is in degrees, and is used for longitude and latitude
35 0.1 degress ~ 10 km on the earth surface */
36
37struct dt_gpx_t;
38
40{
42 GDateTime *time;
43 uint32_t segid;
45
55
56/* loads and parses a gpx track file */
57struct dt_gpx_t *dt_gpx_new(const gchar *filename);
58void dt_gpx_destroy(struct dt_gpx_t *gpx);
59
60/* fetch the lon,lat coords for time t, if within time range
61 of gpx record return TRUE, FALSE is returned if out of time frame
62 and closest record of lon,lat is filled */
63gboolean dt_gpx_get_location(struct dt_gpx_t *, GDateTime *timestamp, dt_image_geoloc_t *geoloc);
64
65// get the list of track segments
66GList *dt_gpx_get_trkseg(struct dt_gpx_t *gpx);
67
68// get the list of track points for a track segment
69GList *dt_gpx_get_trkpts(struct dt_gpx_t *gpx, const guint segid);
70
71// get the distance on the geodesic line and the angle delta referred to earth center
72void dt_gpx_geodesic_distance(double lat1, double lon1,
73 double lat2, double lon2,
74 double *d, double *delta);
75
76/* get the intermediate point (lat, lon) on the geodesic line between point 1 and point 2
77 which form an angle delta (calculated by dt_gpx_geodesic_distance)
78 corresponding to fraction f
79 boolean first_time is in order to reduce unnecessary calculations */
80void dt_gpx_geodesic_intermediate_point(const double lat1, const double lon1,
81 const double lat2, const double lon2,
82 const double delta,
83 const gboolean first_time,
84 double f,
85 double *lat, double *lon);
86
87
88// clang-format off
89// modelines: These editor modelines have been set for all relevant files by tools/update_modelines.py
90// vim: shiftwidth=2 expandtab tabstop=2 cindent
91// kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-spaces modified;
92// clang-format on
93
const dt_aligned_pixel_t f
Definition colorspaces_inline_conversions.h:256
const float d
Definition colorspaces_inline_conversions.h:931
const float delta
Definition colorspaces_inline_conversions.h:722
void dt_gpx_destroy(struct dt_gpx_t *gpx)
Definition gpx.c:152
GList * dt_gpx_get_trkpts(struct dt_gpx_t *gpx, const guint segid)
Definition gpx.c:446
struct dt_gpx_t * dt_gpx_new(const gchar *filename)
Definition gpx.c:88
gboolean dt_gpx_get_location(struct dt_gpx_t *, GDateTime *timestamp, dt_image_geoloc_t *geoloc)
Definition gpx.c:170
void dt_gpx_geodesic_intermediate_point(const double lat1, const double lon1, const double lat2, const double lon2, const double delta, const gboolean first_time, double f, double *lat, double *lon)
Definition gpx.c:491
GList * dt_gpx_get_trkseg(struct dt_gpx_t *gpx)
Definition gpx.c:441
void dt_gpx_geodesic_distance(double lat1, double lon1, double lat2, double lon2, double *d, double *delta)
Definition gpx.c:470
float lat
Definition location.c:3
float lon
Definition location.c:2
Definition gpx.c:48
uint32_t segid
Definition gpx.c:58
Definition gpx.h:40
gdouble longitude
Definition gpx.h:41
GDateTime * time
Definition gpx.h:42
gdouble elevation
Definition gpx.h:41
uint32_t segid
Definition gpx.h:43
gdouble latitude
Definition gpx.h:41
Definition gpx.h:47
char * name
Definition gpx.h:51
dt_gpx_track_point_t * trkpt
Definition gpx.h:52
GDateTime * start_dt
Definition gpx.h:49
GDateTime * end_dt
Definition gpx.h:50
uint32_t nb_trkpt
Definition gpx.h:53
guint id
Definition gpx.h:48
Definition common/image.h:240