-
Notifications
You must be signed in to change notification settings - Fork 0
/
DataTypes.h
59 lines (48 loc) · 1.61 KB
/
DataTypes.h
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
#pragma once
#include "ExifUtils.h"
#include <unordered_map>
#include <vector>
#include <string>
extern const double INVALID_GEO_COORD;
// Just represents a latitude/longitude data
struct LatLon
{
double lat;
double lon;
double Distance(const LatLon& other) const;
bool IsValid() const;
};
// Image data collected from the image file
struct ImageData
{
char fileName[36];
char dateTime[36];
LatLon latLon;
double alt;
};
typedef std::vector<ImageData> ImageDataVec;
// Map of date string to the vector of image datas
typedef std::unordered_map<std::string, ImageDataVec> ImageDataMap;
// Just the image info we need in the array of images for a node
struct Image
{
std::string fileName;
std::string dateTime;
Image(const char* fn, const char* dt) : fileName(fn), dateTime(dt) {}
};
// A location with an array of images taken in the vicinity
struct Node {
LatLon latLon;
std::vector<Image> images;
};
struct Day
{
std::string date;
std::vector<LatLon> path;
std::vector<Node> nodes;
};
#include "FindFile.h"
void ProcessImageFile(const FileInfo& fi, ImageDataMap& mapImageData);
bool FillImageData(ImageData &imgData, const FileInfo& fi, unsigned char* tiff, unsigned char* pIFDExif, unsigned char* pIFDGpsInfo);
void FixInvalidGeoCoords(ImageDataMap& mapImageData);
void GenerateDays(std::vector<Day> &vecDays, const ImageDataMap& mapImageData, FileInfoSet &setProcessed);