consolidate all repos to one for archive
This commit is contained in:
26
projektna_naloga/compression/dec.cpp
Normal file
26
projektna_naloga/compression/dec.cpp
Normal file
@@ -0,0 +1,26 @@
|
||||
#include "decompressor.h"
|
||||
#include "stb.h"
|
||||
|
||||
void decompress(const char *filepath, const char *savepath)
|
||||
{
|
||||
Decompressor dec;
|
||||
|
||||
dec.reader.buffer.load_from_file(filepath);
|
||||
|
||||
int width, hight;
|
||||
std::vector<unsigned char> ret = dec.decompress(width, hight);
|
||||
|
||||
stb_w(savepath, hight, width, 1, ret.data());
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
if (argc != 2)
|
||||
{
|
||||
printf("Usage: %s <filepath>\n", argv[0]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
decompress(argv[1], "out.bmp");
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user