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

Function addChunk_PLTE

samples/shared/lodepng.cpp:4772–4787  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4770}
4771
4772static unsigned addChunk_PLTE(ucvector* out, const LodePNGColorMode* info)
4773{
4774 unsigned error = 0;
4775 size_t i;
4776 ucvector PLTE;
4777 ucvector_init(&PLTE);
4778 for(i = 0; i < info->palettesize * 4; i++)
4779 {
4780 /*add all channels except alpha channel*/
4781 if(i % 4 != 3) ucvector_push_back(&PLTE, info->palette[i]);
4782 }
4783 error = addChunk(out, "PLTE", PLTE.data, PLTE.size);
4784 ucvector_cleanup(&PLTE);
4785
4786 return error;
4787}
4788
4789static unsigned addChunk_tRNS(ucvector* out, const LodePNGColorMode* info)
4790{

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