-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.cpp
71 lines (60 loc) · 2.02 KB
/
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
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
#include <iostream>
#include "WaveletCompress.h"
#include "WaveletDecompress.h"
#include "WaveletComDec.h"
using namespace std;
int main(int argc, char *argv[])
{
//A example to show how to compress the data
int choice = 3;
int exit = 0;
int level = 1;
int value = 5;
char file_input[20];
char file_save[20];
char file_output[20];
cout << "Wavelet Compression Programme: " << endl;
cout << "1. Compress.\n2. Decompress.\n3. Compress & Decompress.\n4. Exit.\n" << endl;
do
{
cin >> choice;
switch(choice)
{
case 1:
cout << "Syntax: [input filename] [output filename] [level = 1] [value = 5]\n=>";
cin >> file_input >> file_save >> level >> value;
cout << "Compressing......" << endl;
Compress(file_input, file_save, level, value);
cout << "Done.\n\n";
cin.get();
break;
case 2:
cout << "Syntax: [input filename] [output filename]\n=>";
cin >> file_save >>file_output;
cout << "Decompressing" << endl;
Decompress(file_save, file_output);
cout << "Done.\n\n";
cin.get();
break;
case 3:
cout << "Syntax: [input filename][output filename] [level = 1] [value = 5]\n=>";
cin >> file_input >> file_output >> level >> value;
cout << "Compressing & Decompressing......" << endl;
CompressDecompress(file_input, file_output, level, value);
cout << "Done.\n\n";
cin.get();
break;
case 4:
exit = 1;
cout <<"Exit wavelet compression programme\n";
cin.get();
break;
default:
cout << "Invalid choice. Choose again.\n" << endl;
cin.get();
break;
}
}
while (exit == 0);
return 0;
}