git.haldean.org datahedron / 20d9e71
first commit for datahedron Haldean Brown 2 years ago
8 changed file(s) with 39 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 .tup
1 datahedron
0 : datahedron.cpp |> g++ -o datahedron datahedron.cpp `libpng-config --cflags --ldflags` |> datahedron
0 #include <png++/png.hpp>
1 #include <vector>
2
3 typedef png::image<png::rgb_pixel> image;
4
5 int main(int argc, char *argv[])
6 {
7 std::vector<image> images;
8 std::pair<size_t, size_t> img_size;
9
10 for (int i = 1; i < argc; i++)
11 {
12 images.emplace_back(argv[i]);
13 if (i == 1)
14 {
15 img_size.first = images.back().get_width();
16 img_size.second = images.back().get_height();
17 }
18 else
19 {
20 size_t w = images.back().get_width();
21 size_t h = images.back().get_height();
22 if (w != img_size.first || h != img_size.second)
23 {
24 std::cerr
25 << "Image sizes don't match; first image size was "
26 << img_size.first << "," << img_size.second
27 << ", but image " << (i + 1) << " is size "
28 << w << "," << h << std::endl;
29 }
30 }
31 }
32
33 std::cout << "Loaded " << images.size() << " images of size "
34 << img_size.first << "," << img_size.second << std::endl;
35 }
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown