| 166 | |
| 167 | #if 0 |
| 168 | bool load_png(const char* pFilename, image_u8& img) |
| 169 | { |
| 170 | img.clear(); |
| 171 | |
| 172 | std::vector<unsigned char> pixels; |
| 173 | unsigned int w = 0, h = 0; |
| 174 | unsigned int e = lodepng::decode(pixels, w, h, pFilename); |
| 175 | if (e != 0) |
| 176 | { |
| 177 | fprintf(stderr, "Failed loading PNG file %s\n", pFilename); |
| 178 | return false; |
| 179 | } |
| 180 | |
| 181 | img.init(w, h); |
| 182 | memcpy(&img.get_pixels()[0], &pixels[0], w * h * sizeof(uint32_t)); |
| 183 | |
| 184 | return true; |
| 185 | } |
| 186 | |
| 187 | bool save_png(const char* pFilename, const image_u8& img, bool save_alpha) |
| 188 | { |
no test coverage detected