CD
Size: a a a
CD
NP
IZ
std::istream
?CD
CD
IZ
CD
NP
CD
unsigned lodepng_load_file(unsigned char** out, size_t* outsize, const char* filename) {
long size = lodepng_filesize(filename);
if(size < 0) return 78;
*outsize = (size_t)size;
*out = (unsigned char*)lodepng_malloc((size_t)size);
if(!(*out) && size > 0) return 83; /*the above malloc failed*/
return lodepng_buffer_file(*out, (size_t)size, filename);
}
CD
NP
CD
unsigned lodepng_decode_file(unsigned char** out, unsigned* w, unsigned* h, const char* filename,
LodePNGColorType colortype, unsigned bitdepth) {
unsigned char* buffer = 0;
size_t buffersize;
unsigned error;
/* safe output values in case error happens */
*out = 0;
*w = *h = 0;
error = lodepng_load_file(&buffer, &buffersize, filename);
if(!error) error = lodepng_decode_memory(out, w, h, buffer, buffersize, colortype, bitdepth);
lodepng_free(buffer);
return error;
}
CD
CD
NP
IZ
NP
NP
IZ
NP