-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_compression.cc
35 lines (22 loc) · 746 Bytes
/
test_compression.cc
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"data_compression.h"
#include <iostream>
#include <string>
#include <fstream>
#include <opencv2/opencv.hpp>
#include"image_tools.h"
#include"hansolo_image_msg.h"
int main()
{
hansoloImageTools tool{};
hansolo_imageMsg img= tool.getImage("/home/hansolo/CplusplusLearn/hansolo_toy_core/test/cat2.jpg");
dataCompression compressTool;
auto re = img.data;
auto copy=tool.base64_encode(img.data);
std::cout << copy.length() << ' ' << re.length() << '\n';
compressTool.compressData(copy, re);
std::cout << copy.length() << ' ' << re.length() << '\n';
compressTool.uncompressData(re, copy);
auto copyOut = tool.base64_decode(copy);
std::cout << copyOut.length() << ' ' << re.length() << '\n';
return 0;
}