File: correlate.h

package info (click to toggle)
gpscorrelate 1.6.1-7
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 936 kB
  • sloc: ansic: 1,781; cpp: 440; makefile: 61
file content (82 lines) | stat: -rw-r--r-- 2,888 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/* correlate.h
 * Written by Daniel Foote.
 * Started Feb 2005.
 *
 * This file contains the options structure and prototypes for
 * functions in correlate.c.
 */

/* Copyright 2005 Daniel Foote.
 *
 * This file is part of gpscorrelate.
 *
 * gpscorrelate is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * gpscorrelate is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with gpscorrelate; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

/* A structure of options to pass to the correlate function.
 * Not really sure if this is needed, but... */
struct CorrelateOptions {
	int NoWriteExif;
	int OverwriteExisting;
	int NoInterpolate;
	int NoChangeMtime;
	int TimeZoneHours;  /* To add to photos to make them UTC. */
	int TimeZoneMins;
	int FeatherTime;
	char* Datum;     /* Datum of the data; when writing. */
	int DoBetweenTrkSeg; /* Match between track segments. */
	int DegMinSecs;   /* Write out data as DD MM SS.SS (more accurate than in the past) */
	
	int Result;

	time_t MinTime;  /* Calculated on first pass. Used to   */
	time_t MaxTime;  /* determine when to throw photos out. */

	int PhotoOffset; /* Offset applied to Photo time. This is ADDED to PHOTO TIME
			    to make it match GPS time. In seconds. 
			    This is (GPS - Photo) */

	struct GPSPoint* Points; /* Points to use... */
};

/* Return codes in order:
 * _OK - all ok. Correlated exactly.
 * _INTERPOLATED - all ok, interpolated point.
 * _ROUND - point rounded to nearest.
 * _NOMATCH - could not find a match - photo timestamp outside GPS data
 * 	(This could be due to timezone of photos not set/set wrong).
 *      Returns NULL for Point.
 * _TOOFAR - point outside "feather" time. Too far from any point.
 *      Returns NULL for Point.
 * _EXIFWRITEFAIL - unable to write EXIF tags.
 * _NOEXIFINPUT - The source file contained no EXIF tags, or not the one we wanted. Hmm.
 *      Returns NULL for Point.
 * _GPSDATAEXISTS - There is already GPS data in the photo... you probably don't want
 *      to fiddle with it.
 *      Returns NULL for Point.
 */
#define CORR_OK             1
#define CORR_INTERPOLATED   2
#define CORR_ROUND          3
#define CORR_NOMATCH        4
#define CORR_TOOFAR         5
#define CORR_EXIFWRITEFAIL  6
#define CORR_NOEXIFINPUT    7
#define CORR_GPSDATAEXISTS  8


struct GPSPoint* CorrelatePhoto(char* Filename, 
		struct CorrelateOptions* Options);