aboutsummaryrefslogtreecommitdiff
path: root/test/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/main.cpp')
-rw-r--r--test/main.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/test/main.cpp b/test/main.cpp
index f60017e..c020526 100644
--- a/test/main.cpp
+++ b/test/main.cpp
@@ -1,6 +1,7 @@
#include <reader.h>
#include <debug.h>
#include <PNGImage.h>
+#include <BMPImage.h>
#include <zlib.h>
#include <cstdint>
#include <cstring>
@@ -10,15 +11,19 @@ using std::cout, std::endl;
int main(int argc, char* argv[])
{
- if(argc < 2)
+ if(argc < 3)
{
- cout << "usage: " << argv[0] << " <image>" << endl;
+ cout << "usage: " << argv[0] << " <in file> <out file>" << endl;
return 1;
}
- std::string filename = argv[1];
-
- PNGImage image(filename);
+ std::string infile = argv[1];
+ std::string outfile = argv[2];
+
- while(image.readNextChunk()){}
+ PNGImage png;
+ png.readFromFile(infile);
+
+ BMPImage bmp(png);
+ bmp.writeToFile(outfile);
}