-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
36 lines (33 loc) · 974 Bytes
/
main.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
#include <iostream>
#include "HdlEngine.h"
#include <sys/time.h>
using namespace std;
int main(int argc, char** argv)
{
if (argc < 3)
{
cout << "Error: too few arguments'" << endl
<< "./Usage: HdlEngine 'hdl_file' 'output_dir'" << endl;
return -1;
}
struct timeval start, end;
gettimeofday(&start, NULL);
// for(int i = 0; i < 101; ++i){
// hdlEngine.processNextFrame();
// }
int count = 0;
#ifdef OFFLINE
HdlEngine hdlEngine(argv[1]);
while(hdlEngine.processNextFrame()){++count;}
hdlEngine.write3bPng("final-3b.png");
hdlEngine.saveLocalMap("final.png");
#else
HdlEngine hdlEngine;
hdlEngine.processNextFrame();
#endif
gettimeofday(&end, NULL);
long useconds = end.tv_usec - start.tv_usec;
long seconds = end.tv_sec - start.tv_sec;
DLOG(INFO) << "Time to process all frame: " << seconds<<"s, "<<useconds<<"microseconds";
return 0;
}