| 32 | } |
| 33 | |
| 34 | PJ::DecodedFrame rgbFrame(int width, int height, const std::vector<uint8_t>& values) { |
| 35 | PJ::DecodedFrame frame; |
| 36 | frame.width = width; |
| 37 | frame.height = height; |
| 38 | frame.format = PJ::PixelFormat::kRGB888; |
| 39 | frame.pixels = std::make_shared<std::vector<uint8_t>>(values); |
| 40 | return frame; |
| 41 | } |
| 42 | |
| 43 | // CRC-32 (PNG/zlib polynomial) over a byte range — used to re-stamp a patched |
| 44 | // IHDR so png_read_info accepts our forged dimensions. |