comparison png.c @ 4018:9c8ab288ebf6 libavcodec

Make PNG produce correct 8-bit pictures
author kostya
date Sat, 14 Oct 2006 12:23:54 +0000
parents c8c591fe26f8
children 8ab58b7bc06b
comparison
equal deleted inserted replaced
4017:b1a1fb651bf5 4018:9c8ab288ebf6
848 alpha_ptr = s->buf + 256 * 3; 848 alpha_ptr = s->buf + 256 * 3;
849 has_alpha = 0; 849 has_alpha = 0;
850 for(i = 0; i < 256; i++) { 850 for(i = 0; i < 256; i++) {
851 v = palette[i]; 851 v = palette[i];
852 alpha = v >> 24; 852 alpha = v >> 24;
853 if (alpha != 0xff) 853 if (alpha && alpha != 0xff)
854 has_alpha = 1; 854 has_alpha = 1;
855 *alpha_ptr++ = alpha; 855 *alpha_ptr++ = alpha;
856 ptr[0] = v >> 16; 856 ptr[0] = v >> 16;
857 ptr[1] = v >> 8; 857 ptr[1] = v >> 8;
858 ptr[2] = v; 858 ptr[2] = v;