| 22 | } |
| 23 | |
| 24 | Colour32 PngImage::getPixel(int x, int y) |
| 25 | { |
| 26 | const size_t index = (y * width + x) * channels; |
| 27 | assert(index + channels <= imageData.size()); |
| 28 | |
| 29 | return { |
| 30 | imageData[index + 0], |
| 31 | imageData[index + 1], |
| 32 | imageData[index + 2], |
| 33 | imageData[index + 3] |
| 34 | }; |
| 35 | } |
| 36 | |
| 37 | static void libpngErrorHandler(png_structp, png_const_charp error_msg) |
| 38 | { |