MCPcopy Create free account
hub / github.com/creatale/node-dv / decode

Function decode

deps/lodepng/lodepng.cpp:6175–6190  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6173#ifdef LODEPNG_COMPILE_DECODER
6174
6175unsigned decode(std::vector<unsigned char>& out, unsigned& w, unsigned& h, const unsigned char* in,
6176 size_t insize, LodePNGColorType colortype, unsigned bitdepth)
6177{
6178 unsigned char* buffer;
6179 unsigned error = lodepng_decode_memory(&buffer, &w, &h, in, insize, colortype, bitdepth);
6180 if(buffer && !error)
6181 {
6182 State state;
6183 state.info_raw.colortype = colortype;
6184 state.info_raw.bitdepth = bitdepth;
6185 size_t buffersize = lodepng_get_raw_size(w, h, &state.info_raw);
6186 out.insert(out.end(), &buffer[0], &buffer[buffersize]);
6187 lodepng_free(buffer);
6188 }
6189 return error;
6190}
6191
6192unsigned decode(std::vector<unsigned char>& out, unsigned& w, unsigned& h,
6193 const std::vector<unsigned char>& in, LodePNGColorType colortype, unsigned bitdepth)

Callers 5

NAN_METHODFunction · 0.85
decodeMethod · 0.85
decodeMethod · 0.85
decodeMethod · 0.85
decodeMethod · 0.85

Calls 9

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
emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected