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

Function load_file

dependency/densecrf/examples/lodepng.cpp:6011–6017  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6009
6010#ifdef LODEPNG_COMPILE_DISK
6011 unsigned load_file(std::vector<unsigned char>& buffer, const std::string& filename)
6012 {
6013 long size = lodepng_filesize(filename.c_str());
6014 if(size < 0) return 78;
6015 buffer.resize((size_t)size);
6016 return size == 0 ? 0 : lodepng_buffer_file(&buffer[0], (size_t)size, filename.c_str());
6017 }
6018
6019 /*write given buffer to the file, overwriting the file, it doesn't append to it.*/
6020 unsigned save_file(const std::vector<unsigned char>& buffer, const std::string& filename)

Callers 1

decodeFunction · 0.85

Calls 3

lodepng_filesizeFunction · 0.85
lodepng_buffer_fileFunction · 0.85
resizeMethod · 0.45

Tested by

no test coverage detected