flam3-3.0.1/ 0000755 0001750 0001750 00000000000 11507100474 011162 5 ustar erik erik flam3-3.0.1/src/ 0000755 0001750 0001750 00000000000 11507100507 011746 5 ustar erik erik flam3-3.0.1/src/parser.h 0000644 0001750 0001750 00000002711 11363132164 013420 0 ustar erik erik /*
FLAM3 - cosmic recursive fractal flames
Copyright (C) 1992-2009 Spotworks LLC
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; either version 3 of the License, or
(at your option) any later version.
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, see .
*/
#ifndef parser_included
#define parser_included
#include "private.h"
int flam3_atoi(char *nstr);
double flam3_atof(char *nstr);
int var2n(const char *s);
int flam3_parse_hexformat_colors(char *colstr, flam3_genome *cp, int numcolors, int chan);
void scan_for_flame_nodes(xmlNode *cur_node, char *parent_file, int default_flag, flam3_genome **all_cp, int *all_ncps);
int parse_flame_element(xmlNode *flame_node, flam3_genome *loc_current_cp);
int parse_xform_xml(xmlNode *chld_node,flam3_xform *this_xform, int *num_xaos,
flam3_chaos_entry **xaos, int numstd, int motionxf);
void flam3_edit_print(FILE *f, xmlNodePtr editNode, int tabs, int formatting);
int flam3_interp_missing_colors(flam3_genome *cp);
#endif
flam3-3.0.1/src/Makefile.in 0000644 0001750 0001750 00000074770 11452725335 014045 0 ustar erik erik # Makefile.in generated by automake 1.11.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@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@
bin_PROGRAMS = flam3-animate$(EXEEXT) flam3-genome$(EXEEXT) \
flam3-render$(EXEEXT) flam3-convert$(EXEEXT)
subdir = .
DIST_COMMON = $(am__configure_deps) $(include_HEADERS) \
$(srcdir)/Makefile.am $(srcdir)/Makefile.in \
$(srcdir)/config.h.in $(srcdir)/flam3.pc.in \
$(top_srcdir)/configure COPYING config.guess config.sub \
install-sh ltmain.sh missing mkinstalldirs
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno config.status.lineno
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = config.h
CONFIG_CLEAN_FILES = flam3.pc
CONFIG_CLEAN_VPATH_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 = f=`echo $$p | sed -e 's|^.*/||'`;
am__install_max = 40
am__nobase_strip_setup = \
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
am__nobase_strip = \
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
am__nobase_list = $(am__nobase_strip_setup); \
for p in $$list; do echo "$$p $$p"; done | \
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
if (++n[$$2] == $(am__install_max)) \
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
END { for (dir in files) print dir, files[dir] }'
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" \
"$(DESTDIR)$(man1dir)" "$(DESTDIR)$(pkgconfigdir)" \
"$(DESTDIR)$(pkgdatadir)" "$(DESTDIR)$(includedir)"
LTLIBRARIES = $(lib_LTLIBRARIES)
libflam3_la_LIBADD =
am_libflam3_la_OBJECTS = flam3.lo filters.lo parser.lo variations.lo \
interpolation.lo palettes.lo jpeg.lo png.lo isaac.lo
libflam3_la_OBJECTS = $(am_libflam3_la_OBJECTS)
libflam3_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(libflam3_la_LDFLAGS) $(LDFLAGS) -o $@
PROGRAMS = $(bin_PROGRAMS)
am_flam3_animate_OBJECTS = flam3-animate.$(OBJEXT) docstring.$(OBJEXT)
flam3_animate_OBJECTS = $(am_flam3_animate_OBJECTS)
flam3_animate_DEPENDENCIES = libflam3.la
am_flam3_convert_OBJECTS = flam3-convert.$(OBJEXT) docstring.$(OBJEXT)
flam3_convert_OBJECTS = $(am_flam3_convert_OBJECTS)
flam3_convert_DEPENDENCIES = libflam3.la
am_flam3_genome_OBJECTS = flam3-genome.$(OBJEXT) docstring.$(OBJEXT)
flam3_genome_OBJECTS = $(am_flam3_genome_OBJECTS)
flam3_genome_DEPENDENCIES = libflam3.la
am_flam3_render_OBJECTS = flam3-render.$(OBJEXT) docstring.$(OBJEXT)
flam3_render_OBJECTS = $(am_flam3_render_OBJECTS)
flam3_render_DEPENDENCIES = libflam3.la
DEFAULT_INCLUDES = -I.@am__isrc@
depcomp =
am__depfiles_maybe =
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 = $(libflam3_la_SOURCES) $(flam3_animate_SOURCES) \
$(flam3_convert_SOURCES) $(flam3_genome_SOURCES) \
$(flam3_render_SOURCES)
DIST_SOURCES = $(libflam3_la_SOURCES) $(flam3_animate_SOURCES) \
$(flam3_convert_SOURCES) $(flam3_genome_SOURCES) \
$(flam3_render_SOURCES)
man1dir = $(mandir)/man1
NROFF = nroff
MANS = $(man1_MANS)
DATA = $(pkgconfig_DATA) $(pkgdata_DATA)
HEADERS = $(include_HEADERS)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
am__remove_distdir = \
{ test ! -d "$(distdir)" \
|| { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
&& rm -fr "$(distdir)"; }; }
DIST_ARCHIVES = $(distdir).tar.gz
GZIP_ENV = --best
distuninstallcheck_listfiles = find . -type f -print
distcleancheck_listfiles = find . -type f -print
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
XML2_CONFIG = @XML2_CONFIG@
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_DUMPBIN = @ac_ct_DUMPBIN@
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@
lt_ECHO = @lt_ECHO@
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_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
AUTOMAKE_OPTIONS = foreign no-dependencies
SVN_DEF = -D'SVN_REV="$(shell svnversion -n .)"'
AM_CFLAGS = -g -O3 -std=gnu99 -ffast-math -DPACKAGE_DATA_DIR=\"$(pkgdatadir)\" $(SVN_DEF)
ACLOCAL_AMFLAGS = -I m4
man1_MANS = flam3-animate.man flam3-genome.man flam3-render.man flam3-convert.man
lib_LTLIBRARIES = libflam3.la
include_HEADERS = flam3.h isaac.h isaacs.h rect.c
libflam3_la_SOURCES = flam3.c filters.c parser.c variations.c interpolation.c palettes.c jpeg.c png.c isaac.c
libflam3_la_LDFLAGS = -no-undefined -ljpeg -lpng -lz -lpthread
flam3_genome_SOURCES = flam3-genome.c docstring.c
flam3_genome_LDADD = libflam3.la -lm
flam3_animate_SOURCES = flam3-animate.c docstring.c
flam3_animate_LDADD = libflam3.la -lm
flam3_render_SOURCES = flam3-render.c docstring.c
flam3_render_LDADD = libflam3.la -lm
flam3_convert_SOURCES = flam3-convert.c docstring.c
flam3_convert_LDADD = libflam3.la -lm
pkgdata_DATA = flam3-palettes.xml
EXTRA_DIST = rect.c flam3.h palettes.h variations.h interpolation.h parser.h \
private.h isaac.h isaacs.h img.h test.flam3 vidres.flam3 \
flam3.dsw render.dsp animate.dsp genome.dsp convert.dsp \
mkinstalldirs README.txt COPYING.txt flam3-palettes.xml \
flam3-animate.man flam3-render.man flam3-genome.man flam3-convert.man
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = flam3.pc
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-am
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
am--refresh:
@:
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \
$(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
echo ' $(SHELL) ./config.status'; \
$(SHELL) ./config.status;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
$(SHELL) ./config.status --recheck
$(top_srcdir)/configure: $(am__configure_deps)
$(am__cd) $(srcdir) && $(AUTOCONF)
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
$(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
$(am__aclocal_m4_deps):
config.h: stamp-h1
@if test ! -f $@; then \
rm -f stamp-h1; \
$(MAKE) $(AM_MAKEFLAGS) stamp-h1; \
else :; fi
stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
@rm -f stamp-h1
cd $(top_builddir) && $(SHELL) ./config.status config.h
$(srcdir)/config.h.in: $(am__configure_deps)
($(am__cd) $(top_srcdir) && $(AUTOHEADER))
rm -f stamp-h1
touch $@
distclean-hdr:
-rm -f config.h stamp-h1
flam3.pc: $(top_builddir)/config.status $(srcdir)/flam3.pc.in
cd $(top_builddir) && $(SHELL) ./config.status $@
install-libLTLIBRARIES: $(lib_LTLIBRARIES)
@$(NORMAL_INSTALL)
test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"
@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
list2=; for p in $$list; do \
if test -f $$p; then \
list2="$$list2 $$p"; \
else :; fi; \
done; \
test -z "$$list2" || { \
echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
}
uninstall-libLTLIBRARIES:
@$(NORMAL_UNINSTALL)
@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
for p in $$list; do \
$(am__strip_dir) \
echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \
$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \
done
clean-libLTLIBRARIES:
-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
@list='$(lib_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
libflam3.la: $(libflam3_la_OBJECTS) $(libflam3_la_DEPENDENCIES)
$(libflam3_la_LINK) -rpath $(libdir) $(libflam3_la_OBJECTS) $(libflam3_la_LIBADD) $(LIBS)
install-binPROGRAMS: $(bin_PROGRAMS)
@$(NORMAL_INSTALL)
test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
for p in $$list; do echo "$$p $$p"; done | \
sed 's/$(EXEEXT)$$//' | \
while read p p1; do if test -f $$p || test -f $$p1; \
then echo "$$p"; echo "$$p"; else :; fi; \
done | \
sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
-e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
sed 'N;N;N;s,\n, ,g' | \
$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
{ d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
if ($$2 == $$4) files[d] = files[d] " " $$1; \
else { print "f", $$3 "/" $$4, $$1; } } \
END { for (d in files) print "f", d, files[d] }' | \
while read type dir files; do \
if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
test -z "$$files" || { \
echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
$(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
} \
; done
uninstall-binPROGRAMS:
@$(NORMAL_UNINSTALL)
@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
files=`for p in $$list; do echo "$$p"; done | \
sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
-e 's/$$/$(EXEEXT)/' `; \
test -n "$$list" || exit 0; \
echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
cd "$(DESTDIR)$(bindir)" && rm -f $$files
clean-binPROGRAMS:
@list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \
echo " rm -f" $$list; \
rm -f $$list || exit $$?; \
test -n "$(EXEEXT)" || exit 0; \
list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
echo " rm -f" $$list; \
rm -f $$list
flam3-animate$(EXEEXT): $(flam3_animate_OBJECTS) $(flam3_animate_DEPENDENCIES)
@rm -f flam3-animate$(EXEEXT)
$(LINK) $(flam3_animate_OBJECTS) $(flam3_animate_LDADD) $(LIBS)
flam3-convert$(EXEEXT): $(flam3_convert_OBJECTS) $(flam3_convert_DEPENDENCIES)
@rm -f flam3-convert$(EXEEXT)
$(LINK) $(flam3_convert_OBJECTS) $(flam3_convert_LDADD) $(LIBS)
flam3-genome$(EXEEXT): $(flam3_genome_OBJECTS) $(flam3_genome_DEPENDENCIES)
@rm -f flam3-genome$(EXEEXT)
$(LINK) $(flam3_genome_OBJECTS) $(flam3_genome_LDADD) $(LIBS)
flam3-render$(EXEEXT): $(flam3_render_OBJECTS) $(flam3_render_DEPENDENCIES)
@rm -f flam3-render$(EXEEXT)
$(LINK) $(flam3_render_OBJECTS) $(flam3_render_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
.c.o:
$(COMPILE) -c $<
.c.obj:
$(COMPILE) -c `$(CYGPATH_W) '$<'`
.c.lo:
$(LTCOMPILE) -c -o $@ $<
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool config.lt
install-man1: $(man1_MANS)
@$(NORMAL_INSTALL)
test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)"
@list='$(man1_MANS)'; test -n "$(man1dir)" || exit 0; \
{ for i in $$list; do echo "$$i"; done; \
} | while read p; do \
if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; echo "$$p"; \
done | \
sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
-e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
sed 'N;N;s,\n, ,g' | { \
list=; while read file base inst; do \
if test "$$base" = "$$inst"; then list="$$list $$file"; else \
echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
$(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \
fi; \
done; \
for i in $$list; do echo "$$i"; done | $(am__base_list) | \
while read files; do \
test -z "$$files" || { \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \
done; }
uninstall-man1:
@$(NORMAL_UNINSTALL)
@list='$(man1_MANS)'; test -n "$(man1dir)" || exit 0; \
files=`{ for i in $$list; do echo "$$i"; done; \
} | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
-e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
test -z "$$files" || { \
echo " ( cd '$(DESTDIR)$(man1dir)' && rm -f" $$files ")"; \
cd "$(DESTDIR)$(man1dir)" && rm -f $$files; }
install-pkgconfigDATA: $(pkgconfig_DATA)
@$(NORMAL_INSTALL)
test -z "$(pkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)"
@list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; \
done | $(am__base_list) | \
while read files; do \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \
done
uninstall-pkgconfigDATA:
@$(NORMAL_UNINSTALL)
@list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
test -n "$$files" || exit 0; \
echo " ( cd '$(DESTDIR)$(pkgconfigdir)' && rm -f" $$files ")"; \
cd "$(DESTDIR)$(pkgconfigdir)" && rm -f $$files
install-pkgdataDATA: $(pkgdata_DATA)
@$(NORMAL_INSTALL)
test -z "$(pkgdatadir)" || $(MKDIR_P) "$(DESTDIR)$(pkgdatadir)"
@list='$(pkgdata_DATA)'; test -n "$(pkgdatadir)" || list=; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; \
done | $(am__base_list) | \
while read files; do \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgdatadir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(pkgdatadir)" || exit $$?; \
done
uninstall-pkgdataDATA:
@$(NORMAL_UNINSTALL)
@list='$(pkgdata_DATA)'; test -n "$(pkgdatadir)" || list=; \
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
test -n "$$files" || exit 0; \
echo " ( cd '$(DESTDIR)$(pkgdatadir)' && rm -f" $$files ")"; \
cd "$(DESTDIR)$(pkgdatadir)" && rm -f $$files
install-includeHEADERS: $(include_HEADERS)
@$(NORMAL_INSTALL)
test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)"
@list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; \
done | $(am__base_list) | \
while read files; do \
echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \
$(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \
done
uninstall-includeHEADERS:
@$(NORMAL_UNINSTALL)
@list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
test -n "$$files" || exit 0; \
echo " ( cd '$(DESTDIR)$(includedir)' && rm -f" $$files ")"; \
cd "$(DESTDIR)$(includedir)" && rm -f $$files
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; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
set x; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) config.h.in $(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; }; }'`; \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
list='$(SOURCES) $(HEADERS) config.h.in $(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)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
@list='$(MANS)'; if test -n "$$list"; then \
list=`for p in $$list; do \
if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \
if test -n "$$list" && \
grep 'ab help2man is required to generate this page' $$list >/dev/null; then \
echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \
grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \
echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \
echo " typically \`make maintainer-clean' will remove them" >&2; \
exit 1; \
else :; fi; \
else :; fi
$(am__remove_distdir)
test -d "$(distdir)" || mkdir "$(distdir)"
@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 "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
-test -n "$(am__skip_mode_fix)" \
|| find "$(distdir)" -type d ! -perm -755 \
-exec chmod u+rwx,go+rx {} \; -o \
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
|| chmod -R a+r "$(distdir)"
dist-gzip: distdir
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
$(am__remove_distdir)
dist-bzip2: distdir
tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
$(am__remove_distdir)
dist-lzma: distdir
tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
$(am__remove_distdir)
dist-xz: distdir
tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz
$(am__remove_distdir)
dist-tarZ: distdir
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
$(am__remove_distdir)
dist-shar: distdir
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
$(am__remove_distdir)
dist-zip: distdir
-rm -f $(distdir).zip
zip -rq $(distdir).zip $(distdir)
$(am__remove_distdir)
dist dist-all: distdir
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
$(am__remove_distdir)
# This target untars the dist file and tries a VPATH configuration. Then
# it guarantees that the distribution is self-contained by making another
# tarfile.
distcheck: dist
case '$(DIST_ARCHIVES)' in \
*.tar.gz*) \
GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \
bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
*.tar.lzma*) \
lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\
*.tar.xz*) \
xz -dc $(distdir).tar.xz | $(am__untar) ;;\
*.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \
GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
*.zip*) \
unzip $(distdir).zip ;;\
esac
chmod -R a-w $(distdir); chmod a+w $(distdir)
mkdir $(distdir)/_build
mkdir $(distdir)/_inst
chmod a-w $(distdir)
test -d $(distdir)/_build || exit 0; \
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
&& am__cwd=`pwd` \
&& $(am__cd) $(distdir)/_build \
&& ../configure --srcdir=.. --prefix="$$dc_install_base" \
$(DISTCHECK_CONFIGURE_FLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
&& $(MAKE) $(AM_MAKEFLAGS) check \
&& $(MAKE) $(AM_MAKEFLAGS) install \
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
&& $(MAKE) $(AM_MAKEFLAGS) uninstall \
&& $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
distuninstallcheck \
&& chmod -R a-w "$$dc_install_base" \
&& ({ \
(cd ../.. && umask 077 && mkdir "$$dc_destdir") \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
} || { rm -rf "$$dc_destdir"; exit 1; }) \
&& rm -rf "$$dc_destdir" \
&& $(MAKE) $(AM_MAKEFLAGS) dist \
&& rm -rf $(DIST_ARCHIVES) \
&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
&& cd "$$am__cwd" \
|| exit 1
$(am__remove_distdir)
@(echo "$(distdir) archives ready for distribution: "; \
list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
distuninstallcheck:
@$(am__cd) '$(distuninstallcheck_dir)' \
&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
|| { echo "ERROR: files left after uninstall:" ; \
if test -n "$(DESTDIR)"; then \
echo " (check DESTDIR support)"; \
fi ; \
$(distuninstallcheck_listfiles) ; \
exit 1; } >&2
distcleancheck: distclean
@if test '$(srcdir)' = . ; then \
echo "ERROR: distcleancheck can only run from a VPATH build" ; \
exit 1 ; \
fi
@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
|| { echo "ERROR: files left in build directory after distclean:" ; \
$(distcleancheck_listfiles) ; \
exit 1; } >&2
check-am: all-am
check: check-am
all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(MANS) $(DATA) $(HEADERS) \
config.h
install-binPROGRAMS: install-libLTLIBRARIES
installdirs:
for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(pkgdatadir)" "$(DESTDIR)$(includedir)"; 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)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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-binPROGRAMS clean-generic clean-libLTLIBRARIES \
clean-libtool mostlyclean-am
distclean: distclean-am
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-hdr distclean-libtool distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am: install-includeHEADERS install-man \
install-pkgconfigDATA install-pkgdataDATA
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am: install-binPROGRAMS install-libLTLIBRARIES
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man: install-man1
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf $(top_srcdir)/autom4te.cache
-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-binPROGRAMS uninstall-includeHEADERS \
uninstall-libLTLIBRARIES uninstall-man uninstall-pkgconfigDATA \
uninstall-pkgdataDATA
uninstall-man: uninstall-man1
.MAKE: all install-am install-strip
.PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \
clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \
clean-libtool ctags dist dist-all dist-bzip2 dist-gzip \
dist-lzma dist-shar dist-tarZ dist-xz dist-zip distcheck \
distclean distclean-compile distclean-generic distclean-hdr \
distclean-libtool distclean-tags distcleancheck distdir \
distuninstallcheck dvi dvi-am html html-am info info-am \
install install-am install-binPROGRAMS install-data \
install-data-am install-dvi install-dvi-am install-exec \
install-exec-am install-html install-html-am \
install-includeHEADERS install-info install-info-am \
install-libLTLIBRARIES install-man install-man1 install-pdf \
install-pdf-am install-pkgconfigDATA install-pkgdataDATA \
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-binPROGRAMS \
uninstall-includeHEADERS uninstall-libLTLIBRARIES \
uninstall-man uninstall-man1 uninstall-pkgconfigDATA \
uninstall-pkgdataDATA
# 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:
flam3-3.0.1/src/Makefile.am 0000644 0001750 0001750 00000002577 11452725335 014030 0 ustar erik erik AUTOMAKE_OPTIONS = foreign no-dependencies
SVN_DEF = -D'SVN_REV="$(shell svnversion -n .)"'
AM_CFLAGS = -g -O3 -std=gnu99 -ffast-math -DPACKAGE_DATA_DIR=\"$(pkgdatadir)\" $(SVN_DEF)
ACLOCAL_AMFLAGS = -I m4
man1_MANS = flam3-animate.man flam3-genome.man flam3-render.man flam3-convert.man
bin_PROGRAMS = flam3-animate flam3-genome flam3-render flam3-convert
lib_LTLIBRARIES = libflam3.la
include_HEADERS = flam3.h isaac.h isaacs.h rect.c
libflam3_la_SOURCES = flam3.c filters.c parser.c variations.c interpolation.c palettes.c jpeg.c png.c isaac.c
libflam3_la_LDFLAGS = -no-undefined -ljpeg -lpng -lz -lpthread
flam3_genome_SOURCES = flam3-genome.c docstring.c
flam3_genome_LDADD = libflam3.la -lm
flam3_animate_SOURCES = flam3-animate.c docstring.c
flam3_animate_LDADD = libflam3.la -lm
flam3_render_SOURCES = flam3-render.c docstring.c
flam3_render_LDADD = libflam3.la -lm
flam3_convert_SOURCES = flam3-convert.c docstring.c
flam3_convert_LDADD = libflam3.la -lm
pkgdata_DATA = flam3-palettes.xml
EXTRA_DIST = rect.c flam3.h palettes.h variations.h interpolation.h parser.h \
private.h isaac.h isaacs.h img.h test.flam3 vidres.flam3 \
flam3.dsw render.dsp animate.dsp genome.dsp convert.dsp \
mkinstalldirs README.txt COPYING.txt flam3-palettes.xml \
flam3-animate.man flam3-render.man flam3-genome.man flam3-convert.man
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = flam3.pc
flam3-3.0.1/src/flam3-render.c 0000644 0001750 0001750 00000030220 11472263342 014376 0 ustar erik erik /*
FLAM3 - cosmic recursive fractal flames
Copyright (C) 1992-2009 Spotworks LLC
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; either version 3 of the License, or
(at your option) any later version.
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, see .
*/
#ifdef WIN32
#define WINVER 0x0500
#include
#endif
#ifdef __APPLE__
#include
#endif
#include
#include "private.h"
#include "img.h"
#include "isaacs.h"
int calc_nstrips(flam3_frame *spec) {
double mem_required;
double mem_available;
int nstrips,ninc;
char *testmalloc;
#ifdef WIN32
MEMORYSTATUS stat;
stat.dwLength = sizeof(stat);
GlobalMemoryStatus(&stat); // may want to go to GlobalMemoryStatusEx eventually
mem_available = (double)stat.dwTotalPhys;
// fprintf(stderr,"%lu bytes free memory...\n",(size_t)stat.dwAvailPhys);
// if (mem_available > 1e9) mem_available = 1e9;
#elif defined(_SC_PHYS_PAGES) && defined(_SC_PAGESIZE)
mem_available =
(double)sysconf(_SC_PHYS_PAGES) * sysconf(_SC_PAGESIZE);
#elif defined __APPLE__
#ifdef __LP64__
long physmem;
size_t len = sizeof(physmem);
static int mib[2] = { CTL_HW, HW_MEMSIZE };
#else
unsigned int physmem;
size_t len = sizeof(physmem);
static int mib[2] = { CTL_HW, HW_PHYSMEM };
#endif
if (sysctl(mib, 2, &physmem, &len, NULL, 0) == 0 && len == sizeof(physmem)) {
mem_available = (double )physmem;
} else {
fprintf(stderr, "warning: unable to determine physical memory.n");
mem_available = 2e9;
}
#else
fprintf(stderr, "warning: unable to determine physical memory.\n");
mem_available = 2e9;
#endif
#if 0
fprintf(stderr,"available phyical memory is %lu\n",
(unsigned long)mem_available);
#endif
mem_available *= 0.8;
if (getenv("use_mem")) {
mem_available = atof(getenv("use_mem"));
}
mem_required = flam3_render_memory_required(spec);
if (mem_available >= mem_required) return 1;
nstrips = (int) ceil(mem_required / mem_available);
if (0) {
/* Attempt to malloc a strip, and if it fails, try adding additional strips */
ninc=-1;
testmalloc = NULL;
while(NULL==testmalloc && ninc<3) {
ninc++;
testmalloc = (char *)malloc((int)ceil(mem_required / (nstrips+ninc)));
}
if (NULL==testmalloc) {
fprintf(stderr,"Unable to allocate memory for render. Please close some running programs and try to render again.\n");
exit(1);
} else {
free(testmalloc);
nstrips = nstrips + ninc;
}
}
return nstrips;
}
int print_progress(void *foo, double fraction, int stage, double eta) {
fprintf(stderr, "stage=%s progress=%g eta=%g\n", stage?"filtering":"chaos", fraction, eta);
return 0;
}
int main(int argc, char **argv) {
flam3_frame f;
char *ai;
flam3_genome *cps;
int ncps;
int i;
void *image=NULL;
FILE *fp;
char fname[256];
size_t this_size, last_size = -1;
double imgmem;
unsigned int strip;
double center_y, center_base;
unsigned int nstrips;
randctx savectx;
char *prefix = args("prefix", "");
char *out = args("out", NULL);
char *format = getenv("format");
int verbose = argi("verbose", 1);
int bits = argi("bits", 33);
int bpc = argi("bpc",8);
int seed = argi("seed", 0);
int transparency = argi("transparency", 0);
char *inf = getenv("in");
double qs = argf("qs", 1.0);
double ss = argf("ss", 1.0);
double pixel_aspect = argf("pixel_aspect", 1.0);
int sub_batch_size = argi("sub_batch_size",10000);
int name_enable = argi("name_enable",0);
int num_threads = argi("nthreads",0);
int earlyclip = argi("earlyclip",0);
FILE *in;
double zoom_scale;
unsigned int channels;
long start_time = (long)time(0);
flam3_img_comments fpc;
stat_struct stats;
char numiter_string[64];
char badval_string[64];
char rtime_string[64];
#ifdef WIN32
char *slashloc;
char exepath[256];
char palpath[256];
memset(exepath,0,256);
memset(palpath,0,256);
slashloc = strrchr(argv[0],'\\');
if (NULL==slashloc) {
sprintf(palpath,"flam3_palettes=flam3-palettes.xml");
} else {
strncpy(exepath,argv[0],slashloc-argv[0]+1);
sprintf(palpath,"flam3_palettes=%sflam3-palettes.xml",exepath);
}
putenv(palpath);
#endif
if (1 != argc) {
docstring();
exit(0);
}
/* Init random number generators */
flam3_init_frame(&f);
flam3_srandom();
/* Set the number of threads */
if (num_threads==0) {
num_threads = flam3_count_nthreads();
if (verbose > 1)
fprintf(stderr,"Automatically detected %d core(s)...\n",num_threads);
} else{
if (verbose)
fprintf(stderr,"Manually specified %d thread(s)...\n",num_threads);
}
if (NULL == format) format = "png";
if (strcmp(format, "jpg") &&
strcmp(format, "ppm") &&
strcmp(format, "png")) {
fprintf(stderr,
"format must be either jpg, ppm, or png, not %s.\n",
format);
exit(1);
}
channels = strcmp(format, "png") ? 3 : 4;
/* Check for 16-bit-per-channel processing */
if ( (16 == bpc) && (strcmp(format,"png") != 0)) {
fprintf(stderr,"Support for 16 bpc images is only present for the png format.\n");
exit(1);
} else if (bpc != 8 && bpc != 16) {
fprintf(stderr,"Unexpected bpc specified (%d)\n",bpc);
exit(1);
}
if (pixel_aspect <= 0.0) {
fprintf(stderr, "pixel aspect ratio must be positive, not %g.\n",
pixel_aspect);
exit(1);
}
if (inf)
in = fopen(inf, "rb");
else
in = stdin;
if (NULL == in) {
perror(inf);
exit(1);
}
cps = flam3_parse_from_file(in, inf, flam3_defaults_on, &ncps);
if (NULL == cps) {
fprintf(stderr,"error reading genomes from file\n");
exit(1);
}
if (inf)
fclose(in);
for (i = 0; i < ncps; i++) {
/* Force ntemporal_samples to 1 for -render */
cps[i].ntemporal_samples = 1;
cps[i].sample_density *= qs;
cps[i].height = (int)(cps[i].height * ss);
cps[i].width = (int)(cps[i].width * ss);
cps[i].pixels_per_unit *= ss;
if (cps[i].height<=0 || cps[i].width<=0) {
fprintf(stderr,"output image has dimension <=0, aborting.\n");
exit(1);
}
}
if (out && (ncps > 1)) {
fprintf(stderr, "hqi-flame: warning: writing multiple images "
"to one file. all but last will be lost.\n");
}
for (i = 0; i < ncps; i++) {
int real_height;
if (verbose && ncps > 1) {
fprintf(stderr, "flame = %d/%d ", i+1, ncps);
}
// f.temporal_filter_radius = 0.0;
f.genomes = &cps[i];
f.ngenomes = 1;
f.verbose = verbose;
f.bits = bits;
f.time = 0.0;
f.pixel_aspect_ratio = pixel_aspect;
f.progress = 0;//print_progress;
f.nthreads = num_threads;
f.earlyclip = earlyclip;
f.sub_batch_size = sub_batch_size;
if (16==bpc)
f.bytes_per_channel = 2;
else
f.bytes_per_channel = 1;
if (getenv("nstrips")) {
nstrips = atoi(getenv("nstrips"));
} else {
nstrips = calc_nstrips(&f);
}
if (nstrips > cps[i].height) {
fprintf(stderr, "cannot have more strips than rows but %d>%d.\n",
nstrips, cps[i].height);
exit(1);
}
imgmem = (double)channels * (double)cps[i].width
* (double)cps[i].height * f.bytes_per_channel;
if (imgmem > ULONG_MAX) {
fprintf(stderr,"Image size > ULONG_MAX. Aborting.\n");
exit(1);
}
this_size = (size_t)channels * (size_t)cps[i].width
* (size_t)cps[i].height * f.bytes_per_channel;
if (this_size != last_size) {
if (last_size != -1)
free(image);
last_size = this_size;
image = (void *) calloc(this_size, sizeof(char));
if (NULL==image) {
fprintf(stderr,"Error allocating memory for image. Aborting\n");
exit(1);
}
} else {
memset(image, 0, this_size);
}
cps[i].sample_density *= nstrips;
real_height = cps[i].height;
cps[i].height = (int) ceil(cps[i].height / (double) nstrips);
center_y = cps[i].center[1];
zoom_scale = pow(2.0, cps[i].zoom);
center_base = center_y - ((nstrips - 1) * cps[i].height) /
(2 * cps[i].pixels_per_unit * zoom_scale);
/* Copy off random context to use for each strip */
memcpy(&savectx, &f.rc, sizeof(randctx));
for (strip = 0; strip < nstrips; strip++) {
size_t ssoff = (size_t)cps[i].height * strip * cps[i].width * channels * f.bytes_per_channel;
void *strip_start = image + ssoff;
cps[i].center[1] = center_base + cps[i].height * (double) strip / (cps[i].pixels_per_unit * zoom_scale);
if ((cps[i].height * (strip + 1)) > real_height) {
int oh = cps[i].height;
cps[i].height = real_height - oh * strip;
cps[i].center[1] -=
(oh - cps[i].height) * 0.5 /
(cps[i].pixels_per_unit * zoom_scale);
}
/* Use the same random context for each strip */
memcpy(&f.rc, &savectx, sizeof(randctx));
if (verbose && nstrips > 1) {
fprintf(stderr, "strip = %d/%d\n", strip+1, nstrips);
}
if (verbose && (1 == nstrips) && (ncps > 1)) {
fprintf(stderr, "\n");
}
cps[i].ntemporal_samples = 1;
if (flam3_render(&f, strip_start, flam3_field_both, channels, transparency, &stats)) {
fprintf(stderr,"error rendering image: aborting.\n");
exit(1);
}
if (NULL != out) {
strcpy(fname,out);
} else if (name_enable && cps[i].flame_name[0]>0) {
sprintf(fname, "%s.%s",cps[i].flame_name,format);
} else {
sprintf(fname, "%s%05d.%s", prefix, i, format);
}
if (verbose) {
fprintf(stderr, "writing %s...", fname);
}
fp = fopen(fname, "wb");
if (NULL == fp) {
perror(fname);
exit(1);
}
/* Generate temp file with genome */
fpc.genome = flam3_print_to_string(f.genomes);
sprintf(badval_string,"%g",stats.badvals/(double)stats.num_iters);
fpc.badvals = badval_string;
sprintf(numiter_string,"%g",(double)stats.num_iters);
fpc.numiters = numiter_string;
sprintf(rtime_string,"%d",stats.render_seconds);
fpc.rtime = rtime_string;
if (!strcmp(format, "png")) {
write_png(fp, image, cps[i].width, real_height, &fpc, f.bytes_per_channel);
} else if (!strcmp(format, "jpg")) {
write_jpeg(fp, (unsigned char *)image, cps[i].width, real_height, &fpc);
} else {
fprintf(fp, "P6\n");
fprintf(fp, "%d %d\n255\n", cps[i].width, real_height);
if (this_size != fwrite((unsigned char *)image, 1, this_size, fp)) {
perror(fname);
}
}
/* Free string */
free(fpc.genome);
fclose(fp);
}
/* restore the cps values to their original values */
cps[i].sample_density /= nstrips;
cps[i].height = real_height;
cps[i].center[1] = center_y;
if (verbose) {
fprintf(stderr, "done.\n");
}
}
if (verbose && ((ncps > 1) || (nstrips > 1))) {
long total_time = (long)time(0) - start_time;
if (total_time > 100)
fprintf(stderr, "total time = %.1f minutes\n", total_time / 60.0);
else
fprintf(stderr, "total time = %ld seconds\n", total_time);
}
for (i=0;i