From cb3716ffb584fe0f593b6f1669a8efdba1305104 Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Tue, 29 Mar 2016 02:16:55 +1000 Subject: Added my version of libg3d and friends. --- .../mimesh/libg3d-0.0.8/plugins/image/Makefile | 552 +++++++++++++++++++++ .../mimesh/libg3d-0.0.8/plugins/image/Makefile.am | 36 ++ .../mimesh/libg3d-0.0.8/plugins/image/Makefile.in | 552 +++++++++++++++++++++ .../mimesh/libg3d-0.0.8/plugins/image/img_bmp.c | 129 +++++ .../mimesh/libg3d-0.0.8/plugins/image/img_dds.c | 149 ++++++ .../libg3d-0.0.8/plugins/image/img_gdkpixbuf.c | 210 ++++++++ .../mimesh/libg3d-0.0.8/plugins/image/img_jpeg.c | 437 ++++++++++++++++ .../mimesh/libg3d-0.0.8/plugins/image/img_sgi.c | 181 +++++++ 8 files changed, 2246 insertions(+) create mode 100644 src/others/mimesh/libg3d-0.0.8/plugins/image/Makefile create mode 100644 src/others/mimesh/libg3d-0.0.8/plugins/image/Makefile.am create mode 100644 src/others/mimesh/libg3d-0.0.8/plugins/image/Makefile.in create mode 100644 src/others/mimesh/libg3d-0.0.8/plugins/image/img_bmp.c create mode 100644 src/others/mimesh/libg3d-0.0.8/plugins/image/img_dds.c create mode 100644 src/others/mimesh/libg3d-0.0.8/plugins/image/img_gdkpixbuf.c create mode 100644 src/others/mimesh/libg3d-0.0.8/plugins/image/img_jpeg.c create mode 100644 src/others/mimesh/libg3d-0.0.8/plugins/image/img_sgi.c (limited to 'src/others/mimesh/libg3d-0.0.8/plugins/image') diff --git a/src/others/mimesh/libg3d-0.0.8/plugins/image/Makefile b/src/others/mimesh/libg3d-0.0.8/plugins/image/Makefile new file mode 100644 index 0000000..d739118 --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/plugins/image/Makefile @@ -0,0 +1,552 @@ +# Makefile.in generated by automake 1.10.1 from Makefile.am. +# plugins/image/Makefile. Generated from Makefile.in by configure. + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + + + +pkgdatadir = $(datadir)/libg3d +pkglibdir = $(libdir)/libg3d +pkgincludedir = $(includedir)/libg3d +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = x86_64-unknown-linux-gnu +host_triplet = x86_64-unknown-linux-gnu +am__append_1 = img_gdkpixbuf.la +subdir = plugins/image +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ + $(top_srcdir)/m4/glib-2.0.m4 $(top_srcdir)/m4/gtk-2.0.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/libxml2.m4 $(top_srcdir)/m4/win32.m4 \ + $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/include/g3d/config.h +CONFIG_CLEAN_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(pluginimgdir)" +pluginimgLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(pluginimg_LTLIBRARIES) +img_bmp_la_DEPENDENCIES = $(top_builddir)/src/libg3d.la +am_img_bmp_la_OBJECTS = img_bmp.lo +img_bmp_la_OBJECTS = $(am_img_bmp_la_OBJECTS) +img_dds_la_DEPENDENCIES = $(top_builddir)/src/libg3d.la +am_img_dds_la_OBJECTS = img_dds.lo +img_dds_la_OBJECTS = $(am_img_dds_la_OBJECTS) +img_gdkpixbuf_la_DEPENDENCIES = $(top_builddir)/src/libg3d.la +am_img_gdkpixbuf_la_OBJECTS = img_gdkpixbuf_la-img_gdkpixbuf.lo +img_gdkpixbuf_la_OBJECTS = $(am_img_gdkpixbuf_la_OBJECTS) +img_gdkpixbuf_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(img_gdkpixbuf_la_CFLAGS) \ + $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +am_img_gdkpixbuf_la_rpath = -rpath \ + $(pluginimgdir) +img_sgi_la_DEPENDENCIES = $(top_builddir)/src/libg3d.la +am_img_sgi_la_OBJECTS = img_sgi.lo +img_sgi_la_OBJECTS = $(am_img_sgi_la_OBJECTS) +DEFAULT_INCLUDES = -I. -I$(top_builddir)/include/g3d +depcomp = $(SHELL) $(top_srcdir)/config/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(img_bmp_la_SOURCES) $(img_dds_la_SOURCES) \ + $(img_gdkpixbuf_la_SOURCES) $(img_sgi_la_SOURCES) +DIST_SOURCES = $(img_bmp_la_SOURCES) $(img_dds_la_SOURCES) \ + $(img_gdkpixbuf_la_SOURCES) $(img_sgi_la_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = ${SHELL} /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/config/missing --run aclocal-1.10 +AMTAR = ${SHELL} /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/config/missing --run tar +AR = ar +AS = as +AUTOCONF = ${SHELL} /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/config/missing --run autoconf +AUTOHEADER = ${SHELL} /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/config/missing --run autoheader +AUTOMAKE = ${SHELL} /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/config/missing --run automake-1.10 +AWK = gawk +CC = gcc +CCDEPMODE = depmode=gcc3 +CFLAGS = -g -O2 +CPP = gcc -E +CPPFLAGS = +CXX = g++ +CXXCPP = g++ -E +CXXDEPMODE = depmode=gcc3 +CXXFLAGS = -g -O2 +CYGPATH_W = echo +DBG_CFLAGS = -O2 +DEBUG = 0 +DEFS = -DHAVE_CONFIG_H +DEPDIR = .deps +DLLTOOL = dlltool +ECHO = echo +ECHO_C = +ECHO_N = -n +ECHO_T = +EGREP = /bin/grep -E +EXEEXT = +F77 = +FFLAGS = +GDKPIXBUF_CFLAGS = -pthread -I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 +GDKPIXBUF_LIBS = -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lglib-2.0 +GLIB_CFLAGS = -pthread -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include +GLIB_GENMARSHAL = glib-genmarshal +GLIB_LIBS = -Wl,--export-dynamic -pthread -lgmodule-2.0 -lrt -lgobject-2.0 -lglib-2.0 +GLIB_MKENUMS = glib-mkenums +GOBJECT_QUERY = gobject-query +GREP = /bin/grep +GTKDOC_CHECK = /usr/bin/gtkdoc-check +GTK_CFLAGS = -pthread -I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 +GTK_LIBS = -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lglib-2.0 +HTML_DIR = ${datadir}/gtk-doc/html +INSTALL = /usr/bin/install -c +INSTALL_DATA = ${INSTALL} -m 644 +INSTALL_PROGRAM = ${INSTALL} +INSTALL_SCRIPT = ${INSTALL} +INSTALL_STRIP_PROGRAM = $(install_sh) -c -s +LDFLAGS = +LEX = flex +LEXLIB = -lfl +LEX_OUTPUT_ROOT = lex.yy +LIBGSF_CFLAGS = -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/libxml2 -I/usr/include/libgsf-1 +LIBGSF_LIBS = -lgsf-1 -lgobject-2.0 -lxml2 -lglib-2.0 +LIBOBJS = +LIBS = -lm +LIBTOOL = $(SHELL) $(top_builddir)/libtool --quiet +LIBXML2_CFLAGS = -I/usr/include/libxml2 +LIBXML2_LIBS = -L/usr/lib/x86_64-linux-gnu -lxml2 +LN_S = ln -s +LTLIBOBJS = +LTVERSION = 0:8:0 +MAGIC_LIBS = -lmagic +MAKEINFO = ${SHELL} /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/config/missing --run makeinfo +MATH_LIBS = -lm +MKDIR_P = /bin/mkdir -p +OBJDUMP = objdump +OBJEXT = o +PACKAGE = libg3d +PACKAGE_BUGREPORT = +PACKAGE_NAME = +PACKAGE_STRING = +PACKAGE_TARNAME = +PACKAGE_VERSION = +PATH_SEPARATOR = : +PKG_CONFIG = /usr/bin/pkg-config +PLUGINS_LDFLAGS = -avoid-version -export-dynamic +RANLIB = ranlib +SET_MAKE = +SHELL = /bin/bash +STRIP = strip +VERSION = 0.0.8 +XML2_CONFIG = /usr/bin/xml2-config +XML_CPPFLAGS = -I/usr/include/libxml2 +XML_LIBS = -L/usr/lib/x86_64-linux-gnu -lxml2 +Z_CFLAGS = +Z_LIBS = -lz +abs_builddir = /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/plugins/image +abs_srcdir = /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/plugins/image +abs_top_builddir = /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8 +abs_top_srcdir = /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8 +ac_ct_CC = gcc +ac_ct_CXX = g++ +ac_ct_F77 = +am__include = include +am__leading_dot = . +am__quote = +am__tar = ${AMTAR} chof - "$$tardir" +am__untar = ${AMTAR} xf - +bindir = ${exec_prefix}/bin +build = x86_64-unknown-linux-gnu +build_alias = +build_cpu = x86_64 +build_os = linux-gnu +build_vendor = unknown +builddir = . +datadir = ${datarootdir} +datarootdir = ${prefix}/share +docdir = ${datarootdir}/doc/${PACKAGE} +dvidir = ${docdir} +exec_prefix = ${prefix} +host = x86_64-unknown-linux-gnu +host_alias = +host_cpu = x86_64 +host_os = linux-gnu +host_vendor = unknown +htmldir = ${docdir} +includedir = ${prefix}/include +infodir = ${datarootdir}/info +install_sh = $(SHELL) /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/config/install-sh +libdir = ${exec_prefix}/lib +libexecdir = ${exec_prefix}/libexec +localedir = ${datarootdir}/locale +localstatedir = ${prefix}/var +mandir = ${datarootdir}/man +mkdir_p = /bin/mkdir -p +oldincludedir = /usr/include +pdfdir = ${docdir} +prefix = /usr/local +program_transform_name = s,x,x, +psdir = ${docdir} +sbindir = ${exec_prefix}/sbin +sharedstatedir = ${prefix}/com +srcdir = . +sysconfdir = ${prefix}/etc +target_alias = +top_builddir = ../.. +top_srcdir = ../.. +pluginimgdir = $(pkglibdir)/plugins/image +pluginimg_LTLIBRARIES = img_bmp.la img_sgi.la img_dds.la \ + $(am__append_1) +AM_CFLAGS = \ + -Wall -ansi -pedantic \ + -DG_LOG_DOMAIN=\"LibG3D\" \ + -O2 -DDEBUG=0 \ + -pthread -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include + +INCLUDES = -I$(top_srcdir)/include +AM_LDFLAGS = \ + -no-undefined -module \ + -avoid-version -export-dynamic + +img_bmp_la_SOURCES = img_bmp.c +img_bmp_la_LIBADD = $(top_builddir)/src/libg3d.la -Wl,--export-dynamic -pthread -lgmodule-2.0 -lrt -lgobject-2.0 -lglib-2.0 +img_sgi_la_SOURCES = img_sgi.c +img_sgi_la_LIBADD = $(top_builddir)/src/libg3d.la -Wl,--export-dynamic -pthread -lgmodule-2.0 -lrt -lgobject-2.0 -lglib-2.0 +img_dds_la_SOURCES = img_dds.c +img_dds_la_LIBADD = $(top_builddir)/src/libg3d.la -Wl,--export-dynamic -pthread -lgmodule-2.0 -lrt -lgobject-2.0 -lglib-2.0 +img_gdkpixbuf_la_CFLAGS = ${AM_CFLAGS} -pthread -I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 +img_gdkpixbuf_la_SOURCES = img_gdkpixbuf.c +img_gdkpixbuf_la_LIBADD = $(top_builddir)/src/libg3d.la -Wl,--export-dynamic -pthread -lgmodule-2.0 -lrt -lgobject-2.0 -lglib-2.0 \ + -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lglib-2.0 + +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plugins/image/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu plugins/image/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-pluginimgLTLIBRARIES: $(pluginimg_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(pluginimgdir)" || $(MKDIR_P) "$(DESTDIR)$(pluginimgdir)" + @list='$(pluginimg_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(pluginimgLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(pluginimgdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(pluginimgLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(pluginimgdir)/$$f"; \ + else :; fi; \ + done + +uninstall-pluginimgLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(pluginimg_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pluginimgdir)/$$p'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pluginimgdir)/$$p"; \ + done + +clean-pluginimgLTLIBRARIES: + -test -z "$(pluginimg_LTLIBRARIES)" || rm -f $(pluginimg_LTLIBRARIES) + @list='$(pluginimg_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +img_bmp.la: $(img_bmp_la_OBJECTS) $(img_bmp_la_DEPENDENCIES) + $(LINK) -rpath $(pluginimgdir) $(img_bmp_la_OBJECTS) $(img_bmp_la_LIBADD) $(LIBS) +img_dds.la: $(img_dds_la_OBJECTS) $(img_dds_la_DEPENDENCIES) + $(LINK) -rpath $(pluginimgdir) $(img_dds_la_OBJECTS) $(img_dds_la_LIBADD) $(LIBS) +img_gdkpixbuf.la: $(img_gdkpixbuf_la_OBJECTS) $(img_gdkpixbuf_la_DEPENDENCIES) + $(img_gdkpixbuf_la_LINK) $(am_img_gdkpixbuf_la_rpath) $(img_gdkpixbuf_la_OBJECTS) $(img_gdkpixbuf_la_LIBADD) $(LIBS) +img_sgi.la: $(img_sgi_la_OBJECTS) $(img_sgi_la_DEPENDENCIES) + $(LINK) -rpath $(pluginimgdir) $(img_sgi_la_OBJECTS) $(img_sgi_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +include ./$(DEPDIR)/img_bmp.Plo +include ./$(DEPDIR)/img_dds.Plo +include ./$(DEPDIR)/img_gdkpixbuf_la-img_gdkpixbuf.Plo +include ./$(DEPDIR)/img_sgi.Plo + +.c.o: + $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< + mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +# source='$<' object='$@' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(COMPILE) -c $< + +.c.obj: + $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` + mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +# source='$<' object='$@' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: + $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< + mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +# source='$<' object='$@' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LTCOMPILE) -c -o $@ $< + +img_gdkpixbuf_la-img_gdkpixbuf.lo: img_gdkpixbuf.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(img_gdkpixbuf_la_CFLAGS) $(CFLAGS) -MT img_gdkpixbuf_la-img_gdkpixbuf.lo -MD -MP -MF $(DEPDIR)/img_gdkpixbuf_la-img_gdkpixbuf.Tpo -c -o img_gdkpixbuf_la-img_gdkpixbuf.lo `test -f 'img_gdkpixbuf.c' || echo '$(srcdir)/'`img_gdkpixbuf.c + mv -f $(DEPDIR)/img_gdkpixbuf_la-img_gdkpixbuf.Tpo $(DEPDIR)/img_gdkpixbuf_la-img_gdkpixbuf.Plo +# source='img_gdkpixbuf.c' object='img_gdkpixbuf_la-img_gdkpixbuf.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(img_gdkpixbuf_la_CFLAGS) $(CFLAGS) -c -o img_gdkpixbuf_la-img_gdkpixbuf.lo `test -f 'img_gdkpixbuf.c' || echo '$(srcdir)/'`img_gdkpixbuf.c + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) +installdirs: + for dir in "$(DESTDIR)$(pluginimgdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-pluginimgLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: install-pluginimgLTLIBRARIES + +install-dvi: install-dvi-am + +install-exec-am: + +install-html: install-html-am + +install-info: install-info-am + +install-man: + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-pluginimgLTLIBRARIES + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-pluginimgLTLIBRARIES ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-pluginimgLTLIBRARIES \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-pluginimgLTLIBRARIES + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/src/others/mimesh/libg3d-0.0.8/plugins/image/Makefile.am b/src/others/mimesh/libg3d-0.0.8/plugins/image/Makefile.am new file mode 100644 index 0000000..1c40c96 --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/plugins/image/Makefile.am @@ -0,0 +1,36 @@ +pluginimgdir = $(pkglibdir)/plugins/image + +pluginimg_LTLIBRARIES = \ + img_bmp.la \ + img_sgi.la \ + img_dds.la + +if HAVE_GDKPIXBUF +pluginimg_LTLIBRARIES += img_gdkpixbuf.la +endif + +AM_CFLAGS = \ + -Wall -ansi -pedantic \ + -DG_LOG_DOMAIN=\"LibG3D\" \ + @DBG_CFLAGS@ -DDEBUG=@DEBUG@ \ + @GLIB_CFLAGS@ + +INCLUDES = -I$(top_srcdir)/include + +AM_LDFLAGS = \ + -no-undefined -module \ + @PLUGINS_LDFLAGS@ + +LIBTOOL += --quiet + +img_bmp_la_SOURCES = img_bmp.c +img_bmp_la_LIBADD = $(top_builddir)/src/libg3d.la @GLIB_LIBS@ +img_sgi_la_SOURCES = img_sgi.c +img_sgi_la_LIBADD = $(top_builddir)/src/libg3d.la @GLIB_LIBS@ +img_dds_la_SOURCES = img_dds.c +img_dds_la_LIBADD = $(top_builddir)/src/libg3d.la @GLIB_LIBS@ + +img_gdkpixbuf_la_CFLAGS = ${AM_CFLAGS} @GDKPIXBUF_CFLAGS@ +img_gdkpixbuf_la_SOURCES = img_gdkpixbuf.c +img_gdkpixbuf_la_LIBADD = $(top_builddir)/src/libg3d.la @GLIB_LIBS@ \ + @GDKPIXBUF_LIBS@ diff --git a/src/others/mimesh/libg3d-0.0.8/plugins/image/Makefile.in b/src/others/mimesh/libg3d-0.0.8/plugins/image/Makefile.in new file mode 100644 index 0000000..23bb6d6 --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/plugins/image/Makefile.in @@ -0,0 +1,552 @@ +# Makefile.in generated by automake 1.10.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +@HAVE_GDKPIXBUF_TRUE@am__append_1 = img_gdkpixbuf.la +subdir = plugins/image +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ + $(top_srcdir)/m4/glib-2.0.m4 $(top_srcdir)/m4/gtk-2.0.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/libxml2.m4 $(top_srcdir)/m4/win32.m4 \ + $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/include/g3d/config.h +CONFIG_CLEAN_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(pluginimgdir)" +pluginimgLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(pluginimg_LTLIBRARIES) +img_bmp_la_DEPENDENCIES = $(top_builddir)/src/libg3d.la +am_img_bmp_la_OBJECTS = img_bmp.lo +img_bmp_la_OBJECTS = $(am_img_bmp_la_OBJECTS) +img_dds_la_DEPENDENCIES = $(top_builddir)/src/libg3d.la +am_img_dds_la_OBJECTS = img_dds.lo +img_dds_la_OBJECTS = $(am_img_dds_la_OBJECTS) +img_gdkpixbuf_la_DEPENDENCIES = $(top_builddir)/src/libg3d.la +am_img_gdkpixbuf_la_OBJECTS = img_gdkpixbuf_la-img_gdkpixbuf.lo +img_gdkpixbuf_la_OBJECTS = $(am_img_gdkpixbuf_la_OBJECTS) +img_gdkpixbuf_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(img_gdkpixbuf_la_CFLAGS) \ + $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +@HAVE_GDKPIXBUF_TRUE@am_img_gdkpixbuf_la_rpath = -rpath \ +@HAVE_GDKPIXBUF_TRUE@ $(pluginimgdir) +img_sgi_la_DEPENDENCIES = $(top_builddir)/src/libg3d.la +am_img_sgi_la_OBJECTS = img_sgi.lo +img_sgi_la_OBJECTS = $(am_img_sgi_la_OBJECTS) +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include/g3d +depcomp = $(SHELL) $(top_srcdir)/config/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(img_bmp_la_SOURCES) $(img_dds_la_SOURCES) \ + $(img_gdkpixbuf_la_SOURCES) $(img_sgi_la_SOURCES) +DIST_SOURCES = $(img_bmp_la_SOURCES) $(img_dds_la_SOURCES) \ + $(img_gdkpixbuf_la_SOURCES) $(img_sgi_la_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DBG_CFLAGS = @DBG_CFLAGS@ +DEBUG = @DEBUG@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GDKPIXBUF_CFLAGS = @GDKPIXBUF_CFLAGS@ +GDKPIXBUF_LIBS = @GDKPIXBUF_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GOBJECT_QUERY = @GOBJECT_QUERY@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTK_CFLAGS = @GTK_CFLAGS@ +GTK_LIBS = @GTK_LIBS@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LEX = @LEX@ +LEXLIB = @LEXLIB@ +LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ +LIBGSF_CFLAGS = @LIBGSF_CFLAGS@ +LIBGSF_LIBS = @LIBGSF_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ --quiet +LIBXML2_CFLAGS = @LIBXML2_CFLAGS@ +LIBXML2_LIBS = @LIBXML2_LIBS@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LTVERSION = @LTVERSION@ +MAGIC_LIBS = @MAGIC_LIBS@ +MAKEINFO = @MAKEINFO@ +MATH_LIBS = @MATH_LIBS@ +MKDIR_P = @MKDIR_P@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PLUGINS_LDFLAGS = @PLUGINS_LDFLAGS@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +XML2_CONFIG = @XML2_CONFIG@ +XML_CPPFLAGS = @XML_CPPFLAGS@ +XML_LIBS = @XML_LIBS@ +Z_CFLAGS = @Z_CFLAGS@ +Z_LIBS = @Z_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +pluginimgdir = $(pkglibdir)/plugins/image +pluginimg_LTLIBRARIES = img_bmp.la img_sgi.la img_dds.la \ + $(am__append_1) +AM_CFLAGS = \ + -Wall -ansi -pedantic \ + -DG_LOG_DOMAIN=\"LibG3D\" \ + @DBG_CFLAGS@ -DDEBUG=@DEBUG@ \ + @GLIB_CFLAGS@ + +INCLUDES = -I$(top_srcdir)/include +AM_LDFLAGS = \ + -no-undefined -module \ + @PLUGINS_LDFLAGS@ + +img_bmp_la_SOURCES = img_bmp.c +img_bmp_la_LIBADD = $(top_builddir)/src/libg3d.la @GLIB_LIBS@ +img_sgi_la_SOURCES = img_sgi.c +img_sgi_la_LIBADD = $(top_builddir)/src/libg3d.la @GLIB_LIBS@ +img_dds_la_SOURCES = img_dds.c +img_dds_la_LIBADD = $(top_builddir)/src/libg3d.la @GLIB_LIBS@ +img_gdkpixbuf_la_CFLAGS = ${AM_CFLAGS} @GDKPIXBUF_CFLAGS@ +img_gdkpixbuf_la_SOURCES = img_gdkpixbuf.c +img_gdkpixbuf_la_LIBADD = $(top_builddir)/src/libg3d.la @GLIB_LIBS@ \ + @GDKPIXBUF_LIBS@ + +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plugins/image/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu plugins/image/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-pluginimgLTLIBRARIES: $(pluginimg_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(pluginimgdir)" || $(MKDIR_P) "$(DESTDIR)$(pluginimgdir)" + @list='$(pluginimg_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(pluginimgLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(pluginimgdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(pluginimgLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(pluginimgdir)/$$f"; \ + else :; fi; \ + done + +uninstall-pluginimgLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(pluginimg_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pluginimgdir)/$$p'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pluginimgdir)/$$p"; \ + done + +clean-pluginimgLTLIBRARIES: + -test -z "$(pluginimg_LTLIBRARIES)" || rm -f $(pluginimg_LTLIBRARIES) + @list='$(pluginimg_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +img_bmp.la: $(img_bmp_la_OBJECTS) $(img_bmp_la_DEPENDENCIES) + $(LINK) -rpath $(pluginimgdir) $(img_bmp_la_OBJECTS) $(img_bmp_la_LIBADD) $(LIBS) +img_dds.la: $(img_dds_la_OBJECTS) $(img_dds_la_DEPENDENCIES) + $(LINK) -rpath $(pluginimgdir) $(img_dds_la_OBJECTS) $(img_dds_la_LIBADD) $(LIBS) +img_gdkpixbuf.la: $(img_gdkpixbuf_la_OBJECTS) $(img_gdkpixbuf_la_DEPENDENCIES) + $(img_gdkpixbuf_la_LINK) $(am_img_gdkpixbuf_la_rpath) $(img_gdkpixbuf_la_OBJECTS) $(img_gdkpixbuf_la_LIBADD) $(LIBS) +img_sgi.la: $(img_sgi_la_OBJECTS) $(img_sgi_la_DEPENDENCIES) + $(LINK) -rpath $(pluginimgdir) $(img_sgi_la_OBJECTS) $(img_sgi_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/img_bmp.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/img_dds.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/img_gdkpixbuf_la-img_gdkpixbuf.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/img_sgi.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +img_gdkpixbuf_la-img_gdkpixbuf.lo: img_gdkpixbuf.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(img_gdkpixbuf_la_CFLAGS) $(CFLAGS) -MT img_gdkpixbuf_la-img_gdkpixbuf.lo -MD -MP -MF $(DEPDIR)/img_gdkpixbuf_la-img_gdkpixbuf.Tpo -c -o img_gdkpixbuf_la-img_gdkpixbuf.lo `test -f 'img_gdkpixbuf.c' || echo '$(srcdir)/'`img_gdkpixbuf.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/img_gdkpixbuf_la-img_gdkpixbuf.Tpo $(DEPDIR)/img_gdkpixbuf_la-img_gdkpixbuf.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='img_gdkpixbuf.c' object='img_gdkpixbuf_la-img_gdkpixbuf.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(img_gdkpixbuf_la_CFLAGS) $(CFLAGS) -c -o img_gdkpixbuf_la-img_gdkpixbuf.lo `test -f 'img_gdkpixbuf.c' || echo '$(srcdir)/'`img_gdkpixbuf.c + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) +installdirs: + for dir in "$(DESTDIR)$(pluginimgdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-pluginimgLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: install-pluginimgLTLIBRARIES + +install-dvi: install-dvi-am + +install-exec-am: + +install-html: install-html-am + +install-info: install-info-am + +install-man: + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-pluginimgLTLIBRARIES + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-pluginimgLTLIBRARIES ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-pluginimgLTLIBRARIES \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-pluginimgLTLIBRARIES + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/src/others/mimesh/libg3d-0.0.8/plugins/image/img_bmp.c b/src/others/mimesh/libg3d-0.0.8/plugins/image/img_bmp.c new file mode 100644 index 0000000..827997a --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/plugins/image/img_bmp.c @@ -0,0 +1,129 @@ +/* $Id$ */ + +/* + libg3d - 3D object loading library + + Copyright (C) 2005-2009 Markus Dahms + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include +#include +#include + +#include +#include + +EAPI +gboolean plugin_load_image_from_stream(G3DContext *context, G3DStream *stream, + G3DImage *image, gpointer user_data) +{ + guint32 filesize, offset, headsize, compression; + gint32 x, y, i; + guint32 ncolplanes, c; + + /* bitmap file always starts with 'BM' */ + if(g3d_stream_read_int16_le(stream) != ('B' | ('M' << 8))) { + g_warning("bitmap magic not found: image seems to be corrupt\n"); + return FALSE; + } + + image->name = g_strdup(stream->uri); + + filesize = g3d_stream_read_int32_le(stream); /* file size */ + g3d_stream_read_int32_le(stream); /* 2 x UINT16 reserved */ + offset = g3d_stream_read_int32_le(stream); /* offset of data */ + headsize = g3d_stream_read_int32_le(stream); /* size of header */ + image->width = g3d_stream_read_int32_le(stream); /* width */ + image->height = g3d_stream_read_int32_le(stream); /* height */ + ncolplanes = g3d_stream_read_int16_le(stream); /* num of color planes */ + image->depth = g3d_stream_read_int16_le(stream); /* bits per pixel */ + compression = g3d_stream_read_int32_le(stream); /* compression */ + g3d_stream_read_int32_le(stream); /* image size */ + g3d_stream_read_int32_le(stream); /* v/res (dpi) */ + g3d_stream_read_int32_le(stream); /* h/res (dpi) */ + +#if DEBUG > 0 + g_debug("BMP: %dx%dx%d (%d, 0x%x)", image->width, image->height, + image->depth, ncolplanes, compression); +#endif + + g3d_stream_seek(stream, offset, G_SEEK_SET); + +#define ALL32BIT +#ifndef ALL32BIT /* always 32bit for now.. */ + image->pixeldata = g_new0(guint8, + image->width * image->height * (image->depth / 8)); +#else + image->pixeldata = g_new0(guint8, image->width * image->height * 4); +#endif + + for(y = (image->height - 1); y >= 0; y --) { + for(x = 0; x < image->width; x ++) { + switch(image->depth) { + case 8: +#ifndef ALL32BIT + image->pixeldata[y * image->width + x] = + g3d_stream_read_int8(stream); +#else + c = g3d_stream_read_int8(stream); + for(i = 0; i < 3; i ++) + image->pixeldata[(y * image->width + x) * 4 + i] = c; + image->pixeldata[(y * image->width + x) * 4 + 3] = 0xFF; +#endif + break; + case 24: +#if 1 + /* read BGR */ + for(i = 2; i >= 0; i --) +#else + for(i = 0; i < 3; i ++) +#endif + image->pixeldata[(y * image->width + x) * 4 + i] = + g3d_stream_read_int8(stream); + image->pixeldata[(y * image->width + x) * 4 + 3] = 0xFF; + break; + default: + break; + } + } /* x */ +#if 1 + /* padding */ + for(i = x; i < ((image->width + 3) & ~(3)); i ++) + g3d_stream_read_int8(stream); +#endif + } /* y */ + image->depth = 32; +#if DEBUG > 2 + g_debug("bitmap successfully loaded"); +#endif + + return TRUE; +} + +EAPI +gchar *plugin_description(G3DContext *context) +{ + return g_strdup("Windows Bitmap images.\n" + "Author: Markus Dahms"); +} + +EAPI +gchar **plugin_extensions(G3DContext *context) +{ + return g_strsplit("bmp", ":", 0); +} + diff --git a/src/others/mimesh/libg3d-0.0.8/plugins/image/img_dds.c b/src/others/mimesh/libg3d-0.0.8/plugins/image/img_dds.c new file mode 100644 index 0000000..cf6c58f --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/plugins/image/img_dds.c @@ -0,0 +1,149 @@ +/* $Id$ */ + +/* + libg3d - 3D object loading library + + Copyright (C) 2005-2009 Markus Dahms + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include +#include + +#include +#include +#include + +static gboolean decode_dxt1(G3DImage *image, G3DStream *stream); + +EAPI +gboolean plugin_load_image_from_stream(G3DContext *context, G3DStream *stream, + G3DImage *image, gpointer user_data) +{ + guint32 magic, size, flags, depth; + guint32 pfsize, pfflags, pffourcc, pfbpp; + guint32 pfrmask, pfgmask, pfbmask, pfamask; + guint32 caps1, caps2; + gchar *sfourcc; + + magic = g3d_stream_read_int32_be(stream); + if(magic != G3D_IFF_MKID('D','D','S',' ')) { + g_warning("%s is not a DDS file", stream->uri); + return FALSE; + } + image->name = g_strdup(stream->uri); + + size = g3d_stream_read_int32_le(stream); + flags = g3d_stream_read_int32_le(stream); + image->height = g3d_stream_read_int32_le(stream); + image->width = g3d_stream_read_int32_le(stream); + g3d_stream_read_int32_le(stream); /* pitch or linesize */ + depth = g3d_stream_read_int32_le(stream); + g3d_stream_read_int32_le(stream); /* num mipmaps */ + + g3d_stream_skip(stream, 44); + + pfsize = g3d_stream_read_int32_le(stream); + pfflags = g3d_stream_read_int32_le(stream); + + pffourcc = g3d_stream_read_int32_be(stream); + sfourcc = g3d_iff_id_to_text(pffourcc); + + pfbpp = g3d_stream_read_int32_le(stream); + pfrmask = g3d_stream_read_int32_le(stream); + pfgmask = g3d_stream_read_int32_le(stream); + pfbmask = g3d_stream_read_int32_le(stream); + pfamask = g3d_stream_read_int32_le(stream); + caps1 = g3d_stream_read_int32_le(stream); + caps2 = g3d_stream_read_int32_le(stream); + + g3d_stream_skip(stream, 12); + +#if DEBUG > 0 + g_debug("DDS: %ux%u %s 0x%08x", image->width, image->height, + sfourcc, pfflags); + g_debug("DDS: masks: 0x%04x, 0x%04x, 0x%04x, 0x%04x", + pfrmask, pfgmask, pfbmask, pfamask); +#endif + + image->pixeldata = g_new0(guint8, image->width * image->height * 4); + + switch(pffourcc) { + case G3D_IFF_MKID('D','X','T','1'): + decode_dxt1(image, stream); + break; + default: + g_warning("DDS: unsupported FOURCC: %s", sfourcc); + } + + g_free(sfourcc); + return TRUE; +} + +EAPI +gchar *plugin_description(G3DContext *context) +{ + return g_strdup("DDS textures.\n" + "Author: Markus Dahms"); +} + +EAPI +gchar **plugin_extensions(G3DContext *context) +{ + return g_strsplit("dds", ":", 0); +} + +/*****************************************************************************/ + +static void decode_rgb565(guint16 c, G3DFloat *r, G3DFloat *g, G3DFloat *b) +{ + *r = ((c & 0xF800) >> 11) / 32.0; + *g = ((c & 0x07E0) >> 5) / 64.0; + *b = (c & 0x001F) / 32.0; +} + +static gboolean decode_dxt1(G3DImage *image, G3DStream *stream) +{ + gint32 x, y, i, j; + guint32 index; + G3DFloat r, g, b, r1, r2, g1, g2, b1, b2; + guint8 line, v2; + + for(y = 0; y < image->height; y += 4) { + for(x = 0; x < image->width; x += 4) { + decode_rgb565(g3d_stream_read_int16_le(stream), &r1, &g1, &b1); + decode_rgb565(g3d_stream_read_int16_le(stream), &r2, &g2, &b2); + for(j = 0; j < 4; j ++) { + line = g3d_stream_read_int8(stream); + for(i = 0; i < 4; i ++) { + v2 = line & 0x3; + line >>= 2; + r = r1 + ((r2 - r1) / 3.0) * v2; + g = g1 + ((g2 - g1) / 3.0) * v2; + b = b1 + ((b2 - b1) / 3.0) * v2; + index = ((image->height - 4) - y + j) * + image->width + x + i; + image->pixeldata[index * 4 + 0] = r * 255.0; + image->pixeldata[index * 4 + 1] = g * 255.0; + image->pixeldata[index * 4 + 2] = b * 255.0; + image->pixeldata[index * 4 + 3] = 0xFF; + } + } + } + } + + return TRUE; +} diff --git a/src/others/mimesh/libg3d-0.0.8/plugins/image/img_gdkpixbuf.c b/src/others/mimesh/libg3d-0.0.8/plugins/image/img_gdkpixbuf.c new file mode 100644 index 0000000..725981d --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/plugins/image/img_gdkpixbuf.c @@ -0,0 +1,210 @@ +/* $Id$ */ + +/* + libg3d - 3D object loading library + + Copyright (C) 2005-2009 Markus Dahms + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include +#include +#include +#include + +#include +#include + +#include +#include + +static gboolean gdkpixbuf_init(void); +static gboolean gdkpixbuf_postprocess(GdkPixbuf *pixbuf, G3DImage *image, + const gchar *uri); + +#define BUFSIZE 1024 + +EAPI +gboolean plugin_load_image_from_stream(G3DContext *context, G3DStream *stream, + G3DImage *image, gpointer user_data) +{ + GdkPixbuf *pixbuf; + GdkPixbufLoader *loader; + GError *error = NULL; + guint8 buffer[BUFSIZE]; + gsize n; + gboolean retval; + + if(!gdkpixbuf_init()) + return FALSE; + + loader = gdk_pixbuf_loader_new(); + if (NULL == loader) + { + g_warning("gdkpixbuf - plugin_load_image_from_stream(): no loader"); + return FALSE; + } + while(!g3d_stream_eof(stream)) { + n = g3d_stream_read(stream, buffer, BUFSIZE); + if(0 >= n) + break; + if(!gdk_pixbuf_loader_write(loader, buffer, n, &error)) { + g_warning("error loading image data from stream: %s", + error->message); + g_error_free(error); + g_object_unref(loader); + return FALSE; + } + } + + if(!gdk_pixbuf_loader_close(loader, &error)) { + g_warning("error loading image data from stream: %s", + error->message); + g_error_free(error); + g_object_unref(loader); + return FALSE; + } + + pixbuf = gdk_pixbuf_loader_get_pixbuf(loader); + gdk_pixbuf_ref(pixbuf); + + retval = gdkpixbuf_postprocess(pixbuf, image, stream->uri); + + g_object_unref(loader); + return retval; +} + +EAPI +gchar *plugin_description(G3DContext *context) +{ + return g_strdup("Read most image formats using the GdkPixbuf library."); +} + +EAPI +gchar **plugin_extensions(G3DContext *context) +{ + gchar *extensions = g_strdup(""); + gchar **retval; + gchar *tmp, **ext; + GSList *fitem; + GdkPixbufFormat *format; + + fitem = gdk_pixbuf_get_formats(); + while(fitem) + { + gboolean doit = TRUE; + + format = (GdkPixbufFormat *)fitem->data; + ext = gdk_pixbuf_format_get_extensions(format); + + if (0 == g_strcmp0("bmp", *ext)) + doit = FALSE; + else if (0 == g_strcmp0("jpg", *ext)) + doit = FALSE; + else if (0 == g_strcmp0("jpeg", *ext)) + doit = FALSE; + else if (0 == g_strcmp0("jfif", *ext)) + doit = FALSE; + else if (0 == g_strcmp0("jif", *ext)) + doit = FALSE; + + if (doit) + { + tmp = g_strdup_printf("%s%s%s", extensions, strlen(extensions) ? ":" : "", g_strjoinv(":", ext)); + g_free(extensions); + extensions = tmp; + } + fitem = fitem->next; + } + + retval = g_strsplit(extensions, ":", 0); + g_free(extensions); + return retval; +} + +/*****************************************************************************/ + +static gboolean gdkpixbuf_init(void) +{ + static gboolean init = TRUE; + + if(init) { + /* initialize GDK */ + /* FIXME: problem if already initialized with gtk_init()? */ + gint argc = 0; + if(!gdk_init_check(&argc, NULL)) + return FALSE; + init = FALSE; + } + return TRUE; +} + +static gboolean gdkpixbuf_postprocess(GdkPixbuf *pixbuf, G3DImage *image, + const gchar *uri) +{ + guint32 x, y, nchannels; + guchar *p; + + if(gdk_pixbuf_get_colorspace(pixbuf) != GDK_COLORSPACE_RGB) { + g_warning("GdkPixbuf: %s: colorspace is not RGB", uri); + gdk_pixbuf_unref(pixbuf); + return FALSE; + } + + nchannels = gdk_pixbuf_get_n_channels(pixbuf); + if(nchannels < 3) + { + g_warning("GdkPixbuf: %s: has only %d channels", uri, + gdk_pixbuf_get_n_channels(pixbuf)); + gdk_pixbuf_unref(pixbuf); + return FALSE; + } + + image->width = gdk_pixbuf_get_width(pixbuf); + image->height = gdk_pixbuf_get_height(pixbuf); + image->depth = 32; + image->name = g_path_get_basename(uri); + image->pixeldata = g_new0(guint8, image->width * image->height * 4); + + for(y = 0; y < image->height; y ++) + for(x = 0; x < image->width; x ++) + { + p = gdk_pixbuf_get_pixels(pixbuf) + y * + gdk_pixbuf_get_rowstride(pixbuf) + x * nchannels; + + image->pixeldata[(y * image->width + x) * 4 + 0] = p[0]; + image->pixeldata[(y * image->width + x) * 4 + 1] = p[1]; + image->pixeldata[(y * image->width + x) * 4 + 2] = p[2]; + if(gdk_pixbuf_get_n_channels(pixbuf) >= 4) + image->pixeldata[(y * image->width + x) * 4 + 3] = p[3]; + } + + /* set alpha to 1.0 */ + if(gdk_pixbuf_get_n_channels(pixbuf) < 4) + for(y = 0; y < image->height; y ++) + for(x = 0; x < image->width; x ++) + image->pixeldata[(y * image->width + x) * 4 + 3] = 0xFF; + + gdk_pixbuf_unref(pixbuf); + +#if DEBUG > 0 + g_print("GdkPixbuf: image '%s' loaded (%dx%d)\n", + image->name, image->width, image->height); +#endif + + return TRUE; +} + diff --git a/src/others/mimesh/libg3d-0.0.8/plugins/image/img_jpeg.c b/src/others/mimesh/libg3d-0.0.8/plugins/image/img_jpeg.c new file mode 100644 index 0000000..138f26b --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/plugins/image/img_jpeg.c @@ -0,0 +1,437 @@ +/* $Id$ */ + +/* + libg3d - 3D object loading library + + Copyright (c) 2011, Dawid Seikel. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + + +/* This is an ugly collection of styles, I'll fix it up later, just want to get it pushed up now. lol */ + +#include +#include +#include + +#include +#include + +#include +#include +#include + +#define BUFSIZE 1024 + +typedef struct +{ + struct jpeg_source_mgr pub; /* public fields */ + + G3DStream *stream; /* source stream */ + JOCTET *buffer; /* start of buffer */ + boolean start_of_file; /* have we gotten any data yet? */ +} my_source_mgr; + +typedef my_source_mgr *my_src_ptr; + +/* Stuff to stop jpeglib from exit() when things fail. */ +struct my_error_mgr +{ + struct jpeg_error_mgr pub; /* "public" fields */ + jmp_buf setjmp_buffer; /* for return to caller */ +}; + +typedef struct my_error_mgr *my_error_ptr; + +/* + * Here's the routine that will replace the standard error_exit method: + */ + +METHODDEF(void) +my_error_exit (j_common_ptr cinfo) +{ + /* cinfo->err really points to a my_error_mgr struct, so coerce pointer */ + my_error_ptr myerr = (my_error_ptr) cinfo->err; + + /* Always display the message. */ + /* We could postpone this until after returning, if we chose. */ + (*cinfo->err->output_message) (cinfo); + + /* Return control to the setjmp point */ + longjmp(myerr->setjmp_buffer, 1); +} + + +static void init_stream_source (j_decompress_ptr cinfo); +static boolean fill_stream_input_buffer (j_decompress_ptr cinfo); +static void skip_input_data (j_decompress_ptr cinfo, long num_bytes); +/*static void resync_to_restart (j_decompress_ptr cinfo, int desired);*/ +static void term_source (j_decompress_ptr cinfo); +static void jpeg_stream_src(struct jpeg_decompress_struct *cinfo, G3DStream *stream); + + +EAPI +gchar *plugin_description(G3DContext *context) +{ + return g_strdup("JPEG images."); +} + +EAPI +gchar **plugin_extensions(G3DContext *context) +{ + return g_strsplit("jpg:jpeg:jpe:jfif:jif", ":", 0); +} + +EAPI +gboolean plugin_load_image_from_stream(G3DContext *context, G3DStream *stream, G3DImage *image, gpointer user_data) +{ + gsize n; + gboolean retval; + guint32 x, y, nchannels; + + /* This struct contains the JPEG decompression parameters and pointers to + * working space (which is allocated as needed by the JPEG library). + */ + struct jpeg_decompress_struct cinfo; + /* We use our private extension JPEG error handler. + * Note that this struct must live as long as the main JPEG parameter + * struct, to avoid dangling-pointer problems. + */ + struct my_error_mgr jerr; + /* More stuff */ + JSAMPARRAY buffer; /* Output row buffer */ + int row_stride; /* physical row width in output buffer */ + + /* Step 1: allocate and initialize JPEG decompression object */ + + /* We set up the normal JPEG error routines, then override error_exit. */ + cinfo.err = jpeg_std_error(&jerr.pub); + jerr.pub.error_exit = my_error_exit; + /* Establish the setjmp return context for my_error_exit to use. */ + if (setjmp(jerr.setjmp_buffer)) { + /* If we get here, the JPEG code has signaled an error. + * We need to clean up the JPEG object, close the input file, and return. + */ + jpeg_destroy_decompress(&cinfo); + return 0; + } + /* Now we can initialize the JPEG decompression object. */ + jpeg_create_decompress(&cinfo); + + /* Step 2: specify data source (eg, a file) */ + + jpeg_stream_src(&cinfo, stream); + + /* Step 3: read file parameters with jpeg_read_header() */ + + (void) jpeg_read_header(&cinfo, TRUE); + /* We can ignore the return value from jpeg_read_header since + * (a) suspension is not possible with the stdio data source, and + * (b) we passed TRUE to reject a tables-only JPEG file as an error. + * See libjpeg.txt for more info. + */ + + /* Step 4: set parameters for decompression */ + + if (cinfo.jpeg_color_space != JCS_RGB) + { + g_warning("Jpeg plugin: %s: colorspace is not RGB, converting.", stream->uri); + cinfo.out_color_space = JCS_RGB; + } + + + /* Step 5: Start decompressor */ + + (void) jpeg_start_decompress(&cinfo); + /* We can ignore the return value since suspension is not possible + * with the stdio data source. + */ + + /* We may need to do some setup of our own at this point before reading + * the data. After jpeg_start_decompress() we have the correct scaled + * output image dimensions available, as well as the output colormap + * if we asked for color quantization. + * In this example, we need to make an output work buffer of the right size. + */ + /* JSAMPLEs per row in output buffer */ + row_stride = cinfo.output_width * cinfo.output_components; + /* Make a one-row-high sample array that will go away when done with image */ + buffer = (*cinfo.mem->alloc_sarray) + ((j_common_ptr) &cinfo, JPOOL_IMAGE, row_stride, 1); + +/* +//output_width image width and height, as scaled +//output_height +//out_color_components # of color components in out_color_space +//output_components # of color components returned per pixel +//colormap the selected colormap, if any +//actual_number_of_colors number of entries in colormap +*/ + nchannels = cinfo.output_components; + if(nchannels < 3) + { + g_warning("Jpeg plugin: %s: has only %d channels", stream->uri, nchannels); + jpeg_destroy_decompress(&cinfo); + return FALSE; + } + + image->width = cinfo.output_width; + image->height = cinfo.output_height; + image->depth = 32; + image->name = g_path_get_basename(stream->uri); + image->pixeldata = g_new0(guint8, image->width * image->height * 4); + + + /* Step 6: while (scan lines remain to be read) */ + /* jpeg_read_scanlines(...); */ + + /* Here we use the library's state variable cinfo.output_scanline as the + * loop counter, so that we don't have to keep track ourselves. + */ + y = 0; + while (cinfo.output_scanline < cinfo.output_height) + { + /* jpeg_read_scanlines expects an array of pointers to scanlines. + * Here the array is only one element long, but you could ask for + * more than one scanline at a time if that's more convenient. + */ + (void) jpeg_read_scanlines(&cinfo, buffer, 1); +/* for(y = 0; y < image->height; y ++) */ + for(x = 0; x < image->width; x ++) + { + JSAMPROW p = buffer[0] + x * nchannels; + + image->pixeldata[(y * image->width + x) * 4 + 0] = GETJSAMPLE(p[0]); + image->pixeldata[(y * image->width + x) * 4 + 1] = GETJSAMPLE(p[1]); + image->pixeldata[(y * image->width + x) * 4 + 2] = GETJSAMPLE(p[2]); + if(nchannels >= 4) + image->pixeldata[(y * image->width + x) * 4 + 3] = GETJSAMPLE(p[3]); + } + y++; + } + + /* set alpha to 1.0 */ + if(nchannels < 4) + for(y = 0; y < image->height; y ++) + for(x = 0; x < image->width; x ++) + image->pixeldata[(y * image->width + x) * 4 + 3] = 0xFF; + + /* Step 7: Finish decompression */ + + (void) jpeg_finish_decompress(&cinfo); + /* We can ignore the return value since suspension is not possible + * with the stdio data source. + */ + + /* Step 8: Release JPEG decompression object */ + + /* This is an important step since it will release a good deal of memory. */ + jpeg_destroy_decompress(&cinfo); + + /* At this point you may want to check to see whether any corrupt-data + * warnings occurred (test whether jerr.pub.num_warnings is nonzero). + */ + + return TRUE; +} + +/* + * SOME FINE POINTS: + * + * In the above code, we ignored the return value of jpeg_read_scanlines, + * which is the number of scanlines actually read. We could get away with + * this because we asked for only one line at a time and we weren't using + * a suspending data source. See libjpeg.txt for more info. + * + * We cheated a bit by calling alloc_sarray() after jpeg_start_decompress(); + * we should have done it beforehand to ensure that the space would be + * counted against the JPEG max_memory setting. In some systems the above + * code would risk an out-of-memory error. However, in general we don't + * know the output image dimensions before jpeg_start_decompress(), unless we + * call jpeg_calc_output_dimensions(). See libjpeg.txt for more about this. + * + * Scanlines are returned in the same order as they appear in the JPEG file, + * which is standardly top-to-bottom. If you must emit data bottom-to-top, + * you can use one of the virtual arrays provided by the JPEG memory manager + * to invert the data. See wrbmp.c for an example. + * + * As with compression, some operating modes may require temporary files. + * On some systems you may need to set up a signal handler to ensure that + * temporary files are deleted if the program is interrupted. See libjpeg.txt. + */ + + + const JOCTET * next_input_byte; /* => next byte to read from buffer */ + size_t bytes_in_buffer; /* # of bytes remaining in buffer */ + +/* + Initialize source. This is called by jpeg_read_header() before any + data is actually read. Unlike init_destination(), it may leave + bytes_in_buffer set to 0 (in which case a fill_input_buffer() call + will occur immediately). +*/ + +static void init_stream_source (j_decompress_ptr cinfo) +{ + my_src_ptr src = (my_src_ptr) cinfo->src; + + /* We reset the empty-input-file flag for each image, + * but we don't clear the input buffer. + * This is correct behavior for reading a series of images from one source. + */ + src->start_of_file = TRUE; +} + +/* + This is called whenever bytes_in_buffer has reached zero and more + data is wanted. In typical applications, it should read fresh data + into the buffer (ignoring the current state of next_input_byte and + bytes_in_buffer), reset the pointer & count to the start of the + buffer, and return TRUE indicating that the buffer has been reloaded. + It is not necessary to fill the buffer entirely, only to obtain at + least one more byte. bytes_in_buffer MUST be set to a positive value + if TRUE is returned. A FALSE return should only be used when I/O + suspension is desired (this mode is discussed in the next section). +*/ +static boolean fill_stream_input_buffer (j_decompress_ptr cinfo) +{ + my_src_ptr src = (my_src_ptr) cinfo->src; + size_t nbytes = 0; + + if (!g3d_stream_eof(src->stream)) + nbytes = g3d_stream_read(src->stream, src->buffer, BUFSIZE); + + if (nbytes <= 0) + { + if (src->start_of_file) /* Treat empty input file as fatal error */ + ERREXIT(cinfo, JERR_INPUT_EMPTY); + WARNMS(cinfo, JWRN_JPEG_EOF); + /* Insert a fake EOI marker */ + src->buffer[0] = (JOCTET) 0xFF; + src->buffer[1] = (JOCTET) JPEG_EOI; + nbytes = 2; + } + + src->pub.next_input_byte = src->buffer; + src->pub.bytes_in_buffer = nbytes; + src->start_of_file = FALSE; + + return TRUE; +} + +/* + Skip num_bytes worth of data. The buffer pointer and count should + be advanced over num_bytes input bytes, refilling the buffer as + needed. This is used to skip over a potentially large amount of + uninteresting data (such as an APPn marker). In some applications + it may be possible to optimize away the reading of the skipped data, + but it's not clear that being smart is worth much trouble; large + skips are uncommon. bytes_in_buffer may be zero on return. + A zero or negative skip count should be treated as a no-op. +*/ +static void skip_input_data (j_decompress_ptr cinfo, long num_bytes) +{ + struct jpeg_source_mgr * src = cinfo->src; + + /* Just a dumb implementation for now. Could use fseek() except + * it doesn't work on pipes. Not clear that being smart is worth + * any trouble anyway --- large skips are infrequent. + */ + if (num_bytes > 0) + { + while (num_bytes > (long) src->bytes_in_buffer) + { + num_bytes -= (long) src->bytes_in_buffer; + (void) (*src->fill_input_buffer) (cinfo); + /* note we assume that fill_input_buffer will never return FALSE, + * so suspension need not be handled. + */ + } + src->next_input_byte += (size_t) num_bytes; + src->bytes_in_buffer -= (size_t) num_bytes; + } +} + +/* + This routine is called only when the decompressor has failed to find + a restart (RSTn) marker where one is expected. Its mission is to + find a suitable point for resuming decompression. For most + applications, we recommend that you just use the default resync + procedure, jpeg_resync_to_restart(). However, if you are able to back + up in the input data stream, or if you have a-priori knowledge about + the likely location of restart markers, you may be able to do better. + Read the read_restart_marker() and jpeg_resync_to_restart() routines + in jdmarker.c if you think you'd like to implement your own resync + procedure. +*/ +/* +//static void resync_to_restart (j_decompress_ptr cinfo, int desired) +//{ +//} +*/ + +/* + Terminate source --- called by jpeg_finish_decompress() after all + data has been read. Often a no-op. +*/ +static void term_source (j_decompress_ptr cinfo) +{ + /* no work necessary here */ +} +/* +For both fill_input_buffer() and skip_input_data(), there is no such thing as an EOF return. If the end of the file has been reached, the routine has a choice of exiting via ERREXIT() or inserting fake data into the buffer. In most cases, generating a warning message and inserting a fake EOI marker is the best course of action --- this will allow the decompressor to output however much of the image is there. In pathological cases, the decompressor + +may swallow the EOI and again demand data ... just keep feeding it fake EOIs. + +jdatasrc.c illustrates the recommended error recovery behavior. + +term_source() is NOT called by jpeg_abort() or jpeg_destroy(). If you want the source manager to be cleaned up during an abort, you must do it yourself. + +You will also need code to create a jpeg_source_mgr struct, fill in its method pointers, and insert a pointer to the struct into the "src" field of the JPEG decompression object. This can be done in-line in your setup code if you like, but it's probably cleaner to provide a separate routine similar to the jpeg_stdio_src() routine of the supplied source manager. + +For more information, consult the stdio source and destination managers in jdatasrc.c and jdatadst.c. +*/ + +static void jpeg_stream_src(struct jpeg_decompress_struct *cinfo, G3DStream *stream) +{ + my_source_mgr *src; + + if (stream == NULL) + ERREXIT(cinfo, JERR_INPUT_EMPTY); + + /* The source object is made permanent so that a series of JPEG images + * can be read from the same buffer by calling jpeg_mem_src only before + * the first one. + */ + if (cinfo->src == NULL) { /* first time for this JPEG object? */ + cinfo->src = (struct jpeg_source_mgr *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, sizeof(my_source_mgr)); + + src = (my_src_ptr) cinfo->src; + src->buffer = (JOCTET *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, BUFSIZE * sizeof(JOCTET)); + } + + src = (my_src_ptr) cinfo->src; + src->pub.init_source = init_stream_source; + src->pub.fill_input_buffer = fill_stream_input_buffer; + src->pub.skip_input_data = skip_input_data; + src->pub.resync_to_restart = jpeg_resync_to_restart; /* use default method */ + src->pub.term_source = term_source; + src->stream = stream; + src->pub.bytes_in_buffer = 0; /* forces fill_input_buffer on first read */ + src->pub.next_input_byte = NULL; /* until buffer loaded */ +} + diff --git a/src/others/mimesh/libg3d-0.0.8/plugins/image/img_sgi.c b/src/others/mimesh/libg3d-0.0.8/plugins/image/img_sgi.c new file mode 100644 index 0000000..71dd583 --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/plugins/image/img_sgi.c @@ -0,0 +1,181 @@ +/* $Id$ */ + +/* + libg3d - 3D object loading library + + Copyright (C) 2005-2009 Markus Dahms + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include +#include +#include + +#include +#include + +#define SGI_STORAGE_VERBATIM 0 +#define SGI_STORAGE_RLE 1 + +EAPI +gboolean plugin_load_image_from_stream(G3DContext *context, G3DStream *stream, + G3DImage *image, gpointer user_data) +{ + guint32 cmap, planes, x, y, p; + guint16 dims; + guint8 storage, bpc; + gchar name[80]; + + if(g3d_stream_read_int16_be(stream) != 474) { + g_warning("file '%s' is not a SGI RGB file", stream->uri); + return FALSE; + } + + storage = g3d_stream_read_int8(stream); + bpc = g3d_stream_read_int8(stream); + dims = g3d_stream_read_int16_be(stream); + + if(bpc != 1) { + g_warning("SGI: %s: bpc != 1 -- unsupported", stream->uri); + return FALSE; + } + + image->width = g3d_stream_read_int16_be(stream); + image->height = g3d_stream_read_int16_be(stream); + + planes = g3d_stream_read_int16_be(stream); /* ZSIZE */ + image->depth = 32; + g3d_stream_read_int32_be(stream); /* PIXMIN */ + g3d_stream_read_int32_be(stream); /* PIXMAX */ + g3d_stream_read_int32_be(stream); /* DUMMY */ + g3d_stream_read(stream, name, 80); + + if(strlen(name) > 0) { +#if DEBUG > 0 + g_debug("SGI: image name: %s", name); +#endif + image->name = g_strdup(name); + } else { + image->name = g_strdup(stream->uri); + } + + cmap = g3d_stream_read_int32_be(stream); /* COLORMAP */ + g3d_stream_skip(stream, 404); + +#if DEBUG > 0 + g_debug("SGI: %dx%dx%d, %d bpc, colormap: 0x%02x", + image->width, image->height, planes, bpc, cmap); +#endif + /* end of header */ + + image->pixeldata = g_new0(guint8, image->width * image->height * 4); + + if(storage == SGI_STORAGE_VERBATIM) { + for(p = 0; p < planes; p ++) { + for(y = 0; y < image->height; y ++) { + for(x = 0; x < image->width; x ++) { + image->pixeldata[(y * image->width + x) * 4 + p] = + g3d_stream_read_int8(stream); + + if(planes == 1) { + /* greyscale: g = r; b = r; */ + image->pixeldata[(y * image->width + x) * 4 + 1] = + image->pixeldata[(y * image->width + x) * 4]; + image->pixeldata[(y * image->width + x) * 4 + 2] = + image->pixeldata[(y * image->width + x) * 4]; + } + } /* x */ + } /* y */ + } /* p */ + } /* verbatim */ + else /* RLE */ { + guint32 *starttab, *lengthtab, rleoff, rlelen; + guint8 cnt, pixel; + + starttab = g_new0(guint32, image->height * planes); + lengthtab = g_new0(guint32, image->height * planes); + + /* read starttab */ + for(p = 0; p < planes; p ++) + for(y = 0; y < image->height; y ++) + starttab[y * planes + p] = g3d_stream_read_int32_be(stream); + /* read lengthtab */ + for(p = 0; p < planes; p ++) + for(y = 0; y < image->height; y ++) + lengthtab[y * planes + p] = g3d_stream_read_int32_be(stream); + + /* read image data */ + for(p = 0; p < planes; p ++) + for(y = 0; y < image->height; y ++) + { + rleoff = starttab[y * planes + p]; + rlelen = lengthtab[y * planes + p]; + + g3d_stream_seek(stream, rleoff, G_SEEK_SET); + + x = 0; + + while(1) { + pixel = g3d_stream_read_int8(stream); + cnt = pixel & 0x7F; + + if(cnt == 0) + break; + + if(pixel & 0x80) { + /* copy n bytes */ + while(cnt --) { + image->pixeldata[(y * image->width + x) * 4 + p] = + g3d_stream_read_int8(stream); + x ++; + } + } else { + /* repeat next byte n times */ + pixel = g3d_stream_read_int8(stream); + while(cnt --) { + image->pixeldata[(y * image->width + x) * 4 + p] = + pixel; + x ++; + } + } + } + } + + g_free(starttab); + g_free(lengthtab); + } + + /* set alpha to 1.0 */ + if(planes < 4) + for(y = 0; y < image->height; y ++) + for(x = 0; x < image->width; x ++) + image->pixeldata[(y * image->width + x) * 4 + 3] = 0xFF; + + return TRUE; +} + +EAPI +gchar *plugin_description(G3DContext *context) +{ + return g_strdup("SGI RGB images."); +} + +EAPI +gchar **plugin_extensions(G3DContext *context) +{ + return g_strsplit("rgb:rgba:sgi", ":", 0); +} + -- cgit v1.1