Revision: 2181
          http://synfig.svn.sourceforge.net/synfig/?rev=2181&view=rev
Author:   pabs3
Date:     2008-11-11 04:47:50 +0000 (Tue, 11 Nov 2008)

Log Message:
-----------
Apply 2198806: add support for alpha in paletted PNG files in the PNG importer. 
Patch by wtachi (hyperwiz)

Modified Paths:
--------------
    synfig-core/trunk/AUTHORS
    synfig-core/trunk/src/modules/mod_png/mptr_png.cpp

Modified: synfig-core/trunk/AUTHORS
===================================================================
--- synfig-core/trunk/AUTHORS   2008-11-10 16:45:06 UTC (rev 2180)
+++ synfig-core/trunk/AUTHORS   2008-11-11 04:47:50 UTC (rev 2181)
@@ -15,6 +15,7 @@
 Carlos López González (genete)
 Gerco Ballintijn
 Daniel Hornung (rubikcube)
+Wtachi (hyperwiz)
 
 Translators:
 

Modified: synfig-core/trunk/src/modules/mod_png/mptr_png.cpp
===================================================================
--- synfig-core/trunk/src/modules/mod_png/mptr_png.cpp  2008-11-10 16:45:06 UTC 
(rev 2180)
+++ synfig-core/trunk/src/modules/mod_png/mptr_png.cpp  2008-11-11 04:47:50 UTC 
(rev 2181)
@@ -309,11 +309,14 @@
                                float r=gamma().r_U8_to_F32((unsigned 
char)png_ptr->palette[row_pointers[y][x]].red);
                                float g=gamma().g_U8_to_F32((unsigned 
char)png_ptr->palette[row_pointers[y][x]].green);
                                float b=gamma().b_U8_to_F32((unsigned 
char)png_ptr->palette[row_pointers[y][x]].blue);
+                               float a=1.0;
+                               if(info_ptr->valid & PNG_INFO_tRNS)
+                                   a = (float)(unsigned 
char)png_ptr->trans[row_pointers[y][x]]*(1.0/255.0);
                                surface_buffer[y][x]=Color(
                                        r,
                                        g,
                                        b,
-                                       1.0
+                                       a
                                );
                        }
                break;


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Synfig-devl mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/synfig-devl

Reply via email to