MCPcopy Create free account
hub / github.com/DFHack/dfhack / lodepng_encode_memory

Function lodepng_encode_memory

depends/lodepng/lodepng.cpp:6075–6088  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6073}
6074
6075unsigned lodepng_encode_memory(unsigned char** out, size_t* outsize, const unsigned char* image,
6076 unsigned w, unsigned h, LodePNGColorType colortype, unsigned bitdepth) {
6077 unsigned error;
6078 LodePNGState state;
6079 lodepng_state_init(&state);
6080 state.info_raw.colortype = colortype;
6081 state.info_raw.bitdepth = bitdepth;
6082 state.info_png.color.colortype = colortype;
6083 state.info_png.color.bitdepth = bitdepth;
6084 lodepng_encode(out, outsize, image, w, h, &state);
6085 error = state.error;
6086 lodepng_state_cleanup(&state);
6087 return error;
6088}
6089
6090unsigned lodepng_encode32(unsigned char** out, size_t* outsize, const unsigned char* image, unsigned w, unsigned h) {
6091 return lodepng_encode_memory(out, outsize, image, w, h, LCT_RGBA, 8);

Callers 4

lodepng_encode32Function · 0.85
lodepng_encode24Function · 0.85
lodepng_encode_fileFunction · 0.85
encodeFunction · 0.85

Calls 3

lodepng_state_initFunction · 0.85
lodepng_encodeFunction · 0.85
lodepng_state_cleanupFunction · 0.85

Tested by

no test coverage detected