]> git.sesse.net Git - vlc/commitdiff
* modules/video_filter/logo.c: convert all pngs to RGBA.
authorGildas Bazin <gbazin@videolan.org>
Sun, 19 Sep 2004 14:46:01 +0000 (14:46 +0000)
committerGildas Bazin <gbazin@videolan.org>
Sun, 19 Sep 2004 14:46:01 +0000 (14:46 +0000)
modules/video_filter/logo.c

index 7c59d9fb1f4d0c3040f542b425a3f020bea31b67..e8c48d4a729f0a981835b796d235c6f3730ddcc5 100644 (file)
@@ -128,6 +128,16 @@ static picture_t *LoadPNG( vlc_object_t *p_this )
                   &i_bit_depth, &i_color_type, &i_interlace_type,
                   &i_compression_type, &i_filter_type);
 
+    if( i_color_type == PNG_COLOR_TYPE_PALETTE )
+        png_set_palette_to_rgb( p_png );
+
+    if( i_color_type == PNG_COLOR_TYPE_GRAY ||
+        i_color_type == PNG_COLOR_TYPE_GRAY_ALPHA )
+          png_set_gray_to_rgb( p_png );
+
+    if( png_get_valid( p_png, p_info, PNG_INFO_tRNS ) )
+        png_set_tRNS_to_alpha( p_png );
+
     p_row_pointers = malloc( sizeof(png_bytep) * i_height );
     for( i = 0; i < (int)i_height; i++ )
     {