MCPcopy Create free account
hub / github.com/KhronosGroup/KTX-Software / lodepng_encode_memory

Function lodepng_encode_memory

external/lodepng/lodepng.cpp:6919–6932  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6917}
6918
6919unsigned lodepng_encode_memory(unsigned char** out, size_t* outsize, const unsigned char* image,
6920 unsigned w, unsigned h, LodePNGColorType colortype, unsigned bitdepth) {
6921 unsigned error;
6922 LodePNGState state;
6923 lodepng_state_init(&state);
6924 state.info_raw.colortype = colortype;
6925 state.info_raw.bitdepth = bitdepth;
6926 state.info_png.color.colortype = colortype;
6927 state.info_png.color.bitdepth = bitdepth;
6928 lodepng_encode(out, outsize, image, w, h, &state);
6929 error = state.error;
6930 lodepng_state_cleanup(&state);
6931 return error;
6932}
6933
6934unsigned lodepng_encode32(unsigned char** out, size_t* outsize, const unsigned char* image, unsigned w, unsigned h) {
6935 return lodepng_encode_memory(out, outsize, image, w, h, LCT_RGBA, 8);

Callers 5

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

Calls 3

lodepng_state_initFunction · 0.85
lodepng_encodeFunction · 0.85
lodepng_state_cleanupFunction · 0.85

Tested by 1

doCodecTestCFunction · 0.68