MCPcopy Create free account
hub / github.com/BinomialLLC/basis_universal / load_png

Function load_png

example_transcoding/utils.cpp:168–185  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

166
167#if 0
168bool 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
187bool save_png(const char* pFilename, const image_u8& img, bool save_alpha)
188{

Callers 1

random_compress_testFunction · 0.50

Calls 2

clearMethod · 0.45
initMethod · 0.45

Tested by

no test coverage detected