| 4770 | } |
| 4771 | |
| 4772 | static 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 | |
| 4789 | static unsigned addChunk_tRNS(ucvector* out, const LodePNGColorMode* info) |
| 4790 | { |
no test coverage detected