MCPcopy Create free account
hub / github.com/HiLab-git/SimpleCRF / decode

Function decode

dependency/densecrf/examples/lodepng.cpp:6099–6114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6097#ifdef LODEPNG_COMPILE_DECODER
6098
6099 unsigned decode(std::vector<unsigned char>& out, unsigned& w, unsigned& h, const unsigned char* in,
6100 size_t insize, LodePNGColorType colortype, unsigned bitdepth)
6101 {
6102 unsigned char* buffer;
6103 unsigned error = lodepng_decode_memory(&buffer, &w, &h, in, insize, colortype, bitdepth);
6104 if(buffer && !error)
6105 {
6106 State state;
6107 state.info_raw.colortype = colortype;
6108 state.info_raw.bitdepth = bitdepth;
6109 size_t buffersize = lodepng_get_raw_size(w, h, &state.info_raw);
6110 out.insert(out.end(), &buffer[0], &buffer[buffersize]);
6111 lodepng_free(buffer);
6112 }
6113 return error;
6114 }
6115
6116 unsigned decode(std::vector<unsigned char>& out, unsigned& w, unsigned& h,
6117 const std::vector<unsigned char>& in, LodePNGColorType colortype, unsigned bitdepth)

Callers 1

readPNGFunction · 0.85

Calls 8

lodepng_decode_memoryFunction · 0.85
lodepng_get_raw_sizeFunction · 0.85
lodepng_freeFunction · 0.85
lodepng_decodeFunction · 0.85
load_fileFunction · 0.85
insertMethod · 0.45
endMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected