-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathCheckpointWriter.h
34 lines (28 loc) · 1.05 KB
/
CheckpointWriter.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
#ifndef CHECKPOINT_WRITER_H
#define CHECKPOINT_WRITER_H
#include <iostream>
#include <fstream>
#include <stdio.h>
#include <stdlib.h>
#include "toojpeg.h"
#include "TelemetryPoint.h"
#include "LocalizedOrigin.h"
#include "MapPoint.h"
#include <math.h>
#include <mutex> // std::mutex, std::unique_lock
using namespace std;
class CheckpointWriter
{
public:
static void checkpoint(const string prefix, int32_t width, int32_t height, TelemetryPoint scan_data[], int scan_size, MapPoint map[], LocalizedOrigin *location);
static void checkpoint(const string prefix, int32_t width, int32_t height, TelemetryPoint scan_data[], int scan_size, int map_size, MapPoint *map, LocalizedOrigin *location);
static void advanceCheckpoint();
private:
static int _checkpoint_num;
static mutex jpeg_mutex;
static ofstream jpeg;
static const int channels = 3;
static void writeJpegByte(unsigned char oneByte);
static void addScanData(unsigned char *pixels, int width, int height, int x, int y, int r, int g, int b, int quality, int pad = 4);
};
#endif