-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathA0-1-5.cpp
More file actions
80 lines (51 loc) · 1.51 KB
/
A0-1-5.cpp
File metadata and controls
80 lines (51 loc) · 1.51 KB
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
// Rule: A0-1-5
// Source line: 2044
// Original file: A0-1-5.cpp
//% $Id: A0-1-5.cpp 305588 2018-01-29 11:07:35Z michal.szczepankiewicz $
#include <cstdint>
#include <vector>
//Compressor.h
class Compressor
{
public:
using raw_memory_type = std::vector<uint8_t>;
raw_memory_type Compress(const raw_memory_type& in, uint8_t ratio);
private:
virtual raw_memory_type __Compress(const raw_memory_type& in, uint8_t ratio)
= 0;
};
//Compressor.cpp
Compressor::raw_memory_type Compressor::Compress(const raw_memory_type& in,
uint8_t ratio)
{
return __Compress(in, ratio);
}
//JPEGCompressor.h
class JPEGCompressor : public Compressor
{
private:
raw_memory_type __Compress(const raw_memory_type& in, uint8_t ratio) override
;
};
//JPEGCompressor.cpp
JPEGCompressor::raw_memory_type JPEGCompressor::__Compress(const raw_memory_type&
in, uint8_t ratio)
{
raw_memory_type ret;
//jpeg compression, ratio used
return ret;
}
//HuffmanCompressor.h
class HuffmanCompressor : public Compressor
{
private:
raw_memory_type __Compress(const raw_memory_type& in, uint8_t) override;
};
//JPEGCompressor.cpp
HuffmanCompressor::raw_memory_type HuffmanCompressor::__Compress(const
raw_memory_type& in, uint8_t)
{
raw_memory_type ret;
//Huffman compression, no ratio parameter available in the algorithm
return ret;
}