blob: 9a30a25cc85521db53976a2cd7f34e22f21c0f6e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
#include <stdio.h>
#include <iostream>
#include <iterator>
#include "lodepng/lodepng.h"
int main(int argc, char *argv[])
{
fprintf(stderr, "decodepng by DanTheMan827\n\n");
fprintf(stderr, "Build Date: %s \n", BUILD_DATE);
fprintf(stderr, " Commit: %s \n", BUILD_COMMIT);
if(argc == 1){
return 1;
}
std::vector<unsigned char> image; //the raw pixels
unsigned width, height;
//decode
unsigned error = lodepng::decode(image, width, height, argv[1]);
std::copy(image.begin(), image.end(), std::ostream_iterator<char>(std::cout));
}
|