// SPDX-FileCopyrightText: 2024 Filip Leonarski, Paul Scherrer Institute // SPDX-License-Identifier: GPL-3.0-only #include #include #include "../preview/JFJochPNG.h" TEST_CASE("PNGTest","[PNG]") { size_t width = 1024; size_t height = 1024; std::vector val(width * height); for (int i = 0; i < width * height; i++) { size_t x = i % width; if (x < 512) { val[i].r = 234; val[i].g = 0; val[i].b = 0; } else { val[i].r = 0; val[i].g = 0; val[i].b = 255; } } std::string s; CompressedImage image(val, width, height); REQUIRE_NOTHROW(s = WritePNGToMem(image)); std::ofstream f("x.png", std::ios::binary); f.write(s.data(), s.size()); }