Module: synfig/synfig
Branch: eldruin_glade_ui
Commit: 02acfebf6c28f9c74ea5bfe435fb369a19884014
URL:
http://synfig.git.sourceforge.net/git/gitweb.cgi?p=synfig/synfig;a=commit;h=02acfebf6c28f9c74ea5bfe435fb369a19884014
Author: Diego Barrios Romero <eldr...@gmailcom>
Date: Mon Oct 4 12:44:59 2010 +0200
PNG 1.4 library support
---
synfig-core/configure.ac | 21 +++++++++++++++------
synfig-core/src/modules/mod_png/mptr_png.cpp | 6 +++++-
2 files changed, 20 insertions(+), 7 deletions(-)
diff --git a/synfig-core/configure.ac b/synfig-core/configure.ac
index a62cca4..871f75b 100644
--- a/synfig-core/configure.ac
+++ b/synfig-core/configure.ac
@@ -434,10 +434,12 @@ dnl PKG_CHECK_MODULES(GLIB,
glib-2.0,[GLIB="yes"],[GLIB="no"])
TARGET_PNG="yes"
TARGET_MNG="yes"
-AC_CHECK_LIB(png, png_write_row,[
- PNG_LIBS="-lpng"
- AC_DEFINE(HAVE_LIBPNG,[], [ Define if PNG library is available ] )
+AC_CHECK_LIB(png14, png_write_row,[
+ PNG_LIBS="-lpng14"
+ AC_DEFINE(HAVE_LIBPNG14,[], [ Define if PNG 1.4 library is available ])
+ AC_DEFINE(HAVE_LIBPNG,[], [ Define if PNG library is available ])
AC_SUBST(PNG_LIBS)
+ AM_CONDITIONAL(HAVE_LIBPNG14,true)
AM_CONDITIONAL(HAVE_LIBPNG,true)
],[
AC_CHECK_LIB(png12, png_write_row,[
@@ -446,9 +448,16 @@ AC_CHECK_LIB(png, png_write_row,[
AC_SUBST(PNG_LIBS)
AM_CONDITIONAL(HAVE_LIBPNG,true)
],[
- AC_MSG_RESULT([ *** PNG Output target disabled])
- TARGET_PNG="no"
- AM_CONDITIONAL(HAVE_LIBPNG,false)
+ AC_CHECK_LIB(png, png_write_row,[
+ PNG_LIBS="-lpng"
+ AC_DEFINE(HAVE_LIBPNG,[])
+ AC_SUBST(PNG_LIBS)
+ AM_CONDITIONAL(HAVE_LIBPNG,true)
+ ],[
+ AC_MSG_RESULT([ *** PNG Output target disabled])
+ TARGET_PNG="no"
+ AM_CONDITIONAL(HAVE_LIBPNG,false)
+ ],[-lz -L${exec_prefix}/lib])
],[-lz -L${exec_prefix}/lib])
],[-lz -L${exec_prefix}/lib])
diff --git a/synfig-core/src/modules/mod_png/mptr_png.cpp
b/synfig-core/src/modules/mod_png/mptr_png.cpp
index ec601b5..197dbd4 100644
--- a/synfig-core/src/modules/mod_png/mptr_png.cpp
+++ b/synfig-core/src/modules/mod_png/mptr_png.cpp
@@ -309,7 +309,11 @@ png_mptr::png_mptr(const char *file_name)
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);
+#ifdef HAVE_LIBPNG14
+ a = (float)(unsigned
char)png_ptr->trans_alpha[row_pointers[y][x]]*(1.0/255.0);
+#else
+ a = (float)(unsigned
char)png_ptr->trans[row_pointers[y][x]]*(1.0/255.0);
+#endif
surface_buffer[y][x]=Color(
r,
g,
------------------------------------------------------------------------------
Virtualization is moving to the mainstream and overtaking non-virtualized
environment for deploying applications. Does it make network security
easier or more difficult to achieve? Read this whitepaper to separate the
two and get a better understanding.
http://p.sf.net/sfu/hp-phase2-d2d
_______________________________________________
Synfig-devl mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/synfig-devl