Remove unnecessary files from giflib directory.
234
third_party/giflib/INSTALL
vendored
@ -1,234 +0,0 @@
|
||||
Installation Instructions
|
||||
*************************
|
||||
|
||||
Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
|
||||
2006 Free Software Foundation, Inc.
|
||||
|
||||
This file is free documentation; the Free Software Foundation gives
|
||||
unlimited permission to copy, distribute and modify it.
|
||||
|
||||
Basic Installation
|
||||
==================
|
||||
|
||||
Briefly, the shell commands `./configure; make; make install' should
|
||||
configure, build, and install this package. The following
|
||||
more-detailed instructions are generic; see the `README' file for
|
||||
instructions specific to this package.
|
||||
|
||||
The `configure' shell script attempts to guess correct values for
|
||||
various system-dependent variables used during compilation. It uses
|
||||
those values to create a `Makefile' in each directory of the package.
|
||||
It may also create one or more `.h' files containing system-dependent
|
||||
definitions. Finally, it creates a shell script `config.status' that
|
||||
you can run in the future to recreate the current configuration, and a
|
||||
file `config.log' containing compiler output (useful mainly for
|
||||
debugging `configure').
|
||||
|
||||
It can also use an optional file (typically called `config.cache'
|
||||
and enabled with `--cache-file=config.cache' or simply `-C') that saves
|
||||
the results of its tests to speed up reconfiguring. Caching is
|
||||
disabled by default to prevent problems with accidental use of stale
|
||||
cache files.
|
||||
|
||||
If you need to do unusual things to compile the package, please try
|
||||
to figure out how `configure' could check whether to do them, and mail
|
||||
diffs or instructions to the address given in the `README' so they can
|
||||
be considered for the next release. If you are using the cache, and at
|
||||
some point `config.cache' contains results you don't want to keep, you
|
||||
may remove or edit it.
|
||||
|
||||
The file `configure.ac' (or `configure.in') is used to create
|
||||
`configure' by a program called `autoconf'. You need `configure.ac' if
|
||||
you want to change it or regenerate `configure' using a newer version
|
||||
of `autoconf'.
|
||||
|
||||
The simplest way to compile this package is:
|
||||
|
||||
1. `cd' to the directory containing the package's source code and type
|
||||
`./configure' to configure the package for your system.
|
||||
|
||||
Running `configure' might take a while. While running, it prints
|
||||
some messages telling which features it is checking for.
|
||||
|
||||
2. Type `make' to compile the package.
|
||||
|
||||
3. Optionally, type `make check' to run any self-tests that come with
|
||||
the package.
|
||||
|
||||
4. Type `make install' to install the programs and any data files and
|
||||
documentation.
|
||||
|
||||
5. You can remove the program binaries and object files from the
|
||||
source code directory by typing `make clean'. To also remove the
|
||||
files that `configure' created (so you can compile the package for
|
||||
a different kind of computer), type `make distclean'. There is
|
||||
also a `make maintainer-clean' target, but that is intended mainly
|
||||
for the package's developers. If you use it, you may have to get
|
||||
all sorts of other programs in order to regenerate files that came
|
||||
with the distribution.
|
||||
|
||||
Compilers and Options
|
||||
=====================
|
||||
|
||||
Some systems require unusual options for compilation or linking that the
|
||||
`configure' script does not know about. Run `./configure --help' for
|
||||
details on some of the pertinent environment variables.
|
||||
|
||||
You can give `configure' initial values for configuration parameters
|
||||
by setting variables in the command line or in the environment. Here
|
||||
is an example:
|
||||
|
||||
./configure CC=c99 CFLAGS=-g LIBS=-lposix
|
||||
|
||||
*Note Defining Variables::, for more details.
|
||||
|
||||
Compiling For Multiple Architectures
|
||||
====================================
|
||||
|
||||
You can compile the package for more than one kind of computer at the
|
||||
same time, by placing the object files for each architecture in their
|
||||
own directory. To do this, you can use GNU `make'. `cd' to the
|
||||
directory where you want the object files and executables to go and run
|
||||
the `configure' script. `configure' automatically checks for the
|
||||
source code in the directory that `configure' is in and in `..'.
|
||||
|
||||
With a non-GNU `make', it is safer to compile the package for one
|
||||
architecture at a time in the source code directory. After you have
|
||||
installed the package for one architecture, use `make distclean' before
|
||||
reconfiguring for another architecture.
|
||||
|
||||
Installation Names
|
||||
==================
|
||||
|
||||
By default, `make install' installs the package's commands under
|
||||
`/usr/local/bin', include files under `/usr/local/include', etc. You
|
||||
can specify an installation prefix other than `/usr/local' by giving
|
||||
`configure' the option `--prefix=PREFIX'.
|
||||
|
||||
You can specify separate installation prefixes for
|
||||
architecture-specific files and architecture-independent files. If you
|
||||
pass the option `--exec-prefix=PREFIX' to `configure', the package uses
|
||||
PREFIX as the prefix for installing programs and libraries.
|
||||
Documentation and other data files still use the regular prefix.
|
||||
|
||||
In addition, if you use an unusual directory layout you can give
|
||||
options like `--bindir=DIR' to specify different values for particular
|
||||
kinds of files. Run `configure --help' for a list of the directories
|
||||
you can set and what kinds of files go in them.
|
||||
|
||||
If the package supports it, you can cause programs to be installed
|
||||
with an extra prefix or suffix on their names by giving `configure' the
|
||||
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
|
||||
|
||||
Optional Features
|
||||
=================
|
||||
|
||||
Some packages pay attention to `--enable-FEATURE' options to
|
||||
`configure', where FEATURE indicates an optional part of the package.
|
||||
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
|
||||
is something like `gnu-as' or `x' (for the X Window System). The
|
||||
`README' should mention any `--enable-' and `--with-' options that the
|
||||
package recognizes.
|
||||
|
||||
For packages that use the X Window System, `configure' can usually
|
||||
find the X include and library files automatically, but if it doesn't,
|
||||
you can use the `configure' options `--x-includes=DIR' and
|
||||
`--x-libraries=DIR' to specify their locations.
|
||||
|
||||
Specifying the System Type
|
||||
==========================
|
||||
|
||||
There may be some features `configure' cannot figure out automatically,
|
||||
but needs to determine by the type of machine the package will run on.
|
||||
Usually, assuming the package is built to be run on the _same_
|
||||
architectures, `configure' can figure that out, but if it prints a
|
||||
message saying it cannot guess the machine type, give it the
|
||||
`--build=TYPE' option. TYPE can either be a short name for the system
|
||||
type, such as `sun4', or a canonical name which has the form:
|
||||
|
||||
CPU-COMPANY-SYSTEM
|
||||
|
||||
where SYSTEM can have one of these forms:
|
||||
|
||||
OS KERNEL-OS
|
||||
|
||||
See the file `config.sub' for the possible values of each field. If
|
||||
`config.sub' isn't included in this package, then this package doesn't
|
||||
need to know the machine type.
|
||||
|
||||
If you are _building_ compiler tools for cross-compiling, you should
|
||||
use the option `--target=TYPE' to select the type of system they will
|
||||
produce code for.
|
||||
|
||||
If you want to _use_ a cross compiler, that generates code for a
|
||||
platform different from the build platform, you should specify the
|
||||
"host" platform (i.e., that on which the generated programs will
|
||||
eventually be run) with `--host=TYPE'.
|
||||
|
||||
Sharing Defaults
|
||||
================
|
||||
|
||||
If you want to set default values for `configure' scripts to share, you
|
||||
can create a site shell script called `config.site' that gives default
|
||||
values for variables like `CC', `cache_file', and `prefix'.
|
||||
`configure' looks for `PREFIX/share/config.site' if it exists, then
|
||||
`PREFIX/etc/config.site' if it exists. Or, you can set the
|
||||
`CONFIG_SITE' environment variable to the location of the site script.
|
||||
A warning: not all `configure' scripts look for a site script.
|
||||
|
||||
Defining Variables
|
||||
==================
|
||||
|
||||
Variables not defined in a site shell script can be set in the
|
||||
environment passed to `configure'. However, some packages may run
|
||||
configure again during the build, and the customized values of these
|
||||
variables may be lost. In order to avoid this problem, you should set
|
||||
them in the `configure' command line, using `VAR=value'. For example:
|
||||
|
||||
./configure CC=/usr/local2/bin/gcc
|
||||
|
||||
causes the specified `gcc' to be used as the C compiler (unless it is
|
||||
overridden in the site shell script).
|
||||
|
||||
Unfortunately, this technique does not work for `CONFIG_SHELL' due to
|
||||
an Autoconf bug. Until the bug is fixed you can use this workaround:
|
||||
|
||||
CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
|
||||
|
||||
`configure' Invocation
|
||||
======================
|
||||
|
||||
`configure' recognizes the following options to control how it operates.
|
||||
|
||||
`--help'
|
||||
`-h'
|
||||
Print a summary of the options to `configure', and exit.
|
||||
|
||||
`--version'
|
||||
`-V'
|
||||
Print the version of Autoconf used to generate the `configure'
|
||||
script, and exit.
|
||||
|
||||
`--cache-file=FILE'
|
||||
Enable the cache: use and save the results of the tests in FILE,
|
||||
traditionally `config.cache'. FILE defaults to `/dev/null' to
|
||||
disable caching.
|
||||
|
||||
`--config-cache'
|
||||
`-C'
|
||||
Alias for `--cache-file=config.cache'.
|
||||
|
||||
`--quiet'
|
||||
`--silent'
|
||||
`-q'
|
||||
Do not print messages saying which checks are being made. To
|
||||
suppress all normal output, redirect it to `/dev/null' (any error
|
||||
messages will still be shown).
|
||||
|
||||
`--srcdir=DIR'
|
||||
Look for the package's source code in directory DIR. Usually
|
||||
`configure' can determine that directory automatically.
|
||||
|
||||
`configure' also accepts some other, not widely useful, options. Run
|
||||
`configure --help' for more details.
|
||||
|
32
third_party/giflib/Makefile.am
vendored
@ -1,32 +0,0 @@
|
||||
SUBDIRS = lib util doc pic
|
||||
WINDOWS = $(top_srcdir)/windows/GifWin.cpp \
|
||||
$(top_srcdir)/windows/GifWin.h \
|
||||
$(top_srcdir)/windows/StdAfx.h \
|
||||
$(top_srcdir)/windows/gifshow.cpp \
|
||||
$(top_srcdir)/windows/gifshow.dsp \
|
||||
$(top_srcdir)/windows/gifshow.dsw \
|
||||
$(top_srcdir)/windows/gifshow.h \
|
||||
$(top_srcdir)/windows/gifshow.ico \
|
||||
$(top_srcdir)/windows/gifshow.rc \
|
||||
$(top_srcdir)/windows/libungif.dsp \
|
||||
$(top_srcdir)/windows/resource.h
|
||||
|
||||
GAMEBOYADVANCE = $(top_srcdir)/gba/giftest.c \
|
||||
$(top_srcdir)/gba/giftest.dsp \
|
||||
$(top_srcdir)/gba/giftest.mak \
|
||||
$(top_srcdir)/gba/res/cover.gif \
|
||||
$(top_srcdir)/gba/res/porsche-240x160.gif \
|
||||
$(top_srcdir)/gba/res/x-trans.gif
|
||||
|
||||
EXTRA_DIST = Makefile.unx \
|
||||
ONEWS \
|
||||
autogen.sh \
|
||||
giflib.spec \
|
||||
test-unx \
|
||||
giflib.lsm \
|
||||
TODO \
|
||||
BUGS \
|
||||
DEVELOPERS \
|
||||
$(WINDOWS) \
|
||||
$(GAMEBOYADVANCE)
|
||||
#TESTS=test-unx
|
675
third_party/giflib/Makefile.in
vendored
@ -1,675 +0,0 @@
|
||||
# Makefile.in generated by automake 1.10 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005, 2006 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@
|
||||
subdir = .
|
||||
DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
|
||||
$(srcdir)/Makefile.in $(srcdir)/config.h.in \
|
||||
$(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \
|
||||
TODO compile config.guess config.sub depcomp install-sh \
|
||||
ltmain.sh missing
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
|
||||
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 = $(install_sh) -d
|
||||
CONFIG_HEADER = config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
SOURCES =
|
||||
DIST_SOURCES =
|
||||
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
|
||||
html-recursive info-recursive install-data-recursive \
|
||||
install-dvi-recursive install-exec-recursive \
|
||||
install-html-recursive install-info-recursive \
|
||||
install-pdf-recursive install-ps-recursive install-recursive \
|
||||
installcheck-recursive installdirs-recursive pdf-recursive \
|
||||
ps-recursive uninstall-recursive
|
||||
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
|
||||
distclean-recursive maintainer-clean-recursive
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DIST_SUBDIRS = $(SUBDIRS)
|
||||
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 $(distdir).tar.bz2
|
||||
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@
|
||||
COMPILABLE_EXTRAS = @COMPILABLE_EXTRAS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DEVS = @DEVS@
|
||||
ECHO = @ECHO@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
F77 = @F77@
|
||||
FFLAGS = @FFLAGS@
|
||||
GL_S_LIB = @GL_S_LIB@
|
||||
GREP = @GREP@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MATH_LIB = @MATH_LIB@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
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@
|
||||
RANLIB = @RANLIB@
|
||||
RLE_LIB = @RLE_LIB@
|
||||
SED = @SED@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
X11_LIB = @X11_LIB@
|
||||
XMKMF = @XMKMF@
|
||||
X_CFLAGS = @X_CFLAGS@
|
||||
X_EXTRA_LIBS = @X_EXTRA_LIBS@
|
||||
X_LIBS = @X_LIBS@
|
||||
X_PRE_LIBS = @X_PRE_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@
|
||||
SUBDIRS = lib util doc pic
|
||||
WINDOWS = $(top_srcdir)/windows/GifWin.cpp \
|
||||
$(top_srcdir)/windows/GifWin.h \
|
||||
$(top_srcdir)/windows/StdAfx.h \
|
||||
$(top_srcdir)/windows/gifshow.cpp \
|
||||
$(top_srcdir)/windows/gifshow.dsp \
|
||||
$(top_srcdir)/windows/gifshow.dsw \
|
||||
$(top_srcdir)/windows/gifshow.h \
|
||||
$(top_srcdir)/windows/gifshow.ico \
|
||||
$(top_srcdir)/windows/gifshow.rc \
|
||||
$(top_srcdir)/windows/libungif.dsp \
|
||||
$(top_srcdir)/windows/resource.h
|
||||
|
||||
GAMEBOYADVANCE = $(top_srcdir)/gba/giftest.c \
|
||||
$(top_srcdir)/gba/giftest.dsp \
|
||||
$(top_srcdir)/gba/giftest.mak \
|
||||
$(top_srcdir)/gba/res/cover.gif \
|
||||
$(top_srcdir)/gba/res/porsche-240x160.gif \
|
||||
$(top_srcdir)/gba/res/x-trans.gif
|
||||
|
||||
EXTRA_DIST = Makefile.unx \
|
||||
ONEWS \
|
||||
autogen.sh \
|
||||
giflib.spec \
|
||||
test-unx \
|
||||
giflib.lsm \
|
||||
TODO \
|
||||
BUGS \
|
||||
DEVELOPERS \
|
||||
$(WINDOWS) \
|
||||
$(GAMEBOYADVANCE)
|
||||
|
||||
all: config.h
|
||||
$(MAKE) $(AM_MAKEFLAGS) all-recursive
|
||||
|
||||
.SUFFIXES:
|
||||
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) --gnu '; \
|
||||
cd $(srcdir) && $(AUTOMAKE) --gnu \
|
||||
&& exit 0; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu 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)
|
||||
cd $(srcdir) && $(AUTOCONF)
|
||||
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
||||
cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
|
||||
|
||||
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)
|
||||
cd $(top_srcdir) && $(AUTOHEADER)
|
||||
rm -f stamp-h1
|
||||
touch $@
|
||||
|
||||
distclean-hdr:
|
||||
-rm -f config.h stamp-h1
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
|
||||
distclean-libtool:
|
||||
-rm -f libtool
|
||||
|
||||
# This directory's subdirectories are mostly independent; you can cd
|
||||
# into them and run `make' without going through this Makefile.
|
||||
# To change the values of `make' variables: instead of editing Makefiles,
|
||||
# (1) if the variable is set in `config.status', edit `config.status'
|
||||
# (which will cause the Makefiles to be regenerated when you run `make');
|
||||
# (2) otherwise, pass the desired values on the `make' command line.
|
||||
$(RECURSIVE_TARGETS):
|
||||
@failcom='exit 1'; \
|
||||
for f in x $$MAKEFLAGS; do \
|
||||
case $$f in \
|
||||
*=* | --[!k]*);; \
|
||||
*k*) failcom='fail=yes';; \
|
||||
esac; \
|
||||
done; \
|
||||
dot_seen=no; \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
if test "$$subdir" = "."; then \
|
||||
dot_seen=yes; \
|
||||
local_target="$$target-am"; \
|
||||
else \
|
||||
local_target="$$target"; \
|
||||
fi; \
|
||||
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||
|| eval $$failcom; \
|
||||
done; \
|
||||
if test "$$dot_seen" = "no"; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
|
||||
fi; test -z "$$fail"
|
||||
|
||||
$(RECURSIVE_CLEAN_TARGETS):
|
||||
@failcom='exit 1'; \
|
||||
for f in x $$MAKEFLAGS; do \
|
||||
case $$f in \
|
||||
*=* | --[!k]*);; \
|
||||
*k*) failcom='fail=yes';; \
|
||||
esac; \
|
||||
done; \
|
||||
dot_seen=no; \
|
||||
case "$@" in \
|
||||
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
|
||||
*) list='$(SUBDIRS)' ;; \
|
||||
esac; \
|
||||
rev=''; for subdir in $$list; do \
|
||||
if test "$$subdir" = "."; then :; else \
|
||||
rev="$$subdir $$rev"; \
|
||||
fi; \
|
||||
done; \
|
||||
rev="$$rev ."; \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
for subdir in $$rev; do \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
if test "$$subdir" = "."; then \
|
||||
local_target="$$target-am"; \
|
||||
else \
|
||||
local_target="$$target"; \
|
||||
fi; \
|
||||
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||
|| eval $$failcom; \
|
||||
done && test -z "$$fail"
|
||||
tags-recursive:
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
|
||||
done
|
||||
ctags-recursive:
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
|
||||
done
|
||||
|
||||
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; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
|
||||
TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
|
||||
include_option=--etags-include; \
|
||||
empty_fix=.; \
|
||||
else \
|
||||
include_option=--include; \
|
||||
empty_fix=; \
|
||||
fi; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
test ! -f $$subdir/TAGS || \
|
||||
tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
|
||||
fi; \
|
||||
done; \
|
||||
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; } \
|
||||
END { 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: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
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; } \
|
||||
END { 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)
|
||||
@case `sed 15q $(srcdir)/NEWS` in \
|
||||
*"$(VERSION)"*) : ;; \
|
||||
*) \
|
||||
echo "NEWS not updated; not releasing" 1>&2; \
|
||||
exit 1;; \
|
||||
esac
|
||||
$(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 $(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
|
||||
list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
test -d "$(distdir)/$$subdir" \
|
||||
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|
||||
|| exit 1; \
|
||||
distdir=`$(am__cd) $(distdir) && pwd`; \
|
||||
top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
|
||||
(cd $$subdir && \
|
||||
$(MAKE) $(AM_MAKEFLAGS) \
|
||||
top_distdir="$$top_distdir" \
|
||||
distdir="$$distdir/$$subdir" \
|
||||
am__remove_distdir=: \
|
||||
am__skip_length_check=: \
|
||||
distdir) \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
-find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -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-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
|
||||
tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
|
||||
$(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) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
|
||||
*.tar.bz2*) \
|
||||
bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
|
||||
*.tar.Z*) \
|
||||
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
|
||||
*.shar.gz*) \
|
||||
GZIP=$(GZIP_ENV) gunzip -c $(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)
|
||||
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
|
||||
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
|
||||
&& 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
|
||||
$(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:
|
||||
@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-recursive
|
||||
all-am: Makefile config.h
|
||||
installdirs: installdirs-recursive
|
||||
installdirs-am:
|
||||
install: install-recursive
|
||||
install-exec: install-exec-recursive
|
||||
install-data: install-data-recursive
|
||||
uninstall: uninstall-recursive
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-recursive
|
||||
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-recursive
|
||||
|
||||
clean-am: clean-generic clean-libtool mostlyclean-am
|
||||
|
||||
distclean: distclean-recursive
|
||||
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-generic distclean-hdr \
|
||||
distclean-libtool distclean-tags
|
||||
|
||||
dvi: dvi-recursive
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-recursive
|
||||
|
||||
info: info-recursive
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am:
|
||||
|
||||
install-dvi: install-dvi-recursive
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-html: install-html-recursive
|
||||
|
||||
install-info: install-info-recursive
|
||||
|
||||
install-man:
|
||||
|
||||
install-pdf: install-pdf-recursive
|
||||
|
||||
install-ps: install-ps-recursive
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-recursive
|
||||
-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-recursive
|
||||
|
||||
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
|
||||
|
||||
pdf: pdf-recursive
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-recursive
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am:
|
||||
|
||||
.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \
|
||||
install-strip
|
||||
|
||||
.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
|
||||
all all-am am--refresh check check-am clean clean-generic \
|
||||
clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \
|
||||
dist-gzip dist-shar dist-tarZ dist-zip distcheck distclean \
|
||||
distclean-generic distclean-hdr distclean-libtool \
|
||||
distclean-tags distcleancheck distdir distuninstallcheck 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-ps install-ps-am install-strip \
|
||||
installcheck installcheck-am installdirs installdirs-am \
|
||||
maintainer-clean maintainer-clean-generic mostlyclean \
|
||||
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
|
||||
tags tags-recursive uninstall uninstall-am
|
||||
|
||||
#TESTS=test-unx
|
||||
# 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:
|
51
third_party/giflib/Makefile.unx
vendored
@ -1,51 +0,0 @@
|
||||
#
|
||||
# Top-level Unix makefile for the GIFLIB package
|
||||
# Should work for all Unix versions
|
||||
#
|
||||
VERSION=3.0
|
||||
|
||||
all:
|
||||
cd lib; make static shared
|
||||
cd util; make all
|
||||
|
||||
install:
|
||||
cd lib; make install-lib
|
||||
cd util; make install-all
|
||||
|
||||
uninstall:
|
||||
cd lib; make uninstall-lib
|
||||
cd util; make uninstall-all
|
||||
|
||||
clean:
|
||||
cd lib; make clean
|
||||
cd util; make clean
|
||||
rm -f giflib-$(VERSION)-1.i386.rpm giflib-$(VERSION)-1.src.rpm \
|
||||
giflib-$(VERSION).tar.gz core giflib.lsm
|
||||
|
||||
giflib-$(VERSION).tar:
|
||||
(cd ..; tar cvf giflib-$(VERSION)/giflib-$(VERSION).tar `cat giflib-$(VERSION)/MANIFEST | sed "/\(^\| \)/s// giflib-$(VERSION)\//g"`)
|
||||
giflib-$(VERSION).tar.gz: giflib-$(VERSION).tar
|
||||
gzip -f giflib-$(VERSION).tar
|
||||
|
||||
dist: Makefile
|
||||
make giflib-$(VERSION).tar.gz
|
||||
lsmgen.sh $(VERSION) `wc -c giflib-$(VERSION).tar.gz` >giflib.lsm
|
||||
make giflib-$(VERSION).tar.gz
|
||||
ls -l giflib-$(VERSION).tar.gz
|
||||
@echo "Don't forget to build RPMs from root!"
|
||||
|
||||
SHAROPTS = -l63 -n giflib -o giflib -a -s esr@snark.thyrsus.com
|
||||
giflib-$(VERSION).shar:
|
||||
(cd ..; shar $(SHAROPTS) `cat MANIFEST | sed "/\(^\| \)/s// bs-$(VERSION)\//g"`)
|
||||
|
||||
# You need to be root to make this work
|
||||
RPMROOT=/usr/src/redhat
|
||||
RPM = rpm
|
||||
RPMFLAGS = -ba
|
||||
srcdir = .
|
||||
rpm: dist
|
||||
cp giflib-$(VERSION).tar.gz $(RPMROOT)/SOURCES;
|
||||
$(srcdir)/specgen.sh $(VERSION) >$(RPMROOT)/SPECS/giflib.spec
|
||||
cd $(RPMROOT)/SPECS; $(RPM) $(RPMFLAGS) giflib.spec
|
||||
cp $(RPMROOT)/RPMS/`arch|sed 's/i[4-9]86/i386/'`/giflib-$(VERSION)*.rpm $(srcdir)
|
||||
cp $(RPMROOT)/SRPMS/giflib-$(VERSION)*.src.rpm $(srcdir)
|
7304
third_party/giflib/aclocal.m4
vendored
25
third_party/giflib/autogen.sh
vendored
@ -1,25 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# This script runs commands necessary to generate a Makefile for libgif.
|
||||
|
||||
echo "Warning: This script will run configure for you -- if you need to pass"
|
||||
echo " arguments to configure, please give them as arguments to this script."
|
||||
|
||||
srcdir=`dirname $0`
|
||||
test -z "$srcdir" && srcdir=.
|
||||
|
||||
THEDIR="`pwd`"
|
||||
cd $srcdir
|
||||
|
||||
aclocal
|
||||
autoheader
|
||||
libtoolize --automake
|
||||
automake --add-missing
|
||||
autoconf
|
||||
automake
|
||||
|
||||
cd $THEDIR
|
||||
|
||||
$srcdir/configure $*
|
||||
|
||||
exit 0
|
142
third_party/giflib/compile
vendored
@ -1,142 +0,0 @@
|
||||
#! /bin/sh
|
||||
# Wrapper for compilers which do not understand `-c -o'.
|
||||
|
||||
scriptversion=2005-05-14.22
|
||||
|
||||
# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
# Written by Tom Tromey <tromey@cygnus.com>.
|
||||
#
|
||||
# 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 2, 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, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
# This file is maintained in Automake, please report
|
||||
# bugs to <bug-automake@gnu.org> or send patches to
|
||||
# <automake-patches@gnu.org>.
|
||||
|
||||
case $1 in
|
||||
'')
|
||||
echo "$0: No command. Try \`$0 --help' for more information." 1>&2
|
||||
exit 1;
|
||||
;;
|
||||
-h | --h*)
|
||||
cat <<\EOF
|
||||
Usage: compile [--help] [--version] PROGRAM [ARGS]
|
||||
|
||||
Wrapper for compilers which do not understand `-c -o'.
|
||||
Remove `-o dest.o' from ARGS, run PROGRAM with the remaining
|
||||
arguments, and rename the output as expected.
|
||||
|
||||
If you are trying to build a whole package this is not the
|
||||
right script to run: please start by reading the file `INSTALL'.
|
||||
|
||||
Report bugs to <bug-automake@gnu.org>.
|
||||
EOF
|
||||
exit $?
|
||||
;;
|
||||
-v | --v*)
|
||||
echo "compile $scriptversion"
|
||||
exit $?
|
||||
;;
|
||||
esac
|
||||
|
||||
ofile=
|
||||
cfile=
|
||||
eat=
|
||||
|
||||
for arg
|
||||
do
|
||||
if test -n "$eat"; then
|
||||
eat=
|
||||
else
|
||||
case $1 in
|
||||
-o)
|
||||
# configure might choose to run compile as `compile cc -o foo foo.c'.
|
||||
# So we strip `-o arg' only if arg is an object.
|
||||
eat=1
|
||||
case $2 in
|
||||
*.o | *.obj)
|
||||
ofile=$2
|
||||
;;
|
||||
*)
|
||||
set x "$@" -o "$2"
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*.c)
|
||||
cfile=$1
|
||||
set x "$@" "$1"
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set x "$@" "$1"
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
shift
|
||||
done
|
||||
|
||||
if test -z "$ofile" || test -z "$cfile"; then
|
||||
# If no `-o' option was seen then we might have been invoked from a
|
||||
# pattern rule where we don't need one. That is ok -- this is a
|
||||
# normal compilation that the losing compiler can handle. If no
|
||||
# `.c' file was seen then we are probably linking. That is also
|
||||
# ok.
|
||||
exec "$@"
|
||||
fi
|
||||
|
||||
# Name of file we expect compiler to create.
|
||||
cofile=`echo "$cfile" | sed -e 's|^.*/||' -e 's/\.c$/.o/'`
|
||||
|
||||
# Create the lock directory.
|
||||
# Note: use `[/.-]' here to ensure that we don't use the same name
|
||||
# that we are using for the .o file. Also, base the name on the expected
|
||||
# object file name, since that is what matters with a parallel build.
|
||||
lockdir=`echo "$cofile" | sed -e 's|[/.-]|_|g'`.d
|
||||
while true; do
|
||||
if mkdir "$lockdir" >/dev/null 2>&1; then
|
||||
break
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
# FIXME: race condition here if user kills between mkdir and trap.
|
||||
trap "rmdir '$lockdir'; exit 1" 1 2 15
|
||||
|
||||
# Run the compile.
|
||||
"$@"
|
||||
ret=$?
|
||||
|
||||
if test -f "$cofile"; then
|
||||
mv "$cofile" "$ofile"
|
||||
elif test -f "${cofile}bj"; then
|
||||
mv "${cofile}bj" "$ofile"
|
||||
fi
|
||||
|
||||
rmdir "$lockdir"
|
||||
exit $ret
|
||||
|
||||
# Local Variables:
|
||||
# mode: shell-script
|
||||
# sh-indentation: 2
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-end: "$"
|
||||
# End:
|
1500
third_party/giflib/config.guess
vendored
126
third_party/giflib/config.h.in
vendored
@ -1,126 +0,0 @@
|
||||
/* config.h.in. Generated from configure.ac by autoheader. */
|
||||
|
||||
/* Define to 1 if you have the <dlfcn.h> header file. */
|
||||
#undef HAVE_DLFCN_H
|
||||
|
||||
/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */
|
||||
#undef HAVE_DOPRNT
|
||||
|
||||
/* Define to 1 if you have the <fcntl.h> header file. */
|
||||
#undef HAVE_FCNTL_H
|
||||
|
||||
/* Define to 1 if you have the <gl/gl.h> header file. */
|
||||
#undef HAVE_GL_GL_H
|
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#undef HAVE_INTTYPES_H
|
||||
|
||||
/* Define if the gl_s library is installed (SGI GL library) */
|
||||
#undef HAVE_LIBGL_S
|
||||
|
||||
/* Define if the X11 library is installed */
|
||||
#undef HAVE_LIBX11
|
||||
|
||||
/* Define to 1 if you have the <memory.h> header file. */
|
||||
#undef HAVE_MEMORY_H
|
||||
|
||||
/* Define to 1 if you have the <rle.h> header file. */
|
||||
#undef HAVE_RLE_H
|
||||
|
||||
/* Define to 1 if you have the <stdarg.h> header file. */
|
||||
#undef HAVE_STDARG_H
|
||||
|
||||
/* Define to 1 if you have the <stdint.h> header file. */
|
||||
#undef HAVE_STDINT_H
|
||||
|
||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||
#undef HAVE_STDLIB_H
|
||||
|
||||
/* Define to 1 if you have the `strdup' function. */
|
||||
#undef HAVE_STRDUP
|
||||
|
||||
/* Define to 1 if you have the <strings.h> header file. */
|
||||
#undef HAVE_STRINGS_H
|
||||
|
||||
/* Define to 1 if you have the <string.h> header file. */
|
||||
#undef HAVE_STRING_H
|
||||
|
||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
||||
#undef HAVE_SYS_STAT_H
|
||||
|
||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
||||
#undef HAVE_SYS_TYPES_H
|
||||
|
||||
/* Define to 1 if the system has the type `uint32_t'. */
|
||||
#undef HAVE_UINT32_T
|
||||
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#undef HAVE_UNISTD_H
|
||||
|
||||
/* Define to 1 if the system has the type `u_int32_t'. */
|
||||
#undef HAVE_U_INT32_T
|
||||
|
||||
/* Define to 1 if you have the <varargs.h> header file. */
|
||||
#undef HAVE_VARARGS_H
|
||||
|
||||
/* Define to 1 if you have the `vprintf' function. */
|
||||
#undef HAVE_VPRINTF
|
||||
|
||||
/* Define to 1 if you have the <X11/Xlib.h> header file. */
|
||||
#undef HAVE_X11_XLIB_H
|
||||
|
||||
/* Define to 1 if you have the <X11/Xutil.h> header file. */
|
||||
#undef HAVE_X11_XUTIL_H
|
||||
|
||||
/* Define to 1 if your C compiler doesn't accept -c and -o together. */
|
||||
#undef NO_MINUS_C_MINUS_O
|
||||
|
||||
/* Name of package */
|
||||
#undef PACKAGE
|
||||
|
||||
/* Define to the address where bug reports for this package should be sent. */
|
||||
#undef PACKAGE_BUGREPORT
|
||||
|
||||
/* Define to the full name of this package. */
|
||||
#undef PACKAGE_NAME
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#undef PACKAGE_STRING
|
||||
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#undef PACKAGE_TARNAME
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#undef PACKAGE_VERSION
|
||||
|
||||
/* Define to 1 if the C compiler supports function prototypes. */
|
||||
#undef PROTOTYPES
|
||||
|
||||
/* Define to 1 if the `setvbuf' function takes the buffering type as its
|
||||
second argument and the buffer pointer as the third, as on System V before
|
||||
release 3. */
|
||||
#undef SETVBUF_REVERSED
|
||||
|
||||
/* The size of `unsigned int', as computed by sizeof. */
|
||||
#undef SIZEOF_UNSIGNED_INT
|
||||
|
||||
/* The size of `unsigned long', as computed by sizeof. */
|
||||
#undef SIZEOF_UNSIGNED_LONG
|
||||
|
||||
/* Define to 1 if you have the ANSI C header files. */
|
||||
#undef STDC_HEADERS
|
||||
|
||||
/* Set to an unsigned 32 bit integer available on this system */
|
||||
#undef UINT32
|
||||
|
||||
/* Version number of package */
|
||||
#undef VERSION
|
||||
|
||||
/* Define to 1 if the X Window System is missing or not being used. */
|
||||
#undef X_DISPLAY_MISSING
|
||||
|
||||
/* Define like PROTOTYPES; this can be used by system headers. */
|
||||
#undef __PROTOTYPES
|
||||
|
||||
/* Define to empty if `const' does not conform to ANSI C. */
|
||||
#undef const
|
1616
third_party/giflib/config.sub
vendored
26118
third_party/giflib/configure
vendored
128
third_party/giflib/configure.ac
vendored
@ -1,128 +0,0 @@
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
AC_INIT(giflib, [4.1.6], [abadger1999@sourceforge.net], giflib)
|
||||
AC_CONFIG_SRCDIR([lib/dgif_lib.c])
|
||||
AM_INIT_AUTOMAKE([gnu check-news dist-bzip2 -Wall])
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
|
||||
dnl Checks for programs.
|
||||
AC_PROG_LIBTOOL
|
||||
AC_PROG_CC
|
||||
AC_PROG_CPP
|
||||
AC_PROG_INSTALL
|
||||
AC_PROG_LN_S
|
||||
AC_PROG_MAKE_SET
|
||||
AM_PROG_CC_C_O
|
||||
|
||||
dnl Define warnings if we're compiling with gcc.
|
||||
dnl Set it in CFLAGS so the end-user can disable it if they wish.
|
||||
if test "x$GCC" = "xyes" ; then
|
||||
CFLAGS="$CFLAGS -Wall"
|
||||
fi
|
||||
|
||||
dnl Checks for libraries.
|
||||
|
||||
AC_CHECK_LIB(m, pow, [MATH_LIB="${MATH_LIB} -lm"
|
||||
COMPILABLE_EXTRAS="${COMPILABLE_EXTRAS} gifclrmp${EXEEXT} gifrotat${EXEEXT}"] )
|
||||
|
||||
AC_ARG_ENABLE(rle, AC_HELP_STRING([rle],[detect whether we can support conversion to/from rle]),
|
||||
enable_rle=$enableval, enable_rle=auto)
|
||||
|
||||
AC_ARG_ENABLE(x11, AC_HELP_STRING([x11],[detect whether we can support conversion directly to X11 Windows]),
|
||||
enable_x11=$enableval, enable_x11=auto)
|
||||
|
||||
AC_ARG_ENABLE(gl, AC_HELP_STRING([gl],[detect whether we can support conversion to/from gl]),
|
||||
enable_gl=$enableval, enable_gl=auto)
|
||||
|
||||
dnl I don't have this on my system. Could someone else configure it and
|
||||
dnl check that it works?
|
||||
if test "x$enable_rle" != "xno" ; then
|
||||
if test ${MATH_LIB}; then
|
||||
AC_CHECK_HEADERS([rle.h],
|
||||
AC_CHECK_LIB(rle, rle_hdr_init, [RLE_LIB="${RLE_LIBS} -lrle -lm"
|
||||
COMPILABLE_EXTRAS="${COMPILABLE_EXTRAS} gif2rle${EXEEXT} rle2gif${EXEEXT}"],
|
||||
,"-lm" ))
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "x$enable_gl" != "xno" ; then
|
||||
AC_CHECK_HEADERS([gl/gl.h],
|
||||
AC_CHECK_LIB(gl_s, main, [GL_S_LIB="${GL_S_LIB} -lgl_s $X_LIBS"
|
||||
AC_DEFINE(HAVE_LIBGL_S, [1], [Define if the gl_s library is installed (SGI GL library)])
|
||||
COMPILABLE_EXTRAS="${COMPILABLE_EXTRAS} gif2iris${EXEEXT}"],, $X_LIBS))
|
||||
fi
|
||||
|
||||
if test "x$enable_x11" != "xno" ; then
|
||||
AC_PATH_XTRA
|
||||
AC_CHECK_HEADERS([X11/Xlib.h X11/Xutil.h],
|
||||
AC_CHECK_LIB(X11, main, [X11_LIB="${X11_LIB} ${X_PRE_LIBS} $X_LIBS ${X_EXTRA_LIBS} -lX11"
|
||||
AC_DEFINE(HAVE_LIBX11, [1], [Define if the X11 library is installed])
|
||||
COMPILABLE_EXTRAS="${COMPILABLE_EXTRAS} gif2x11${EXEEXT}"],, $X_LIBS))
|
||||
fi
|
||||
|
||||
DEVS="${GL_S_LIB} ${X11_LIB}"
|
||||
AC_SUBST(DEVS)
|
||||
AC_SUBST(COMPILABLE_EXTRAS)
|
||||
AC_SUBST(GL_S_LIB)
|
||||
AC_SUBST(X11_LIB)
|
||||
AC_SUBST(X_CFLAGS)
|
||||
AC_SUBST(MATH_LIB)
|
||||
AC_SUBST(RLE_LIB)
|
||||
|
||||
dnl Checks for header files.
|
||||
AC_HEADER_STDC
|
||||
dnl * HEADER_STDC checks for stdargs.h so this is a bit redundant.
|
||||
dnl * The code will prefer stdargs.h if available.
|
||||
dnl If not available, we will try to fallback to using varargs.h
|
||||
AC_CHECK_HEADERS([stdarg.h varargs.h], break,
|
||||
AC_MSG_ERROR([giflib 4.x must have stdarg.h or varargs.h]))
|
||||
|
||||
AC_CHECK_HEADERS(fcntl.h, ,
|
||||
AC_MSG_ERROR([giflib 4.x must have fcntl.h to compile]))
|
||||
|
||||
dnl Now look for a 32 bit integer type
|
||||
foundint=no
|
||||
AC_CHECK_TYPES([u_int32_t], [AC_DEFINE([UINT32], u_int32_t,
|
||||
[Set to an unsigned 32 bit integer available on this system])
|
||||
foundint=yes]
|
||||
)
|
||||
if test x$foundint != x'yes'; then
|
||||
AC_CHECK_TYPES([uint32_t], [AC_DEFINE([UINT32], uint32_t,
|
||||
[Set to an unsigned 32 bit integer available on this system])
|
||||
foundint=yes]
|
||||
)
|
||||
fi
|
||||
|
||||
dnl Fall back on trying to find one ourselves by compiling and checking sizes.
|
||||
if test x$foundint != x'yes'; then
|
||||
AC_CHECK_SIZEOF(unsigned int)
|
||||
if test $ac_cv_sizeof_unsigned_int -eq 4; then
|
||||
AC_DEFINE([UINT32], [unsigned int],
|
||||
[Set to an unsigned 32 bit integer available on this system])
|
||||
else
|
||||
AC_CHECK_SIZEOF(unsigned long)
|
||||
if test $ac_cv_sizeof_unsigned_long -eq 4; then
|
||||
AC_DEFINE([UINT32], [unsigned long],
|
||||
[Set to an unsigned 32 bit integer available on this system])
|
||||
else
|
||||
AC_ERROR("Unable to find a thirty-two bit integer type")
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl Checks for typedefs, structures, and compiler characteristics.
|
||||
AC_C_CONST
|
||||
|
||||
dnl Checks for library functions.
|
||||
AC_FUNC_MEMCMP
|
||||
AC_FUNC_SETVBUF_REVERSED
|
||||
AC_FUNC_VPRINTF
|
||||
AC_CHECK_FUNCS(strdup)
|
||||
|
||||
AC_CONFIG_FILES([
|
||||
util/Makefile
|
||||
lib/Makefile
|
||||
Makefile
|
||||
doc/Makefile
|
||||
pic/Makefile
|
||||
])
|
||||
AC_OUTPUT
|
584
third_party/giflib/depcomp
vendored
@ -1,584 +0,0 @@
|
||||
#! /bin/sh
|
||||
# depcomp - compile a program generating dependencies as side-effects
|
||||
|
||||
scriptversion=2006-10-15.18
|
||||
|
||||
# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006 Free Software
|
||||
# Foundation, Inc.
|
||||
|
||||
# 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 2, 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, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
# 02110-1301, USA.
|
||||
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
|
||||
|
||||
case $1 in
|
||||
'')
|
||||
echo "$0: No command. Try \`$0 --help' for more information." 1>&2
|
||||
exit 1;
|
||||
;;
|
||||
-h | --h*)
|
||||
cat <<\EOF
|
||||
Usage: depcomp [--help] [--version] PROGRAM [ARGS]
|
||||
|
||||
Run PROGRAMS ARGS to compile a file, generating dependencies
|
||||
as side-effects.
|
||||
|
||||
Environment variables:
|
||||
depmode Dependency tracking mode.
|
||||
source Source file read by `PROGRAMS ARGS'.
|
||||
object Object file output by `PROGRAMS ARGS'.
|
||||
DEPDIR directory where to store dependencies.
|
||||
depfile Dependency file to output.
|
||||
tmpdepfile Temporary file to use when outputing dependencies.
|
||||
libtool Whether libtool is used (yes/no).
|
||||
|
||||
Report bugs to <bug-automake@gnu.org>.
|
||||
EOF
|
||||
exit $?
|
||||
;;
|
||||
-v | --v*)
|
||||
echo "depcomp $scriptversion"
|
||||
exit $?
|
||||
;;
|
||||
esac
|
||||
|
||||
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
|
||||
echo "depcomp: Variables source, object and depmode must be set" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
|
||||
depfile=${depfile-`echo "$object" |
|
||||
sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
|
||||
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
|
||||
|
||||
rm -f "$tmpdepfile"
|
||||
|
||||
# Some modes work just like other modes, but use different flags. We
|
||||
# parameterize here, but still list the modes in the big case below,
|
||||
# to make depend.m4 easier to write. Note that we *cannot* use a case
|
||||
# here, because this file can only contain one case statement.
|
||||
if test "$depmode" = hp; then
|
||||
# HP compiler uses -M and no extra arg.
|
||||
gccflag=-M
|
||||
depmode=gcc
|
||||
fi
|
||||
|
||||
if test "$depmode" = dashXmstdout; then
|
||||
# This is just like dashmstdout with a different argument.
|
||||
dashmflag=-xM
|
||||
depmode=dashmstdout
|
||||
fi
|
||||
|
||||
case "$depmode" in
|
||||
gcc3)
|
||||
## gcc 3 implements dependency tracking that does exactly what
|
||||
## we want. Yay! Note: for some reason libtool 1.4 doesn't like
|
||||
## it if -MD -MP comes after the -MF stuff. Hmm.
|
||||
## Unfortunately, FreeBSD c89 acceptance of flags depends upon
|
||||
## the command line argument order; so add the flags where they
|
||||
## appear in depend2.am. Note that the slowdown incurred here
|
||||
## affects only configure: in makefiles, %FASTDEP% shortcuts this.
|
||||
for arg
|
||||
do
|
||||
case $arg in
|
||||
-c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
|
||||
*) set fnord "$@" "$arg" ;;
|
||||
esac
|
||||
shift # fnord
|
||||
shift # $arg
|
||||
done
|
||||
"$@"
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
mv "$tmpdepfile" "$depfile"
|
||||
;;
|
||||
|
||||
gcc)
|
||||
## There are various ways to get dependency output from gcc. Here's
|
||||
## why we pick this rather obscure method:
|
||||
## - Don't want to use -MD because we'd like the dependencies to end
|
||||
## up in a subdir. Having to rename by hand is ugly.
|
||||
## (We might end up doing this anyway to support other compilers.)
|
||||
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
|
||||
## -MM, not -M (despite what the docs say).
|
||||
## - Using -M directly means running the compiler twice (even worse
|
||||
## than renaming).
|
||||
if test -z "$gccflag"; then
|
||||
gccflag=-MD,
|
||||
fi
|
||||
"$@" -Wp,"$gccflag$tmpdepfile"
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
rm -f "$depfile"
|
||||
echo "$object : \\" > "$depfile"
|
||||
alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
|
||||
## The second -e expression handles DOS-style file names with drive letters.
|
||||
sed -e 's/^[^:]*: / /' \
|
||||
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
|
||||
## This next piece of magic avoids the `deleted header file' problem.
|
||||
## The problem is that when a header file which appears in a .P file
|
||||
## is deleted, the dependency causes make to die (because there is
|
||||
## typically no way to rebuild the header). We avoid this by adding
|
||||
## dummy dependencies for each header file. Too bad gcc doesn't do
|
||||
## this for us directly.
|
||||
tr ' ' '
|
||||
' < "$tmpdepfile" |
|
||||
## Some versions of gcc put a space before the `:'. On the theory
|
||||
## that the space means something, we add a space to the output as
|
||||
## well.
|
||||
## Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
## correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
hp)
|
||||
# This case exists only to let depend.m4 do its work. It works by
|
||||
# looking at the text of this script. This case will never be run,
|
||||
# since it is checked for above.
|
||||
exit 1
|
||||
;;
|
||||
|
||||
sgi)
|
||||
if test "$libtool" = yes; then
|
||||
"$@" "-Wp,-MDupdate,$tmpdepfile"
|
||||
else
|
||||
"$@" -MDupdate "$tmpdepfile"
|
||||
fi
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
rm -f "$depfile"
|
||||
|
||||
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
|
||||
echo "$object : \\" > "$depfile"
|
||||
|
||||
# Clip off the initial element (the dependent). Don't try to be
|
||||
# clever and replace this with sed code, as IRIX sed won't handle
|
||||
# lines with more than a fixed number of characters (4096 in
|
||||
# IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
|
||||
# the IRIX cc adds comments like `#:fec' to the end of the
|
||||
# dependency line.
|
||||
tr ' ' '
|
||||
' < "$tmpdepfile" \
|
||||
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
|
||||
tr '
|
||||
' ' ' >> $depfile
|
||||
echo >> $depfile
|
||||
|
||||
# The second pass generates a dummy entry for each header file.
|
||||
tr ' ' '
|
||||
' < "$tmpdepfile" \
|
||||
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
|
||||
>> $depfile
|
||||
else
|
||||
# The sourcefile does not contain any dependencies, so just
|
||||
# store a dummy comment line, to avoid errors with the Makefile
|
||||
# "include basename.Plo" scheme.
|
||||
echo "#dummy" > "$depfile"
|
||||
fi
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
aix)
|
||||
# The C for AIX Compiler uses -M and outputs the dependencies
|
||||
# in a .u file. In older versions, this file always lives in the
|
||||
# current directory. Also, the AIX compiler puts `$object:' at the
|
||||
# start of each line; $object doesn't have directory information.
|
||||
# Version 6 uses the directory in both cases.
|
||||
stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'`
|
||||
tmpdepfile="$stripped.u"
|
||||
if test "$libtool" = yes; then
|
||||
"$@" -Wc,-M
|
||||
else
|
||||
"$@" -M
|
||||
fi
|
||||
stat=$?
|
||||
|
||||
if test -f "$tmpdepfile"; then :
|
||||
else
|
||||
stripped=`echo "$stripped" | sed 's,^.*/,,'`
|
||||
tmpdepfile="$stripped.u"
|
||||
fi
|
||||
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
|
||||
if test -f "$tmpdepfile"; then
|
||||
outname="$stripped.o"
|
||||
# Each line is of the form `foo.o: dependent.h'.
|
||||
# Do two passes, one to just change these to
|
||||
# `$object: dependent.h' and one to simply `dependent.h:'.
|
||||
sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
|
||||
sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
|
||||
else
|
||||
# The sourcefile does not contain any dependencies, so just
|
||||
# store a dummy comment line, to avoid errors with the Makefile
|
||||
# "include basename.Plo" scheme.
|
||||
echo "#dummy" > "$depfile"
|
||||
fi
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
icc)
|
||||
# Intel's C compiler understands `-MD -MF file'. However on
|
||||
# icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
|
||||
# ICC 7.0 will fill foo.d with something like
|
||||
# foo.o: sub/foo.c
|
||||
# foo.o: sub/foo.h
|
||||
# which is wrong. We want:
|
||||
# sub/foo.o: sub/foo.c
|
||||
# sub/foo.o: sub/foo.h
|
||||
# sub/foo.c:
|
||||
# sub/foo.h:
|
||||
# ICC 7.1 will output
|
||||
# foo.o: sub/foo.c sub/foo.h
|
||||
# and will wrap long lines using \ :
|
||||
# foo.o: sub/foo.c ... \
|
||||
# sub/foo.h ... \
|
||||
# ...
|
||||
|
||||
"$@" -MD -MF "$tmpdepfile"
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
rm -f "$depfile"
|
||||
# Each line is of the form `foo.o: dependent.h',
|
||||
# or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
|
||||
# Do two passes, one to just change these to
|
||||
# `$object: dependent.h' and one to simply `dependent.h:'.
|
||||
sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
|
||||
# Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
# correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
|
||||
sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
hp2)
|
||||
# The "hp" stanza above does not work with aCC (C++) and HP's ia64
|
||||
# compilers, which have integrated preprocessors. The correct option
|
||||
# to use with these is +Maked; it writes dependencies to a file named
|
||||
# 'foo.d', which lands next to the object file, wherever that
|
||||
# happens to be.
|
||||
# Much of this is similar to the tru64 case; see comments there.
|
||||
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
|
||||
test "x$dir" = "x$object" && dir=
|
||||
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
|
||||
if test "$libtool" = yes; then
|
||||
tmpdepfile1=$dir$base.d
|
||||
tmpdepfile2=$dir.libs/$base.d
|
||||
"$@" -Wc,+Maked
|
||||
else
|
||||
tmpdepfile1=$dir$base.d
|
||||
tmpdepfile2=$dir$base.d
|
||||
"$@" +Maked
|
||||
fi
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile1" "$tmpdepfile2"
|
||||
exit $stat
|
||||
fi
|
||||
|
||||
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
|
||||
do
|
||||
test -f "$tmpdepfile" && break
|
||||
done
|
||||
if test -f "$tmpdepfile"; then
|
||||
sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
|
||||
# Add `dependent.h:' lines.
|
||||
sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile"
|
||||
else
|
||||
echo "#dummy" > "$depfile"
|
||||
fi
|
||||
rm -f "$tmpdepfile" "$tmpdepfile2"
|
||||
;;
|
||||
|
||||
tru64)
|
||||
# The Tru64 compiler uses -MD to generate dependencies as a side
|
||||
# effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
|
||||
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
|
||||
# dependencies in `foo.d' instead, so we check for that too.
|
||||
# Subdirectories are respected.
|
||||
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
|
||||
test "x$dir" = "x$object" && dir=
|
||||
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
|
||||
|
||||
if test "$libtool" = yes; then
|
||||
# With Tru64 cc, shared objects can also be used to make a
|
||||
# static library. This mechanism is used in libtool 1.4 series to
|
||||
# handle both shared and static libraries in a single compilation.
|
||||
# With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
|
||||
#
|
||||
# With libtool 1.5 this exception was removed, and libtool now
|
||||
# generates 2 separate objects for the 2 libraries. These two
|
||||
# compilations output dependencies in $dir.libs/$base.o.d and
|
||||
# in $dir$base.o.d. We have to check for both files, because
|
||||
# one of the two compilations can be disabled. We should prefer
|
||||
# $dir$base.o.d over $dir.libs/$base.o.d because the latter is
|
||||
# automatically cleaned when .libs/ is deleted, while ignoring
|
||||
# the former would cause a distcleancheck panic.
|
||||
tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4
|
||||
tmpdepfile2=$dir$base.o.d # libtool 1.5
|
||||
tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5
|
||||
tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
|
||||
"$@" -Wc,-MD
|
||||
else
|
||||
tmpdepfile1=$dir$base.o.d
|
||||
tmpdepfile2=$dir$base.d
|
||||
tmpdepfile3=$dir$base.d
|
||||
tmpdepfile4=$dir$base.d
|
||||
"$@" -MD
|
||||
fi
|
||||
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
|
||||
exit $stat
|
||||
fi
|
||||
|
||||
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
|
||||
do
|
||||
test -f "$tmpdepfile" && break
|
||||
done
|
||||
if test -f "$tmpdepfile"; then
|
||||
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
|
||||
# That's a tab and a space in the [].
|
||||
sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
|
||||
else
|
||||
echo "#dummy" > "$depfile"
|
||||
fi
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
#nosideeffect)
|
||||
# This comment above is used by automake to tell side-effect
|
||||
# dependency tracking mechanisms from slower ones.
|
||||
|
||||
dashmstdout)
|
||||
# Important note: in order to support this mode, a compiler *must*
|
||||
# always write the preprocessed file to stdout, regardless of -o.
|
||||
"$@" || exit $?
|
||||
|
||||
# Remove the call to Libtool.
|
||||
if test "$libtool" = yes; then
|
||||
while test $1 != '--mode=compile'; do
|
||||
shift
|
||||
done
|
||||
shift
|
||||
fi
|
||||
|
||||
# Remove `-o $object'.
|
||||
IFS=" "
|
||||
for arg
|
||||
do
|
||||
case $arg in
|
||||
-o)
|
||||
shift
|
||||
;;
|
||||
$object)
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"
|
||||
shift # fnord
|
||||
shift # $arg
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
test -z "$dashmflag" && dashmflag=-M
|
||||
# Require at least two characters before searching for `:'
|
||||
# in the target name. This is to cope with DOS-style filenames:
|
||||
# a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
|
||||
"$@" $dashmflag |
|
||||
sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
|
||||
rm -f "$depfile"
|
||||
cat < "$tmpdepfile" > "$depfile"
|
||||
tr ' ' '
|
||||
' < "$tmpdepfile" | \
|
||||
## Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
## correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
dashXmstdout)
|
||||
# This case only exists to satisfy depend.m4. It is never actually
|
||||
# run, as this mode is specially recognized in the preamble.
|
||||
exit 1
|
||||
;;
|
||||
|
||||
makedepend)
|
||||
"$@" || exit $?
|
||||
# Remove any Libtool call
|
||||
if test "$libtool" = yes; then
|
||||
while test $1 != '--mode=compile'; do
|
||||
shift
|
||||
done
|
||||
shift
|
||||
fi
|
||||
# X makedepend
|
||||
shift
|
||||
cleared=no
|
||||
for arg in "$@"; do
|
||||
case $cleared in
|
||||
no)
|
||||
set ""; shift
|
||||
cleared=yes ;;
|
||||
esac
|
||||
case "$arg" in
|
||||
-D*|-I*)
|
||||
set fnord "$@" "$arg"; shift ;;
|
||||
# Strip any option that makedepend may not understand. Remove
|
||||
# the object too, otherwise makedepend will parse it as a source file.
|
||||
-*|$object)
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"; shift ;;
|
||||
esac
|
||||
done
|
||||
obj_suffix="`echo $object | sed 's/^.*\././'`"
|
||||
touch "$tmpdepfile"
|
||||
${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
|
||||
rm -f "$depfile"
|
||||
cat < "$tmpdepfile" > "$depfile"
|
||||
sed '1,2d' "$tmpdepfile" | tr ' ' '
|
||||
' | \
|
||||
## Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
## correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile" "$tmpdepfile".bak
|
||||
;;
|
||||
|
||||
cpp)
|
||||
# Important note: in order to support this mode, a compiler *must*
|
||||
# always write the preprocessed file to stdout.
|
||||
"$@" || exit $?
|
||||
|
||||
# Remove the call to Libtool.
|
||||
if test "$libtool" = yes; then
|
||||
while test $1 != '--mode=compile'; do
|
||||
shift
|
||||
done
|
||||
shift
|
||||
fi
|
||||
|
||||
# Remove `-o $object'.
|
||||
IFS=" "
|
||||
for arg
|
||||
do
|
||||
case $arg in
|
||||
-o)
|
||||
shift
|
||||
;;
|
||||
$object)
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"
|
||||
shift # fnord
|
||||
shift # $arg
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
"$@" -E |
|
||||
sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
|
||||
-e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
|
||||
sed '$ s: \\$::' > "$tmpdepfile"
|
||||
rm -f "$depfile"
|
||||
echo "$object : \\" > "$depfile"
|
||||
cat < "$tmpdepfile" >> "$depfile"
|
||||
sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
msvisualcpp)
|
||||
# Important note: in order to support this mode, a compiler *must*
|
||||
# always write the preprocessed file to stdout, regardless of -o,
|
||||
# because we must use -o when running libtool.
|
||||
"$@" || exit $?
|
||||
IFS=" "
|
||||
for arg
|
||||
do
|
||||
case "$arg" in
|
||||
"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
|
||||
set fnord "$@"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
done
|
||||
"$@" -E |
|
||||
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
|
||||
rm -f "$depfile"
|
||||
echo "$object : \\" > "$depfile"
|
||||
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
|
||||
echo " " >> "$depfile"
|
||||
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
none)
|
||||
exec "$@"
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Unknown depmode $depmode" 1>&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
||||
# Local Variables:
|
||||
# mode: shell-script
|
||||
# sh-indentation: 2
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-end: "$"
|
||||
# End:
|
BIN
third_party/giflib/doc/GifFileType.png
vendored
Before Width: | Height: | Size: 24 KiB |
41
third_party/giflib/doc/Makefile.am
vendored
@ -1,41 +0,0 @@
|
||||
UTILHELP = gif2bgi.html \
|
||||
gif2epsn.html \
|
||||
gif2herc.html \
|
||||
gif2iris.html \
|
||||
gif2ps.html \
|
||||
gif2rgb.html \
|
||||
gif2rle.html \
|
||||
gif2x11.html \
|
||||
gifasm.html \
|
||||
gifbg.html \
|
||||
gifburst.html \
|
||||
gifclip.html \
|
||||
gifclrmp.html \
|
||||
gifcolor.html \
|
||||
gifcomb.html \
|
||||
gifcompose.html \
|
||||
giffiltr.html \
|
||||
giffix.html \
|
||||
gifflip.html \
|
||||
gifhisto.html \
|
||||
gifinter.html \
|
||||
gifinto.html \
|
||||
gifovly.html \
|
||||
gifpos.html \
|
||||
gifrotat.html \
|
||||
gifrsize.html \
|
||||
gifspnge.html \
|
||||
giftext.html \
|
||||
gifwedge.html \
|
||||
icon2gif.html \
|
||||
raw2gif.html \
|
||||
rgb2gif.html \
|
||||
rle2gif.html \
|
||||
text2gif.html
|
||||
LIBRARYHELP = GifFileType.png \
|
||||
gif89.txt \
|
||||
gif_lib.html \
|
||||
index.html \
|
||||
liberror.html \
|
||||
lzgif.txt
|
||||
EXTRA_DIST = $(UTILHELP) $(LIBRARYHELP)
|
374
third_party/giflib/doc/Makefile.in
vendored
@ -1,374 +0,0 @@
|
||||
# Makefile.in generated by automake 1.10 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005, 2006 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@
|
||||
subdir = doc
|
||||
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = $(top_builddir)/config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
SOURCES =
|
||||
DIST_SOURCES =
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMTAR = @AMTAR@
|
||||
AR = @AR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
COMPILABLE_EXTRAS = @COMPILABLE_EXTRAS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DEVS = @DEVS@
|
||||
ECHO = @ECHO@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
F77 = @F77@
|
||||
FFLAGS = @FFLAGS@
|
||||
GL_S_LIB = @GL_S_LIB@
|
||||
GREP = @GREP@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MATH_LIB = @MATH_LIB@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
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@
|
||||
RANLIB = @RANLIB@
|
||||
RLE_LIB = @RLE_LIB@
|
||||
SED = @SED@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
X11_LIB = @X11_LIB@
|
||||
XMKMF = @XMKMF@
|
||||
X_CFLAGS = @X_CFLAGS@
|
||||
X_EXTRA_LIBS = @X_EXTRA_LIBS@
|
||||
X_LIBS = @X_LIBS@
|
||||
X_PRE_LIBS = @X_PRE_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@
|
||||
UTILHELP = gif2bgi.html \
|
||||
gif2epsn.html \
|
||||
gif2herc.html \
|
||||
gif2iris.html \
|
||||
gif2ps.html \
|
||||
gif2rgb.html \
|
||||
gif2rle.html \
|
||||
gif2x11.html \
|
||||
gifasm.html \
|
||||
gifbg.html \
|
||||
gifburst.html \
|
||||
gifclip.html \
|
||||
gifclrmp.html \
|
||||
gifcolor.html \
|
||||
gifcomb.html \
|
||||
gifcompose.html \
|
||||
giffiltr.html \
|
||||
giffix.html \
|
||||
gifflip.html \
|
||||
gifhisto.html \
|
||||
gifinter.html \
|
||||
gifinto.html \
|
||||
gifovly.html \
|
||||
gifpos.html \
|
||||
gifrotat.html \
|
||||
gifrsize.html \
|
||||
gifspnge.html \
|
||||
giftext.html \
|
||||
gifwedge.html \
|
||||
icon2gif.html \
|
||||
raw2gif.html \
|
||||
rgb2gif.html \
|
||||
rle2gif.html \
|
||||
text2gif.html
|
||||
|
||||
LIBRARYHELP = GifFileType.png \
|
||||
gif89.txt \
|
||||
gif_lib.html \
|
||||
index.html \
|
||||
liberror.html \
|
||||
lzgif.txt
|
||||
|
||||
EXTRA_DIST = $(UTILHELP) $(LIBRARYHELP)
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
$(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 doc/Makefile'; \
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu doc/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
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
tags: TAGS
|
||||
TAGS:
|
||||
|
||||
ctags: CTAGS
|
||||
CTAGS:
|
||||
|
||||
|
||||
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
|
||||
installdirs:
|
||||
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 mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-generic
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am:
|
||||
|
||||
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 -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am:
|
||||
|
||||
.MAKE: install-am install-strip
|
||||
|
||||
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
|
||||
distclean distclean-generic distclean-libtool 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-ps install-ps-am install-strip \
|
||||
installcheck installcheck-am installdirs maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-generic \
|
||||
mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am
|
||||
|
||||
# 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:
|
136
third_party/giflib/doc/gif2bgi.html
vendored
@ -1,136 +0,0 @@
|
||||
<!doctype HTML public "-//W3O//DTD W3 HTML 2.0//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>gif2bgi</TITLE>
|
||||
<link rev=made href=mailto:esr@snark.thyrsus.com>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
Go to <a href="index.html">index page</a>.
|
||||
|
||||
<CENTER><H1>gif2bgi</H1></CENTER>
|
||||
|
||||
A program to display images saved as GIF files on IBM PC display devices using
|
||||
the BGI (Borland) driver interface.<P>
|
||||
|
||||
The program operates as follows:<P>
|
||||
|
||||
<OL>
|
||||
<LI>
|
||||
Reads the GIF file header and determines the image size.<P>
|
||||
|
||||
<LI>
|
||||
Dynamically allocates enough memory to hold all the image internally.
|
||||
One byte per pixel is always allocated, so a little bit more than
|
||||
width*height (of screen, not image) bytes are required.<P>
|
||||
|
||||
<LI>
|
||||
Reads all the image in. Interlaced images are read in correctly, although
|
||||
they are displayed sequentially.<P>
|
||||
|
||||
<LI>
|
||||
Display first image using the defaults as set by the command line option.<P>
|
||||
|
||||
<LI>
|
||||
Goes to interactive mode. For a full description of the interactive mode
|
||||
see below.<P>
|
||||
</OL>
|
||||
|
||||
<H1>Usage:</H1>
|
||||
|
||||
<pre>
|
||||
gif2bgi [-q] [-d BGI dir] [-u driver] [-z zoom] [-b] [-h] gif-file
|
||||
</pre>
|
||||
|
||||
If no GIF is given, gif2bgi will try to read a GIF file from stdin.<P>
|
||||
|
||||
<H1>Memory required:</H1>
|
||||
|
||||
Screen.
|
||||
|
||||
<H1>Options:</H1>
|
||||
<DL>
|
||||
<DT> [-q]
|
||||
<DD> Quiet mode. Default off on MSDOS, on under UNIX. Controls printout
|
||||
of running scan lines. Use -q- to invert.<P>
|
||||
|
||||
<DT> [-d BGI Directory]
|
||||
<DD> Where we should look for default drivers (as supplied by Borland).
|
||||
For example '-d c:/tc/bgi'.<P>
|
||||
|
||||
<DT> [-u driver]
|
||||
<DD> Specifies a user-defined BGI driver. If for example
|
||||
you have a BGI driver for your special vga called MYVGA.BGI and you want
|
||||
to run it in mode 2, then type '-u c:/tc/bgi/myvga.2'. Note the absolute
|
||||
path to the driver must be specified. Also note that we use '/' and not
|
||||
'\' so they won't be treated as options.<P>
|
||||
|
||||
<DT> [-z zoom]
|
||||
<DD> Sets zoom factor of the view. Zoom factor should be
|
||||
power of 2 up to 256. Default is 1 (no zoom).<P>
|
||||
|
||||
<DT> [-h]
|
||||
<DD> Print one line of command-line help, similar to Usage above.<P>
|
||||
</DL>
|
||||
|
||||
<H1>Interactive mode:</H1>
|
||||
|
||||
Once the image is displayed, the gif2bgi program goes into interactive mode
|
||||
which recognizes the following commands:<P>
|
||||
|
||||
<DL>
|
||||
<DT> C - get Color and position
|
||||
<DD> In this submenu, a cursor appears and the location and color of the
|
||||
pixel underneath it are printed. The 4 arrows may be used (shifted for
|
||||
faster movement) to move the cursor. Any other key will abort this submode.<P>
|
||||
|
||||
<DT> D - zoom Down
|
||||
<DD> Zoom down by factor of 2 unless current zoom factor is 1.<P>
|
||||
|
||||
<DT> R - Redraw
|
||||
<DD> Redraw the image.<P>
|
||||
|
||||
<DT> S - print Status
|
||||
<DD> Print status of image and program.<P>
|
||||
|
||||
<DT> U - zoom Up
|
||||
<DD> Zoom up by factor of 2 unless current zoom factor is 256.<P>
|
||||
|
||||
<DT> arrow keys
|
||||
<DD> The 4 arrow keys can be used to pan in the desired direction, if the image
|
||||
overflows in that direction. If the image fits into the screen, arrow
|
||||
keys are ignored. The panning steps are 1/2 screen if not on image end.<P>
|
||||
|
||||
<DT> SPC - abort
|
||||
<DD> Space bar may be used to abort current image drawing.<P>
|
||||
|
||||
<DT> ESC - abort
|
||||
<DD> Escape may be used to abort current image drawing.
|
||||
</DL>
|
||||
|
||||
|
||||
<H1>Notes:</H1>
|
||||
|
||||
This program is useless in a Unix environment and is not normally
|
||||
built there.<P>
|
||||
|
||||
No color quantization is used in this program; thus, if a GIF image has more
|
||||
colors than the BGI driver support, this program will abort.<P>
|
||||
|
||||
This driver is optimized for drivers with one byte per pixel (256 colors)
|
||||
and will run MUCH faster on such drivers.<P>
|
||||
|
||||
<H1>Bugs:</H1>
|
||||
|
||||
For some reason I could not figure out, on my ATI wonder card, int 10h call
|
||||
10h (AH = AL = 10h) to set the color registers sometimes result with wrong
|
||||
colors. Direct access of the card registers gives correct results.<P>
|
||||
|
||||
<H1>Author:</H1>
|
||||
|
||||
Gershon Elber
|
||||
|
||||
<HR>
|
||||
<ADDRESS>Eric S. Raymond <A HREF="mailto:esr@thyrsus.com"><esr@snark.thyrsus.com></A></ADDRESS>
|
||||
</BODY>
|
||||
</HTML>
|
||||
|
98
third_party/giflib/doc/gif2epsn.html
vendored
@ -1,98 +0,0 @@
|
||||
<!doctype HTML public "-//W3O//DTD W3 HTML 2.0//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>gif2bgi</TITLE>
|
||||
<link rev=made href=mailto:esr@snark.thyrsus.com>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
Go to <a href="index.html">index page</a>.
|
||||
|
||||
<CENTER><H1>gif2epsn</H1></CENTER>
|
||||
|
||||
A program to dump images saved as GIF files on Epson type printers.<P>
|
||||
|
||||
<H1>Usage:</H1>
|
||||
|
||||
<pre>
|
||||
gif2epsn [-q] [-d dither] [-t bw] [-m map] [-i] [-n] [-p printer] [-h] gif-file
|
||||
</pre>
|
||||
|
||||
If no gif-file is given, Gif2Epsn will try to read a GIF file from stdin.<p>
|
||||
|
||||
|
||||
<H1>Memory required:</H1>
|
||||
|
||||
Screen.
|
||||
|
||||
<H1>Options:</H1>
|
||||
|
||||
<DL>
|
||||
<DT>[-q]
|
||||
<DD> Quiet mode. Default off on MSDOS, on under UNIX. Controls printout
|
||||
of running scan lines. Use -q- to invert.<P>
|
||||
|
||||
<DT>[-d dither]
|
||||
<DD> Sets size of dithering matrix, where DitherSize can be
|
||||
2,3 or 4 only (for 2x2, 3x3 and 4x4 dithering matrices). Default is 2.
|
||||
Note image will be displayed in this mode only if the mapping
|
||||
option (see -m) selected this mode.<P>
|
||||
|
||||
<DT> [-t bw]
|
||||
<DD> Sets threshold level for B&W mapping in percent.
|
||||
This threshold level is used in the different mappings as selected via -m.
|
||||
Default is 19%.<P>
|
||||
|
||||
<DT> [-m map]
|
||||
<DD> Select method to map colors to B&W. Mapping can be:
|
||||
|
||||
<DL>
|
||||
<DT>0<DD>
|
||||
Every none background color is considered foreground (white color but
|
||||
is drawn as black by printer, unless -i is specified).<P>
|
||||
|
||||
<DT>1<DD>
|
||||
If 0.3 * RED + 0.59 * GREEN + 0.11 * YELLOW > BW the pixel is
|
||||
considered white color.<P>
|
||||
|
||||
<DT>2<DD>
|
||||
Colors are mapped as in 1, and use dithering of size as defined using
|
||||
-d option. BWthreshold is used here as scaler.<P>
|
||||
</DL><P>
|
||||
|
||||
The default is option 0.<P>
|
||||
|
||||
<DT> [-i]
|
||||
<DD> Invert the image, i.e. black -> white, white -> black.<P>
|
||||
|
||||
<DT> [-n]
|
||||
<DD> Nicer image. Uses double-density feature of Epson printer. This
|
||||
takes more time (and kills your ink cartridge faster...) but results
|
||||
are usually better.<P>
|
||||
|
||||
<DT> [-p printer]
|
||||
<DD> Under Unix, output goes to stdout by default; under DOS, the
|
||||
default is LPT1:. With this switch you can specify the output
|
||||
target.<P>
|
||||
|
||||
<DT> [-h]
|
||||
<DD> print one line of command line help, similar to Usage above.<P>
|
||||
</DL>
|
||||
|
||||
<H1>Notes:</H1>
|
||||
|
||||
The output has an aspect ratio of 1, so a square image will be square in
|
||||
hardcopy as well.<P>
|
||||
|
||||
The widest image can be printed is 640 pixels, on 8 inch paper. You
|
||||
probably will need to flip wider images, if height is less than that:
|
||||
`<a href="gifflip.html">gifflip</a> -r x29.gif | gif2epsn'. Wider
|
||||
images will be clipped.<P>
|
||||
|
||||
<H1>Author:</H1>
|
||||
|
||||
Gershon Elber
|
||||
|
||||
<HR>
|
||||
<ADDRESS>Eric S. Raymond <A HREF="mailto:esr@thyrsus.com"><esr@snark.thyrsus.com></A></ADDRESS>
|
||||
</BODY>
|
||||
</HTML>
|
153
third_party/giflib/doc/gif2herc.html
vendored
@ -1,153 +0,0 @@
|
||||
<!doctype HTML public "-//W3O//DTD W3 HTML 2.0//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>gif2herc</TITLE>
|
||||
<link rev=made href=mailto:esr@snark.thyrsus.com>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
Go to <a href="index.html">index page</a>.
|
||||
|
||||
<CENTER><H1>gif2herc</H1></CENTER>
|
||||
|
||||
A program to display images saved as GIF files on an IBM PC Hercules
|
||||
graphic card. The program operates as follows:<P>
|
||||
|
||||
<OL>
|
||||
<LI>
|
||||
Read GIF file header and determine size of the image.<P>
|
||||
|
||||
<LI>
|
||||
Dynamically allocate enough memory to hold all the image internally.
|
||||
One byte per pixel is always allocated, so a little bit more than
|
||||
width*height (of screen, not image) bytes are required.<P>
|
||||
|
||||
<LI>
|
||||
Reads the image in. Interlaced images are read correctly, although
|
||||
they are displayed sequentially.<P>
|
||||
|
||||
<LI>
|
||||
Display first image using the defaults as set by the command line option.<P>
|
||||
|
||||
<LI>
|
||||
Goes to interactive mode. For full description of the interactive mode
|
||||
see below.<P>
|
||||
</OL>
|
||||
|
||||
<H1>Usage:</H1>
|
||||
|
||||
<pre>
|
||||
gif2herc [-q] [-d dither] [-z zoom] [-t bw] [-m map] [-i] [-b] [-h] gif-file
|
||||
</pre>
|
||||
|
||||
If no gif-file is given, gif2herc will try to read a GIF file from stdin.<P>
|
||||
|
||||
|
||||
<H1>Memory required:</H1>
|
||||
|
||||
Screen.
|
||||
|
||||
<H1>Options:</H1>
|
||||
|
||||
<DT> [-q]
|
||||
<DD> Quiet mode. Defaults off on MSDOS, on under UNIX. Controls printout
|
||||
of running scan lines. Use -q- to invert.<P>
|
||||
|
||||
<DT> [-d dither]
|
||||
<DD> Sets size of dithering matrix, where dither can be
|
||||
2,3 or 4 only (for 2x2, 3x3 and 4x4 dithering matrices). Default is 2.
|
||||
Note: the image will be dithered only if the mapping (see -m)
|
||||
selected dithering mode.<P>
|
||||
|
||||
<DT> [-z zoom]
|
||||
<DD> Sets zoom factor of the image. Zoom factor should be
|
||||
power of 2 up to 256. Default is 1 (no zoom).<P>
|
||||
|
||||
<DT> [-t bw]
|
||||
<DD> Sets threshold level for B&W mapping in percent.
|
||||
This threshold level is used in the different mappings as selected via -m.
|
||||
Default is 19%.<P>
|
||||
|
||||
<DT> [-m map]
|
||||
<DD> Select method to map colors to B&W. Mapping can be:
|
||||
|
||||
<DL>
|
||||
<DT>0<DD>
|
||||
Every non-background color is considered foreground (white).
|
||||
|
||||
<DT>1<DD>
|
||||
0.3 * RED + 0.59 * GREEN + 0.11 * YELLOW > BWThreshold is considered white.
|
||||
|
||||
<DT>2<DD>
|
||||
Colors are mapped as in 1, and use dithering of size as defined using
|
||||
-d option. BWthreshold is used here as scaler.
|
||||
</DL>
|
||||
|
||||
Default is option 0, which is much faster than the other two.<P>
|
||||
|
||||
<DT> [-i]
|
||||
<DD> Invert the image, i.e. black -> white, white -> black.<P>
|
||||
|
||||
<DT> [-b]
|
||||
<DD> Disable beeps. Every time the image is complete, or a wrong key was
|
||||
presses, sound is generated. The -b option disables that.<P>
|
||||
|
||||
<DT> [-h]
|
||||
<DD> Print one line of command line help, similar to Usage above.<P>
|
||||
</DL>
|
||||
|
||||
<H1>Interactive mode:</H1>
|
||||
|
||||
Once the image is displayed, the program goes into an interactive mode
|
||||
which recognizes the following commands:
|
||||
|
||||
<DL>
|
||||
<DT> C - get Color and position
|
||||
<DD> In this submenu, a cursor appears and the location and color of the
|
||||
pixel underneath it are printed. The 4 arrows may be used (shifted for
|
||||
faster movement) to move the cursor. Any other key will abort this
|
||||
submode.<P>
|
||||
|
||||
|
||||
<DT> D - zoom Down
|
||||
<DD> Zoom down by factor of 2 unless current zoom factor is 1.<P>
|
||||
|
||||
<DT>H - Increase dither matrix size
|
||||
<DD>...unless current size is maximum (4), in which case size is set
|
||||
to minimum (2).<P>
|
||||
|
||||
<DT>I - Invert
|
||||
<DD>Invert the image, i.e. white -> black, black -> white.<P>
|
||||
|
||||
<DT>M - Method
|
||||
<DD>Increment color -> BW mapping method, unless current method is maximum
|
||||
(2), in which case method is set to minimum (0).<P>
|
||||
|
||||
<DT> R - Redraw
|
||||
<DD> Redraw the image.<P>
|
||||
|
||||
<DT> S - print Status
|
||||
<DD> Print status of image and program.<P>
|
||||
|
||||
<DT> U - zoom Up
|
||||
<DD> Zoom up by factor of 2 unless current zoom factor is 256.<P>
|
||||
|
||||
<DT> arrow keys
|
||||
<DD> The 4 arrow keys can be used to pan in the desired direction, if the image
|
||||
overflows in that direction. If the image fits into the screen, arrow
|
||||
keys are ignored. The panning steps are 1/2 screen if not on image end.<P>
|
||||
|
||||
<DT> SPC - abort
|
||||
<DD> Space bar may be used to abort current image drawing.<P>
|
||||
|
||||
<DT> ESC - abort
|
||||
<DD> Escape may be used to abort current image drawing.<P>
|
||||
</DL>
|
||||
|
||||
<H1>Author:</H1>
|
||||
|
||||
Gershon Elber
|
||||
|
||||
<HR>
|
||||
<ADDRESS>Eric S. Raymond <A HREF="mailto:esr@thyrsus.com"><esr@snark.thyrsus.com></A></ADDRESS>
|
||||
</BODY>
|
||||
</HTML>
|
52
third_party/giflib/doc/gif2iris.html
vendored
@ -1,52 +0,0 @@
|
||||
<!doctype HTML public "-//W3O//DTD W3 HTML 2.0//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>gif2iris</TITLE>
|
||||
<link rev=made href=mailto:esr@snark.thyrsus.com>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
Go to <a href="index.html">index page</a>.
|
||||
|
||||
<CENTER><H1>gif2iris</H1></CENTER>
|
||||
|
||||
A program to display images saved as GIF files under the
|
||||
SGI NeWs window system.<P>
|
||||
|
||||
<H1>Usage:</H1>
|
||||
|
||||
<pre>
|
||||
Gif2Iris [-q] [-f] [-p PosX PosY] [-f] [-h] gif-file
|
||||
</pre>
|
||||
|
||||
If no gif-file is given, Gif2Iris will try to read a GIF from stdin.<P>
|
||||
|
||||
<H1>Memory required:</H1>
|
||||
|
||||
Screen.
|
||||
|
||||
<H1>Options:</H1>
|
||||
|
||||
<DL>
|
||||
<DT> [-q]
|
||||
<DD> Quiet mode. Defaults off on MSDOS, on under UNIX. Controls printout
|
||||
of running scan lines. Use -q- to invert.<P>
|
||||
|
||||
<DT> [-f]
|
||||
<DD> Force Gif2Iris to stay in foreground.<P>
|
||||
|
||||
<DT> [-p PosX PosY]
|
||||
<DD> Defines position of image on screen. By default the
|
||||
program will prompt for position.<P>
|
||||
|
||||
<DT> [-h]
|
||||
<DD> Print one line of command line help, similar to Usage above..<P>
|
||||
</DL>
|
||||
|
||||
<H1>Author:</H1>
|
||||
|
||||
Gershon Elber
|
||||
|
||||
<HR>
|
||||
<ADDRESS>Eric S. Raymond <A HREF="mailto:esr@thyrsus.com"><esr@snark.thyrsus.com></A></ADDRESS>
|
||||
</BODY>
|
||||
</HTML>
|
71
third_party/giflib/doc/gif2ps.html
vendored
@ -1,71 +0,0 @@
|
||||
<!doctype HTML public "-//W3O//DTD W3 HTML 2.0//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>gif2ps</TITLE>
|
||||
<link rev=made href=mailto:esr@snark.thyrsus.com>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
Go to <a href="index.html">index page</a>.
|
||||
|
||||
<CENTER><H1>gif2ps</H1></CENTER>
|
||||
|
||||
GIF-to-PostScript conversion.<P>
|
||||
|
||||
<H1>Usage:</H1>
|
||||
|
||||
<pre>
|
||||
gif2ps [-q] [-x] [-y] [-s sx sy] [-p px py] [-i] [-n copies] [-h] gif-file
|
||||
</pre>
|
||||
|
||||
If no gif-file is given, Gif2PS will try to read a GIF file from stdin.<P>
|
||||
|
||||
|
||||
<H1>Memory required:</H1>
|
||||
|
||||
Line.
|
||||
|
||||
<H1>Options:</H1>
|
||||
|
||||
<DL>
|
||||
<DT> [-q]
|
||||
<DD> quiet mode. Defaults off on MSDOS, on under UNIX. Controls printout
|
||||
of running scan lines. Use -q- to invert.<P>
|
||||
|
||||
<DT> [-x]
|
||||
<DD> Force image to be horizontal (`landscape mode'). By default image
|
||||
will be positioned so it will be the biggest. If -x is given image will be
|
||||
scaled to be biggest possible horizontally.<P>
|
||||
|
||||
<DT> [-y]
|
||||
<DD> Force vertical (`portrait mode'); analogous to -x.<P>
|
||||
|
||||
<DT> [-s sx sy]
|
||||
<DD> Force image size to be sx by sy inches.
|
||||
If image will exit page dimensions, it will scream and die.
|
||||
Page dimensions are 8.5 by 11.0 inches but only 7.5 by 9.0 are assumed to
|
||||
be printable.<P>
|
||||
|
||||
<DT> [-p pc py]
|
||||
<DD> Force image lower left corner to be as px py.
|
||||
If this would overrun the page's dimensions, it will scream and die.<P>
|
||||
|
||||
<DT> [-i]
|
||||
<DD> Image will be inverted (Black -> White and vice versa).
|
||||
Mapping from colors is done by 0.3 * RED + 0.59 * GREEN + 0.11 * BLUE
|
||||
and sometimes inverting the image will look better.<P>
|
||||
|
||||
<DT> [-n copies]
|
||||
<DD> Number of copies to print. 1 by default.<P>
|
||||
|
||||
<DT> [-h]
|
||||
<DD> Print one line of command help, similar to Usage above.<P>
|
||||
</DL>
|
||||
|
||||
<H1>Author:</H1>
|
||||
|
||||
Gershon Elber
|
||||
|
||||
<HR>
|
||||
<ADDRESS>Eric S. Raymond <A HREF="mailto:esr@thyrsus.com"><esr@snark.thyrsus.com></A></ADDRESS>
|
||||
</BODY>
|
||||
</HTML>
|
55
third_party/giflib/doc/gif2rgb.html
vendored
@ -1,55 +0,0 @@
|
||||
<!doctype HTML public "-//W3O//DTD W3 HTML 2.0//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>gif2rgb</TITLE>
|
||||
<link rev=made href=mailto:esr@snark.thyrsus.com>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
Go to <a href="index.html">index page</a>.
|
||||
|
||||
<CENTER><H1>gif2rgb</H1></CENTER>
|
||||
|
||||
A program to convert images saved as GIF to 24-bit RGB image(s).
|
||||
|
||||
|
||||
<H1>Usage:</H1>
|
||||
|
||||
<pre>
|
||||
gif2rgb [-q] [-1] [-o OutFileName] [-h] gif-file
|
||||
</pre>
|
||||
|
||||
If no gif-file is given, Gif2RGB will try to read a GIF file from stdin.<P>
|
||||
|
||||
<H1>Memory required:</H1>
|
||||
|
||||
Screen.
|
||||
|
||||
<H1>Options:</H1>
|
||||
|
||||
<DL>
|
||||
<DT> [-q]
|
||||
<DD> Quiet mode. Defaults off on MSDOS, on under UNIX. Controls printout
|
||||
of running scan lines. Use -q- to invert.<P>
|
||||
|
||||
<DT> [-1]
|
||||
<DD> Only one file in the format of RGBRGB... triplets (Each of R, G, B
|
||||
is a byte) is being written. This file size is 3 * Width * Height.
|
||||
If stdout is used for output, this option is implicitly applied.
|
||||
The default (if not `-1') is 3 files with the names OutFileName.R,
|
||||
OutFileName.G, OutFileName.B, each of which is Width * Height bytes.<P>
|
||||
|
||||
<DT> [-o OutFileName]
|
||||
<DD> specifies the name of the out file (see also `-1' above).<P>
|
||||
|
||||
<DT> [-h]
|
||||
<DD> Print one line of command line help, similar to Usage above.<P>
|
||||
</DL>
|
||||
|
||||
<H1>Author:</H1>
|
||||
|
||||
Gershon Elber
|
||||
|
||||
<HR>
|
||||
<ADDRESS>Eric S. Raymond <A HREF="mailto:esr@thyrsus.com"><esr@snark.thyrsus.com></A></ADDRESS>
|
||||
</BODY>
|
||||
</HTML>
|
56
third_party/giflib/doc/gif2rle.html
vendored
@ -1,56 +0,0 @@
|
||||
<!doctype HTML public "-//W3O//DTD W3 HTML 2.0//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>gif2rle</TITLE>
|
||||
<link rev=made href=mailto:esr@snark.thyrsus.com>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
Go to <a href="index.html">index page</a>.
|
||||
|
||||
<CENTER><H1>gif2rle</H1></CENTER>
|
||||
|
||||
A program to convert images saved as GIF to RLE (Utah raster toolkit)
|
||||
format.<p>
|
||||
|
||||
<H1>Usage:</H1>
|
||||
|
||||
<pre>
|
||||
gif2rle [-q] [-a] [-h] gif-file
|
||||
</pre>
|
||||
|
||||
If no gif-file is given, Gif2Rle will try to read a GIF file from stdin.<p>
|
||||
|
||||
|
||||
<H1>Memory required:</H1>
|
||||
|
||||
Screen.
|
||||
|
||||
<H1>Options:</H1>
|
||||
|
||||
<DL>
|
||||
<DT> [-q]
|
||||
<DD> Quiet mode. Defaults off on MSDOS, on under UNIX. Controls printout
|
||||
of running scan lines. Use -q- to invert.<P>
|
||||
|
||||
<DT> [-a]
|
||||
<DD> Add alpha channel (see rle document) to the output data file.<P>
|
||||
|
||||
<DT> [-h]
|
||||
<DD> Print one line command line help, similar to Usage above.<P>
|
||||
</DL>
|
||||
|
||||
<H1>Notes:</H1>
|
||||
|
||||
This routine must be linked with the RLE toolkit library librle.a and
|
||||
is not built by the normal distribution make. If you want to convert
|
||||
images to RLE format, it is reasonable to assume you have this library
|
||||
available.<p>
|
||||
|
||||
<H1>Author:</H1>
|
||||
|
||||
Gershon Elber
|
||||
|
||||
<HR>
|
||||
<ADDRESS>Eric S. Raymond <A HREF="mailto:esr@thyrsus.com"><esr@snark.thyrsus.com></A></ADDRESS>
|
||||
</BODY>
|
||||
</HTML>
|
59
third_party/giflib/doc/gif2x11.html
vendored
@ -1,59 +0,0 @@
|
||||
<!doctype HTML public "-//W3O//DTD W3 HTML 2.0//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>gif2x11</TITLE>
|
||||
<link rev=made href=mailto:esr@snark.thyrsus.com>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
Go to <a href="index.html">index page</a>.
|
||||
|
||||
<CENTER><H1>gif2x11</H1></CENTER>
|
||||
|
||||
A program to display images saved as GIF files under X window system.<P?
|
||||
|
||||
<H1>Usage:</H1>
|
||||
|
||||
<pre>
|
||||
gif2x11 [-q] [-p PosX PosY] [-d Display] [-f] [-h] gif-file
|
||||
</pre>
|
||||
|
||||
If no gif-file is given, Gif2X11 will try to read a GIF file from stdin.
|
||||
Note: this program does <em>not</em> read the X resource data base.<P>
|
||||
|
||||
<H1>Memory required:</H1>
|
||||
|
||||
Screen.
|
||||
|
||||
<H1>Options:</H1>
|
||||
|
||||
<DL>
|
||||
<DT> [-q]
|
||||
<DD> Quiet mode. Defaults off on MSDOS, on under UNIX. Controls printout
|
||||
of running scan lines. Use -q- to invert.<P>
|
||||
|
||||
<DT> [-p PosX PosY]
|
||||
<DD> Set the position of image on screen. By default the
|
||||
program will prompt for position.<P>
|
||||
|
||||
<DT> [-d Display]
|
||||
<DD> What X server should be connected to.<P>
|
||||
|
||||
<DT> [-f]
|
||||
<DD> Force attempt to allocate exact colors. This usually will result in a
|
||||
very muddled image if not enough colors can be allocated; the rest of
|
||||
them will be approximated by the closest one. By default the least bits
|
||||
of the colors are stripped until success (in allocation) which looks much
|
||||
better.<P>
|
||||
|
||||
<DT> [-h]
|
||||
<DD> Print one line command line help, similar to Usage above.<P>
|
||||
</DL>
|
||||
|
||||
<H1>Author:</H1>
|
||||
|
||||
Gershon Elber
|
||||
|
||||
<HR>
|
||||
<ADDRESS>Eric S. Raymond <A HREF="mailto:esr@thyrsus.com"><esr@snark.thyrsus.com></A></ADDRESS>
|
||||
</BODY>
|
||||
</HTML>
|
2475
third_party/giflib/doc/gif89.txt
vendored
713
third_party/giflib/doc/gif_lib.html
vendored
@ -1,713 +0,0 @@
|
||||
<!doctype HTML public "-//W3O//DTD W3 HTML 2.0//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>gif_lib</TITLE>
|
||||
<link rev=made href=mailto:esr@snark.thyrsus.com>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
Go to <a href="index.html">index page</a>.
|
||||
|
||||
<CENTER><H1>The GIFLIB Library</H1></CENTER>
|
||||
|
||||
<CENTER><BLOCKQUOTE>
|
||||
Gershon Elber, May 1991<BR>
|
||||
Eric S. Raymond, Sep 1992<BR>
|
||||
Toshio Kuratomi, May 2004<br>
|
||||
</BLOCKQUOTE></CENTER>
|
||||
|
||||
The Graphics Interchange Format(c) is the Copyright property of
|
||||
CompuServe Incorporated. GIF(sm) is a Service Mark property of CompuServe
|
||||
Incorporated.<P>
|
||||
|
||||
Gershon wrote: "This library was written because I couldn't find
|
||||
anything similar and I wanted one. I was inspired by the RLE Utah tool kit,
|
||||
which I hoped to port to an IBM PC, but found it to be too machine specific,
|
||||
and its compression ratio too low. I compromised on the GIF format, but I am
|
||||
not sure how long 8 bits per pixel will be enough."<P>
|
||||
|
||||
This document explains the GIF library code in directory `lib'. The
|
||||
code is collected into libgif.a which is used in all the utilities in
|
||||
`util'. It can be used in any application needs to read/write the GIF
|
||||
file format. This document does </em>not</em> explain the GIF file
|
||||
format and assumes you know it, at least to the level of the GIF file
|
||||
structure.<P>
|
||||
|
||||
When a GIF file is opened, a GIF file descriptor is created which
|
||||
is a pointer to GifFileType structure as follows:<P>
|
||||
|
||||
<pre><code>
|
||||
typedef struct GifFileType {
|
||||
int SWidth, SHeight, /* Screen dimensions. */
|
||||
SColorResolution, /* How many colors can we generate? */
|
||||
SBackGroundColor; /* I hope you understand this one... */
|
||||
ColorMapObject *SColorMap; /* NULL if not exists. */
|
||||
int ImageCount; /* Number of current image */
|
||||
GifImageDesc Image; /* Block describing current image */
|
||||
struct SavedImage *SavedImages; /* Use this to accumulate file state */
|
||||
VoidPtr Private; /* The regular user should not mess with this one! */
|
||||
} GifFileType;
|
||||
</code></pre>
|
||||
|
||||
This structure was copied from gif_lib.h - the header file for the GIF
|
||||
library. Any application program that uses the libgif.a library should
|
||||
include it. Members beginning with S refer to GIF Screen; others hold
|
||||
properties of the current image (a GIF file may have more than one image)
|
||||
or point to allocated store used by various routines.<P>
|
||||
|
||||
The user almost never writes into this structure (exception: it may
|
||||
occasionally useful to alter things in the SavedImages array), but can read
|
||||
any of these items at any time it is valid (image information is invalid
|
||||
until first image was read/write).<P>
|
||||
|
||||
As the library needs to keep its own internal data, a Private pointer
|
||||
to hidden data is included. Applications should ignore this item.<P>
|
||||
|
||||
The library has no static data. This means that it is fully reentrant
|
||||
and any number of GIF files (up to memory limits) can be opened for
|
||||
read/write. Instead of the static data, internal structure pointed by the
|
||||
Private pointer is used.<P>
|
||||
|
||||
The library allocates its own memory dynamically, on opening of files,
|
||||
and releases that once closed. The user is never required to allocate
|
||||
any memory for any of the functions of this library nor to free them
|
||||
directly.<P>
|
||||
|
||||
In order to reduce disk access, the file buffer is increased to
|
||||
FILE_BUFFER_SIZE (defined in gif_lib.h). The library was compiled in large
|
||||
model on the PC as the memory allocated per file is quite big: about 17k for
|
||||
decoding (DGIF_LIB.C), and 32k for encoding (EGIF_LIB.C), excluding the
|
||||
FILE_BUFFER_SIZE.<P>
|
||||
|
||||
Here is a module summary:<P>
|
||||
|
||||
<DL>
|
||||
<DT>egif_lib.c <DD> Encoding routines, all prefixed with E.<P>
|
||||
|
||||
<DT>dgif_lib.c <DD> Decoding routines, all prefixed with D.<P>
|
||||
|
||||
<DT>dev2gif.c <DD> Routines to convert specific device buffers into GIF files.<P>
|
||||
|
||||
<DT>gifalloc.c <DD> Routines for colormap handling and GIF record allocation.<P>
|
||||
|
||||
<DT>gif_font.c <DD> The 8x8 font table for the GIF utility font.<P>
|
||||
|
||||
<DT>gif_err.c <DD> Error handler for the library.<P>
|
||||
</DL>
|
||||
|
||||
The library includes a sixth file of hash-function code which is accessed
|
||||
internally only.<P>
|
||||
|
||||
<P>Most of the routines return GIF_ERROR (see gif_lib.h) if something
|
||||
went wrong, GIF_OK otherwise. After an error return, the code in the
|
||||
gif_err.c module can be used to do something about it.<P>
|
||||
|
||||
In addition, a module to parse command line arguments is supplied.
|
||||
This module is called getarg.c and its headers are in getarg.h. See the header
|
||||
of getarg.c for details on its usage.<P>
|
||||
|
||||
<H1>Decoding (dgif_lib.c)</H1>
|
||||
|
||||
The following functions are used to set up input from a GIF:<P>
|
||||
|
||||
<pre><code>
|
||||
GifFileType *DGifOpenFileName(char *GifFileName)
|
||||
</code></pre>
|
||||
|
||||
Open a new GIF file using the given GifFileName, and read its Screen
|
||||
information.
|
||||
</code></pre>
|
||||
|
||||
If any error occurs, NULL is returned and the error handler can be
|
||||
used to get the exact error (see gif_err.c).
|
||||
</code></pre>
|
||||
|
||||
The file is opened in binary mode, and its buffer size is set to
|
||||
FILE_BUFFER_SIZE bytes.
|
||||
</code></pre>
|
||||
|
||||
<pre><code>
|
||||
GifFileType *DGifOpenFileHandle(int GifFileHandle)
|
||||
</code></pre>
|
||||
|
||||
Open a new GIF file using the given GifFileHandle, and read its Screen
|
||||
information.<P>
|
||||
|
||||
If any error occurs, NULL is returned and the error handler can be
|
||||
used to get the exact error (see gif_err.c).<P>
|
||||
|
||||
The file is opened in binary mode, and its buffer size is set to
|
||||
FILE_BUFFER_SIZE bytes.<P>
|
||||
|
||||
Once you have acquired a handle on a GIF, there are two ways to read it in.
|
||||
The high-level function
|
||||
|
||||
<pre><code>
|
||||
int DGifSlurp(GifFileType)
|
||||
</code></pre>
|
||||
|
||||
reads the rest of a complete (possibly multi-image) GIF file from the
|
||||
indicated file handle into in-core allocated structures. It returns
|
||||
GIF_OK on success, GIF_ERROR on failure.<P>
|
||||
|
||||
Once you have done this, all image, raster, and extension-block data in the
|
||||
GIF is accessable in the SavedImages member (see the structures in fif_lib.h).
|
||||
When you have modified the image to taste, write it out with EGifSpew().<P>
|
||||
|
||||
If you are handling large images on a memory-limited machine, you may need
|
||||
to use the following functions for sequential read.<P>
|
||||
|
||||
<pre><code>
|
||||
int DGifGetScreenDesc(GifFileType *GifFile)
|
||||
</code></pre>
|
||||
|
||||
Reads the screen information into the GifFile structure. Note this
|
||||
routine is automatically called once a file is opened, and therefore
|
||||
usually need not be called explicitly.<P>
|
||||
|
||||
Returns GIF_ERROR if something went wrong, GIF_OK otherwise.<P>
|
||||
|
||||
<pre><code>
|
||||
int DGifGetRecordType(GifFileType *GifFile, GifRecordType *GifType)
|
||||
</code></pre>
|
||||
|
||||
As the GIF file can have different records in arbitrary order, this
|
||||
routine should be called once the file was open to detect the next
|
||||
record type, and act upon it. It can return these types in GifType:<P>
|
||||
|
||||
<DL>
|
||||
<DT> 1. UndefinedRecordType <DD> something is wrong!<P>
|
||||
|
||||
<DT> 2. ScreenDescRecordType <DD> screen information. As the screen info
|
||||
is automatically read in when the file is open, this should
|
||||
not happen.<P>
|
||||
|
||||
<DT> 3. ImageDescRecordType <DD> next record is an image descriptor.<P>
|
||||
|
||||
<DT> 4. ExtensionRecordType <DD> next record is extension block.<P>
|
||||
|
||||
<DT> 5. TerminateRecordType <DD> last record reached, can close the file.<P>
|
||||
</DL>
|
||||
The first two types can usually be ignored. The function
|
||||
returns GIF_ERROR if something went wrong, GIF_OK otherwise.
|
||||
|
||||
<pre><code>
|
||||
int DGifGetImageDesc(GifFileType *GifFile)
|
||||
</code></pre>
|
||||
|
||||
Reads image information into the GifFile structure.
|
||||
Returns GIF_ERROR if something went wrong, GIF_OK otherwise.<P>
|
||||
|
||||
<pre><code><A NAME="DGifGetLine">
|
||||
int DGifGetLine(GifFileType *GifFile, PixelType *GifLine, int GifLineLen)
|
||||
</A></code></pre>
|
||||
|
||||
Load a block of pixels from the GIF file. The line can be
|
||||
of any length. More than that, this routine may be interleaved with
|
||||
DGifGetPixel until all pixels have been read.<P>
|
||||
|
||||
Returns GIF_ERROR if something went wrong, GIF_OK otherwise.</P>
|
||||
|
||||
<pre><code>
|
||||
int DGifGetPixel(GifFileType *GifFile, PixelType GifPixel)
|
||||
</code></pre>
|
||||
|
||||
Loads one pixel from the GIF file. This routine may be interleaved
|
||||
with <a href="#DGifGetLine">DGifGetLine</a>, until all pixels are
|
||||
read. Because of the overhead per each call, use of this routine is
|
||||
not recommended.<P>
|
||||
|
||||
Returns GIF_ERROR if something went wrong, GIF_OK otherwise.<P>
|
||||
|
||||
<pre><code>
|
||||
int DGifGetComment(GifFileType *GifFile, char *GifComment)
|
||||
</code></pre>
|
||||
|
||||
Load a comment from the GIF file. Because DGifGetRecordType will
|
||||
only tell if the record is of type extension, this routine should be
|
||||
called iff it is known %100 that is must be a comment.<P>
|
||||
|
||||
For the definition of a comment, see <a
|
||||
href="#EGifPutComment">EGifPutComment</a>. Returns GIF_ERROR if
|
||||
something went wrong, GIF_OK otherwise.<P>
|
||||
|
||||
<pre><code>
|
||||
int DGifGetExtension(
|
||||
GifFileType *GifFile,
|
||||
int *GifExtCode,
|
||||
ByteType **GifExtension)
|
||||
</code></pre>
|
||||
|
||||
Loads an extension block from the GIF file. Extension blocks
|
||||
are optional in GIF files. This routine should be followed by
|
||||
<a href="#DGifGetExtensionNext">DGifGetExtensionNext</a>.<P>
|
||||
|
||||
Returns GIF_ERROR if something went wrong, GIF_OK otherwise.<P>
|
||||
|
||||
<pre><code><A NAME="DGifGetExtensionNext">
|
||||
int DGifGetExtensionNext(GifFileType *GifFile, ByteType **GifExtension)
|
||||
</A> </code></pre>
|
||||
|
||||
As extensions may contain more than one block, use this routine to
|
||||
continue after DGifGetExtension, until *GifExtension is NULL.<P>
|
||||
|
||||
Returns GIF_ERROR if something went wrong, GIF_OK otherwise.<P>
|
||||
|
||||
|
||||
<pre><code>
|
||||
int DGifGetCode(
|
||||
GifFileType *GifFile,
|
||||
int *GifCodeSize, ByteType **GifCodeBlock)
|
||||
</code></pre>
|
||||
|
||||
It sometimes may be desired to read the compressed code as is
|
||||
without decoding it. This routine does exactly that (with
|
||||
DGifGetCodeNext), and can be used instead of DGifGetLine.<P>
|
||||
|
||||
This compressed code information can be written out using the
|
||||
EGifPutCode/EGifPutCodeNext sequence (see gifpos.c for example).
|
||||
Returns GIF_ERROR if something went wrong, GIF_OK otherwise.<P>
|
||||
|
||||
<pre><code>
|
||||
int DGifGetCodeNext(GifFileType *GifFile, ByteType **GifCodeBlock)
|
||||
</code></pre>
|
||||
|
||||
See DGifGetCode above.<P>
|
||||
|
||||
<pre><code>
|
||||
int DGifGetLZCodes(GifFileType *GifFile, int *GifCode)
|
||||
</code></pre>
|
||||
|
||||
This routine can be called instead of DGifGetLine/DGifGetPixel or
|
||||
DGifGetCode/DGifGetCodeNext to get the 12 bits LZ codes of the images.
|
||||
It will be used mainly for debugging purposes (see GifText.c for
|
||||
example).<P>
|
||||
|
||||
Returns GIF_ERROR if something went wrong, GIF_OK otherwise.<P>
|
||||
|
||||
<pre><code>
|
||||
int DGifCloseFile(GifFileType *GifFile)
|
||||
</code></pre>
|
||||
|
||||
Close GIF file and free all memory allocated for it. GifFile should
|
||||
not be used after this routine has been called.<P>
|
||||
|
||||
Returns GIF_ERROR if something went wrong, GIF_OK otherwise.<P>
|
||||
|
||||
<H1>Encoding (egif_lib.c)</H1>
|
||||
|
||||
There are two ways to write out a GIF. The high-level function<P>
|
||||
|
||||
<pre>
|
||||
int EGifSpew(GifFileType *GifFile, int GifFileHandle)
|
||||
</pre>
|
||||
|
||||
Writes a complete (possibly multi-image) GIF file to the indicated file
|
||||
handle from in-core allocated structures created by a previous DGifSlurp()
|
||||
or equivalent operations. Its arguments are a GIF file descriptor (as
|
||||
above) and an ordinary output file descriptor.<P>
|
||||
|
||||
The file is written with a GIF87 stamp unless it contains one of the four
|
||||
special extension blocks defined in GIF89, in which case it is written
|
||||
with a GIF89 stamp.<P>
|
||||
|
||||
If you are handling large images on a memory-limited machine, you may need
|
||||
to use the following functions for sequential write.<P>
|
||||
|
||||
<pre><code>
|
||||
GifFileType *EGifOpenFileName(char *GifFileName, int GifTestExistance)
|
||||
</code></pre>
|
||||
|
||||
Open a new GIF file using the given GifFileName. If GifTestExistance
|
||||
is TRUE, and file exists, the file is not destroyed, and NULL
|
||||
returned.<P>
|
||||
|
||||
If any error occurs, NULL is returned and the error handler can be
|
||||
used to get the exact error (see gif_err.c).<P>
|
||||
|
||||
The file is opened in binary mode, and its buffer size is set to
|
||||
FILE_BUFFER_SIZE bytes.<P>
|
||||
|
||||
<pre><code>
|
||||
GifFileType *EGifOpenFileHandle(int GifFileHandle)
|
||||
</code></pre>
|
||||
|
||||
Open a new GIF file using the given GifFileHandle.<P>
|
||||
|
||||
If any error occurs, NULL is returned and the error handler can be
|
||||
used to get the exact error (see gif_err.c).<P>
|
||||
|
||||
The file is opened in binary mode, and its buffer size is set to
|
||||
FILE_BUFFER_SIZE bytes.<P>
|
||||
|
||||
<pre><code>
|
||||
void EGifSetGifVersion(char *Version)
|
||||
</code></pre>
|
||||
|
||||
Sets the GIF version of all files opened, until another call to this
|
||||
routine is made. Version is a 3 characters string of the form "87a"
|
||||
or "89a". No test is made to validate this string.<P>
|
||||
|
||||
<pre><code>
|
||||
int EGifPutScreenDesc(GifFileType *GifFile,
|
||||
int GifWidth, int GifHeight,
|
||||
int GifColorRes, int GifBackGround,
|
||||
ColorMapObject *GifColorMap)
|
||||
</code></pre>
|
||||
|
||||
Update the GifFile Screen parameters, in GifFile structure and in
|
||||
the real file. If error occurs, returns GIF_ERROR (see gif_lib.h),
|
||||
otherwise GIF_OK.<P>
|
||||
|
||||
This routine should be called immediately after the GIF file was
|
||||
opened.<P>
|
||||
|
||||
<pre><code>
|
||||
int EGifPutImageDesc(GifFileType *GifFile,
|
||||
int GifLeft, int GifTop,
|
||||
int Width, int GifHeight,
|
||||
int GifInterlace,
|
||||
ColorMapObject *GifColorMap)
|
||||
</code></pre>
|
||||
|
||||
Update GifFile Image parameters, in GifFile structure and in the real
|
||||
file. if error occurs returns GIF_ERROR (see gif_lib.h), otherwise
|
||||
GIF_OK.<P>
|
||||
|
||||
This routine should be called each time a new image must be
|
||||
dumped to the file.<P>
|
||||
|
||||
<pre><code><A NAME="EGifPutLine">
|
||||
int EGifPutLine(GifFileType *GifFile, PixelType *GifLine, int GifLineLen)
|
||||
</A> </code></pre>
|
||||
|
||||
Dumps a block of pixels out to the GIF file. The slab can be
|
||||
of any length. More than that, this routine may be interleaved with
|
||||
<a href="#EGifPutPixel"></a>, until all pixels have been sent.<P>
|
||||
|
||||
Returns GIF_ERROR if something went wrong, GIF_OK otherwise.<P>
|
||||
|
||||
<pre><code><A NAME="EGifPutPixel">
|
||||
int EGifPutPixel(GifFileType *GifFile, PixelType GifPixel)
|
||||
</A></code></pre>
|
||||
|
||||
Dumps one pixel to the GIF file. This routine may be interleaved with
|
||||
<a href="#EGifPutLine">EGifPutLine</a>, until all pixels were sent.
|
||||
Because of the overhead for each call, use of this routine is not
|
||||
recommended.<P>
|
||||
|
||||
Returns GIF_ERROR if something went wrong, GIF_OK otherwise.<P>
|
||||
|
||||
<pre><code><A NAME="EGifPutComment">
|
||||
int EGifPutComment(GifFileType *GifFile, char *GifComment)
|
||||
</A></code></pre>
|
||||
|
||||
Uses extension GIF records to save a string as a comment is the file.
|
||||
The extension code is 'C' (for Comment).<P>
|
||||
|
||||
Returns GIF_ERROR if something went wrong, GIF_OK otherwise.<P>
|
||||
|
||||
<pre><code>
|
||||
int EGifPutExtension(
|
||||
GifFileType *GifFile,
|
||||
int GifExtCode,
|
||||
int GifExtLen,
|
||||
void *GifExtension)
|
||||
</code></pre>
|
||||
|
||||
Dumps the given extension block into the GIF file. Extension blocks
|
||||
are optional in GIF file. Extension blocks of more than 255 bytes or
|
||||
more than one block are not supported in this function. Please use
|
||||
EGifPutExtensionFirst, EGifPutExtensionNext, and EGifPutExtensionLast
|
||||
if your extension blocks may fall into this category.<P>
|
||||
|
||||
Returns GIF_ERROR if something went wrong, GIF_OK otherwise.<P>
|
||||
|
||||
<pre><code>
|
||||
int EGifPutExtensionFirst(
|
||||
GifFileType * GifFile,
|
||||
int GifExtCode,
|
||||
int GifExtLen,
|
||||
const VoidPtr GifExtension)
|
||||
</code></pre>
|
||||
Dumps the beginning of a GIF extension block to a GIF file. Extension blocks
|
||||
are optional in GIF files. This function outputs the meta information
|
||||
necessary to a GIF extension block and the extension data described in the
|
||||
GifExtension argument.<P>
|
||||
|
||||
Further blocks of the GIF Extension should be dumped using
|
||||
EGifPutExtensionNext. When finished with this extension block,
|
||||
EGifPutExtensionLast should be called to output the block termination.<P>
|
||||
|
||||
Returns GIF_ERROR if something went wrong, GIF_OK otherwise.<P>
|
||||
|
||||
<pre><code>
|
||||
int EGifPutExtensionNext(
|
||||
GifFileType * GifFile,
|
||||
int GifExtCode,
|
||||
int GifExtLen,
|
||||
const VoidPtr GifExtension)
|
||||
</code></pre>
|
||||
Dumps a subblock of a GIF extension to a GIF File. Extension blocks are
|
||||
optional in GIF files. This function will write the Extension Data in
|
||||
GifExtension to the file as a subblock of the preceding Extension Block.
|
||||
Repeat calling of this function until all data subblocks have been output.<P>
|
||||
|
||||
Note that EGifPutExtensionFirst needs to be called before any calls to this
|
||||
function. EGifPutExtensionLast should be called to finish the Extension
|
||||
block after all data subblocks have been output.<P>
|
||||
|
||||
Returns GIF_ERROR if something went wrong, GIF_OK otherwise.<P>
|
||||
|
||||
<pre><code>
|
||||
int EGifPutExtensionLast(
|
||||
GifFileType * GifFile,
|
||||
int GifExtCode,
|
||||
int GifExtLen,
|
||||
const VoidPtr GifExtension)
|
||||
</code></pre>
|
||||
Dumps an optional GIF extension data subblock and the GIF extension block
|
||||
terminator to a GIF File. Extension blocks are optional in GIF files. This
|
||||
function will write the Extension Data in GifExtension to the file as a
|
||||
subblock of the preceding Extension Block. Then it will output the GIF
|
||||
extension block terminator to end the current Extension block. As a special
|
||||
case, if GifExtLen is zero, the function will assume there isn't another
|
||||
data block to output and will simply write the block terminator.<P>
|
||||
|
||||
Note that a call to EGifPutExtensionFirst is needed to open the GIF
|
||||
Extension Block prior to calling this function.<P>
|
||||
|
||||
Returns GIF_ERROR if something went wrong, GIF_OK otherwise.<P>
|
||||
|
||||
<pre><code>
|
||||
int EGifPutCode(
|
||||
GifFileType *GifFile,
|
||||
int *GifCodeSize,
|
||||
ByteType **GifCodeBlock)
|
||||
</code></pre>
|
||||
|
||||
It sometimes may be desired to write the compressed code as is
|
||||
without decoding it. For example a filter for a GIF file that change
|
||||
only screen size (GifPos), does not need the exact pixel values.
|
||||
Piping out the compressed image as is makes this process much
|
||||
faster.<P>
|
||||
|
||||
This routine does exactly that (with EGifPutCodeNext), and can be
|
||||
used instead of EGifPutLine. You'll usually use this with the
|
||||
DGifGetCode/DgifGetCodeNext routines, which reads the compressed
|
||||
code, while EGifPutCode/EGifPutCodeNext write it out. See gifpos.c
|
||||
for example.<P>
|
||||
|
||||
Returns GIF_ERROR if something went wrong, GIF_OK otherwise.<P>
|
||||
|
||||
<pre><code>
|
||||
int EGifPutCodeNext(GifFileType *GifFile, ByteType **GifCodeBlock)
|
||||
</code></pre>
|
||||
|
||||
See EGifPutCode above.<P>
|
||||
|
||||
<pre><code>
|
||||
int EGifCloseFile(GifFileType *GifFile)
|
||||
</code></pre>
|
||||
|
||||
Close a GIF file and free all memory allocated for it. gif-file$
|
||||
should not be used, once this routine was called.<P>
|
||||
|
||||
Returns GIF_ERROR if something went wrong, GIF_OK otherwise.<P>
|
||||
|
||||
<H1>Color map handling and allocation routines</H1>
|
||||
|
||||
<pre><code>
|
||||
ColorMapObject *MakeMapObject(int ColorCount, GifColorType *ColorMap)
|
||||
</code></pre>
|
||||
|
||||
Allocate storage for a color map object with the given number of
|
||||
RGB triplet slots. If the second argument is non-NULL, initialize
|
||||
the color table portion of the new map from it. Returns NULL if
|
||||
memory is exhausted or if the size is not a power of 2 <= 256.<P>
|
||||
|
||||
<pre><code>
|
||||
void FreeMapObject(ColorMapObject *Object)
|
||||
</code></pre>
|
||||
|
||||
Free the storage occupied by a ColorMapObject that is no longer needed.<P>
|
||||
|
||||
<pre><code>
|
||||
ColorMapObject *UnionColorMap(
|
||||
ColorMapObject *ColorIn1, ColorMapObject *ColorIn2,
|
||||
GifPixelType ColorTransIn2[])
|
||||
</code></pre>
|
||||
|
||||
Create the union of two given color maps and return it. If the result
|
||||
won't fit into 256 colors, NULL is returned, the allocated union
|
||||
otherwise. ColorIn1 is copied as it to ColorUnion, while colors from
|
||||
ColorIn2 are copied iff they didn't exist before. ColorTransIn2 maps
|
||||
the old ColorIn2 into ColorUnion color map table.<P>
|
||||
|
||||
<pre><code>
|
||||
SavedImage *GifAttachImage(GifFileType *GifFile)
|
||||
</code></pre>
|
||||
|
||||
Add an image block to the SavedImages array. The image block is
|
||||
initially zeroed out. This image block will be seen by any following
|
||||
EGifSpew() calls.
|
||||
</code></pre>
|
||||
|
||||
<H1>The GIF Utility Font</H1>
|
||||
|
||||
The 8x8 utility font used in text2gif and gifcolor lives in the library
|
||||
module gif_font.c, in a table called AsciiTable. The library header file
|
||||
includes suitable externs and defines.<P>
|
||||
|
||||
The GIF utility font support includes entry points for drawing legends
|
||||
on in-core images, drawing boxes and rectangles, and boxing text.
|
||||
These entry points are as follows:<P>
|
||||
|
||||
<pre><code>
|
||||
void DrawText(
|
||||
SavedImage *Image,
|
||||
const int x, const int y,
|
||||
const char *legend,
|
||||
const int color)
|
||||
</code></pre>
|
||||
|
||||
Draw text using the 8x8 utility font on the saved image. Upper left
|
||||
corner of the text is at image pixel (x, y). Use the specified
|
||||
color index.<P>
|
||||
|
||||
<pre><code>
|
||||
void DrawBox(SavedImage *Image,
|
||||
const int x, const int y,
|
||||
const int w, const int h,
|
||||
const int color)
|
||||
</code></pre>
|
||||
|
||||
Draw a box on the saved image. Upper left corner of the box is at
|
||||
image pixels (x, y), width is w, height is h. Use the specified color
|
||||
index.<P>
|
||||
|
||||
<pre><code>
|
||||
void DrawRectangle(SavedImage *Image,
|
||||
const int x, const int y,
|
||||
const int w, const int h,
|
||||
const int color)
|
||||
</code></pre>
|
||||
|
||||
Draw a (filled) rectangle on the saved image. Upper left corner of
|
||||
the box is at image pixels (x, y), width is w, height is h. Use the
|
||||
specified color index.<P>
|
||||
|
||||
<pre><code>
|
||||
void DrawBoxedText(SavedImage *Image,
|
||||
const int x, const int y,
|
||||
const char *legend,
|
||||
const int border,
|
||||
const int bg, const int fg)
|
||||
</code></pre>
|
||||
|
||||
Draw text on a filled rectangle. The rectangle will be sized to fit
|
||||
the text, with upper left hand corner at (x, y) on the saved image.
|
||||
The `border' argument specifies a pixel margin around the text. The
|
||||
`bg' argument is the color table index to fill the rectangle with;
|
||||
`fg' is the color table index to draw the text with.<P>
|
||||
|
||||
This function interprets some characters in the legend string
|
||||
specially. A tab (\t) is interpreted as a command to center the
|
||||
following text in the box. A carriage return (\r) is interpreted
|
||||
as a request for a line break.<P>
|
||||
|
||||
<H1>Error Handling (egif_lib.c)</H1>
|
||||
|
||||
<pre><code>
|
||||
void PrintGifError(void)
|
||||
</code></pre>
|
||||
|
||||
Print a one-line diagnostic on the last giflib error to stderr.<P>
|
||||
|
||||
<pre><code>
|
||||
int GifLastError(void)
|
||||
</code></pre>
|
||||
|
||||
Return the number of the last giflib error, and clear the error.
|
||||
The error types are defined in gif_lib.h.<P>
|
||||
|
||||
Note it is the user's responsibility to call the file closing
|
||||
routine, so the file will be closed (if was opened), and allocated
|
||||
memory will be released.<P>
|
||||
|
||||
<H1>Device Specific (XXX2gif.c)</H1>
|
||||
|
||||
<pre><code>
|
||||
int DumpScreen2Gif(char *FileName, int ReqGraphDriver, int ReqGraphMode1,
|
||||
int ReqGraphMode2)
|
||||
</code></pre>
|
||||
|
||||
Dumps the whole device buffer as specified by GraphDriver and
|
||||
GraphMode (as defined in TC 2.0 graphics.h) into FileName as GIF file.
|
||||
Current devices supported:<P>
|
||||
|
||||
<pre>
|
||||
1. Hercules.
|
||||
|
||||
2. EGA, EGA64, EGAMONO (all modes - see TC graphics.h).
|
||||
|
||||
3. VGA (all modes - see TC graphics.h).
|
||||
|
||||
4. SVGA_SPECIAL. This mode is special and not supported by Borland
|
||||
graphics.h. ReqGraphDriver must be equal to 999, and ReqGraphMode
|
||||
is ignored. This modes assumes 800 by 600 in 16 colors.
|
||||
Returns GIF_ERROR if something went wrong, GIF_OK otherwise.
|
||||
|
||||
5. SGI 4D using gl graphic library - window dump.
|
||||
|
||||
6. X11 window dump.
|
||||
</pre>
|
||||
|
||||
|
||||
<H1>Command Line Parsing</H1>
|
||||
|
||||
<pre><code>
|
||||
int GAGetArgs(int argc, char **argv, char *CtrlStr, ...)
|
||||
</code></pre>
|
||||
|
||||
Main routine of this module. Given argc & argv as received by
|
||||
the main procedure, the command line CtrlStr, and the addresses of
|
||||
all parameters, parse the command line, and update the parameters.<P>
|
||||
|
||||
The CtrlStr defines what types of variables should follow. Look at the
|
||||
beginning of getarg.c for exact usage.<P>
|
||||
|
||||
Returns 0 if successful, error number (as defined by getarg.h) otherwise.<P>
|
||||
|
||||
<pre><code>
|
||||
void GAPrintErrMsg(int Error)
|
||||
</code></pre>
|
||||
|
||||
If an error occurred in GAGetARgs, this routine may be used to print
|
||||
one line diagnostic to stderr.<P>
|
||||
|
||||
<pre><code>
|
||||
void GAPrintHowTo(char *CtrlStr)
|
||||
</code></pre>
|
||||
|
||||
Given the same CtrlStr as for GAGetArgs, can be used to print a one line
|
||||
'how to use'. <P>
|
||||
|
||||
<H1>Skeletons of GIF filters</H1>
|
||||
|
||||
If you are developing on a virtual-memory OS such as most flavors of
|
||||
UNIX, or are otherwise sure of having enough memory to keep all of GIFs you
|
||||
need to operate in core, writing a filter is trivial. See the file
|
||||
gifspnge.c in util.<P>
|
||||
|
||||
A sequential filter skeleton will usually look like the example file
|
||||
giffiltr.c in util.<P>
|
||||
|
||||
<P>Please look at the utilities in the util directory for more ideas once
|
||||
you feel comfortable with these skeletons. Also try to follow the coding
|
||||
standards of this package if you want the maintainer to officially add your new
|
||||
utility to it.<P>
|
||||
|
||||
<HR>
|
||||
<ADDRESS>Eric S. Raymond <A HREF="mailto:esr@thyrsus.com"><esr@snark.thyrsus.com></A></ADDRESS>
|
||||
</BODY>
|
||||
</HTML>
|
59
third_party/giflib/doc/gifasm.html
vendored
@ -1,59 +0,0 @@
|
||||
<!doctype HTML public "-//W3O//DTD W3 HTML 2.0//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>gifasm</TITLE>
|
||||
<link rev=made href=mailto:esr@snark.thyrsus.com>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
Go to <a href="index.html">index page</a>.
|
||||
|
||||
<CENTER><H1>gifasm</H1></CENTER>
|
||||
|
||||
A program to assemble multiple GIF files into one, or disassemble a single GIF
|
||||
file with multiple images into single image files.<P>
|
||||
|
||||
<H1>Usage:</H1>
|
||||
|
||||
<pre>
|
||||
gifasm [-q] [-a] [-d OutFileName] [-h] gif-file...
|
||||
</pre>
|
||||
|
||||
If no gif-file is given, GifAsm will try to read a GIF file from stdin, if
|
||||
in disassembly mode only (-d).<P>
|
||||
|
||||
<H1>Memory required:</H1>
|
||||
|
||||
Line.
|
||||
|
||||
<H1>Options:</H1>
|
||||
|
||||
<DL>
|
||||
<DT> [-q]
|
||||
<DD> Quiet mode. Defaults off on MSDOS, on under UNIX. Controls printout
|
||||
of running scan lines. Use -q- to invert.<P>
|
||||
|
||||
<DT> [-a]
|
||||
<DD> Assemble. This is the default, and the GifFile(s) are assembled to
|
||||
stdout. Note the screen descriptor (including screen color map) is taken
|
||||
from the first file, while other screen descriptors are ignored.
|
||||
As this tool requires at least 2 GIF files as input, no attempt will be
|
||||
made to read stdin if none specified on command line.<P>
|
||||
|
||||
<DT> [-d OutFileName]
|
||||
<DD> Disassemble GifFile (if specified on command line) or
|
||||
stdin, into several files of the form OutFileNameXX, where XX are two
|
||||
decimal digits. Obviously up to 100 files can be generated this way.
|
||||
Note: in this mode nothing is sent to stdout.<P>
|
||||
|
||||
<DT> [-h]
|
||||
<DD> Print one line of command line help, similar to Usage above.<P>
|
||||
</DL>
|
||||
|
||||
<H1>Author:</H1>
|
||||
|
||||
Gershon Elber
|
||||
|
||||
<HR>
|
||||
<ADDRESS>Eric S. Raymond <A HREF="mailto:esr@thyrsus.com"><esr@snark.thyrsus.com></A></ADDRESS>
|
||||
</BODY>
|
||||
</HTML>
|
86
third_party/giflib/doc/gifbg.html
vendored
@ -1,86 +0,0 @@
|
||||
<!doctype HTML public "-//W3O//DTD W3 HTML 2.0//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>gifbg</TITLE>
|
||||
<link rev=made href=mailto:esr@snark.thyrsus.com>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
Go to <a href="index.html">index page</a>.
|
||||
|
||||
<CENTER><H1>gifbg</H1></CENTER>
|
||||
|
||||
A program to generate a single-color test pattern GIF with gradually changing
|
||||
intensity in any of the basic 8 directions.<P>
|
||||
|
||||
<H1>Usage:</H1>
|
||||
|
||||
<pre>
|
||||
gifbg [-q] [-d Dir] [-l #Lvls] [-c R G B] [-m MinI] [-M MaxI] [-s W H] [-h]
|
||||
</pre>
|
||||
|
||||
The gifbg program reads no input, and will dump the created GIF file
|
||||
to stdout.<P>
|
||||
|
||||
<H1>Memory required:</H1>
|
||||
|
||||
Line.
|
||||
|
||||
<H1>Options:</H1>
|
||||
|
||||
<DL>
|
||||
<DT> [-q]
|
||||
<DD> Quiet mode. Defaults off on MSDOS, on under UNIX. Controls printout
|
||||
of running scan lines. Use -q- to invert.<P>
|
||||
|
||||
<DT> [-d Dir]
|
||||
<DD> Select direction the intensity of the background should increase.
|
||||
Direction can be one of the 8 principal directions:<P>
|
||||
|
||||
<pre>
|
||||
"T" - for Top "TR" - for Top Right
|
||||
"R" - for Right "BR" - for Bottom Right
|
||||
"B" - for Bottom "BL" - for Bottom Left
|
||||
"L" - for left "TL" - for Top Left
|
||||
</pre>
|
||||
|
||||
The compass directions may be use as synonyms for the above directions, so
|
||||
for example "NE" is equal to "TR".<P>
|
||||
|
||||
Direction is case insensitive. The default direction is Top (North).<P>
|
||||
|
||||
<DT> [-l #Lvls]
|
||||
<DD> Number of levels the color will be scaled to. Default is 16.<P>
|
||||
|
||||
<DT> [-c R G B]
|
||||
<DD> What to use as the primary background color to scale.
|
||||
This color is scaled between the minimum intensity (MinI) and maximum
|
||||
intensity (MaxI) from one end of the screen to the other as defined by Dir.
|
||||
See below (-m & -M) for MinI & MaxI. Default is Blue (0, 0, 255).<P>
|
||||
|
||||
<DT> [-m MinI]
|
||||
<DD> Minimum intensity (in percent) to scale color. Default 10%<P>
|
||||
|
||||
<DT> [-M MaxI]
|
||||
<DD> Maximum intensity (in percent) to scale color. Default 100%<P>
|
||||
|
||||
<DT> [-s W H]
|
||||
<DD> Size of image to create. Default 640 by 350.<P>
|
||||
|
||||
<DT> [-h]
|
||||
<DD> Print one line of command line help, similar to Usage above.<P>
|
||||
</DL>
|
||||
|
||||
<H1>Notes:</H1>
|
||||
|
||||
If MinI == MaxI = 100 (%) and #Lvls == 2 then boolean mask image of specified
|
||||
size will be created - all foreground. This can be used as a square mask for
|
||||
the <a href="gifcomb.html"></a>gifcomb utility.<P>
|
||||
|
||||
<H1>Author:</H1>
|
||||
|
||||
Gershon Elber
|
||||
|
||||
<HR>
|
||||
<ADDRESS>Eric S. Raymond <A HREF="mailto:esr@thyrsus.com"><esr@snark.thyrsus.com></A></ADDRESS>
|
||||
</BODY>
|
||||
</HTML>
|
48
third_party/giflib/doc/gifburst.html
vendored
@ -1,48 +0,0 @@
|
||||
<!doctype HTML public "-//W3O//DTD W3 HTML 2.0//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>gifburst</TITLE>
|
||||
<link rev=made href=mailto:esr@snark.thyrsus.com>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
Go to <a href="index.html">index page</a>.
|
||||
|
||||
<CENTER><H1>gifburst</H1></CENTER>
|
||||
|
||||
The gifburst program takes a named GIF file and breaks it into equal-sized
|
||||
tiles. This is useful if a GIF is too large for your viewer, so you have
|
||||
to look at it in sections.<P>
|
||||
|
||||
<H1>Usage:</H1>
|
||||
|
||||
<pre>
|
||||
gifburst [-s n] [-p b] gif-file
|
||||
</pre>
|
||||
|
||||
<H1>Memory required:</H1>
|
||||
|
||||
Proportional to the size of the largest pasted image.
|
||||
|
||||
<H1>Options:</H1>
|
||||
|
||||
<DT> [-s nnn]
|
||||
<DD> Specify the number of pieces. Valid values are presently 4 (2x2)
|
||||
and 6 (2x3). Default is 4.
|
||||
|
||||
<DT> [-p nnn]
|
||||
<DD> Specify the number of pixels of overlap between interior boundaries
|
||||
of pieces. Default 20.
|
||||
|
||||
<H1>Note:</H1>
|
||||
|
||||
The gifburst program is written on Perl, using the C utilities. You must have
|
||||
both the giflib utilities and Perl installed to run it.<P>
|
||||
|
||||
<H1>Author:</H1>
|
||||
|
||||
Eric S. Raymond <esr@snark.thyrsus.com><P>
|
||||
|
||||
<HR>
|
||||
<ADDRESS>Eric S. Raymond <A HREF="mailto:esr@thyrsus.com"><esr@snark.thyrsus.com></A></ADDRESS>
|
||||
</BODY>
|
||||
</HTML>
|
75
third_party/giflib/doc/gifclip.html
vendored
@ -1,75 +0,0 @@
|
||||
<!doctype HTML public "-//W3O//DTD W3 HTML 2.0//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>gifclip</TITLE>
|
||||
<link rev=made href=mailto:esr@snark.thyrsus.com>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
Go to <a href="index.html">index page</a>.
|
||||
|
||||
<CENTER><H1>gifclip</H1></CENTER>
|
||||
|
||||
A program to clip images in GIF files. Only one image in a GIF file can be
|
||||
modified at a time. Neither the image position on screen nor the screen size
|
||||
is modified (use <a href="gifpos.html">gifpos</a> for that).<P>
|
||||
|
||||
<H1>Usage:</H1>
|
||||
|
||||
<pre>
|
||||
gifclip [-q] [-i Xmin Ymin Xmax Ymax] [-n n Xmin Ymin Xmax Ymax] [-c] [-h] gif-file
|
||||
</pre>
|
||||
|
||||
If no gif-file is given, GifClip will try to read a GIF file from stdin.<P>
|
||||
|
||||
<H1>Memory required:</H1>
|
||||
|
||||
Line.
|
||||
|
||||
<H1>Options:</H1>
|
||||
|
||||
<DL>
|
||||
<DT> [-q]
|
||||
<DD> Quiet mode. Default off on MSDOS, on under UNIX. Controls printout
|
||||
of running scan lines. Use -q- to invert.<P>
|
||||
|
||||
<DT> [-i Xmin Ymin Xmax Ymax]
|
||||
<DD> Clip first image to the dimensions as specified
|
||||
by the 4 coordinates (Xmin Ymin Xmax Ymax) of a box clipping region.<P>
|
||||
|
||||
For example: '-i 11 22 33 44' will crop the box from top left [11,22]
|
||||
to bottom right [33,44] out of the first image.<P>
|
||||
|
||||
If the first parameter is bigger than third one (Xmin > Xmax) they are
|
||||
swapped. Same for Y.<P>
|
||||
|
||||
The dimensions of the clipped image must be confined to original image
|
||||
width and height. Note the clipped image includes both the min & max
|
||||
boundary; an image of width W can have coordinates 0 to W-1 (zero based).<P>
|
||||
|
||||
Only one of -i or -n can be specified.<P>
|
||||
|
||||
<DT> [-n n Xmin Ymin Xmax Ymax]
|
||||
<DD> Same as -i above but for the nth image:
|
||||
`-n 1 11 22 33 44' is exactly the same as the example in -i. Only one of
|
||||
-i or -n can be specified.<P>
|
||||
|
||||
<DT> [-c]
|
||||
<DD> Complement. This removes horizontal and/or vertical bands of the
|
||||
image. For example `-c -i 638 3 658 13' would remove a horizontal band
|
||||
11 pixels deep beginning at raster line 3, and a vertical band 21 pixels
|
||||
right beginning at pixel 658.<P>
|
||||
|
||||
<DT> [-h]
|
||||
<DD> Print one line of command line help, similar to Usage above.<P>
|
||||
</DL>
|
||||
|
||||
Note: all coordinates are 0-based --- the top left corner is (0, 0).<P>
|
||||
|
||||
<H1>Author:</H1>
|
||||
|
||||
Gershon Elber
|
||||
|
||||
<HR>
|
||||
<ADDRESS>Eric S. Raymond <A HREF="mailto:esr@thyrsus.com"><esr@snark.thyrsus.com></A></ADDRESS>
|
||||
</BODY>
|
||||
</HTML>
|
77
third_party/giflib/doc/gifclrmp.html
vendored
@ -1,77 +0,0 @@
|
||||
<!doctype HTML public "-//W3O//DTD W3 HTML 2.0//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>gifclrmp</TITLE>
|
||||
<link rev=made href=mailto:esr@snark.thyrsus.com>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
Go to <a href="index.html">index page</a>.
|
||||
|
||||
<CENTER><H1>gifclrmp</H1></CENTER>
|
||||
|
||||
A program to modify GIF image colormaps. Any local colormap in a GIF file can
|
||||
be modified at a time, or the global screen one.<P>
|
||||
|
||||
<H1>Usage:</H1>
|
||||
|
||||
<pre>
|
||||
gifclrmap [-q] [-s] [-t trans] [-l map] [-g Gamma] [-i image] [-h] gif-file
|
||||
</pre>
|
||||
|
||||
If no gif-file is given, GifClip will try to read a GIF file from stdin.<P>
|
||||
|
||||
<H1>Memory required:</H1>
|
||||
|
||||
Line.
|
||||
|
||||
<H1>Options:</H1>
|
||||
|
||||
<DL>
|
||||
<DT> [-q]
|
||||
<DD> Quiet mode. Defaults off on MSDOS, on under UNIX. Controls printout
|
||||
of running scan lines. Use -q- to invert.<P>
|
||||
|
||||
<DT> [-s]
|
||||
<DD> Select the global screen color map.<P>
|
||||
|
||||
<DT> [-l map]
|
||||
<DD> Load color map from this file instead of selected color map.<P>
|
||||
|
||||
<DT> [-t trans]
|
||||
<DD> Change color index values. The change is made to both
|
||||
the selected color table and the raster bits of the selected image. A
|
||||
translation file is a list of pairs of `before' and `after' index values.
|
||||
At present, the `before' index values must be in ascending order starting
|
||||
from 0.<P>
|
||||
|
||||
<DT> [-g Gamma]
|
||||
<DD> Apply gamma correction to selected color map.<P>
|
||||
|
||||
<DT>[-i image]
|
||||
<DD> Select the color map of the numbered image.<P>
|
||||
|
||||
<DT>[-h]
|
||||
<DD> Print one command line help, similar to Usage above.<P>
|
||||
</DL>
|
||||
|
||||
<H1>Notes:</H1>
|
||||
|
||||
<UL>
|
||||
<LI>
|
||||
The default operation is to dump out the selected color map in text
|
||||
format.<P>
|
||||
|
||||
<LI>
|
||||
The file to load/dump is simply one color map entry per line. Each such
|
||||
entry line has four integers: "ColorIndex Red Green Blue", where color
|
||||
index is in ascending order starting from 1.<P>
|
||||
</UL>
|
||||
|
||||
<H1>Author:</H1>
|
||||
|
||||
Gershon Elber
|
||||
|
||||
<HR>
|
||||
<ADDRESS>Eric S. Raymond <A HREF="mailto:esr@thyrsus.com"><esr@snark.thyrsus.com></A></ADDRESS>
|
||||
</BODY>
|
||||
</HTML>
|
60
third_party/giflib/doc/gifcolor.html
vendored
@ -1,60 +0,0 @@
|
||||
<!doctype HTML public "-//W3O//DTD W3 HTML 2.0//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>gifcolor</TITLE>
|
||||
<link rev=made href=mailto:esr@snark.thyrsus.com>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
Go to <a href="index.html">index page</a>.
|
||||
|
||||
<CENTER><H1>gifcolor</H1></CENTER>
|
||||
|
||||
A program to generate color test patterns. Feed it a color map file (as
|
||||
generated, say, by the -s otion of GifClrMp) and it will generate a GIF
|
||||
containing lines of the form
|
||||
|
||||
<pre>
|
||||
Color %-3d: [%-3d, %-3d, %-3d]:
|
||||
</pre>
|
||||
|
||||
where the first number is the zero-based color index, and the triple is the
|
||||
index's [Red, Green, Blue] value. There will be one such line for each color.
|
||||
Each line will be set in a simple 8x8 font in the color it describes; thus,
|
||||
any lines corresponding to the GIF's background color will be blank.<p>
|
||||
|
||||
<H1>Usage:</H1>
|
||||
|
||||
<pre>
|
||||
gifcolor [-q] [-b Background] [-h] <ColorMapFile
|
||||
</pre>
|
||||
|
||||
As gifcolor can generate huge amounts of data, ^C will kill it, but 'q' will
|
||||
stop only the printing (of one of -e, -z, -p), while file integrity will still
|
||||
be checked.<P>
|
||||
|
||||
<H1>Memory required:</H1>
|
||||
|
||||
Line.
|
||||
|
||||
<H1>Options:</H1>
|
||||
|
||||
<DL>
|
||||
<DT> [-q]
|
||||
<DD> Quiet mode. Defaults off on MSDOS, on under UNIX. Controls printout
|
||||
of running scan lines. Use -q- to invert.<P>
|
||||
|
||||
<DT> [-b]
|
||||
<DD> Set the image's backround color to a given numeric index.<P>
|
||||
|
||||
<DT> [-h]
|
||||
<DD> Print one line of command line help, similar to Usage above.<P>
|
||||
</DL>
|
||||
|
||||
<H1>Author:</H1>
|
||||
|
||||
Gershon Elber
|
||||
|
||||
<HR>
|
||||
<ADDRESS>Eric S. Raymond <A HREF="mailto:esr@thyrsus.com"><esr@snark.thyrsus.com></A></ADDRESS>
|
||||
</BODY>
|
||||
</HTML>
|
57
third_party/giflib/doc/gifcomb.html
vendored
@ -1,57 +0,0 @@
|
||||
<!doctype HTML public "-//W3O//DTD W3 HTML 2.0//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>gifcomb</TITLE>
|
||||
<link rev=made href=mailto:esr@snark.thyrsus.com>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
Go to <a href="index.html">index page</a>.
|
||||
|
||||
<CENTER><H1>gifcomb</H1></CENTER>
|
||||
|
||||
A program to combine 2 GIF images of exactly the same size into one.
|
||||
The color maps are merged, but the result may not exceed 256 colors.
|
||||
A boolean mask GIF file can be used to set which pixel from two images
|
||||
to use at each location. Otherwise any background color from first
|
||||
image is converted to second image color at that point. Only the
|
||||
first image of each file is combined; again, all files' first images
|
||||
must be of exactly the same size.<P>
|
||||
|
||||
<H1>Usage:</H1>
|
||||
|
||||
<pre>
|
||||
gifcomb [-q] [-m MaskGIFFile] [-h] gif-file...
|
||||
</pre>
|
||||
|
||||
Two GIF files must be specified; a third mask GIF file is optional.<P>
|
||||
|
||||
<H1>Memory required:</H1>
|
||||
|
||||
Line.
|
||||
|
||||
<H1>Options:</H1>
|
||||
|
||||
<DL>
|
||||
<DT> [-q]
|
||||
<DD> Quiet mode. Default off on MSDOS, on under UNIX. Controls printout
|
||||
of running scan lines. Use -q- to invert.<P>
|
||||
|
||||
<DT> [-m MaskGIFFile]
|
||||
<DD> the MaskGIFfile can be regular GIF file whose first
|
||||
image has same dimensions as the combined images. Any non-background color
|
||||
in it will select Image 1 Pixel to output, otherwise Image2 pixel will be
|
||||
selected. Usually this image will be boolean (two colors only) but
|
||||
it does not have to be.<P>
|
||||
|
||||
<DT> [-h]
|
||||
<DD> Print one line of command line help, similar to Usage above.<P>
|
||||
</DL>
|
||||
|
||||
<H1>Author:</H1>
|
||||
|
||||
Gershon Elber
|
||||
|
||||
<HR>
|
||||
<ADDRESS>Eric S. Raymond <A HREF="mailto:esr@thyrsus.com"><esr@snark.thyrsus.com></A></ADDRESS>
|
||||
</BODY>
|
||||
</HTML>
|
124
third_party/giflib/doc/gifcompose.html
vendored
@ -1,124 +0,0 @@
|
||||
<!doctype HTML public "-//W3O//DTD W3 HTML 2.0//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>gifcompose</TITLE>
|
||||
<link rev=made href=mailto:esr@snark.thyrsus.com>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
Go to <a href="index.html">index page</a>.
|
||||
|
||||
<CENTER><H1>gifcompose</H1></CENTER>
|
||||
|
||||
The gifcompose program uses the GIFLIB utility tools to support a minilanguage
|
||||
for describing GIF pasteup sequences.<P>
|
||||
|
||||
<H1>Usage:</H1>
|
||||
|
||||
<pre>
|
||||
gifcompose [-v] <specfile
|
||||
</pre>
|
||||
|
||||
<H1>Specification Syntax</H1>
|
||||
|
||||
The gifcompose tool takes a series of text lines and interprets them as
|
||||
commands to do pasteup operations. The commands are:<P>
|
||||
|
||||
<CENTER><H2>Generators</H2></CENTER>
|
||||
|
||||
<DL>
|
||||
<DT><CODE>gif <name></CODE><DD>
|
||||
Paste in <name>.gif<P>
|
||||
|
||||
<DT><CODE>raw <name> <width> <height></CODE><DD>
|
||||
Paste in the given raw-format file (no suffix supplied). Raw format
|
||||
is a stream of 8-bit indices into the EGA color map. Accordingly, the
|
||||
width and height must be specified, and the source must be exactly
|
||||
width times height bytes long.<P>
|
||||
|
||||
<DT><CODE>rgb <name> <width> <height></CODE><DD>
|
||||
Paste in the given RGB-format file (no suffix supplied). Raw format
|
||||
is a stream of 24-bit color values. Accordingly, the width and height
|
||||
must be specified, and the source must be exactly 3 times width times
|
||||
height bytes long.<P>
|
||||
|
||||
<DT><CODE>rle <name></CODE><DD>
|
||||
Paste in the given RLE-format file (no suffix supplied). This converts
|
||||
the Utah Raster Kit format to GIF.<P>
|
||||
|
||||
<DT><CODE>text <text> [foreground <index>] [color <r> <g> <b>]</CODE><DD>
|
||||
Copy 8x8 monospace font, with transparent background and index 1 as
|
||||
foreground. If the text string contains whitespaces, they must be
|
||||
escaped or the string must be quoted (shell conventions).<P>
|
||||
|
||||
The optional suffix `foreground <n>' sets the foreground color index.
|
||||
The optional suffix `color <r> <g> <b>' sets the RGB color to be used
|
||||
for the foreground index.<P>
|
||||
</DL>
|
||||
|
||||
Each generator operation may be followed by any combination of the
|
||||
following suffixes:
|
||||
|
||||
<CENTER><H2>Modifiers</H2></CENTER>
|
||||
|
||||
<DT><CODE>at <x> <y></CODE><DD>
|
||||
Place the image at the given (upper-left-hand-corner) coordinates
|
||||
in the pasted-up result.<P>
|
||||
|
||||
<DT><CODE>clip <name> <top-x> <top-y> <bottom-x> <bottom-y></CODE><DD>
|
||||
Clip image using the given rectange, paste it onto.<P>
|
||||
|
||||
<DT><CODE>xflip</CODE><DD>
|
||||
Flip the image around the X axis before placing it.<P>
|
||||
|
||||
<DT><CODE>yflip</CODE><DD>
|
||||
Flip the image around the Y axis before placing it.<P>
|
||||
|
||||
<DT><CODE>left</CODE><DD>
|
||||
Rotate the image 90 degrees counterclockwise before placing it.<P>
|
||||
|
||||
<DT><CODE>right</CODE><DD>
|
||||
Rotate the image 90 degrees clockwise before placing it.<P>
|
||||
|
||||
<CENTER><H2>Target Operations</H2></CENTER>
|
||||
|
||||
<DT><CODE>screen size <x-size> <y-size></CODE><DD>
|
||||
Set the global screen size of the final image.<P>
|
||||
|
||||
<DT><CODE>screen position <x> <y></CODE><DD>
|
||||
Set the global screen position of the final image.<P>
|
||||
|
||||
<CENTER><H2>Comments</H2></CENTER>
|
||||
|
||||
Comments or comment lines may be preceded with `#' and will be ignored.<P>
|
||||
|
||||
<H1>Memory required:</H1>
|
||||
|
||||
Proportional to the size of the largest pasted image.<P>
|
||||
|
||||
<H1>Options:</H1>
|
||||
|
||||
<DL>
|
||||
<DT> [-v]
|
||||
<DD> Emit a report on each composition action to stderr as it happens.
|
||||
</DL>
|
||||
|
||||
<H1>Bugs:</H1>
|
||||
|
||||
The suffix sequence `left left' sometimes mysteriously fails to work,
|
||||
probably due to some restriction in <a href="gifflip.html">gifflip</a>.<P>
|
||||
|
||||
No support for resizing or odd-angle rotations yet.<P>
|
||||
|
||||
The `color' suffix of text is a no-op, because the present version of
|
||||
<a href="gifovly.html">gifovly</a> throws away color tables.<P>
|
||||
|
||||
Error checking is rudimentary.<P>
|
||||
|
||||
<H1>Author:</H1>
|
||||
|
||||
Eric S. Raymond <esr@snark.thyrsus.com>
|
||||
|
||||
<HR>
|
||||
<ADDRESS>Eric S. Raymond <A HREF="mailto:esr@thyrsus.com"><esr@snark.thyrsus.com></A></ADDRESS>
|
||||
</BODY>
|
||||
</HTML>
|
40
third_party/giflib/doc/giffiltr.html
vendored
@ -1,40 +0,0 @@
|
||||
<!doctype HTML public "-//W3O//DTD W3 HTML 2.0//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>giffiltr</TITLE>
|
||||
<link rev=made href=mailto:esr@snark.thyrsus.com>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
Go to <a href="index.html">index page</a>.
|
||||
|
||||
<CENTER><H1>giffiltr</H1></CENTER>
|
||||
|
||||
This is an expensive way to copy a GIF. The source is included as a skeleton
|
||||
for more sophisticated filters. See the source in the util directory for
|
||||
details.<P>
|
||||
|
||||
I suppose this does have some utility as a test of the sequential GIF record
|
||||
I/O routines. The output should be bytewise identical to the input.<P>
|
||||
|
||||
<H1>Usage:</H1>
|
||||
|
||||
<pre>
|
||||
giffiltr <GifFile >GifCopy
|
||||
</pre>
|
||||
|
||||
<H1>Memory required:</H1>
|
||||
|
||||
Line.
|
||||
|
||||
<H1>Options:</H1>
|
||||
|
||||
None.
|
||||
|
||||
<H1>Author</H1>
|
||||
|
||||
Eric S. Raymond <esr@snark.thyrsus.com><P>
|
||||
|
||||
<HR>
|
||||
<ADDRESS>Eric S. Raymond <A HREF="mailto:esr@thyrsus.com"><esr@snark.thyrsus.com></A></ADDRESS>
|
||||
</BODY>
|
||||
</HTML>
|
47
third_party/giflib/doc/giffix.html
vendored
@ -1,47 +0,0 @@
|
||||
<!doctype HTML public "-//W3O//DTD W3 HTML 2.0//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>giffix</TITLE>
|
||||
<link rev=made href=mailto:esr@snark.thyrsus.com>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
Go to <a href="index.html">index page</a>.
|
||||
|
||||
<CENTER><H1>giffix</H1></CENTER>
|
||||
|
||||
A program that attempts to fix broken GIF images. Currently will "fix"
|
||||
images terminated prematurely by filling the rest of the image with
|
||||
the darkest color found in image.<P>
|
||||
|
||||
<H1>Usage:</H1>
|
||||
|
||||
<pre>
|
||||
giffix [-q] [-h] gif-file
|
||||
</pre>
|
||||
|
||||
If no gif-file is given, GifFix will try to read a GIF file from
|
||||
stdin. The fixed file is dumped to stdout.<P>
|
||||
|
||||
<H1>Memory required:</H1>
|
||||
|
||||
Line.
|
||||
|
||||
<H1>Options:</H1>
|
||||
|
||||
<DL>
|
||||
<DT> [-q]
|
||||
<DD> Quiet mode. Defaults off on MSDOS, on under UNIX. Controls printout
|
||||
of running scan lines. Use -q- to invert.<P>
|
||||
|
||||
<DT> [-h]
|
||||
<DD> Print one line of command line help, similar to Usage above..<P>
|
||||
</DL>
|
||||
|
||||
<H1>Author:</H1>
|
||||
|
||||
Gershon Elber
|
||||
|
||||
<HR>
|
||||
<ADDRESS>Eric S. Raymond <A HREF="mailto:esr@thyrsus.com"><esr@snark.thyrsus.com></A></ADDRESS>
|
||||
</BODY>
|
||||
</HTML>
|
60
third_party/giflib/doc/gifflip.html
vendored
@ -1,60 +0,0 @@
|
||||
<!doctype HTML public "-//W3O//DTD W3 HTML 2.0//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>gifflip</TITLE>
|
||||
<link rev=made href=mailto:esr@snark.thyrsus.com>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
Go to <a href="index.html">index page</a>.
|
||||
|
||||
<CENTER><H1>gifflip</H1></CENTER>
|
||||
|
||||
A program to flip (mirror) GIF file along X or Y axes, or rotate the GIF
|
||||
file 90 degrees to the left or to the right.<P>
|
||||
|
||||
<H1>Usage:</H1>
|
||||
|
||||
<pre>
|
||||
gifflip [-q] [-r] [-l] [-x] [-y] [-h] gif-file
|
||||
</pre>
|
||||
|
||||
If no gif-file is given, GifFlip will try to read a GIF file from stdin.<P>
|
||||
|
||||
<H1>Memory required:</H1>
|
||||
|
||||
Image.
|
||||
|
||||
<H1>Options:</H1>
|
||||
|
||||
<DL>
|
||||
<DT> [-q]
|
||||
<DD> Quiet mode. Default off on MSDOS, on under UNIX. Controls printout
|
||||
of running scan lines. Use -q- to invert.<P>
|
||||
|
||||
<DT> [-r]
|
||||
<DD> Rotate the GIF file to the right.<P>
|
||||
|
||||
<DT> [-l]
|
||||
<DD> Rotate the GIF file to the left.<P>
|
||||
|
||||
<DT> [-x]
|
||||
<DD> Mirror the GIF file along the X axis. Very useful if GIF file was
|
||||
created from another format in with the first line in at image bottom.
|
||||
Effectively exchanges first row with last.<P>
|
||||
|
||||
<DT> [-y]
|
||||
<DD> Mirror the GIF file along Y axis.
|
||||
Effectively exchanges first column with last.<P>
|
||||
|
||||
<DT> [-h]
|
||||
<DD> Print one line of command line help, similar to Usage above.<P>
|
||||
</DL>
|
||||
|
||||
<H1>Author:</H1>
|
||||
|
||||
Gershon Elber
|
||||
|
||||
<HR>
|
||||
<ADDRESS>Eric S. Raymond <A HREF="mailto:esr@thyrsus.com"><esr@snark.thyrsus.com></A></ADDRESS>
|
||||
</BODY>
|
||||
</HTML>
|
72
third_party/giflib/doc/gifhisto.html
vendored
@ -1,72 +0,0 @@
|
||||
<!doctype HTML public "-//W3O//DTD W3 HTML 2.0//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>gifhisto</TITLE>
|
||||
<link rev=made href=mailto:esr@snark.thyrsus.com>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
Go to <a href="index.html">index page</a>.
|
||||
|
||||
<CENTER><H1>gifhisto</H1></CENTER>
|
||||
|
||||
A program to create histogram of number of pixels using each color. The output
|
||||
can be formatted into a GIF histogram file, or as text file - both go to
|
||||
stdout.<P>
|
||||
|
||||
<H1>Usage:</H1>
|
||||
|
||||
<pre>
|
||||
gifhisto [-q] [-t] [-s Width Height] [-n ImageNumber] [-b] [-h] gif-file
|
||||
</pre>
|
||||
|
||||
If no gif-file is given, GifHisto will try to read a GIF file from stdin.<P>
|
||||
|
||||
<H1>Memory required:</H1>
|
||||
|
||||
Line.
|
||||
|
||||
<H1>Options:</H1>
|
||||
|
||||
<DL>
|
||||
<DT> [-q]
|
||||
<DD> Quiet mode. Default off on MSDOS, on under UNIX. Controls printout
|
||||
of running scan lines. Use -q- to invert.<P>
|
||||
|
||||
<DT> [-t]
|
||||
<DD> Force output to be text file of the following form: (colormap size)
|
||||
lines each containing two integers: number of times color appeared, and
|
||||
color index. Lines are in increasing color index order. This output can be
|
||||
fed directly to a sort program if ordering by color frequency
|
||||
is desired.<P>
|
||||
|
||||
The colrmap picked is the one to be used for the image to generate
|
||||
histogram for, as defined in GIF format.<P>
|
||||
|
||||
<DT> [-s Width Height]
|
||||
<DD> Size of GIF histogram file. The Height of the
|
||||
histogram should be power of 2 dividable by number of colors in colormap.<P>
|
||||
|
||||
Width sets the resolution (accuracy if you like) of the histogram as
|
||||
the maximum histogram bar is scaled to fit it.<P>
|
||||
|
||||
<DT> [-n ImageNumber]
|
||||
<DD> Image number to test. Default is one.<P>
|
||||
|
||||
<DT> [-b]
|
||||
<DD> Zeros the background color count. As only linear scale bars are
|
||||
supported and usually the background appears much more often then other
|
||||
colors, deleting the background count will improve the scaling of other
|
||||
colors.
|
||||
|
||||
<DT> [-h]
|
||||
<DD> Print one line of command line help, similar to Usage above.<P>
|
||||
</DL>
|
||||
|
||||
<H1>Author:</H1>
|
||||
|
||||
Gershon Elber
|
||||
|
||||
<HR>
|
||||
<ADDRESS>Eric S. Raymond <A HREF="mailto:esr@thyrsus.com"><esr@snark.thyrsus.com></A></ADDRESS>
|
||||
</BODY>
|
||||
</HTML>
|
51
third_party/giflib/doc/gifinter.html
vendored
@ -1,51 +0,0 @@
|
||||
<!doctype HTML public "-//W3O//DTD W3 HTML 2.0//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>gifinter</TITLE>
|
||||
<link rev=made href=mailto:esr@snark.thyrsus.com>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
Go to <a href="index.html">index page</a>.
|
||||
|
||||
<CENTER><H1>gifinter</H1></CENTER>
|
||||
|
||||
A program to convert between interlaced and non-interlaced GIF images.<P>
|
||||
|
||||
<H1>Usage:</H1>
|
||||
|
||||
<pre>
|
||||
gifinter [-q] [-i] [-s] [-h] gif-file
|
||||
</pre>
|
||||
|
||||
If no gif-file is given, GifInter will try to read a GIF file from stdin.<P>
|
||||
|
||||
|
||||
<H1>Memory required:</H1>
|
||||
|
||||
Image.
|
||||
|
||||
<H1>Options:</H1>
|
||||
|
||||
<DL>
|
||||
<DT> [-q]
|
||||
<DD> Quiet mode. Defaults off on MSDOS, on under UNIX. Controls printout
|
||||
of running scan lines. Use -q- to invert.<P>
|
||||
|
||||
<DT> [-i]
|
||||
<DD> Force all images in GIF file be interlaced.<P>
|
||||
|
||||
<DT> [-s]
|
||||
<DD> Force all images in GIF file be sequential (default).<P>
|
||||
|
||||
<DT> [-h]
|
||||
<DD> Print one line of command line help, similar to Usage above.<P>
|
||||
</DL>
|
||||
|
||||
<H1>Author:</H1>
|
||||
|
||||
Gershon Elber
|
||||
|
||||
<HR>
|
||||
<ADDRESS>Eric S. Raymond <A HREF="mailto:esr@thyrsus.com"><esr@snark.thyrsus.com></A></ADDRESS>
|
||||
</BODY>
|
||||
</HTML>
|
56
third_party/giflib/doc/gifinto.html
vendored
@ -1,56 +0,0 @@
|
||||
<!doctype HTML public "-//W3O//DTD W3 HTML 2.0//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>gifinto</TITLE>
|
||||
<link rev=made href=mailto:esr@snark.thyrsus.com>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
Go to <a href="index.html">index page</a>.
|
||||
|
||||
<CENTER><H1>gifinto</H1></CENTER>
|
||||
|
||||
A program to save stdin into a file with given name, iff the result file has
|
||||
size bigger than specified (see below). This can be used to save result in
|
||||
same files name we started a chain of pipes.<P>
|
||||
|
||||
<H1>Usage:</H1>
|
||||
|
||||
<pre>
|
||||
gifinto [-q] [-s MinFileSize] [-h] gif-file
|
||||
</pre>
|
||||
|
||||
Gifinto always reads a GIF file from stdin.<P>
|
||||
|
||||
<H1>Memory required:</H1>
|
||||
|
||||
Line.
|
||||
|
||||
<H1>Options:</H1>
|
||||
|
||||
<DL>
|
||||
<DT> [-q]
|
||||
<DD> Quiet mode. Default off on MSDOS, on under UNIX. Controls printout
|
||||
of running scan lines. Use -q- to invert.<P>
|
||||
|
||||
<DT> [-s MinFileSize]
|
||||
<DD> If file is less than MinFileSize, it is deleted and
|
||||
not renamed to given name. This will prevent killing the file we
|
||||
started with if the result is an empty file, or the pipeline did not
|
||||
complete.<P>
|
||||
|
||||
The default file threshold size is 14 bytes which is 1 bigger than GIF file
|
||||
stamp (6 bytes) and GIF file screen descriptor (7 bytes), so a GIF file with
|
||||
only GIF stamp and screen descriptor will not be renamed.<P>
|
||||
|
||||
<DT> [-h]
|
||||
<DD> Print one line of command line help, similar to Usage above.<P>
|
||||
</DL>
|
||||
|
||||
<H1>Author:</H1>
|
||||
|
||||
Gershon Elber
|
||||
|
||||
<HR>
|
||||
<ADDRESS>Eric S. Raymond <A HREF="mailto:esr@thyrsus.com"><esr@snark.thyrsus.com></A></ADDRESS>
|
||||
</BODY>
|
||||
</HTML>
|
49
third_party/giflib/doc/gifovly.html
vendored
@ -1,49 +0,0 @@
|
||||
<!doctype HTML public "-//W3O//DTD W3 HTML 2.0//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>gifovly</TITLE>
|
||||
<link rev=made href=mailto:esr@snark.thyrsus.com>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
Go to <a href="index.html">index page</a>.
|
||||
|
||||
<CENTER><H1>gifovly</H1></CENTER>
|
||||
|
||||
This program takes a multi-image GIF file and generates a single GIF
|
||||
consisting of all the images overlayed. Each image's screen position
|
||||
is used. Thus, you can use this together with <a
|
||||
href="gifpos.html">gifpos</a> and <a href="gifasm.html">gifasm</a> to
|
||||
paste together images.<P>
|
||||
|
||||
<H1>Usage:</H1>
|
||||
|
||||
<pre>
|
||||
gifovly [-s TransparentColor] [-h]
|
||||
</pre>
|
||||
|
||||
The GIF to be operated is read in from stdin. The result GIF is written to
|
||||
stdout.<P>
|
||||
|
||||
<H1>Memory required:</H1>
|
||||
|
||||
Proportional to the size of the input file.<P>
|
||||
|
||||
<H1>Options:</H1>
|
||||
|
||||
<DL>
|
||||
<DT> [-t num]
|
||||
<DD> If this index is given, any pixel in images after the first that
|
||||
has this value is not copied.<P>
|
||||
|
||||
<DT> [-h]
|
||||
<DD> Print one line of command line help, similar to Usage above..<P>
|
||||
</DL>
|
||||
|
||||
<H1>Author:</H1>
|
||||
|
||||
Eric S. Raymond <esr@snark.thyrsus.com><P>
|
||||
|
||||
<HR>
|
||||
<ADDRESS>Eric S. Raymond <A HREF="mailto:esr@thyrsus.com"><esr@snark.thyrsus.com></A></ADDRESS>
|
||||
</BODY>
|
||||
</HTML>
|
59
third_party/giflib/doc/gifpos.html
vendored
@ -1,59 +0,0 @@
|
||||
<!doctype HTML public "-//W3O//DTD W3 HTML 2.0//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>gifpos</TITLE>
|
||||
<link rev=made href=mailto:esr@snark.thyrsus.com>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
Go to <a href="index.html">index page</a>.
|
||||
|
||||
<CENTER><H1>gifpos</H1></CENTER>
|
||||
|
||||
A program to change GIF screen size and/or reposition images. No test is made
|
||||
to make sure changes will generate valid GIF files (i.e. images are still
|
||||
confined to screen etc.)<P>
|
||||
|
||||
<H1>Usage:</H1>
|
||||
|
||||
<pre>
|
||||
gifpos [-q] [-s Width Height] [-i Left Top] [-n n Left Top] [-h] gif-file
|
||||
</pre>
|
||||
|
||||
If no gif-file is given, GifPos will try to read a GIF file from stdin.<P>
|
||||
|
||||
<H1>Memory required:</H1>
|
||||
|
||||
Line.
|
||||
|
||||
<H1>Options:</H1>
|
||||
|
||||
<DL>
|
||||
<DT> [-q]
|
||||
<DD> Quiet mode. Default off on MSDOS, on under UNIX. Controls printout
|
||||
of running scan lines. Use -q- to invert.<P>
|
||||
|
||||
<DT> [-s Width Height]
|
||||
<DD> Set the new screen dimensions, so for example
|
||||
`-s 1000 800' will set screen to width of 1000 and height of 800.<P>
|
||||
|
||||
<DT> [-i Left Top]
|
||||
<DD> set image relative to screen position, so for example
|
||||
`-i 100 80' will set image left position to 100 and top position to 80.
|
||||
This sets the position of the first image only.<P>
|
||||
|
||||
<DT> [-n n Left Top]
|
||||
<DD> set image n relative to screen position, so for
|
||||
example '-n 3 100 80' will set the third image position as in 2.<P>
|
||||
|
||||
<DT> [-h]
|
||||
<DD> Print one line of command line help, similar to Usage above.<P>
|
||||
</DL>
|
||||
|
||||
<H1>Author:</H1>
|
||||
|
||||
Gershon Elber
|
||||
|
||||
<HR>
|
||||
<ADDRESS>Eric S. Raymond <A HREF="mailto:esr@thyrsus.com"><esr@snark.thyrsus.com></A></ADDRESS>
|
||||
</BODY>
|
||||
</HTML>
|
62
third_party/giflib/doc/gifrotat.html
vendored
@ -1,62 +0,0 @@
|
||||
<!doctype HTML public "-//W3O//DTD W3 HTML 2.0//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>gifrotat</TITLE>
|
||||
<link rev=made href=mailto:esr@snark.thyrsus.com>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
Go to <a href="index.html">index page</a>.
|
||||
|
||||
<CENTER><H1>gifrotat</H1></CENTER>
|
||||
|
||||
A program to rotate a GIF image by a specified angle.<P>
|
||||
|
||||
<H1>Usage:</H1>
|
||||
|
||||
<pre>
|
||||
gifrotat -a Angle [-q] [-s Width Height] [-h] gif-file
|
||||
</pre>
|
||||
|
||||
If no gif-file is given, GifRotat will try to read a GIF file from stdin.<P>
|
||||
|
||||
|
||||
<H1>Memory required:</H1>
|
||||
|
||||
Screen (of source image).<P>
|
||||
|
||||
<H1>Options:</H1>
|
||||
|
||||
<DL>
|
||||
<DT> -a Angle
|
||||
<DD> Specifies the angle to rotate in degrees with respect to
|
||||
the X (horizontal) axis.<P>
|
||||
|
||||
<DT> [-q]
|
||||
<DD> Quiet mode. Defaults off on MSDOS, on under UNIX. Controls printout
|
||||
of running scan lines. Use -q- to invert.<P>
|
||||
|
||||
<DT> [-s Width Height]
|
||||
<DD> Since the rotated image will have the same image size as
|
||||
the original, some parts of the image will by clipped out and lost. By
|
||||
specifing a (bigger) size explicitly using the `-s' option, these parts
|
||||
may be saved.<P>
|
||||
|
||||
<DT> [-h]
|
||||
<DD> Print one line of command line help, similar to Usage above.<P>
|
||||
</DL>
|
||||
|
||||
<H1>Notes:</H1>
|
||||
|
||||
The image is rotated around its center. No filtering is performed on the
|
||||
output, which have the same color map as the input. This is mainly since
|
||||
filtering would require color quantization which is very memory/time intensive
|
||||
and out of MSDOS memory limits even for small images.<P>
|
||||
|
||||
<H1>Author:</H1>
|
||||
|
||||
Gershon Elber
|
||||
|
||||
<HR>
|
||||
<ADDRESS>Eric S. Raymond <A HREF="mailto:esr@thyrsus.com"><esr@snark.thyrsus.com></A></ADDRESS>
|
||||
</BODY>
|
||||
</HTML>
|
60
third_party/giflib/doc/gifrsize.html
vendored
@ -1,60 +0,0 @@
|
||||
<!doctype HTML public "-//W3O//DTD W3 HTML 2.0//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>gifrsize</TITLE>
|
||||
<link rev=made href=mailto:esr@snark.thyrsus.com>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
Go to <a href="index.html">index page</a>.
|
||||
|
||||
<CENTER><H1>gifrsize</H1></CENTER>
|
||||
|
||||
A program to resize image size by an integer factor, deleting bits when scaling
|
||||
down and duplicating bits when scaling up.<P>
|
||||
|
||||
<H1>Usage:</H1>
|
||||
|
||||
<pre>
|
||||
gifrsize [-q] [-S X Y] [-s Scale] [-x XScale] [-y YScale] [-h] gif-file
|
||||
</pre>
|
||||
|
||||
If no gif-file is given, GifRSize will try to read a GIF file from stdin.<P>
|
||||
|
||||
<H1>Memory required:</H1>
|
||||
|
||||
Line.
|
||||
|
||||
<H1>Options:</H1>
|
||||
|
||||
<DL>
|
||||
<DT> [-q]
|
||||
<DD> Quiet mode. Defaults off on MSDOS, on under UNIX. Controls printout
|
||||
of running scan lines. Use -q- to invert.<P>
|
||||
|
||||
<DT> [-S X Y]
|
||||
<DD> specifies the exact screen dimension of the output GIF.<P>
|
||||
|
||||
<DT> [-s Scale]
|
||||
<DD> Set scaling factor for both x & y direction to Scale.
|
||||
Default is 0.5. Note this is a floating point number.<P>
|
||||
|
||||
<DT> [-x XScale]
|
||||
<DD> Set scaling factor for x direction to Scale. Default is 0.5.
|
||||
Note: this is a floating point number.<P>
|
||||
|
||||
<DT> [-y YScale]
|
||||
<DD> Set scaling factor for y direction to Scale. Default is 0.5.
|
||||
Note: this is a floating point number.<P>
|
||||
|
||||
<DT> [-h]
|
||||
<DD> Print one line of command line help, similar to Usage above.<P>
|
||||
</DL>
|
||||
|
||||
<H1>Author:</H1>
|
||||
|
||||
Gershon Elber
|
||||
|
||||
<HR>
|
||||
<ADDRESS>Eric S. Raymond <A HREF="mailto:esr@thyrsus.com"><esr@snark.thyrsus.com></A></ADDRESS>
|
||||
</BODY>
|
||||
</HTML>
|
40
third_party/giflib/doc/gifspnge.html
vendored
@ -1,40 +0,0 @@
|
||||
<!doctype HTML public "-//W3O//DTD W3 HTML 2.0//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>gifspnge</TITLE>
|
||||
<link rev=made href=mailto:esr@snark.thyrsus.com>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
Go to <a href="index.html">index page</a>.
|
||||
|
||||
<CENTER><H1>gifspnge</H1></CENTER>
|
||||
|
||||
This is an expensive way to copy a GIF. The source is included as a skeleton
|
||||
for more sophisticated filters using DGifSlurp() and EGifSpew(). See the
|
||||
source in the util directory for details.<P>
|
||||
|
||||
I suppose this does have some utility as a test of DGifSlurp() and EGifSpew().
|
||||
The output should be bytewise identical to the input.<P>
|
||||
|
||||
<H1>Usage:</H1>
|
||||
|
||||
<pre>
|
||||
gifspnge <GifFile >GifCopy
|
||||
</pre>
|
||||
|
||||
<H1>Memory required:</H1>
|
||||
|
||||
The size of the input GIF, plus malloc overhead.
|
||||
|
||||
<H1>Options:</H1>
|
||||
|
||||
None.
|
||||
|
||||
<H1>Author:</H1>
|
||||
|
||||
Eric S. Raymond <esr@snark.thyrsus.com><P>
|
||||
|
||||
<HR>
|
||||
<ADDRESS>Eric S. Raymond <A HREF="mailto:esr@thyrsus.com"><esr@snark.thyrsus.com></A></ADDRESS>
|
||||
</BODY>
|
||||
</HTML>
|
71
third_party/giflib/doc/giftext.html
vendored
@ -1,71 +0,0 @@
|
||||
<!doctype HTML public "-//W3O//DTD W3 HTML 2.0//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>giftext</TITLE>
|
||||
<link rev=made href=mailto:esr@snark.thyrsus.com>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
Go to <a href="index.html">index page</a>.
|
||||
|
||||
<CENTER><H1>giftext</H1></CENTER>
|
||||
|
||||
A program to dump (text only) general information about GIF file.<P>
|
||||
|
||||
<H1>Usage:</H1>
|
||||
|
||||
<pre>
|
||||
giftext [-q] [-c] [-e] [-z] [-p] [-r] [-h] gif-file
|
||||
</pre>
|
||||
|
||||
If no gif-file is given, GifText will try to read a GIF file from stdin.<P>
|
||||
|
||||
As giftext can generate huge amounts of data, ^C will kill it, but 'q' will
|
||||
stop only the printing (of one of -e, -z, -p), while file integrity will still
|
||||
be checked.<P>
|
||||
|
||||
<H1>Memory required:</H1>
|
||||
|
||||
Line.
|
||||
|
||||
<H1>Options:</H1>
|
||||
|
||||
<DL>
|
||||
<DT> [-q]
|
||||
<DD> Quiet mode. Defaults off on MSDOS, on under UNIX. Controls printout
|
||||
of running scan lines. Use -q- to invert.<P>
|
||||
|
||||
<DT> [-c]
|
||||
<DD> Dumps the color maps.<P>
|
||||
|
||||
<DT> [-e]
|
||||
<DD> Dumps encoded bytes - the pixels after compressed using LZ
|
||||
algorithm and chained to form bytes. This is the form the data is saved
|
||||
in the GIF file. Dumps in hex - 2 digit per byte.<P>
|
||||
|
||||
<DT> [-z]
|
||||
<DD> Dumps the LZ codes of the image. Dumps in hex - 3 digits per
|
||||
code (as we are limited to 12 bits).<P>
|
||||
|
||||
<DT> [-p]
|
||||
<DD> Dumps the pixels of the image. Dumps in hex - 2 digit per
|
||||
pixel (<=byte).<P>
|
||||
|
||||
<DT> [-r]
|
||||
<DD> Dumps raw pixels as one byte per pixel. This option inhibits all
|
||||
other options and only the pixels are dumped. This option may be used to
|
||||
convert GIF files into raw data. Note: the color map can be extracted by
|
||||
gifclrmp utility. If more than one image is included in the file, all
|
||||
images will be dumped in order.<P>
|
||||
|
||||
<DT> [-h]
|
||||
<DD> Print one line of command line help, similar to Usage above.<P>
|
||||
</DL>
|
||||
|
||||
<H1>Author:</H1>
|
||||
|
||||
Gershon Elber
|
||||
|
||||
<HR>
|
||||
<ADDRESS>Eric S. Raymond <A HREF="mailto:esr@thyrsus.com"><esr@snark.thyrsus.com></A></ADDRESS>
|
||||
</BODY>
|
||||
</HTML>
|
53
third_party/giflib/doc/gifwedge.html
vendored
@ -1,53 +0,0 @@
|
||||
<!doctype HTML public "-//W3O//DTD W3 HTML 2.0//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>gifwedge</TITLE>
|
||||
<link rev=made href=mailto:esr@snark.thyrsus.com>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
Go to <a href="index.html">index page</a>.
|
||||
|
||||
<CENTER><H1>gifwedge</H1></CENTER>
|
||||
|
||||
A program to create a test GIF image with intensity levels of the RGB colors
|
||||
YCM colors and white.<P>
|
||||
|
||||
<H1>Usage:</H1>
|
||||
|
||||
<pre>
|
||||
gifwedge [-q] [-l #Lvls] [-s SizeX SizeY] [-h]
|
||||
</pre>
|
||||
|
||||
<H1>Memory required:</H1>
|
||||
|
||||
Line.
|
||||
|
||||
<H1>Options:</H1>
|
||||
|
||||
<DL>
|
||||
<DT> [-q]
|
||||
<DD> Quiet mode. Defaults off on MSDOS, on under UNIX. Controls printout
|
||||
of running scan lines. Use -q- to invert.<P>
|
||||
|
||||
<DT> [-l #Lvls]
|
||||
<DD> Set number of intensity levels per color. This number must be
|
||||
power of two up to 32, as Gif format can only have 256 color simultanuously
|
||||
and 7 basic colors are to be displayed.<P>
|
||||
|
||||
<DT> [-s SizeX SizeY]
|
||||
<DD> Force image size to be SizeX by SizeY pixels.
|
||||
Image size will be rounded down to be a multiple of number of intensities
|
||||
horizontally, and 7 (colors) vertically.<P>
|
||||
|
||||
<DT> [-h]
|
||||
<DD> Print one line command line help, similar to Usage above.<P>
|
||||
</DL>
|
||||
|
||||
<H1>Author:</H1>
|
||||
|
||||
Gershon Elber
|
||||
|
||||
<HR>
|
||||
<ADDRESS>Eric S. Raymond <A HREF="mailto:esr@thyrsus.com"><esr@snark.thyrsus.com></A></ADDRESS>
|
||||
</BODY>
|
||||
</HTML>
|
142
third_party/giflib/doc/icon2gif.html
vendored
@ -1,142 +0,0 @@
|
||||
<!doctype HTML public "-//W3O//DTD W3 HTML 2.0//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>icon2gif</TITLE>
|
||||
<link rev=made href=mailto:esr@snark.thyrsus.com>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
Go to <a href="index.html">index page</a>.
|
||||
|
||||
<CENTER><H1>icon2gif</H1></CENTER>
|
||||
|
||||
A program to convert a series of editable text GIF icon specifications and
|
||||
named GIF files into a multi-image GIF, usable as a graphic resource file.
|
||||
It can also dump existing GIFs in this format.<P>
|
||||
|
||||
<H1>Usage:</H1>
|
||||
|
||||
<pre>
|
||||
icon2gif [-q] [-a] [-d] [t TranslationTable] [-h] gif-file...
|
||||
</pre>
|
||||
|
||||
If no gif-file is given, icon2gif will try to read a text input from stdin.<P>
|
||||
|
||||
<H1>Specification Syntax</H1>
|
||||
|
||||
Here is a syntax summary in informal BNF. The token `NL' represents a
|
||||
required newline.<P>
|
||||
|
||||
<pre>
|
||||
<gif-spec> ::= <header-block> <image-block>...
|
||||
|
||||
<header-block> ::= <header-declaration>...
|
||||
|
||||
<header-declaration ::=
|
||||
| screen width <digits> NL
|
||||
| screen height <digits> NL
|
||||
| screen colors <digits> NL
|
||||
| screen background <digits> NL
|
||||
| screen map <color-table> NL
|
||||
|
||||
<color-table> ::= <color-declaration>... end NL
|
||||
|
||||
<color-declaration> ::= rgb <digits> <digits> <digits> is <key> NL
|
||||
|
||||
<image-block> ::= include <file-name> NL
|
||||
| image NL
|
||||
<image-declaration>...
|
||||
<raster-picture>
|
||||
[ <extension> ]
|
||||
|
||||
<image-declarations> ::= image top <digits> NL
|
||||
| image left <digits> NL
|
||||
| image interlaced NL
|
||||
| image map <color-table> NL
|
||||
| image bits <digits> by <digits> NL <raster-block>
|
||||
|
||||
<extension> := <comment> NL <extension-block> NL end NL
|
||||
| <plaintext> NL <extension-block> NL end NL
|
||||
| extension <hex-digits> NL <extension-block> NL end NL
|
||||
</pre>
|
||||
|
||||
If the semantics of the `screen height', `screen width', `screen background',
|
||||
`image top', `image left' declarations aren't obvious to you, what are you
|
||||
doing with this software?<P>
|
||||
|
||||
A color table declares color indices (in ascending order from 0) and
|
||||
assiciates them with key characters. These characters can later be used in
|
||||
raster blocks. As these must be printable and non-whitespace, you can only
|
||||
specify 94 colors per icon. Life is like that sometimes.<P>
|
||||
|
||||
A raster block is just a block of key characters. It should be sized correctly
|
||||
for the `image bits' declaration that leads it.<P>
|
||||
|
||||
The `comment' or `plaintext' keywords lead defined GIF89 extension
|
||||
record data (the other two GIF89 types, graphics control and application
|
||||
block, are not yet supported). You can also say `extension' followed
|
||||
by a hexadecimal record type. All of these extension declarations
|
||||
must be followed by an extension block, which is terminated by the
|
||||
keyword `end' on its own line.<P>
|
||||
|
||||
An extension block is a series of text lines, each interpreted as a string of
|
||||
bytes to fill an argument block (the terminating newline is stripped). Text
|
||||
may include standard C-style octal and hex escapes preceded by a backslash.<P>
|
||||
|
||||
All <digits> tokens are interpreted as decimal numerals; <hex-digits>
|
||||
tokens are interpreted as two hex digits (a byte). All coordinates are
|
||||
zero-origin with the top left corner (0,0). Range checking is weak and
|
||||
signedness checking nonexistent; caveat hacker!<P>
|
||||
|
||||
In general, the amount of whitespace and order of declarations within a
|
||||
header or image block is not significant, except that a raster picture
|
||||
must immediately follow its `image bits' bits declaration.<P>
|
||||
|
||||
The `include' declaration includes a named GIF as the next image. The global
|
||||
color maps of included GIFs are merged with the base table defined by any
|
||||
`screen color' declaration. All images of an included multi-image GIF will
|
||||
be included in order.<P>
|
||||
|
||||
Comments may be preceded with `#' and will be ignored.<P>
|
||||
|
||||
<H1>Memory required:</H1>
|
||||
|
||||
For the compilation mode, proportional to the size of the input file. For
|
||||
dumping, proportional to the line size of the widest GIF.<P>
|
||||
|
||||
<H1>Options:</H1>
|
||||
|
||||
<DL>
|
||||
<DT> [-q]
|
||||
<DD> Quiet mode. Defaults off on MSDOS, on under UNIX. Controls printout
|
||||
of running scan lines. Use -q- to invert.<P>
|
||||
|
||||
<DT> [-d]
|
||||
<DD> Dump the input GIF file(s) into the text form described above.<P>
|
||||
|
||||
<DT> [-t]
|
||||
<DD> Specify name characters to use when dumping raster blocks. Only
|
||||
valid with -d option.<P>
|
||||
|
||||
<DT> [-h]
|
||||
<DD> Print one line of command line help, similar to Usage above.<P>
|
||||
</DL>
|
||||
|
||||
<H1>Bugs:</H1>
|
||||
|
||||
Because there are only 94 characters unambiguously usable for raster blocks,
|
||||
an attempt to dump a GIF with a larger color map will fail.<P>
|
||||
|
||||
Error checking is rudimentary.<P>
|
||||
|
||||
<H1>Example:</H1>
|
||||
|
||||
A sample icon file called `sample.ico' is included in the pic directory.<P>
|
||||
|
||||
<H1>Author:</H1>
|
||||
|
||||
Eric S. Raymond <esr@snark.thyrsus.com>
|
||||
|
||||
<HR>
|
||||
<ADDRESS>Eric S. Raymond <A HREF="mailto:esr@thyrsus.com"><esr@snark.thyrsus.com></A></ADDRESS>
|
||||
</BODY>
|
||||
</HTML>
|
215
third_party/giflib/doc/index.html
vendored
@ -1,215 +0,0 @@
|
||||
<!doctype HTML public "-//W3O//DTD W3 HTML 2.0//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>Introduction to GIFLIB</TITLE>
|
||||
<link rev=made href=mailto:esr@snark.thyrsus.com>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<CENTER><H1>Introduction to GIFLIB</H1></CENTER>
|
||||
|
||||
GIFLIB is a package of portable tools and library routines for working
|
||||
with GIF images. You can find the latest version at the GIFLIB home
|
||||
page <a
|
||||
href="http://www.ccil.org/~esr/giflib">http://www.ccil.org/~esr/giflib</a>.<P>
|
||||
|
||||
The Graphics Interchange Format(c) specification is the copyrighted
|
||||
property of CompuServe Incorporated. GIF(sm) is a service mark
|
||||
property of CompuServe Incorporated. As this package existed before
|
||||
UniSys's lawyeritis attack of New Years' Day 1995, it is grandfathered
|
||||
in under their license terms and you do <em>not</em> have to pay fees
|
||||
for using it.<P>
|
||||
|
||||
This package has been released under an X Consortium-life freeware
|
||||
license. Use and copy as you see fit. If you make useful changes,
|
||||
add new tools, or find and fix bugs, please send your mods to the
|
||||
maintainers for general distribution.</P>
|
||||
|
||||
The util directory includes programs to clip, rotate, scale, and
|
||||
position GIF images. It includes an X11 viewer, code to dump GIFs to
|
||||
an Epson-compatible printer in graphics mode, and many conversion
|
||||
utilities. These are no replacement for an interactive graphics
|
||||
editor, but they can be very useful for scripted image generation or
|
||||
transformation.<P>
|
||||
|
||||
The library includes program-callable entry points for reading and writing
|
||||
GIF files, an 8x8 utility font for embedding text in GIFs, and an error
|
||||
handler. GIF manipulation can be done at a relatively low level by
|
||||
sequential I/O (which automatically does/undoes image compression) or at
|
||||
a higher level by slurping an entire GIF into allocated core.<P>
|
||||
|
||||
This library speaks both GIF87a and GIF89. The differences between
|
||||
GIF87 and GIF89 are minor: in the latter, the interpretation of some
|
||||
extension block types is defined. The library never needs to actually
|
||||
interpret these, but <a href="giftext.html">giftext</a> notices them.<P>
|
||||
|
||||
<H1>Utilities</H1>
|
||||
|
||||
Here is a summary of the utilities in this package. If you're looking
|
||||
at this page through a web browser, each utility name should be a
|
||||
hotlink to HTML documentation.<P>
|
||||
|
||||
<H2>Conversion Utilities</H2>
|
||||
|
||||
<DL>
|
||||
<DT><a href="gif2bgi.html">gif2bgi</a>
|
||||
<DD>display GIFs on IBM PC displays using the BGI (Borland) driver
|
||||
<DT><a href="gif2epsn.html">gif2epsn</a>
|
||||
<DD>dump images saved as GIF files on Epson type printers
|
||||
<DT><a href="gif2herc.html">gif2herc</a>
|
||||
<DD>display GIFs on IBM PC displays using the Hercules graphic card
|
||||
<DT><a href="gif2iris.html">gif2iris</a>
|
||||
<DD>display GIFs under SGI NeWs window system
|
||||
<DT><a href="gif2ps.html">gif2ps</a>
|
||||
<DD>print GIF file on laser printers supporting PostScript
|
||||
<DT><a href="gif2rgb.html">gif2rgb</a>
|
||||
<DD>convert images saved as GIF to 24-bit RGB image(s)
|
||||
<DT><a href="gif2rle.html">gif2rle</a>
|
||||
<DD>convert images saved as GIF to RLE (Utah raster toolkit) format
|
||||
<DT><a href="gif2x11.html">gif2x11</a>
|
||||
<DD>display images saved as GIF files under X window system
|
||||
<DT><a href="raw2gif.html">raw2gif</a>
|
||||
<DD>convert raw 8-bit image data into GIF files
|
||||
<DT><a href="rgb2gif.html">rgb2gif</a>
|
||||
<DD>convert 24 bit images to a GIF image using color quantization
|
||||
<DT><a href="rle2gif.html">rle2gif</a>
|
||||
<DD>convert images saved as RLE (Utah raster toolkit) to GIF format
|
||||
</DL>
|
||||
|
||||
<H2>Test Pattern Generators</H2>
|
||||
|
||||
<DL>
|
||||
<DT><a href="gifbg.html">gifbg</a>
|
||||
<DD>generate a single-color test pattern GIF
|
||||
<DT><a href="gifcolor.html">gifcolor</a>
|
||||
<DD>generate color test patterns
|
||||
<DT><a href="gifwedge.html">gifwedge</a>
|
||||
<DD>create a test GIF image resembling a color monitor test pattern
|
||||
</DL>
|
||||
|
||||
<H2>Image Manipulation Components</H2>
|
||||
|
||||
<DL>
|
||||
<DT><a href="gifasm.html">gifasm</a>
|
||||
<DD>assemble multiple GIFs into one, or burst a multiple-mage GIF
|
||||
<DT><a href="gifclip.html">gifclip</a>
|
||||
<DD>clip or crop a GIF image
|
||||
<DT><a href="gifclrmp.html">gifclrmp</a>
|
||||
<DD>modify GIF image colormaps
|
||||
<DT><a href="gifcomb.html">gifcomb</a>
|
||||
<DD>combine 2 GIF images of exactly the same size into one
|
||||
<DT><a href="giffix.html">giffix</a>
|
||||
<DD>clumsily attempts to fix truncated GIF images
|
||||
<DT><a href="gifflip.html">gifflip</a>
|
||||
<DD>flip GIF image along X or Y axis or rotate by 90 degrees
|
||||
<DT><a href="gifinter.html">gifinter</a>
|
||||
<DD>convert between interlaced and non interlaced images
|
||||
<DT><a href="gifovly.html">gifovly</a>
|
||||
<DD>generate one composite GIF from a multiple-image GIF
|
||||
<DT><a href="gifpos.html">gifpos</a>
|
||||
<DD>change a GIF's screen size or recondition it.
|
||||
<DT><a href="gifrotat.html">gifrotat</a>
|
||||
<DD>rotate a GIF through any desired angle
|
||||
<DT><a href="gifrsize.html">gifrsize</a>
|
||||
<DD>resize a GIF by deletion or duplication of bits
|
||||
<DT><a href="gifburst.html">gifburst</a>
|
||||
<DD>burst a GIF image into subrectangles.
|
||||
</DL>
|
||||
|
||||
<H2>Report Generators</H2>
|
||||
|
||||
<DL>
|
||||
<DT><a href="giftext.html">giftext</a>
|
||||
<DD>print (text only) general information about a GIF
|
||||
<DT><a href="gifhisto.html">gifhisto</a>
|
||||
<DD>generate color-frequency histogram from a GIF
|
||||
</DL>
|
||||
|
||||
<H2>GIF Composition Tools</H2>
|
||||
|
||||
<DL>
|
||||
<DT><a href="icon2gif.html">icon2gif</a>
|
||||
<DD>converter/deconverter to/from an editable text format
|
||||
<DT><a href="text2gif.html">text2gif</a>
|
||||
<DD>generate GIF images out of regular text in 8x8 font
|
||||
<DT><a href="gifinto.html">gifinto</a>
|
||||
<DD>end-of-pipe fitting for GIF-processing pipelines
|
||||
<DT><a href="gifcompose.html">gifcompose</a>
|
||||
<DD>use giflib tools to compose images
|
||||
</DL>
|
||||
|
||||
<H2>C Code Templates</H2>
|
||||
|
||||
<DL>
|
||||
<DT><a href="giffiltr.html">giffiltr</a>
|
||||
<DD>template code for filtering a GIF sequentially
|
||||
<DT><a href="gifspnge.html">gifspnge</a>
|
||||
<DD>template code for filtering a GIF with in-core operations
|
||||
</DL>
|
||||
|
||||
Under MS-DOS, most filters will print the current input scan line number
|
||||
(counting up) whenever they read image input, and will print output image line
|
||||
number (counting down) when they dump output. Utilities that only read or
|
||||
write always print in increasing order. Utilities (like GifPos that only
|
||||
change positions) that copy the image as a block of compressed data will print
|
||||
nothing --- they cannot identify a scan line number, and are enough faster that
|
||||
the feedback to the user doesn't seem necessary.<P>
|
||||
|
||||
Some of the utilities require memory on the order of the whole screen, while
|
||||
others read one scan line at a time. Each utility HTML file has entry called
|
||||
<em>Memory Usage</em> which will be one of:<P>
|
||||
|
||||
<DL>
|
||||
<DT> Line <DD> memory required is on the order of one scan line
|
||||
<DT> Image <DD> proportional to the size of the biggest image in GIF file
|
||||
<DT> Screen <DD> proportional to GIF screen size
|
||||
</DL>
|
||||
|
||||
In all cases a byte is allocated per pixel, so an image of 320 by 200 pixels
|
||||
will requires approximately 64k bytes of main memory.<P>
|
||||
|
||||
<H1>Library Functions</H1>
|
||||
|
||||
The library contains two groups of C functions. One group does sequential
|
||||
I/O on the stream-oriented GIF format. The other supports grabbing an
|
||||
entire GIF into allocated core, operating on it in core, and then writing
|
||||
the modified in-core GIF out to disk.<P>
|
||||
|
||||
Unless you are on a 286 or some other very memory-limited machine
|
||||
running under DOS, you probably want to use the second group.<P>
|
||||
|
||||
Detailed documentation on the library entry points is in <a
|
||||
href="gif_lib.html">gif_lib.html</a>. Library error codes are
|
||||
described in <a href="liberror.html">liberror.html</a><P>
|
||||
|
||||
<H1>The GIF Standard</H1>
|
||||
|
||||
The doc subdurector includes flat-ASCII descriptions of <a
|
||||
href="gif89.txt">GIF89 format</a> and <a href="lzgif.txt">Lempel-Ziv
|
||||
Compression</a>.<P>
|
||||
|
||||
<H1>History</H1>
|
||||
|
||||
This package was originally written by Gershon Elber <gershon@cs.utah.edu>
|
||||
in 1990 on an IBM PC under MS-DOS using Borland Turbo C. He made it portable
|
||||
to several UNIX environments.<P>
|
||||
|
||||
The 2.1 version featured substantial changes and additions by Eric
|
||||
S. Raymond <esr@snark.thyrsus.com>. These included the
|
||||
DGifSlurp/EGifSpew function pair for enabling non-sequential
|
||||
operations on GIF images and the tools icon2gif, gifovly, gifburst, and
|
||||
gifcompose.<P>
|
||||
|
||||
The 2.4 version converted all the docs from an idiosyncratic
|
||||
plain-text formal to to HTML.<P>
|
||||
|
||||
<H1>Package Status</H1>
|
||||
|
||||
GIFLIB's current maintainer is Eric S. Raymond. You can find his home
|
||||
page at <a href="http://www.ccil.org/esr">http://www.ccil.org/esr</a>.<P>
|
||||
|
||||
GIFLIB is not under active development, but bug fixes are being accepted.<P>
|
||||
|
||||
<HR>
|
||||
<ADDRESS>Eric S. Raymond <A HREF="mailto:esr@thyrsus.com"><esr@snark.thyrsus.com></A></ADDRESS>
|
||||
</BODY>
|
||||
</HTML>
|
140
third_party/giflib/doc/liberror.html
vendored
@ -1,140 +0,0 @@
|
||||
<!doctype HTML public "-//W3O//DTD W3 HTML 2.0//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>GIFLIB error codes</TITLE>
|
||||
<link rev=made href=mailto:esr@snark.thyrsus.com>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
Go to <a href="index.html">index page</a>.
|
||||
|
||||
<CENTER><H1>GIFLIB error codes</H1></CENTER>
|
||||
|
||||
Errors as reported from the GIF_LIB library are divided to two major
|
||||
categoriess: the encoder (errors prefixed by E_GIF_ERR), and the
|
||||
decoder (errors prefixed by D_GIF_ERR). This document explains them
|
||||
briefly:<P>
|
||||
|
||||
<H1>Encoding errors:</H1>
|
||||
|
||||
<DL>
|
||||
<DT><CODE>E_GIF_ERR_OpenFailed</CODE><DD>
|
||||
Message printed using PrintGifError: "Failed to open given file"
|
||||
IO error result when attempt to open the given GIF file.<P>
|
||||
|
||||
<DT><CODE>E_GIF_ERR_WriteFailed</CODE><DD>
|
||||
Message printed using PrintGifError: "Failed to Write to given file"
|
||||
IO error result when attempt to write to the given GIF file.<P>
|
||||
|
||||
<DT><CODE>E_GIF_ERR_HasScrnDscr</CODE><DD>
|
||||
Message printed using PrintGifError: "Screen Descriptor already been set"
|
||||
Attempt to write second screen descriptor to same GIF file. GIF file should
|
||||
have exactly one screen descriptor which should be set directly after the
|
||||
file is opened.<P>
|
||||
|
||||
<DT><CODE>E_GIF_ERR_HasImagDscr</CODE><DD>
|
||||
Message printed using PrintGifError: "Image Descriptor is still active"
|
||||
Image descriptor should be sent before and image dump, and no second
|
||||
image descriptor should be sent before current image dump ended. This error
|
||||
occurred probably because current image was not complete.<P>
|
||||
|
||||
<DT><CODE>E_GIF_ERR_NoColorMap</CODE><DD>
|
||||
Message printed using PrintGifError: "Neither Global Nor Local color map"
|
||||
An image must have either global (screen) or local (image) color map.
|
||||
Neither were given in this case.<P>
|
||||
|
||||
<DT><CODE>E_GIF_ERR_DataTooBig</CODE><DD>
|
||||
Message printed using PrintGifError: "#Pixels bigger than Width * Height"
|
||||
The number of pixels dumped for this image is bigger than specified by
|
||||
image Height times image Width.<P>
|
||||
|
||||
<DT><CODE>E_GIF_ERR_NotEnoughMem</CODE><DD>
|
||||
Message printed using PrintGifError: "Fail to allocate required memory"
|
||||
Once an attemp is made to open GIF file, special structures are allocated
|
||||
to hold internal data for it. If allocation fails this error is returned.<P>
|
||||
|
||||
<DT><CODE>E_GIF_ERR_DiskIsFull</CODE><DD>
|
||||
Message printed using PrintGifError: "Write failed (disk full?)"
|
||||
Writing encoded data failed.<P>
|
||||
|
||||
<DT><CODE>E_GIF_ERR_CloseFailed</CODE><DD>
|
||||
Message printed using PrintGifError: "Failed to close given file"
|
||||
Closing file failed.<P>
|
||||
|
||||
<DT><CODE> E_GIF_ERR_NotWriteable</CODE><DD>
|
||||
Message printed using PrintGifError: "Given file was not opened for write"
|
||||
GIF files can be opened both for read (DGIF part of library) and write
|
||||
(EGIF part of library). This error occurs when a file is opened for read
|
||||
(using DGIF) is given to one of the encoding (EGIF) routines.<P>
|
||||
</DL>
|
||||
|
||||
<H1>Encoding errors:</H1>
|
||||
|
||||
<DL>
|
||||
<DT><CODE>D_GIF_ERR_OpenFailed</CODE><DD>
|
||||
Message printed using PrintGifError: "Failed to open given file"
|
||||
IO error result when attempt to open the given GIF file.<P>
|
||||
|
||||
<DT><CODE>D_GIF_ERR_ReadFailed</CODE><DD>
|
||||
Message printed using PrintGifError: "Failed to Read from given file"
|
||||
IO error result when attempt to write to the given GIF file.<P>
|
||||
|
||||
<DT><CODE>D_GIF_ERR_Notgif-file$</CODE><DD>
|
||||
Message printed using PrintGifError: "Given file is NOT GIF file"
|
||||
GIF files should have special stamp identifies them as such, If that stamp
|
||||
is not found, this error is issued.<P>
|
||||
|
||||
<DT><CODE>D_GIF_ERR_NoScrnDscr</CODE><DD>
|
||||
Message printed using PrintGifError: "No Screen Descriptor detected"
|
||||
Each GIF file should have screen descriptor in its header. This error will
|
||||
be generated if no such descriptor was found.<P>
|
||||
|
||||
<DT><CODE>D_GIF_ERR_NoImagDscr</CODE><DD>
|
||||
Message printed using PrintGifError: "No Image Descriptor detected"
|
||||
Each image should have image descriptor in its header. This error will
|
||||
be generated if no such descriptor was found.<P>
|
||||
|
||||
<DT><CODE>D_GIF_ERR_NoColorMap</CODE><DD>
|
||||
Message printed using PrintGifError: "Neither Global Nor Local color map"
|
||||
An image must have either global (screen) or local (image) color map.
|
||||
Neither were given in this case.<P>
|
||||
|
||||
<DT><CODE>D_GIF_ERR_WrongRecord</CODE><DD>
|
||||
Message printed using PrintGifError: "Wrong record type detected"
|
||||
Each record in GIF file has special identifier, in its header. If the
|
||||
record has wrong identifier, this error is generated.<P>
|
||||
|
||||
<DT><CODE>D_GIF_ERR_DataTooBig</CODE><DD>
|
||||
Message printed using PrintGifError: "#Pixels bigger than Width * Height"
|
||||
The number of pixels dumped for this image is bigger than specified by
|
||||
image Height times image Width.<P>
|
||||
|
||||
<DT><CODE>D_GIF_ERR_NotEnoughMem</CODE><DD>
|
||||
Message printed using PrintGifError: "Fail to allocate required memory"
|
||||
Once an attemp is made to open GIF file, special structures are allocated
|
||||
to hold internal data for it. If allocation fails this error is returned.<P>
|
||||
|
||||
<DT><CODE>D_GIF_ERR_CloseFailed</CODE><DD>
|
||||
Message printed using PrintGifError: "Failed to close given file"
|
||||
Closing file failed.<P>
|
||||
|
||||
<DT><CODE>D_GIF_ERR_NotReadable</CODE><DD>
|
||||
Message printed using PrintGifError: "Given file was not opened for read"
|
||||
GIF files can be opened both for read (DGIF part of library) and write
|
||||
(EGIF part of library). This error occurs when a file is opened for write
|
||||
(using EGIF) is given to one of the decoding (DGIF) routines.<P>
|
||||
|
||||
<DT><CODE>D_GIF_ERR_ImageDefect</CODE><DD>
|
||||
Message printed using PrintGifError: "Image is defective, decoding aborted"
|
||||
This error is generated, once the decoding failed - probably image is
|
||||
defect.<P>
|
||||
|
||||
<DT><CODE>D_GIF_ERR_EOFTooSoon</CODE><DD>
|
||||
Message printed using PrintGifError: "Image EOF detected, before image complete"
|
||||
This error is generated once EOF code is detected in encoded image before
|
||||
all the pixels (Width * Height) has be decoded.<P>
|
||||
</DL>
|
||||
|
||||
<HR>
|
||||
<ADDRESS>Eric S. Raymond <A HREF="mailto:esr@thyrsus.com"><esr@snark.thyrsus.com></A></ADDRESS>
|
||||
</BODY>
|
||||
</HTML>
|
123
third_party/giflib/doc/lzgif.txt
vendored
@ -1,123 +0,0 @@
|
||||
LZW compression used to encode/decode a GIF file by Bob Montgomery [73357,3140]
|
||||
|
||||
ENCODER
|
||||
Consider the following input data stream in a 4 color (A, B, C, D) system.
|
||||
We will build a table of codes which represent strings of colors. Each time
|
||||
we find a new string, we will give it the next code, and break it into a
|
||||
prefix string and a suffix color. The symbols \ or --- represent the prefix
|
||||
string, and / represents the suffix color. The first 4 entries in the table
|
||||
are the 4 colors with codes 0 thru 3, each of which represents a single
|
||||
color. The next 2 codes (4 and 5) are the clear code and the end of image
|
||||
code. The first available code to represent a string of colors is 6. Each
|
||||
time we find a new code, we will send the prefix for that code to the
|
||||
output data stream.
|
||||
|
||||
A B A B A B A B B B A B A B A A C D A C D A D C A B A A A B A B .....
|
||||
\/\/---/-----/\/---/-------/\/ \/ \ /\/---/---/\ /\/-----/---/---/
|
||||
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 Code
|
||||
6 8 10 8 14 16 8 13 7 Prefix
|
||||
|
||||
The encoder table is built from input data stream. Always start with the
|
||||
suffix of last code, and keep getting colors until you have a new
|
||||
combination.
|
||||
|
||||
Color Code Prefix Suffix String Output
|
||||
A 0 -
|
||||
B 1 -
|
||||
C 2 -
|
||||
D 3 -
|
||||
Clear 4 -
|
||||
End 5 -
|
||||
A \ A A First color is a special case.
|
||||
B / \ 6 A B AB A
|
||||
A | / 7 B A BA B
|
||||
B |
|
||||
A / | 8 6 A ABA 6
|
||||
B |
|
||||
A |
|
||||
B \ / 9 8 B ABAB 8
|
||||
B / | 10 B B BB B
|
||||
B |
|
||||
A | / 11 10 A BBA 10
|
||||
B |
|
||||
A |
|
||||
B |
|
||||
A / \ 12 9 A ABABA 9
|
||||
A \ / 13 A A AA A
|
||||
C / \ 14 A C AC A
|
||||
D \ / 15 C D CD C
|
||||
A / | 16 D A DA D
|
||||
C |
|
||||
D | / 17 14 D ACD 14
|
||||
A |
|
||||
D / \ 18 16 D DAD 16
|
||||
C \ / 19 D C DC D
|
||||
A / | 20 C A CA C
|
||||
B |
|
||||
A |
|
||||
A | / 21 8 A ABAA 8
|
||||
A |
|
||||
B / | 22 13 B AAB 13
|
||||
A |
|
||||
B / 23 7 B BAB 7
|
||||
|
||||
The resultant output stream is: A B 6 8 B 10 9 A A C D 14 16 D C 8 ....
|
||||
The GIF encoder starts with a code length of 2+1=3 bits for 4 colors, so
|
||||
when the code reaches 8 we will have to increase the code size to 4 bits.
|
||||
Similarly, when the code gets to 16 we will have to increse the code size
|
||||
to 5 bits, etc. If the code gets to 13 bits, we send a clear code and start
|
||||
over. See GIFENCOD.GIF for a flow diagram of the encoding process. This
|
||||
uses a tree method to search if a new string is already in the table, which
|
||||
is much simpler, faster, and easier to understand than hashing.
|
||||
|
||||
===========================================================================
|
||||
|
||||
DECODER
|
||||
|
||||
We will now see if we can regenerate the original data stream and duplicate
|
||||
the table looking only at the output data stream generated by the encoder
|
||||
on the previous page. The output data stream is:
|
||||
|
||||
A B 6 8 B 10 9 A A C D 14 16 D C 8 ....
|
||||
|
||||
The docoding process is harder to see, but easier to implement, than the
|
||||
encoding process. The data is taken in pairs, and a new code is assigned to
|
||||
each pair. The prefix is the left side of the pair, and the suffix is the
|
||||
color that the right side of the pair decomposes to from the table. The
|
||||
decomposition is done by outputing the suffix of the code, and using the
|
||||
prefix as the new code. The process repeats until the prefix is a single
|
||||
color, and it is output too. The output of the decomposition is pushed onto
|
||||
a stack, and then poped off the stack to the display, which restores the
|
||||
original order that the colors were seen by the encoder. We will go thru
|
||||
the first few entries in detail, which will hopefully make the process
|
||||
clearer.
|
||||
The first pair is (A B), so the prefix of code 6 is A and the suffix
|
||||
is B, and 6 represents the string AB. The color A is sent to the display.
|
||||
The 2nd pair is (B 6), so the prefix of code 7 is B and the suffix is
|
||||
the the last color in the decomposition of code 6. Code 6 decomposes into
|
||||
BA, so code 7 = BA, and has a suffix A. The color B is sent to the display.
|
||||
The 3rd pair is (6 8) and the next code is 8. How can we decompose 8.
|
||||
We know that the prefix of code 8 is 6, but we don't know the suffix. The
|
||||
answer is that we use the suffix of the prefix code; A in this case since
|
||||
the suffix of 6 is A. Thus, code 8 = ABA and has a suffix A. We decompose 6
|
||||
to get BA, which becomes AB when we pop it off the stack to the display.
|
||||
The 4th pair is (8 B), so code 9 has a prefix of 8 and a suffix of B,
|
||||
and code 9 = ABAB. We output ABA to the stack, and pop it off to the
|
||||
display as ABA.
|
||||
The 5th pair is (B 10) and the next code is 10. The prefix of code 10
|
||||
is B and the suffix is B (since the prefix is B). Code 10 = BB, and we
|
||||
output the prefix B to the display.
|
||||
The 6th pair is (10 9) and the next code is 11. Thus the prefix of
|
||||
code 11 is 10 and the suffix is the last color in the decomposition of 9,
|
||||
which is A. Thus code 11 = BBA, And we output BB to the display.
|
||||
So far, we have output the correct colors stream A B AB ABA B BB to
|
||||
the display, and have duplicated the codes 6 thru 11 in the encoder table.
|
||||
This process is repeated for the whole data stream to reconstruct the
|
||||
original color stream and build a table identical to the one built by the
|
||||
encoder. We start the table with codes 0-5 representing the 4 colors, the
|
||||
clear code, and the end code. When we get to code 8, we must increse the
|
||||
code size to 5 bits, etc. See GIFDECOD.GIF for a flow diagram of the
|
||||
decoding process.
|
||||
|
||||
I Hope this helps take some of the mystery out of LZW compression, which is
|
||||
really quite easy once you 'see' it. Bob Montgomery
|
60
third_party/giflib/doc/raw2gif.html
vendored
@ -1,60 +0,0 @@
|
||||
<!doctype HTML public "-//W3O//DTD W3 HTML 2.0//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>raw2gif</TITLE>
|
||||
<link rev=made href=mailto:esr@snark.thyrsus.com>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
Go to <a href="index.html">index page</a>.
|
||||
|
||||
<CENTER><H1>raw2gif</H1></CENTER>
|
||||
|
||||
A program to convert RAW image data into GIF files. Only one image can be
|
||||
handled. The RAW image file is assumed to hold one pixel color in one byte,
|
||||
and therefore the file size must be Width times Height as specified by the
|
||||
-s option below.<P>
|
||||
|
||||
<H1>Usage:</H1>
|
||||
|
||||
<pre>
|
||||
raw2gif [-q] -s Width Height [-p ColorMapFile] [-h] RawFile
|
||||
</pre>
|
||||
|
||||
If no RawFile is given, Raw2Gif will try to read RAW data from stdin.
|
||||
The generated GIF File is dumped to stdout.<P>
|
||||
|
||||
<H1>Memory required:</H1>
|
||||
|
||||
Line.
|
||||
|
||||
<H1>Options:</H1>
|
||||
|
||||
<DL>
|
||||
<DT> [-q]
|
||||
<DD> Quiet mode. Defaults off on MSDOS, on under UNIX. Controls printout
|
||||
of running scan lines. Use -q- to invert.<P>
|
||||
|
||||
<DT> -s Width Height
|
||||
<DD> the dimensions of the image MUST be specified in the
|
||||
command line. The RAW image file size must be exactly Width times Height
|
||||
bytes (each byte is one pixel color).<P>
|
||||
|
||||
<DT> [-p ColorMapFile]
|
||||
<DD> Color map to load for given RAW image. This file has
|
||||
4 integers in line (ColorIndex Red Green Blue), and the ColorIndex is
|
||||
in order starting from 1. See GifClrMp, which can also use/create these
|
||||
bitmap files. If no color map is specified, uses the EGA 16 color pallete
|
||||
as default color map.<P>
|
||||
|
||||
<DT> [-h]
|
||||
<DD> Print one line of command line help, similar to Usage above.<P>
|
||||
</DL>
|
||||
|
||||
<H1>Author:</H1>
|
||||
|
||||
Gershon Elber
|
||||
|
||||
<HR>
|
||||
<ADDRESS>Eric S. Raymond <A HREF="mailto:esr@thyrsus.com"><esr@snark.thyrsus.com></A></ADDRESS>
|
||||
</BODY>
|
||||
</HTML>
|
59
third_party/giflib/doc/rgb2gif.html
vendored
@ -1,59 +0,0 @@
|
||||
<!doctype HTML public "-//W3O//DTD W3 HTML 2.0//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>rgb2gif</TITLE>
|
||||
<link rev=made href=mailto:esr@snark.thyrsus.com>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
Go to <a href="index.html">index page</a>.
|
||||
|
||||
<CENTER><H1>rgb2gif</H1></CENTER>
|
||||
|
||||
A program to convert 24 bit images to a GIF image using color quantization.<P>
|
||||
|
||||
|
||||
<H1>Usage:</H1>
|
||||
|
||||
<pre>
|
||||
rgb2gif [-q] [-c #Colors] [-1] -s Width Height [-h] RGBFile
|
||||
</pre>
|
||||
|
||||
If no RGBFile is given, RGB2Gif will try to read a GIF file from stdin.<P>
|
||||
|
||||
<H1>Memory required:</H1>
|
||||
|
||||
Screen.
|
||||
|
||||
<H1>Options:</H1>
|
||||
|
||||
<DL>
|
||||
<DT> [-q]
|
||||
<DD> Quiet mode. Defaulte off on MSDOS, on under UNIX. Controls printout
|
||||
of running scan lines. Use -q- to invert.<P>
|
||||
|
||||
<DT> [-c #Colors]
|
||||
<DD> Specifies number of colors to use, in bits per pixels, so
|
||||
'-c 8' specifies actually 256 colors (maximum and default).<P>
|
||||
|
||||
<DT> [-1]
|
||||
<DD> Only one file in the format of RGBRGB... triplets (Each of R, G, B
|
||||
is a byte) is read from input. This file size is 3 * Width * Height (see
|
||||
'-s' below. If stdin is used for input, this option is implicitly applied.
|
||||
The default (if not '-1') is 3 files with the names RGBFile.R, RGBFile.G,
|
||||
RGBFile.B, each of which is Width * Height bytes.<P>
|
||||
|
||||
<DT> [-s Width Height]
|
||||
<DD> Specifies the size of the image to read.<P>
|
||||
|
||||
<DT> [-h]
|
||||
<DD> Print one line of command line help, similar to Usage above.<P>
|
||||
</DL>
|
||||
|
||||
<H1>Author:</H1>
|
||||
|
||||
Gershon Elber
|
||||
|
||||
<HR>
|
||||
<ADDRESS>Eric S. Raymond <A HREF="mailto:esr@thyrsus.com"><esr@snark.thyrsus.com></A></ADDRESS>
|
||||
</BODY>
|
||||
</HTML>
|
58
third_party/giflib/doc/rle2gif.html
vendored
@ -1,58 +0,0 @@
|
||||
<!doctype HTML public "-//W3O//DTD W3 HTML 2.0//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>rle2gif</TITLE>
|
||||
<link rev=made href=mailto:esr@snark.thyrsus.com>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
Go to <a href="index.html">index page</a>.
|
||||
|
||||
<CENTER><H1>rle2gif</H1></CENTER>
|
||||
|
||||
A program to convert images saved as RLE (Utah raster toolkit) to GIF
|
||||
format.<P>
|
||||
|
||||
<H1>Usage:</H1>
|
||||
|
||||
<pre>
|
||||
rle2Gif [-q] [-c #Colors] [-h] RleFile
|
||||
</pre>
|
||||
|
||||
If no RleFile is given, Rle2Gif will try to read an Rle file from stdin.<P>
|
||||
|
||||
<H1>Memory required:</H1>
|
||||
|
||||
Screen.
|
||||
|
||||
<H1>Options:</H1>
|
||||
|
||||
<DL>
|
||||
<DT> [-q]
|
||||
<DD> Quiet mode. Defaults off on MSDOS, on under UNIX. Controls printout
|
||||
of running scan lines. Use -q- to invert.<P>
|
||||
|
||||
<DT> [-c #Colors]
|
||||
<DD> Select size of color map in the output Gif file. #Colors
|
||||
should be given as the based 2 log of number of colors. Default is 8
|
||||
which is 256 colors, and which is also the maximum.
|
||||
|
||||
<DT> [-h]
|
||||
<DD> Print one line of command line help, similar to Usage above..<P>
|
||||
</DL>
|
||||
|
||||
<H1>Notes:</H1>
|
||||
|
||||
As the RLE format allows full 24 bits per pixel (8 per primary color)
|
||||
Colors must be quantized to the number of colors as set by the [-c]
|
||||
option, above. This process is quite slow. See the quantize.c file
|
||||
in the lib directory for the code for this quantization algorithm
|
||||
(median cut).<P>
|
||||
|
||||
<H1>Author:</H1>
|
||||
|
||||
Gershon Elber
|
||||
|
||||
<HR>
|
||||
<ADDRESS>Eric S. Raymond <A HREF="mailto:esr@thyrsus.com"><esr@snark.thyrsus.com></A></ADDRESS>
|
||||
</BODY>
|
||||
</HTML>
|
73
third_party/giflib/doc/text2gif.html
vendored
@ -1,73 +0,0 @@
|
||||
<!doctype HTML public "-//W3O//DTD W3 HTML 2.0//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>text2gif</TITLE>
|
||||
<link rev=made href=mailto:esr@snark.thyrsus.com>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
Go to <a href="index.html">index page</a>.
|
||||
|
||||
<CENTER><H1>text2gif</H1></CENTER>
|
||||
|
||||
A program to generate GIF images out of regular text. Text can be one line
|
||||
or multi-line, and is converted using 8 by 8 fixed font.<P>
|
||||
|
||||
<H1>Usage:</H1>
|
||||
|
||||
<pre>
|
||||
text2gif [-q] [-s ClrMapSize] [-f FGClr] [-c R G B] [-t "Text"] [-h]
|
||||
</pre>
|
||||
|
||||
This program reads stdin if no text is provided on the command line (-t),
|
||||
and will dump the created GIF file to stdout.<P>
|
||||
|
||||
<H1>Memory required:</H1>
|
||||
|
||||
Line.
|
||||
|
||||
<H1>Options:</H1>
|
||||
|
||||
<DT> [-q]
|
||||
<DD> Quiet mode. Defaults off on MSDOS, on under UNIX. Controls printout
|
||||
of running scan lines. Use -q- to invert.<P>
|
||||
|
||||
<DT>[-s ClrMapSize]
|
||||
<DD>Explicitly defines the size of the color map of the
|
||||
resulting gif image. Usually the image will be bicolor with fg as color
|
||||
1, unless [-f] is explicitly given in case the color map size will be
|
||||
big enough to hold it. However it is sometimes convenient to set the
|
||||
color map size to certain size while the fg color is small mainly so
|
||||
this image may be merged with another (images must match color map size).<P>
|
||||
|
||||
<DT>[-f FG]
|
||||
<DD> Select foreground index (background is always 0). By default
|
||||
it is one and therefore the image result is bicolored.
|
||||
if FG is set to n then color map will be created with 2^k entries where
|
||||
2^k > n for minimum k, assuming k <= 8. This color map will be all zeros
|
||||
except this forground index. This option is useful if this text image
|
||||
should be integrated into other image colormap using their colors.<P>
|
||||
|
||||
<DT> [-c R G B]
|
||||
<DD> The color to use as the foreground color. White by default.<P>
|
||||
|
||||
<DT> [-t "Text"]
|
||||
<DD> One line of text can be provided on the command
|
||||
line. Note you must encapsulate the Text within quotes if it has spaces
|
||||
(The quotes themselves are not treated as part of the text). If no -t
|
||||
option is provided, stdin is read until end of file.<P>
|
||||
|
||||
<DT> [-h]
|
||||
<DD> Print one line command line help, similar to Usage above.<P>
|
||||
|
||||
<H1>Notes:</H1>
|
||||
|
||||
There is a hardcoded limit of 100 the number of lines.<P>
|
||||
|
||||
<H1>Author:</H1>
|
||||
|
||||
Gershon Elber
|
||||
|
||||
<HR>
|
||||
<ADDRESS>Eric S. Raymond <A HREF="mailto:esr@thyrsus.com"><esr@snark.thyrsus.com></A></ADDRESS>
|
||||
</BODY>
|
||||
</HTML>
|
283
third_party/giflib/gba/giftest.c
vendored
@ -1,283 +0,0 @@
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
#else
|
||||
int __gba_multiboot;
|
||||
#include <gba_input.h>
|
||||
#include <gba_video.h>
|
||||
#endif
|
||||
|
||||
#define RGB8(r,g,b) ( (((b)>>3)<<10) | (((g)>>3)<<5) | ((r)>>3) )
|
||||
|
||||
#ifndef __MSDOS__
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
#include "../lib/gif_lib.h"
|
||||
|
||||
#include "res/cover.c"
|
||||
#include "res/porsche-240x160.c"
|
||||
#include "res/x-trans.c"
|
||||
|
||||
const short InterlacedOffset[] = { 0, 4, 2, 1 }; /* The way Interlaced image should. */
|
||||
const short InterlacedJumps[] = { 8, 8, 4, 2 }; /* be read - offsets and jumps... */
|
||||
|
||||
int readFunc(GifFileType* GifFile, GifByteType* buf, int count)
|
||||
{
|
||||
char* ptr = GifFile->UserData;
|
||||
memcpy(buf, ptr, count);
|
||||
GifFile->UserData = ptr + count;
|
||||
return count;
|
||||
}
|
||||
|
||||
void CopyLine(void* dst, void* src, int count)
|
||||
{
|
||||
do
|
||||
{
|
||||
*(short*) dst = *(short*) src;
|
||||
src = (u8*)src + 2;
|
||||
dst = (u8*)dst + 2;
|
||||
count -= 2;
|
||||
}
|
||||
while (count >= 0);
|
||||
}
|
||||
|
||||
int DGifGetLineByte(GifFileType *GifFile, GifPixelType *Line, int LineLen)
|
||||
{
|
||||
GifPixelType LineBuf[240];
|
||||
CopyLine(LineBuf, Line, LineLen);
|
||||
int result = DGifGetLine(GifFile, LineBuf, LineLen);
|
||||
CopyLine(Line, LineBuf, LineLen);
|
||||
return result;
|
||||
}
|
||||
|
||||
#define GAMMA(x) (x)
|
||||
|
||||
#ifdef _NO_FILEIO
|
||||
#define PrintGifError()
|
||||
#endif
|
||||
|
||||
/******************************************************************************
|
||||
* Interpret the command line and scan the given GIF file. *
|
||||
******************************************************************************/
|
||||
#ifdef _WIN32
|
||||
int DecodeGif(const u8 *userData, u8 ScreenBuff[160][240], BITMAPINFO* pBMI)
|
||||
#else
|
||||
int DecodeGif(const u8 *userData, u8 ScreenBuff[160][240], u16* Palette)
|
||||
#endif
|
||||
{
|
||||
int i, j, Row, Col, Width, Height, ExtCode, Count;
|
||||
GifRecordType RecordType;
|
||||
GifByteType *Extension;
|
||||
GifFileType *GifFile;
|
||||
ColorMapObject *ColorMap;
|
||||
|
||||
if ((GifFile = DGifOpen(userData, readFunc)) == NULL) {
|
||||
PrintGifError();
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
for (i = 0; i < GifFile->SWidth; i++) /* Set its color to BackGround. */
|
||||
ScreenBuff[0][i] = GifFile->SBackGroundColor;
|
||||
for (i = 1; i < GifFile->SHeight; i++) {
|
||||
memcpy(ScreenBuff[i], ScreenBuff[0], GifFile->SWidth);
|
||||
}
|
||||
|
||||
/* Scan the content of the GIF file and load the image(s) in: */
|
||||
do {
|
||||
if (DGifGetRecordType(GifFile, &RecordType) == GIF_ERROR) {
|
||||
PrintGifError();
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
switch (RecordType) {
|
||||
case IMAGE_DESC_RECORD_TYPE:
|
||||
if (DGifGetImageDesc(GifFile) == GIF_ERROR) {
|
||||
PrintGifError();
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
Row = GifFile->Image.Top; /* Image Position relative to Screen. */
|
||||
Col = GifFile->Image.Left;
|
||||
Width = GifFile->Image.Width;
|
||||
Height = GifFile->Image.Height;
|
||||
|
||||
// Update Color map
|
||||
ColorMap = (GifFile->Image.ColorMap
|
||||
? GifFile->Image.ColorMap
|
||||
: GifFile->SColorMap);
|
||||
|
||||
#ifdef _WIN32
|
||||
ZeroMemory(pBMI, sizeof(BITMAPINFOHEADER) + 256*sizeof(RGBQUAD));
|
||||
pBMI->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
|
||||
pBMI->bmiHeader.biWidth = Width;
|
||||
pBMI->bmiHeader.biHeight = -Height; // negative for top-down bitmap
|
||||
pBMI->bmiHeader.biPlanes = 1;
|
||||
pBMI->bmiHeader.biBitCount = 8;
|
||||
pBMI->bmiHeader.biClrUsed = 256;
|
||||
pBMI->bmiHeader.biClrImportant = 256;
|
||||
i = ColorMap->ColorCount;
|
||||
while (--i >= 0)
|
||||
{
|
||||
RGBQUAD rgb;
|
||||
GifColorType* color = &ColorMap->Colors[i];
|
||||
rgb.rgbRed = color->Red;
|
||||
rgb.rgbGreen = color->Green;
|
||||
rgb.rgbBlue = color->Blue;
|
||||
rgb.rgbReserved = 0;
|
||||
pBMI->bmiColors[i] = rgb;
|
||||
}
|
||||
#else
|
||||
i = ColorMap->ColorCount;
|
||||
while (--i >= 0)
|
||||
{
|
||||
GifColorType* pColor = &ColorMap->Colors[i];
|
||||
Palette[i] = RGB8(GAMMA(pColor->Red), GAMMA(pColor->Green), GAMMA(pColor->Blue));
|
||||
}
|
||||
#endif
|
||||
if (GifFile->Image.Left + GifFile->Image.Width > GifFile->SWidth ||
|
||||
GifFile->Image.Top + GifFile->Image.Height > GifFile->SHeight) {
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
if (GifFile->Image.Interlace) {
|
||||
/* Need to perform 4 passes on the images: */
|
||||
for (Count = i = 0; i < 4; i++)
|
||||
for (j = Row + InterlacedOffset[i]; j < Row + Height;
|
||||
j += InterlacedJumps[i]) {
|
||||
if (DGifGetLineByte(GifFile, &ScreenBuff[j][Col],
|
||||
Width) == GIF_ERROR) {
|
||||
PrintGifError();
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
for (i = 0; i < Height; i++) {
|
||||
if (DGifGetLineByte(GifFile, &ScreenBuff[Row++][Col],
|
||||
Width) == GIF_ERROR) {
|
||||
PrintGifError();
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case EXTENSION_RECORD_TYPE:
|
||||
/* Skip any extension blocks in file: */
|
||||
if (DGifGetExtension(GifFile, &ExtCode, &Extension) == GIF_ERROR) {
|
||||
PrintGifError();
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
while (Extension != NULL) {
|
||||
if (DGifGetExtensionNext(GifFile, &Extension) == GIF_ERROR) {
|
||||
PrintGifError();
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case TERMINATE_RECORD_TYPE:
|
||||
break;
|
||||
default: /* Should be traps by DGifGetRecordType. */
|
||||
break;
|
||||
}
|
||||
}
|
||||
while (RecordType != TERMINATE_RECORD_TYPE);
|
||||
|
||||
/* Close file when done */
|
||||
if (DGifCloseFile(GifFile) == GIF_ERROR) {
|
||||
PrintGifError();
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
u16* paletteMem = (u16*)0x5000000;
|
||||
|
||||
short x = 120;
|
||||
short y = 60;
|
||||
short n = 0;
|
||||
short v = 0;
|
||||
|
||||
int WaitInput(void)
|
||||
{
|
||||
volatile int keys;
|
||||
do
|
||||
{
|
||||
keys = ~REG_KEYINPUT;
|
||||
|
||||
if (keys & KEY_B)
|
||||
{
|
||||
REG_BG2PA = 0x0080;
|
||||
REG_BG2PD = 0x0080;
|
||||
|
||||
if (keys & KEY_RIGHT)
|
||||
{
|
||||
if (x < 240)
|
||||
++x;
|
||||
}
|
||||
else if (keys & KEY_LEFT)
|
||||
{
|
||||
if (x > 0)
|
||||
--x;
|
||||
}
|
||||
if (keys & KEY_DOWN)
|
||||
{
|
||||
if (y < 160)
|
||||
++y;
|
||||
}
|
||||
else if (keys & KEY_UP)
|
||||
{
|
||||
if (y > 0)
|
||||
--y;
|
||||
}
|
||||
REG_BG2X = x << 7;
|
||||
REG_BG2Y = y << 7;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Normal: no pan offset
|
||||
REG_BG2PA = 0x0100;
|
||||
REG_BG2PD = 0x0100;
|
||||
REG_BG2X = 0;
|
||||
REG_BG2Y = 0;
|
||||
}
|
||||
while (REG_VCOUNT != 160);
|
||||
}
|
||||
while ((keys & (KEY_A|KEY_L|KEY_R)) == 0);
|
||||
|
||||
if (keys & KEY_L)
|
||||
if (n > 0) --n; else n = 2;
|
||||
else
|
||||
if (n < 2) ++n; else n = 0;
|
||||
|
||||
return keys;
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
SetMode(4 | BG2_ENABLE); /* Enable mode 4 and turn on background 2. */
|
||||
do
|
||||
{
|
||||
memset(MODE3_FB, 0, 240*160*sizeof(short));
|
||||
const u8* pict;
|
||||
switch (n)
|
||||
{
|
||||
case 1:
|
||||
pict = cover;
|
||||
break;
|
||||
case 2:
|
||||
pict = x_trans;
|
||||
break;
|
||||
default:
|
||||
pict = porsche_240x160;
|
||||
break;
|
||||
}
|
||||
/* Convert GIF to 256-color picture */
|
||||
DecodeGif(pict, (void*) MODE3_FB, paletteMem);
|
||||
}
|
||||
while ((WaitInput() & (KEY_START|KEY_SELECT)) == 0);
|
||||
return 0;
|
||||
}
|
157
third_party/giflib/gba/giftest.dsp
vendored
@ -1,157 +0,0 @@
|
||||
# Microsoft Developer Studio Project File - Name="giftest" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) External Target" 0x0106
|
||||
|
||||
CFG=giftest - Win32 Debug
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "giftest.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "giftest.mak" CFG="giftest - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "giftest - Win32 Release" (based on "Win32 (x86) External Target")
|
||||
!MESSAGE "giftest - Win32 Debug" (based on "Win32 (x86) External Target")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
|
||||
!IF "$(CFG)" == "giftest - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Cmd_Line "NMAKE /f giftest.mak"
|
||||
# PROP BASE Rebuild_Opt "/a"
|
||||
# PROP BASE Target_File "giftest.exe"
|
||||
# PROP BASE Bsc_Name "giftest.bsc"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Cmd_Line "vmake -f "giftest.mak""
|
||||
# PROP Rebuild_Opt "all"
|
||||
# PROP Target_File "giftest.mb"
|
||||
# PROP Bsc_Name ""
|
||||
# PROP Target_Dir ""
|
||||
|
||||
!ELSEIF "$(CFG)" == "giftest - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Cmd_Line "NMAKE /f giftest.mak"
|
||||
# PROP BASE Rebuild_Opt "/a"
|
||||
# PROP BASE Target_File "giftest.exe"
|
||||
# PROP BASE Bsc_Name "giftest.bsc"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "Debug"
|
||||
# PROP Intermediate_Dir "Debug"
|
||||
# PROP Cmd_Line "vmake -f "giftest.mak""
|
||||
# PROP Rebuild_Opt "all"
|
||||
# PROP Target_File "giftest.mb"
|
||||
# PROP Bsc_Name ""
|
||||
# PROP Target_Dir ""
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "giftest - Win32 Release"
|
||||
# Name "giftest - Win32 Debug"
|
||||
|
||||
!IF "$(CFG)" == "giftest - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "giftest - Win32 Debug"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\lib\dgif_lib.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\lib\gif_err.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\lib\gifalloc.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\giftest.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\giftest.mak
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\res\porsche-240x160.c"
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\lib\gif_lib.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\lib\gif_lib_private.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Resource Files"
|
||||
|
||||
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\res\cover.gif
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\res\porsche-240x160.gif"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\res\x-trans.gif"
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Output Files"
|
||||
|
||||
# PROP Default_Filter "*.gba;*.mb"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\giftest.gba
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\giftest.map
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\giftest.mb
|
||||
# End Source File
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
52
third_party/giflib/gba/giftest.mak
vendored
@ -1,52 +0,0 @@
|
||||
APP = giftest
|
||||
CC = arm-elf-gcc
|
||||
AS = arm-elf-as
|
||||
GCCBASE = c:/devkitpro/devkitARM
|
||||
LIBGBA = c:/devkitpro/libgba/include
|
||||
GCCDIR = $(GCCBASE)/lib/gcc/arm-elf/4.0.1
|
||||
GBAINC = -I $(GCCDIR)/include -I $(LIBGBA)
|
||||
ARCH = -mthumb -mthumb-interwork
|
||||
AFLAGS = $(GBAINC) $(ARCH)
|
||||
CFLAGS = -c -g -Wall -D_GBA_OPTMEM -D_GBA_NO_FILEIO -O3 $(ARCH) -mcpu=arm7tdmi -ffast-math -I. $(GBAINC)
|
||||
LFLAGS = $(ARCH) -specs=gba_mb.specs -Wl,-Map,$(APP).map
|
||||
|
||||
build : $(APP).gba $(APP).mb
|
||||
|
||||
all: clean build
|
||||
|
||||
$(APP).gba : $(APP).elf
|
||||
arm-elf-objcopy -v -O binary $(APP).elf $@
|
||||
|
||||
$(APP).mb : $(APP).gba
|
||||
gba-header -i $(APP).gba -o $(APP).mb -fix
|
||||
|
||||
$(APP).elf : giftest.o dgif_lib.o gif_err.o gifalloc.o
|
||||
$(CC) -o $@ $(LFLAGS) giftest.o dgif_lib.o gif_err.o gifalloc.o
|
||||
|
||||
giftest.o : giftest.c res/cover.c res/porsche-240x160.c res/x-trans.c
|
||||
$(CC) $(CFLAGS) giftest.c
|
||||
|
||||
dgif_lib.o : ../lib/dgif_lib.c
|
||||
$(CC) $(CFLAGS) ../lib/dgif_lib.c
|
||||
|
||||
gif_err.o : ../lib/gif_err.c
|
||||
$(CC) $(CFLAGS) ../lib/gif_err.c
|
||||
|
||||
gifalloc.o : ../lib/gifalloc.c
|
||||
$(CC) $(CFLAGS) ../lib/gifalloc.c
|
||||
|
||||
res/cover.c : res/cover.gif
|
||||
bin2c $*.gif $@ cover
|
||||
|
||||
res/porsche-240x160.c : res/porsche-240x160.gif
|
||||
bin2c $*.gif $@ porsche_240x160
|
||||
|
||||
res/x-trans.c : res/x-trans.gif
|
||||
bin2c $*.gif $@ x_trans
|
||||
|
||||
clean :
|
||||
rm -f *.o $(APP).elf $(APP).map $(APP).gba $(APP).mb res/*.c
|
||||
|
||||
cln : clean
|
||||
rm -f $(APP).dsw $(APP).ncb $(APP).opt $(APP).plg
|
||||
rmdir Debug
|
BIN
third_party/giflib/gba/res/cover.gif
vendored
Before Width: | Height: | Size: 13 KiB |
BIN
third_party/giflib/gba/res/porsche-240x160.gif
vendored
Before Width: | Height: | Size: 4.4 KiB |
BIN
third_party/giflib/gba/res/x-trans.gif
vendored
Before Width: | Height: | Size: 1.1 KiB |
25
third_party/giflib/giflib.lsm
vendored
@ -1,25 +0,0 @@
|
||||
Begin3
|
||||
Title: giflib
|
||||
Version: 4.1.2
|
||||
Entered-date: 26MAY2004
|
||||
Description: A library for reading and writing gif images. This library
|
||||
is an update of giflib-3.0 which has long languished without
|
||||
bug-fixes and improvements. It implements a superset of that
|
||||
library's API but is not binary compatible with it. It _is_
|
||||
binary compatible with libungif-4.1. Be warned that using
|
||||
this library may require a license from Unisys (because of
|
||||
their patent on LZW compression used in the gif format.)
|
||||
Unless you really need to write compressed gifs, I would
|
||||
suggest libungif (available from the same sites as this
|
||||
library) as a better alternative.
|
||||
Keywords: GIF library graphics utilities
|
||||
Author: toshio@tiki-lounge.com (Toshio Kuratomi)
|
||||
Maintained-by: toshio@tiki-lounge.com (Toshio Kuratomi)
|
||||
Primary-site: download.sourceforge.net /libungif
|
||||
553k giflib-4.1.2.tar.gz
|
||||
Alternate-site:
|
||||
Original-site: download.sourceforge.net /libungif
|
||||
553k giflib-4.1.2.tar.gz
|
||||
Platforms:
|
||||
Copying-policy: MIT
|
||||
End
|
114
third_party/giflib/giflib.spec
vendored
@ -1,114 +0,0 @@
|
||||
Summary: A library for manipulating GIF format image files.
|
||||
Name: giflib
|
||||
Version: 4.1.3
|
||||
Release: 1
|
||||
License: MIT
|
||||
URL: http://sourceforge.net/projects/libungif/
|
||||
Source: http://osdn.dl.sourceforge.net/sourceforge/libungif/%{name}-%{version}.tar.bz2
|
||||
Group: System Environment/Libraries
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||
Obsoletes: libungif
|
||||
Provides: libungif.so libungif
|
||||
|
||||
%description
|
||||
GIF loading and saving shared library.
|
||||
|
||||
IMPORTANT! Please read /usr/doc/PATENT_PROBLEMS for information on
|
||||
why using this library may put you at legal risk and what
|
||||
alternatives you may have.
|
||||
|
||||
%package devel
|
||||
Summary: Development tools for programs which will use the giflib library.
|
||||
Group: Development/Libraries
|
||||
Requires: %{name} = %{version}
|
||||
|
||||
%description devel
|
||||
Libraries and headers needed for developing programs that use giflib
|
||||
to load and save gif image files.
|
||||
|
||||
IMPORTANT! Please read /usr/doc/PATENT_PROBLEMS for information on
|
||||
why using this library may put you at legal risk and what
|
||||
alternatives you may have.
|
||||
|
||||
%package progs
|
||||
Summary: Programs for manipulating GIF format image files.
|
||||
Group: Applications/Multimedia
|
||||
Requires: %{name} = %{version}
|
||||
|
||||
%description progs
|
||||
This package contains various programs for manipulating gif image files.
|
||||
|
||||
IMPORTANT! Please read /usr/doc/PATENT_PROBLEMS for information on
|
||||
why using this library may put you at legal risk and what
|
||||
alternatives you may have.
|
||||
|
||||
%prep
|
||||
%setup
|
||||
|
||||
%build
|
||||
%configure
|
||||
make all
|
||||
|
||||
%install
|
||||
rm -rf ${RPM_BUILD_ROOT}
|
||||
|
||||
%{makeinstall}
|
||||
ln -sf libungif.so.%{version} ${RPM_BUILD_ROOT}%{_libdir}/libgif.so.%{version}
|
||||
ln -sf libgif.so.%{version} ${RPM_BUILD_ROOT}%{_libdir}/libgif.so.4
|
||||
ln -sf libgif.so.4 ${RPM_BUILD_ROOT}%{_libdir}/libgif.so
|
||||
ln -sf libungif.a ${RPM_BUILD_ROOT}%{_libdir}/libgif.a
|
||||
|
||||
chmod 755 ${RPM_BUILD_ROOT}%{_libdir}/*.so*
|
||||
chmod 644 ${RPM_BUILD_ROOT}%{_libdir}/*.a*
|
||||
chmod 644 COPYING README UNCOMPRESSED_GIF NEWS ONEWS
|
||||
chmod 644 ChangeLog TODO BUGS AUTHORS
|
||||
chmod 644 doc/* util/giffiltr.c util/gifspnge.c
|
||||
|
||||
%clean
|
||||
rm -rf ${RPM_BUILD_ROOT}
|
||||
|
||||
%post -p /sbin/ldconfig
|
||||
|
||||
%postun -p /sbin/ldconfig
|
||||
|
||||
%files
|
||||
%defattr(-,root,root)
|
||||
%doc COPYING README PATENT_PROBLEMS NEWS ONEWS
|
||||
%doc ChangeLog TODO BUGS AUTHORS
|
||||
%{_libdir}/lib*.so.*
|
||||
|
||||
%files devel
|
||||
%defattr(-,root,root)
|
||||
%doc doc/* util/giffiltr.c util/gifspnge.c
|
||||
%{_libdir}/lib*.a
|
||||
%{_libdir}/lib*.so
|
||||
%{_libdir}/lib*.la
|
||||
%{_includedir}/gif_lib.h
|
||||
|
||||
%files progs
|
||||
%attr(0755 root root) %{_bindir}/*
|
||||
|
||||
%changelog
|
||||
* Sat May 29 2004 Toshio Kuratomi <toshio@tiki-lounge.com> - 4.1.3-1
|
||||
- Upgrade to version 4.1.3
|
||||
|
||||
* Wed May 26 2004 Toshio Kuratomi <toshio@tiki-lounge.com> - 4.1.2-1
|
||||
- Upgrade to 4.1.2
|
||||
|
||||
* Tue Feb 17 2004 Toshio Kuratomi <toshio@tiki-lounge.com> - 4.1.1-1
|
||||
- Upgrade to 4.1.1
|
||||
- Modernize the spec a bit
|
||||
|
||||
* Tue Jan 19 1999 Toshio Kuratomi <badger@prtr-13.ucsc.edu>
|
||||
- Upgrade to version 4.1
|
||||
+ Fix a few minor memory leaks in error conditions.
|
||||
+ Add a new function EGifOpen( void *userData, OutputFunc writeFunc) that
|
||||
allows user specified gif writing function.
|
||||
- Merge spec file from libungif-3.1-5
|
||||
|
||||
* Fri Dec 17 1998 Toshio Kuratomi <badger@prtr-13.ucsc.edu>
|
||||
- Add note to read PATENT_PROBLEMS.
|
||||
|
||||
* Mon Dec 14 1998 Toshio Kuratomi <badger@prtr-13.ucsc.edu>
|
||||
- Upgrade to version 4.0 (Fixes rather nasty behaviour when dealing with
|
||||
Extensions.)
|
507
third_party/giflib/install-sh
vendored
@ -1,507 +0,0 @@
|
||||
#!/bin/sh
|
||||
# install - install a program, script, or datafile
|
||||
|
||||
scriptversion=2006-10-14.15
|
||||
|
||||
# This originates from X11R5 (mit/util/scripts/install.sh), which was
|
||||
# later released in X11R6 (xc/config/util/install.sh) with the
|
||||
# following copyright and license.
|
||||
#
|
||||
# Copyright (C) 1994 X Consortium
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to
|
||||
# deal in the Software without restriction, including without limitation the
|
||||
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
# sell copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
|
||||
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#
|
||||
# Except as contained in this notice, the name of the X Consortium shall not
|
||||
# be used in advertising or otherwise to promote the sale, use or other deal-
|
||||
# ings in this Software without prior written authorization from the X Consor-
|
||||
# tium.
|
||||
#
|
||||
#
|
||||
# FSF changes to this file are in the public domain.
|
||||
#
|
||||
# Calling this script install-sh is preferred over install.sh, to prevent
|
||||
# `make' implicit rules from creating a file called install from it
|
||||
# when there is no Makefile.
|
||||
#
|
||||
# This script is compatible with the BSD install script, but was written
|
||||
# from scratch.
|
||||
|
||||
nl='
|
||||
'
|
||||
IFS=" "" $nl"
|
||||
|
||||
# set DOITPROG to echo to test this script
|
||||
|
||||
# Don't use :- since 4.3BSD and earlier shells don't like it.
|
||||
doit="${DOITPROG-}"
|
||||
if test -z "$doit"; then
|
||||
doit_exec=exec
|
||||
else
|
||||
doit_exec=$doit
|
||||
fi
|
||||
|
||||
# Put in absolute file names if you don't have them in your path;
|
||||
# or use environment vars.
|
||||
|
||||
mvprog="${MVPROG-mv}"
|
||||
cpprog="${CPPROG-cp}"
|
||||
chmodprog="${CHMODPROG-chmod}"
|
||||
chownprog="${CHOWNPROG-chown}"
|
||||
chgrpprog="${CHGRPPROG-chgrp}"
|
||||
stripprog="${STRIPPROG-strip}"
|
||||
rmprog="${RMPROG-rm}"
|
||||
mkdirprog="${MKDIRPROG-mkdir}"
|
||||
|
||||
posix_glob=
|
||||
posix_mkdir=
|
||||
|
||||
# Desired mode of installed file.
|
||||
mode=0755
|
||||
|
||||
chmodcmd=$chmodprog
|
||||
chowncmd=
|
||||
chgrpcmd=
|
||||
stripcmd=
|
||||
rmcmd="$rmprog -f"
|
||||
mvcmd="$mvprog"
|
||||
src=
|
||||
dst=
|
||||
dir_arg=
|
||||
dstarg=
|
||||
no_target_directory=
|
||||
|
||||
usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
|
||||
or: $0 [OPTION]... SRCFILES... DIRECTORY
|
||||
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
|
||||
or: $0 [OPTION]... -d DIRECTORIES...
|
||||
|
||||
In the 1st form, copy SRCFILE to DSTFILE.
|
||||
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
|
||||
In the 4th, create DIRECTORIES.
|
||||
|
||||
Options:
|
||||
-c (ignored)
|
||||
-d create directories instead of installing files.
|
||||
-g GROUP $chgrpprog installed files to GROUP.
|
||||
-m MODE $chmodprog installed files to MODE.
|
||||
-o USER $chownprog installed files to USER.
|
||||
-s $stripprog installed files.
|
||||
-t DIRECTORY install into DIRECTORY.
|
||||
-T report an error if DSTFILE is a directory.
|
||||
--help display this help and exit.
|
||||
--version display version info and exit.
|
||||
|
||||
Environment variables override the default commands:
|
||||
CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
|
||||
"
|
||||
|
||||
while test $# -ne 0; do
|
||||
case $1 in
|
||||
-c) shift
|
||||
continue;;
|
||||
|
||||
-d) dir_arg=true
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-g) chgrpcmd="$chgrpprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
--help) echo "$usage"; exit $?;;
|
||||
|
||||
-m) mode=$2
|
||||
shift
|
||||
shift
|
||||
case $mode in
|
||||
*' '* | *' '* | *'
|
||||
'* | *'*'* | *'?'* | *'['*)
|
||||
echo "$0: invalid mode: $mode" >&2
|
||||
exit 1;;
|
||||
esac
|
||||
continue;;
|
||||
|
||||
-o) chowncmd="$chownprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-s) stripcmd=$stripprog
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-t) dstarg=$2
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-T) no_target_directory=true
|
||||
shift
|
||||
continue;;
|
||||
|
||||
--version) echo "$0 $scriptversion"; exit $?;;
|
||||
|
||||
--) shift
|
||||
break;;
|
||||
|
||||
-*) echo "$0: invalid option: $1" >&2
|
||||
exit 1;;
|
||||
|
||||
*) break;;
|
||||
esac
|
||||
done
|
||||
|
||||
if test $# -ne 0 && test -z "$dir_arg$dstarg"; then
|
||||
# When -d is used, all remaining arguments are directories to create.
|
||||
# When -t is used, the destination is already specified.
|
||||
# Otherwise, the last argument is the destination. Remove it from $@.
|
||||
for arg
|
||||
do
|
||||
if test -n "$dstarg"; then
|
||||
# $@ is not empty: it contains at least $arg.
|
||||
set fnord "$@" "$dstarg"
|
||||
shift # fnord
|
||||
fi
|
||||
shift # arg
|
||||
dstarg=$arg
|
||||
done
|
||||
fi
|
||||
|
||||
if test $# -eq 0; then
|
||||
if test -z "$dir_arg"; then
|
||||
echo "$0: no input file specified." >&2
|
||||
exit 1
|
||||
fi
|
||||
# It's OK to call `install-sh -d' without argument.
|
||||
# This can happen when creating conditional directories.
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if test -z "$dir_arg"; then
|
||||
trap '(exit $?); exit' 1 2 13 15
|
||||
|
||||
# Set umask so as not to create temps with too-generous modes.
|
||||
# However, 'strip' requires both read and write access to temps.
|
||||
case $mode in
|
||||
# Optimize common cases.
|
||||
*644) cp_umask=133;;
|
||||
*755) cp_umask=22;;
|
||||
|
||||
*[0-7])
|
||||
if test -z "$stripcmd"; then
|
||||
u_plus_rw=
|
||||
else
|
||||
u_plus_rw='% 200'
|
||||
fi
|
||||
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
|
||||
*)
|
||||
if test -z "$stripcmd"; then
|
||||
u_plus_rw=
|
||||
else
|
||||
u_plus_rw=,u+rw
|
||||
fi
|
||||
cp_umask=$mode$u_plus_rw;;
|
||||
esac
|
||||
fi
|
||||
|
||||
for src
|
||||
do
|
||||
# Protect names starting with `-'.
|
||||
case $src in
|
||||
-*) src=./$src ;;
|
||||
esac
|
||||
|
||||
if test -n "$dir_arg"; then
|
||||
dst=$src
|
||||
dstdir=$dst
|
||||
test -d "$dstdir"
|
||||
dstdir_status=$?
|
||||
else
|
||||
|
||||
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
|
||||
# might cause directories to be created, which would be especially bad
|
||||
# if $src (and thus $dsttmp) contains '*'.
|
||||
if test ! -f "$src" && test ! -d "$src"; then
|
||||
echo "$0: $src does not exist." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if test -z "$dstarg"; then
|
||||
echo "$0: no destination specified." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
dst=$dstarg
|
||||
# Protect names starting with `-'.
|
||||
case $dst in
|
||||
-*) dst=./$dst ;;
|
||||
esac
|
||||
|
||||
# If destination is a directory, append the input filename; won't work
|
||||
# if double slashes aren't ignored.
|
||||
if test -d "$dst"; then
|
||||
if test -n "$no_target_directory"; then
|
||||
echo "$0: $dstarg: Is a directory" >&2
|
||||
exit 1
|
||||
fi
|
||||
dstdir=$dst
|
||||
dst=$dstdir/`basename "$src"`
|
||||
dstdir_status=0
|
||||
else
|
||||
# Prefer dirname, but fall back on a substitute if dirname fails.
|
||||
dstdir=`
|
||||
(dirname "$dst") 2>/dev/null ||
|
||||
expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
|
||||
X"$dst" : 'X\(//\)[^/]' \| \
|
||||
X"$dst" : 'X\(//\)$' \| \
|
||||
X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
|
||||
echo X"$dst" |
|
||||
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
|
||||
s//\1/
|
||||
q
|
||||
}
|
||||
/^X\(\/\/\)[^/].*/{
|
||||
s//\1/
|
||||
q
|
||||
}
|
||||
/^X\(\/\/\)$/{
|
||||
s//\1/
|
||||
q
|
||||
}
|
||||
/^X\(\/\).*/{
|
||||
s//\1/
|
||||
q
|
||||
}
|
||||
s/.*/./; q'
|
||||
`
|
||||
|
||||
test -d "$dstdir"
|
||||
dstdir_status=$?
|
||||
fi
|
||||
fi
|
||||
|
||||
obsolete_mkdir_used=false
|
||||
|
||||
if test $dstdir_status != 0; then
|
||||
case $posix_mkdir in
|
||||
'')
|
||||
# Create intermediate dirs using mode 755 as modified by the umask.
|
||||
# This is like FreeBSD 'install' as of 1997-10-28.
|
||||
umask=`umask`
|
||||
case $stripcmd.$umask in
|
||||
# Optimize common cases.
|
||||
*[2367][2367]) mkdir_umask=$umask;;
|
||||
.*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
|
||||
|
||||
*[0-7])
|
||||
mkdir_umask=`expr $umask + 22 \
|
||||
- $umask % 100 % 40 + $umask % 20 \
|
||||
- $umask % 10 % 4 + $umask % 2
|
||||
`;;
|
||||
*) mkdir_umask=$umask,go-w;;
|
||||
esac
|
||||
|
||||
# With -d, create the new directory with the user-specified mode.
|
||||
# Otherwise, rely on $mkdir_umask.
|
||||
if test -n "$dir_arg"; then
|
||||
mkdir_mode=-m$mode
|
||||
else
|
||||
mkdir_mode=
|
||||
fi
|
||||
|
||||
posix_mkdir=false
|
||||
case $umask in
|
||||
*[123567][0-7][0-7])
|
||||
# POSIX mkdir -p sets u+wx bits regardless of umask, which
|
||||
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
|
||||
;;
|
||||
*)
|
||||
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
|
||||
trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
|
||||
|
||||
if (umask $mkdir_umask &&
|
||||
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
|
||||
then
|
||||
if test -z "$dir_arg" || {
|
||||
# Check for POSIX incompatibilities with -m.
|
||||
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
|
||||
# other-writeable bit of parent directory when it shouldn't.
|
||||
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
|
||||
ls_ld_tmpdir=`ls -ld "$tmpdir"`
|
||||
case $ls_ld_tmpdir in
|
||||
d????-?r-*) different_mode=700;;
|
||||
d????-?--*) different_mode=755;;
|
||||
*) false;;
|
||||
esac &&
|
||||
$mkdirprog -m$different_mode -p -- "$tmpdir" && {
|
||||
ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
|
||||
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
|
||||
}
|
||||
}
|
||||
then posix_mkdir=:
|
||||
fi
|
||||
rmdir "$tmpdir/d" "$tmpdir"
|
||||
else
|
||||
# Remove any dirs left behind by ancient mkdir implementations.
|
||||
rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
|
||||
fi
|
||||
trap '' 0;;
|
||||
esac;;
|
||||
esac
|
||||
|
||||
if
|
||||
$posix_mkdir && (
|
||||
umask $mkdir_umask &&
|
||||
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
|
||||
)
|
||||
then :
|
||||
else
|
||||
|
||||
# The umask is ridiculous, or mkdir does not conform to POSIX,
|
||||
# or it failed possibly due to a race condition. Create the
|
||||
# directory the slow way, step by step, checking for races as we go.
|
||||
|
||||
case $dstdir in
|
||||
/*) prefix=/ ;;
|
||||
-*) prefix=./ ;;
|
||||
*) prefix= ;;
|
||||
esac
|
||||
|
||||
case $posix_glob in
|
||||
'')
|
||||
if (set -f) 2>/dev/null; then
|
||||
posix_glob=true
|
||||
else
|
||||
posix_glob=false
|
||||
fi ;;
|
||||
esac
|
||||
|
||||
oIFS=$IFS
|
||||
IFS=/
|
||||
$posix_glob && set -f
|
||||
set fnord $dstdir
|
||||
shift
|
||||
$posix_glob && set +f
|
||||
IFS=$oIFS
|
||||
|
||||
prefixes=
|
||||
|
||||
for d
|
||||
do
|
||||
test -z "$d" && continue
|
||||
|
||||
prefix=$prefix$d
|
||||
if test -d "$prefix"; then
|
||||
prefixes=
|
||||
else
|
||||
if $posix_mkdir; then
|
||||
(umask=$mkdir_umask &&
|
||||
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
|
||||
# Don't fail if two instances are running concurrently.
|
||||
test -d "$prefix" || exit 1
|
||||
else
|
||||
case $prefix in
|
||||
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
|
||||
*) qprefix=$prefix;;
|
||||
esac
|
||||
prefixes="$prefixes '$qprefix'"
|
||||
fi
|
||||
fi
|
||||
prefix=$prefix/
|
||||
done
|
||||
|
||||
if test -n "$prefixes"; then
|
||||
# Don't fail if two instances are running concurrently.
|
||||
(umask $mkdir_umask &&
|
||||
eval "\$doit_exec \$mkdirprog $prefixes") ||
|
||||
test -d "$dstdir" || exit 1
|
||||
obsolete_mkdir_used=true
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if test -n "$dir_arg"; then
|
||||
{ test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
|
||||
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
|
||||
{ test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
|
||||
test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
|
||||
else
|
||||
|
||||
# Make a couple of temp file names in the proper directory.
|
||||
dsttmp=$dstdir/_inst.$$_
|
||||
rmtmp=$dstdir/_rm.$$_
|
||||
|
||||
# Trap to clean up those temp files at exit.
|
||||
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
|
||||
|
||||
# Copy the file name to the temp name.
|
||||
(umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
|
||||
|
||||
# and set any options; do chmod last to preserve setuid bits.
|
||||
#
|
||||
# If any of these fail, we abort the whole thing. If we want to
|
||||
# ignore errors from any of these, just make sure not to ignore
|
||||
# errors from the above "$doit $cpprog $src $dsttmp" command.
|
||||
#
|
||||
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
|
||||
&& { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
|
||||
&& { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
|
||||
&& { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
|
||||
|
||||
# Now rename the file to the real destination.
|
||||
{ $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null \
|
||||
|| {
|
||||
# The rename failed, perhaps because mv can't rename something else
|
||||
# to itself, or perhaps because mv is so ancient that it does not
|
||||
# support -f.
|
||||
|
||||
# Now remove or move aside any old file at destination location.
|
||||
# We try this two ways since rm can't unlink itself on some
|
||||
# systems and the destination file might be busy for other
|
||||
# reasons. In this case, the final cleanup might fail but the new
|
||||
# file should still install successfully.
|
||||
{
|
||||
if test -f "$dst"; then
|
||||
$doit $rmcmd -f "$dst" 2>/dev/null \
|
||||
|| { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null \
|
||||
&& { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }; }\
|
||||
|| {
|
||||
echo "$0: cannot unlink or rename $dst" >&2
|
||||
(exit 1); exit 1
|
||||
}
|
||||
else
|
||||
:
|
||||
fi
|
||||
} &&
|
||||
|
||||
# Now rename the file to the real destination.
|
||||
$doit $mvcmd "$dsttmp" "$dst"
|
||||
}
|
||||
} || exit 1
|
||||
|
||||
trap '' 0
|
||||
fi
|
||||
done
|
||||
|
||||
# Local variables:
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-end: "$"
|
||||
# End:
|
26
third_party/giflib/lib/Makefile.am
vendored
@ -1,26 +0,0 @@
|
||||
## Process this file with automake to produce a Makefile.in for libungif.
|
||||
|
||||
EXTRA_DIST = Makefile.unx
|
||||
|
||||
lib_LTLIBRARIES = libgif.la
|
||||
noinst_LIBRARIES = libgetarg.a
|
||||
|
||||
include_HEADERS = gif_lib.h
|
||||
|
||||
libgetarg_a_SOURCES = getarg.c getarg.h
|
||||
|
||||
libgif_la_SOURCES = dev2gif.c \
|
||||
dgif_lib.c \
|
||||
egif_lib.c \
|
||||
gif_err.c \
|
||||
gif_font.c \
|
||||
gif_hash.c \
|
||||
gif_hash.h \
|
||||
gifalloc.c \
|
||||
qprintf.c \
|
||||
quantize.c \
|
||||
gif_lib_private.h
|
||||
|
||||
libgif_la_LDFLAGS = -version-info 5:6:1
|
||||
libgif_la_LIBADD = @DEVS@
|
||||
libgif_CFLAGS = $(X_CFLAGS) $(AM_CFLAGS)
|
540
third_party/giflib/lib/Makefile.in
vendored
@ -1,540 +0,0 @@
|
||||
# Makefile.in generated by automake 1.10 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005, 2006 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@
|
||||
subdir = lib
|
||||
DIST_COMMON = $(include_HEADERS) $(srcdir)/Makefile.am \
|
||||
$(srcdir)/Makefile.in
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = $(top_builddir)/config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
LIBRARIES = $(noinst_LIBRARIES)
|
||||
ARFLAGS = cru
|
||||
libgetarg_a_AR = $(AR) $(ARFLAGS)
|
||||
libgetarg_a_LIBADD =
|
||||
am_libgetarg_a_OBJECTS = getarg.$(OBJEXT)
|
||||
libgetarg_a_OBJECTS = $(am_libgetarg_a_OBJECTS)
|
||||
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)$(libdir)" "$(DESTDIR)$(includedir)"
|
||||
libLTLIBRARIES_INSTALL = $(INSTALL)
|
||||
LTLIBRARIES = $(lib_LTLIBRARIES)
|
||||
libgif_la_DEPENDENCIES =
|
||||
am_libgif_la_OBJECTS = dev2gif.lo dgif_lib.lo egif_lib.lo gif_err.lo \
|
||||
gif_font.lo gif_hash.lo gifalloc.lo qprintf.lo quantize.lo
|
||||
libgif_la_OBJECTS = $(am_libgif_la_OBJECTS)
|
||||
libgif_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
|
||||
$(libgif_la_LDFLAGS) $(LDFLAGS) -o $@
|
||||
DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@
|
||||
depcomp = $(SHELL) $(top_srcdir)/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 = $(libgetarg_a_SOURCES) $(libgif_la_SOURCES)
|
||||
DIST_SOURCES = $(libgetarg_a_SOURCES) $(libgif_la_SOURCES)
|
||||
includeHEADERS_INSTALL = $(INSTALL_HEADER)
|
||||
HEADERS = $(include_HEADERS)
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMTAR = @AMTAR@
|
||||
AR = @AR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
COMPILABLE_EXTRAS = @COMPILABLE_EXTRAS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DEVS = @DEVS@
|
||||
ECHO = @ECHO@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
F77 = @F77@
|
||||
FFLAGS = @FFLAGS@
|
||||
GL_S_LIB = @GL_S_LIB@
|
||||
GREP = @GREP@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MATH_LIB = @MATH_LIB@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
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@
|
||||
RANLIB = @RANLIB@
|
||||
RLE_LIB = @RLE_LIB@
|
||||
SED = @SED@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
X11_LIB = @X11_LIB@
|
||||
XMKMF = @XMKMF@
|
||||
X_CFLAGS = @X_CFLAGS@
|
||||
X_EXTRA_LIBS = @X_EXTRA_LIBS@
|
||||
X_LIBS = @X_LIBS@
|
||||
X_PRE_LIBS = @X_PRE_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@
|
||||
EXTRA_DIST = Makefile.unx
|
||||
lib_LTLIBRARIES = libgif.la
|
||||
noinst_LIBRARIES = libgetarg.a
|
||||
include_HEADERS = gif_lib.h
|
||||
libgetarg_a_SOURCES = getarg.c getarg.h
|
||||
libgif_la_SOURCES = dev2gif.c \
|
||||
dgif_lib.c \
|
||||
egif_lib.c \
|
||||
gif_err.c \
|
||||
gif_font.c \
|
||||
gif_hash.c \
|
||||
gif_hash.h \
|
||||
gifalloc.c \
|
||||
qprintf.c \
|
||||
quantize.c \
|
||||
gif_lib_private.h
|
||||
|
||||
libgif_la_LDFLAGS = -version-info 5:6:1
|
||||
libgif_la_LIBADD = @DEVS@
|
||||
libgif_CFLAGS = $(X_CFLAGS) $(AM_CFLAGS)
|
||||
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 lib/Makefile'; \
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu lib/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
|
||||
|
||||
clean-noinstLIBRARIES:
|
||||
-test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
|
||||
libgetarg.a: $(libgetarg_a_OBJECTS) $(libgetarg_a_DEPENDENCIES)
|
||||
-rm -f libgetarg.a
|
||||
$(libgetarg_a_AR) libgetarg.a $(libgetarg_a_OBJECTS) $(libgetarg_a_LIBADD)
|
||||
$(RANLIB) libgetarg.a
|
||||
install-libLTLIBRARIES: $(lib_LTLIBRARIES)
|
||||
@$(NORMAL_INSTALL)
|
||||
test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"
|
||||
@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
|
||||
if test -f $$p; then \
|
||||
f=$(am__strip_dir) \
|
||||
echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \
|
||||
$(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \
|
||||
else :; fi; \
|
||||
done
|
||||
|
||||
uninstall-libLTLIBRARIES:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
|
||||
p=$(am__strip_dir) \
|
||||
echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \
|
||||
$(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \
|
||||
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
|
||||
libgif.la: $(libgif_la_OBJECTS) $(libgif_la_DEPENDENCIES)
|
||||
$(libgif_la_LINK) -rpath $(libdir) $(libgif_la_OBJECTS) $(libgif_la_LIBADD) $(LIBS)
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.$(OBJEXT)
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dev2gif.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dgif_lib.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/egif_lib.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getarg.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gif_err.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gif_font.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gif_hash.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gifalloc.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qprintf.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quantize.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 $@ $<
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
install-includeHEADERS: $(include_HEADERS)
|
||||
@$(NORMAL_INSTALL)
|
||||
test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)"
|
||||
@list='$(include_HEADERS)'; for p in $$list; do \
|
||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
||||
f=$(am__strip_dir) \
|
||||
echo " $(includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(includedir)/$$f'"; \
|
||||
$(includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(includedir)/$$f"; \
|
||||
done
|
||||
|
||||
uninstall-includeHEADERS:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(include_HEADERS)'; for p in $$list; do \
|
||||
f=$(am__strip_dir) \
|
||||
echo " rm -f '$(DESTDIR)$(includedir)/$$f'"; \
|
||||
rm -f "$(DESTDIR)$(includedir)/$$f"; \
|
||||
done
|
||||
|
||||
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; } \
|
||||
END { 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; } \
|
||||
END { 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=; \
|
||||
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; } \
|
||||
END { 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 $(LIBRARIES) $(LTLIBRARIES) $(HEADERS)
|
||||
installdirs:
|
||||
for dir in "$(DESTDIR)$(libdir)" "$(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)
|
||||
|
||||
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-libLTLIBRARIES clean-libtool \
|
||||
clean-noinstLIBRARIES 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-includeHEADERS
|
||||
|
||||
install-dvi: install-dvi-am
|
||||
|
||||
install-exec-am: install-libLTLIBRARIES
|
||||
|
||||
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-includeHEADERS uninstall-libLTLIBRARIES
|
||||
|
||||
.MAKE: install-am install-strip
|
||||
|
||||
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
|
||||
clean-libLTLIBRARIES clean-libtool clean-noinstLIBRARIES 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-includeHEADERS install-info install-info-am \
|
||||
install-libLTLIBRARIES install-man install-pdf install-pdf-am \
|
||||
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-includeHEADERS \
|
||||
uninstall-libLTLIBRARIES
|
||||
|
||||
# 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:
|
106
third_party/giflib/lib/Makefile.unx
vendored
@ -1,106 +0,0 @@
|
||||
#
|
||||
# This is the make file for the lib subdirectory of the GIF library
|
||||
# You'll need GNU gcc or some other ANSI-complient compiler.
|
||||
#
|
||||
# Gershon Elber, Jun 1989
|
||||
# * version number in ./lib/Makefile
|
||||
#
|
||||
V = 3.0
|
||||
|
||||
SHLIB = libgif.so.$(V)
|
||||
|
||||
#
|
||||
# Where all the include files are:
|
||||
INCS = -I.
|
||||
|
||||
LIBDIR = /usr/lib
|
||||
|
||||
#
|
||||
# What devices we should be able to grab into gif images. Note that if
|
||||
# you enable them the associated library must be available at link time.
|
||||
# Avaiable devices:
|
||||
# 1. EGA, VGA, SVGA (800x600), Hercules - all on IBM PC only.
|
||||
# 2. SGI 4D Irix using gl library (Add -D__SGI_GL__).
|
||||
# 3. X11 using libX.a (Add -D__X11__)
|
||||
DEVS = -D__X11__
|
||||
|
||||
#
|
||||
# These are the flags for gcc, in BSD4.3 or Sun O.S. 4.0.3
|
||||
#
|
||||
# If your system has all function prototypes for gcc, replace all
|
||||
# the -Wxxx with -Wall. I can not add -Wimplicit as my system uses old cc
|
||||
# h files.
|
||||
#
|
||||
# CC = gcc
|
||||
#
|
||||
# CFLAGS = -O -c -W -Wreturn-type -Wcomment
|
||||
# CFLAGS = -g -pg -c -W -Wreturn-type -Wcomment
|
||||
#
|
||||
# for sun 4 (gunnars@ifi.uib.no). Tested using gcc 1.39.
|
||||
#
|
||||
# CFLAGS = -O -c -sun4 -W -Wreturn-type -Wcomment -DUSE_VARARGS
|
||||
# CFLAGS = -g -c -sun4 -W -Wreturn-type -Wcomment -DUSE_VARARGS
|
||||
|
||||
#
|
||||
# These are the flags for cc on SGI iris4d. O.S. IRIX 3.2
|
||||
#
|
||||
# CC = cc
|
||||
#
|
||||
# CFLAGS = -O -c -DSYSV -DNO_VOID_PTR -DUSE_VARARGS -Olimit 1000 -Wf,-XNh5000 -Wf,-XNd5000 -G 4
|
||||
# CFLAGS = -g -p -c -DSYSV -DNO_VOID_PTR -DUSE_VARARGS -Olimit 1000 -Wf,-XNh5000 -Wf,-XNd5000 -G 4
|
||||
|
||||
#
|
||||
# These are the flags for xlc, ansi compiler for IBM R6000
|
||||
#
|
||||
# CC = xlc
|
||||
#
|
||||
# CFLAGS = -O -c -qnoro -D_POSIX_SOURCE -D_ALL_SOURCE -DR6000
|
||||
# CFLAGS = -g -pg -c -qnoro -D_POSIX_SOURCE -D_ALL_SOURCE -DR6000
|
||||
|
||||
#
|
||||
# GNU CC over Linux and XFree86
|
||||
#
|
||||
CC = gcc
|
||||
#
|
||||
#CFLAGS = -fno-builtin -O -c -W -Wreturn-type -Wcomment
|
||||
CFLAGS = -fno-builtin -g -c -W -Wreturn-type -Wcomment
|
||||
|
||||
|
||||
OBJS = dev2gif.o egif_lib.o dgif_lib.o gifalloc.o gif_font.o gif_hash.o \
|
||||
gif_err.o quantize.o qprintf.o getarg.o
|
||||
|
||||
.c.o:
|
||||
$(CC) $(INCS) $(DEVS) $(CFLAGS) $<
|
||||
|
||||
all: static shared
|
||||
|
||||
static: libgif.a
|
||||
shared: $(SHLIB)
|
||||
|
||||
libgif.a: $(OBJS)
|
||||
rm -f libgif.a
|
||||
ar rcv libgif.a $(OBJS)
|
||||
-ranlib libgif.a
|
||||
|
||||
$(SHLIB): $(OBJS)
|
||||
rm -f libgif.so.$(V)
|
||||
gcc -shared -o $(SHLIB) $(OBJS)
|
||||
|
||||
dev2gif.o: gif_lib.h
|
||||
egif_lib.o: gif_lib.h gif_hash.h
|
||||
dgif_lib.o: gif_lib.h gif_hash.h
|
||||
gif_hash.o: gif_lib.h gif_hash.h
|
||||
gif_err.o: gif_lib.h
|
||||
gifalloc.o: gif_lib.h
|
||||
gif_font.o: gif_lib.h
|
||||
quantize.o: gif_lib.h
|
||||
qprintf.o: gif_lib.h
|
||||
getarg.o: getarg.h
|
||||
|
||||
install-lib: libgif.a
|
||||
cp libgif.a libgif.so.$(V) $(LIBDIR)
|
||||
|
||||
uninstall-lib: shared static
|
||||
rm -f $(LIBDIR)/libgif.a $(LIBDIR)/$(SHLIB)
|
||||
clean:
|
||||
rm -f *.[oa] *~ libgif.so.$(V)
|
6909
third_party/giflib/ltmain.sh
vendored
367
third_party/giflib/missing
vendored
@ -1,367 +0,0 @@
|
||||
#! /bin/sh
|
||||
# Common stub for a few missing GNU programs while installing.
|
||||
|
||||
scriptversion=2006-05-10.23
|
||||
|
||||
# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006
|
||||
# Free Software Foundation, Inc.
|
||||
# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
|
||||
|
||||
# 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 2, 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, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
# 02110-1301, USA.
|
||||
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
if test $# -eq 0; then
|
||||
echo 1>&2 "Try \`$0 --help' for more information"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
run=:
|
||||
sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
|
||||
sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
|
||||
|
||||
# In the cases where this matters, `missing' is being run in the
|
||||
# srcdir already.
|
||||
if test -f configure.ac; then
|
||||
configure_ac=configure.ac
|
||||
else
|
||||
configure_ac=configure.in
|
||||
fi
|
||||
|
||||
msg="missing on your system"
|
||||
|
||||
case $1 in
|
||||
--run)
|
||||
# Try to run requested program, and just exit if it succeeds.
|
||||
run=
|
||||
shift
|
||||
"$@" && exit 0
|
||||
# Exit code 63 means version mismatch. This often happens
|
||||
# when the user try to use an ancient version of a tool on
|
||||
# a file that requires a minimum version. In this case we
|
||||
# we should proceed has if the program had been absent, or
|
||||
# if --run hadn't been passed.
|
||||
if test $? = 63; then
|
||||
run=:
|
||||
msg="probably too old"
|
||||
fi
|
||||
;;
|
||||
|
||||
-h|--h|--he|--hel|--help)
|
||||
echo "\
|
||||
$0 [OPTION]... PROGRAM [ARGUMENT]...
|
||||
|
||||
Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
|
||||
error status if there is no known handling for PROGRAM.
|
||||
|
||||
Options:
|
||||
-h, --help display this help and exit
|
||||
-v, --version output version information and exit
|
||||
--run try to run the given command, and emulate it if it fails
|
||||
|
||||
Supported PROGRAM values:
|
||||
aclocal touch file \`aclocal.m4'
|
||||
autoconf touch file \`configure'
|
||||
autoheader touch file \`config.h.in'
|
||||
autom4te touch the output file, or create a stub one
|
||||
automake touch all \`Makefile.in' files
|
||||
bison create \`y.tab.[ch]', if possible, from existing .[ch]
|
||||
flex create \`lex.yy.c', if possible, from existing .c
|
||||
help2man touch the output file
|
||||
lex create \`lex.yy.c', if possible, from existing .c
|
||||
makeinfo touch the output file
|
||||
tar try tar, gnutar, gtar, then tar without non-portable flags
|
||||
yacc create \`y.tab.[ch]', if possible, from existing .[ch]
|
||||
|
||||
Send bug reports to <bug-automake@gnu.org>."
|
||||
exit $?
|
||||
;;
|
||||
|
||||
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
|
||||
echo "missing $scriptversion (GNU Automake)"
|
||||
exit $?
|
||||
;;
|
||||
|
||||
-*)
|
||||
echo 1>&2 "$0: Unknown \`$1' option"
|
||||
echo 1>&2 "Try \`$0 --help' for more information"
|
||||
exit 1
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
# Now exit if we have it, but it failed. Also exit now if we
|
||||
# don't have it and --version was passed (most likely to detect
|
||||
# the program).
|
||||
case $1 in
|
||||
lex|yacc)
|
||||
# Not GNU programs, they don't have --version.
|
||||
;;
|
||||
|
||||
tar)
|
||||
if test -n "$run"; then
|
||||
echo 1>&2 "ERROR: \`tar' requires --run"
|
||||
exit 1
|
||||
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
|
||||
*)
|
||||
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
|
||||
# We have it, but it failed.
|
||||
exit 1
|
||||
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
|
||||
# Could not run --version or --help. This is probably someone
|
||||
# running `$TOOL --version' or `$TOOL --help' to check whether
|
||||
# $TOOL exists and not knowing $TOOL uses missing.
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
# If it does not exist, or fails to run (possibly an outdated version),
|
||||
# try to emulate it.
|
||||
case $1 in
|
||||
aclocal*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified \`acinclude.m4' or \`${configure_ac}'. You might want
|
||||
to install the \`Automake' and \`Perl' packages. Grab them from
|
||||
any GNU archive site."
|
||||
touch aclocal.m4
|
||||
;;
|
||||
|
||||
autoconf)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified \`${configure_ac}'. You might want to install the
|
||||
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
|
||||
archive site."
|
||||
touch configure
|
||||
;;
|
||||
|
||||
autoheader)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified \`acconfig.h' or \`${configure_ac}'. You might want
|
||||
to install the \`Autoconf' and \`GNU m4' packages. Grab them
|
||||
from any GNU archive site."
|
||||
files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
|
||||
test -z "$files" && files="config.h"
|
||||
touch_files=
|
||||
for f in $files; do
|
||||
case $f in
|
||||
*:*) touch_files="$touch_files "`echo "$f" |
|
||||
sed -e 's/^[^:]*://' -e 's/:.*//'`;;
|
||||
*) touch_files="$touch_files $f.in";;
|
||||
esac
|
||||
done
|
||||
touch $touch_files
|
||||
;;
|
||||
|
||||
automake*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
|
||||
You might want to install the \`Automake' and \`Perl' packages.
|
||||
Grab them from any GNU archive site."
|
||||
find . -type f -name Makefile.am -print |
|
||||
sed 's/\.am$/.in/' |
|
||||
while read f; do touch "$f"; done
|
||||
;;
|
||||
|
||||
autom4te)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is needed, but is $msg.
|
||||
You might have modified some files without having the
|
||||
proper tools for further handling them.
|
||||
You can get \`$1' as part of \`Autoconf' from any GNU
|
||||
archive site."
|
||||
|
||||
file=`echo "$*" | sed -n "$sed_output"`
|
||||
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
|
||||
if test -f "$file"; then
|
||||
touch $file
|
||||
else
|
||||
test -z "$file" || exec >$file
|
||||
echo "#! /bin/sh"
|
||||
echo "# Created by GNU Automake missing as a replacement of"
|
||||
echo "# $ $@"
|
||||
echo "exit 0"
|
||||
chmod +x $file
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
|
||||
bison|yacc)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' $msg. You should only need it if
|
||||
you modified a \`.y' file. You may need the \`Bison' package
|
||||
in order for those modifications to take effect. You can get
|
||||
\`Bison' from any GNU archive site."
|
||||
rm -f y.tab.c y.tab.h
|
||||
if test $# -ne 1; then
|
||||
eval LASTARG="\${$#}"
|
||||
case $LASTARG in
|
||||
*.y)
|
||||
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
|
||||
if test -f "$SRCFILE"; then
|
||||
cp "$SRCFILE" y.tab.c
|
||||
fi
|
||||
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
|
||||
if test -f "$SRCFILE"; then
|
||||
cp "$SRCFILE" y.tab.h
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
if test ! -f y.tab.h; then
|
||||
echo >y.tab.h
|
||||
fi
|
||||
if test ! -f y.tab.c; then
|
||||
echo 'main() { return 0; }' >y.tab.c
|
||||
fi
|
||||
;;
|
||||
|
||||
lex|flex)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified a \`.l' file. You may need the \`Flex' package
|
||||
in order for those modifications to take effect. You can get
|
||||
\`Flex' from any GNU archive site."
|
||||
rm -f lex.yy.c
|
||||
if test $# -ne 1; then
|
||||
eval LASTARG="\${$#}"
|
||||
case $LASTARG in
|
||||
*.l)
|
||||
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
|
||||
if test -f "$SRCFILE"; then
|
||||
cp "$SRCFILE" lex.yy.c
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
if test ! -f lex.yy.c; then
|
||||
echo 'main() { return 0; }' >lex.yy.c
|
||||
fi
|
||||
;;
|
||||
|
||||
help2man)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified a dependency of a manual page. You may need the
|
||||
\`Help2man' package in order for those modifications to take
|
||||
effect. You can get \`Help2man' from any GNU archive site."
|
||||
|
||||
file=`echo "$*" | sed -n "$sed_output"`
|
||||
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
|
||||
if test -f "$file"; then
|
||||
touch $file
|
||||
else
|
||||
test -z "$file" || exec >$file
|
||||
echo ".ab help2man is required to generate this page"
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
|
||||
makeinfo)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified a \`.texi' or \`.texinfo' file, or any other file
|
||||
indirectly affecting the aspect of the manual. The spurious
|
||||
call might also be the consequence of using a buggy \`make' (AIX,
|
||||
DU, IRIX). You might want to install the \`Texinfo' package or
|
||||
the \`GNU make' package. Grab either from any GNU archive site."
|
||||
# The file to touch is that specified with -o ...
|
||||
file=`echo "$*" | sed -n "$sed_output"`
|
||||
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
|
||||
if test -z "$file"; then
|
||||
# ... or it is the one specified with @setfilename ...
|
||||
infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
|
||||
file=`sed -n '
|
||||
/^@setfilename/{
|
||||
s/.* \([^ ]*\) *$/\1/
|
||||
p
|
||||
q
|
||||
}' $infile`
|
||||
# ... or it is derived from the source name (dir/f.texi becomes f.info)
|
||||
test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
|
||||
fi
|
||||
# If the file does not exist, the user really needs makeinfo;
|
||||
# let's fail without touching anything.
|
||||
test -f $file || exit 1
|
||||
touch $file
|
||||
;;
|
||||
|
||||
tar)
|
||||
shift
|
||||
|
||||
# We have already tried tar in the generic part.
|
||||
# Look for gnutar/gtar before invocation to avoid ugly error
|
||||
# messages.
|
||||
if (gnutar --version > /dev/null 2>&1); then
|
||||
gnutar "$@" && exit 0
|
||||
fi
|
||||
if (gtar --version > /dev/null 2>&1); then
|
||||
gtar "$@" && exit 0
|
||||
fi
|
||||
firstarg="$1"
|
||||
if shift; then
|
||||
case $firstarg in
|
||||
*o*)
|
||||
firstarg=`echo "$firstarg" | sed s/o//`
|
||||
tar "$firstarg" "$@" && exit 0
|
||||
;;
|
||||
esac
|
||||
case $firstarg in
|
||||
*h*)
|
||||
firstarg=`echo "$firstarg" | sed s/h//`
|
||||
tar "$firstarg" "$@" && exit 0
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
echo 1>&2 "\
|
||||
WARNING: I can't seem to be able to run \`tar' with the given arguments.
|
||||
You may want to install GNU tar or Free paxutils, or check the
|
||||
command line arguments."
|
||||
exit 1
|
||||
;;
|
||||
|
||||
*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is needed, and is $msg.
|
||||
You might have modified some files without having the
|
||||
proper tools for further handling them. Check the \`README' file,
|
||||
it often tells you about the needed prerequisites for installing
|
||||
this package. You may also peek at any GNU archive site, in case
|
||||
some other package would contain this missing \`$1' program."
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
||||
# Local variables:
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-end: "$"
|
||||
# End:
|
7
third_party/giflib/pic/Makefile.am
vendored
@ -1,7 +0,0 @@
|
||||
EXTRA_DIST = NOTES \
|
||||
cover.gif \
|
||||
porsche.gif \
|
||||
solid2.gif \
|
||||
welcome2.gif \
|
||||
x-trans.gif \
|
||||
sample.ico
|
339
third_party/giflib/pic/Makefile.in
vendored
@ -1,339 +0,0 @@
|
||||
# Makefile.in generated by automake 1.10 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005, 2006 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@
|
||||
subdir = pic
|
||||
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = $(top_builddir)/config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
SOURCES =
|
||||
DIST_SOURCES =
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMTAR = @AMTAR@
|
||||
AR = @AR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
COMPILABLE_EXTRAS = @COMPILABLE_EXTRAS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DEVS = @DEVS@
|
||||
ECHO = @ECHO@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
F77 = @F77@
|
||||
FFLAGS = @FFLAGS@
|
||||
GL_S_LIB = @GL_S_LIB@
|
||||
GREP = @GREP@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MATH_LIB = @MATH_LIB@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
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@
|
||||
RANLIB = @RANLIB@
|
||||
RLE_LIB = @RLE_LIB@
|
||||
SED = @SED@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
X11_LIB = @X11_LIB@
|
||||
XMKMF = @XMKMF@
|
||||
X_CFLAGS = @X_CFLAGS@
|
||||
X_EXTRA_LIBS = @X_EXTRA_LIBS@
|
||||
X_LIBS = @X_LIBS@
|
||||
X_PRE_LIBS = @X_PRE_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@
|
||||
EXTRA_DIST = NOTES \
|
||||
cover.gif \
|
||||
porsche.gif \
|
||||
solid2.gif \
|
||||
welcome2.gif \
|
||||
x-trans.gif \
|
||||
sample.ico
|
||||
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
$(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 pic/Makefile'; \
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu pic/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
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
tags: TAGS
|
||||
TAGS:
|
||||
|
||||
ctags: CTAGS
|
||||
CTAGS:
|
||||
|
||||
|
||||
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
|
||||
installdirs:
|
||||
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 mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-generic
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am:
|
||||
|
||||
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 -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am:
|
||||
|
||||
.MAKE: install-am install-strip
|
||||
|
||||
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
|
||||
distclean distclean-generic distclean-libtool 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-ps install-ps-am install-strip \
|
||||
installcheck installcheck-am installdirs maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-generic \
|
||||
mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am
|
||||
|
||||
# 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:
|
6
third_party/giflib/pic/NOTES
vendored
@ -1,6 +0,0 @@
|
||||
Gershon wrote:
|
||||
|
||||
Only one of the images on .\pic was actually generated by me -
|
||||
solid2.gif, which is binary image rendered using a solid modeller I have
|
||||
developed named IRIT. The other two were released to usenet few month ago.
|
||||
I do not think so, but let me know if I violate anything here.
|
BIN
third_party/giflib/pic/cover.gif
vendored
Before Width: | Height: | Size: 13 KiB |
BIN
third_party/giflib/pic/porsche.gif
vendored
Before Width: | Height: | Size: 6.0 KiB |
86
third_party/giflib/pic/sample.ico
vendored
@ -1,86 +0,0 @@
|
||||
#
|
||||
# Example icon file
|
||||
#
|
||||
screen width 640
|
||||
screen height 480
|
||||
screen colors 16
|
||||
screen background 0
|
||||
|
||||
screen map
|
||||
rgb 0 0 0 is . # Black
|
||||
rgb 0 0 170 is 1 # Blue
|
||||
rgb 0 170 0 is 2 # Green
|
||||
rgb 0 170 170 is 3 # Cyan
|
||||
rgb 170 0 0 is 4 # Red
|
||||
rgb 170 0 170 is 5 # Magenta
|
||||
rgb 170 170 0 is 6 # Brown
|
||||
rgb 170 170 170 is 7 # LightGray
|
||||
rgb 85 85 85 is X # DarkGray
|
||||
rgb 85 85 255 is 9 # LightBlue
|
||||
rgb 85 255 85 is A # LightGreen
|
||||
rgb 85 255 255 is # # LightCyan
|
||||
rgb 255 85 85 is C # LightRed
|
||||
rgb 255 85 255 is D # LightMagenta
|
||||
rgb 255 255 85 is E # Yellow
|
||||
rgb 255 255 255 is F # White
|
||||
end
|
||||
|
||||
include solid2.gif # Use as 1st image
|
||||
|
||||
#
|
||||
# Shield
|
||||
#
|
||||
image
|
||||
image top 30
|
||||
image left 50
|
||||
image bits 16 by 16
|
||||
################
|
||||
################
|
||||
##XXX######XXX##
|
||||
##XXXXXXXXXXXX##
|
||||
###XXXXXXXXXX###
|
||||
###XXXXXXXXXX###
|
||||
###XXXXXXXXXX###
|
||||
###XXXXXXXXXX###
|
||||
###XXXXXXXXXX###
|
||||
###XXXXXXXXXX###
|
||||
###XXXXXXXXXX###
|
||||
####XXXXXXXX####
|
||||
#####XXXXXX#####
|
||||
######XXXX######
|
||||
################
|
||||
################
|
||||
|
||||
extension fe # Matches conventions used elsewhere in giflib
|
||||
This is a klugey way of embedding a comment in the GIF.
|
||||
end
|
||||
|
||||
#
|
||||
# Questionmark
|
||||
#
|
||||
image
|
||||
image top 30
|
||||
image left 500
|
||||
image bits 16 by 16
|
||||
......XXXXX.....
|
||||
.....XXXXXXX....
|
||||
....XXX..XXXX...
|
||||
...XXX....XXXX..
|
||||
...XXX....XXXX..
|
||||
....XX...XXXX...
|
||||
........XXXX....
|
||||
.......XXXX.....
|
||||
......XXXX......
|
||||
......XXXX......
|
||||
......XXXX......
|
||||
................
|
||||
.......XX.......
|
||||
......XXXX......
|
||||
......XXXX......
|
||||
.......XX.......
|
||||
|
||||
# The following sets edit modes for GNU EMACS
|
||||
# Local Variables:
|
||||
# mode:picture
|
||||
# truncate-lines:t
|
||||
# End:
|
BIN
third_party/giflib/pic/solid2.gif
vendored
Before Width: | Height: | Size: 18 KiB |
BIN
third_party/giflib/pic/welcome2.gif
vendored
Before Width: | Height: | Size: 36 KiB |
BIN
third_party/giflib/pic/x-trans.gif
vendored
Before Width: | Height: | Size: 1.1 KiB |
69
third_party/giflib/test-unx
vendored
@ -1,69 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Tests for the GIFLIB utilities.
|
||||
# Usage:
|
||||
# test-unx [display_prgm]
|
||||
#
|
||||
# This test assumes the gif_lib utilities are available from one of the
|
||||
# path directories, and that GIF_DIR is set (directly or through command line)
|
||||
# to the directory holding these gif files:
|
||||
# 1. solid2.gif
|
||||
# 2. cover.gif
|
||||
# 3. porsche.gif
|
||||
# In addition, set GIF_DISPLAY ( directly or through command line) to the
|
||||
# program to display gif files in our system.
|
||||
#
|
||||
# Gershon Elber, Feb 90. Rewritten by Eric Raymond, December 1995.
|
||||
# Revised by Toshio Kuratomi December 1998.
|
||||
PATH=$PATH:./util:${SRCDIR}/util
|
||||
GIF_DIR=${SRCDIR}./pic
|
||||
GIF_DISPLAY=${1:-"xv -"}
|
||||
GIF_DISPLAY=${GIF_DISPLAY:-"gif2x11"}
|
||||
#GIF_DIR=${1:-./pic}
|
||||
#GIF_DISPLAY=${2:-gif2x11}
|
||||
|
||||
echo "The Porsche."
|
||||
echo "$GIF_DISPLAY <$GIF_DIR/porsche.gif"
|
||||
|
||||
echo "The Porsche composited with a generated background"
|
||||
util/gifbg -d tl -s 320 200 -c 255 255 255 -l 64 > bg1.gif
|
||||
util/gifcomb $GIF_DIR/porsche.gif bg1.gif | $GIF_DISPLAY
|
||||
rm -f bg1.gif
|
||||
|
||||
echo "Color density report on the TNHD cover image"
|
||||
util/gifhisto -t $GIF_DIR/cover.gif | sort -r | more
|
||||
|
||||
echo "Color histogram of the Porsche image"
|
||||
util/gifhisto -b -s 200 512 $GIF_DIR/porsche.gif | util/gifflip -l | $GIF_DISPLAY
|
||||
|
||||
echo "The #2 solid flipped on its side"
|
||||
util/gifflip -r $GIF_DIR/solid2.gif | util/gifrsize | $GIF_DISPLAY
|
||||
|
||||
echo "TNHD cover flipped on its side"
|
||||
util/gifflip -x $GIF_DIR/cover.gif | $GIF_DISPLAY
|
||||
|
||||
echo "Scale the #2 solid by 0.45"
|
||||
cp $GIF_DIR/solid2.gif sall.gif
|
||||
util/gifrsize -s 0.45 sall.gif | $GIF_DISPLAY
|
||||
rm -f s?.gif sall.gif
|
||||
|
||||
echo "Reposition the Porsche image"
|
||||
util/gifpos -s 720 348 -i 400 148 $GIF_DIR/porsche.gif | $GIF_DISPLAY
|
||||
|
||||
echo "Resize the #2 solid image"
|
||||
util/gifrsize -S 800 600 $GIF_DIR/solid2.gif | $GIF_DISPLAY
|
||||
|
||||
echo "Clip, crop, and resize the #2 solid image"
|
||||
util/gifclip -i 222 0 390 134 $GIF_DIR/solid2.gif | util/gifpos -s 169 135 | util/gifrsize -s 2.0 | $GIF_DISPLAY
|
||||
|
||||
echo "Rotate the cover image by 45 degrees"
|
||||
util/gifrotat -a 45 $GIF_DIR/cover.gif | $GIF_DISPLAY
|
||||
|
||||
echo "Copy the Porsche image (test DGifSlurp and DGifSpew)"
|
||||
util/gifspnge <$GIF_DIR/porsche.gif | $GIF_DISPLAY
|
||||
|
||||
echo "Copy a transparent image (test extensions)"
|
||||
util/gifspnge <$GIF_DIR/x-trans.gif |$GIF_DISPLAY
|
||||
|
||||
# echo "Copy an animated gif, that has shared colour maps"
|
||||
util/gifspnge <$GIF_DIR/welcome2.gif | $GIF_DISPLAY
|
58
third_party/giflib/util/Makefile.am
vendored
@ -1,58 +0,0 @@
|
||||
|
||||
bin_PROGRAMS = gif2epsn gif2ps gif2rgb gifasm gifbg gifclip gifcomb \
|
||||
giffix gifflip gifhisto gifinter gifinto gifovly gifpos gifrsize \
|
||||
giftext gifwedge raw2gif rgb2gif text2gif gifspnge giffiltr \
|
||||
icon2gif gifcolor gifinfo @COMPILABLE_EXTRAS@
|
||||
bin_SCRIPTS = gifcompose gifburst
|
||||
EXTRA_PROGRAMS = gif2rle rle2gif gif2iris gif2x11 gifclrmp gifrotat
|
||||
|
||||
EXTRA_DIST=Makefile.unx $(bin_SCRIPTS)
|
||||
|
||||
LDADD = ../lib/libgif.la ../lib/libgetarg.a
|
||||
|
||||
AM_CPPFLAGS = -I$(srcdir) -I$(top_srcdir)/lib
|
||||
|
||||
gif2rle_SOURCES = gif2rle.c
|
||||
gif2rle_LDADD = $(LDADD) @RLE_LIB@
|
||||
|
||||
rle2gif_SOURCES = rle2gif.c
|
||||
rle2gif_LDADD = $(LDADD) @RLE_LIB@
|
||||
|
||||
gif2iris_SOURCES = gif2iris.c
|
||||
gif2iris_LDADD = $(LDADD) @GL_S_LIB@
|
||||
|
||||
gif2x11_SOURCES = gif2x11.c
|
||||
gif2x11_LDADD = $(LDADD) @X11_LIB@
|
||||
gif2x11_CFLAGS = @X_CFLAGS@ $(AM_CFLAGS)
|
||||
|
||||
gifclrmp_SOURCES = gifclrmp.c
|
||||
gifclrmp_LDADD = $(LDADD) @MATH_LIB@
|
||||
|
||||
gifrotat_SOURCES = gifrotat.c
|
||||
gifrotat_LDADD = $(LDADD) @MATH_LIB@
|
||||
|
||||
gifinfo_SOURCES = gifinfo.c
|
||||
gif2epsn_SOURCES = gif2epsn.c
|
||||
gif2ps_SOURCES = gif2ps.c
|
||||
gif2rgb_SOURCES = gif2rgb.c
|
||||
gifasm_SOURCES = gifasm.c
|
||||
gifbg_SOURCES = gifbg.c
|
||||
gifclip_SOURCES = gifclip.c
|
||||
gifcomb_SOURCES = gifcomb.c
|
||||
giffix_SOURCES = giffix.c
|
||||
gifflip_SOURCES = gifflip.c
|
||||
gifhisto_SOURCES = gifhisto.c
|
||||
gifinter_SOURCES = gifinter.c
|
||||
gifinto_SOURCES = gifinto.c
|
||||
gifovly_SOURCES = gifovly.c
|
||||
gifpos_SOURCES = gifpos.c
|
||||
gifrsize_SOURCES = gifrsize.c
|
||||
giftext_SOURCES = giftext.c
|
||||
gifwedge_SOURCES = gifwedge.c
|
||||
raw2gif_SOURCES = raw2gif.c
|
||||
rgb2gif_SOURCES = rgb2gif.c
|
||||
text2gif_SOURCES = text2gif.c
|
||||
gifspnge_SOURCES = gifspnge.c
|
||||
giffiltr_SOURCES = giffiltr.c
|
||||
icon2gif_SOURCES = icon2gif.c
|
||||
gifcolor_SOURCES = gifcolor.c
|
813
third_party/giflib/util/Makefile.in
vendored
@ -1,813 +0,0 @@
|
||||
# Makefile.in generated by automake 1.10 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005, 2006 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@
|
||||
bin_PROGRAMS = gif2epsn$(EXEEXT) gif2ps$(EXEEXT) gif2rgb$(EXEEXT) \
|
||||
gifasm$(EXEEXT) gifbg$(EXEEXT) gifclip$(EXEEXT) \
|
||||
gifcomb$(EXEEXT) giffix$(EXEEXT) gifflip$(EXEEXT) \
|
||||
gifhisto$(EXEEXT) gifinter$(EXEEXT) gifinto$(EXEEXT) \
|
||||
gifovly$(EXEEXT) gifpos$(EXEEXT) gifrsize$(EXEEXT) \
|
||||
giftext$(EXEEXT) gifwedge$(EXEEXT) raw2gif$(EXEEXT) \
|
||||
rgb2gif$(EXEEXT) text2gif$(EXEEXT) gifspnge$(EXEEXT) \
|
||||
giffiltr$(EXEEXT) icon2gif$(EXEEXT) gifcolor$(EXEEXT) \
|
||||
gifinfo$(EXEEXT) @COMPILABLE_EXTRAS@
|
||||
EXTRA_PROGRAMS = gif2rle$(EXEEXT) rle2gif$(EXEEXT) gif2iris$(EXEEXT) \
|
||||
gif2x11$(EXEEXT) gifclrmp$(EXEEXT) gifrotat$(EXEEXT)
|
||||
subdir = util
|
||||
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = $(top_builddir)/config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)"
|
||||
binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
|
||||
PROGRAMS = $(bin_PROGRAMS)
|
||||
am_gif2epsn_OBJECTS = gif2epsn.$(OBJEXT)
|
||||
gif2epsn_OBJECTS = $(am_gif2epsn_OBJECTS)
|
||||
gif2epsn_LDADD = $(LDADD)
|
||||
gif2epsn_DEPENDENCIES = ../lib/libgif.la ../lib/libgetarg.a
|
||||
am_gif2iris_OBJECTS = gif2iris.$(OBJEXT)
|
||||
gif2iris_OBJECTS = $(am_gif2iris_OBJECTS)
|
||||
gif2iris_DEPENDENCIES = $(LDADD)
|
||||
am_gif2ps_OBJECTS = gif2ps.$(OBJEXT)
|
||||
gif2ps_OBJECTS = $(am_gif2ps_OBJECTS)
|
||||
gif2ps_LDADD = $(LDADD)
|
||||
gif2ps_DEPENDENCIES = ../lib/libgif.la ../lib/libgetarg.a
|
||||
am_gif2rgb_OBJECTS = gif2rgb.$(OBJEXT)
|
||||
gif2rgb_OBJECTS = $(am_gif2rgb_OBJECTS)
|
||||
gif2rgb_LDADD = $(LDADD)
|
||||
gif2rgb_DEPENDENCIES = ../lib/libgif.la ../lib/libgetarg.a
|
||||
am_gif2rle_OBJECTS = gif2rle.$(OBJEXT)
|
||||
gif2rle_OBJECTS = $(am_gif2rle_OBJECTS)
|
||||
gif2rle_DEPENDENCIES = $(LDADD)
|
||||
am_gif2x11_OBJECTS = gif2x11-gif2x11.$(OBJEXT)
|
||||
gif2x11_OBJECTS = $(am_gif2x11_OBJECTS)
|
||||
gif2x11_DEPENDENCIES = $(LDADD)
|
||||
gif2x11_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
|
||||
--mode=link $(CCLD) $(gif2x11_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
|
||||
$(LDFLAGS) -o $@
|
||||
am_gifasm_OBJECTS = gifasm.$(OBJEXT)
|
||||
gifasm_OBJECTS = $(am_gifasm_OBJECTS)
|
||||
gifasm_LDADD = $(LDADD)
|
||||
gifasm_DEPENDENCIES = ../lib/libgif.la ../lib/libgetarg.a
|
||||
am_gifbg_OBJECTS = gifbg.$(OBJEXT)
|
||||
gifbg_OBJECTS = $(am_gifbg_OBJECTS)
|
||||
gifbg_LDADD = $(LDADD)
|
||||
gifbg_DEPENDENCIES = ../lib/libgif.la ../lib/libgetarg.a
|
||||
am_gifclip_OBJECTS = gifclip.$(OBJEXT)
|
||||
gifclip_OBJECTS = $(am_gifclip_OBJECTS)
|
||||
gifclip_LDADD = $(LDADD)
|
||||
gifclip_DEPENDENCIES = ../lib/libgif.la ../lib/libgetarg.a
|
||||
am_gifclrmp_OBJECTS = gifclrmp.$(OBJEXT)
|
||||
gifclrmp_OBJECTS = $(am_gifclrmp_OBJECTS)
|
||||
gifclrmp_DEPENDENCIES = $(LDADD)
|
||||
am_gifcolor_OBJECTS = gifcolor.$(OBJEXT)
|
||||
gifcolor_OBJECTS = $(am_gifcolor_OBJECTS)
|
||||
gifcolor_LDADD = $(LDADD)
|
||||
gifcolor_DEPENDENCIES = ../lib/libgif.la ../lib/libgetarg.a
|
||||
am_gifcomb_OBJECTS = gifcomb.$(OBJEXT)
|
||||
gifcomb_OBJECTS = $(am_gifcomb_OBJECTS)
|
||||
gifcomb_LDADD = $(LDADD)
|
||||
gifcomb_DEPENDENCIES = ../lib/libgif.la ../lib/libgetarg.a
|
||||
am_giffiltr_OBJECTS = giffiltr.$(OBJEXT)
|
||||
giffiltr_OBJECTS = $(am_giffiltr_OBJECTS)
|
||||
giffiltr_LDADD = $(LDADD)
|
||||
giffiltr_DEPENDENCIES = ../lib/libgif.la ../lib/libgetarg.a
|
||||
am_giffix_OBJECTS = giffix.$(OBJEXT)
|
||||
giffix_OBJECTS = $(am_giffix_OBJECTS)
|
||||
giffix_LDADD = $(LDADD)
|
||||
giffix_DEPENDENCIES = ../lib/libgif.la ../lib/libgetarg.a
|
||||
am_gifflip_OBJECTS = gifflip.$(OBJEXT)
|
||||
gifflip_OBJECTS = $(am_gifflip_OBJECTS)
|
||||
gifflip_LDADD = $(LDADD)
|
||||
gifflip_DEPENDENCIES = ../lib/libgif.la ../lib/libgetarg.a
|
||||
am_gifhisto_OBJECTS = gifhisto.$(OBJEXT)
|
||||
gifhisto_OBJECTS = $(am_gifhisto_OBJECTS)
|
||||
gifhisto_LDADD = $(LDADD)
|
||||
gifhisto_DEPENDENCIES = ../lib/libgif.la ../lib/libgetarg.a
|
||||
am_gifinfo_OBJECTS = gifinfo.$(OBJEXT)
|
||||
gifinfo_OBJECTS = $(am_gifinfo_OBJECTS)
|
||||
gifinfo_LDADD = $(LDADD)
|
||||
gifinfo_DEPENDENCIES = ../lib/libgif.la ../lib/libgetarg.a
|
||||
am_gifinter_OBJECTS = gifinter.$(OBJEXT)
|
||||
gifinter_OBJECTS = $(am_gifinter_OBJECTS)
|
||||
gifinter_LDADD = $(LDADD)
|
||||
gifinter_DEPENDENCIES = ../lib/libgif.la ../lib/libgetarg.a
|
||||
am_gifinto_OBJECTS = gifinto.$(OBJEXT)
|
||||
gifinto_OBJECTS = $(am_gifinto_OBJECTS)
|
||||
gifinto_LDADD = $(LDADD)
|
||||
gifinto_DEPENDENCIES = ../lib/libgif.la ../lib/libgetarg.a
|
||||
am_gifovly_OBJECTS = gifovly.$(OBJEXT)
|
||||
gifovly_OBJECTS = $(am_gifovly_OBJECTS)
|
||||
gifovly_LDADD = $(LDADD)
|
||||
gifovly_DEPENDENCIES = ../lib/libgif.la ../lib/libgetarg.a
|
||||
am_gifpos_OBJECTS = gifpos.$(OBJEXT)
|
||||
gifpos_OBJECTS = $(am_gifpos_OBJECTS)
|
||||
gifpos_LDADD = $(LDADD)
|
||||
gifpos_DEPENDENCIES = ../lib/libgif.la ../lib/libgetarg.a
|
||||
am_gifrotat_OBJECTS = gifrotat.$(OBJEXT)
|
||||
gifrotat_OBJECTS = $(am_gifrotat_OBJECTS)
|
||||
gifrotat_DEPENDENCIES = $(LDADD)
|
||||
am_gifrsize_OBJECTS = gifrsize.$(OBJEXT)
|
||||
gifrsize_OBJECTS = $(am_gifrsize_OBJECTS)
|
||||
gifrsize_LDADD = $(LDADD)
|
||||
gifrsize_DEPENDENCIES = ../lib/libgif.la ../lib/libgetarg.a
|
||||
am_gifspnge_OBJECTS = gifspnge.$(OBJEXT)
|
||||
gifspnge_OBJECTS = $(am_gifspnge_OBJECTS)
|
||||
gifspnge_LDADD = $(LDADD)
|
||||
gifspnge_DEPENDENCIES = ../lib/libgif.la ../lib/libgetarg.a
|
||||
am_giftext_OBJECTS = giftext.$(OBJEXT)
|
||||
giftext_OBJECTS = $(am_giftext_OBJECTS)
|
||||
giftext_LDADD = $(LDADD)
|
||||
giftext_DEPENDENCIES = ../lib/libgif.la ../lib/libgetarg.a
|
||||
am_gifwedge_OBJECTS = gifwedge.$(OBJEXT)
|
||||
gifwedge_OBJECTS = $(am_gifwedge_OBJECTS)
|
||||
gifwedge_LDADD = $(LDADD)
|
||||
gifwedge_DEPENDENCIES = ../lib/libgif.la ../lib/libgetarg.a
|
||||
am_icon2gif_OBJECTS = icon2gif.$(OBJEXT)
|
||||
icon2gif_OBJECTS = $(am_icon2gif_OBJECTS)
|
||||
icon2gif_LDADD = $(LDADD)
|
||||
icon2gif_DEPENDENCIES = ../lib/libgif.la ../lib/libgetarg.a
|
||||
am_raw2gif_OBJECTS = raw2gif.$(OBJEXT)
|
||||
raw2gif_OBJECTS = $(am_raw2gif_OBJECTS)
|
||||
raw2gif_LDADD = $(LDADD)
|
||||
raw2gif_DEPENDENCIES = ../lib/libgif.la ../lib/libgetarg.a
|
||||
am_rgb2gif_OBJECTS = rgb2gif.$(OBJEXT)
|
||||
rgb2gif_OBJECTS = $(am_rgb2gif_OBJECTS)
|
||||
rgb2gif_LDADD = $(LDADD)
|
||||
rgb2gif_DEPENDENCIES = ../lib/libgif.la ../lib/libgetarg.a
|
||||
am_rle2gif_OBJECTS = rle2gif.$(OBJEXT)
|
||||
rle2gif_OBJECTS = $(am_rle2gif_OBJECTS)
|
||||
rle2gif_DEPENDENCIES = $(LDADD)
|
||||
am_text2gif_OBJECTS = text2gif.$(OBJEXT)
|
||||
text2gif_OBJECTS = $(am_text2gif_OBJECTS)
|
||||
text2gif_LDADD = $(LDADD)
|
||||
text2gif_DEPENDENCIES = ../lib/libgif.la ../lib/libgetarg.a
|
||||
binSCRIPT_INSTALL = $(INSTALL_SCRIPT)
|
||||
SCRIPTS = $(bin_SCRIPTS)
|
||||
DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@
|
||||
depcomp = $(SHELL) $(top_srcdir)/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 = $(gif2epsn_SOURCES) $(gif2iris_SOURCES) $(gif2ps_SOURCES) \
|
||||
$(gif2rgb_SOURCES) $(gif2rle_SOURCES) $(gif2x11_SOURCES) \
|
||||
$(gifasm_SOURCES) $(gifbg_SOURCES) $(gifclip_SOURCES) \
|
||||
$(gifclrmp_SOURCES) $(gifcolor_SOURCES) $(gifcomb_SOURCES) \
|
||||
$(giffiltr_SOURCES) $(giffix_SOURCES) $(gifflip_SOURCES) \
|
||||
$(gifhisto_SOURCES) $(gifinfo_SOURCES) $(gifinter_SOURCES) \
|
||||
$(gifinto_SOURCES) $(gifovly_SOURCES) $(gifpos_SOURCES) \
|
||||
$(gifrotat_SOURCES) $(gifrsize_SOURCES) $(gifspnge_SOURCES) \
|
||||
$(giftext_SOURCES) $(gifwedge_SOURCES) $(icon2gif_SOURCES) \
|
||||
$(raw2gif_SOURCES) $(rgb2gif_SOURCES) $(rle2gif_SOURCES) \
|
||||
$(text2gif_SOURCES)
|
||||
DIST_SOURCES = $(gif2epsn_SOURCES) $(gif2iris_SOURCES) \
|
||||
$(gif2ps_SOURCES) $(gif2rgb_SOURCES) $(gif2rle_SOURCES) \
|
||||
$(gif2x11_SOURCES) $(gifasm_SOURCES) $(gifbg_SOURCES) \
|
||||
$(gifclip_SOURCES) $(gifclrmp_SOURCES) $(gifcolor_SOURCES) \
|
||||
$(gifcomb_SOURCES) $(giffiltr_SOURCES) $(giffix_SOURCES) \
|
||||
$(gifflip_SOURCES) $(gifhisto_SOURCES) $(gifinfo_SOURCES) \
|
||||
$(gifinter_SOURCES) $(gifinto_SOURCES) $(gifovly_SOURCES) \
|
||||
$(gifpos_SOURCES) $(gifrotat_SOURCES) $(gifrsize_SOURCES) \
|
||||
$(gifspnge_SOURCES) $(giftext_SOURCES) $(gifwedge_SOURCES) \
|
||||
$(icon2gif_SOURCES) $(raw2gif_SOURCES) $(rgb2gif_SOURCES) \
|
||||
$(rle2gif_SOURCES) $(text2gif_SOURCES)
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMTAR = @AMTAR@
|
||||
AR = @AR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
COMPILABLE_EXTRAS = @COMPILABLE_EXTRAS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DEVS = @DEVS@
|
||||
ECHO = @ECHO@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
F77 = @F77@
|
||||
FFLAGS = @FFLAGS@
|
||||
GL_S_LIB = @GL_S_LIB@
|
||||
GREP = @GREP@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MATH_LIB = @MATH_LIB@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
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@
|
||||
RANLIB = @RANLIB@
|
||||
RLE_LIB = @RLE_LIB@
|
||||
SED = @SED@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
X11_LIB = @X11_LIB@
|
||||
XMKMF = @XMKMF@
|
||||
X_CFLAGS = @X_CFLAGS@
|
||||
X_EXTRA_LIBS = @X_EXTRA_LIBS@
|
||||
X_LIBS = @X_LIBS@
|
||||
X_PRE_LIBS = @X_PRE_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@
|
||||
bin_SCRIPTS = gifcompose gifburst
|
||||
EXTRA_DIST = Makefile.unx $(bin_SCRIPTS)
|
||||
LDADD = ../lib/libgif.la ../lib/libgetarg.a
|
||||
AM_CPPFLAGS = -I$(srcdir) -I$(top_srcdir)/lib
|
||||
gif2rle_SOURCES = gif2rle.c
|
||||
gif2rle_LDADD = $(LDADD) @RLE_LIB@
|
||||
rle2gif_SOURCES = rle2gif.c
|
||||
rle2gif_LDADD = $(LDADD) @RLE_LIB@
|
||||
gif2iris_SOURCES = gif2iris.c
|
||||
gif2iris_LDADD = $(LDADD) @GL_S_LIB@
|
||||
gif2x11_SOURCES = gif2x11.c
|
||||
gif2x11_LDADD = $(LDADD) @X11_LIB@
|
||||
gif2x11_CFLAGS = @X_CFLAGS@ $(AM_CFLAGS)
|
||||
gifclrmp_SOURCES = gifclrmp.c
|
||||
gifclrmp_LDADD = $(LDADD) @MATH_LIB@
|
||||
gifrotat_SOURCES = gifrotat.c
|
||||
gifrotat_LDADD = $(LDADD) @MATH_LIB@
|
||||
gifinfo_SOURCES = gifinfo.c
|
||||
gif2epsn_SOURCES = gif2epsn.c
|
||||
gif2ps_SOURCES = gif2ps.c
|
||||
gif2rgb_SOURCES = gif2rgb.c
|
||||
gifasm_SOURCES = gifasm.c
|
||||
gifbg_SOURCES = gifbg.c
|
||||
gifclip_SOURCES = gifclip.c
|
||||
gifcomb_SOURCES = gifcomb.c
|
||||
giffix_SOURCES = giffix.c
|
||||
gifflip_SOURCES = gifflip.c
|
||||
gifhisto_SOURCES = gifhisto.c
|
||||
gifinter_SOURCES = gifinter.c
|
||||
gifinto_SOURCES = gifinto.c
|
||||
gifovly_SOURCES = gifovly.c
|
||||
gifpos_SOURCES = gifpos.c
|
||||
gifrsize_SOURCES = gifrsize.c
|
||||
giftext_SOURCES = giftext.c
|
||||
gifwedge_SOURCES = gifwedge.c
|
||||
raw2gif_SOURCES = raw2gif.c
|
||||
rgb2gif_SOURCES = rgb2gif.c
|
||||
text2gif_SOURCES = text2gif.c
|
||||
gifspnge_SOURCES = gifspnge.c
|
||||
giffiltr_SOURCES = giffiltr.c
|
||||
icon2gif_SOURCES = icon2gif.c
|
||||
gifcolor_SOURCES = gifcolor.c
|
||||
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 util/Makefile'; \
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu util/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-binPROGRAMS: $(bin_PROGRAMS)
|
||||
@$(NORMAL_INSTALL)
|
||||
test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
|
||||
@list='$(bin_PROGRAMS)'; for p in $$list; do \
|
||||
p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
|
||||
if test -f $$p \
|
||||
|| test -f $$p1 \
|
||||
; then \
|
||||
f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
|
||||
echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
|
||||
$(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
|
||||
else :; fi; \
|
||||
done
|
||||
|
||||
uninstall-binPROGRAMS:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(bin_PROGRAMS)'; for p in $$list; do \
|
||||
f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
|
||||
echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
|
||||
rm -f "$(DESTDIR)$(bindir)/$$f"; \
|
||||
done
|
||||
|
||||
clean-binPROGRAMS:
|
||||
@list='$(bin_PROGRAMS)'; for p in $$list; do \
|
||||
f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
|
||||
echo " rm -f $$p $$f"; \
|
||||
rm -f $$p $$f ; \
|
||||
done
|
||||
gif2epsn$(EXEEXT): $(gif2epsn_OBJECTS) $(gif2epsn_DEPENDENCIES)
|
||||
@rm -f gif2epsn$(EXEEXT)
|
||||
$(LINK) $(gif2epsn_OBJECTS) $(gif2epsn_LDADD) $(LIBS)
|
||||
gif2iris$(EXEEXT): $(gif2iris_OBJECTS) $(gif2iris_DEPENDENCIES)
|
||||
@rm -f gif2iris$(EXEEXT)
|
||||
$(LINK) $(gif2iris_OBJECTS) $(gif2iris_LDADD) $(LIBS)
|
||||
gif2ps$(EXEEXT): $(gif2ps_OBJECTS) $(gif2ps_DEPENDENCIES)
|
||||
@rm -f gif2ps$(EXEEXT)
|
||||
$(LINK) $(gif2ps_OBJECTS) $(gif2ps_LDADD) $(LIBS)
|
||||
gif2rgb$(EXEEXT): $(gif2rgb_OBJECTS) $(gif2rgb_DEPENDENCIES)
|
||||
@rm -f gif2rgb$(EXEEXT)
|
||||
$(LINK) $(gif2rgb_OBJECTS) $(gif2rgb_LDADD) $(LIBS)
|
||||
gif2rle$(EXEEXT): $(gif2rle_OBJECTS) $(gif2rle_DEPENDENCIES)
|
||||
@rm -f gif2rle$(EXEEXT)
|
||||
$(LINK) $(gif2rle_OBJECTS) $(gif2rle_LDADD) $(LIBS)
|
||||
gif2x11$(EXEEXT): $(gif2x11_OBJECTS) $(gif2x11_DEPENDENCIES)
|
||||
@rm -f gif2x11$(EXEEXT)
|
||||
$(gif2x11_LINK) $(gif2x11_OBJECTS) $(gif2x11_LDADD) $(LIBS)
|
||||
gifasm$(EXEEXT): $(gifasm_OBJECTS) $(gifasm_DEPENDENCIES)
|
||||
@rm -f gifasm$(EXEEXT)
|
||||
$(LINK) $(gifasm_OBJECTS) $(gifasm_LDADD) $(LIBS)
|
||||
gifbg$(EXEEXT): $(gifbg_OBJECTS) $(gifbg_DEPENDENCIES)
|
||||
@rm -f gifbg$(EXEEXT)
|
||||
$(LINK) $(gifbg_OBJECTS) $(gifbg_LDADD) $(LIBS)
|
||||
gifclip$(EXEEXT): $(gifclip_OBJECTS) $(gifclip_DEPENDENCIES)
|
||||
@rm -f gifclip$(EXEEXT)
|
||||
$(LINK) $(gifclip_OBJECTS) $(gifclip_LDADD) $(LIBS)
|
||||
gifclrmp$(EXEEXT): $(gifclrmp_OBJECTS) $(gifclrmp_DEPENDENCIES)
|
||||
@rm -f gifclrmp$(EXEEXT)
|
||||
$(LINK) $(gifclrmp_OBJECTS) $(gifclrmp_LDADD) $(LIBS)
|
||||
gifcolor$(EXEEXT): $(gifcolor_OBJECTS) $(gifcolor_DEPENDENCIES)
|
||||
@rm -f gifcolor$(EXEEXT)
|
||||
$(LINK) $(gifcolor_OBJECTS) $(gifcolor_LDADD) $(LIBS)
|
||||
gifcomb$(EXEEXT): $(gifcomb_OBJECTS) $(gifcomb_DEPENDENCIES)
|
||||
@rm -f gifcomb$(EXEEXT)
|
||||
$(LINK) $(gifcomb_OBJECTS) $(gifcomb_LDADD) $(LIBS)
|
||||
giffiltr$(EXEEXT): $(giffiltr_OBJECTS) $(giffiltr_DEPENDENCIES)
|
||||
@rm -f giffiltr$(EXEEXT)
|
||||
$(LINK) $(giffiltr_OBJECTS) $(giffiltr_LDADD) $(LIBS)
|
||||
giffix$(EXEEXT): $(giffix_OBJECTS) $(giffix_DEPENDENCIES)
|
||||
@rm -f giffix$(EXEEXT)
|
||||
$(LINK) $(giffix_OBJECTS) $(giffix_LDADD) $(LIBS)
|
||||
gifflip$(EXEEXT): $(gifflip_OBJECTS) $(gifflip_DEPENDENCIES)
|
||||
@rm -f gifflip$(EXEEXT)
|
||||
$(LINK) $(gifflip_OBJECTS) $(gifflip_LDADD) $(LIBS)
|
||||
gifhisto$(EXEEXT): $(gifhisto_OBJECTS) $(gifhisto_DEPENDENCIES)
|
||||
@rm -f gifhisto$(EXEEXT)
|
||||
$(LINK) $(gifhisto_OBJECTS) $(gifhisto_LDADD) $(LIBS)
|
||||
gifinfo$(EXEEXT): $(gifinfo_OBJECTS) $(gifinfo_DEPENDENCIES)
|
||||
@rm -f gifinfo$(EXEEXT)
|
||||
$(LINK) $(gifinfo_OBJECTS) $(gifinfo_LDADD) $(LIBS)
|
||||
gifinter$(EXEEXT): $(gifinter_OBJECTS) $(gifinter_DEPENDENCIES)
|
||||
@rm -f gifinter$(EXEEXT)
|
||||
$(LINK) $(gifinter_OBJECTS) $(gifinter_LDADD) $(LIBS)
|
||||
gifinto$(EXEEXT): $(gifinto_OBJECTS) $(gifinto_DEPENDENCIES)
|
||||
@rm -f gifinto$(EXEEXT)
|
||||
$(LINK) $(gifinto_OBJECTS) $(gifinto_LDADD) $(LIBS)
|
||||
gifovly$(EXEEXT): $(gifovly_OBJECTS) $(gifovly_DEPENDENCIES)
|
||||
@rm -f gifovly$(EXEEXT)
|
||||
$(LINK) $(gifovly_OBJECTS) $(gifovly_LDADD) $(LIBS)
|
||||
gifpos$(EXEEXT): $(gifpos_OBJECTS) $(gifpos_DEPENDENCIES)
|
||||
@rm -f gifpos$(EXEEXT)
|
||||
$(LINK) $(gifpos_OBJECTS) $(gifpos_LDADD) $(LIBS)
|
||||
gifrotat$(EXEEXT): $(gifrotat_OBJECTS) $(gifrotat_DEPENDENCIES)
|
||||
@rm -f gifrotat$(EXEEXT)
|
||||
$(LINK) $(gifrotat_OBJECTS) $(gifrotat_LDADD) $(LIBS)
|
||||
gifrsize$(EXEEXT): $(gifrsize_OBJECTS) $(gifrsize_DEPENDENCIES)
|
||||
@rm -f gifrsize$(EXEEXT)
|
||||
$(LINK) $(gifrsize_OBJECTS) $(gifrsize_LDADD) $(LIBS)
|
||||
gifspnge$(EXEEXT): $(gifspnge_OBJECTS) $(gifspnge_DEPENDENCIES)
|
||||
@rm -f gifspnge$(EXEEXT)
|
||||
$(LINK) $(gifspnge_OBJECTS) $(gifspnge_LDADD) $(LIBS)
|
||||
giftext$(EXEEXT): $(giftext_OBJECTS) $(giftext_DEPENDENCIES)
|
||||
@rm -f giftext$(EXEEXT)
|
||||
$(LINK) $(giftext_OBJECTS) $(giftext_LDADD) $(LIBS)
|
||||
gifwedge$(EXEEXT): $(gifwedge_OBJECTS) $(gifwedge_DEPENDENCIES)
|
||||
@rm -f gifwedge$(EXEEXT)
|
||||
$(LINK) $(gifwedge_OBJECTS) $(gifwedge_LDADD) $(LIBS)
|
||||
icon2gif$(EXEEXT): $(icon2gif_OBJECTS) $(icon2gif_DEPENDENCIES)
|
||||
@rm -f icon2gif$(EXEEXT)
|
||||
$(LINK) $(icon2gif_OBJECTS) $(icon2gif_LDADD) $(LIBS)
|
||||
raw2gif$(EXEEXT): $(raw2gif_OBJECTS) $(raw2gif_DEPENDENCIES)
|
||||
@rm -f raw2gif$(EXEEXT)
|
||||
$(LINK) $(raw2gif_OBJECTS) $(raw2gif_LDADD) $(LIBS)
|
||||
rgb2gif$(EXEEXT): $(rgb2gif_OBJECTS) $(rgb2gif_DEPENDENCIES)
|
||||
@rm -f rgb2gif$(EXEEXT)
|
||||
$(LINK) $(rgb2gif_OBJECTS) $(rgb2gif_LDADD) $(LIBS)
|
||||
rle2gif$(EXEEXT): $(rle2gif_OBJECTS) $(rle2gif_DEPENDENCIES)
|
||||
@rm -f rle2gif$(EXEEXT)
|
||||
$(LINK) $(rle2gif_OBJECTS) $(rle2gif_LDADD) $(LIBS)
|
||||
text2gif$(EXEEXT): $(text2gif_OBJECTS) $(text2gif_DEPENDENCIES)
|
||||
@rm -f text2gif$(EXEEXT)
|
||||
$(LINK) $(text2gif_OBJECTS) $(text2gif_LDADD) $(LIBS)
|
||||
install-binSCRIPTS: $(bin_SCRIPTS)
|
||||
@$(NORMAL_INSTALL)
|
||||
test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
|
||||
@list='$(bin_SCRIPTS)'; for p in $$list; do \
|
||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
||||
if test -f $$d$$p; then \
|
||||
f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
|
||||
echo " $(binSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(bindir)/$$f'"; \
|
||||
$(binSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(bindir)/$$f"; \
|
||||
else :; fi; \
|
||||
done
|
||||
|
||||
uninstall-binSCRIPTS:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(bin_SCRIPTS)'; for p in $$list; do \
|
||||
f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
|
||||
echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
|
||||
rm -f "$(DESTDIR)$(bindir)/$$f"; \
|
||||
done
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.$(OBJEXT)
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gif2epsn.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gif2iris.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gif2ps.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gif2rgb.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gif2rle.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gif2x11-gif2x11.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gifasm.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gifbg.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gifclip.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gifclrmp.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gifcolor.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gifcomb.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/giffiltr.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/giffix.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gifflip.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gifhisto.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gifinfo.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gifinter.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gifinto.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gifovly.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gifpos.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gifrotat.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gifrsize.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gifspnge.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/giftext.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gifwedge.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/icon2gif.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/raw2gif.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rgb2gif.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rle2gif.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/text2gif.Po@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 $@ $<
|
||||
|
||||
gif2x11-gif2x11.o: gif2x11.c
|
||||
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gif2x11_CFLAGS) $(CFLAGS) -MT gif2x11-gif2x11.o -MD -MP -MF $(DEPDIR)/gif2x11-gif2x11.Tpo -c -o gif2x11-gif2x11.o `test -f 'gif2x11.c' || echo '$(srcdir)/'`gif2x11.c
|
||||
@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/gif2x11-gif2x11.Tpo $(DEPDIR)/gif2x11-gif2x11.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gif2x11.c' object='gif2x11-gif2x11.o' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gif2x11_CFLAGS) $(CFLAGS) -c -o gif2x11-gif2x11.o `test -f 'gif2x11.c' || echo '$(srcdir)/'`gif2x11.c
|
||||
|
||||
gif2x11-gif2x11.obj: gif2x11.c
|
||||
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gif2x11_CFLAGS) $(CFLAGS) -MT gif2x11-gif2x11.obj -MD -MP -MF $(DEPDIR)/gif2x11-gif2x11.Tpo -c -o gif2x11-gif2x11.obj `if test -f 'gif2x11.c'; then $(CYGPATH_W) 'gif2x11.c'; else $(CYGPATH_W) '$(srcdir)/gif2x11.c'; fi`
|
||||
@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/gif2x11-gif2x11.Tpo $(DEPDIR)/gif2x11-gif2x11.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gif2x11.c' object='gif2x11-gif2x11.obj' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gif2x11_CFLAGS) $(CFLAGS) -c -o gif2x11-gif2x11.obj `if test -f 'gif2x11.c'; then $(CYGPATH_W) 'gif2x11.c'; else $(CYGPATH_W) '$(srcdir)/gif2x11.c'; fi`
|
||||
|
||||
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; } \
|
||||
END { 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; } \
|
||||
END { 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=; \
|
||||
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; } \
|
||||
END { 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 $(PROGRAMS) $(SCRIPTS)
|
||||
installdirs:
|
||||
for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)"; 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-binPROGRAMS clean-generic clean-libtool 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-dvi: install-dvi-am
|
||||
|
||||
install-exec-am: install-binPROGRAMS install-binSCRIPTS
|
||||
|
||||
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-binPROGRAMS uninstall-binSCRIPTS
|
||||
|
||||
.MAKE: install-am install-strip
|
||||
|
||||
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
|
||||
clean-generic clean-libtool ctags distclean distclean-compile \
|
||||
distclean-generic distclean-libtool distclean-tags distdir dvi \
|
||||
dvi-am html html-am info info-am install install-am \
|
||||
install-binPROGRAMS install-binSCRIPTS 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-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-binSCRIPTS
|
||||
|
||||
# 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:
|
130
third_party/giflib/util/Makefile.unx
vendored
@ -1,130 +0,0 @@
|
||||
#
|
||||
# This is the make file for the util subdirectory of the GIF library
|
||||
# The compiler must be GNU gcc or ANSI-compliant.
|
||||
#
|
||||
# To make test versions in the utils directory:
|
||||
#
|
||||
# make -f makefile.unx [all] [rle] [iris]
|
||||
#
|
||||
# To install them in the /usr/bin directory:
|
||||
#
|
||||
# make -f makefile.unx [install-all] [install-rle] [install-iris]
|
||||
#
|
||||
# Eric Raymond, September 1992
|
||||
#
|
||||
|
||||
#
|
||||
# If you have the Utah raster tool kit and wants conversion routines to and
|
||||
# from it set the ones below properly.
|
||||
#
|
||||
# RLE_INC = -I/u/urt/urt3.0/include
|
||||
# RLE_LIB = /u/urt/urt3.0/lib/librle.a
|
||||
# X_INC_DIR = /server/sun4/usr/new/lib/X11R4
|
||||
|
||||
# Declare the include files and libraries for the GIF utils:
|
||||
INC = -I../lib
|
||||
GIF_LIB = ../lib/libgif.a
|
||||
GIF_INC_DEPEND = ../lib/libgif.a ../lib/gif_lib.h ../lib/getarg.h
|
||||
|
||||
# Where to copy executables to:
|
||||
DEST = /usr/bin
|
||||
|
||||
# These are the flags for gcc, in BSD4.3 or Sun O.S. 4.0.3
|
||||
#
|
||||
# If your system has all function prototypes for gcc, replace all
|
||||
# the -Wxxx with -Wall. I can not add -Wimplicit as my system uses old cc
|
||||
# h files.
|
||||
#
|
||||
# CC = gcc
|
||||
# CFLAGS = $(INC) -O -s -W -Wreturn-type -Wcomment
|
||||
# CFLAGS = $(INC) -g -pg -W -Wreturn-type -Wcomment
|
||||
|
||||
|
||||
# For sun 4 (gunnars@ifi.uib.no). Tested using gcc 1.39.
|
||||
#
|
||||
# CFLAGS = $(INC) -O -s -sun4 -W -Wreturn-type -Wcomment -DUSE_VARARGS
|
||||
# CFLAGS = $(INC) -g -sun4 -W -Wreturn-type -Wcomment -DUSE_VARARGS
|
||||
# XLIBS = -lX11
|
||||
|
||||
# These are the flags for cc on SGI iris4d. O.S. IRIX 3.2. Note you must
|
||||
# define XLIBS as well.
|
||||
#
|
||||
# CC = cc
|
||||
# CFLAGS = $(INC) -O -s -DSYSV -DNO_VOID_PTR -Olimit 1000 -Wf,-XNh5000 -Wf,-XNd5000 -G 4
|
||||
# CFLAGS = $(INC) -g -p -DSYSV -DNO_VOID_PTR -Olimit 1000 -Wf,-XNh5000 -Wf,-XNd5000 -G 4
|
||||
# XLIBS = -lbsd -lX11
|
||||
|
||||
# These are the flags for xlc, ansi compiler for IBM R6000
|
||||
#
|
||||
# CC = xlc
|
||||
# CFLAGS = $(INC) -O -s -qnoro -D_POSIX_SOURCE -D_ALL_SOURCE -DR6000
|
||||
# CFLAGS = $(INC) -g -pg -qnoro -D_POSIX_SOURCE -D_ALL_SOURCE -DR6000
|
||||
# XLIBS = -lX11
|
||||
|
||||
# GNU CC 2.2 under System V Release 3.2 with AT&T's crocked-up X11R3
|
||||
#
|
||||
# CC = gcc
|
||||
# CFLAGS = $(INC) -fno-builtin -O -s -W -Wreturn-type -Wcomment
|
||||
# CFLAGS = $(INC) -fno-builtin -g -lg -W -Wreturn-type -Wcomment
|
||||
# XLIBS = -lX11 -lnls -lnsl_s -lpt
|
||||
# X_INC_DIR = /usr/X/include
|
||||
# X_LIB_DIR = /usr/X/lib
|
||||
|
||||
# SVr4 using SGCS X11R5
|
||||
#
|
||||
# CC = gcc
|
||||
# CFLAGS = $(INC) -fno-builtin -O -s -W -Wreturn-type -Wcomment
|
||||
# CFLAGS = $(INC) -fno-builtin -g -lg -W -Wreturn-type -Wcomment
|
||||
# XLIBS = -lX11 -lsocket -lnsl
|
||||
# X_INC_DIR = /usr/X/include
|
||||
# X_LIB_DIR = /usr/X/lib
|
||||
|
||||
# Linux using XFree86
|
||||
#
|
||||
CC = gcc
|
||||
#CFLAGS = $(INC) -fno-builtin -O -s -W -Wreturn-type -Wcomment
|
||||
CFLAGS = $(INC) -fno-builtin -g -W -Wreturn-type -Wcomment
|
||||
XLIBS = -lX11
|
||||
X_INC_DIR = /usr/X11/include
|
||||
X_LIB_DIR = /usr/X11/lib
|
||||
|
||||
BINARIES = gif2epsn gif2ps gif2rgb gif2x11 gifasm gifbg \
|
||||
gifclip gifclrmp gifcomb giffix gifflip gifhisto \
|
||||
gifinter gifinto gifovly gifpos gifrotat gifrsize giftext \
|
||||
gifwedge raw2gif rgb2gif text2gif gifspnge giffiltr \
|
||||
icon2gif gifcolor
|
||||
|
||||
RLE = gif2rle rle2gif
|
||||
|
||||
IRIS = gif2iris
|
||||
|
||||
SCRIPTS = gifcompose gifburst
|
||||
|
||||
all: $(BINARIES)
|
||||
rle: $(RLE)
|
||||
iris: $(IRIS)
|
||||
|
||||
install-all:
|
||||
cp $(BINARIES) $(SCRIPTS) $(DEST)
|
||||
|
||||
install-rle:
|
||||
cp $(RLE) $(DEST)
|
||||
|
||||
install-iris:
|
||||
cp $(IRIS) $(DEST)
|
||||
|
||||
.c:
|
||||
$(CC) $(CFLAGS) $< $(GIF_LIB) -lm $(LDFLAGS) -o $*
|
||||
|
||||
uninstall-utils:
|
||||
(cd $(DEST); rm -f $(BINARIES) $(RLE) $(IRIS) $(SCRIPTS))
|
||||
|
||||
gif2iris: gif2iris.c
|
||||
$(CC) gif2iris.c $(CFLAGS) $(LDFLAGS) -lgl_s -o gif2iris
|
||||
|
||||
gif2x11: gif2x11.c
|
||||
$(CC) gif2x11.c $(CFLAGS) -I$(X_INC_DIR) -L$(X_LIB_DIR) $(LDFLAGS) $(GIF_LIB) $(XLIBS) -o gif2x11
|
||||
|
||||
|
||||
clean:
|
||||
rm -f $(BINARIES) $(RLE) $(IRIS)
|
614
third_party/giflib/util/gif2epsn.c
vendored
@ -1,614 +0,0 @@
|
||||
/*****************************************************************************
|
||||
* "Gif-Lib" - Yet another gif library. *
|
||||
* *
|
||||
* Written by: Gershon Elber Ver 0.1, Jul. 1989 *
|
||||
******************************************************************************
|
||||
* Program to dump GIF file into EPSON type printers *
|
||||
* Options: *
|
||||
* -q : quiet printing mode. *
|
||||
* -d factor : use dithering of matrix of size factor by factor. *
|
||||
* -t level : set the threshold level of white in the result (0..100). *
|
||||
* -m mapping : methods for mapping the 24bits colors into 1 BW bit. *
|
||||
* -p printer : specify printer to print to (lpt1: by default). *
|
||||
* -n : nice mode : uses double density to achieve better quality. *
|
||||
* -i : invert the image. *
|
||||
* -h : on-line help. *
|
||||
******************************************************************************
|
||||
* History: *
|
||||
* 15 Jul 89 - Version 1.0 by Gershon Elber. *
|
||||
* 22 Dec 89 - Fix problems with const strings been modified (Version 1.1). *
|
||||
*****************************************************************************/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#ifdef __MSDOS__
|
||||
#include <graphics.h>
|
||||
#include <stdlib.h>
|
||||
#include <alloc.h>
|
||||
#include <io.h>
|
||||
#include <dos.h>
|
||||
#include <bios.h>
|
||||
#endif /* __MSDOS__ */
|
||||
|
||||
#ifndef __MSDOS__
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
#ifdef HAVE_FCNTL_H
|
||||
#include <fcntl.h>
|
||||
#endif /* HAVE_FCNTL_H */
|
||||
#include "gif_lib.h"
|
||||
#include "getarg.h"
|
||||
|
||||
#define PROGRAM_NAME "Gif2Epsn"
|
||||
|
||||
#define C2BW_BACK_GROUND 0 /*Methods to map 24bits Colors to 1 BW bit.*/
|
||||
#define C2BW_GREY_LEVELS 1
|
||||
#define C2BW_DITHER 2
|
||||
#define C2BW_NUM_METHODS 3 /* Always hold # of methods. */
|
||||
|
||||
#define DEFAULT_THRESHOLD 5000 /* Color->BW threshold level. */
|
||||
|
||||
#define DITHER_MIN_MATRIX 2
|
||||
#define DITHER_MAX_MATRIX 4
|
||||
|
||||
/* The epson specific are defined here: */
|
||||
#define EPSON_WIDTH 80 /* 80 char per line. */
|
||||
#define EPSON_PIXEL_2_CHAR 8 /* 8 pixels per char, in REG_DENSITY. */
|
||||
|
||||
#define EPSON_ESC "\033" /* Actually regular escape char. */
|
||||
#define EPSON_RESET "\033@" /* Reset the printer. */
|
||||
#define EPSON_VERTICAL_SPACE "\033A\010" /* 8/72 inch vertically. */
|
||||
#define EPSON_REG_DENSITY "\033K" /* 640 pixels per 7.5" (line). */
|
||||
#define EPSON_DUAL_DENSITY "\033L" /* 1280 pixels per 7.5" (line). */
|
||||
|
||||
#ifdef __MSDOS__
|
||||
extern unsigned int
|
||||
_stklen = 16384; /* Increase default stack size. */
|
||||
#endif /* __MSDOS__ */
|
||||
|
||||
#ifdef SYSV
|
||||
static char *VersionStr =
|
||||
"Gif toolkit module,\t\tGershon Elber\n\
|
||||
(C) Copyright 1989 Gershon Elber.\n";
|
||||
static char
|
||||
*CtrlStr = "Gif2Epsn q%- d%-DitherSize!d t%-BWThreshold!d m%-Mapping!d i%- n%- p%-PrinterName!s h%- GifFile!*s";
|
||||
#else
|
||||
static char
|
||||
*VersionStr =
|
||||
PROGRAM_NAME
|
||||
GIF_LIB_VERSION
|
||||
" Gershon Elber, "
|
||||
__DATE__ ", " __TIME__ "\n"
|
||||
"(C) Copyright 1989 Gershon Elber.\n";
|
||||
static char
|
||||
*CtrlStr =
|
||||
PROGRAM_NAME
|
||||
" q%- d%-DitherSize!d t%-BWThreshold!d m%-Mapping!d i%- n%- p%-PrinterName!s h%- GifFile!*s";
|
||||
#endif /* SYSV */
|
||||
|
||||
static char
|
||||
*PrinterName = NULL;
|
||||
/* Make some variables global, so we could access them faster: */
|
||||
static int
|
||||
ImageNum = 0,
|
||||
BackGround = 0,
|
||||
DitherSize = 2, DitherFlag = FALSE,
|
||||
BWThresholdFlag = FALSE, Threshold,
|
||||
BWThreshold = DEFAULT_THRESHOLD, /* Color->BW mapping threshold. */
|
||||
Mapping, MappingFlag = FALSE,
|
||||
InvertFlag = FALSE,
|
||||
NiceFlag = FALSE,
|
||||
PrinterFlag = FALSE,
|
||||
HelpFlag = FALSE,
|
||||
ColorToBWMapping = C2BW_BACK_GROUND,
|
||||
InterlacedOffset[] = { 0, 4, 2, 1 }, /* The way Interlaced image should */
|
||||
InterlacedJumps[] = { 8, 8, 4, 2 }; /* be read - offsets and jumps... */
|
||||
static GifColorType
|
||||
*ColorMap;
|
||||
|
||||
static void EvalDitheredScanline(GifRowType *ScreenBuffer, int Row,
|
||||
int RowSize, GifRowType *DitherBuffer);
|
||||
static void DumpScreen2Epsn(GifRowType *ScreenBuffer,
|
||||
int ScreenWidth, int ScreenHeight);
|
||||
static void PutString(FILE *Prt, int DirectPrint, char *Str, int Len);
|
||||
static void PutString2(FILE *Prt, int DirectPrint, char *Str, int Len);
|
||||
|
||||
/******************************************************************************
|
||||
* Interpret the command line and scan the given GIF file. *
|
||||
******************************************************************************/
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
int i, j, Error, NumFiles, Size, Row, Col, Width, Height, ExtCode, Count;
|
||||
GifRecordType RecordType;
|
||||
GifByteType *Extension;
|
||||
char **FileName = NULL;
|
||||
GifRowType *ScreenBuffer;
|
||||
GifFileType *GifFile;
|
||||
|
||||
if ((Error = GAGetArgs(argc, argv, CtrlStr,
|
||||
&GifQuietPrint, &DitherFlag, &DitherSize,
|
||||
&BWThresholdFlag, &Threshold,
|
||||
&MappingFlag, &Mapping, &InvertFlag,
|
||||
&NiceFlag, &PrinterFlag, &PrinterName, &HelpFlag,
|
||||
&NumFiles, &FileName)) != FALSE ||
|
||||
(NumFiles > 1 && !HelpFlag)) {
|
||||
if (Error)
|
||||
GAPrintErrMsg(Error);
|
||||
else if (NumFiles > 1)
|
||||
GIF_MESSAGE("Error in command line parsing - one GIF file please.");
|
||||
GAPrintHowTo(CtrlStr);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if (HelpFlag) {
|
||||
fprintf(stderr, VersionStr);
|
||||
GAPrintHowTo(CtrlStr);
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
if (!PrinterFlag) PrinterName = "";
|
||||
|
||||
if (DitherFlag) {
|
||||
/* Make sure we are o.k.: */
|
||||
if (DitherSize > DITHER_MAX_MATRIX) DitherSize = DITHER_MAX_MATRIX;
|
||||
if (DitherSize < DITHER_MIN_MATRIX) DitherSize = DITHER_MAX_MATRIX;
|
||||
}
|
||||
|
||||
/* As Threshold is in [0..100] range and BWThreshold is [0..25500]: */
|
||||
if (BWThresholdFlag) {
|
||||
if (Threshold > 100 || Threshold < 0)
|
||||
GIF_EXIT("Threshold not in 0..100 percent.");
|
||||
BWThreshold = Threshold * 255;
|
||||
if (BWThreshold == 0) BWThreshold = 1; /* Overcome divide by zero! */
|
||||
}
|
||||
|
||||
/* No message is emitted, but mapping method is clipped to exists method.*/
|
||||
if (MappingFlag) ColorToBWMapping = Mapping % C2BW_NUM_METHODS;
|
||||
|
||||
if (NumFiles == 1) {
|
||||
if ((GifFile = DGifOpenFileName(*FileName)) == NULL) {
|
||||
PrintGifError();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
else {
|
||||
/* Use the stdin instead: */
|
||||
|
||||
#ifdef __MSDOS__
|
||||
setmode(0, O_BINARY);
|
||||
#endif /* __MSDOS__ */
|
||||
if ((GifFile = DGifOpenFileHandle(0)) == NULL) {
|
||||
PrintGifError();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
|
||||
/* Allocate the screen as vector of column of rows. We cannt allocate */
|
||||
/* the all screen at once, as this broken minded CPU can allocate up to */
|
||||
/* 64k at a time and our image can be bigger than that: */
|
||||
/* Note this screen is device independent - its the screen as defined by */
|
||||
/* the GIF file parameters itself. */
|
||||
if ((ScreenBuffer = (GifRowType *)
|
||||
malloc(GifFile->SHeight * sizeof(GifRowType *))) == NULL)
|
||||
GIF_EXIT("Failed to allocate memory required, aborted.");
|
||||
|
||||
Size = GifFile->SWidth * sizeof(GifPixelType);/* Size in bytes one row.*/
|
||||
if ((ScreenBuffer[0] = (GifRowType) malloc(Size)) == NULL) /* First row. */
|
||||
GIF_EXIT("Failed to allocate memory required, aborted.");
|
||||
|
||||
for (i = 0; i < GifFile->SWidth; i++) /* Set its color to BackGround. */
|
||||
ScreenBuffer[0][i] = GifFile->SBackGroundColor;
|
||||
for (i = 1; i < GifFile->SHeight; i++) {
|
||||
/* Allocate the other rows, andset their color to background too: */
|
||||
if ((ScreenBuffer[i] = (GifRowType) malloc(Size)) == NULL)
|
||||
GIF_EXIT("Failed to allocate memory required, aborted.\n");
|
||||
|
||||
memcpy(ScreenBuffer[i], ScreenBuffer[0], Size);
|
||||
}
|
||||
|
||||
/* Scan the content of the GIF file and load the image(s) in: */
|
||||
do {
|
||||
if (DGifGetRecordType(GifFile, &RecordType) == GIF_ERROR) {
|
||||
PrintGifError();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
switch (RecordType) {
|
||||
case IMAGE_DESC_RECORD_TYPE:
|
||||
if (DGifGetImageDesc(GifFile) == GIF_ERROR) {
|
||||
PrintGifError();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
Row = GifFile->Image.Top; /* Image Position relative to Screen. */
|
||||
Col = GifFile->Image.Left;
|
||||
Width = GifFile->Image.Width;
|
||||
Height = GifFile->Image.Height;
|
||||
GifQprintf("\n%s: Image %d at (%d, %d) [%dx%d]: ",
|
||||
PROGRAM_NAME, ++ImageNum, Col, Row, Width, Height);
|
||||
if (GifFile->Image.Left + GifFile->Image.Width > GifFile->SWidth ||
|
||||
GifFile->Image.Top + GifFile->Image.Height > GifFile->SHeight) {
|
||||
fprintf(stderr, "Image %d is not confined to screen dimension, aborted.\n",ImageNum);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
if (GifFile->Image.Interlace) {
|
||||
/* Need to perform 4 passes on the images: */
|
||||
for (Count = i = 0; i < 4; i++)
|
||||
for (j = Row + InterlacedOffset[i]; j < Row + Height;
|
||||
j += InterlacedJumps[i]) {
|
||||
GifQprintf("\b\b\b\b%-4d", Count++);
|
||||
if (DGifGetLine(GifFile, &ScreenBuffer[j][Col],
|
||||
Width) == GIF_ERROR) {
|
||||
PrintGifError();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
for (i = 0; i < Height; i++) {
|
||||
GifQprintf("\b\b\b\b%-4d", i);
|
||||
if (DGifGetLine(GifFile, &ScreenBuffer[Row++][Col],
|
||||
Width) == GIF_ERROR) {
|
||||
PrintGifError();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case EXTENSION_RECORD_TYPE:
|
||||
/* Skip any extension blocks in file: */
|
||||
if (DGifGetExtension(GifFile, &ExtCode, &Extension) == GIF_ERROR) {
|
||||
PrintGifError();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
while (Extension != NULL) {
|
||||
if (DGifGetExtensionNext(GifFile, &Extension) == GIF_ERROR) {
|
||||
PrintGifError();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case TERMINATE_RECORD_TYPE:
|
||||
break;
|
||||
default: /* Should be traps by DGifGetRecordType. */
|
||||
break;
|
||||
}
|
||||
}
|
||||
while (RecordType != TERMINATE_RECORD_TYPE);
|
||||
|
||||
/* Lets display it - set the global variables required and do it: */
|
||||
BackGround = GifFile->SBackGroundColor;
|
||||
ColorMap = (GifFile->Image.ColorMap ? GifFile->Image.ColorMap->Colors :
|
||||
(GifFile->SColorMap ? GifFile->SColorMap->Colors :
|
||||
NULL));
|
||||
if (ColorMap == NULL) {
|
||||
fprintf(stderr, "Gif Image does not have a colormap\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
DumpScreen2Epsn(ScreenBuffer, GifFile->SWidth, GifFile->SHeight);
|
||||
|
||||
if (DGifCloseFile(GifFile) == GIF_ERROR) {
|
||||
PrintGifError();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* Routine to evaluate dithered scanlines out of given ones, using Size *
|
||||
* dithering matrix, starting from Row. The given scanlines are NOT modified. *
|
||||
*****************************************************************************/
|
||||
static void EvalDitheredScanline(GifRowType *ScreenBuffer, int Row,
|
||||
int RowSize, GifRowType *DitherBuffer)
|
||||
{
|
||||
static char Dither2[2][2] = { /* See Foley & Van Dam pp. 597-601. */
|
||||
{ 1, 3 },
|
||||
{ 4, 2 }
|
||||
};
|
||||
static char Dither3[3][3] = {
|
||||
{ 7, 9, 5 },
|
||||
{ 2, 1, 4 },
|
||||
{ 6, 3, 8 }
|
||||
};
|
||||
static char Dither4[4][4] = {
|
||||
{ 1, 9, 3, 11 },
|
||||
{ 13, 5, 15, 7 },
|
||||
{ 4, 12, 2, 10 },
|
||||
{ 16, 8, 14, 6 }
|
||||
};
|
||||
int i, j, k, Level;
|
||||
long Intensity;
|
||||
GifColorType *ColorMapEntry;
|
||||
|
||||
/* Scan the Rows (Size rows) evaluate intensity every Size pixel and use */
|
||||
/* the dither matrix to set the dithered result; */
|
||||
for (i = 0; i <= RowSize - DitherSize; i += DitherSize) {
|
||||
Intensity = 0;
|
||||
for (j = Row; j < Row + DitherSize; j++)
|
||||
for (k = 0; k < DitherSize; k++) {
|
||||
ColorMapEntry = &ColorMap[ScreenBuffer[j][i+k]];
|
||||
Intensity += 30 * ((int) ColorMapEntry->Red) +
|
||||
59 * ((int) ColorMapEntry->Green) +
|
||||
11 * ((int) ColorMapEntry->Blue);
|
||||
}
|
||||
|
||||
/* Find the intensity level (between 0 and Size^2) of our matrix: */
|
||||
/* Expression is "Intensity * BWThreshold / (25500 * DefThresh)" */
|
||||
/* but to prevent from overflow in the long evaluation we do this: */
|
||||
Level = ((Intensity / 2550) * ((long) DEFAULT_THRESHOLD) /
|
||||
(((long) BWThreshold) * 10));
|
||||
switch (DitherSize) {
|
||||
case 2:
|
||||
for (j = 0; j < DitherSize; j++)
|
||||
for (k = 0; k < DitherSize; k++)
|
||||
DitherBuffer[j][i+k] = Dither2[j][k] <= Level;
|
||||
break;
|
||||
case 3:
|
||||
for (j = 0; j < DitherSize; j++)
|
||||
for (k = 0; k < DitherSize; k++)
|
||||
DitherBuffer[j][i+k] = Dither3[j][k] <= Level;
|
||||
break;
|
||||
case 4:
|
||||
for (j = 0; j < DitherSize; j++)
|
||||
for (k = 0; k < DitherSize; k++)
|
||||
DitherBuffer[j][i+k] = Dither4[j][k] <= Level;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* The real dumping routine. Few things are taken into account: *
|
||||
* 1. The Nice flag. If TRUE each pixel is printed twice in double density. *
|
||||
* 2. The Invert flag. If TRUE each pixel before drawn is inverted. *
|
||||
* 3. The rendering mode and dither matrix flag if dithering is selected. *
|
||||
* The image is drawn from ScreenBuffer ScreenTop/Left in the bottom/right *
|
||||
* directions. *
|
||||
* Unfortunatelly, there is a BUG in DOS that does not handle ctrl-Z *
|
||||
* correctly if we open lptx: device in binary mode (should treat it as any *
|
||||
* other char). Therefore I had to write to it directly using biosprint. I *
|
||||
* dont like it either, and if you have better way to do it, let me know. *
|
||||
******************************************************************************/
|
||||
static void DumpScreen2Epsn(GifRowType *ScreenBuffer,
|
||||
int ScreenWidth, int ScreenHeight)
|
||||
{
|
||||
int i, j, p, Size, LeftCWidth, Len, DirectPrint = 0,
|
||||
DitheredLinesLeft = 0, DitheredLinesCount = 0, MapInvert[2];
|
||||
char LinePrefixLen[2]; /* Length of scan line. */
|
||||
GifByteType *EpsonBuffer;
|
||||
GifPixelType *Line;
|
||||
GifRowType *DitherBuffer;
|
||||
GifColorType *ColorMapEntry;
|
||||
FILE *Prt = NULL;
|
||||
|
||||
#ifdef __MSDOS__
|
||||
for (i = 0; i < strlen(PrinterName); i++)
|
||||
if (islower(PrinterName[i]))
|
||||
PrinterName[i] = toupper(PrinterName[i]);
|
||||
|
||||
if (strcmp(PrinterName, "LPT1") == 0 ||
|
||||
strcmp(PrinterName, "PRN") == 0)
|
||||
DirectPrint = 1;
|
||||
else if (strcmp(PrinterName, "LPT2") == 0)
|
||||
DirectPrint = 2;
|
||||
else if (strcmp(PrinterName, "LPT3") == 0)
|
||||
DirectPrint = 3;
|
||||
#endif /* __MSDOS__ */
|
||||
|
||||
if (!DirectPrint) {
|
||||
if (strlen(PrinterName) == 0) {
|
||||
#ifdef __MSDOS__
|
||||
setmode(1, O_BINARY); /* Make sure it is in binary mode. */
|
||||
#endif
|
||||
Prt = stdout;
|
||||
}
|
||||
else
|
||||
{
|
||||
Prt = fopen(PrinterName, "wb");
|
||||
if (Prt == NULL)
|
||||
{
|
||||
GIF_EXIT("Failed to open output (printer) file.");
|
||||
}
|
||||
|
||||
#ifdef __MSDOS__
|
||||
if (setvbuf(Prt, NULL, _IOFBF, GIF_FILE_BUFFER_SIZE))
|
||||
{
|
||||
GIF_EXIT("Failed to open output (printer) file.");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
if ((EpsonBuffer = (GifByteType *) malloc(ScreenWidth)) == NULL)
|
||||
GIF_EXIT("Failed to allocate memory required, aborted.");
|
||||
|
||||
/* Allocate the buffer to save the dithered information. */
|
||||
if (ColorToBWMapping == C2BW_DITHER) {
|
||||
if ((DitherBuffer = (GifRowType *)
|
||||
malloc(DITHER_MAX_MATRIX * sizeof(GifRowType *))) != NULL) {
|
||||
Size = ScreenWidth * sizeof(GifPixelType); /* Size of one row. */
|
||||
for (i = 0; i < DITHER_MAX_MATRIX; i++) {
|
||||
if ((DitherBuffer[i] = (GifRowType) malloc(Size)) == NULL) {
|
||||
DitherBuffer = NULL;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (DitherBuffer == NULL)
|
||||
GIF_EXIT("Failed to allocate memory required, aborted.");
|
||||
}
|
||||
else
|
||||
DitherBuffer = NULL;
|
||||
|
||||
/* Reset the printer, and make sure no space between adjacent lines: */
|
||||
PutString(Prt, DirectPrint, EPSON_RESET, 2);
|
||||
PutString(Prt, DirectPrint, EPSON_VERTICAL_SPACE, 3);
|
||||
|
||||
/* Prepar left spacing to begin with, so image will be in the middle. */
|
||||
LeftCWidth = (EPSON_WIDTH - (ScreenWidth / EPSON_PIXEL_2_CHAR)) / 2;
|
||||
|
||||
if (InvertFlag) { /* Make the inversion as fast a possible. */
|
||||
MapInvert[0] = 1;
|
||||
MapInvert[1] = 0;
|
||||
}
|
||||
else {
|
||||
MapInvert[0] = 0;
|
||||
MapInvert[1] = 1;
|
||||
}
|
||||
|
||||
for (i = 0, p = 0; i < ScreenHeight; i++, p++) {
|
||||
GifQprintf("\b\b\b\b%-4d", ScreenHeight - i);
|
||||
Line = ScreenBuffer[i];
|
||||
|
||||
/* If 8 lines were accumulated in printer buffer - dump them out. */
|
||||
if (p == 8) {
|
||||
for (Len = ScreenWidth-1; Len >= 0; Len--)
|
||||
if (EpsonBuffer[Len]) break;
|
||||
|
||||
/* Only in case this line is not empty: */
|
||||
if (Len++ >= 0) {
|
||||
/* Make the left space, so image will be centered: */
|
||||
for (j = 0; j < LeftCWidth; j++)
|
||||
PutString(Prt, DirectPrint, " ", 1);
|
||||
|
||||
/* Full printer line is ready to be dumped - send it out: */
|
||||
if (NiceFlag) {
|
||||
PutString(Prt, DirectPrint, EPSON_DUAL_DENSITY, 2);
|
||||
LinePrefixLen[0] = (Len * 2) % 256;
|
||||
LinePrefixLen[1] = (Len * 2) / 256;
|
||||
PutString(Prt, DirectPrint, LinePrefixLen, 2);
|
||||
PutString2(Prt, DirectPrint, (char *) EpsonBuffer, Len);
|
||||
}
|
||||
else {
|
||||
PutString(Prt, DirectPrint, EPSON_REG_DENSITY, 2);
|
||||
LinePrefixLen[0] = Len % 256;
|
||||
LinePrefixLen[1] = Len / 256;
|
||||
PutString(Prt, DirectPrint, LinePrefixLen, 2);
|
||||
PutString(Prt, DirectPrint, (char *) EpsonBuffer, Len);
|
||||
}
|
||||
}
|
||||
PutString(Prt, DirectPrint, "\015\012", 2);
|
||||
p = 0;
|
||||
}
|
||||
|
||||
/* We decide right here what method to map Colors to BW so the inner */
|
||||
/* loop will be independent of it (and therefore faster): */
|
||||
switch(ColorToBWMapping) {
|
||||
case C2BW_BACK_GROUND:
|
||||
for (j = 0; j < ScreenWidth; j++)
|
||||
EpsonBuffer[j] = (EpsonBuffer[j] << 1) +
|
||||
MapInvert[Line[j] != BackGround];
|
||||
break;
|
||||
case C2BW_GREY_LEVELS:
|
||||
for (j = 0; j < ScreenWidth; j++) {
|
||||
ColorMapEntry = &ColorMap[Line[j]];
|
||||
/* For the transformation from RGB to BW, see Folley & */
|
||||
/* Van Dam pp 613: The Y channel is the BW we need: */
|
||||
/* As colors are 255 maximum, the result can be up to */
|
||||
/* 25500 which is still in range of our 16 bits integers */
|
||||
EpsonBuffer[j] = (EpsonBuffer[j] << 1) +
|
||||
MapInvert[(30 * (int) ColorMapEntry->Red) +
|
||||
59 * ((int) ColorMapEntry->Green) +
|
||||
11 * ((int) ColorMapEntry->Blue) >
|
||||
BWThreshold];
|
||||
}
|
||||
break;
|
||||
case C2BW_DITHER:
|
||||
if (DitheredLinesLeft-- == 0) {
|
||||
EvalDitheredScanline(ScreenBuffer,
|
||||
(i < ScreenHeight - DitherSize ? i :
|
||||
ScreenHeight - DitherSize),
|
||||
ScreenWidth, DitherBuffer);
|
||||
DitheredLinesLeft = DitherSize - 1;
|
||||
DitheredLinesCount = 0;
|
||||
}
|
||||
Line = DitherBuffer[DitheredLinesCount++];
|
||||
for (j = 0; j < ScreenWidth; j++)
|
||||
EpsonBuffer[j] = (EpsonBuffer[j] << 1) +
|
||||
MapInvert[Line[j]];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* If buffer in incomplete - complete it and dump it out: */
|
||||
if (p != 0) {
|
||||
for (Len = ScreenWidth - 1; Len >= 0; Len--)
|
||||
if (EpsonBuffer[Len]) break;
|
||||
if (Len++ >= 0) {
|
||||
i = 8 - p; /* Amount to shift. */
|
||||
for (j = 0; j < ScreenWidth; j++) EpsonBuffer[j] <<= i;
|
||||
|
||||
/* Make the left space, so image will be centered: */
|
||||
for (j = 0; j < LeftCWidth; j++)
|
||||
PutString(Prt, DirectPrint, " ", 1);
|
||||
|
||||
if (NiceFlag) {
|
||||
PutString(Prt, DirectPrint, EPSON_DUAL_DENSITY, 2);
|
||||
LinePrefixLen[0] = (Len * 2) % 256;
|
||||
LinePrefixLen[1] = (Len * 2) / 256;
|
||||
PutString(Prt, DirectPrint, LinePrefixLen, 2);
|
||||
PutString2(Prt, DirectPrint, (char *) EpsonBuffer, Len);
|
||||
}
|
||||
else {
|
||||
PutString(Prt, DirectPrint, EPSON_REG_DENSITY, 2);
|
||||
LinePrefixLen[0] = Len % 256;
|
||||
LinePrefixLen[1] = Len / 256;
|
||||
PutString(Prt, DirectPrint, LinePrefixLen, 2);
|
||||
PutString(Prt, DirectPrint, (char *) EpsonBuffer, Len);
|
||||
}
|
||||
}
|
||||
PutString(Prt, DirectPrint, "\015\012", 2);
|
||||
}
|
||||
|
||||
fclose(Prt);
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* Dumps the string of given length, to Prt. No char in Str has special *
|
||||
* meaning, and even zero (NULL) chars are dumped. *
|
||||
* If however DirectPrint is non zero, string is dumped to specifed lpt port. *
|
||||
******************************************************************************/
|
||||
static void PutString(FILE *Prt, int DirectPrint, char *Str, int Len)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (DirectPrint) {
|
||||
#ifdef __MSDOS__
|
||||
for (i = 0; i < Len; i++) biosprint(0, Str[i], DirectPrint - 1);
|
||||
#else
|
||||
GIF_EXIT("Can not print directly to a printer if not MSDOS.");
|
||||
#endif /* __MSDOS__ */
|
||||
}
|
||||
else
|
||||
for (i = 0; i < Len; i++) fputc(Str[i], Prt);
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* Dumps the string of given length, to Prt. No char in Str has special *
|
||||
* meaning, and even zero (NULL) chars are dumped. Every char is dumped twice. *
|
||||
* If however DirectPrint is non zero, string is dumped to specifed lpt port. *
|
||||
******************************************************************************/
|
||||
static void PutString2(FILE *Prt, int DirectPrint, char *Str, int Len)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (DirectPrint) {
|
||||
#ifdef __MSDOS__
|
||||
for (i = 0; i < Len; i++) {
|
||||
biosprint(0, Str[i], DirectPrint - 1);
|
||||
biosprint(0, Str[i], DirectPrint - 1);
|
||||
}
|
||||
#else
|
||||
GIF_EXIT("Can not print directly to a printer if not MSDOS.");
|
||||
#endif /* __MSDOS__ */
|
||||
}
|
||||
else
|
||||
for (i = 0; i < Len; i++) {
|
||||
fputc(Str[i], Prt);
|
||||
fputc(Str[i], Prt);
|
||||
}
|
||||
}
|
294
third_party/giflib/util/gif2iris.c
vendored
@ -1,294 +0,0 @@
|
||||
/*****************************************************************************
|
||||
* "Gif-Lib" - Yet another gif library. *
|
||||
* *
|
||||
* Written by: Gershon Elber UNIX Ver 0.1, Jul. 1989 *
|
||||
******************************************************************************
|
||||
* Program to display GIF file under X11 window system. *
|
||||
* Options: *
|
||||
* -q : quiet printing mode. *
|
||||
* -f : force the process to be in foreground. *
|
||||
* -p PosX PosY : defines the position where to put the image. *
|
||||
* -h : on-line help. *
|
||||
******************************************************************************
|
||||
* History: *
|
||||
* 13 mar 90 - Version 1.0 by Gershon Elber. *
|
||||
*****************************************************************************/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#ifdef __MSDOS__
|
||||
#include <graphics.h>
|
||||
#include <alloc.h>
|
||||
#include <io.h>
|
||||
#include <dos.h>
|
||||
#include <bios.h>
|
||||
#endif /* __MSDOS__ */
|
||||
|
||||
#include "gl.h"
|
||||
#include "device.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
#ifdef HAVE_FCNTL_H
|
||||
#include <fcntl.h>
|
||||
#endif /* HAVE_FCNTL_H */
|
||||
#include "gif_lib.h"
|
||||
#include "getarg.h"
|
||||
|
||||
#define PROGRAM_NAME "Gif2Iris"
|
||||
|
||||
#define ABS(x) ((x) > 0 ? (x) : (-(x)))
|
||||
|
||||
#ifdef __MSDOS__
|
||||
extern unsigned int
|
||||
_stklen = 16384; /* Increase default stack size. */
|
||||
#endif /* __MSDOS__ */
|
||||
#ifdef SYSV
|
||||
static char *VersionStr =
|
||||
"Gif toolkit module,\t\tGershon Elber\n\
|
||||
(C) Copyright 1989 Gershon Elber.\n";
|
||||
static char
|
||||
*CtrlStr = "Gif2Iris q%- f%- p%-PosX|PosY!d!d h%- GifFile!*s";
|
||||
#else
|
||||
static char
|
||||
*VersionStr =
|
||||
PROGRAM_NAME
|
||||
GIF_LIB_VERSION
|
||||
" Gershon Elber, "
|
||||
__DATE__ ", " __TIME__ "\n"
|
||||
"(C) Copyright 1989 Gershon Elber.\n";
|
||||
static char
|
||||
*CtrlStr =
|
||||
PROGRAM_NAME
|
||||
" q%- f%- p%-PosX|PosY!d!d h%- GifFile!*s";
|
||||
#endif /* SYSV */
|
||||
|
||||
/* Make some variables global, so we could access them faster: */
|
||||
static int
|
||||
PosFlag = FALSE,
|
||||
HelpFlag = FALSE,
|
||||
ForeGroundFlag = FALSE,
|
||||
ColorMapSize = 0,
|
||||
BackGround = 0,
|
||||
IrisPosX = 0,
|
||||
IrisPosY = 0,
|
||||
InterlacedOffset[] = { 0, 4, 2, 1 }, /* The way Interlaced image should. */
|
||||
InterlacedJumps[] = { 8, 8, 4, 2 }; /* be read - offsets and jumps... */
|
||||
static GifColorType
|
||||
*ColorMap;
|
||||
|
||||
static void Screen2Iris(GifRowType *ScreenBuffer,
|
||||
int ScreenWidth, int ScreenHeight);
|
||||
|
||||
/******************************************************************************
|
||||
* Interpret the command line and scan the given GIF file. *
|
||||
******************************************************************************/
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
int i, j, Error, NumFiles, ImageNum = 0, Size, Row, Col, Width, Height,
|
||||
ExtCode, Count;
|
||||
GifRecordType RecordType;
|
||||
GifByteType *Extension;
|
||||
char **FileName = NULL;
|
||||
GifRowType *ScreenBuffer;
|
||||
GifFileType *GifFile;
|
||||
|
||||
if ((Error = GAGetArgs(argc, argv, CtrlStr,
|
||||
&GifQuietPrint, &ForeGroundFlag,
|
||||
&PosFlag, &IrisPosX, &IrisPosY,
|
||||
&HelpFlag, &NumFiles, &FileName)) != FALSE ||
|
||||
(NumFiles > 1 && !HelpFlag)) {
|
||||
if (Error)
|
||||
GAPrintErrMsg(Error);
|
||||
else if (NumFiles > 1)
|
||||
GIF_MESSAGE("Error in command line parsing - one GIF file please.");
|
||||
GAPrintHowTo(CtrlStr);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if (HelpFlag) {
|
||||
fprintf(stderr, VersionStr);
|
||||
GAPrintHowTo(CtrlStr);
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
if (NumFiles == 1) {
|
||||
if ((GifFile = DGifOpenFileName(*FileName)) == NULL) {
|
||||
PrintGifError();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
else {
|
||||
/* Use the stdin instead: */
|
||||
|
||||
#ifdef __MSDOS__
|
||||
setmode(0, O_BINARY);
|
||||
#endif /* __MSDOS__ */
|
||||
if ((GifFile = DGifOpenFileHandle(0)) == NULL) {
|
||||
PrintGifError();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
|
||||
/* Allocate the screen as vector of column of rows. We cannt allocate */
|
||||
/* the all screen at once, as this broken minded CPU can allocate up to */
|
||||
/* 64k at a time and our image can be bigger than that: */
|
||||
/* Note this screen is device independent - its the screen as defined by */
|
||||
/* the GIF file parameters itself. */
|
||||
if ((ScreenBuffer = (GifRowType *)
|
||||
malloc(GifFile->SHeight * sizeof(GifRowType *))) == NULL)
|
||||
GIF_EXIT("Failed to allocate memory required, aborted.");
|
||||
|
||||
Size = GifFile->SWidth * sizeof(GifPixelType);/* Size in bytes one row.*/
|
||||
if ((ScreenBuffer[0] = (GifRowType) malloc(Size)) == NULL) /* First row. */
|
||||
GIF_EXIT("Failed to allocate memory required, aborted.");
|
||||
|
||||
for (i = 0; i < GifFile->SWidth; i++) /* Set its color to BackGround. */
|
||||
ScreenBuffer[0][i] = GifFile->SBackGroundColor;
|
||||
for (i = 1; i < GifFile->SHeight; i++) {
|
||||
/* Allocate the other rows, and set their color to background too: */
|
||||
if ((ScreenBuffer[i] = (GifRowType) malloc(Size)) == NULL)
|
||||
GIF_EXIT("Failed to allocate memory required, aborted.");
|
||||
|
||||
memcpy(ScreenBuffer[i], ScreenBuffer[0], Size);
|
||||
}
|
||||
|
||||
/* Scan the content of the GIF file and load the image(s) in: */
|
||||
do {
|
||||
if (DGifGetRecordType(GifFile, &RecordType) == GIF_ERROR) {
|
||||
PrintGifError();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
switch (RecordType) {
|
||||
case IMAGE_DESC_RECORD_TYPE:
|
||||
if (DGifGetImageDesc(GifFile) == GIF_ERROR) {
|
||||
PrintGifError();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
Row = GifFile->Image.Top; /* Image Position relative to Screen. */
|
||||
Col = GifFile->Image.Left;
|
||||
Width = GifFile->Image.Width;
|
||||
Height = GifFile->Image.Height;
|
||||
GifQprintf("\n%s: Image %d at (%d, %d) [%dx%d]: ",
|
||||
PROGRAM_NAME, ++ImageNum, Col, Row, Width, Height);
|
||||
if (GifFile->Image.Left + GifFile->Image.Width > GifFile->SWidth ||
|
||||
GifFile->Image.Top + GifFile->Image.Height > GifFile->SHeight) {
|
||||
fprintf(stderr, "Image %d is not confined to screen dimension, aborted.\n", ImageNum);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
if (GifFile->Image.Interlace) {
|
||||
/* Need to perform 4 passes on the images: */
|
||||
for (Count = i = 0; i < 4; i++)
|
||||
for (j = Row + InterlacedOffset[i]; j < Row + Height;
|
||||
j += InterlacedJumps[i]) {
|
||||
GifQprintf("\b\b\b\b%-4d", Count++);
|
||||
if (DGifGetLine(GifFile, &ScreenBuffer[j][Col],
|
||||
Width) == GIF_ERROR) {
|
||||
PrintGifError();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
for (i = 0; i < Height; i++) {
|
||||
GifQprintf("\b\b\b\b%-4d", i);
|
||||
if (DGifGetLine(GifFile, &ScreenBuffer[Row++][Col],
|
||||
Width) == GIF_ERROR) {
|
||||
PrintGifError();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case EXTENSION_RECORD_TYPE:
|
||||
/* Skip any extension blocks in file: */
|
||||
if (DGifGetExtension(GifFile, &ExtCode, &Extension) == GIF_ERROR) {
|
||||
PrintGifError();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
while (Extension != NULL) {
|
||||
if (DGifGetExtensionNext(GifFile, &Extension) == GIF_ERROR) {
|
||||
PrintGifError();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case TERMINATE_RECORD_TYPE:
|
||||
break;
|
||||
default: /* Should be traps by DGifGetRecordType. */
|
||||
break;
|
||||
}
|
||||
}
|
||||
while (RecordType != TERMINATE_RECORD_TYPE);
|
||||
|
||||
/* Lets display it - set the global variables required and do it: */
|
||||
BackGround = GifFile->SBackGroundColor;
|
||||
ColorMap = (GifFile->Image.ColorMap ? GifFile->Image.ColorMap :
|
||||
GifFile->SColorMap);
|
||||
if (ColorMap == NULL) {
|
||||
fprintf(stderr, "Gif Image does not have a colormap\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
ColorMapSize = 1 << ColorMap->BitsPerPixel;
|
||||
GifQprintf("\n");
|
||||
Screen2Iris(ScreenBuffer, GifFile->SWidth, GifFile->SHeight);
|
||||
|
||||
if (DGifCloseFile(GifFile) == GIF_ERROR) {
|
||||
PrintGifError();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* The real display routine. *
|
||||
******************************************************************************/
|
||||
static void Screen2Iris(GifRowType *ScreenBuffer,
|
||||
int ScreenWidth, int ScreenHeight)
|
||||
{
|
||||
short Val;
|
||||
int i, j;
|
||||
unsigned long *IrisScreenBuffer, *PBuffer;
|
||||
|
||||
if (ScreenWidth > XMAXSCREEN + 1 ||
|
||||
ScreenHeight > YMAXSCREEN + 1)
|
||||
GIF_EXIT("Input image is too big.");
|
||||
|
||||
if (PosFlag)
|
||||
prefposition(IrisPosX, IrisPosX + ScreenWidth - 1,
|
||||
IrisPosY, IrisPosY + ScreenHeight - 1);
|
||||
else
|
||||
prefsize(ScreenWidth, ScreenHeight);
|
||||
if (ForeGroundFlag)
|
||||
foreground();
|
||||
|
||||
winopen(PROGRAM_NAME);
|
||||
RGBmode();
|
||||
gconfig();
|
||||
if ((IrisScreenBuffer = (unsigned long *)
|
||||
malloc(ScreenWidth * ScreenHeight * sizeof(unsigned long))) == NULL)
|
||||
GIF_EXIT("Failed to allocate memory required, aborted.");
|
||||
|
||||
PBuffer = IrisScreenBuffer;
|
||||
for (i = ScreenHeight - 1; i >= 0; i--)
|
||||
for (j = 0; j < ScreenWidth; j++)
|
||||
*PBuffer++ = ColorMap[ScreenBuffer[i][j]].Red +
|
||||
(ColorMap[ScreenBuffer[i][j]].Green << 8) +
|
||||
(ColorMap[ScreenBuffer[i][j]].Blue << 16);
|
||||
|
||||
reshapeviewport();
|
||||
lrectwrite(0, 0, ScreenWidth - 1, ScreenHeight - 1, IrisScreenBuffer);
|
||||
|
||||
while (TRUE) {
|
||||
if (qread(&Val) == REDRAW) {
|
||||
reshapeviewport();
|
||||
lrectwrite(0, 0, ScreenWidth - 1, ScreenHeight - 1,
|
||||
IrisScreenBuffer);
|
||||
}
|
||||
}
|
||||
}
|
404
third_party/giflib/util/gif2ps.c
vendored
@ -1,404 +0,0 @@
|
||||
/*****************************************************************************
|
||||
* "Gif-Lib" - Yet another gif library. *
|
||||
* *
|
||||
* Written by: Gershon Elber Ver 0.1, Jul. 1989 *
|
||||
******************************************************************************
|
||||
* Program to dump GIF file into PostScript type printers *
|
||||
* Options: *
|
||||
* -q : quiet printing mode. *
|
||||
* -x : force image to be horizontal. *
|
||||
* -y : force image to be vertical. *
|
||||
* -s x y : force image to be of given size. *
|
||||
* -p x y : force image to be positioned at given position in page. *
|
||||
* -i : invert the image. *
|
||||
* -n n : number of copies. *
|
||||
* -h : on-line help. *
|
||||
******************************************************************************
|
||||
* History: *
|
||||
* 22 Dec 89 - Version 1.0 by Gershon Elber. *
|
||||
*****************************************************************************/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#ifdef __MSDOS__
|
||||
#include <graphics.h>
|
||||
#include <stdlib.h>
|
||||
#include <alloc.h>
|
||||
#include <io.h>
|
||||
#include <dos.h>
|
||||
#include <bios.h>
|
||||
#endif /* __MSDOS__ */
|
||||
|
||||
#ifndef __MSDOS__
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
#ifdef HAVE_FCNTL_H
|
||||
#include <fcntl.h>
|
||||
#endif /* HAVE_FCNTL_H */
|
||||
#include "gif_lib.h"
|
||||
#include "getarg.h"
|
||||
|
||||
#define PROGRAM_NAME "Gif2PS"
|
||||
|
||||
#define PAGE_WIDTH 7.5 /* All dimensions are in inches. */
|
||||
#define PAGE_HEIGHT 9.0
|
||||
#define FULL_PAGE_WIDTH 8.5
|
||||
#define FULL_PAGE_HEIGHT 11.0
|
||||
|
||||
#define UNKNOWN_ORIENT 0
|
||||
#define HORIZONTAL_ORIENT 1
|
||||
#define VERTICAL_ORIENT 2
|
||||
|
||||
#ifdef __MSDOS__
|
||||
extern unsigned int
|
||||
_stklen = 16384; /* Increase default stack size. */
|
||||
#endif /* __MSDOS__ */
|
||||
|
||||
#ifdef SYSV
|
||||
static char *VersionStr =
|
||||
"Gif toolkit module,\t\tGershon Elber\n\
|
||||
(C) Copyright 1989 Gershon Elber.\n";
|
||||
static char
|
||||
*CtrlStr = "Gif2PS q%- x%- y%- s%-SizeX|SizeY!F!F p%-PosX|PosY!F!F i%- n%-#Copies!d h%- GifFile!*s";
|
||||
#else
|
||||
static char
|
||||
*VersionStr =
|
||||
PROGRAM_NAME
|
||||
GIF_LIB_VERSION
|
||||
" Gershon Elber, "
|
||||
__DATE__ ", " __TIME__ "\n"
|
||||
"(C) Copyright 1989 Gershon Elber.\n";
|
||||
static char
|
||||
*CtrlStr =
|
||||
PROGRAM_NAME
|
||||
" q%- x%- y%- s%-SizeX|SizeY!F!F p%-PosX|PosY!F!F i%- n%-#Copies!d h%- GifFile!*s";
|
||||
#endif /* SYSV */
|
||||
|
||||
/* Make some variables global, so we could access them faster: */
|
||||
static int
|
||||
ImageNum = 0,
|
||||
BackGround = 0,
|
||||
ForceXFlag = FALSE,
|
||||
ForceYFlag = FALSE,
|
||||
SizeFlag = FALSE,
|
||||
PosFlag = FALSE,
|
||||
InvertFlag = FALSE,
|
||||
NumCopiesFlag = FALSE,
|
||||
HelpFlag = FALSE,
|
||||
NumOfCopies = 1,
|
||||
InterlacedOffset[] = { 0, 4, 2, 1 }, /* The way Interlaced image should. */
|
||||
InterlacedJumps[] = { 8, 8, 4, 2 }, /* be read - offsets and jumps... */
|
||||
PSOrientation;
|
||||
static double PSSizeX, PSSizeY, PSPosX, PSPosY;
|
||||
static GifColorType
|
||||
*ColorMap;
|
||||
|
||||
static void DumpScreen2PS(GifRowType *ScreenBuffer,
|
||||
int ScreenWidth, int ScreenHeight);
|
||||
static void PutString(unsigned char *Line, int Len);
|
||||
|
||||
/******************************************************************************
|
||||
* Interpret the command line and scan the given GIF file. *
|
||||
******************************************************************************/
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
int i, j, Error, NumFiles, Size, Row, Col, Width, Height, ExtCode, Count;
|
||||
GifRecordType RecordType;
|
||||
GifByteType *Extension;
|
||||
char **FileName = NULL;
|
||||
GifRowType *ScreenBuffer;
|
||||
GifFileType *GifFile;
|
||||
|
||||
if ((Error = GAGetArgs(argc, argv, CtrlStr,&GifQuietPrint,
|
||||
&ForceXFlag, &ForceYFlag, &SizeFlag, &PSSizeX, &PSSizeY,
|
||||
&PosFlag, &PSPosX, &PSPosY,
|
||||
&InvertFlag, &NumCopiesFlag, &NumOfCopies, &HelpFlag,
|
||||
&NumFiles, &FileName)) != FALSE ||
|
||||
(NumFiles > 1 && !HelpFlag)) {
|
||||
if (Error)
|
||||
GAPrintErrMsg(Error);
|
||||
else if (NumFiles > 1)
|
||||
GIF_MESSAGE("Error in command line parsing - one GIF file please.");
|
||||
GAPrintHowTo(CtrlStr);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if (HelpFlag) {
|
||||
fprintf(stderr, VersionStr);
|
||||
GAPrintHowTo(CtrlStr);
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
if (ForceXFlag)
|
||||
PSOrientation = HORIZONTAL_ORIENT;
|
||||
else if (ForceYFlag)
|
||||
PSOrientation = VERTICAL_ORIENT;
|
||||
else
|
||||
PSOrientation = UNKNOWN_ORIENT;
|
||||
|
||||
if (NumFiles == 1) {
|
||||
if ((GifFile = DGifOpenFileName(*FileName)) == NULL) {
|
||||
PrintGifError();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
else {
|
||||
/* Use the stdin instead: */
|
||||
|
||||
#ifdef __MSDOS__
|
||||
setmode(0, O_BINARY);
|
||||
#endif /* __MSDOS__ */
|
||||
if ((GifFile = DGifOpenFileHandle(0)) == NULL) {
|
||||
PrintGifError();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
|
||||
/* Allocate the screen as vector of column of rows. We cannt allocate */
|
||||
/* the all screen at once, as this broken minded CPU can allocate up to */
|
||||
/* 64k at a time and our image can be bigger than that: */
|
||||
/* Note this screen is device independent - its the screen as defined by */
|
||||
/* the GIF file parameters itself. */
|
||||
if ((ScreenBuffer = (GifRowType *)
|
||||
malloc(GifFile->SHeight * sizeof(GifRowType *))) == NULL)
|
||||
GIF_EXIT("Failed to allocate memory required, aborted.");
|
||||
|
||||
Size = GifFile->SWidth * sizeof(GifPixelType);/* Size in bytes one row.*/
|
||||
if ((ScreenBuffer[0] = (GifRowType) malloc(Size)) == NULL) /* First row. */
|
||||
GIF_EXIT("Failed to allocate memory required, aborted.");
|
||||
|
||||
for (i = 0; i < GifFile->SWidth; i++) /* Set its color to BackGround. */
|
||||
ScreenBuffer[0][i] = GifFile->SBackGroundColor;
|
||||
for (i = 1; i < GifFile->SHeight; i++) {
|
||||
/* Allocate the other rows, and set their color to background too: */
|
||||
if ((ScreenBuffer[i] = (GifRowType) malloc(Size)) == NULL)
|
||||
GIF_EXIT("Failed to allocate memory required, aborted.");
|
||||
|
||||
memcpy(ScreenBuffer[i], ScreenBuffer[0], Size);
|
||||
}
|
||||
|
||||
/* Scan the content of the GIF file and load the image(s) in: */
|
||||
do {
|
||||
if (DGifGetRecordType(GifFile, &RecordType) == GIF_ERROR) {
|
||||
PrintGifError();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
switch (RecordType) {
|
||||
case IMAGE_DESC_RECORD_TYPE:
|
||||
if (DGifGetImageDesc(GifFile) == GIF_ERROR) {
|
||||
PrintGifError();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
Row = GifFile->Image.Top; /* Image Position relative to Screen. */
|
||||
Col = GifFile->Image.Left;
|
||||
Width = GifFile->Image.Width;
|
||||
Height = GifFile->Image.Height;
|
||||
GifQprintf("\n%s: Image %d at (%d, %d) [%dx%d]: ",
|
||||
PROGRAM_NAME, ++ImageNum, Col, Row, Width, Height);
|
||||
if (GifFile->Image.Left + GifFile->Image.Width > GifFile->SWidth ||
|
||||
GifFile->Image.Top + GifFile->Image.Height > GifFile->SHeight) {
|
||||
fprintf(stderr, "Image %d is not confined to screen dimension, aborted.\n",ImageNum);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
if (GifFile->Image.Interlace) {
|
||||
/* Need to perform 4 passes on the images: */
|
||||
for (Count = i = 0; i < 4; i++)
|
||||
for (j = Row + InterlacedOffset[i]; j < Row + Height;
|
||||
j += InterlacedJumps[i]) {
|
||||
GifQprintf("\b\b\b\b%-4d", Count++);
|
||||
if (DGifGetLine(GifFile, &ScreenBuffer[j][Col],
|
||||
Width) == GIF_ERROR) {
|
||||
PrintGifError();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
for (i = 0; i < Height; i++) {
|
||||
GifQprintf("\b\b\b\b%-4d", i);
|
||||
if (DGifGetLine(GifFile, &ScreenBuffer[Row++][Col],
|
||||
Width) == GIF_ERROR) {
|
||||
PrintGifError();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case EXTENSION_RECORD_TYPE:
|
||||
/* Skip any extension blocks in file: */
|
||||
if (DGifGetExtension(GifFile, &ExtCode, &Extension) == GIF_ERROR) {
|
||||
PrintGifError();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
while (Extension != NULL) {
|
||||
if (DGifGetExtensionNext(GifFile, &Extension) == GIF_ERROR) {
|
||||
PrintGifError();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case TERMINATE_RECORD_TYPE:
|
||||
break;
|
||||
default: /* Should be traps by DGifGetRecordType. */
|
||||
break;
|
||||
}
|
||||
}
|
||||
while (RecordType != TERMINATE_RECORD_TYPE);
|
||||
|
||||
/* Lets display it - set the global variables required and do it: */
|
||||
BackGround = GifFile->SBackGroundColor;
|
||||
ColorMap = (GifFile->Image.ColorMap
|
||||
? GifFile->Image.ColorMap->Colors
|
||||
: (GifFile->SColorMap ? GifFile->SColorMap->Colors : NULL));
|
||||
if (ColorMap == NULL) {
|
||||
fprintf(stderr, "Gif Image does not have a colormap\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
DumpScreen2PS(ScreenBuffer, GifFile->SWidth, GifFile->SHeight);
|
||||
|
||||
if (DGifCloseFile(GifFile) == GIF_ERROR) {
|
||||
PrintGifError();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* The real dumping routine. *
|
||||
******************************************************************************/
|
||||
static void DumpScreen2PS(GifRowType *ScreenBuffer,
|
||||
int ScreenWidth, int ScreenHeight)
|
||||
{
|
||||
int i, j;
|
||||
double Aspect;
|
||||
GifByteType *OutLine, Data;
|
||||
GifPixelType *Line;
|
||||
GifColorType *ColorMapEntry;
|
||||
|
||||
/* If user did not enforce orientation, pick the best one. */
|
||||
if (PSOrientation == UNKNOWN_ORIENT) {
|
||||
if (ScreenWidth > ScreenHeight) {
|
||||
PSOrientation = VERTICAL_ORIENT;
|
||||
} else {
|
||||
PSOrientation = HORIZONTAL_ORIENT;
|
||||
}
|
||||
}
|
||||
Aspect = ((double) ScreenHeight) / ((double) ScreenWidth);
|
||||
|
||||
if (!SizeFlag)
|
||||
switch (PSOrientation) {
|
||||
case HORIZONTAL_ORIENT:
|
||||
if (Aspect > PAGE_HEIGHT / PAGE_WIDTH) {
|
||||
PSSizeX = PAGE_HEIGHT / Aspect;
|
||||
PSSizeY = PAGE_HEIGHT;
|
||||
}
|
||||
else {
|
||||
PSSizeX = PAGE_WIDTH;
|
||||
PSSizeY = PAGE_WIDTH * Aspect;
|
||||
}
|
||||
break;
|
||||
case VERTICAL_ORIENT:
|
||||
if (1 / Aspect > PAGE_HEIGHT / PAGE_WIDTH) {
|
||||
PSSizeX = PAGE_HEIGHT * Aspect;
|
||||
PSSizeY = PAGE_HEIGHT;
|
||||
}
|
||||
else {
|
||||
PSSizeX = PAGE_WIDTH;
|
||||
PSSizeY = PAGE_WIDTH / Aspect;
|
||||
}
|
||||
break;
|
||||
}
|
||||
else {
|
||||
if (PAGE_WIDTH < PSSizeX) {
|
||||
GIF_MESSAGE("X Size specified is too big, page size selected.");
|
||||
PSSizeX = PAGE_WIDTH;
|
||||
}
|
||||
if (PAGE_HEIGHT < PSSizeY) {
|
||||
GIF_MESSAGE("Y Size specified is too big, page size selected.");
|
||||
PSSizeX = PAGE_HEIGHT;
|
||||
}
|
||||
}
|
||||
|
||||
if (!PosFlag) {
|
||||
PSPosX = (FULL_PAGE_WIDTH - PSSizeX) / 2;
|
||||
PSPosY = (FULL_PAGE_HEIGHT - PSSizeY) / 2;
|
||||
}
|
||||
else {
|
||||
if (PSPosX + PSSizeX > PAGE_WIDTH || PSPosY + PSSizeY > PAGE_HEIGHT)
|
||||
GIF_EXIT("Requested position will put image out of page, aborted.");
|
||||
}
|
||||
|
||||
/* Time to dump out the PostScript header: */
|
||||
printf("%%!\n");
|
||||
printf("%%%%Creator: %s\n", PROGRAM_NAME);
|
||||
printf("/#copies %d def\n", NumOfCopies);
|
||||
printf("gsave\n");
|
||||
printf("72 72 scale\t\t\t\t%% Lets talk inches.\n");
|
||||
printf("/oneline %d string def\t\t\t%% Allocate one scan line.\n",
|
||||
ScreenWidth);
|
||||
printf("/drawimage {\n");
|
||||
printf("\t%d %d 8 [%d 0 0 %d 0 %d]\n", ScreenWidth, ScreenHeight,
|
||||
ScreenWidth, -ScreenHeight, ScreenHeight);
|
||||
printf("\t{ currentfile oneline readhexstring pop } image\n");
|
||||
printf("} def\n");
|
||||
switch (PSOrientation) {
|
||||
case HORIZONTAL_ORIENT:
|
||||
printf("%f %f translate\n", PSPosX, PSPosY);
|
||||
printf("%f %f scale\n", PSSizeX, PSSizeY);
|
||||
break;
|
||||
case VERTICAL_ORIENT:
|
||||
printf("%f %f translate\n", PSPosX + PSSizeX, PSPosY);
|
||||
printf("90 rotate\n");
|
||||
printf("%f %f scale\n", PSSizeY, PSSizeX);
|
||||
break;
|
||||
}
|
||||
printf("drawimage\n");
|
||||
|
||||
if ((OutLine = (GifByteType *) malloc(sizeof(GifByteType) * ScreenWidth))
|
||||
== NULL)
|
||||
GIF_EXIT("Failed to allocate memory required, aborted.");
|
||||
|
||||
for (i = 0; i < ScreenHeight; i++) {
|
||||
GifQprintf("\b\b\b\b%-4d", ScreenHeight - i);
|
||||
|
||||
Line = ScreenBuffer[i];
|
||||
for (j = 0; j < ScreenWidth; j++) {
|
||||
ColorMapEntry = &ColorMap[Line[j]];
|
||||
Data = (30 * ((unsigned int) ColorMapEntry->Red) +
|
||||
59 * ((unsigned int) ColorMapEntry->Green) +
|
||||
11 * ((unsigned int) ColorMapEntry->Blue)) / 100;
|
||||
OutLine[j] = InvertFlag ? 255 - Data : Data;
|
||||
}
|
||||
|
||||
PutString(OutLine, ScreenWidth);
|
||||
}
|
||||
free(OutLine);
|
||||
|
||||
printf("\nshowpage\n");
|
||||
printf("grestore\n");
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* Dumps the string of given length as 2 hexdigits per byte 39 bytes per line. *
|
||||
******************************************************************************/
|
||||
static void PutString(unsigned char *Line, int Len)
|
||||
{
|
||||
int i;
|
||||
static int Counter = 0;
|
||||
static char *Hex = "0123456789ABCDEF";
|
||||
|
||||
for (i = 0; i < Len; i++) {
|
||||
if (++Counter % 40 == 0) {
|
||||
putchar('\n');
|
||||
Counter = 1;
|
||||
}
|
||||
putchar(Hex[Line[i] >> 4]);
|
||||
putchar(Hex[Line[i] & 0x0f]);
|
||||
}
|
||||
}
|
336
third_party/giflib/util/gif2rgb.c
vendored
@ -1,336 +0,0 @@
|
||||
/*****************************************************************************
|
||||
* "Gif-Lib" - Yet another gif library. *
|
||||
* *
|
||||
* Written by: Gershon Elber Ver 0.1, Jul. 1989 *
|
||||
******************************************************************************
|
||||
* Program to convert GIF file to RGB 24 bits. *
|
||||
* Options: *
|
||||
* -q : quiet printing mode. *
|
||||
* -1 : dump as one file using RGBRGB triples. *
|
||||
* -h : on-line help. *
|
||||
* -o FileName : specify the output file name(s). *
|
||||
******************************************************************************
|
||||
* History: *
|
||||
* 5 Jan 90 - Version 1.0 by Gershon Elber. *
|
||||
*****************************************************************************/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#ifdef __MSDOS__
|
||||
#include <graphics.h>
|
||||
#include <stdlib.h>
|
||||
#include <alloc.h>
|
||||
#include <io.h>
|
||||
#include <dos.h>
|
||||
#include <bios.h>
|
||||
#endif /* __MSDOS__ */
|
||||
|
||||
#ifndef __MSDOS__
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
#ifdef HAVE_FCNTL_H
|
||||
#include <fcntl.h>
|
||||
#endif /* HAVE_FCNTL_H */
|
||||
#include "gif_lib.h"
|
||||
#include "getarg.h"
|
||||
|
||||
#define PROGRAM_NAME "Gif2RGB"
|
||||
|
||||
#ifdef __MSDOS__
|
||||
extern unsigned int
|
||||
_stklen = 16384; /* Increase default stack size. */
|
||||
#endif /* __MSDOS__ */
|
||||
|
||||
#ifdef SYSV
|
||||
static char *VersionStr =
|
||||
"Gif toolkit module,\t\tGershon Elber\n\
|
||||
(C) Copyright 1989 Gershon Elber.\n";
|
||||
static char
|
||||
*CtrlStr = "Gif2RGB q%- 1%- o%-OutFileName!s h%- GifFile!*s";
|
||||
#else
|
||||
static char
|
||||
*VersionStr =
|
||||
PROGRAM_NAME
|
||||
GIF_LIB_VERSION
|
||||
" Gershon Elber, "
|
||||
__DATE__ ", " __TIME__ "\n"
|
||||
"(C) Copyright 1989 Gershon Elber.\n";
|
||||
static char
|
||||
*CtrlStr =
|
||||
PROGRAM_NAME
|
||||
" q%- 1%- o%-OutFileName!s h%- GifFile!*s";
|
||||
#endif /* SYSV */
|
||||
|
||||
/* Make some variables global, so we could access them faster: */
|
||||
static int
|
||||
ImageNum = 0,
|
||||
BackGround = 0,
|
||||
OneFileFlag = FALSE,
|
||||
HelpFlag = FALSE,
|
||||
InterlacedOffset[] = { 0, 4, 2, 1 }, /* The way Interlaced image should. */
|
||||
InterlacedJumps[] = { 8, 8, 4, 2 }; /* be read - offsets and jumps... */
|
||||
static ColorMapObject
|
||||
*ColorMap;
|
||||
|
||||
static void DumpScreen2RGB(char *FileName, int OneFileFlag,
|
||||
GifRowType *ScreenBuffer,
|
||||
int ScreenWidth, int ScreenHeight);
|
||||
|
||||
/******************************************************************************
|
||||
* Interpret the command line and scan the given GIF file. *
|
||||
******************************************************************************/
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
int i, j, Error, NumFiles, Size, Row, Col, Width, Height, ExtCode, Count,
|
||||
OutFileFlag = FALSE;
|
||||
GifRecordType RecordType;
|
||||
GifByteType *Extension;
|
||||
char *OutFileName,
|
||||
**FileName = NULL;
|
||||
GifRowType *ScreenBuffer;
|
||||
GifFileType *GifFile;
|
||||
|
||||
if ((Error = GAGetArgs(argc, argv, CtrlStr, &GifQuietPrint,
|
||||
&OneFileFlag, &OutFileFlag, &OutFileName,
|
||||
&HelpFlag, &NumFiles, &FileName)) != FALSE ||
|
||||
(NumFiles > 1 && !HelpFlag)) {
|
||||
if (Error)
|
||||
GAPrintErrMsg(Error);
|
||||
else if (NumFiles > 1)
|
||||
GIF_MESSAGE("Error in command line parsing - one GIF file please.");
|
||||
GAPrintHowTo(CtrlStr);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if (HelpFlag) {
|
||||
fprintf(stderr, VersionStr);
|
||||
GAPrintHowTo(CtrlStr);
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
if (!OutFileFlag) OutFileName = NULL;
|
||||
|
||||
if (NumFiles == 1) {
|
||||
if ((GifFile = DGifOpenFileName(*FileName)) == NULL) {
|
||||
PrintGifError();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
else {
|
||||
/* Use the stdin instead: */
|
||||
|
||||
#ifdef __MSDOS__
|
||||
setmode(0, O_BINARY);
|
||||
#endif /* __MSDOS__ */
|
||||
if ((GifFile = DGifOpenFileHandle(0)) == NULL) {
|
||||
PrintGifError();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
|
||||
/* Allocate the screen as vector of column of rows. We cannt allocate */
|
||||
/* the all screen at once, as this broken minded CPU can allocate up to */
|
||||
/* 64k at a time and our image can be bigger than that: */
|
||||
/* Note this screen is device independent - its the screen as defined by */
|
||||
/* the GIF file parameters itself. */
|
||||
if ((ScreenBuffer = (GifRowType *)
|
||||
malloc(GifFile->SHeight * sizeof(GifRowType *))) == NULL)
|
||||
GIF_EXIT("Failed to allocate memory required, aborted.");
|
||||
|
||||
Size = GifFile->SWidth * sizeof(GifPixelType);/* Size in bytes one row.*/
|
||||
if ((ScreenBuffer[0] = (GifRowType) malloc(Size)) == NULL) /* First row. */
|
||||
GIF_EXIT("Failed to allocate memory required, aborted.");
|
||||
|
||||
for (i = 0; i < GifFile->SWidth; i++) /* Set its color to BackGround. */
|
||||
ScreenBuffer[0][i] = GifFile->SBackGroundColor;
|
||||
for (i = 1; i < GifFile->SHeight; i++) {
|
||||
/* Allocate the other rows, and set their color to background too: */
|
||||
if ((ScreenBuffer[i] = (GifRowType) malloc(Size)) == NULL)
|
||||
GIF_EXIT("Failed to allocate memory required, aborted.");
|
||||
|
||||
memcpy(ScreenBuffer[i], ScreenBuffer[0], Size);
|
||||
}
|
||||
|
||||
/* Scan the content of the GIF file and load the image(s) in: */
|
||||
do {
|
||||
if (DGifGetRecordType(GifFile, &RecordType) == GIF_ERROR) {
|
||||
PrintGifError();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
switch (RecordType) {
|
||||
case IMAGE_DESC_RECORD_TYPE:
|
||||
if (DGifGetImageDesc(GifFile) == GIF_ERROR) {
|
||||
PrintGifError();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
Row = GifFile->Image.Top; /* Image Position relative to Screen. */
|
||||
Col = GifFile->Image.Left;
|
||||
Width = GifFile->Image.Width;
|
||||
Height = GifFile->Image.Height;
|
||||
GifQprintf("\n%s: Image %d at (%d, %d) [%dx%d]: ",
|
||||
PROGRAM_NAME, ++ImageNum, Col, Row, Width, Height);
|
||||
if (GifFile->Image.Left + GifFile->Image.Width > GifFile->SWidth ||
|
||||
GifFile->Image.Top + GifFile->Image.Height > GifFile->SHeight) {
|
||||
fprintf(stderr, "Image %d is not confined to screen dimension, aborted.\n",ImageNum);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
if (GifFile->Image.Interlace) {
|
||||
/* Need to perform 4 passes on the images: */
|
||||
for (Count = i = 0; i < 4; i++)
|
||||
for (j = Row + InterlacedOffset[i]; j < Row + Height;
|
||||
j += InterlacedJumps[i]) {
|
||||
GifQprintf("\b\b\b\b%-4d", Count++);
|
||||
if (DGifGetLine(GifFile, &ScreenBuffer[j][Col],
|
||||
Width) == GIF_ERROR) {
|
||||
PrintGifError();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
for (i = 0; i < Height; i++) {
|
||||
GifQprintf("\b\b\b\b%-4d", i);
|
||||
if (DGifGetLine(GifFile, &ScreenBuffer[Row++][Col],
|
||||
Width) == GIF_ERROR) {
|
||||
PrintGifError();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case EXTENSION_RECORD_TYPE:
|
||||
/* Skip any extension blocks in file: */
|
||||
if (DGifGetExtension(GifFile, &ExtCode, &Extension) == GIF_ERROR) {
|
||||
PrintGifError();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
while (Extension != NULL) {
|
||||
if (DGifGetExtensionNext(GifFile, &Extension) == GIF_ERROR) {
|
||||
PrintGifError();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case TERMINATE_RECORD_TYPE:
|
||||
break;
|
||||
default: /* Should be traps by DGifGetRecordType. */
|
||||
break;
|
||||
}
|
||||
} while (RecordType != TERMINATE_RECORD_TYPE);
|
||||
|
||||
/* Lets dump it - set the global variables required and do it: */
|
||||
BackGround = GifFile->SBackGroundColor;
|
||||
ColorMap = (GifFile->Image.ColorMap
|
||||
? GifFile->Image.ColorMap
|
||||
: GifFile->SColorMap);
|
||||
if (ColorMap == NULL) {
|
||||
fprintf(stderr, "Gif Image does not have a colormap\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
DumpScreen2RGB(OutFileName, OneFileFlag,
|
||||
ScreenBuffer, GifFile->SWidth, GifFile->SHeight);
|
||||
|
||||
if (DGifCloseFile(GifFile) == GIF_ERROR) {
|
||||
PrintGifError();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* The real dumping routine. *
|
||||
******************************************************************************/
|
||||
static void DumpScreen2RGB(char *FileName, int OneFileFlag,
|
||||
GifRowType *ScreenBuffer,
|
||||
int ScreenWidth, int ScreenHeight)
|
||||
{
|
||||
int i, j;
|
||||
GifRowType GifRow;
|
||||
static GifColorType *ColorMapEntry;
|
||||
FILE *f[3];
|
||||
|
||||
if (FileName != NULL) {
|
||||
char OneFileName[80];
|
||||
|
||||
if (OneFileFlag) {
|
||||
if ((f[0] = fopen(FileName, "wb")) == NULL)
|
||||
GIF_EXIT("Can't open input file name.");
|
||||
} else {
|
||||
static char *Postfixes[] = { ".R", ".G", ".B" };
|
||||
|
||||
for (i = 0; i < 3; i++) {
|
||||
strcpy(OneFileName, FileName);
|
||||
strcat(OneFileName, Postfixes[i]);
|
||||
|
||||
if ((f[i] = fopen(OneFileName, "wb")) == NULL) {
|
||||
GIF_EXIT("Can't open input file name.");
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
OneFileFlag = TRUE;
|
||||
|
||||
#ifdef __MSDOS__
|
||||
setmode(0, O_BINARY);
|
||||
#endif /* __MSDOS__ */
|
||||
|
||||
f[0] = stdout;
|
||||
}
|
||||
|
||||
if (OneFileFlag) {
|
||||
unsigned char *Buffer, *BufferP;
|
||||
|
||||
if ((Buffer = (unsigned char *) malloc(ScreenWidth * 3)) == NULL)
|
||||
GIF_EXIT("Failed to allocate memory required, aborted.");
|
||||
for (i = 0; i < ScreenHeight; i++) {
|
||||
GifRow = ScreenBuffer[i];
|
||||
GifQprintf("\b\b\b\b%-4d", ScreenHeight - i);
|
||||
for (j = 0, BufferP = Buffer; j < ScreenWidth; j++) {
|
||||
ColorMapEntry = &ColorMap->Colors[GifRow[j]];
|
||||
*BufferP++ = ColorMapEntry->Red;
|
||||
*BufferP++ = ColorMapEntry->Green;
|
||||
*BufferP++ = ColorMapEntry->Blue;
|
||||
}
|
||||
if (fwrite(Buffer, ScreenWidth * 3, 1, f[0]) != 1)
|
||||
GIF_EXIT("Write to file(s) failed.");
|
||||
}
|
||||
|
||||
free((char *) Buffer);
|
||||
fclose(f[0]);
|
||||
} else {
|
||||
unsigned char *Buffers[3];
|
||||
|
||||
if ((Buffers[0] = (unsigned char *) malloc(ScreenWidth)) == NULL ||
|
||||
(Buffers[1] = (unsigned char *) malloc(ScreenWidth)) == NULL ||
|
||||
(Buffers[2] = (unsigned char *) malloc(ScreenWidth)) == NULL)
|
||||
GIF_EXIT("Failed to allocate memory required, aborted.");
|
||||
|
||||
for (i = 0; i < ScreenHeight; i++) {
|
||||
GifRow = ScreenBuffer[i];
|
||||
GifQprintf("\b\b\b\b%-4d", ScreenHeight - i);
|
||||
for (j = 0; j < ScreenWidth; j++) {
|
||||
ColorMapEntry = &ColorMap->Colors[GifRow[j]];
|
||||
Buffers[0][j] = ColorMapEntry->Red;
|
||||
Buffers[1][j] = ColorMapEntry->Green;
|
||||
Buffers[2][j] = ColorMapEntry->Blue;
|
||||
}
|
||||
if (fwrite(Buffers[0], ScreenWidth, 1, f[0]) != 1 ||
|
||||
fwrite(Buffers[1], ScreenWidth, 1, f[1]) != 1 ||
|
||||
fwrite(Buffers[2], ScreenWidth, 1, f[2]) != 1)
|
||||
GIF_EXIT("Write to file(s) failed.");
|
||||
}
|
||||
|
||||
free((char *) Buffers[0]);
|
||||
free((char *) Buffers[1]);
|
||||
free((char *) Buffers[2]);
|
||||
fclose(f[0]);
|
||||
fclose(f[1]);
|
||||
fclose(f[2]);
|
||||
}
|
||||
}
|
288
third_party/giflib/util/gif2rle.c
vendored
@ -1,288 +0,0 @@
|
||||
/*****************************************************************************
|
||||
* "Gif-Lib" - Yet another gif library. *
|
||||
* *
|
||||
* Written by: Gershon Elber Ver 0.1, Jul. 1989 *
|
||||
******************************************************************************
|
||||
* Program to convert GIF file RLE format (utah raster toolkit). *
|
||||
* Options: *
|
||||
* -q : quiet printing mode. *
|
||||
* -a : add alpha channel with full coverage. *
|
||||
* -h : on-line help. *
|
||||
******************************************************************************
|
||||
* History: *
|
||||
* 5 Jan 90 - Version 1.0 by Gershon Elber. *
|
||||
*****************************************************************************/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#ifdef __MSDOS__
|
||||
#include <graphics.h>
|
||||
#include <alloc.h>
|
||||
#include <io.h>
|
||||
#include <dos.h>
|
||||
#include <bios.h>
|
||||
#endif /* __MSDOS__ */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
#ifdef HAVE_FCNTL_H
|
||||
#include <fcntl.h>
|
||||
#endif /* HAVE_FCNTL_H */
|
||||
#include "gif_lib.h"
|
||||
#include "getarg.h"
|
||||
|
||||
#include "rle.h" /* The rle tool kit header files. */
|
||||
|
||||
#define PROGRAM_NAME "Gif2Rle"
|
||||
|
||||
#ifdef __MSDOS__
|
||||
extern unsigned int
|
||||
_stklen = 16384; /* Increase default stack size. */
|
||||
#endif /* __MSDOS__ */
|
||||
|
||||
#ifdef SYSV
|
||||
static char *VersionStr =
|
||||
"Gif toolkit module,\t\tGershon Elber\n\
|
||||
(C) Copyright 1989 Gershon Elber.\n";
|
||||
static char
|
||||
*CtrlStr = "Gif2Rle q%- a%- h%- GifFile!*s";
|
||||
#else
|
||||
static char
|
||||
*VersionStr =
|
||||
PROGRAM_NAME
|
||||
GIF_LIB_VERSION
|
||||
" Gershon Elber, "
|
||||
__DATE__ ", " __TIME__ "\n"
|
||||
"(C) Copyright 1989 Gershon Elber.\n";
|
||||
static char
|
||||
*CtrlStr =
|
||||
PROGRAM_NAME
|
||||
" q%- a%- h%- GifFile!*s";
|
||||
#endif /* SYSV */
|
||||
|
||||
/* Make some variables global, so we could access them faster: */
|
||||
static int
|
||||
ImageNum = 0,
|
||||
BackGround = 0,
|
||||
AlphaFlag = FALSE,
|
||||
HelpFlag = FALSE,
|
||||
ColorMapSize = 0,
|
||||
InterlacedOffset[] = { 0, 4, 2, 1 }, /* The way Interlaced image should. */
|
||||
InterlacedJumps[] = { 8, 8, 4, 2 }; /* be read - offsets and jumps... */
|
||||
static GifColorType
|
||||
*ColorMap;
|
||||
|
||||
static void DumpScreen2Rle(GifRowType *ScreenBuffer,
|
||||
int ScreenWidth, int ScreenHeight);
|
||||
|
||||
/******************************************************************************
|
||||
* Interpret the command line and scan the given GIF file. *
|
||||
******************************************************************************/
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
int i, j, Error, NumFiles, Size, Row, Col, Width, Height, ExtCode, Count;
|
||||
GifRecordType RecordType;
|
||||
GifByteType *Extension;
|
||||
char **FileName = NULL;
|
||||
GifRowType *ScreenBuffer;
|
||||
GifFileType *GifFile;
|
||||
|
||||
if ((Error = GAGetArgs(argc, argv, CtrlStr, &GifQuietPrint,
|
||||
&AlphaFlag, &HelpFlag, &NumFiles, &FileName)) != FALSE ||
|
||||
(NumFiles > 1 && !HelpFlag)) {
|
||||
if (Error)
|
||||
GAPrintErrMsg(Error);
|
||||
else if (NumFiles > 1)
|
||||
GIF_MESSAGE("Error in command line parsing - one GIF file please.");
|
||||
GAPrintHowTo(CtrlStr);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if (HelpFlag) {
|
||||
fprintf(stderr, VersionStr);
|
||||
GAPrintHowTo(CtrlStr);
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
if (NumFiles == 1) {
|
||||
if ((GifFile = DGifOpenFileName(*FileName)) == NULL) {
|
||||
PrintGifError();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
else {
|
||||
/* Use the stdin instead: */
|
||||
|
||||
#ifdef __MSDOS__
|
||||
setmode(0, O_BINARY);
|
||||
#endif /* __MSDOS__ */
|
||||
if ((GifFile = DGifOpenFileHandle(0)) == NULL) {
|
||||
PrintGifError();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
|
||||
/* Allocate the screen as vector of column of rows. We cannt allocate */
|
||||
/* the all screen at once, as this broken minded CPU can allocate up to */
|
||||
/* 64k at a time and our image can be bigger than that: */
|
||||
/* Note this screen is device independent - its the screen as defined by */
|
||||
/* the GIF file parameters itself. */
|
||||
if ((ScreenBuffer = (GifRowType *)
|
||||
malloc(GifFile->SHeight * sizeof(GifRowType *))) == NULL)
|
||||
GIF_EXIT("Failed to allocate memory required, aborted.");
|
||||
|
||||
Size = GifFile->SWidth * sizeof(GifPixelType);/* Size in bytes one row.*/
|
||||
if ((ScreenBuffer[0] = (GifRowType) malloc(Size)) == NULL) /* First row. */
|
||||
GIF_EXIT("Failed to allocate memory required, aborted.");
|
||||
|
||||
for (i = 0; i < GifFile->SWidth; i++) /* Set its color to BackGround. */
|
||||
ScreenBuffer[0][i] = GifFile->SBackGroundColor;
|
||||
for (i = 1; i < GifFile->SHeight; i++) {
|
||||
/* Allocate the other rows, and set their color to background too: */
|
||||
if ((ScreenBuffer[i] = (GifRowType) malloc(Size)) == NULL)
|
||||
GIF_EXIT("Failed to allocate memory required, aborted.");
|
||||
|
||||
memcpy(ScreenBuffer[i], ScreenBuffer[0], Size);
|
||||
}
|
||||
|
||||
/* Scan the content of the GIF file and load the image(s) in: */
|
||||
do {
|
||||
if (DGifGetRecordType(GifFile, &RecordType) == GIF_ERROR) {
|
||||
PrintGifError();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
switch (RecordType) {
|
||||
case IMAGE_DESC_RECORD_TYPE:
|
||||
if (DGifGetImageDesc(GifFile) == GIF_ERROR) {
|
||||
PrintGifError();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
Row = GifFile->Image.Top; /* Image Position relative to Screen. */
|
||||
Col = GifFile->Image.Left;
|
||||
Width = GifFile->Image.Width;
|
||||
Height = GifFile->Image.Height;
|
||||
GifQprintf("\n%s: Image %d at (%d, %d) [%dx%d]: ",
|
||||
PROGRAM_NAME, ++ImageNum, Col, Row, Width, Height);
|
||||
if (GifFile->Image.Left + GifFile->Image.Width > GifFile->SWidth ||
|
||||
GifFile->Image.Top + GifFile->Image.Height > GifFile->SHeight) {
|
||||
fprintf(stderr, "Image %d is not confined to screen dimension, aborted.\n", ImageNum);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
if (GifFile->Image.Interlace) {
|
||||
/* Need to perform 4 passes on the images: */
|
||||
for (Count = i = 0; i < 4; i++)
|
||||
for (j = Row + InterlacedOffset[i]; j < Row + Height;
|
||||
j += InterlacedJumps[i]) {
|
||||
GifQprintf("\b\b\b\b%-4d", Count++);
|
||||
if (DGifGetLine(GifFile, &ScreenBuffer[j][Col],
|
||||
Width) == GIF_ERROR) {
|
||||
PrintGifError();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
for (i = 0; i < Height; i++) {
|
||||
GifQprintf("\b\b\b\b%-4d", i);
|
||||
if (DGifGetLine(GifFile, &ScreenBuffer[Row++][Col],
|
||||
Width) == GIF_ERROR) {
|
||||
PrintGifError();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case EXTENSION_RECORD_TYPE:
|
||||
/* Skip any extension blocks in file: */
|
||||
if (DGifGetExtension(GifFile, &ExtCode, &Extension) == GIF_ERROR) {
|
||||
PrintGifError();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
while (Extension != NULL) {
|
||||
if (DGifGetExtensionNext(GifFile, &Extension) == GIF_ERROR) {
|
||||
PrintGifError();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case TERMINATE_RECORD_TYPE:
|
||||
break;
|
||||
default: /* Should be traps by DGifGetRecordType. */
|
||||
break;
|
||||
}
|
||||
}
|
||||
while (RecordType != TERMINATE_RECORD_TYPE);
|
||||
|
||||
/* Lets display it - set the global variables required and do it: */
|
||||
BackGround = GifFile->SBackGroundColor;
|
||||
ColorMap = (GifFile->Image.ColorMap ?
|
||||
GifFile->Image.ColorMap->Colors :
|
||||
GifFile->SColorMap->Colors);
|
||||
if (ColorMap == NULL) {
|
||||
fprintf(stderr, "Gif Image does not have a colormap\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
ColorMapSize = 1 << ColorMap->BitsPerPixel;
|
||||
DumpScreen2Rle(ScreenBuffer, GifFile->SWidth, GifFile->SHeight);
|
||||
|
||||
if (DGifCloseFile(GifFile) == GIF_ERROR) {
|
||||
PrintGifError();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* The real dumping routine. *
|
||||
******************************************************************************/
|
||||
static void DumpScreen2Rle(GifRowType *ScreenBuffer,
|
||||
int ScreenWidth, int ScreenHeight)
|
||||
{
|
||||
int i, j;
|
||||
char Comment[80];
|
||||
rle_pixel *rows[4];
|
||||
GifRowType GifRow;
|
||||
static GifColorType
|
||||
*ColorMapEntry;
|
||||
|
||||
if (AlphaFlag) RLE_SET_BIT(rle_dflt_hdr, RLE_ALPHA);
|
||||
rle_dflt_hdr.alpha = AlphaFlag != 0;
|
||||
rle_dflt_hdr.rle_file = stdout;
|
||||
rle_dflt_hdr.xmin = 0;
|
||||
rle_dflt_hdr.ymin = 0;
|
||||
rle_dflt_hdr.xmax = ScreenWidth - 1;
|
||||
rle_dflt_hdr.ymax = ScreenHeight - 1;
|
||||
sprintf(Comment, "origin=GIF format, %d colors.", ColorMapSize);
|
||||
rle_putcom(Comment, &rle_dflt_hdr);
|
||||
rle_put_setup(&rle_dflt_hdr);
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
if ((rows[i] = (rle_pixel *) malloc(sizeof(rle_pixel) * ScreenWidth))
|
||||
== NULL)
|
||||
GIF_EXIT("Failed to allocated memory required, aborted.");
|
||||
|
||||
if (AlphaFlag) {
|
||||
/* Initial the alpha channel to full coverage: */
|
||||
for (i = 0; i < ScreenWidth; i++) rows[0][i] = 255;
|
||||
}
|
||||
|
||||
for (i = 0; i < ScreenHeight; i++) {
|
||||
/* Flip the image vertically as rle files start at the bollom... */
|
||||
GifRow = ScreenBuffer[ScreenHeight - i - 1];
|
||||
GifQprintf("\b\b\b\b%-4d", ScreenHeight - i);
|
||||
for (j = 0; j < ScreenWidth; j++) {
|
||||
ColorMapEntry = &ColorMap[GifRow[j]];
|
||||
rows[1][j] = ColorMapEntry->Red;
|
||||
rows[2][j] = ColorMapEntry->Green;
|
||||
rows[3][j] = ColorMapEntry->Blue;
|
||||
}
|
||||
rle_putrow( &rows[1], ScreenWidth, &rle_dflt_hdr );
|
||||
}
|
||||
|
||||
rle_puteof( &rle_dflt_hdr );
|
||||
}
|
563
third_party/giflib/util/gif2x11.c
vendored
@ -1,563 +0,0 @@
|
||||
/*****************************************************************************
|
||||
* "Gif-Lib" - Yet another gif library. *
|
||||
* *
|
||||
* Written by: Gershon Elber Ver 0.1, Jul. 1989 *
|
||||
******************************************************************************
|
||||
* Program to display GIF file under X11 window system. *
|
||||
* Options: *
|
||||
* -q : quiet printing mode. *
|
||||
* -p PosX PosY : defines the position where to put the image. *
|
||||
* -d Display : what display should go to. *
|
||||
* -f : force attempt to allocate the exact colors. This usually look bad... *
|
||||
* -h : on-line help. *
|
||||
******************************************************************************
|
||||
* History: *
|
||||
* 28 Dec 89 - Version 1.0 by Gershon Elber, color allocation is based on the *
|
||||
* xgif program by John Bradley, bradley@cis.ipenn.edu. *
|
||||
*****************************************************************************/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#ifdef __MSDOS__
|
||||
#include <graphics.h>
|
||||
#include <stdlib.h>
|
||||
#include <alloc.h>
|
||||
#include <io.h>
|
||||
#include <dos.h>
|
||||
#include <bios.h>
|
||||
#endif /* __MSDOS__ */
|
||||
|
||||
#ifdef HAVE_LIBX11
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xutil.h>
|
||||
#include <X11/cursorfont.h>
|
||||
#endif /* HAVE_LIBX11 */
|
||||
|
||||
#ifndef __MSDOS__
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
#ifdef HAVE_FCNTL_H
|
||||
#include <fcntl.h>
|
||||
#endif /* HAVE_FCNTL_H */
|
||||
#include "gif_lib.h"
|
||||
#include "getarg.h"
|
||||
|
||||
#define PROGRAM_NAME "Gif2X11"
|
||||
|
||||
#define ICON_SIZE 60
|
||||
#define ABS(x) ((x) > 0 ? (x) : (-(x)))
|
||||
|
||||
#ifdef __MSDOS__
|
||||
extern unsigned int
|
||||
_stklen = 16384; /* Increase default stack size. */
|
||||
#endif /* __MSDOS__ */
|
||||
#ifdef SYSV
|
||||
static char *VersionStr =
|
||||
"Gif toolkit module,\t\tGershon Elber\n\
|
||||
(C) Copyright 1989 Gershon Elber.\n";
|
||||
static char
|
||||
*CtrlStr = "Gif2X11 q%- p%-PosX|PosY!d!d d%-Display!s f%- h%- GifFile!*s";
|
||||
#else
|
||||
static char
|
||||
*VersionStr =
|
||||
PROGRAM_NAME
|
||||
GIF_LIB_VERSION
|
||||
" Gershon Elber, "
|
||||
__DATE__ ", " __TIME__ "\n"
|
||||
"(C) Copyright 1989 Gershon Elber.\n";
|
||||
static char
|
||||
*CtrlStr =
|
||||
PROGRAM_NAME
|
||||
" q%- p%-PosX|PosY!d!d d%-Display!s f%- h%- GifFile!*s";
|
||||
#endif /* SYSV */
|
||||
|
||||
/* Make some variables global, so we could access them faster: */
|
||||
static int
|
||||
PosFlag = FALSE,
|
||||
HelpFlag = FALSE,
|
||||
DisplayFlag = FALSE,
|
||||
ForceFlag = FALSE,
|
||||
ColorMapSize = 0,
|
||||
BackGround = 0,
|
||||
XPosX = 0,
|
||||
XPosY = 0,
|
||||
InterlacedOffset[] = { 0, 4, 2, 1 }, /* The way Interlaced image should. */
|
||||
InterlacedJumps[] = { 8, 8, 4, 2 }; /* be read - offsets and jumps... */
|
||||
static char
|
||||
*DisplayName = NULL;
|
||||
static ColorMapObject
|
||||
*ColorMap;
|
||||
|
||||
/* X specific staff goes here. XColorTable will hold the GIF image colors, */
|
||||
/* while XPixelTable will hold the pixel number so we can redirect through */
|
||||
/* it when forming the image bitmap in X format. */
|
||||
/* Note the table has 256 entry which is the maximum allowed in GIF format. */
|
||||
static XColor XColorTable[256];
|
||||
static unsigned long XPixelTable[256];
|
||||
static Display *XDisplay;
|
||||
static int XScreen;
|
||||
static Window Xroot, XImageWndw;
|
||||
static Colormap XColorMap;
|
||||
static GC XGraphContext;
|
||||
static Visual *XVisual;
|
||||
static XImage *XImageBuffer;
|
||||
static Pixmap XIcon;
|
||||
static Cursor XCursor;
|
||||
|
||||
#define BYTESPERPIXEL 4
|
||||
|
||||
static void Screen2X(int argc, char **argv, GifRowType *ScreenBuffer,
|
||||
int ScreenWidth, int ScreenHeight);
|
||||
static void AllocateColors1(void);
|
||||
static void AllocateColors2(void);
|
||||
|
||||
/******************************************************************************
|
||||
* Interpret the command line and scan the given GIF file. *
|
||||
******************************************************************************/
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
int i, j, Error, NumFiles, ImageNum = 0, Size, Row, Col, Width, Height,
|
||||
ExtCode, Count;
|
||||
GifRecordType RecordType;
|
||||
GifByteType *Extension;
|
||||
char **FileName = NULL;
|
||||
GifRowType *ScreenBuffer;
|
||||
GifFileType *GifFile;
|
||||
|
||||
if ((Error = GAGetArgs(argc, argv, CtrlStr,
|
||||
&GifQuietPrint, &PosFlag, &XPosX, &XPosY,
|
||||
&DisplayFlag, &DisplayName, &ForceFlag,
|
||||
&HelpFlag, &NumFiles, &FileName)) != FALSE ||
|
||||
(NumFiles > 1 && !HelpFlag)) {
|
||||
if (Error)
|
||||
GAPrintErrMsg(Error);
|
||||
else if (NumFiles > 1)
|
||||
GIF_MESSAGE("Error in command line parsing - one GIF file please.");
|
||||
GAPrintHowTo(CtrlStr);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if (HelpFlag) {
|
||||
fprintf(stderr, VersionStr);
|
||||
GAPrintHowTo(CtrlStr);
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
if (NumFiles == 1) {
|
||||
if ((GifFile = DGifOpenFileName(*FileName)) == NULL) {
|
||||
PrintGifError();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
else {
|
||||
/* Use the stdin instead: */
|
||||
|
||||
#ifdef __MSDOS__
|
||||
setmode(0, O_BINARY);
|
||||
#endif /* __MSDOS__ */
|
||||
if ((GifFile = DGifOpenFileHandle(0)) == NULL) {
|
||||
PrintGifError();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
|
||||
/* Lets see if we can get access to the X server before we even start: */
|
||||
if ((XDisplay = (Display *) XOpenDisplay(DisplayName)) == NULL)
|
||||
GIF_EXIT("Failed to access X server, abored.");
|
||||
XScreen = DefaultScreen(XDisplay);
|
||||
Xroot = RootWindow(XDisplay, XScreen);
|
||||
XColorMap = DefaultColormap(XDisplay, XScreen);
|
||||
XGraphContext = DefaultGC(XDisplay, XScreen);
|
||||
XVisual = DefaultVisual(XDisplay, XScreen);
|
||||
XSetBackground(XDisplay, XGraphContext, BlackPixel(XDisplay, XScreen));
|
||||
XSetForeground(XDisplay, XGraphContext, WhitePixel(XDisplay, XScreen));
|
||||
|
||||
/* Allocate the screen as vector of column of rows. We cannt allocate */
|
||||
/* the all screen at once, as this broken minded CPU can allocate up to */
|
||||
/* 64k at a time and our image can be bigger than that: */
|
||||
/* Note this screen is device independent - its the screen as defined by */
|
||||
/* the GIF file parameters itself. */
|
||||
if ((ScreenBuffer = (GifRowType *)
|
||||
malloc(GifFile->SHeight * sizeof(GifRowType *))) == NULL)
|
||||
GIF_EXIT("Failed to allocate memory required, aborted.");
|
||||
|
||||
Size = GifFile->SWidth * sizeof(GifPixelType);/* Size in bytes one row.*/
|
||||
if ((ScreenBuffer[0] = (GifRowType) malloc(Size)) == NULL) /* First row. */
|
||||
GIF_EXIT("Failed to allocate memory required, aborted.");
|
||||
|
||||
for (i = 0; i < GifFile->SWidth; i++) /* Set its color to BackGround. */
|
||||
ScreenBuffer[0][i] = GifFile->SBackGroundColor;
|
||||
for (i = 1; i < GifFile->SHeight; i++) {
|
||||
/* Allocate the other rows, and set their color to background too: */
|
||||
if ((ScreenBuffer[i] = (GifRowType) malloc(Size)) == NULL)
|
||||
GIF_EXIT("Failed to allocate memory required, aborted.");
|
||||
|
||||
memcpy(ScreenBuffer[i], ScreenBuffer[0], Size);
|
||||
}
|
||||
|
||||
/* Scan the content of the GIF file and load the image(s) in: */
|
||||
do {
|
||||
if (DGifGetRecordType(GifFile, &RecordType) == GIF_ERROR) {
|
||||
PrintGifError();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
switch (RecordType) {
|
||||
case IMAGE_DESC_RECORD_TYPE:
|
||||
if (DGifGetImageDesc(GifFile) == GIF_ERROR) {
|
||||
PrintGifError();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
Row = GifFile->Image.Top; /* Image Position relative to Screen. */
|
||||
Col = GifFile->Image.Left;
|
||||
Width = GifFile->Image.Width;
|
||||
Height = GifFile->Image.Height;
|
||||
GifQprintf("\n%s: Image %d at (%d, %d) [%dx%d]: ",
|
||||
PROGRAM_NAME, ++ImageNum, Col, Row, Width, Height);
|
||||
if (GifFile->Image.Left + GifFile->Image.Width > GifFile->SWidth ||
|
||||
GifFile->Image.Top + GifFile->Image.Height > GifFile->SHeight) {
|
||||
fprintf(stderr, "Image %d is not confined to screen dimension, aborted.\n",ImageNum);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
if (GifFile->Image.Interlace) {
|
||||
/* Need to perform 4 passes on the images: */
|
||||
for (Count = i = 0; i < 4; i++)
|
||||
for (j = Row + InterlacedOffset[i]; j<Row + Height;
|
||||
j += InterlacedJumps[i]) {
|
||||
GifQprintf("\b\b\b\b%-4d", Count++);
|
||||
if (DGifGetLine(GifFile, &ScreenBuffer[j][Col],
|
||||
Width) == GIF_ERROR) {
|
||||
PrintGifError();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
for (i = 0; i < Height; i++) {
|
||||
GifQprintf("\b\b\b\b%-4d", i);
|
||||
if (DGifGetLine(GifFile, &ScreenBuffer[Row++][Col],
|
||||
Width) == GIF_ERROR) {
|
||||
PrintGifError();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case EXTENSION_RECORD_TYPE:
|
||||
/* Skip any extension blocks in file: */
|
||||
if (DGifGetExtension(GifFile, &ExtCode, &Extension) == GIF_ERROR) {
|
||||
PrintGifError();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
while (Extension != NULL) {
|
||||
if (DGifGetExtensionNext(GifFile, &Extension) == GIF_ERROR) {
|
||||
PrintGifError();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case TERMINATE_RECORD_TYPE:
|
||||
break;
|
||||
default: /* Should be traps by DGifGetRecordType. */
|
||||
break;
|
||||
}
|
||||
}
|
||||
while (RecordType != TERMINATE_RECORD_TYPE);
|
||||
|
||||
/* Lets display it - set the global variables required and do it: */
|
||||
BackGround = GifFile->SBackGroundColor;
|
||||
ColorMap = (GifFile->Image.ColorMap
|
||||
? GifFile->Image.ColorMap
|
||||
: GifFile->SColorMap);
|
||||
if (ColorMap == NULL) {
|
||||
fprintf(stderr, "Gif Image does not have a colormap\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
ColorMapSize = ColorMap->ColorCount;
|
||||
Screen2X(argc, argv, ScreenBuffer, GifFile->SWidth, GifFile->SHeight);
|
||||
|
||||
for (i = GifFile->SHeight - 1 ; i >= 0 ; i--) {
|
||||
free( ScreenBuffer[ i ] );
|
||||
}
|
||||
free( ScreenBuffer );
|
||||
if ( XImageBuffer != (XImage *) NULL )
|
||||
XDestroyImage( XImageBuffer );
|
||||
|
||||
if ( XIcon )
|
||||
XFreePixmap( XDisplay , XIcon );
|
||||
|
||||
if (DGifCloseFile(GifFile) == GIF_ERROR) {
|
||||
PrintGifError();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
GifQprintf("\n");
|
||||
|
||||
return 0 ;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* The real display routine. *
|
||||
******************************************************************************/
|
||||
static void Screen2X(int argc, char **argv, GifRowType *ScreenBuffer,
|
||||
int ScreenWidth, int ScreenHeight)
|
||||
{
|
||||
#define WM_DELETE_WINDOW "WM_DELETE_WINDOW"
|
||||
|
||||
Status rc ;
|
||||
Atom atomKill ;
|
||||
|
||||
int i, j, c, Size, x, y,
|
||||
MinIntensity, MaxIntensity, AvgIntensity, IconSizeX, IconSizeY;
|
||||
char *XImageData, *XIconData, KeyBuffer[81];
|
||||
unsigned long ValueMask;
|
||||
GifColorType *ColorMapEntry = ColorMap->Colors;
|
||||
XSetWindowAttributes SetWinAttr;
|
||||
XSizeHints Hints;
|
||||
XEvent Event;
|
||||
XExposeEvent *EEvent;
|
||||
XKeyEvent *KEvent;
|
||||
XComposeStatus Stat;
|
||||
KeySym KS;
|
||||
|
||||
/* Let find out what are the intensities in the color map: */
|
||||
MaxIntensity = 0;
|
||||
MinIntensity = 256 * 100;
|
||||
for (i = 0; i < ColorMapSize; i++) {
|
||||
c = ColorMapEntry[i].Red * 30 +
|
||||
ColorMapEntry[i].Green * 59 +
|
||||
ColorMapEntry[i].Blue * 11;
|
||||
if (c > MaxIntensity) MaxIntensity = c;
|
||||
if (c < MinIntensity) MinIntensity = c;
|
||||
}
|
||||
AvgIntensity = (MinIntensity + MaxIntensity) / 2;
|
||||
|
||||
/* The big trick here is to select the colors so lets do this first: */
|
||||
if (ForceFlag)
|
||||
AllocateColors2();
|
||||
else
|
||||
AllocateColors1();
|
||||
|
||||
SetWinAttr.background_pixel = BlackPixel( XDisplay, XScreen );
|
||||
SetWinAttr.border_pixel = WhitePixel( XDisplay, XScreen );
|
||||
ValueMask = CWBackPixel | CWBorderPixel;
|
||||
|
||||
Hints.flags = PSize | PMinSize | PMaxSize;
|
||||
Hints.x = Hints.y = 1;
|
||||
Hints.width = Hints.min_width = Hints.max_width = ScreenWidth;
|
||||
Hints.height = Hints.min_height = Hints.max_height = ScreenHeight;
|
||||
if (PosFlag) {
|
||||
Hints.flags |= USPosition;
|
||||
Hints.x = XPosX;
|
||||
Hints.y = XPosY;
|
||||
}
|
||||
|
||||
XImageWndw = XCreateWindow(XDisplay, Xroot, XPosX, XPosY,
|
||||
ScreenWidth, ScreenHeight,
|
||||
1, 0,
|
||||
CopyFromParent, CopyFromParent,
|
||||
ValueMask, &SetWinAttr);
|
||||
|
||||
/* Set up the icon bit map to be a shrinked BW version of the image: */
|
||||
if (ScreenWidth > ScreenHeight) {
|
||||
IconSizeX = (ICON_SIZE / 8) * 8;
|
||||
IconSizeY = (ScreenHeight * ICON_SIZE) / ScreenWidth;
|
||||
}
|
||||
else {
|
||||
IconSizeY = ICON_SIZE;
|
||||
IconSizeX = (((ScreenWidth * ICON_SIZE) / ScreenHeight) / 8) * 8;
|
||||
}
|
||||
XIconData = (char *) malloc(IconSizeX * IconSizeY / 8);
|
||||
memset(XIconData, 0, IconSizeX * IconSizeY / 8);
|
||||
for (i = 0; i < IconSizeY; i++) {
|
||||
y = (i * ScreenHeight / IconSizeY);
|
||||
Size = i * IconSizeX / 8;
|
||||
for (j = 0; j < IconSizeX; j++) {
|
||||
x = j * ScreenWidth / IconSizeX;
|
||||
c = ScreenBuffer[y][x];
|
||||
c = ColorMapEntry[c].Red * 30 +
|
||||
ColorMapEntry[c].Green * 59 +
|
||||
ColorMapEntry[c].Blue * 11 > AvgIntensity;
|
||||
XIconData[Size + j / 8] |= c << (j % 8);
|
||||
}
|
||||
}
|
||||
|
||||
XIcon = XCreateBitmapFromData(XDisplay, XImageWndw, XIconData,
|
||||
IconSizeX, IconSizeY);
|
||||
|
||||
XSetStandardProperties(XDisplay, XImageWndw,
|
||||
PROGRAM_NAME, PROGRAM_NAME, XIcon,
|
||||
argv, argc,
|
||||
&Hints);
|
||||
|
||||
free( XIconData );
|
||||
|
||||
atomKill = XInternAtom(XDisplay, WM_DELETE_WINDOW, False );
|
||||
rc = XSetWMProtocols( XDisplay, XImageWndw , &atomKill , 1 );
|
||||
if ( rc == 0 )
|
||||
GIF_EXIT("Failed to trap WM_DELETE_WINDOW event" );
|
||||
|
||||
XSelectInput(XDisplay, XImageWndw, ExposureMask | KeyPressMask);
|
||||
|
||||
/* Set out own cursor: */
|
||||
XCursor = XCreateFontCursor(XDisplay, XC_diamond_cross);
|
||||
XDefineCursor(XDisplay, XImageWndw, XCursor);
|
||||
|
||||
XMapWindow(XDisplay, XImageWndw);
|
||||
|
||||
/* Create the image in X format: */
|
||||
if ((XImageData = (char *) malloc(ScreenWidth * ScreenHeight * BYTESPERPIXEL)) == NULL)
|
||||
GIF_EXIT("Failed to allocate memory required, aborted.");
|
||||
|
||||
for (i = 0; i < ScreenHeight; i++) {
|
||||
y = i * ScreenWidth;
|
||||
for (j = 0; j < ScreenWidth; j++) {
|
||||
XImageData[(y + j)*BYTESPERPIXEL] = XColorTable[ScreenBuffer[i][j]].blue;
|
||||
XImageData[(y + j)*BYTESPERPIXEL+1] = XColorTable[ScreenBuffer[i][j]].green;
|
||||
XImageData[(y + j)*BYTESPERPIXEL+2] = XColorTable[ScreenBuffer[i][j]].red;
|
||||
}
|
||||
}
|
||||
XImageBuffer = XCreateImage(XDisplay, XVisual, DefaultDepth(XDisplay, DefaultScreen(XDisplay)), ZPixmap, 0,
|
||||
XImageData, ScreenWidth, ScreenHeight,
|
||||
BitmapPad(XDisplay), ScreenWidth*BYTESPERPIXEL);
|
||||
|
||||
while (TRUE) {
|
||||
XNextEvent(XDisplay, &Event);
|
||||
switch (Event.type) {
|
||||
case Expose:
|
||||
EEvent = (XExposeEvent *) &Event;
|
||||
XPutImage(XDisplay, XImageWndw, XGraphContext, XImageBuffer,
|
||||
EEvent->x, EEvent->y,
|
||||
EEvent->x, EEvent->y,
|
||||
EEvent->width, EEvent->height);
|
||||
break;
|
||||
case KeyPress:
|
||||
KEvent = (XKeyEvent *) &Event;
|
||||
XLookupString(KEvent, KeyBuffer, 80, &KS, &Stat);
|
||||
if (KeyBuffer[0] == 3) return;
|
||||
/* if (KeyBuffer[0] == 3) { free(XImageData ); return; } made by XDestroyImage */
|
||||
break;
|
||||
case ClientMessage :
|
||||
if ( Event.xclient.data.l[0] == atomKill ) return ;
|
||||
break ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* Routine to allocate the requested colors from the X server. *
|
||||
* Colors are allocated until success by stripping off the least bits of the *
|
||||
* colors. *
|
||||
******************************************************************************/
|
||||
static void AllocateColors1(void)
|
||||
{
|
||||
int Strip, Msk, i;
|
||||
char Msg[80];
|
||||
|
||||
for (i = 0; i < 256; i++)
|
||||
XPixelTable[i] = 0; /* Put reasonable color for out of range. */
|
||||
|
||||
for (Strip = 0, Msk = 0xff; Strip < 8; Strip++, Msk <<= 1) {
|
||||
for (i = 0; i < ColorMapSize; i++) {
|
||||
/* Prepare color entry in X format. */
|
||||
XColorTable[i].red = (ColorMap->Colors[i].Red & Msk) << 8;
|
||||
XColorTable[i].green = (ColorMap->Colors[i].Green & Msk) << 8;
|
||||
XColorTable[i].blue = (ColorMap->Colors[i].Blue & Msk) << 8;
|
||||
XColorTable[i].flags = DoRed | DoGreen | DoBlue;
|
||||
if (XAllocColor(XDisplay, XColorMap, &XColorTable[i]))
|
||||
XPixelTable[i] = XColorTable[i].pixel;
|
||||
else
|
||||
break;
|
||||
}
|
||||
if (i < ColorMapSize)
|
||||
XFreeColors(XDisplay, XColorMap, XPixelTable, i, 0L);
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
if (Strip == 8)
|
||||
GIF_EXIT("Can not display the image - not enough colors available.");
|
||||
|
||||
if (Strip != 0) {
|
||||
sprintf(Msg, "%d bits were stripped off the color map.", Strip);
|
||||
GIF_MESSAGE(Msg);
|
||||
}
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* Routine to allocate the requested colors from the X server. *
|
||||
* Two stages are performed: *
|
||||
* 1. Colors are requested directly. *
|
||||
* 2. If not enough colors can be allocated, the closest current color *
|
||||
* in current table is selected instead. *
|
||||
* This allocation is not optimal as when fail to allocate all colors one *
|
||||
* should pick the right colors to do allocate in order to minimize the *
|
||||
* closest distance from the unallocated ones under some norm (what is a good *
|
||||
* norm for the RGB space?). Improve it if you are bored. *
|
||||
******************************************************************************/
|
||||
static void AllocateColors2(void)
|
||||
{
|
||||
int i, j, Index = 0, Count = 0, XNumOfColors;
|
||||
char Msg[80];
|
||||
unsigned long D, Distance, AvgDistance = 0, Red, Green, Blue;
|
||||
GifBooleanType Failed = FALSE;
|
||||
XColor *XOldColorTable;
|
||||
|
||||
for (i = 0; i < 256; i++) {
|
||||
if (i < ColorMapSize) { /* Prepere color entry in X format. */
|
||||
XColorTable[i].red = ColorMap->Colors[i].Red << 8;
|
||||
XColorTable[i].green = ColorMap->Colors[i].Green << 8;
|
||||
XColorTable[i].blue = ColorMap->Colors[i].Blue << 8;
|
||||
XColorTable[i].flags = DoRed | DoGreen | DoBlue;
|
||||
XPixelTable[i] = -1; /* Not allocated yet. */
|
||||
}
|
||||
else
|
||||
XPixelTable[i] = 0; /* Put reasonable color for out of range. */
|
||||
}
|
||||
|
||||
for (i = 0; i < ColorMapSize; i++) /* Allocate the colors from X: */
|
||||
if (XAllocColor(XDisplay, XColorMap, &XColorTable[i]))
|
||||
XPixelTable[i] = XColorTable[i].pixel;
|
||||
else
|
||||
Failed = TRUE;
|
||||
|
||||
if (Failed) {
|
||||
XNumOfColors = DisplayCells(XDisplay, XScreen);
|
||||
XOldColorTable = (XColor *) malloc(sizeof(XColor) * XNumOfColors);
|
||||
for (i = 0; i < XNumOfColors; i++) XOldColorTable[i].pixel = i;
|
||||
XQueryColors(XDisplay, XColorMap, XOldColorTable, XNumOfColors);
|
||||
|
||||
for (i = 0; i < ColorMapSize; i++) {
|
||||
/* Allocate closest colors from X: */
|
||||
if (XPixelTable[i] == -1) { /* Failed to allocate this one. */
|
||||
Distance = 0xffffffff;
|
||||
|
||||
Red = XColorTable[i].red;
|
||||
Green = XColorTable[i].green;
|
||||
Blue = XColorTable[i].blue;
|
||||
|
||||
for (j = 0; j < XNumOfColors; j++) {
|
||||
/* Find the closest color in 3D RGB space using L1 norm. */
|
||||
if ((D = ABS(Red - XOldColorTable[j].red) +
|
||||
ABS(Green - XOldColorTable[j].green) +
|
||||
ABS(Blue - XOldColorTable[j].blue)) < Distance) {
|
||||
Distance = D;
|
||||
Index = j;
|
||||
}
|
||||
}
|
||||
XPixelTable[i] = Index;
|
||||
|
||||
AvgDistance += Distance;
|
||||
Count++;
|
||||
}
|
||||
}
|
||||
free(XOldColorTable);
|
||||
|
||||
sprintf(Msg, "Colors will be approximated (average error = %ld).\n",
|
||||
AvgDistance / Count);
|
||||
GIF_MESSAGE(Msg);
|
||||
}
|
||||
}
|
415
third_party/giflib/util/gifasm.c
vendored
@ -1,415 +0,0 @@
|
||||
/*****************************************************************************
|
||||
* "Gif-Lib" - Yet another gif library. *
|
||||
* *
|
||||
* Written by: Gershon Elber Ver 0.1, Jul. 1989 *
|
||||
******************************************************************************
|
||||
* Program to assemble/disassemble GIF files: disassembles multi image file *
|
||||
* into seperated files, or assembles few single image GIF files into one. *
|
||||
* Options: *
|
||||
* -q : quiet printing mode. *
|
||||
* -A : assemble few files into one as an animation gif. *
|
||||
* -a : assemble few files into one (default) *
|
||||
* -d name : disassmble given GIF file into seperate files derived from name. *
|
||||
* -h : on-line help. *
|
||||
******************************************************************************
|
||||
* History: *
|
||||
* 7 Jul 89 - Version 1.0 by Gershon Elber. *
|
||||
*****************************************************************************/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#ifdef __MSDOS__
|
||||
#include <alloc.h>
|
||||
#endif /* __MSDOS__ */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif /* HAVE_UNISTD_H */
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
#include "gif_lib.h"
|
||||
#include "getarg.h"
|
||||
|
||||
#define PROGRAM_NAME "GifAsm"
|
||||
#define GIF_ASM_NAME "NETSCAPE2.0"
|
||||
#define COMMENT_GIF_ASM "(c) Gershon Elber, GifLib"
|
||||
|
||||
#define SQR(x) ((x) * (x))
|
||||
|
||||
#ifdef __MSDOS__
|
||||
extern unsigned int
|
||||
_stklen = 16384; /* Increase default stack size. */
|
||||
#endif /* __MSDOS__ */
|
||||
|
||||
#ifdef SYSV
|
||||
static char *VersionStr =
|
||||
"Gif toolkit module,\t\tGershon Elber\n\
|
||||
(C) Copyright 1989 Gershon Elber.\n";
|
||||
static char
|
||||
*CtrlStr = "GifAsm q%- A%-Delay!d a%- d%-OutFileName!s h%- GifFile(s)!*s";
|
||||
#else
|
||||
static char
|
||||
*VersionStr =
|
||||
PROGRAM_NAME
|
||||
GIF_LIB_VERSION
|
||||
" Gershon Elber, "
|
||||
__DATE__ ", " __TIME__ "\n"
|
||||
"(C) Copyright 1989 Gershon Elber.\n";
|
||||
static char
|
||||
*CtrlStr =
|
||||
PROGRAM_NAME
|
||||
" q%- A%-Delay!d a%- d%-OutFileName!s h%- GifFile(s)!*s";
|
||||
#endif /* SYSV */
|
||||
|
||||
static int
|
||||
AsmGifAnimFlag = FALSE,
|
||||
AsmGifAnimNumIters = 1,
|
||||
AsmGifAnimDelay = 0,
|
||||
AsmGifAnimUserWait = FALSE,
|
||||
AsmFlag = FALSE;
|
||||
|
||||
#if FALSE
|
||||
/* This is apparently not yet an implemented feature of the program */
|
||||
static void DoAssemblyGifAnim(int NumFiles, char **FileNames);
|
||||
#endif /* FALSE */
|
||||
static void DoAssembly(int NumFiles, char **FileNames);
|
||||
static void DoDisassembly(char *InFileName, char *OutFileName);
|
||||
static void QuitGifError(GifFileType *GifFileIn, GifFileType *GifFileOut);
|
||||
|
||||
/******************************************************************************
|
||||
* Interpret the command line and scan the given GIF file. *
|
||||
******************************************************************************/
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
int Error, NumFiles, DisasmFlag = FALSE, HelpFlag = FALSE;
|
||||
char **FileNames = NULL, *OutFileName;
|
||||
|
||||
if ((Error = GAGetArgs(argc, argv, CtrlStr, &GifQuietPrint,
|
||||
&AsmGifAnimFlag, &AsmGifAnimDelay,
|
||||
&AsmFlag, &DisasmFlag, &OutFileName,
|
||||
&HelpFlag, &NumFiles, &FileNames)) != FALSE) {
|
||||
GAPrintErrMsg(Error);
|
||||
GAPrintHowTo(CtrlStr);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if (HelpFlag) {
|
||||
fprintf(stderr, VersionStr);
|
||||
GAPrintHowTo(CtrlStr);
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
if (!AsmFlag && !AsmGifAnimFlag && !DisasmFlag)
|
||||
AsmFlag = TRUE; /* Make default - assemble. */
|
||||
if ((AsmFlag || AsmGifAnimFlag) && NumFiles < 2) {
|
||||
GIF_MESSAGE("At list two GIF files are required to assembly operation.");
|
||||
GAPrintHowTo(CtrlStr);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
if (!AsmFlag && !AsmGifAnimFlag && NumFiles > 1) {
|
||||
GIF_MESSAGE("Error in command line parsing - one GIF file please.");
|
||||
GAPrintHowTo(CtrlStr);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if (AsmFlag || AsmGifAnimFlag)
|
||||
DoAssembly(NumFiles, FileNames);
|
||||
else
|
||||
DoDisassembly(NumFiles == 1 ? *FileNames : NULL, OutFileName);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* Perform the assembly operation - take few input files into one output. *
|
||||
******************************************************************************/
|
||||
static void DoAssembly(int NumFiles, char **FileNames)
|
||||
{
|
||||
int i, j, k, Len = 0, ExtCode, ReMapColor[256];
|
||||
ColorMapObject FirstColorMap;
|
||||
GifRecordType RecordType;
|
||||
GifByteType *Line = NULL, *Extension;
|
||||
GifFileType *GifFileIn = NULL, *GifFileOut = NULL;
|
||||
|
||||
/* Open stdout for the output file: */
|
||||
if ((GifFileOut = EGifOpenFileHandle(1)) == NULL)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
|
||||
/* Scan the content of the GIF file and load the image(s) in: */
|
||||
for (i = 0; i < NumFiles; i++) {
|
||||
if ((GifFileIn = DGifOpenFileName(FileNames[i])) == NULL)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
|
||||
/* And dump out screen descriptor iff its first image. */
|
||||
if (i == 0) {
|
||||
if (EGifPutScreenDesc(GifFileOut,
|
||||
GifFileIn->SWidth, GifFileIn->SHeight,
|
||||
GifFileIn->SColorResolution, GifFileIn->SBackGroundColor,
|
||||
GifFileIn->SColorMap) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
|
||||
FirstColorMap = *GifFileIn->SColorMap;
|
||||
FirstColorMap.Colors =
|
||||
(GifColorType *) malloc(sizeof(GifColorType) *
|
||||
FirstColorMap.ColorCount);
|
||||
memcpy(FirstColorMap.Colors, GifFileIn->SColorMap->Colors,
|
||||
sizeof(GifColorType) * FirstColorMap.ColorCount);
|
||||
|
||||
if (AsmGifAnimFlag) {
|
||||
unsigned char ExtStr[3];
|
||||
|
||||
ExtStr[0] = AsmGifAnimNumIters % 256;
|
||||
ExtStr[1] = AsmGifAnimNumIters / 256;
|
||||
ExtStr[2] = 0;
|
||||
|
||||
/* Dump application+comment blocks. */
|
||||
EGifPutExtensionFirst(GifFileOut, APPLICATION_EXT_FUNC_CODE,
|
||||
strlen(GIF_ASM_NAME), GIF_ASM_NAME);
|
||||
EGifPutExtensionLast(GifFileOut, APPLICATION_EXT_FUNC_CODE,
|
||||
3, ExtStr);
|
||||
EGifPutExtension(GifFileOut, COMMENT_EXT_FUNC_CODE,
|
||||
strlen(COMMENT_GIF_ASM), COMMENT_GIF_ASM);
|
||||
}
|
||||
for (j = 0; j < GifFileIn->SColorMap->ColorCount; j++)
|
||||
ReMapColor[j] = j;
|
||||
}
|
||||
else {
|
||||
/* Compute the remapping of this image's color map to first one. */
|
||||
for (j = 0; j < GifFileIn->SColorMap->ColorCount; j++) {
|
||||
int MinIndex = 0,
|
||||
MinDist = 3 * 256 * 256;
|
||||
GifColorType *CMap1 = FirstColorMap.Colors,
|
||||
*c = GifFileIn->SColorMap->Colors;
|
||||
|
||||
/* Find closest color in first color map to this color. */
|
||||
for (k = 0; k < FirstColorMap.ColorCount; k++) {
|
||||
int Dist = SQR(c[j].Red - CMap1[k].Red) +
|
||||
SQR(c[j].Green - CMap1[k].Green) +
|
||||
SQR(c[j].Blue - CMap1[k].Blue);
|
||||
|
||||
if (MinDist > Dist) {
|
||||
MinDist = Dist;
|
||||
MinIndex = k;
|
||||
}
|
||||
}
|
||||
ReMapColor[j] = MinIndex;
|
||||
}
|
||||
}
|
||||
|
||||
do {
|
||||
if (DGifGetRecordType(GifFileIn, &RecordType) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
|
||||
switch (RecordType) {
|
||||
case IMAGE_DESC_RECORD_TYPE:
|
||||
if (DGifGetImageDesc(GifFileIn) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
|
||||
if (AsmGifAnimFlag) {
|
||||
static unsigned char
|
||||
ExtStr[4] = { 0x04, 0x00, 0x00, 0xff };
|
||||
|
||||
ExtStr[0] = AsmGifAnimUserWait ? 0x06 : 0x04;
|
||||
ExtStr[1] = AsmGifAnimDelay % 256;
|
||||
ExtStr[2] = AsmGifAnimDelay / 256;
|
||||
|
||||
/* Dump graphics control block. */
|
||||
EGifPutExtension(GifFileOut, GRAPHICS_EXT_FUNC_CODE,
|
||||
4, ExtStr);
|
||||
}
|
||||
|
||||
if (i == 0) {
|
||||
Len = sizeof(GifPixelType) * GifFileIn->Image.Width;
|
||||
if ((Line = (GifRowType) malloc(Len)) == NULL)
|
||||
GIF_EXIT("Failed to allocate memory required, aborted.");
|
||||
}
|
||||
|
||||
/* Put image descriptor to out file: */
|
||||
if (EGifPutImageDesc(GifFileOut,
|
||||
GifFileIn->Image.Left, GifFileIn->Image.Top,
|
||||
GifFileIn->Image.Width, GifFileIn->Image.Height,
|
||||
GifFileIn->Image.Interlace,
|
||||
GifFileIn->Image.ColorMap) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
|
||||
/* Now read image itself and remap to global color map. */
|
||||
for (k = 0; k < GifFileIn->Image.Height; k++) {
|
||||
if (DGifGetLine(GifFileIn, Line, Len) != GIF_ERROR) {
|
||||
for (j = 0; j < Len; j++)
|
||||
Line[j] = ReMapColor[Line[j]];
|
||||
|
||||
if (EGifPutLine(GifFileOut, Line, Len) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
}
|
||||
else
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
}
|
||||
break;
|
||||
case EXTENSION_RECORD_TYPE:
|
||||
/* Skip any extension blocks in file: */
|
||||
if (DGifGetExtension(GifFileIn, &ExtCode, &Extension)
|
||||
== GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
if (EGifPutExtension(GifFileOut, ExtCode, Extension[0],
|
||||
Extension) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
|
||||
/* No support to more than one extension blocks, discard.*/
|
||||
while (Extension != NULL)
|
||||
if (DGifGetExtensionNext(GifFileIn, &Extension)
|
||||
== GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
break;
|
||||
case TERMINATE_RECORD_TYPE:
|
||||
break;
|
||||
default: /* Should be traps by DGifGetRecordType. */
|
||||
break;
|
||||
}
|
||||
}
|
||||
while (RecordType != TERMINATE_RECORD_TYPE);
|
||||
|
||||
if (DGifCloseFile(GifFileIn) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
}
|
||||
|
||||
if (EGifCloseFile(GifFileOut) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* Perform the disassembly operation - take one input files into few output. *
|
||||
******************************************************************************/
|
||||
static void DoDisassembly(char *InFileName, char *OutFileName)
|
||||
{
|
||||
int ExtCode, CodeSize, FileNum = 0, FileEmpty;
|
||||
GifRecordType RecordType;
|
||||
char CrntFileName[80];
|
||||
GifByteType *Extension, *CodeBlock;
|
||||
GifFileType *GifFileIn = NULL, *GifFileOut = NULL;
|
||||
|
||||
#ifdef __MSDOS__
|
||||
int i;
|
||||
char *p;
|
||||
|
||||
/* If name has type postfix, strip it out, and make sure name is less */
|
||||
/* or equal to 6 chars, so we will have 2 chars in name for numbers. */
|
||||
for (i = 0; i < (int)strlen(OutFileName); i++)/* Make sure all is upper case.*/
|
||||
if (islower(OutFileName[i]))
|
||||
OutFileName[i] = toupper(OutFileName[i]);
|
||||
|
||||
if ((p = strrchr(OutFileName, '.')) != NULL && strlen(p) <= 4) p[0] = 0;
|
||||
if ((p = strrchr(OutFileName, '/')) != NULL ||
|
||||
(p = strrchr(OutFileName, '\\')) != NULL ||
|
||||
(p = strrchr(OutFileName, ':')) != NULL) {
|
||||
if (strlen(p) > 7) p[7] = 0; /* p includes the '/', '\\', ':' char. */
|
||||
}
|
||||
else {
|
||||
/* Only name is given for current directory: */
|
||||
if (strlen(OutFileName) > 6) OutFileName[6] = 0;
|
||||
}
|
||||
#endif /* __MSDOS__ */
|
||||
|
||||
/* Open input file: */
|
||||
if (InFileName != NULL) {
|
||||
if ((GifFileIn = DGifOpenFileName(InFileName)) == NULL)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
}
|
||||
else {
|
||||
/* Use the stdin instead: */
|
||||
if ((GifFileIn = DGifOpenFileHandle(0)) == NULL)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
}
|
||||
|
||||
/* Scan the content of GIF file and dump image(s) to seperate file(s): */
|
||||
do {
|
||||
sprintf(CrntFileName, "%s%02d.gif", OutFileName, FileNum++);
|
||||
if ((GifFileOut = EGifOpenFileName(CrntFileName, TRUE)) == NULL)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
FileEmpty = TRUE;
|
||||
|
||||
/* And dump out its exactly same screen information: */
|
||||
if (EGifPutScreenDesc(GifFileOut,
|
||||
GifFileIn->SWidth, GifFileIn->SHeight,
|
||||
GifFileIn->SColorResolution, GifFileIn->SBackGroundColor,
|
||||
GifFileIn->SColorMap) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
|
||||
do {
|
||||
if (DGifGetRecordType(GifFileIn, &RecordType) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
|
||||
switch (RecordType) {
|
||||
case IMAGE_DESC_RECORD_TYPE:
|
||||
FileEmpty = FALSE;
|
||||
if (DGifGetImageDesc(GifFileIn) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
/* Put same image descriptor to out file: */
|
||||
if (EGifPutImageDesc(GifFileOut,
|
||||
GifFileIn->Image.Left, GifFileIn->Image.Top,
|
||||
GifFileIn->Image.Width, GifFileIn->Image.Height,
|
||||
GifFileIn->Image.Interlace,
|
||||
GifFileIn->Image.ColorMap) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
|
||||
/* Now read image itself in decoded form as we dont */
|
||||
/* really care what is there, and this is much faster. */
|
||||
if (DGifGetCode(GifFileIn, &CodeSize, &CodeBlock) == GIF_ERROR
|
||||
|| EGifPutCode(GifFileOut, CodeSize, CodeBlock) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
while (CodeBlock != NULL)
|
||||
if (DGifGetCodeNext(GifFileIn, &CodeBlock) == GIF_ERROR ||
|
||||
EGifPutCodeNext(GifFileOut, CodeBlock) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
break;
|
||||
case EXTENSION_RECORD_TYPE:
|
||||
FileEmpty = FALSE;
|
||||
/* Skip any extension blocks in file: */
|
||||
if (DGifGetExtension(GifFileIn, &ExtCode, &Extension)
|
||||
== GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
if (EGifPutExtension(GifFileOut, ExtCode, Extension[0],
|
||||
Extension) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
|
||||
/* No support to more than one extension blocks, discard.*/
|
||||
while (Extension != NULL)
|
||||
if (DGifGetExtensionNext(GifFileIn, &Extension)
|
||||
== GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
break;
|
||||
case TERMINATE_RECORD_TYPE:
|
||||
break;
|
||||
default: /* Should be traps by DGifGetRecordType. */
|
||||
break;
|
||||
}
|
||||
}
|
||||
while (RecordType != IMAGE_DESC_RECORD_TYPE &&
|
||||
RecordType != TERMINATE_RECORD_TYPE);
|
||||
|
||||
if (EGifCloseFile(GifFileOut) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
if (FileEmpty) {
|
||||
/* Might happen on last file - delete it if so: */
|
||||
unlink(CrntFileName);
|
||||
}
|
||||
}
|
||||
while (RecordType != TERMINATE_RECORD_TYPE);
|
||||
|
||||
if (DGifCloseFile(GifFileIn) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* Close both input and output file (if open), and exit. *
|
||||
******************************************************************************/
|
||||
static void QuitGifError(GifFileType *GifFileIn, GifFileType *GifFileOut)
|
||||
{
|
||||
PrintGifError();
|
||||
if (GifFileIn != NULL) DGifCloseFile(GifFileIn);
|
||||
if (GifFileOut != NULL) EGifCloseFile(GifFileOut);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
371
third_party/giflib/util/gifbg.c
vendored
@ -1,371 +0,0 @@
|
||||
/*****************************************************************************
|
||||
* "Gif-Lib" - Yet another gif library. *
|
||||
* *
|
||||
* Written by: Gershon Elber Ver 0.1, Jul. 1989 *
|
||||
******************************************************************************
|
||||
* Program to generate back ground image that can be used to replace constant *
|
||||
* background. *
|
||||
* Options: *
|
||||
* -q : quiet printing mode. *
|
||||
* -d direction : set direction image should increase intensity. *
|
||||
* -l levels : number of color levels. *
|
||||
* -c r g b : colors of the back ground. *
|
||||
* -m min : minimin intensity in percent. *
|
||||
* -M max : maximum intensity in percent. *
|
||||
* -s width height : size of image to create. *
|
||||
* -h : on-line help. *
|
||||
******************************************************************************
|
||||
* History: *
|
||||
* 9 Jul 89 - Version 1.0 by Gershon Elber. *
|
||||
*****************************************************************************/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#ifdef __MSDOS__
|
||||
#include <stdlib.h>
|
||||
#include <alloc.h>
|
||||
#endif /* __MSDOS__ */
|
||||
|
||||
#ifndef __MSDOS__
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
#include "gif_lib.h"
|
||||
#include "getarg.h"
|
||||
|
||||
#define PROGRAM_NAME "GifBG"
|
||||
|
||||
#define DEFAULT_WIDTH 640
|
||||
#define DEFAULT_HEIGHT 350
|
||||
|
||||
#define DEFAULT_COLOR_RED 0
|
||||
#define DEFAULT_COLOR_GREEN 0
|
||||
#define DEFAULT_COLOR_BLUE 255
|
||||
|
||||
#define DEFAULT_MIN_INTENSITY 10 /* In percent. */
|
||||
#define DEFAULT_MAX_INTENSITY 100
|
||||
|
||||
#define DEFAULT_NUM_LEVELS 16 /* Number of colors to gen the image. */
|
||||
|
||||
#define DIR_NONE 0 /* Direction the levels can be changed: */
|
||||
#define DIR_TOP 1
|
||||
#define DIR_TOP_RIGHT 2
|
||||
#define DIR_RIGHT 3
|
||||
#define DIR_BOT_RIGHT 4
|
||||
#define DIR_BOT 5
|
||||
#define DIR_BOT_LEFT 6
|
||||
#define DIR_LEFT 7
|
||||
#define DIR_TOP_LEFT 8
|
||||
|
||||
#define DEFAULT_DIR "T" /* TOP (North) direction. */
|
||||
|
||||
#ifdef __MSDOS__
|
||||
extern unsigned int
|
||||
_stklen = 16384; /* Increase default stack size. */
|
||||
#endif /* __MSDOS__ */
|
||||
|
||||
#ifdef SYSV
|
||||
static char *VersionStr =
|
||||
"Gif library module \t\tGershon Elber\n\
|
||||
(C) Copyright 1989 Gershon Elber.\n";
|
||||
static char
|
||||
*CtrlStr = "GifBG q%- d%-Dir!s l%-#Lvls!d c%-R|G|B!d!d!d m%-MinI!d M%-MaxI!d s%-W|H!d!d h%-";
|
||||
#else
|
||||
static char
|
||||
*VersionStr =
|
||||
PROGRAM_NAME
|
||||
GIF_LIB_VERSION
|
||||
" Gershon Elber, "
|
||||
__DATE__ ", " __TIME__ "\n"
|
||||
"(C) Copyright 1989 Gershon Elber.\n";
|
||||
static char
|
||||
*CtrlStr =
|
||||
PROGRAM_NAME
|
||||
" q%- d%-Dir!s l%-#Lvls!d c%-R|G|B!d!d!d m%-MinI!d M%-MaxI!d s%-W|H!d!d h%-";
|
||||
#endif /* SYSV */
|
||||
|
||||
static int
|
||||
MaximumIntensity = DEFAULT_MAX_INTENSITY, /* In percent. */
|
||||
MinimumIntensity = DEFAULT_MIN_INTENSITY,
|
||||
NumLevels = DEFAULT_NUM_LEVELS,
|
||||
ImageWidth = DEFAULT_WIDTH,
|
||||
ImageHeight = DEFAULT_HEIGHT,
|
||||
Direction;
|
||||
static unsigned int
|
||||
RedColor = DEFAULT_COLOR_RED,
|
||||
GreenColor = DEFAULT_COLOR_GREEN,
|
||||
BlueColor = DEFAULT_COLOR_BLUE;
|
||||
|
||||
static void QuitGifError(GifFileType *GifFile);
|
||||
|
||||
/******************************************************************************
|
||||
* Interpret the command line and scan the given GIF file. *
|
||||
******************************************************************************/
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
unsigned int Ratio;
|
||||
int i, j, l, LevelHeight, LevelWidth, Error, LogNumLevels, FlipDir,
|
||||
Accumulator, StartX, StepX, Count = 0, DoAllMaximum = FALSE,
|
||||
DirectionFlag = FALSE, LevelsFlag = FALSE, ColorFlag = FALSE,
|
||||
MinFlag = FALSE, MaxFlag = FALSE, SizeFlag = FALSE, HelpFlag = FALSE;
|
||||
GifPixelType Color;
|
||||
char *DirectionStr = DEFAULT_DIR;
|
||||
GifRowType Line;
|
||||
ColorMapObject *ColorMap;
|
||||
GifFileType *GifFile;
|
||||
|
||||
if ((Error = GAGetArgs(argc, argv, CtrlStr, &GifQuietPrint,
|
||||
&DirectionFlag, &DirectionStr, &LevelsFlag, &NumLevels,
|
||||
&ColorFlag, &RedColor, &GreenColor, &BlueColor,
|
||||
&MinFlag, &MinimumIntensity, &MaxFlag, &MaximumIntensity,
|
||||
&SizeFlag, &ImageWidth, &ImageHeight,
|
||||
&HelpFlag)) != FALSE) {
|
||||
GAPrintErrMsg(Error);
|
||||
GAPrintHowTo(CtrlStr);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if (HelpFlag) {
|
||||
fprintf(stderr, VersionStr);
|
||||
GAPrintHowTo(CtrlStr);
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
/* Make sure intensities are in the right range: */
|
||||
if (MinimumIntensity < 0 || MinimumIntensity > 100 ||
|
||||
MaximumIntensity < 0 || MaximumIntensity > 100)
|
||||
GIF_EXIT("Intensities (-m or -M options) are not in [0..100] range (percent).");
|
||||
|
||||
/* Convert DirectionStr to our local representation: */
|
||||
Direction = DIR_NONE;
|
||||
FlipDir = FALSE;
|
||||
for (i = 0; i < (int)strlen(DirectionStr); i++) /* Make sure its upper case. */
|
||||
if (islower(DirectionStr[i]))
|
||||
DirectionStr[i] = toupper(DirectionStr[i]);
|
||||
|
||||
switch(DirectionStr[0]) {
|
||||
case 'T': /* Top or North */
|
||||
case 'N':
|
||||
if (strlen(DirectionStr) < 2)
|
||||
Direction = DIR_TOP;
|
||||
else
|
||||
switch(DirectionStr[1]) {
|
||||
case 'R':
|
||||
case 'E':
|
||||
Direction = DIR_TOP_RIGHT;
|
||||
break;
|
||||
case 'L':
|
||||
case 'W':
|
||||
Direction = DIR_TOP_LEFT;
|
||||
FlipDir = TRUE;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 'R': /* Right or East */
|
||||
case 'E':
|
||||
Direction = DIR_RIGHT;
|
||||
break;
|
||||
case 'B': /* Bottom or South */
|
||||
case 'S':
|
||||
if (strlen(DirectionStr) < 2) {
|
||||
Direction = DIR_BOT;
|
||||
FlipDir = TRUE;
|
||||
}
|
||||
else
|
||||
switch(DirectionStr[1]) {
|
||||
case 'R':
|
||||
case 'E':
|
||||
Direction = DIR_BOT_RIGHT;
|
||||
break;
|
||||
case 'L':
|
||||
case 'W':
|
||||
Direction = DIR_BOT_LEFT;
|
||||
FlipDir = TRUE;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 'L': /* Left or West */
|
||||
case 'W':
|
||||
Direction = DIR_LEFT;
|
||||
FlipDir = TRUE;
|
||||
break;
|
||||
}
|
||||
if (Direction == DIR_NONE)
|
||||
GIF_EXIT("Direction requested (-d option) is wierd!");
|
||||
|
||||
/* We are going to handle only TOP, TOP_RIGHT, RIGHT, BOT_RIGHT so flip */
|
||||
/* the complement cases (TOP <-> BOT for example) by flipping the */
|
||||
/* Color i with color (NumLevels - i - 1). */
|
||||
if (FlipDir) {
|
||||
switch (Direction) {
|
||||
case DIR_BOT:
|
||||
Direction = DIR_TOP;
|
||||
break;
|
||||
case DIR_BOT_LEFT:
|
||||
Direction = DIR_TOP_RIGHT;
|
||||
break;
|
||||
case DIR_LEFT:
|
||||
Direction = DIR_RIGHT;
|
||||
break;
|
||||
case DIR_TOP_LEFT:
|
||||
Direction = DIR_BOT_RIGHT;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* If binary mask is requested (special case): */
|
||||
if (MinimumIntensity == 100 && MaximumIntensity == 100 && NumLevels == 2) {
|
||||
MinimumIntensity = 0;
|
||||
DoAllMaximum = TRUE;
|
||||
Direction = DIR_RIGHT;
|
||||
}
|
||||
|
||||
/* Make sure colors are in the right range: */
|
||||
if (RedColor > 255 || GreenColor > 255 || BlueColor > 255)
|
||||
GIF_EXIT("Colors are not in the ragne [0..255].");
|
||||
|
||||
/* Make sure number of levels is power of 2 (up to 8 bits per pixel). */
|
||||
for (i = 1; i < 8; i++) if (NumLevels == (1 << i)) break;
|
||||
if (i == 8) GIF_EXIT("#Lvls (-l option) is not power of 2.");
|
||||
LogNumLevels = i;
|
||||
|
||||
/* Open stdout for the output file: */
|
||||
if ((GifFile = EGifOpenFileHandle(1)) == NULL)
|
||||
QuitGifError(GifFile);
|
||||
|
||||
/* Dump out screen description with given size and generated color map: */
|
||||
if ((ColorMap = MakeMapObject(NumLevels, NULL)) == NULL)
|
||||
GIF_EXIT("Failed to allocate memory required, aborted.");
|
||||
|
||||
for (i = 1; i <= NumLevels; i++) {
|
||||
/* Ratio will be in the range of 0..100 for required intensity: */
|
||||
Ratio = (MaximumIntensity * (i * (256 / NumLevels)) +
|
||||
MinimumIntensity * ((NumLevels - i) * (256 / NumLevels))) /
|
||||
256;
|
||||
ColorMap->Colors[i-1].Red = (RedColor * Ratio) / 100;
|
||||
ColorMap->Colors[i-1].Green = (GreenColor * Ratio) / 100;
|
||||
ColorMap->Colors[i-1].Blue = (BlueColor * Ratio) / 100;
|
||||
}
|
||||
if (EGifPutScreenDesc(GifFile,
|
||||
ImageWidth, ImageHeight, LogNumLevels, 0, ColorMap)
|
||||
== GIF_ERROR)
|
||||
QuitGifError(GifFile);
|
||||
|
||||
/* Dump out the image descriptor: */
|
||||
if (EGifPutImageDesc(GifFile,
|
||||
0, 0, ImageWidth, ImageHeight, FALSE, NULL) == GIF_ERROR)
|
||||
QuitGifError(GifFile);
|
||||
|
||||
GifQprintf("\n%s: Image 1 at (%d, %d) [%dx%d]: ",
|
||||
PROGRAM_NAME, GifFile->Image.Left, GifFile->Image.Top,
|
||||
GifFile->Image.Width, GifFile->Image.Height);
|
||||
|
||||
/* Allocate one scan line twice as big as image is as we are going to */
|
||||
/* shift along it, while we dump the scan lines: */
|
||||
if ((Line = (GifRowType) malloc(sizeof(GifPixelType) * ImageWidth * 2)) == NULL)
|
||||
GIF_EXIT("Failed to allocate memory required, aborted.");
|
||||
|
||||
if (Direction == DIR_TOP) {
|
||||
/* We must evaluate the line each time level is changing: */
|
||||
LevelHeight = ImageHeight / NumLevels;
|
||||
for (Color = NumLevels, i = l = 0; i < ImageHeight; i++) {
|
||||
if (i == l) {
|
||||
/* Time to update the line to next color level: */
|
||||
if (Color != 0) Color--;
|
||||
for (j = 0; j < ImageWidth; j++)
|
||||
Line[j] = (FlipDir ? NumLevels - Color - 1 : Color);
|
||||
l += LevelHeight;
|
||||
}
|
||||
if (EGifPutLine(GifFile, Line, ImageWidth) == GIF_ERROR)
|
||||
QuitGifError(GifFile);
|
||||
GifQprintf("\b\b\b\b%-4d", Count++);
|
||||
}
|
||||
}
|
||||
else if (Direction == DIR_RIGHT) {
|
||||
/* We pre-prepare the scan lines as going from color zero to maximum */
|
||||
/* color and dump the same scan line Height times: */
|
||||
/* Note this case should handle the Boolean Mask special case. */
|
||||
LevelWidth = ImageWidth / NumLevels;
|
||||
if (DoAllMaximum) {
|
||||
/* Special case - do all in maximum color: */
|
||||
for (i = 0; i < ImageWidth; i++) Line[i] = 1;
|
||||
}
|
||||
else {
|
||||
for (Color = i = 0, l = LevelWidth; i < ImageWidth; i++, l--) {
|
||||
if (l == 0) {
|
||||
l = LevelWidth;
|
||||
if (Color < NumLevels - 1) Color++;
|
||||
}
|
||||
Line[i] = (FlipDir ? NumLevels - Color - 1 : Color);
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < ImageHeight; i++) {
|
||||
if (EGifPutLine(GifFile, Line, ImageWidth) == GIF_ERROR)
|
||||
QuitGifError(GifFile);
|
||||
GifQprintf("\b\b\b\b%-4d", Count++);
|
||||
}
|
||||
}
|
||||
else {
|
||||
/* We are in one of the TOP_RIGHT, BOT_RIGHT cases: we will */
|
||||
/* initialize the Line with its double ImageWidth length from the */
|
||||
/* minimum intensity to the maximum intensity and shift along it */
|
||||
/* while we go along the image height. */
|
||||
LevelWidth = ImageWidth * 2 / NumLevels;
|
||||
for (Color = i = 0, l = LevelWidth; i < ImageWidth * 2; i++, l--) {
|
||||
if (l == 0) {
|
||||
l = LevelWidth;
|
||||
if (Color < NumLevels - 1) Color++;
|
||||
}
|
||||
Line[i] = (FlipDir ? NumLevels - Color - 1 : Color);
|
||||
}
|
||||
/* We need to implement a DDA to know how much to shift Line while */
|
||||
/* we go down along image height. we set the parameters for it now: */
|
||||
Accumulator = 0;
|
||||
switch(Direction) {
|
||||
case DIR_TOP_RIGHT:
|
||||
StartX = ImageWidth;
|
||||
StepX = -1;
|
||||
break;
|
||||
case DIR_BOT_RIGHT:
|
||||
default:
|
||||
StartX = 0;
|
||||
StepX = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
/* Time to dump information out: */
|
||||
for (i = 0; i < ImageHeight; i++) {
|
||||
if (EGifPutLine(GifFile, &Line[StartX], ImageWidth) == GIF_ERROR)
|
||||
QuitGifError(GifFile);
|
||||
GifQprintf("\b\b\b\b%-4d", Count++);
|
||||
if ((Accumulator += ImageWidth) > ImageHeight) {
|
||||
while (Accumulator > ImageHeight) {
|
||||
Accumulator -= ImageHeight;
|
||||
StartX += StepX;
|
||||
}
|
||||
if (Direction < 0) Direction = 0;
|
||||
if (Direction > ImageWidth) Direction = ImageWidth;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (EGifCloseFile(GifFile) == GIF_ERROR)
|
||||
QuitGifError(GifFile);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* Close output file (if open), and exit. *
|
||||
******************************************************************************/
|
||||
static void QuitGifError(GifFileType *GifFile)
|
||||
{
|
||||
PrintGifError();
|
||||
if (GifFile != NULL) EGifCloseFile(GifFile);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
75
third_party/giflib/util/gifburst
vendored
@ -1,75 +0,0 @@
|
||||
#!/usr/bin/perl
|
||||
#
|
||||
# Split a GIF image into four or six pieces, dividing in half horizontally
|
||||
# and into halves or thirds vertically.
|
||||
#
|
||||
# The -s option controls the number of pieces. The -p option controls the
|
||||
# amount of overlap (in pixels) at the edges of pieces.
|
||||
|
||||
# Set to flush on print.
|
||||
$| = 1;
|
||||
|
||||
require 'getopts.pl';
|
||||
|
||||
# How many pieces?
|
||||
$split = 4;
|
||||
&Getopts("s:p:");
|
||||
$split = $opt_i if $opt_i;
|
||||
$overlap = $opt_p if $opt_p;
|
||||
|
||||
$nm=$ARGV[0];
|
||||
print "Bursting image $nm.gif...\n";
|
||||
|
||||
$stats=`giftext $nm.gif | grep Width | head -n1`;
|
||||
$stats =~ /Width = ([0-9]+), Height = ([0-9]+)/;
|
||||
$width=$1;
|
||||
$height=$2;
|
||||
print "Width is $width, height $height\n";
|
||||
|
||||
$overlap = 20;
|
||||
|
||||
if ($split == 6)
|
||||
{
|
||||
$a = int($width / 2) + $overlap;
|
||||
$b = int($width / 2) - $overlap;
|
||||
$c = int($width - 1);
|
||||
$d = int($height / 3) - $overlap;
|
||||
$e = int($height / 3) * 2 - $overlap;
|
||||
$f = int($height / 3) + $overlap;
|
||||
$g = int($height / 3) * 2 + $overlap;
|
||||
$h = int($height - 1);
|
||||
|
||||
$regions[1] = "0 0 $a $f";
|
||||
$regions[2] = "0 $d $a $g";
|
||||
$regions[3] = "0 $e $a $h";
|
||||
$regions[4] = "$b 0 $c $f";
|
||||
$regions[5] = "$b $d $c $g";
|
||||
$regions[6] = "$b $e $c $h";
|
||||
}
|
||||
elsif ($split == 4)
|
||||
{
|
||||
$a = int($width / 2) + $overlap;
|
||||
$b = int($width / 2) - $overlap;
|
||||
$c = int($width - 1);
|
||||
$d = int($height / 2) - $overlap;
|
||||
$e = int($height / 2) + $overlap;
|
||||
$f = int($height - 1);
|
||||
|
||||
$regions[1] = "0 0 $a $e";
|
||||
$regions[2] = "0 $d $a $f";
|
||||
$regions[3] = "$b 0 $c $e";
|
||||
$regions[4] = "$b $d $c $f";
|
||||
}
|
||||
else
|
||||
{
|
||||
die("I don't know how to make that many pieces.\n");
|
||||
}
|
||||
|
||||
for ($i = 1; $i <= $split; $i++)
|
||||
{
|
||||
print "${nm}-${i}: ${regions[$i]}\n";
|
||||
system("gifclip -i $regions[$i] ${nm}.gif >${nm}-${i}.gif");
|
||||
}
|
||||
|
||||
print "$nm done\n"
|
||||
|
324
third_party/giflib/util/gifclip.c
vendored
@ -1,324 +0,0 @@
|
||||
/*****************************************************************************
|
||||
* "Gif-Lib" - Yet another gif library. *
|
||||
* *
|
||||
* Written by: Gershon Elber Ver 0.1, Jul. 1989 *
|
||||
******************************************************************************
|
||||
* Program to clip an image and dump out only portion of it. *
|
||||
* Options: *
|
||||
* -q : quiet printing mode. *
|
||||
* -i left top width bottom : clipping information for first image. *
|
||||
* -n n left top width bottom : clipping information for nth image. *
|
||||
* -c complement; remove the bands specified by -i or -n *
|
||||
* -h : on-line help *
|
||||
******************************************************************************
|
||||
* History: *
|
||||
* 8 Jul 89 - Version 1.0 by Gershon Elber. *
|
||||
*****************************************************************************/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#ifdef __MSDOS__
|
||||
#include <stdlib.h>
|
||||
#include <alloc.h>
|
||||
#endif /* __MSDOS__ */
|
||||
|
||||
#ifndef __MSDOS__
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
#include "gif_lib.h"
|
||||
#include "getarg.h"
|
||||
|
||||
#define PROGRAM_NAME "GifClip"
|
||||
|
||||
#ifdef __MSDOS__
|
||||
extern unsigned int
|
||||
_stklen = 16384; /* Increase default stack size. */
|
||||
#endif /* __MSDOS__ */
|
||||
|
||||
#ifdef SYSV
|
||||
static char *VersionStr =
|
||||
"Gif toolkit module,\t\tGershon Elber\n\
|
||||
(C) Copyright 1989 Gershon Elber.\n";
|
||||
static char
|
||||
*CtrlStr = "GifClip q%- c%- i%-Xmin|Ymin|Xmax|Ymax!d!d!d!d n%-n|Xmin|Ymin|Xmax|Ymax!d!d!d!d!d h%- GifFile!*s";
|
||||
#else
|
||||
static char
|
||||
*VersionStr =
|
||||
PROGRAM_NAME
|
||||
GIF_LIB_VERSION
|
||||
" Gershon Elber, "
|
||||
__DATE__ ", " __TIME__ "\n"
|
||||
"(C) Copyright 1989 Gershon Elber.\n";
|
||||
static char
|
||||
*CtrlStr =
|
||||
PROGRAM_NAME
|
||||
" q%- c%- i%-Xmin|Ymin|Xmax|Ymax!d!d!d!d n%-n|Xmin|Ymin|Xmax|Ymax!d!d!d!d!d h%- GifFile!*s";
|
||||
#endif /* SYSV */
|
||||
|
||||
static void QuitGifError(GifFileType *GifFileIn, GifFileType *GifFileOut);
|
||||
|
||||
/******************************************************************************
|
||||
* Interpret the command line and scan the given GIF file. *
|
||||
******************************************************************************/
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
int i, Error, NumFiles, ExtCode, CodeSize, ImageNum = 0,
|
||||
ImageFlag = FALSE, ImageNFlag = FALSE, ImageN, ImageX1, ImageY1,
|
||||
ImageX2, ImageY2, ImageWidth, ImageDepth,
|
||||
Complement = FALSE, HelpFlag = FALSE;
|
||||
GifRecordType RecordType;
|
||||
GifByteType *Extension, *CodeBlock;
|
||||
char **FileName = NULL;
|
||||
GifRowType Line;
|
||||
GifFileType *GifFileIn = NULL, *GifFileOut = NULL;
|
||||
|
||||
/* Same image dimension vars for both Image & ImageN as only one allowed.*/
|
||||
if ((Error = GAGetArgs(argc, argv, CtrlStr, &GifQuietPrint, &Complement,
|
||||
&ImageFlag, &ImageX1, &ImageY1, &ImageX2, &ImageY2,
|
||||
&ImageNFlag, &ImageN, &ImageX1, &ImageY1, &ImageX2, &ImageY2,
|
||||
&HelpFlag, &NumFiles, &FileName)) != FALSE ||
|
||||
(NumFiles > 1 && !HelpFlag)) {
|
||||
if (Error)
|
||||
GAPrintErrMsg(Error);
|
||||
else if (NumFiles > 1)
|
||||
GIF_MESSAGE("Error in command line parsing - one GIF file please.");
|
||||
GAPrintHowTo(CtrlStr);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if (HelpFlag) {
|
||||
fprintf(stderr, VersionStr);
|
||||
GAPrintHowTo(CtrlStr);
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
/* Test to make sure exactly one of ImageFlag & ImageNFlag is set: */
|
||||
if ((ImageFlag && ImageNFlag) || (!ImageFlag && !ImageNFlag)) {
|
||||
GIF_MESSAGE("Exactly one of [-i ...] && [-n ...] please.");
|
||||
GAPrintHowTo(CtrlStr);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
if (ImageFlag) ImageN = 1; /* Its first image we are after. */
|
||||
|
||||
/* Make sure the first coordinates of clipping box are smaller: */
|
||||
if (ImageX1 > ImageX2) {
|
||||
i = ImageX1;
|
||||
ImageX1 = ImageX2;
|
||||
ImageX2 = i;
|
||||
}
|
||||
if (ImageY1 > ImageY2) {
|
||||
i = ImageX1;
|
||||
ImageY1 = ImageY2;
|
||||
ImageY2 = i;
|
||||
}
|
||||
|
||||
if (NumFiles == 1) {
|
||||
if ((GifFileIn = DGifOpenFileName(*FileName)) == NULL)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
}
|
||||
else {
|
||||
/* Use the stdin instead: */
|
||||
if ((GifFileIn = DGifOpenFileHandle(0)) == NULL)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
}
|
||||
|
||||
/* Open stdout for the output file: */
|
||||
if ((GifFileOut = EGifOpenFileHandle(1)) == NULL)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
|
||||
/* Width and depth of clipped image. */
|
||||
if (!Complement)
|
||||
ImageWidth = ImageX2 - ImageX1 + 1;
|
||||
else
|
||||
ImageWidth = GifFileIn->SWidth
|
||||
- (ImageX2 != ImageX1) * (ImageX2 - ImageX1 + 1);
|
||||
if (!Complement)
|
||||
ImageDepth = ImageY2 - ImageY1 + 1;
|
||||
else
|
||||
ImageDepth = GifFileIn->SHeight
|
||||
- (ImageY2 != ImageY1) * (ImageY2 - ImageY1 + 1);
|
||||
|
||||
/* And dump out exactly same screen information: */
|
||||
if (EGifPutScreenDesc(GifFileOut,
|
||||
GifFileIn->SWidth, GifFileIn->SHeight,
|
||||
GifFileIn->SColorResolution, GifFileIn->SBackGroundColor,
|
||||
GifFileIn->SColorMap) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
|
||||
/* Scan the content of the GIF file and load the image(s) in: */
|
||||
do {
|
||||
if (DGifGetRecordType(GifFileIn, &RecordType) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
|
||||
switch (RecordType) {
|
||||
case IMAGE_DESC_RECORD_TYPE:
|
||||
if (DGifGetImageDesc(GifFileIn) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
if (++ImageNum == ImageN) {
|
||||
/* We can handle only non interlaced images here: */
|
||||
if (GifFileIn->Image.Interlace)
|
||||
GIF_EXIT("Image to clip is interlaced - use GifInter first.");
|
||||
|
||||
/* This is the image we should clip - test sizes and */
|
||||
/* dump out new clipped screen descriptor if o.k. */
|
||||
if (GifFileIn->Image.Width <= ImageX2 ||
|
||||
GifFileIn->Image.Height <= ImageY2)
|
||||
GIF_EXIT("Image is smaller than given clip dimensions.");
|
||||
|
||||
/* Put the image descriptor to out file: */
|
||||
if (EGifPutImageDesc(GifFileOut,
|
||||
GifFileIn->Image.Left, GifFileIn->Image.Top,
|
||||
ImageWidth, ImageDepth,
|
||||
FALSE, GifFileIn->Image.ColorMap) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
|
||||
/* o.k. - read the image and clip it: */
|
||||
Line = (GifRowType) malloc(GifFileIn->Image.Width *
|
||||
sizeof(GifPixelType));
|
||||
GifQprintf("\n%s: Image %d at (%d, %d) [%dx%d]: ",
|
||||
PROGRAM_NAME, ImageNum,
|
||||
GifFileIn->Image.Left, GifFileIn->Image.Top,
|
||||
GifFileIn->Image.Width, GifFileIn->Image.Height);
|
||||
|
||||
/* Skip lines below ImageY1: */
|
||||
for (i = 0; i < ImageY1; i++) {
|
||||
if (DGifGetLine(GifFileIn, Line, GifFileIn->Image.Width)
|
||||
== GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
|
||||
if (Complement) {
|
||||
if (ImageX1 == ImageX2) {
|
||||
/* don't remove any vertical band */
|
||||
if (EGifPutLine(GifFileOut, Line,
|
||||
ImageWidth) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (EGifPutLine(GifFileOut, Line,
|
||||
ImageX1) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
|
||||
if (EGifPutLine(GifFileOut,
|
||||
&Line[ImageX2 + 1],
|
||||
GifFileIn->SWidth - (ImageX2 + 1)
|
||||
) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
}
|
||||
}
|
||||
|
||||
GifQprintf("\b\b\b\b%-4d", i);
|
||||
}
|
||||
|
||||
/* Clip the lines from ImageY1 to ImageY2 (to X1 - X2): */
|
||||
for (i = ImageY1; i <= ImageY2; i++) {
|
||||
if (DGifGetLine(GifFileIn, Line, GifFileIn->Image.Width)
|
||||
== GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
|
||||
if (!Complement)
|
||||
if (EGifPutLine(GifFileOut, &Line[ImageX1],
|
||||
ImageWidth) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
|
||||
GifQprintf("\b\b\b\b%-4d", i);
|
||||
}
|
||||
|
||||
/* Skip lines above ImageY2: */
|
||||
for (i = ImageY2 + 1; i < GifFileIn->Image.Height; i++) {
|
||||
if (DGifGetLine(GifFileIn, Line, GifFileIn->Image.Width)
|
||||
== GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
|
||||
if (Complement) {
|
||||
if (ImageX1 == ImageX2) {
|
||||
/* don't remove any vertical band */
|
||||
if (EGifPutLine(GifFileOut, Line,
|
||||
ImageWidth) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (EGifPutLine(GifFileOut, Line,
|
||||
ImageX1) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
|
||||
if (EGifPutLine(GifFileOut,
|
||||
&Line[ImageX2 + 1],
|
||||
GifFileIn->SWidth - (ImageX2 + 1)
|
||||
) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
}
|
||||
}
|
||||
|
||||
GifQprintf("\b\b\b\b%-4d", i);
|
||||
}
|
||||
|
||||
free((char *) Line);
|
||||
}
|
||||
else {
|
||||
/* Copy the image as is (we dont modify this one): */
|
||||
if (EGifPutImageDesc(GifFileOut,
|
||||
GifFileIn->Image.Left, GifFileIn->Image.Top,
|
||||
GifFileIn->Image.Width, GifFileIn->Image.Height,
|
||||
GifFileIn->Image.Interlace,
|
||||
GifFileIn->Image.ColorMap) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
|
||||
/* Now read image itself in decoded form as we dont */
|
||||
/* really care what is there, and this is much faster. */
|
||||
if (DGifGetCode(GifFileIn, &CodeSize, &CodeBlock) == GIF_ERROR
|
||||
|| EGifPutCode(GifFileOut, CodeSize, CodeBlock) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
while (CodeBlock != NULL)
|
||||
if (DGifGetCodeNext(GifFileIn, &CodeBlock) == GIF_ERROR ||
|
||||
EGifPutCodeNext(GifFileOut, CodeBlock) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
}
|
||||
break;
|
||||
case EXTENSION_RECORD_TYPE:
|
||||
/* Skip any extension blocks in file: */
|
||||
if (DGifGetExtension(GifFileIn, &ExtCode, &Extension) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
if (EGifPutExtension(GifFileOut, ExtCode, Extension[0],
|
||||
Extension) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
|
||||
/* No support to more than one extension blocks, so discard: */
|
||||
while (Extension != NULL) {
|
||||
if (DGifGetExtensionNext(GifFileIn, &Extension) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
}
|
||||
break;
|
||||
case TERMINATE_RECORD_TYPE:
|
||||
break;
|
||||
default: /* Should be traps by DGifGetRecordType. */
|
||||
break;
|
||||
}
|
||||
}
|
||||
while (RecordType != TERMINATE_RECORD_TYPE);
|
||||
|
||||
if (DGifCloseFile(GifFileIn) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
if (EGifCloseFile(GifFileOut) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* Close both input and output file (if open), and exit. *
|
||||
******************************************************************************/
|
||||
static void QuitGifError(GifFileType *GifFileIn, GifFileType *GifFileOut)
|
||||
{
|
||||
PrintGifError();
|
||||
if (GifFileIn != NULL) DGifCloseFile(GifFileIn);
|
||||
if (GifFileOut != NULL) EGifCloseFile(GifFileOut);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
361
third_party/giflib/util/gifclrmp.c
vendored
@ -1,361 +0,0 @@
|
||||
/*****************************************************************************
|
||||
* "Gif-Lib" - Yet another gif library. *
|
||||
* *
|
||||
* Written by: Gershon Elber Ver 0.1, Jul. 1989 *
|
||||
******************************************************************************
|
||||
* Program to modify GIF file color map(s). Images are not modified at all. *
|
||||
* Options: *
|
||||
* -q : quiet printing mode. *
|
||||
* -s : save screen color map (unless -i - see below), to stdout. *
|
||||
* -l colormap.file : substitute given colormap.file colormap into screen *
|
||||
* colormap (unless -i - see below). *
|
||||
* -g correction : apply gamma correction to the screen colormap (unless -i - *
|
||||
* see below). *
|
||||
* -i n : select image number n color map instead of screen map for above *
|
||||
* operations (n = 1 for first image). *
|
||||
* -h : on-line help. *
|
||||
* All color maps are ascii text files, with one line per color of the *
|
||||
* form: index, Red color, Green color, Blue color - all in the range 0..255. *
|
||||
* All color maps should be in the exact same length. *
|
||||
******************************************************************************
|
||||
* History: *
|
||||
* 17 Jul 89 - Version 1.0 by Gershon Elber. *
|
||||
*****************************************************************************/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#ifdef __MSDOS__
|
||||
#include <stdlib.h>
|
||||
#include <alloc.h>
|
||||
#endif /* __MSDOS__ */
|
||||
|
||||
#ifndef __MSDOS__
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
#include "gif_lib.h"
|
||||
#include "getarg.h"
|
||||
|
||||
#define PROGRAM_NAME "GifClrMp"
|
||||
|
||||
#ifdef __MSDOS__
|
||||
extern unsigned int
|
||||
_stklen = 16384; /* Increase default stack size. */
|
||||
#endif /* __MSDOS__ */
|
||||
|
||||
#ifdef SYSV
|
||||
static char *VersionStr =
|
||||
"Gif toolkit module,\t\tGershon Elber\n\
|
||||
(C) Copyright 1989 Gershon Elber.\n";
|
||||
static char
|
||||
*CtrlStr = "GifClrMp q%- s%- t%-TranslationFile!s l%-ColorMapFile!s g%-Gamma!F i%-Image#!d h%- GifFile!*s";
|
||||
#else
|
||||
static char
|
||||
*VersionStr =
|
||||
PROGRAM_NAME
|
||||
GIF_LIB_VERSION
|
||||
" Gershon Elber, "
|
||||
__DATE__ ", " __TIME__ "\n"
|
||||
"(C) Copyright 1989 Gershon Elber.\n";
|
||||
static char
|
||||
*CtrlStr =
|
||||
PROGRAM_NAME
|
||||
" q%- s%- t%-TranslationFile!s l%-ColorMapFile!s g%-Gamma!F i%-Image#!d h%- GifFile!*s";
|
||||
#endif /* SYSV */
|
||||
|
||||
static int
|
||||
SaveFlag = FALSE,
|
||||
TranslateFlag = FALSE,
|
||||
LoadFlag = FALSE,
|
||||
GammaFlag = FALSE;
|
||||
static
|
||||
double Gamma = 1.0;
|
||||
static
|
||||
FILE *ColorFile = NULL;
|
||||
FILE *TranslateFile = NULL;
|
||||
static
|
||||
GifPixelType Translation[256];
|
||||
|
||||
static ColorMapObject *ModifyColorMap(ColorMapObject *ColorMap);
|
||||
static void QuitGifError(GifFileType *GifFileIn, GifFileType *GifFileOut);
|
||||
|
||||
/******************************************************************************
|
||||
* Interpret the command line and scan the given GIF file. *
|
||||
******************************************************************************/
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
int Error, NumFiles, ExtCode, CodeSize, ImageNum = 0,
|
||||
ImageNFlag = FALSE, ImageN, HelpFlag = FALSE, HasGIFOutput;
|
||||
GifRecordType RecordType;
|
||||
GifByteType *Extension, *CodeBlock;
|
||||
char **FileName = NULL, *ColorFileName, *TranslateFileName;
|
||||
GifFileType *GifFileIn = NULL, *GifFileOut = NULL;
|
||||
|
||||
if ((Error = GAGetArgs(argc, argv, CtrlStr, &GifQuietPrint, &SaveFlag,
|
||||
&TranslateFlag, &TranslateFileName,
|
||||
&LoadFlag, &ColorFileName,
|
||||
&GammaFlag, &Gamma, &ImageNFlag, &ImageN,
|
||||
&HelpFlag, &NumFiles, &FileName)) != FALSE ||
|
||||
(NumFiles > 1 && !HelpFlag)) {
|
||||
if (Error)
|
||||
GAPrintErrMsg(Error);
|
||||
else if (NumFiles > 1)
|
||||
GIF_MESSAGE("Error in command line parsing - one GIF file please.");
|
||||
GAPrintHowTo(CtrlStr);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if (HelpFlag) {
|
||||
fprintf(stderr, VersionStr);
|
||||
GAPrintHowTo(CtrlStr);
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
if (SaveFlag + LoadFlag + GammaFlag + TranslateFlag > 1)
|
||||
GIF_EXIT("Can not handle more than one of -s -l, -t, or -g at the same time.");
|
||||
|
||||
if (NumFiles == 1) {
|
||||
if ((GifFileIn = DGifOpenFileName(*FileName)) == NULL)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
}
|
||||
else {
|
||||
/* Use stdin instead: */
|
||||
if ((GifFileIn = DGifOpenFileHandle(0)) == NULL)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
}
|
||||
|
||||
if (SaveFlag) {
|
||||
/* We are dumping out the color map as text file to stdout: */
|
||||
ColorFile = stdout;
|
||||
}
|
||||
else {
|
||||
if (TranslateFlag) {
|
||||
/* We are loading new color map from specified file: */
|
||||
if ((TranslateFile = fopen(TranslateFileName, "rt")) == NULL)
|
||||
GIF_EXIT("Failed to open specified color translation file.");
|
||||
}
|
||||
|
||||
if (LoadFlag) {
|
||||
/* We are loading new color map from specified file: */
|
||||
if ((ColorFile = fopen(ColorFileName, "rt")) == NULL)
|
||||
GIF_EXIT("Failed to open specified color map file.");
|
||||
}
|
||||
}
|
||||
|
||||
if ((HasGIFOutput = (LoadFlag || TranslateFlag || GammaFlag)) != 0) {
|
||||
/* Open stdout for GIF output file: */
|
||||
if ((GifFileOut = EGifOpenFileHandle(1)) == NULL)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
}
|
||||
|
||||
if (!ImageNFlag) {
|
||||
/* We are suppose to modify the screen color map, so do it: */
|
||||
GifFileIn->SColorMap = ModifyColorMap(GifFileIn->SColorMap);
|
||||
if (!HasGIFOutput) {
|
||||
/* We can quit here, as we have the color map: */
|
||||
if (GifFileIn != NULL) DGifCloseFile(GifFileIn);
|
||||
fclose(ColorFile);
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
}
|
||||
/* And dump out its new possible repositioned screen information: */
|
||||
if (HasGIFOutput)
|
||||
if (EGifPutScreenDesc(GifFileOut,
|
||||
GifFileIn->SWidth, GifFileIn->SHeight,
|
||||
GifFileIn->SColorResolution, GifFileIn->SBackGroundColor,
|
||||
GifFileIn->SColorMap) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
|
||||
/* Scan the content of the GIF file and load the image(s) in: */
|
||||
do {
|
||||
if (DGifGetRecordType(GifFileIn, &RecordType) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
|
||||
switch (RecordType) {
|
||||
case IMAGE_DESC_RECORD_TYPE:
|
||||
if (DGifGetImageDesc(GifFileIn) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
if ((++ImageNum == ImageN) && ImageNFlag) {
|
||||
/* We are suppose to modify this image color map, do it: */
|
||||
GifFileIn->SColorMap =ModifyColorMap(GifFileIn->SColorMap);
|
||||
if (!HasGIFOutput) {
|
||||
/* We can quit here, as we have the color map: */
|
||||
if (GifFileIn != NULL) DGifCloseFile(GifFileIn);
|
||||
fclose(ColorFile);
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
}
|
||||
if (HasGIFOutput)
|
||||
if (EGifPutImageDesc(GifFileOut,
|
||||
GifFileIn->Image.Left, GifFileIn->Image.Top,
|
||||
GifFileIn->Image.Width, GifFileIn->Image.Height,
|
||||
GifFileIn->Image.Interlace,
|
||||
GifFileIn->Image.ColorMap) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
|
||||
if (!TranslateFlag || (ImageNFlag && (ImageN != ImageNum)))
|
||||
{
|
||||
/* Now read image itself in decoded form as we don't */
|
||||
/* really care what we have there, and this is much */
|
||||
/* faster. */
|
||||
if (DGifGetCode(GifFileIn, &CodeSize, &CodeBlock) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
if (HasGIFOutput)
|
||||
if (EGifPutCode(GifFileOut, CodeSize, CodeBlock) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
while (CodeBlock != NULL) {
|
||||
if (DGifGetCodeNext(GifFileIn, &CodeBlock) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
if (HasGIFOutput)
|
||||
if (EGifPutCodeNext(GifFileOut, CodeBlock) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
}
|
||||
}
|
||||
else /* we need to mung pixels intices */
|
||||
{
|
||||
int i;
|
||||
register GifPixelType *cp;
|
||||
|
||||
GifPixelType *Line
|
||||
= (GifPixelType *) malloc(GifFileIn->Image.Width *
|
||||
sizeof(GifPixelType));
|
||||
for (i = 0; i < GifFileIn->Image.Height; i++) {
|
||||
if (DGifGetLine(GifFileIn, Line,GifFileIn->Image.Width)
|
||||
== GIF_ERROR) {
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
}
|
||||
|
||||
/* translation step goes here */
|
||||
for (cp = Line; cp < Line+GifFileIn->Image.Width; cp++)
|
||||
*cp = Translation[*cp];
|
||||
|
||||
if (EGifPutLine(GifFileOut,
|
||||
Line, GifFileIn->Image.Width)
|
||||
== GIF_ERROR) {
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
}
|
||||
}
|
||||
free((char *) Line);
|
||||
}
|
||||
break;
|
||||
case EXTENSION_RECORD_TYPE:
|
||||
/* Skip any extension blocks in file: */
|
||||
if (DGifGetExtension(GifFileIn, &ExtCode, &Extension) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
if (HasGIFOutput)
|
||||
if (EGifPutExtension(GifFileOut, ExtCode, Extension[0],
|
||||
Extension) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
|
||||
/* No support to more than one extension blocks, so discard: */
|
||||
while (Extension != NULL) {
|
||||
if (DGifGetExtensionNext(GifFileIn, &Extension) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
}
|
||||
break;
|
||||
case TERMINATE_RECORD_TYPE:
|
||||
break;
|
||||
default: /* Should be traps by DGifGetRecordType. */
|
||||
break;
|
||||
}
|
||||
}
|
||||
while (RecordType != TERMINATE_RECORD_TYPE);
|
||||
|
||||
if (DGifCloseFile(GifFileIn) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
if (HasGIFOutput)
|
||||
if (EGifCloseFile(GifFileOut) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* Modify the given colormap according to global variables setting. *
|
||||
******************************************************************************/
|
||||
static ColorMapObject *ModifyColorMap(ColorMapObject *ColorMap)
|
||||
{
|
||||
int i, Dummy, Red, Green, Blue, Max = 0;
|
||||
double Gamma1;
|
||||
|
||||
if (SaveFlag) {
|
||||
/* Save this color map to ColorFile: */
|
||||
for (i = 0; i < ColorMap->ColorCount; i++)
|
||||
fprintf(ColorFile, "%3d %3d %3d %3d\n", i,
|
||||
ColorMap->Colors[i].Red,
|
||||
ColorMap->Colors[i].Green,
|
||||
ColorMap->Colors[i].Blue);
|
||||
return(ColorMap);
|
||||
}
|
||||
else if (LoadFlag) {
|
||||
/* Read the color map in ColorFile into this color map: */
|
||||
for (i = 0; i < ColorMap->ColorCount; i++) {
|
||||
if (feof(ColorFile))
|
||||
GIF_EXIT("Color file to load color map from, too small.");
|
||||
fscanf(ColorFile, "%3d %3d %3d %3d\n", &Dummy, &Red, &Green, &Blue);
|
||||
ColorMap->Colors[i].Red = Red;
|
||||
ColorMap->Colors[i].Green = Green;
|
||||
ColorMap->Colors[i].Blue = Blue;
|
||||
}
|
||||
return(ColorMap);
|
||||
}
|
||||
else if (GammaFlag) {
|
||||
/* Apply gamma correction to this color map: */
|
||||
Gamma1 = 1.0 / Gamma;
|
||||
for (i = 0; i < ColorMap->ColorCount; i++) {
|
||||
ColorMap->Colors[i].Red =
|
||||
((int) (255 * pow(ColorMap->Colors[i].Red / 255.0, Gamma1)));
|
||||
ColorMap->Colors[i].Green =
|
||||
((int) (255 * pow(ColorMap->Colors[i].Green / 255.0, Gamma1)));
|
||||
ColorMap->Colors[i].Blue =
|
||||
((int) (255 * pow(ColorMap->Colors[i].Blue / 255.0, Gamma1)));
|
||||
}
|
||||
return(ColorMap);
|
||||
}
|
||||
else if (TranslateFlag) {
|
||||
ColorMapObject *NewMap;
|
||||
|
||||
/* Read the translation table in TranslateFile: */
|
||||
for (i = 0; i < ColorMap->ColorCount; i++) {
|
||||
int tmp;
|
||||
if (feof(TranslateFile))
|
||||
GIF_EXIT("Color file to load color map from, too small.");
|
||||
fscanf(TranslateFile, "%3d %3d\n", &Dummy, &tmp);
|
||||
Translation[i] = tmp;
|
||||
if (Translation[i] > Max)
|
||||
Max = Translation[i];
|
||||
}
|
||||
|
||||
if ((NewMap = MakeMapObject(1 << BitSize(Max+1), NULL)) == NULL)
|
||||
GIF_EXIT("Out of memory while allocating color map!");
|
||||
|
||||
/* Apply the translation; we'll do it to the pixels, too */
|
||||
for (i = 0; i < ColorMap->ColorCount; i++) {
|
||||
NewMap->Colors[i] = ColorMap->Colors[Translation[i]];
|
||||
}
|
||||
|
||||
return(NewMap);
|
||||
}
|
||||
else
|
||||
{
|
||||
GIF_EXIT("Nothing to do!");
|
||||
return(ColorMap);
|
||||
}
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* Close both input and output file (if open), and exit. *
|
||||
******************************************************************************/
|
||||
static void QuitGifError(GifFileType *GifFileIn, GifFileType *GifFileOut)
|
||||
{
|
||||
PrintGifError();
|
||||
if (GifFileIn != NULL) DGifCloseFile(GifFileIn);
|
||||
if (GifFileOut != NULL) EGifCloseFile(GifFileOut);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
189
third_party/giflib/util/gifcolor.c
vendored
@ -1,189 +0,0 @@
|
||||
/*****************************************************************************
|
||||
* "Gif-Lib" - Yet another gif library. *
|
||||
* *
|
||||
* Written by: Gershon Elber Ver 0.1, Jul. 1989 *
|
||||
******************************************************************************
|
||||
* Program to generate a test pattern from a given color map *
|
||||
******************************************************************************
|
||||
* Options: *
|
||||
* -q : quiet printing mode. *
|
||||
* -b : set background color.
|
||||
* -h : on-line help. *
|
||||
******************************************************************************
|
||||
* History: *
|
||||
* 21 Sep 92 - Version 1.0 by Eric S. Raymond. *
|
||||
*****************************************************************************/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#ifdef __MSDOS__
|
||||
#include <stdlib.h>
|
||||
#include <alloc.h>
|
||||
#endif /* __MSDOS__ */
|
||||
|
||||
#ifndef __MSDOS__
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
#include "gif_lib.h"
|
||||
#include "getarg.h"
|
||||
|
||||
#define PROGRAM_NAME "GifColor"
|
||||
|
||||
#define LINE_LEN 40
|
||||
#define IMAGEWIDTH LINE_LEN*GIF_FONT_WIDTH
|
||||
|
||||
#ifdef __MSDOS__
|
||||
extern unsigned int
|
||||
_stklen = 16384; /* Increase default stack size. */
|
||||
#endif /* __MSDOS__ */
|
||||
|
||||
#ifdef SYSV
|
||||
static char *VersionStr =
|
||||
"Gif library module \t\tGershon Elber\n\
|
||||
(C) Copyright 1989 Gershon Elber.\n";
|
||||
static char
|
||||
*CtrlStr = "GifColor q%- b%-Background!d h%-";
|
||||
#else
|
||||
static char
|
||||
*VersionStr =
|
||||
PROGRAM_NAME
|
||||
GIF_LIB_VERSION
|
||||
" Gershon Elber, "
|
||||
__DATE__ ", " __TIME__ "\n"
|
||||
"(C) Copyright 1989 Gershon Elber.\n";
|
||||
static char
|
||||
*CtrlStr = PROGRAM_NAME " q%- b%-Background!d h%-";
|
||||
#endif /* SYSV */
|
||||
|
||||
static int BackGround = 0;
|
||||
static void QuitGifError(GifFileType *GifFile);
|
||||
static void GenRasterTextLine(GifRowType *RasterBuffer, char *TextLine,
|
||||
int BufferWidth, int ForeGroundIndex);
|
||||
|
||||
/******************************************************************************
|
||||
* Interpret the command line and generate the given GIF file. *
|
||||
******************************************************************************/
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
int i, j, l, Error, GifQuietPrint, ColorMapSize,
|
||||
BackGroundFlag = FALSE, HelpFlag = FALSE;
|
||||
char Line[LINE_LEN];
|
||||
GifRowType RasterBuffer[GIF_FONT_HEIGHT];
|
||||
ColorMapObject *ColorMap;
|
||||
GifFileType *GifFile;
|
||||
GifColorType ScratchMap[256];
|
||||
int red, green, blue;
|
||||
|
||||
if ((Error = GAGetArgs(argc, argv, CtrlStr,
|
||||
&GifQuietPrint,
|
||||
&BackGroundFlag, &BackGround,
|
||||
&HelpFlag)) != FALSE) {
|
||||
GAPrintErrMsg(Error);
|
||||
GAPrintHowTo(CtrlStr);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if (HelpFlag) {
|
||||
fprintf(stderr, VersionStr);
|
||||
GAPrintHowTo(CtrlStr);
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
/* Allocate the raster buffer for GIF_FONT_HEIGHT scan lines. */
|
||||
for (i = 0; i < GIF_FONT_HEIGHT; i++)
|
||||
{
|
||||
if ((RasterBuffer[i] = (GifRowType) malloc(sizeof(GifPixelType) *
|
||||
IMAGEWIDTH)) == NULL)
|
||||
GIF_EXIT("Failed to allocate memory required, aborted.");
|
||||
}
|
||||
|
||||
/* Open stdout for the output file: */
|
||||
if ((GifFile = EGifOpenFileHandle(1)) == NULL)
|
||||
QuitGifError(GifFile);
|
||||
|
||||
/* Read the color map in ColorFile into this color map: */
|
||||
ColorMapSize = 0;
|
||||
while (fscanf(stdin,
|
||||
"%*3d %3d %3d %3d\n",
|
||||
&red, &green, &blue) == 3) {
|
||||
ScratchMap[ColorMapSize].Red = red;
|
||||
ScratchMap[ColorMapSize].Green = green;
|
||||
ScratchMap[ColorMapSize].Blue = blue;
|
||||
ColorMapSize++;
|
||||
}
|
||||
|
||||
if ((ColorMap = MakeMapObject(1 << BitSize(ColorMapSize), ScratchMap)) == NULL)
|
||||
GIF_EXIT("Failed to allocate memory required, aborted.");
|
||||
|
||||
if (EGifPutScreenDesc(GifFile,
|
||||
IMAGEWIDTH, ColorMapSize * GIF_FONT_HEIGHT,
|
||||
BitSize(ColorMapSize),
|
||||
BackGround, ColorMap) == GIF_ERROR)
|
||||
QuitGifError(GifFile);
|
||||
|
||||
/* Dump out the image descriptor: */
|
||||
if (EGifPutImageDesc(GifFile,
|
||||
0, 0, IMAGEWIDTH, ColorMapSize * GIF_FONT_HEIGHT, FALSE, NULL) == GIF_ERROR)
|
||||
QuitGifError(GifFile);
|
||||
|
||||
GifQprintf("\n%s: Image 1 at (%d, %d) [%dx%d]: ",
|
||||
PROGRAM_NAME, GifFile->Image.Left, GifFile->Image.Top,
|
||||
GifFile->Image.Width, GifFile->Image.Height);
|
||||
|
||||
for (i = l = 0; i < ColorMap->ColorCount; i++) {
|
||||
(void)sprintf(Line, "Color %-3d: [%-3d, %-3d, %-3d] ", i,
|
||||
ColorMap->Colors[i].Red,
|
||||
ColorMap->Colors[i].Green,
|
||||
ColorMap->Colors[i].Blue);
|
||||
GenRasterTextLine(RasterBuffer, Line, IMAGEWIDTH, i);
|
||||
for (j = 0; j < GIF_FONT_HEIGHT; j++) {
|
||||
if (EGifPutLine(GifFile, RasterBuffer[j], IMAGEWIDTH) == GIF_ERROR)
|
||||
QuitGifError(GifFile);
|
||||
GifQprintf("\b\b\b\b%-4d", l++);
|
||||
}
|
||||
}
|
||||
|
||||
if (EGifCloseFile(GifFile) == GIF_ERROR)
|
||||
QuitGifError(GifFile);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* Close output file (if open), and exit. *
|
||||
******************************************************************************/
|
||||
static void GenRasterTextLine(GifRowType *RasterBuffer, char *TextLine,
|
||||
int BufferWidth, int ForeGroundIndex)
|
||||
{
|
||||
unsigned char c;
|
||||
unsigned char Byte, Mask;
|
||||
int i, j, k, CharPosX, Len = strlen(TextLine);
|
||||
|
||||
for (i = 0; i < BufferWidth; i++)
|
||||
for (j = 0; j < GIF_FONT_HEIGHT; j++) RasterBuffer[j][i] = BackGround;
|
||||
|
||||
for (i = CharPosX = 0; i < Len; i++, CharPosX += GIF_FONT_WIDTH) {
|
||||
c = TextLine[i];
|
||||
for (j = 0; j < GIF_FONT_HEIGHT; j++) {
|
||||
Byte = AsciiTable[(unsigned short)c][j];
|
||||
for (k = 0, Mask = 128; k < GIF_FONT_WIDTH; k++, Mask >>= 1)
|
||||
if (Byte & Mask)
|
||||
RasterBuffer[j][CharPosX + k] = ForeGroundIndex;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* Close output file (if open), and exit. *
|
||||
******************************************************************************/
|
||||
static void QuitGifError(GifFileType *GifFile)
|
||||
{
|
||||
PrintGifError();
|
||||
if (GifFile != NULL) EGifCloseFile(GifFile);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
266
third_party/giflib/util/gifcomb.c
vendored
@ -1,266 +0,0 @@
|
||||
/*****************************************************************************
|
||||
* "Gif-Lib" - Yet another gif library. *
|
||||
* *
|
||||
* Written by: Gershon Elber Ver 0.1, Jul. 1989 *
|
||||
******************************************************************************
|
||||
* Program to combine 2 GIF images into single one, using optional mask GIF *
|
||||
* file. Result colormap will be the union of the two images colormaps. *
|
||||
* Both images should have exactly the same size, although they may be mapped *
|
||||
* differently on screen. Only First GIF screen descriptor info. is used. *
|
||||
* Options: *
|
||||
* -q : quiet printing mode. *
|
||||
* -m mask : optional boolean image, defines where second GIF should be used. *
|
||||
* -h : on-line help. *
|
||||
******************************************************************************
|
||||
* History: *
|
||||
* 12 Jul 89 - Version 1.0 by Gershon Elber. *
|
||||
*****************************************************************************/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#ifdef __MSDOS__
|
||||
#include <stdlib.h>
|
||||
#include <alloc.h>
|
||||
#endif /* _MSDOS__ */
|
||||
|
||||
#ifndef __MSDOS__
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
#include "gif_lib.h"
|
||||
#include "getarg.h"
|
||||
|
||||
#define PROGRAM_NAME "GifComb"
|
||||
|
||||
#ifdef __MSDOS__
|
||||
extern unsigned int
|
||||
_stklen = 16384; /* Increase default stack size. */
|
||||
#endif /* __MSDOS__ */
|
||||
|
||||
#ifdef SYSV
|
||||
static char *VersionStr =
|
||||
"Gif toolkit module,\t\tGershon Elber\n\
|
||||
(C) Copyright 1989 Gershon Elber.\n";
|
||||
static char
|
||||
*CtrlStr = "GifComb q%- m%-MaskGIFFile!s h%- GifFile!*s";
|
||||
#else
|
||||
static char
|
||||
*VersionStr =
|
||||
PROGRAM_NAME
|
||||
GIF_LIB_VERSION
|
||||
" Gershon Elber, "
|
||||
__DATE__ ", " __TIME__ "\n"
|
||||
"(C) Copyright 1989 Gershon Elber.\n";
|
||||
static char
|
||||
*CtrlStr =
|
||||
PROGRAM_NAME
|
||||
" q%- m%-MaskGIFFile!s h%- GifFile!*s";
|
||||
#endif /* SYSV */
|
||||
|
||||
static int ReadUntilImage(GifFileType *GifFile);
|
||||
static void QuitGifError(GifFileType *GifFileIn1, GifFileType *GifFileIn2,
|
||||
GifFileType *GifMaskFile, GifFileType *GifFileOut);
|
||||
|
||||
/******************************************************************************
|
||||
* Interpret the command line and scan the given GIF file. *
|
||||
******************************************************************************/
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
int i, j, Error, NumFiles, Size,
|
||||
MaskFlag = FALSE, HelpFlag = FALSE;
|
||||
char **FileName = NULL, *MaskFileName;
|
||||
GifPixelType ColorTransIn2[256];
|
||||
GifRowType LineIn1 = NULL, LineIn2 = NULL, LineMask = NULL, LineOut = NULL;
|
||||
ColorMapObject *ColorUnion;
|
||||
ColorMapObject *ColorIn1 = NULL, *ColorIn2 = NULL;
|
||||
GifFileType *GifFileIn1 = NULL, *GifFileIn2 = NULL, *GifMaskFile = NULL,
|
||||
*GifFileOut = NULL;
|
||||
|
||||
if ((Error = GAGetArgs(argc, argv, CtrlStr,
|
||||
&GifQuietPrint, &MaskFlag, &MaskFileName,
|
||||
&HelpFlag, &NumFiles, &FileName)) != FALSE ||
|
||||
(NumFiles != 2 && !HelpFlag)) {
|
||||
if (Error)
|
||||
GAPrintErrMsg(Error);
|
||||
else if (NumFiles != 2)
|
||||
GIF_MESSAGE("Error in command line parsing - two GIF file please.");
|
||||
GAPrintHowTo(CtrlStr);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if (HelpFlag) {
|
||||
fprintf(stderr, VersionStr);
|
||||
GAPrintHowTo(CtrlStr);
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
/* Open all input files (two GIF to combine, and optional mask): */
|
||||
if ((GifFileIn1 = DGifOpenFileName(FileName[0])) == NULL ||
|
||||
(GifFileIn2 = DGifOpenFileName(FileName[1])) == NULL ||
|
||||
(MaskFlag && (GifMaskFile = DGifOpenFileName(MaskFileName)) == NULL))
|
||||
QuitGifError(GifFileIn1, GifFileIn2, GifMaskFile, GifFileOut);
|
||||
|
||||
if (ReadUntilImage(GifFileIn1) == GIF_ERROR ||
|
||||
ReadUntilImage(GifFileIn2) == GIF_ERROR ||
|
||||
(MaskFlag && ReadUntilImage(GifMaskFile) == GIF_ERROR))
|
||||
QuitGifError(GifFileIn1, GifFileIn2, GifMaskFile, GifFileOut);
|
||||
|
||||
if (GifFileIn1->Image.Width != GifFileIn2->Image.Width ||
|
||||
GifFileIn2->Image.Height != GifFileIn2->Image.Height ||
|
||||
(MaskFlag && (GifFileIn1->Image.Width != GifMaskFile->Image.Width ||
|
||||
GifFileIn1->Image.Height != GifMaskFile->Image.Height)))
|
||||
GIF_EXIT("Given GIF files have different image dimensions.");
|
||||
|
||||
/* Open stdout for the output file: */
|
||||
if ((GifFileOut = EGifOpenFileHandle(1)) == NULL)
|
||||
QuitGifError(GifFileIn1, GifFileIn2, GifMaskFile, GifFileOut);
|
||||
|
||||
Size = sizeof(GifPixelType) * GifFileIn1->Image.Width;
|
||||
if ((LineIn1 = (GifRowType) malloc(Size)) == NULL ||
|
||||
(LineIn2 = (GifRowType) malloc(Size)) == NULL ||
|
||||
(MaskFlag && (LineMask = (GifRowType) malloc(Size)) == NULL) ||
|
||||
(LineOut = (GifRowType) malloc(Size)) == NULL)
|
||||
GIF_EXIT("Failed to allocate memory required, aborted.");
|
||||
|
||||
if (GifFileIn1->Image.ColorMap) {
|
||||
ColorIn1 = GifFileIn1->Image.ColorMap;
|
||||
}
|
||||
else if (GifFileIn1->SColorMap) {
|
||||
ColorIn1 = GifFileIn1->SColorMap;
|
||||
}
|
||||
else
|
||||
GIF_EXIT("Neither Screen nor Image color map exists - GIF file 1.");
|
||||
|
||||
if (GifFileIn2->Image.ColorMap) {
|
||||
ColorIn2 = GifFileIn2->Image.ColorMap;
|
||||
}
|
||||
else if (GifFileIn2->SColorMap) {
|
||||
ColorIn2 = GifFileIn2->SColorMap;
|
||||
}
|
||||
else
|
||||
GIF_EXIT("Neither Screen nor Image color map exists - GIF file 2.");
|
||||
|
||||
/* Create union of the two given color maps. ColorIn1 will be copied as */
|
||||
/* is while ColorIn2 will be mapped using ColorTransIn2 table. */
|
||||
/* ColorUnion is allocated by the procedure itself. */
|
||||
if ((ColorUnion = UnionColorMap(ColorIn1, ColorIn2, ColorTransIn2))==NULL)
|
||||
GIF_EXIT("Unioned color map is too big (>256 colors).");
|
||||
|
||||
/* Dump out new image and screen descriptors: */
|
||||
if (EGifPutScreenDesc(GifFileOut,
|
||||
GifFileIn1->SWidth, GifFileIn1->SHeight,
|
||||
ColorUnion->BitsPerPixel, GifFileIn1->SBackGroundColor,
|
||||
ColorUnion) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn1, GifFileIn2, GifMaskFile, GifFileOut);
|
||||
|
||||
if (EGifPutImageDesc(GifFileOut,
|
||||
GifFileIn1->Image.Left, GifFileIn1->Image.Top,
|
||||
GifFileIn1->Image.Width, GifFileIn1->Image.Height,
|
||||
GifFileIn1->Image.Interlace, NULL) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn1, GifFileIn2, GifMaskFile, GifFileOut);
|
||||
|
||||
|
||||
/* Time to do it: read 2 scan lines from 2 files (and optionally from */
|
||||
/* the mask file, merge them and them result out. Do it Height times: */
|
||||
GifQprintf("\n%s: Image 1 at (%d, %d) [%dx%d]: ",
|
||||
PROGRAM_NAME, GifFileOut->Image.Left, GifFileOut->Image.Top,
|
||||
GifFileOut->Image.Width, GifFileOut->Image.Height);
|
||||
for (i = 0; i < GifFileIn1->Image.Height; i++) {
|
||||
if (DGifGetLine(GifFileIn1, LineIn1, GifFileIn1->Image.Width) == GIF_ERROR ||
|
||||
DGifGetLine(GifFileIn2, LineIn2, GifFileIn2->Image.Width) == GIF_ERROR ||
|
||||
(MaskFlag &&
|
||||
DGifGetLine(GifMaskFile, LineMask, GifMaskFile->Image.Width)
|
||||
== GIF_ERROR))
|
||||
QuitGifError(GifFileIn1, GifFileIn2, GifMaskFile, GifFileOut);
|
||||
if (MaskFlag) {
|
||||
/* Every time Mask has non background color, use LineIn1 pixel, */
|
||||
/* otherwise use LineIn2 pixel instead. */
|
||||
for (j = 0; j < GifFileIn1->Image.Width; j++) {
|
||||
if (LineMask[j] != GifMaskFile->SBackGroundColor)
|
||||
LineOut[j] = LineIn1[j];
|
||||
else
|
||||
LineOut[j] = ColorTransIn2[LineIn2[j]];
|
||||
}
|
||||
}
|
||||
else {
|
||||
/* Every time Color of Image 1 is equal to background - take it */
|
||||
/* From Image 2 instead of the background. */
|
||||
for (j = 0; j < GifFileIn1->Image.Width; j++) {
|
||||
if (LineIn1[j] != GifFileIn1->SBackGroundColor)
|
||||
LineOut[j] = LineIn1[j];
|
||||
else
|
||||
LineOut[j] = ColorTransIn2[LineIn2[j]];
|
||||
}
|
||||
}
|
||||
if (EGifPutLine(GifFileOut, LineOut, GifFileOut->Image.Width)
|
||||
== GIF_ERROR)
|
||||
QuitGifError(GifFileIn1, GifFileIn2, GifMaskFile, GifFileOut);
|
||||
GifQprintf("\b\b\b\b%-4d", i);
|
||||
}
|
||||
|
||||
FreeMapObject(ColorUnion); /* We dont need this any more... */
|
||||
ColorUnion = NULL;
|
||||
|
||||
if (DGifCloseFile(GifFileIn1) == GIF_ERROR ||
|
||||
DGifCloseFile(GifFileIn2) == GIF_ERROR ||
|
||||
EGifCloseFile(GifFileOut) == GIF_ERROR ||
|
||||
(MaskFlag && DGifCloseFile(GifMaskFile) == GIF_ERROR))
|
||||
QuitGifError(GifFileIn1, GifFileIn2, GifMaskFile, GifFileOut);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* Read until first image in GIF file is detected and read its descriptor. *
|
||||
******************************************************************************/
|
||||
static int ReadUntilImage(GifFileType *GifFile)
|
||||
{
|
||||
int ExtCode;
|
||||
GifRecordType RecordType;
|
||||
GifByteType *Extension;
|
||||
|
||||
/* Scan the content of the GIF file, until image descriptor is detected: */
|
||||
do {
|
||||
if (DGifGetRecordType(GifFile, &RecordType) == GIF_ERROR)
|
||||
return GIF_ERROR;
|
||||
|
||||
switch (RecordType) {
|
||||
case IMAGE_DESC_RECORD_TYPE:
|
||||
return DGifGetImageDesc(GifFile);
|
||||
case EXTENSION_RECORD_TYPE:
|
||||
/* Skip any extension blocks in file: */
|
||||
if (DGifGetExtension(GifFile, &ExtCode, &Extension) == GIF_ERROR)
|
||||
return GIF_ERROR;
|
||||
|
||||
while (Extension != NULL)
|
||||
if (DGifGetExtensionNext(GifFile, &Extension) == GIF_ERROR)
|
||||
return GIF_ERROR;
|
||||
break;
|
||||
case TERMINATE_RECORD_TYPE:
|
||||
break;
|
||||
default: /* Should be traps by DGifGetRecordType. */
|
||||
break;
|
||||
}
|
||||
}
|
||||
while (RecordType != TERMINATE_RECORD_TYPE);
|
||||
|
||||
return GIF_ERROR; /* We should be here - no image was found! */
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* Close both input and output file (if open), and exit. *
|
||||
******************************************************************************/
|
||||
static void QuitGifError(GifFileType *GifFileIn1, GifFileType *GifFileIn2,
|
||||
GifFileType *GifMaskFile, GifFileType *GifFileOut)
|
||||
{
|
||||
PrintGifError();
|
||||
if (GifFileIn1 != NULL) DGifCloseFile(GifFileIn1);
|
||||
if (GifFileIn2 != NULL) DGifCloseFile(GifFileIn2);
|
||||
if (GifMaskFile != NULL) DGifCloseFile(GifMaskFile);
|
||||
if (GifFileOut != NULL) EGifCloseFile(GifFileOut);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
119
third_party/giflib/util/gifcompose
vendored
@ -1,119 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# gifcompose --- a GIF compositor
|
||||
#
|
||||
# This script composes a GIF from a series of overlays described in an input
|
||||
# text file.
|
||||
#
|
||||
if [ "$1" = "-v" ]
|
||||
then
|
||||
echo=echo
|
||||
else
|
||||
echo=:
|
||||
fi
|
||||
|
||||
trap "rm -fr comp$$ tmp$$ btmp$$; exit 0" 0 1 2 15
|
||||
|
||||
mkdir comp$$;
|
||||
|
||||
gen="x"
|
||||
while read line
|
||||
do
|
||||
set -- $line
|
||||
postproc='n'
|
||||
name=$2
|
||||
case $1 in
|
||||
gif)
|
||||
$echo "Pasting GIF file $2.gif" 1>&2;
|
||||
cat $2.gif >tmp$$
|
||||
shift; shift; postproc='y' ;;
|
||||
raw)
|
||||
$echo "Pasting raw file $2" 1>&2;
|
||||
raw2gif -s $3 $4 <$2 >tmp$$
|
||||
shift; shift; shift; shift; postproc='y' ;;
|
||||
rgb)
|
||||
$echo "Pasting RGB file $2" 1>&2;
|
||||
rgb2gif -s $3 $4 <$2 >tmp$$
|
||||
shift; shift; shift; shift; postproc='y' ;;
|
||||
rle)
|
||||
$echo "Pasting RLE file $2" 1>&2;
|
||||
rle2gif $2 >tmp$$
|
||||
shift; shift; postproc='y' ;;
|
||||
text)
|
||||
$echo "Generating text \`$2'" 1>&2;
|
||||
case "$3" in
|
||||
foreground)
|
||||
text2gif -t "$2" -f $4 >tmp$$;
|
||||
shift; shift;;
|
||||
background)
|
||||
text2gif -t "$2" -c $4 $5 $6 >tmp$$;
|
||||
shift; shift; shift; shift;;
|
||||
*)
|
||||
text2gif -t "$2" >tmp$$;;
|
||||
esac
|
||||
shift; shift; postproc='y' ;;
|
||||
screen)
|
||||
case $2 in
|
||||
size) resize="$3 $4";;
|
||||
position) reposition="$3 $4";;
|
||||
*) echo "Unknown screen operation" 1>&2
|
||||
esac;;
|
||||
esac
|
||||
|
||||
if [ $postproc = 'y' ]
|
||||
then
|
||||
while [ $# != 0 ]
|
||||
do
|
||||
case "$1" in
|
||||
at)
|
||||
$echo "Positioning \`$name' at $2 $3" 1>&2
|
||||
gifpos -i $2 $3 <tmp$$ >btmp$$; mv btmp$$ tmp$$;
|
||||
shift; shift; shift;;
|
||||
clip)
|
||||
$echo "Clipping \`$name' to size $2 $3 $4 $5" 1>&2
|
||||
gifclip -i $2 $3 $4 $5 <tmp$$ >btmp$$; mv btmp$$ tmp$$;
|
||||
shift; shift; shift; shift; shift;;
|
||||
xflip)
|
||||
$echo "Flipping \`$name' around the X axis" 1>&2;
|
||||
gifflip -x <tmp$$ >btmp$$; mv btmp$$ tmp$$;
|
||||
shift;;
|
||||
yflip)
|
||||
$echo "Flipping \`$name' around the Y axis" 1>&2;
|
||||
gifflip -y <tmp$$ >btmp$$; mv btmp$$ tmp$$;
|
||||
shift;;
|
||||
left)
|
||||
$echo "Rotating \`$name' left (counterclockwise)" 1>&2;
|
||||
gifflip -l <tmp$$ >btmp$$; mv btmp$$ tmp$$;
|
||||
shift;;
|
||||
right)
|
||||
$echo "Rotating \`$name' right (clockwise)" 1>&2;
|
||||
gifflip -r <tmp$$ >btmp$$; mv btmp$$ tmp$$;
|
||||
shift;;
|
||||
''|\#*)
|
||||
break;;
|
||||
*)
|
||||
echo "Unknown operator \`$1'" 1>&2
|
||||
shift;;
|
||||
esac
|
||||
done
|
||||
|
||||
mv tmp$$ comp$$/${gen}.gif
|
||||
fi
|
||||
|
||||
gen="${gen}x";
|
||||
done
|
||||
|
||||
gifasm comp$$/*.gif | gifovly -t 0 >tmp$$
|
||||
if [ "$resize" ]
|
||||
then
|
||||
gifpos -s $resize <tmp$$ >btmp$$; mv btmp$$ tmp$$;
|
||||
fi
|
||||
if [ "$reposition" ]
|
||||
then
|
||||
gifpos -n $reposition <tmp$$ >btmp$$; mv btmp$$ tmp$$;
|
||||
fi
|
||||
cat tmp$$
|
||||
|
||||
$echo "Done."
|
||||
|
||||
# script ends here
|
142
third_party/giflib/util/giffiltr.c
vendored
@ -1,142 +0,0 @@
|
||||
/*
|
||||
* Skeleton file for generic GIF `filter' program --- sequentially read GIF
|
||||
* records from stdin, process them, send them out. Most of the junk above
|
||||
* `int main' isn't needed for the skeleton, but is likely to be for what
|
||||
* you'll do with it.
|
||||
*
|
||||
* If you compile this, it will turn into an expensive GIF copying routine;
|
||||
* stdin to stdout with no changes and minimal validation. Well, it's a
|
||||
* decent test of the low-level routines, anyway.
|
||||
*
|
||||
* Note: due to the vicissitudes of Lempel-Ziv compression, the output of this
|
||||
* copier may not be bitwise identical to its input. This can happen if you
|
||||
* copy an image from a much more (or much *less*) memory-limited system; your
|
||||
* compression may use more (or fewer) bits. The uncompressed rasters should,
|
||||
* however, be identical (you can check this with icon2gif -d).
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#ifdef __MSDOS__
|
||||
#include <dos.h>
|
||||
#include <alloc.h>
|
||||
#include <graphics.h>
|
||||
#include <io.h>
|
||||
#endif /* __MSDOS__ */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#ifdef HAVE_FCNTL_H
|
||||
#include <fcntl.h>
|
||||
#endif /* HAVE_FCNTL_H */
|
||||
#include "getarg.h"
|
||||
#include "gif_lib.h"
|
||||
|
||||
#define PROGRAM_NAME "giffiltr"
|
||||
|
||||
#ifdef __MSDOS__
|
||||
extern unsigned int
|
||||
_stklen = 16384; /* Increase default stack size. */
|
||||
#endif /* __MSDOS__ */
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* Close both input and output file (if open), and exit. *
|
||||
******************************************************************************/
|
||||
static void QuitGifError(GifFileType *GifFileIn, GifFileType *GifFileOut)
|
||||
{
|
||||
PrintGifError();
|
||||
if (GifFileIn != NULL) DGifCloseFile(GifFileIn);
|
||||
if (GifFileOut != NULL) EGifCloseFile(GifFileOut);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* Main sequence *
|
||||
******************************************************************************/
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
GifFileType *GifFileIn = NULL, *GifFileOut = NULL;
|
||||
GifRecordType RecordType;
|
||||
int CodeSize, ExtCode;
|
||||
GifByteType *CodeBlock, *Extension;
|
||||
|
||||
/*
|
||||
* Command-line processing goes here.
|
||||
*/
|
||||
|
||||
/* Use the stdin as input (note this also read screen descriptor in: */
|
||||
if ((GifFileIn = DGifOpenFileHandle(0)) == NULL)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
|
||||
/* Use the stdout as output: */
|
||||
if ((GifFileOut = EGifOpenFileHandle(1)) == NULL)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
|
||||
/* And dump out its screen information: */
|
||||
if (EGifPutScreenDesc(GifFileOut,
|
||||
GifFileIn->SWidth, GifFileIn->SHeight,
|
||||
GifFileIn->SColorResolution, GifFileIn->SBackGroundColor,
|
||||
GifFileIn->SColorMap) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
|
||||
/* Scan the content of the input GIF file and load the image(s) in: */
|
||||
do {
|
||||
if (DGifGetRecordType(GifFileIn, &RecordType) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
|
||||
switch (RecordType) {
|
||||
case IMAGE_DESC_RECORD_TYPE:
|
||||
if (DGifGetImageDesc(GifFileIn) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
/* Put image descriptor to out file: */
|
||||
if (EGifPutImageDesc(GifFileOut,
|
||||
GifFileIn->Image.Left, GifFileIn->Image.Top,
|
||||
GifFileIn->Image.Width, GifFileIn->Image.Height,
|
||||
GifFileIn->Image.Interlace,
|
||||
GifFileIn->Image.ColorMap) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
|
||||
/* Now read image itself in decoded form as we dont really */
|
||||
/* care what we have there, and this is much faster. */
|
||||
if (DGifGetCode(GifFileIn, &CodeSize, &CodeBlock) == GIF_ERROR ||
|
||||
EGifPutCode(GifFileOut, CodeSize, CodeBlock) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
while (CodeBlock != NULL) {
|
||||
if (DGifGetCodeNext(GifFileIn, &CodeBlock) == GIF_ERROR ||
|
||||
EGifPutCodeNext(GifFileOut, CodeBlock) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
}
|
||||
break;
|
||||
case EXTENSION_RECORD_TYPE:
|
||||
/* Skip any extension blocks in file: */
|
||||
if (DGifGetExtension(GifFileIn, &ExtCode, &Extension) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
if (EGifPutExtension(GifFileOut, ExtCode, Extension[0],
|
||||
Extension + 1) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
|
||||
/* No support to more than one extension blocks, so discard: */
|
||||
while (Extension != NULL) {
|
||||
if (DGifGetExtensionNext(GifFileIn, &Extension) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
}
|
||||
break;
|
||||
case TERMINATE_RECORD_TYPE:
|
||||
break;
|
||||
default: /* Should be trapped by DGifGetRecordType */
|
||||
break;
|
||||
}
|
||||
}
|
||||
while (RecordType != TERMINATE_RECORD_TYPE);
|
||||
|
||||
if (DGifCloseFile(GifFileIn) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
if (EGifCloseFile(GifFileOut) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
|
||||
return 0;
|
||||
}
|
220
third_party/giflib/util/giffix.c
vendored
@ -1,220 +0,0 @@
|
||||
/*****************************************************************************
|
||||
* "Gif-Lib" - Yet another gif library. *
|
||||
* *
|
||||
* Written by: Gershon Elber Ver 0.1, Jul. 1989 *
|
||||
******************************************************************************
|
||||
* Program to attempt and fix broken GIF images. Currently fix the following: *
|
||||
* 1. EOF terminates before end of image size (adds black in the end). *
|
||||
* Options: *
|
||||
* -q : quiet printing mode. *
|
||||
* -h : on-line help *
|
||||
******************************************************************************
|
||||
* History: *
|
||||
* 5 May 91 - Version 1.0 by Gershon Elber. *
|
||||
*****************************************************************************/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#ifdef __MSDOS__
|
||||
#include <stdlib.h>
|
||||
#include <alloc.h>
|
||||
#endif /* __MSDOS__ */
|
||||
|
||||
#ifndef __MSDOS__
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
#include "gif_lib.h"
|
||||
#include "getarg.h"
|
||||
|
||||
#define PROGRAM_NAME "GifFix"
|
||||
|
||||
#ifdef __MSDOS__
|
||||
extern unsigned int
|
||||
_stklen = 16384; /* Increase default stack size. */
|
||||
#endif /* __MSDOS__ */
|
||||
|
||||
#ifdef SYSV
|
||||
static char *VersionStr =
|
||||
"Gif toolkit module,\t\tGershon Elber\n\
|
||||
(C) Copyright 1989 Gershon Elber.\n";
|
||||
static char
|
||||
*CtrlStr = "GifFix q%- h%- GifFile!*s";
|
||||
#else
|
||||
static char
|
||||
*VersionStr =
|
||||
PROGRAM_NAME
|
||||
GIF_LIB_VERSION
|
||||
" Gershon Elber, "
|
||||
__DATE__ ", " __TIME__ "\n"
|
||||
"(C) Copyright 1989 Gershon Elber.\n";
|
||||
static char
|
||||
*CtrlStr =
|
||||
PROGRAM_NAME
|
||||
" q%- h%- GifFile!*s";
|
||||
#endif /* SYSV */
|
||||
|
||||
/* Make some variables global, so we could access them faster: */
|
||||
static int
|
||||
ImageNum = 0;
|
||||
|
||||
static void QuitGifError(GifFileType *GifFileIn, GifFileType *GifFileOut);
|
||||
|
||||
/******************************************************************************
|
||||
* Interpret the command line and scan the given GIF file. *
|
||||
******************************************************************************/
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
int i, j, Error, NumFiles, ExtCode, Row, Col, Width, Height,
|
||||
DarkestColor = 0, ColorIntens = 10000, HelpFlag = FALSE;
|
||||
GifRecordType RecordType;
|
||||
GifByteType *Extension;
|
||||
char **FileName = NULL;
|
||||
GifRowType LineBuffer;
|
||||
ColorMapObject *ColorMap;
|
||||
GifFileType *GifFileIn = NULL, *GifFileOut = NULL;
|
||||
|
||||
if ((Error = GAGetArgs(argc, argv, CtrlStr, &GifQuietPrint, &HelpFlag,
|
||||
&NumFiles, &FileName)) != FALSE ||
|
||||
(NumFiles > 1 && !HelpFlag)) {
|
||||
if (Error)
|
||||
GAPrintErrMsg(Error);
|
||||
else if (NumFiles > 1)
|
||||
GIF_MESSAGE("Error in command line parsing - one GIF file please.");
|
||||
GAPrintHowTo(CtrlStr);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if (HelpFlag) {
|
||||
fprintf(stderr, VersionStr);
|
||||
GAPrintHowTo(CtrlStr);
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
if (NumFiles == 1) {
|
||||
if ((GifFileIn = DGifOpenFileName(*FileName)) == NULL)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
}
|
||||
else {
|
||||
/* Use the stdin instead: */
|
||||
if ((GifFileIn = DGifOpenFileHandle(0)) == NULL)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
}
|
||||
|
||||
/* Open stdout for the output file: */
|
||||
if ((GifFileOut = EGifOpenFileHandle(1)) == NULL)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
|
||||
/* Dump out exactly same screen information: */
|
||||
if (EGifPutScreenDesc(GifFileOut,
|
||||
GifFileIn->SWidth, GifFileIn->SHeight,
|
||||
GifFileIn->SColorResolution, GifFileIn->SBackGroundColor,
|
||||
GifFileIn->SColorMap) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
|
||||
if ((LineBuffer = (GifRowType) malloc(GifFileIn->SWidth)) == NULL)
|
||||
GIF_EXIT("Failed to allocate memory required, aborted.");
|
||||
|
||||
/* Scan the content of the GIF file and load the image(s) in: */
|
||||
do {
|
||||
if (DGifGetRecordType(GifFileIn, &RecordType) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
|
||||
switch (RecordType) {
|
||||
case IMAGE_DESC_RECORD_TYPE:
|
||||
if (DGifGetImageDesc(GifFileIn) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
if (GifFileIn->Image.Interlace)
|
||||
GIF_EXIT("Cannt fix interlaced images.");
|
||||
|
||||
Row = GifFileIn->Image.Top; /* Image Position relative to Screen. */
|
||||
Col = GifFileIn->Image.Left;
|
||||
Width = GifFileIn->Image.Width;
|
||||
Height = GifFileIn->Image.Height;
|
||||
GifQprintf("\n%s: Image %d at (%d, %d) [%dx%d]: ",
|
||||
PROGRAM_NAME, ++ImageNum, Col, Row, Width, Height);
|
||||
|
||||
/* Put the image descriptor to out file: */
|
||||
if (EGifPutImageDesc(GifFileOut, Col, Row, Width, Height,
|
||||
FALSE, GifFileIn->Image.ColorMap) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
|
||||
/* Find the darkest color in color map to use as a filler. */
|
||||
ColorMap = (GifFileIn->Image.ColorMap ? GifFileIn->Image.ColorMap :
|
||||
GifFileIn->SColorMap);
|
||||
for (i = 0; i < ColorMap->ColorCount; i++) {
|
||||
j = ((int) ColorMap->Colors[i].Red) * 30 +
|
||||
((int) ColorMap->Colors[i].Green) * 59 +
|
||||
((int) ColorMap->Colors[i].Blue) * 11;
|
||||
if (j < ColorIntens) {
|
||||
ColorIntens = j;
|
||||
DarkestColor = i;
|
||||
}
|
||||
}
|
||||
|
||||
/* Load the image, and dump it. */
|
||||
for (i = 0; i < Height; i++) {
|
||||
GifQprintf("\b\b\b\b%-4d", i);
|
||||
if (DGifGetLine(GifFileIn, LineBuffer, Width)
|
||||
== GIF_ERROR) break;
|
||||
if (EGifPutLine(GifFileOut, LineBuffer, Width)
|
||||
== GIF_ERROR) QuitGifError(GifFileIn, GifFileOut);
|
||||
}
|
||||
|
||||
if (i < Height) {
|
||||
fprintf(stderr, "\nFollowing error occured (and ignored):");
|
||||
PrintGifError();
|
||||
|
||||
/* Fill in with the darkest color in color map. */
|
||||
for (j = 0; j < Width; j++)
|
||||
LineBuffer[j] = DarkestColor;
|
||||
for (; i < Height; i++)
|
||||
if (EGifPutLine(GifFileOut, LineBuffer, Width)
|
||||
== GIF_ERROR) QuitGifError(GifFileIn, GifFileOut);
|
||||
}
|
||||
break;
|
||||
case EXTENSION_RECORD_TYPE:
|
||||
/* Skip any extension blocks in file: */
|
||||
if (DGifGetExtension(GifFileIn, &ExtCode, &Extension) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
if (EGifPutExtension(GifFileOut, ExtCode, Extension[0],
|
||||
Extension) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
|
||||
/* No support to more than one extension blocks, so discard: */
|
||||
while (Extension != NULL) {
|
||||
if (DGifGetExtensionNext(GifFileIn, &Extension) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
}
|
||||
break;
|
||||
case TERMINATE_RECORD_TYPE:
|
||||
break;
|
||||
default: /* Should be traps by DGifGetRecordType. */
|
||||
break;
|
||||
}
|
||||
}
|
||||
while (RecordType != TERMINATE_RECORD_TYPE);
|
||||
|
||||
if (DGifCloseFile(GifFileIn) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
if (EGifCloseFile(GifFileOut) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* Close both input and output file (if open), and exit. *
|
||||
******************************************************************************/
|
||||
static void QuitGifError(GifFileType *GifFileIn, GifFileType *GifFileOut)
|
||||
{
|
||||
fprintf(stderr, "\nFollowing unrecoverable error occured:");
|
||||
PrintGifError();
|
||||
if (GifFileIn != NULL) DGifCloseFile(GifFileIn);
|
||||
if (GifFileOut != NULL) EGifCloseFile(GifFileOut);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
347
third_party/giflib/util/gifflip.c
vendored
@ -1,347 +0,0 @@
|
||||
/*****************************************************************************
|
||||
* "Gif-Lib" - Yet another gif library. *
|
||||
* *
|
||||
* Written by: Gershon Elber Ver 0.1, Jul. 1989 *
|
||||
******************************************************************************
|
||||
* Program to rotate image 90 degrees to the right/left or flip the image *
|
||||
* horizintally/vertically (mirror). *
|
||||
* Options: *
|
||||
* -q : quiet printing mode. *
|
||||
* -r : rotate 90 degrees to the right (default). *
|
||||
* -l : rotate 90 degrees to the left. *
|
||||
* -x : Mirror the image horizontally (first line switch places with last). *
|
||||
* -y : Mirror the image vertically (first column switch places with last). *
|
||||
* -h : on-line help *
|
||||
******************************************************************************
|
||||
* History: *
|
||||
* 10 Jul 89 - Version 1.0 by Gershon Elber. *
|
||||
*****************************************************************************/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#ifdef __MSDOS__
|
||||
#include <stdlib.h>
|
||||
#include <alloc.h>
|
||||
#endif /* __MSDOS__ */
|
||||
|
||||
#ifndef __MSDOS__
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
#include "gif_lib.h"
|
||||
#include "getarg.h"
|
||||
|
||||
#define PROGRAM_NAME "GifFlip"
|
||||
|
||||
#define FLIP_NONE 0
|
||||
#define FLIP_RIGHT 1
|
||||
#define FLIP_LEFT 2
|
||||
#define FLIP_HORIZ 3
|
||||
#define FLIP_VERT 4
|
||||
|
||||
#ifdef __MSDOS__
|
||||
extern unsigned int
|
||||
_stklen = 16384; /* Increase default stack size. */
|
||||
#endif /* __MSDOS__ */
|
||||
|
||||
#ifdef SYSV
|
||||
static char *VersionStr =
|
||||
"Gif toolkit module,\t\tGershon Elber\n\
|
||||
(C) Copyright 1989 Gershon Elber.\n";
|
||||
static char
|
||||
*CtrlStr = "GifFlip q%- r%- l%- x%- y%- h%- GifFile!*s";
|
||||
#else
|
||||
static char
|
||||
*VersionStr =
|
||||
PROGRAM_NAME
|
||||
GIF_LIB_VERSION
|
||||
" Gershon Elber, "
|
||||
__DATE__ ", " __TIME__ "\n"
|
||||
"(C) Copyright 1989 Gershon Elber.\n";
|
||||
static char
|
||||
*CtrlStr =
|
||||
PROGRAM_NAME
|
||||
" q%- r%- l%- x%- y%- h%- GifFile!*s";
|
||||
#endif /* SYSV */
|
||||
|
||||
/* Make some variables global, so we could access them faster: */
|
||||
static int
|
||||
ImageNum = 0;
|
||||
|
||||
static int LoadImage(GifFileType *GifFile, GifRowType **ImageBuffer);
|
||||
static int DumpImage(GifFileType *GifFile, GifRowType *ImageBuffer,
|
||||
int Width, int Height, int FlipDirection);
|
||||
static void QuitGifError(GifFileType *GifFileIn, GifFileType *GifFileOut);
|
||||
|
||||
/******************************************************************************
|
||||
* Interpret the command line and scan the given GIF file. *
|
||||
******************************************************************************/
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
int i, Error, NumFiles, ExtCode, FlipDirection = FLIP_RIGHT,
|
||||
RightFlag = FALSE, LeftFlag = FALSE,
|
||||
HorizFlag = FALSE, VertFlag = FALSE, HelpFlag = FALSE;
|
||||
GifRecordType RecordType;
|
||||
GifByteType *Extension;
|
||||
char **FileName = NULL;
|
||||
GifRowType *ImageBuffer;
|
||||
GifFileType *GifFileIn = NULL, *GifFileOut = NULL;
|
||||
|
||||
if ((Error = GAGetArgs(argc, argv, CtrlStr, &GifQuietPrint,
|
||||
&RightFlag, &LeftFlag, &HorizFlag, &VertFlag, &HelpFlag,
|
||||
&NumFiles, &FileName)) != FALSE ||
|
||||
(NumFiles > 1 && !HelpFlag)) {
|
||||
if (Error)
|
||||
GAPrintErrMsg(Error);
|
||||
else if (NumFiles > 1)
|
||||
GIF_MESSAGE("Error in command line parsing - one GIF file please.");
|
||||
GAPrintHowTo(CtrlStr);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if (HelpFlag) {
|
||||
fprintf(stderr, VersionStr);
|
||||
GAPrintHowTo(CtrlStr);
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
if ((i = (RightFlag != 0) + (LeftFlag != 0) +
|
||||
(HorizFlag != 0) + (VertFlag != 0)) > 1)
|
||||
GIF_EXIT("Only one of -r, -l, -x, -y please.");
|
||||
if (i == 0)
|
||||
FlipDirection = FLIP_RIGHT; /* Make it the default. */
|
||||
else {
|
||||
if (RightFlag) FlipDirection = FLIP_RIGHT;
|
||||
if (LeftFlag) FlipDirection = FLIP_LEFT;
|
||||
if (HorizFlag) FlipDirection = FLIP_HORIZ;
|
||||
if (VertFlag) FlipDirection = FLIP_VERT;
|
||||
}
|
||||
|
||||
if (NumFiles == 1) {
|
||||
if ((GifFileIn = DGifOpenFileName(*FileName)) == NULL)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
}
|
||||
else {
|
||||
/* Use the stdin instead: */
|
||||
if ((GifFileIn = DGifOpenFileHandle(0)) == NULL)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
}
|
||||
|
||||
/* Open stdout for the output file: */
|
||||
if ((GifFileOut = EGifOpenFileHandle(1)) == NULL)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
|
||||
if (RightFlag || LeftFlag) {
|
||||
/* Dump out same screen information, but flip Screen Width/Height: */
|
||||
if (EGifPutScreenDesc(GifFileOut,
|
||||
GifFileIn->SHeight, GifFileIn->SWidth,
|
||||
GifFileIn->SColorResolution, GifFileIn->SBackGroundColor,
|
||||
GifFileIn->SColorMap) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
}
|
||||
else {
|
||||
/* Dump out exactly same screen information: */
|
||||
if (EGifPutScreenDesc(GifFileOut,
|
||||
GifFileIn->SWidth, GifFileIn->SHeight,
|
||||
GifFileIn->SColorResolution, GifFileIn->SBackGroundColor,
|
||||
GifFileIn->SColorMap) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
}
|
||||
|
||||
/* Scan the content of the GIF file and load the image(s) in: */
|
||||
do {
|
||||
if (DGifGetRecordType(GifFileIn, &RecordType) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
|
||||
switch (RecordType) {
|
||||
case IMAGE_DESC_RECORD_TYPE:
|
||||
if (DGifGetImageDesc(GifFileIn) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
if (GifFileIn->Image.Interlace)
|
||||
GIF_EXIT("Cannt flip interlaced images - use GifInter first.");
|
||||
|
||||
/* Put the image descriptor to out file: */
|
||||
if (RightFlag) {
|
||||
/* Rotate to the right: */
|
||||
if (EGifPutImageDesc(GifFileOut,
|
||||
GifFileIn->SHeight - GifFileIn->Image.Height -
|
||||
GifFileIn->Image.Top,
|
||||
GifFileIn->Image.Left,
|
||||
GifFileIn->Image.Height, GifFileIn->Image.Width,
|
||||
FALSE, GifFileIn->Image.ColorMap) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
}
|
||||
else if (LeftFlag) {
|
||||
/* Rotate to the left: */
|
||||
if (EGifPutImageDesc(GifFileOut,
|
||||
GifFileIn->Image.Top,
|
||||
GifFileIn->SWidth - GifFileIn->Image.Width -
|
||||
GifFileIn->Image.Left,
|
||||
GifFileIn->Image.Height, GifFileIn->Image.Width,
|
||||
FALSE, GifFileIn->Image.ColorMap) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
}
|
||||
else {
|
||||
/* No rotation - only flipping vert. or horiz.: */
|
||||
if (EGifPutImageDesc(GifFileOut,
|
||||
GifFileIn->Image.Left, GifFileIn->Image.Top,
|
||||
GifFileIn->Image.Width, GifFileIn->Image.Height,
|
||||
FALSE, GifFileIn->Image.ColorMap) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
}
|
||||
|
||||
/* Load the image (either Interlaced or not), and dump it */
|
||||
/* fliped as requrested by Flags: */
|
||||
if (LoadImage(GifFileIn, &ImageBuffer) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
if (DumpImage(GifFileOut, ImageBuffer, GifFileIn->Image.Width,
|
||||
GifFileIn->Image.Height, FlipDirection) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
break;
|
||||
case EXTENSION_RECORD_TYPE:
|
||||
/* Skip any extension blocks in file: */
|
||||
if (DGifGetExtension(GifFileIn, &ExtCode, &Extension) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
if (EGifPutExtension(GifFileOut, ExtCode, Extension[0],
|
||||
Extension) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
|
||||
/* No support to more than one extension blocks, so discard: */
|
||||
while (Extension != NULL) {
|
||||
if (DGifGetExtensionNext(GifFileIn, &Extension) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
}
|
||||
break;
|
||||
case TERMINATE_RECORD_TYPE:
|
||||
break;
|
||||
default: /* Should be traps by DGifGetRecordType. */
|
||||
break;
|
||||
}
|
||||
}
|
||||
while (RecordType != TERMINATE_RECORD_TYPE);
|
||||
|
||||
if (DGifCloseFile(GifFileIn) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
if (EGifCloseFile(GifFileOut) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* Routine to read Image out. The image can be Non interlaced only. *
|
||||
* The memory required to hold the image is allocate by the routine itself. *
|
||||
* Return GIF_OK if succesful, GIF_ERROR otherwise. *
|
||||
******************************************************************************/
|
||||
static int LoadImage(GifFileType *GifFile, GifRowType **ImageBufferPtr)
|
||||
{
|
||||
int Size, i;
|
||||
GifRowType *ImageBuffer;
|
||||
|
||||
/* Allocate the image as vector of column of rows. We cannt allocate */
|
||||
/* the all screen at once, as this broken minded CPU can allocate up to */
|
||||
/* 64k at a time and our image can be bigger than that: */
|
||||
if ((ImageBuffer = (GifRowType *)
|
||||
malloc(GifFile->Image.Height * sizeof(GifRowType *))) == NULL)
|
||||
GIF_EXIT("Failed to allocate memory required, aborted.");
|
||||
|
||||
Size = GifFile->Image.Width * sizeof(GifPixelType);/* One row size in bytes.*/
|
||||
for (i = 0; i < GifFile->Image.Height; i++) {
|
||||
/* Allocate the rows: */
|
||||
if ((ImageBuffer[i] = (GifRowType) malloc(Size)) == NULL)
|
||||
GIF_EXIT("Failed to allocate memory required, aborted.");
|
||||
}
|
||||
|
||||
*ImageBufferPtr = ImageBuffer;
|
||||
|
||||
GifQprintf("\n%s: Image %d at (%d, %d) [%dx%d]: ",
|
||||
PROGRAM_NAME, ++ImageNum, GifFile->Image.Left, GifFile->Image.Top,
|
||||
GifFile->Image.Width, GifFile->Image.Height);
|
||||
|
||||
for (i = 0; i < GifFile->Image.Height; i++) {
|
||||
GifQprintf("\b\b\b\b%-4d", i);
|
||||
if (DGifGetLine(GifFile, ImageBuffer[i], GifFile->Image.Width)
|
||||
== GIF_ERROR) return GIF_ERROR;
|
||||
}
|
||||
|
||||
return GIF_OK;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* Routine to dump image out. The given Image buffer should always hold the *
|
||||
* image sequencially, and Width & Height hold image dimensions BEFORE flip. *
|
||||
* Image will be dumped according to FlipDirection. *
|
||||
* Once dumped, the memory holding the image is freed. *
|
||||
* Return GIF_OK if succesful, GIF_ERROR otherwise. *
|
||||
******************************************************************************/
|
||||
static int DumpImage(GifFileType *GifFile, GifRowType *ImageBuffer,
|
||||
int Width, int Height, int FlipDirection)
|
||||
{
|
||||
int i, j, Count;
|
||||
GifRowType Line; /* New scan line is copied to it. */
|
||||
|
||||
/* Allocate scan line that will fit both image width and height: */
|
||||
if ((Line = (GifRowType) malloc((Width > Height ? Width : Height)
|
||||
* sizeof(GifPixelType))) == NULL)
|
||||
GIF_EXIT("Failed to allocate memory required, aborted.");
|
||||
|
||||
switch (FlipDirection) {
|
||||
case FLIP_RIGHT:
|
||||
for (Count = Width, i = 0; i < Width; i++) {
|
||||
GifQprintf("\b\b\b\b%-4d", Count--);
|
||||
for (j = 0; j < Height; j++)
|
||||
Line[j] = ImageBuffer[Height - j - 1][i];
|
||||
if (EGifPutLine(GifFile, Line, Height) == GIF_ERROR)
|
||||
return GIF_ERROR;
|
||||
}
|
||||
break;
|
||||
case FLIP_LEFT:
|
||||
for (i = Width - 1; i >= 0; i--) {
|
||||
GifQprintf("\b\b\b\b%-4d", i + 1);
|
||||
for (j = 0; j < Height; j++)
|
||||
Line[j] = ImageBuffer[j][i];
|
||||
if (EGifPutLine(GifFile, Line, Height) == GIF_ERROR)
|
||||
return GIF_ERROR;
|
||||
}
|
||||
break;
|
||||
case FLIP_HORIZ:
|
||||
for (i = Height - 1; i >= 0; i--) {
|
||||
GifQprintf("\b\b\b\b%-4d", i);
|
||||
if (EGifPutLine(GifFile, ImageBuffer[i], Width) == GIF_ERROR)
|
||||
return GIF_ERROR;
|
||||
}
|
||||
break;
|
||||
case FLIP_VERT:
|
||||
for (Count = Height, i = 0; i < Height; i++) {
|
||||
GifQprintf("\b\b\b\b%-4d", Count--);
|
||||
for (j = 0; j < Width; j++)
|
||||
Line[j] = ImageBuffer[i][Width - j - 1];
|
||||
if (EGifPutLine(GifFile, Line, Width) == GIF_ERROR)
|
||||
return GIF_ERROR;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
/* Free the memory used for this image, and the temporary scan line: */
|
||||
for (i = 0; i < Height; i++) free((char *) ImageBuffer[i]);
|
||||
free((char *) ImageBuffer);
|
||||
|
||||
free((char *) Line);
|
||||
|
||||
return GIF_OK;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* Close both input and output file (if open), and exit. *
|
||||
******************************************************************************/
|
||||
static void QuitGifError(GifFileType *GifFileIn, GifFileType *GifFileOut)
|
||||
{
|
||||
PrintGifError();
|
||||
if (GifFileIn != NULL) DGifCloseFile(GifFileIn);
|
||||
if (GifFileOut != NULL) EGifCloseFile(GifFileOut);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
272
third_party/giflib/util/gifhisto.c
vendored
@ -1,272 +0,0 @@
|
||||
/*****************************************************************************
|
||||
* "Gif-Lib" - Yet another gif library. *
|
||||
* *
|
||||
* Written by: Gershon Elber Ver 0.1, Jul. 1989 *
|
||||
******************************************************************************
|
||||
* Program to create histogram of the colors used by the given GIF file. *
|
||||
* Dumps out GIF file of constants size GIF_WIDTH by GIF_HEIGHT. *
|
||||
* Options: *
|
||||
* -q : quiet printing mode. *
|
||||
* -t : Dump out text instead of GIF - #Colors lines, each with #appearances. *
|
||||
* -i W H : size of GIF image to generate. Colors of input GIF file are *
|
||||
* spread homogeneously along Height, which better by dividable by the *
|
||||
* number of colors in input image. *
|
||||
* -n n : select image number to generate histogram to (1 by default). *
|
||||
* -b : strip off background color count. *
|
||||
* -h : on-line help *
|
||||
******************************************************************************
|
||||
* History: *
|
||||
* 8 Jul 89 - Version 1.0 by Gershon Elber. *
|
||||
*****************************************************************************/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#ifdef __MSDOS__
|
||||
#include <stdlib.h>
|
||||
#include <alloc.h>
|
||||
#endif /* __MSDOS__ */
|
||||
|
||||
#ifndef __MSDOS__
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
#include "gif_lib.h"
|
||||
#include "getarg.h"
|
||||
|
||||
#define PROGRAM_NAME "GifHisto"
|
||||
|
||||
#define DEFAULT_HISTO_WIDTH 100 /* Histogram image diemnsions. */
|
||||
#define DEFAULT_HISTO_HEIGHT 256
|
||||
#define HISTO_BITS_PER_PIXEL 2 /* Size of bitmap for histogram GIF. */
|
||||
|
||||
#ifdef __MSDOS__
|
||||
extern unsigned int
|
||||
_stklen = 16384; /* Increase default stack size. */
|
||||
#endif /* __MSDOS__ */
|
||||
|
||||
#ifdef SYSV
|
||||
static char *VersionStr =
|
||||
"Gif toolkit module,\t\tGershon Elber\n\
|
||||
(C) Copyright 1989 Gershon Elber.\n";
|
||||
static char
|
||||
*CtrlStr = "GifHisto q%- t%- s%-Width|Height!d!d n%-ImageNumber!d b%- h%- GifFile!*s";
|
||||
#else
|
||||
static char
|
||||
*VersionStr =
|
||||
PROGRAM_NAME
|
||||
GIF_LIB_VERSION
|
||||
" Gershon Elber, "
|
||||
__DATE__ ", " __TIME__ "\n"
|
||||
"(C) Copyright 1989 Gershon Elber.\n";
|
||||
static char
|
||||
*CtrlStr =
|
||||
PROGRAM_NAME
|
||||
" q%- t%- s%-Width|Height!d!d n%-ImageNumber!d b%- h%- GifFile!*s";
|
||||
#endif /* SYSV */
|
||||
|
||||
static int
|
||||
ImageWidth = DEFAULT_HISTO_WIDTH,
|
||||
ImageHeight = DEFAULT_HISTO_HEIGHT,
|
||||
ImageN = 1;
|
||||
static GifColorType
|
||||
HistoColorMap[] = { /* Constant bit map for histograms: */
|
||||
{ 0, 0, 0 },
|
||||
{ 255, 0, 0 },
|
||||
{ 0, 255, 0 },
|
||||
{ 0, 0, 255 }
|
||||
};
|
||||
|
||||
static void QuitGifError(GifFileType *GifFileIn, GifFileType *GifFileOut);
|
||||
|
||||
/******************************************************************************
|
||||
* Interpret the command line and scan the given GIF file. *
|
||||
******************************************************************************/
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
int i, j, Size, Error, NumFiles, ExtCode, CodeSize, NumColors = 2, Color,
|
||||
Count, ImageNum = 0, TextFlag = FALSE, SizeFlag = FALSE,
|
||||
ImageNFlag = FALSE, BackGroundFlag = FALSE, HelpFlag = FALSE;
|
||||
long Scaler, Histogram[256];
|
||||
GifRecordType RecordType;
|
||||
GifByteType *Extension, *CodeBlock;
|
||||
char **FileName = NULL;
|
||||
GifRowType Line;
|
||||
GifFileType *GifFileIn = NULL, *GifFileOut = NULL;
|
||||
|
||||
/* Same image dimension vars for both Image & ImageN as only one allowed */
|
||||
if ((Error = GAGetArgs(argc, argv, CtrlStr, &GifQuietPrint,
|
||||
&TextFlag, &SizeFlag, &ImageWidth, &ImageHeight,
|
||||
&ImageNFlag, &ImageN, &BackGroundFlag,
|
||||
&HelpFlag, &NumFiles, &FileName)) != FALSE ||
|
||||
(NumFiles > 1 && !HelpFlag)) {
|
||||
if (Error)
|
||||
GAPrintErrMsg(Error);
|
||||
else if (NumFiles > 1)
|
||||
GIF_MESSAGE("Error in command line parsing - one GIF file please.");
|
||||
GAPrintHowTo(CtrlStr);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if (HelpFlag) {
|
||||
fprintf(stderr, VersionStr);
|
||||
GAPrintHowTo(CtrlStr);
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
if (NumFiles == 1) {
|
||||
if ((GifFileIn = DGifOpenFileName(*FileName)) == NULL)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
}
|
||||
else {
|
||||
/* Use the stdin instead: */
|
||||
if ((GifFileIn = DGifOpenFileHandle(0)) == NULL)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
}
|
||||
|
||||
for (i = 0; i < 256; i++) Histogram[i] = 0; /* Reset counters. */
|
||||
|
||||
/* Scan the content of the GIF file and load the image(s) in: */
|
||||
do {
|
||||
if (DGifGetRecordType(GifFileIn, &RecordType) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
|
||||
switch (RecordType) {
|
||||
case IMAGE_DESC_RECORD_TYPE:
|
||||
if (DGifGetImageDesc(GifFileIn) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
|
||||
if (GifFileIn->Image.ColorMap)
|
||||
NumColors = GifFileIn->Image.ColorMap->ColorCount;
|
||||
else if (GifFileIn->SColorMap)
|
||||
NumColors = GifFileIn->SColorMap->ColorCount;
|
||||
else
|
||||
GIF_EXIT("Neither Screen nor Image color map exists.");
|
||||
|
||||
if ((ImageHeight / NumColors) * NumColors != ImageHeight)
|
||||
GIF_EXIT("Image height specified not dividable by #colors.");
|
||||
|
||||
if (++ImageNum == ImageN) {
|
||||
/* This is the image we should make histogram for: */
|
||||
Line = (GifRowType) malloc(GifFileIn->Image.Width *
|
||||
sizeof(GifPixelType));
|
||||
GifQprintf("\n%s: Image %d at (%d, %d) [%dx%d]: ",
|
||||
PROGRAM_NAME, ImageNum,
|
||||
GifFileIn->Image.Left, GifFileIn->Image.Top,
|
||||
GifFileIn->Image.Width, GifFileIn->Image.Height);
|
||||
|
||||
for (i = 0; i < GifFileIn->Image.Height; i++) {
|
||||
if (DGifGetLine(GifFileIn, Line, GifFileIn->Image.Width)
|
||||
== GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
for (j = 0; j < GifFileIn->Image.Width; j++)
|
||||
Histogram[Line[j]]++;
|
||||
GifQprintf("\b\b\b\b%-4d", i);
|
||||
}
|
||||
|
||||
free((char *) Line);
|
||||
}
|
||||
else {
|
||||
/* Skip the image: */
|
||||
/* Now read image itself in decoded form as we dont */
|
||||
/* really care what is there, and this is much faster. */
|
||||
if (DGifGetCode(GifFileIn, &CodeSize, &CodeBlock) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
while (CodeBlock != NULL)
|
||||
if (DGifGetCodeNext(GifFileIn, &CodeBlock) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
}
|
||||
break;
|
||||
case EXTENSION_RECORD_TYPE:
|
||||
/* Skip any extension blocks in file: */
|
||||
if (DGifGetExtension(GifFileIn, &ExtCode, &Extension) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
|
||||
while (Extension != NULL) {
|
||||
if (DGifGetExtensionNext(GifFileIn, &Extension) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
}
|
||||
break;
|
||||
case TERMINATE_RECORD_TYPE:
|
||||
break;
|
||||
default: /* Should be traps by DGifGetRecordType. */
|
||||
break;
|
||||
}
|
||||
}
|
||||
while (RecordType != TERMINATE_RECORD_TYPE);
|
||||
|
||||
/* We we requested to kill back ground count: */
|
||||
if (BackGroundFlag) Histogram[GifFileIn->SBackGroundColor] = 0;
|
||||
|
||||
if (DGifCloseFile(GifFileIn) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
|
||||
|
||||
/* We may required to dump out the histogram as text file: */
|
||||
if (TextFlag) {
|
||||
for (i = 0; i < NumColors; i++)
|
||||
printf("%12ld %3d\n", Histogram[i], i);
|
||||
}
|
||||
else {
|
||||
/* Open stdout for the histogram output file: */
|
||||
if ((GifFileOut = EGifOpenFileHandle(1)) == NULL)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
|
||||
/* Dump out screen descriptor to fit histogram dimensions: */
|
||||
if (EGifPutScreenDesc(GifFileOut,
|
||||
ImageWidth, ImageHeight, HISTO_BITS_PER_PIXEL, 0,
|
||||
MakeMapObject(4, HistoColorMap)) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
|
||||
/* Dump out image descriptor to fit histogram dimensions: */
|
||||
if (EGifPutImageDesc(GifFileOut,
|
||||
0, 0, ImageWidth, ImageHeight, FALSE, NULL) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
|
||||
/* Prepare scan line for histogram file, and find scaler to scale */
|
||||
/* histogram to be between 0 and ImageWidth: */
|
||||
Line = (GifRowType) malloc(ImageWidth * sizeof(GifPixelType));
|
||||
for (Scaler = 0, i = 0; i < NumColors; i++) if (Histogram[i] > Scaler)
|
||||
Scaler = Histogram[i];
|
||||
Scaler /= ImageWidth;
|
||||
if (Scaler == 0) Scaler = 1; /* In case maximum is less than width. */
|
||||
|
||||
/* Dump out the image itself: */
|
||||
for (Count = ImageHeight, i = 0, Color = 1; i < NumColors; i++) {
|
||||
if ((Size = Histogram[i] / Scaler) > ImageWidth) Size = ImageWidth;
|
||||
for (j = 0; j < Size; j++)
|
||||
Line[j] = Color;
|
||||
for (j = Size; j < ImageWidth; j++)
|
||||
Line[j] = GifFileOut->SBackGroundColor;
|
||||
|
||||
/* Move to next color: */
|
||||
if (++Color >= (1 << HISTO_BITS_PER_PIXEL)) Color = 1;
|
||||
|
||||
/* Dump this histogram entry as many times as required: */
|
||||
for (j = 0; j < ImageHeight / NumColors; j++) {
|
||||
if (EGifPutLine(GifFileOut, Line, ImageWidth) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
GifQprintf("\b\b\b\b%-4d", Count--);
|
||||
}
|
||||
}
|
||||
|
||||
if (EGifCloseFile(GifFileOut) == GIF_ERROR)
|
||||
QuitGifError(GifFileIn, GifFileOut);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* Close both input and output file (if open), and exit. *
|
||||
******************************************************************************/
|
||||
static void QuitGifError(GifFileType *GifFileIn, GifFileType *GifFileOut)
|
||||
{
|
||||
PrintGifError();
|
||||
if (GifFileIn != NULL) DGifCloseFile(GifFileIn);
|
||||
if (GifFileOut != NULL) EGifCloseFile(GifFileOut);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|