Commit 11b9c3df authored by Stephane Glondu's avatar Stephane Glondu

Imported Upstream version 4.1.0

parent 97ce66a0
repo: e37886d73a98029822983bee73a2d90ceb4b298b
node: b13d6457ea31084e4914856330020725d5bdf1f5
branch: 4.0.2
node: 668faa3494feaff8e7d79af79e9e393290e98107
branch: 4.1.0
latesttag: v4.0.1
latesttagdistance: 17
latesttagdistance: 56
......@@ -23,6 +23,9 @@ doc/sphinx/_build
test/out\.image$
test/test$
test/jpgexif$
test/jpgmark$
test/test2$
examples/converter/converter$
examples/converter-external/converter$
......
#!/bin/sh
export ACLOCAL='aclocal -I ../autoconf'
autoreconf --install
./configure --prefix $PREFIX
make clean all install
cp src/*.sp?t $PREFIX/lib/ocaml/site-lib/camlimages/
(cd examples/liv; make opt; /bin/cp liv.opt $PREFIX/bin)
Version 2.12 of the CamlImages library, by Jun Furuse, François
Pessaux, and Pierre Weis, is now available.
CamlImages is an image processing library, which provides to the
objective Caml programmer:
** basic functions for image processing and loading/saving various image
file formats (hence providing a translation facility from format to format),
** an interface with the Caml graphics library allows to display
images in the Graphics module screen and to mix them with Caml
drawings,
** a freetype interface, integrated into the library:
you can draw texts into images using any truetype fonts,
** a set of example programs, including gif animation, slide show, postscript
converter to print images.
Version 2.12 adds support for lablgtk2 and is also a bug fix release.
Sources and documentation are available from:
http://pauillac.inria.fr/camlimages/eng.htm
ftp://ftp.inria.fr/INRIA/caml-light/bazar-ocaml/camlimages-2.12.tgz
Contributions and comments are welcome.
Hi,
I'm glad to announce the availability of the 4.0.1 version of the
CamlImages library, by Jun Furuse, François Pessaux, and Pierre Weis.
This is a bug fix release.
The software home page is:
http://cristal.inria.fr/camlimages/eng.htm
Sources and documentation are available from:
http://cristal.inria.fr/camlimages/camlimages-3.0.2.tgz
ftp://ftp.inria.fr/INRIA/Projects/cristal/caml-light/bazar-ocaml/camlimages-3.0.2.tgz
Contributions and comments are welcome.
Pierre Weis & June Furuse
CamlImages is an image processing library, which provides to the
objective Caml programmer a lot of image processing functionality.
CamlImages provides to the objective Caml programmer:
** basic functions for image processing and loading/saving various image
file formats (hence providing a translation facility from format to format),
** an interface with the Caml graphics library allows to display
images in the Graphics module screen and to mix them with Caml
drawings,
** a freetype interface, integrated into the library:
you can draw texts into images using any truetype fonts,
** a set of example programs, including gif animation, slide show,
and a postscript converter to print images.
4.1.0
* bmp was not linked with examples. Since bmp is pure ML libarary,
you may need to add -linkall to linker command to your build script,
otherwise the module is silently ignored.
* bmp 32bit RGBA is now supported
* added jpeg marker load/saving (not tested well)
* added exif support (you need libexif)
! refactored ocamlfind package names (probably introduce some incompatibility)
* removed unused old configure and make scripts
* Applied GODI's patches. Now omake takes the following variable definitions:
- INCLUDES
- LDFLAGS
- NATIVE_ENABLED
- ARG_WANT_XXX
- ARG_PATH_GS
- ARG_FREETYPE_CONFIG
If they are not defined, some default values are deduced.
4.0.2
* ppm save was somehow disabled.
......
*** This is OBSOLETE.
This document describes how to build camlimages using automake,
which is now OBSOLETE and no longer supported.
*** Requirements
To install CamlImages library, you need the following softwares:
* ocaml 3.11 or higher
* GNU make
* automake (1.7.9 does not work. 1.9.6 works)
and that is all. But note that this is the minimum requirement: you
can read/write BMP or PXM (PPM, PGM, PBM) image formats but no other
formats. If you want to deal with other image formats, you need to
install the corresponding external libraries:
* libpng for PNG format
http://www.libpng.org/pub/png/libpng.html
http://sourceforge.net/projects/libpng/
* libjpeg for JPEG format
The Independent JPEG Group's software
ftp://ftp.uu.net/graphics/jpeg/jpegsrc.v6b.tar.gz
* libtiff for TIFF format
http://www.libtiff.org/
ftp://ftp.remotesensing.org/pub/libtiff/
* libxpm for XPM format (could be already by the X server installation)
X contrib libraries ftp directory
ftp://ftp.x.org/contrib/libraries
* freetype for drawing texts using truetype fonts
The FREETYPE Project
http://sourceforge.net/projects/freetype/
* libungif for GIF format
Because of the GIF patent problem of Unisys, we do not
recommend to use GIF file format. If you really want to
use GIF, do it in your own risk.
Libungif, a library for using GIFs without compression.
http://sourceforge.net/projects/libungif/
* ghostscript for PS format
See http://www.ghostscript.com/
* lablgtk2, an Objective Caml interface to gtk+
http://wwwfun.kurims.kyoto-u.ac.jp/soft/olabl/lablgtk.html
*** Installation procedure by automake
Generating build scripts
------------------------
* make sure ocaml autoconf macros, available from bazar-ocaml/autoconf
directory (http://camlcvs.inria.fr/cgi-bin/cvsweb/bazar-ocaml/autoconf/),
are present in aclocal macro search path, by any of the following
solution:
- export ACLOCAL='aclocal -I <directory>' before invoking autoreconf
- set up a dirlist file in automake macro directory, as explained in aclocal
documentation
* run autoreconf --install
Configuration
-------------
Just run the standard configure script:
% ./configure
If the script can't find some installed external libraries, this is probably
because they are installed in locations not included in linker or
preprocessor configuration. You'll have to passe proper flags while running
configure script:
%./configure CFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib
%./configure CFLAGS=-I/sw/include LDFLAGS=-L/sw/lib
If problems persist, check config.log for failure details.
The script allow some user configuration. Check help output for details:
% ./configure --help
Compilation
-----------
type
% make
and wait.
Test
----
Before you actually install the library, you can check that it
really works, by running examples in the test directory. For the test
programs,
% cd test
% make
% ./test
% ./test.byt
(./test.byt is the bytecode executable and ./test the binary
executable).
Installation
------------
If there is no compilation error and the test works fine,
install the library,
% make install
This installs all the required files into the $(LIBDIR) directory
specified in Makefile.config (usually /usr/local/lib/ocaml/camlimages
or /usr/lib/ocaml/camlimages).
If you want to create a toplevel with camlimages, type in
% make top
that creates a toplevel named "customtop". Then,
% toplevel
executes customtop with the appropriate options.
Example applications
--------------------
In the examples directory you can find several example applications
using Camlimages.
Some of the programs use the lablgtk GUI (in particular liv and
gifanim): you cannot compile them if the lablgtk library has not
been installed.
To compile the examples execute:
% cd examples
% make
......@@ -6,10 +6,12 @@ This library is reliable but still under development.
To install CamlImages library, you need the following softwares:
* ocaml 3.11.x or higher
* findlib (aka ocamlfind,
* OCaml 4.00.1 or higher
(OCaml 3.11 and above might work with small trivial fixes,
but never tested)
* Findlib (aka ocamlfind,
http://www.camlcity.org/archive/programming/findlib.html)
* omake (http://omake.metaprl.org/index.html)
* OMake (http://omake.metaprl.org/index.html)
Note that this is the minimum requirement: you can read/write BMP or
PXM (PPM, PGM, PBM) image formats but no other formats. If you want to
......@@ -24,6 +26,8 @@ external libraries:
The Independent JPEG Group's software
ftp://ftp.uu.net/graphics/jpeg/jpegsrc.v6b.tar.gz
* libexif for EXIF tags in JPEG files
* libtiff for TIFF format
http://www.libtiff.org/
ftp://ftp.remotesensing.org/pub/libtiff/
......@@ -37,11 +41,7 @@ external libraries:
http://sourceforge.net/projects/freetype/
* libungif for GIF format
Because of the GIF patent problem of Unisys, we do not
recommend to use GIF file format. If you really want to
use GIF, do it in your own risk.
Libungif, a library for using GIFs without compression.
Libungif, a library for using GIFs
http://sourceforge.net/projects/libungif/
* ghostscript for PS format
......@@ -53,54 +53,37 @@ external libraries:
*** Installation procedure by omake
% yes no | omake --install
% omake
% omake --configure <configuration options>
% omake install
*** OLD installation procedure by automake (not supported any more)
* GNU make
* automake (1.7.9 does not work. 1.9.6 works)
At omake --configure, you can specify CFLAGS and LDFLAGS
to add extra header and library search paths respectively. For example,
Generating build scripts
------------------------
This is only needed if you're using CVS version directly.
% omake --configure CFLAGS="-I /usr/include/libexif" LDFLAGS="-L/opt/blah"
* make sure ocaml autoconf macros, available from bazar-ocaml/autoconf
directory, are present in aclocal macro search path, by any of the following
solution:
- export ACLOCAL='aclocal -I <directory>' before invoking autoreconf
- set up a dirlist file in automake macro directory, as explained in aclocal
documentation
* run autoreconf --install
List of configurable variables
Configuration
-------------
CFLASG, INCLUDES, LDFLAGS: as usual.
Just run the standard configure script:
% ./configure
ARG_WANT_<feature>=bool
Without specifying ARG_WANT_<feature>, omake --configure automatically
searches the availability of <feature> and enables it when found.
If the script can't find some installed external libraries, this is probably
because they are installed in locations not included in linker or
preprocessor configuration. You'll have to passe proper flags while running
configure script:
%./configure CFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib
%./configure CFLAGS=-I/sw/include LDFLAGS=-L/sw/lib
If ARG_WANT_<feature>=0, the feature is not checked, and disabled.
If problems persist, check config.log for failure details.
The script allow some user configuration. Check help output for details:
% ./configure --help
If ARG_WANT_<feature>=1, the feature must exist and is enabled.
If omake fails to find the feature, the entire build fails.
Compilation
-----------
type
% make
Currently the following features are available:
GIF, PNG, JPEG, EXIF, TIFF, XPM, GS, LABLGTK2, GRAPHICS, FREETYPE
and wait.
ARG_FREETYPE_CONFIG=string
ARG_PATH_GS=string
PATH of freetype-config and gs.
Without specifying, omake tries to find them in the PATH.
Test
----
Test
----
Before you actually install the library, you can check that it
really works, by running examples in the test directory. For the test
programs,
......@@ -108,44 +91,7 @@ programs,
% cd test
% make
% ./test
% ./test.byt
% ./test.run
(./test.byt is the bytecode executable and ./test the binary
(./test.run is the bytecode executable and ./test the binary
executable).
Installation
------------
If there is no compilation error and the test works fine,
install the library,
% make install
This installs all the required files into the $(LIBDIR) directory
specified in Makefile.config (usually /usr/local/lib/ocaml/camlimages
or /usr/lib/ocaml/camlimages).
If you want to create a toplevel with camlimages, type in
% make top
that creates a toplevel named "customtop". Then,
% toplevel
executes customtop with the appropriate options.
Example applications
--------------------
In the examples directory you can find several example applications
using Camlimages.
Some of the programs use the lablgtk GUI (in particular liv and
gifanim): you cannot compile them if the lablgtk library has not
been installed.
To compile the examples execute:
% cd examples
% make
This diff is collapsed.
......@@ -24,6 +24,26 @@ OCAML_WHERE = $(shell ocamlc -where)
open configure/Configure
public.CheckCLib(libs, funs) =
# This is broken in omake:
LDFLAGS += $(addprefix -l, $(libs))
program = $"""
#ifdef __cplusplus
extern "C"
#endif
#pragma warning( disable : 4100 )
/* Override any gcc2 internal prototype to avoid an error. */
$(add-wrapper $(nl)extern char , $'();', $(funs))
int main(int argc, char **argv) {
/* Usage */
$(add-wrapper $(nl) , $'();', $(funs))
return 0;
}
"""
#echo "program = $(program)"
return $(TryLinkC $(program))
Check_header_library(xlib, xheader, xfunc) =
return $(and $(VerboseCheckCHeader $(xheader)), $(VerboseCheckCLib $(xlib), $(xfunc)))
......@@ -166,24 +186,27 @@ SRCDIR = $(ROOT)/src
################################################################### local build
Subpackages_available(packs) =
sequence-forall($(fun elem, $(mem $(elem), all supported $(SUPPORTED_SUBPACKAGES))), $(packs))
sequence-forall($(fun elem, $(mem $(elem), core all_formats supported $(SUPPORTED_SUBPACKAGES))), $(packs))
BuildExample(namex, modules, packages) =
.PHONY: clean
if $(Subpackages_available $(packages))
subs=core $(packages)
# the library is created with -dllib: no -custom required
OCAML_BYTE_LINK_FLAGS=
OCAML_BYTE_LINK_FLAGS= -linkall
OCAML_NATIVE_LINK_FLAGS= -linkall
OCAMLINCLUDES += $(SRCDIR)
OCAML_LIBS+= $(addprefix $(SRCDIR)/camlimages_, $(subs))
OCAML_BYTE_LINK_FLAGS+=-dllpath $(SRCDIR)
OCAMLPACKS[]+=unix # exif requires unix
export
.DEFAULT: $(OCamlProgram $(namex), $(modules))
else
println(Warning: $(namex) is not built: it requires $(string $(packages)))
println(Warning: Supported: $(string all_formats supported $(SUPPORTED_SUBPACKAGES)))
clean:
rm -f $(filter-proper-targets $(ls R, .))
rm -f $(filter-proper-targets $(ls R, .)) *.cmt* *.sp*t
export
......
This diff is collapsed.
This diff is collapsed.
......@@ -14,4 +14,4 @@
#(* $Id: OMakefile,v 1.1.2.2 2010/05/13 13:36:09 furuse Exp $ *)
BuildExample(converter, converter, all)
BuildExample(converter, converter, all_formats)
......@@ -16,4 +16,4 @@
OCAMLPACKS[]= unix
BuildExample(crop, crop, all)
BuildExample(crop, crop, all_formats)
......@@ -14,4 +14,4 @@
#(* $Id: OMakefile,v 1.1.2.2 2010/05/13 13:36:09 furuse Exp $ *)
BuildExample(edge, edge, all)
BuildExample(edge, edge, all_formats)
......@@ -14,4 +14,4 @@
#(* $Id: OMakefile,v 1.1.2.2 2010/05/13 13:36:09 furuse Exp $ *)
BuildExample(imgstat, imgstat, all)
BuildExample(imgstat, imgstat, all_formats)
......@@ -38,5 +38,5 @@ MODULES[] =
tout
viewer
BuildExample(liv, $(MODULES), all lablgtk2)
BuildExample(liv, $(MODULES), all_formats lablgtk2)
......@@ -14,4 +14,4 @@
#(* $Id: OMakefile,v 1.1.2.2 2010/05/13 13:36:09 furuse Exp $ *)
BuildExample(monochrome, monochrome, all)
BuildExample(monochrome, monochrome, all_formats)
......@@ -14,4 +14,4 @@
#(* $Id: OMakefile,v 1.1.2.2 2010/05/13 13:36:09 furuse Exp $ *)
BuildExample(normalize, normalize, all)
BuildExample(normalize, normalize, all_formats)
......@@ -14,4 +14,4 @@
#(* $Id: OMakefile,v 1.1.2.2 2010/05/13 13:36:09 furuse Exp $ *)
BuildExample(resize, resize, all)
BuildExample(resize, resize, all_formats)
......@@ -65,7 +65,7 @@ type scanlined_loader = {
let scanline_open name =
match Images.file_format name with
| Jpeg, _ ->
let w,h,ic = Jpeg.open_in name in
let w,h,ic,_rev_markers = Jpeg.open_in name in
let y = ref 0 in
w, h, 200.0,
{ read_next_line = (fun buf -> Jpeg.read_scanline ic buf !y; incr y);
......
......@@ -14,4 +14,4 @@
#(* $Id: OMakefile,v 1.1.2.2 2010/05/13 13:36:09 furuse Exp $ *)
BuildExample(ttfimg, ttfimg, all freetype)
BuildExample(ttfimg, ttfimg, all_formats freetype)
#!/bin/sh
# install - install a program, script, or datafile
scriptversion=2005-05-14.22
# 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. It can only install one file at a time, a restriction
# shared with many OS's install programs.
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit="${DOITPROG-}"
# put in absolute paths if you don't have them in your path; or use env. 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}"
chmodcmd="$chmodprog 0755"
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 -n "$1"; 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) chmodcmd="$chmodprog $2"
shift
shift
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 $?;;
*) # When -d is used, all remaining arguments are directories to create.
# When -t is used, the destination is already specified.
test -n "$dir_arg$dstarg" && break
# 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
break;;
esac
done
if test -z "$1"; 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
for src
do
# Protect names starting with `-'.
case $src in
-*) src=./$src ;;
esac
if test -n "$dir_arg"; then
dst=$src
src=
if test -d "$dst"; then
mkdircmd=:
chmodcmd=
else
mkdircmd=$mkdirprog
fi
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
dst=$dst/`basename "$src"`
fi
fi
# This sed command emulates the dirname command.
dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'`
# Make sure that the destination directory exists.