I've written an image loader for evas that can load pbm, pgm, ppm. It
supports P1, P2, P3, P4, P5, P6. For P5 and P6 it also supports the
2-byte format. Unfortunately I haven't seen that there is a pnm loader
for imlib2, when I started to write it. And when I saw the imlib2
loader, I've already written the most parts of my loader. Compared to
the imlib2 loader my loader is very lenient, supports 2-byte binary
format and imho is easier to understand. Therefor the imlib2 code might
be a bit faster. I haven't measured it tho. And the felt load time is
almost equal.
I named the loader pmaps, but if you prefer I can rename it to pnm.
The attached diff only adds the loader to evas. The pmaps directory can
be found here:
http://mowem.de/evas/pmaps.tar.gz
or if you just want to scroll through the c file:
http://phpfi.com/296415
If you like it, I'll commit it.
Peter
? pmaps.diff
? src/modules/loaders/pmaps
? src/modules/loaders/pmaps.tar.gz
Index: configure.in
===================================================================
RCS file: /cvs/e/e17/libs/evas/configure.in,v
retrieving revision 1.248
diff -u -u -r1.248 configure.in
--- configure.in 25 Jan 2008 03:35:49 -0000 1.248
+++ configure.in 14 Feb 2008 11:24:05 -0000
@@ -1055,6 +1055,22 @@
AM_CONDITIONAL(BUILD_LOADER_SVG, test x$have_svg = xyes)
+#######################################
+## PMAPS
+have_pmaps="yes";
+AC_MSG_CHECKING(whether to enable pmaps image loader)
+AC_ARG_ENABLE(image-loader-pmaps,
+ AC_HELP_STRING([--disable-image-loader-pmaps], [disable PMAPS image loader]),
+ [ have_pmaps=$enableval ]
+)
+AC_MSG_RESULT($have_pmaps)
+
+pmaps_cflags=""
+pmaps_libs=""
+
+AM_CONDITIONAL(BUILD_LOADER_PMAPS, test x$have_pmaps = xyes)
+
+
#####################################################################
## Cpu based optimizations
@@ -1520,6 +1536,8 @@
AC_SUBST(xpm_libs)
AC_SUBST(svg_cflags)
AC_SUBST(svg_libs)
+AC_SUBST(pmaps_cflags)
+AC_SUBST(pmaps_libs)
AC_SUBST(altivec_cflags)
AC_SUBST(pthread_cflags)
AC_SUBST(pthread_libs)
@@ -1595,6 +1613,7 @@
src/modules/loaders/tiff/Makefile
src/modules/loaders/xpm/Makefile
src/modules/loaders/svg/Makefile
+src/modules/loaders/pmaps/Makefile
src/modules/savers/Makefile
src/modules/savers/edb/Makefile
src/modules/savers/eet/Makefile
@@ -1648,6 +1667,7 @@
echo " TIFF....................: $have_tiff"
echo " XPM.....................: $have_xpm"
echo " SVG.....................: $have_svg"
+echo " PMAPS...................: $have_pmaps"
# FIXME: need to add modular image loader system
# FIXME: add more image loader modules
echo
Index: src/lib/engines/common/evas_image_load.c
===================================================================
RCS file: /cvs/e/e17/libs/evas/src/lib/engines/common/evas_image_load.c,v
retrieving revision 1.44
diff -u -u -r1.44 evas_image_load.c
--- src/lib/engines/common/evas_image_load.c 2 Dec 2007 19:44:27 -0000 1.44
+++ src/lib/engines/common/evas_image_load.c 14 Feb 2008 11:24:05 -0000
@@ -22,7 +22,11 @@
{ "tif", "tiff" },
{ "svg", "svg" },
{ "svgz", "svg" },
- { "gif", "gif" }
+ { "gif", "gif" },
+ { "pbm", "pmaps" },
+ { "pgm", "pmaps" },
+ { "ppm", "pmaps" },
+ { "pnm", "pmaps" }
};
EAPI int
Index: src/modules/loaders/Makefile.am
===================================================================
RCS file: /cvs/e/e17/libs/evas/src/modules/loaders/Makefile.am,v
retrieving revision 1.6
diff -u -u -r1.6 Makefile.am
--- src/modules/loaders/Makefile.am 17 Aug 2006 15:39:24 -0000 1.6
+++ src/modules/loaders/Makefile.am 14 Feb 2008 11:24:05 -0000
@@ -32,4 +32,9 @@
svg_subdir = svg
endif
-SUBDIRS = $(edb_subdir) $(eet_subdir) $(gif_subdir) $(jpeg_subdir) $(png_subdir) $(tiff_subdir) $(xpm_subdir) $(svg_subdir)
+if BUILD_LOADER_PMAPS
+pmaps_subdir = pmaps
+endif
+
+
+SUBDIRS = $(edb_subdir) $(eet_subdir) $(gif_subdir) $(jpeg_subdir) $(png_subdir) $(tiff_subdir) $(xpm_subdir) $(svg_subdir) $(pmaps_subdir)
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel