| 2715 | } |
| 2716 | |
| 2717 | static int lodepng_color_mode_equal(const LodePNGColorMode* a, const LodePNGColorMode* b) { |
| 2718 | size_t i; |
| 2719 | if(a->colortype != b->colortype) return 0; |
| 2720 | if(a->bitdepth != b->bitdepth) return 0; |
| 2721 | if(a->key_defined != b->key_defined) return 0; |
| 2722 | if(a->key_defined) { |
| 2723 | if(a->key_r != b->key_r) return 0; |
| 2724 | if(a->key_g != b->key_g) return 0; |
| 2725 | if(a->key_b != b->key_b) return 0; |
| 2726 | } |
| 2727 | if(a->palettesize != b->palettesize) return 0; |
| 2728 | for(i = 0; i != a->palettesize * 4; ++i) { |
| 2729 | if(a->palette[i] != b->palette[i]) return 0; |
| 2730 | } |
| 2731 | return 1; |
| 2732 | } |
| 2733 | |
| 2734 | void lodepng_palette_clear(LodePNGColorMode* info) { |
| 2735 | if(info->palette) lodepng_free(info->palette); |
no outgoing calls
no test coverage detected