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

Function addChunk_PLTE

dependency/densecrf/examples/lodepng.cpp:4903–4918  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4901}
4902
4903static unsigned addChunk_PLTE(ucvector* out, const LodePNGColorMode* info)
4904{
4905 unsigned error = 0;
4906 size_t i;
4907 ucvector PLTE;
4908 ucvector_init(&PLTE);
4909 for(i = 0; i != info->palettesize * 4; ++i)
4910 {
4911 /*add all channels except alpha channel*/
4912 if(i % 4 != 3) ucvector_push_back(&PLTE, info->palette[i]);
4913 }
4914 error = addChunk(out, "PLTE", PLTE.data, PLTE.size);
4915 ucvector_cleanup(&PLTE);
4916
4917 return error;
4918}
4919
4920static unsigned addChunk_tRNS(ucvector* out, const LodePNGColorMode* info)
4921{

Callers 1

lodepng_encodeFunction · 0.85

Calls 4

ucvector_initFunction · 0.85
ucvector_push_backFunction · 0.85
addChunkFunction · 0.85
ucvector_cleanupFunction · 0.85

Tested by

no test coverage detected