-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcontour_flt.cpp
49 lines (45 loc) · 1.24 KB
/
contour_flt.cpp
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
#include "contour.h"
#include "PNGImage.h"
#include <fstream>
#include <iostream>
struct HDR {
int ncols;
int nrows;
float xllcorner;
float yllcorner;
float cellsize;
int NODATA_value;
int NODATA;
HDR() =default;
HDR(std::istream &stream) {
using namespace::std;
string key;
while(!stream.eof()) {
stream>>key;
if (key == "ncols") {
stream>>ncols;
} else if (key == "nrows") {
stream>>nrows;
} else if (key == "xllcorner") {
stream>>xllcorner;
} else if (key == "yllcorner") {
stream>>yllcorner;
} else if (key == "cellsize") {
stream>>cellsize;
} else if (key == "NODATA_value") {
stream>>NODATA_value;
} else if (key == "NODATA") {
stream>>NODATA;
} else if (key == "byteorder") {
stream>>key;
if (key != "LSBFIRST") {
throw std::runtime_error("LSBFIRST is the only supported byteorder");
}
}
}
}
};
int main(int argc, char *argv[]) {
std::cerr<<"Not yet implemented\n";
return 0;
}