| 4921 | } |
| 4922 | |
| 4923 | static unsigned addChunk_PLTE(ucvector* out, const LodePNGColorMode* info) |
| 4924 | { |
| 4925 | unsigned error = 0; |
| 4926 | size_t i; |
| 4927 | ucvector PLTE; |
| 4928 | ucvector_init(&PLTE); |
| 4929 | for(i = 0; i < info->palettesize * 4; i++) |
| 4930 | { |
| 4931 | /*add all channels except alpha channel*/ |
| 4932 | if(i % 4 != 3) ucvector_push_back(&PLTE, info->palette[i]); |
| 4933 | } |
| 4934 | error = addChunk(out, "PLTE", PLTE.data, PLTE.size); |
| 4935 | ucvector_cleanup(&PLTE); |
| 4936 | |
| 4937 | return error; |
| 4938 | } |
| 4939 | |
| 4940 | static unsigned addChunk_tRNS(ucvector* out, const LodePNGColorMode* info) |
| 4941 | { |
no test coverage detected