MCPcopy Create free account
hub / github.com/ValveSoftware/openvr / decode

Function decode

samples/shared/lodepng.cpp:5980–5995  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5978#ifdef LODEPNG_COMPILE_DECODER
5979
5980unsigned decode(std::vector<unsigned char>& out, unsigned& w, unsigned& h, const unsigned char* in,
5981 size_t insize, LodePNGColorType colortype, unsigned bitdepth)
5982{
5983 unsigned char* buffer;
5984 unsigned error = lodepng_decode_memory(&buffer, &w, &h, in, insize, colortype, bitdepth);
5985 if(buffer && !error)
5986 {
5987 State state;
5988 state.info_raw.colortype = colortype;
5989 state.info_raw.bitdepth = bitdepth;
5990 size_t buffersize = lodepng_get_raw_size(w, h, &state.info_raw);
5991 out.insert(out.end(), &buffer[0], &buffer[buffersize]);
5992 lodepng_free(buffer);
5993 }
5994 return error;
5995}
5996
5997unsigned decode(std::vector<unsigned char>& out, unsigned& w, unsigned& h,
5998 const std::vector<unsigned char>& in, LodePNGColorType colortype, unsigned bitdepth)

Callers 3

SetupTexturemapsMethod · 0.85
SetupTexturemapsMethod · 0.85
SetupTexturemapsMethod · 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
endMethod · 0.80
emptyMethod · 0.80
sizeMethod · 0.80

Tested by

no test coverage detected