diff options
| author | BossCode45 <boss@tehbox.org> | 2025-06-27 17:58:36 +1200 |
|---|---|---|
| committer | BossCode45 <boss@tehbox.org> | 2025-07-24 12:48:21 +1200 |
| commit | 078b4e08fe3bccb7424dac76e158bf8bf48a182d (patch) | |
| tree | a4f84f3fc346053c1c41990be4cc0867ab206cf5 /test/main.cpp | |
| parent | eed164fa72297efb69b624f3c58cb5deb339a974 (diff) | |
| download | tehimage-078b4e08fe3bccb7424dac76e158bf8bf48a182d.tar.gz tehimage-078b4e08fe3bccb7424dac76e158bf8bf48a182d.zip | |
feat: Made it so that you can now convert between image subclasses
Also added the bitmap image subclass
note: this is pretty hacky in how it works
Diffstat (limited to 'test/main.cpp')
| -rw-r--r-- | test/main.cpp | 17 |
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); } |
