/*
    Tools and libraries for image processing and O2-products
        http://www.sc.isc.tohoku.ac.jp/~hgot/O2/
    Release 2.00

    README,   by Hideaki Goto Dec 2008
*/

/*--------------------------------------------------------------------
  Copyright (C) 1997-2008  Hideaki Goto

        All Rights Reserved

  Permission to use, copy, modify, and distribute this software and
  its documentation for any purpose is hereby granted without fee,
  provided that (i) the above copyright notice and this permission
  notice appear in all copies and in supporting documentation, (ii)
  the name of the author, Hideaki Goto, may not be used in any
  advertising or otherwise to promote the sale, use or other
  dealings in this software without prior written authorization
  from the author, (iii) this software may not be used for
  commercial products without prior written permission from the
  author, and (iv) the notice of modification is specified in cases
  where modified copies of this software are distributed.

  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
  THE AUTHOR WILL NOT BE RESPONSIBLE FOR ANY DAMAGE CAUSED BY THIS
  SOFTWARE.
--------------------------------------------------------------------*/


1. About this package.

  The programs and libraries in this package are originally my private
  image processing stuff designed especially suitable for document
  image processing.  Some redundant and experimental codes may be
  included in this package.  The programs or the libraries were not
  necessarily designed to provide tools which were universal and
  convenient to everybody.  However, you could find some convenient
  programs in this package.

  ImageMagick and Netpbm, the famous image processing packages,
  provide universal and very convenient tools to us. The programs
  in those packages work well for small images. (I often use them:)
  However, unfortunately, some of the programs does not work fast
  enough for very large images, so that they are not applicable to
  document image processing.

  Most of the programs in this package have been designed carefully
  to avoid slowing down even for huge images, e.g. 3300x4700. 
  I hope you will find them better.

  This package contains following programs:

    bmptopnm - convert a BMP(DIB) file into a portable anymap

    breduce  - read a portable bitmap and reduce it N times

    makecr   - create circumscribing rectangles (bounding box) in an
               image

    makepr   - create Primitive Rectangles in an image

    prlst2ps - produce  PostScript  data  from  rectangle/line-
               segment data

    lpsmooth - smooth an image preserving thin lines

  This package may contain some codes contributed by other authors.
  There is a copyright notice in every file of the source code.  All
  authors have granted that you have the right to use and distribute
  their code without paying them, as long as you do it on a non-
  commercial act.  Please remember to check the copyright notes.


2. Changes in version 2.00

    1) Some data types have been changed. Specifically, a lot of
       short and ushort variables have been eliminated for ease
       of use and for code simplification.

    2) Autoconf has been introduced for ease of installation.
       Imake is not used anymore.

    3) IP stream functions have been removed, since they were
       not designed well and have not been used.


3. Requirements

  Under UNIX or UNIX-like Operating System:

    1) ANSI C and C++ compilers.
       Using GNU's gcc and g++ is the easiest way, if you don't care
       about the speed of the programs. I'd like to recommend you to
       try better compilers with good optimizations in order to get
       faster executables.

    2) "make" command.

    3) Autoconf compatible environment in which you can run
       "configure" script.


  Under Windows NT Operating System:

    1) ANSI C and C++ compilers. (Never use 16bit-compilers!)
       Microsoft Visual C++ 2.0 or later is desirable.


4. How to make programs.

  Under UNIX or UNIX-like Operating System:

    1)  Run configure script in the top directory.
        For example,
          $ ./configure

        To change the installation directory, try something like
          $ ./configure --prefix=$HOME/O2/x86_64-sun-solaris

        To change the optimization flags, try
          $ CFLAGS="-O2" CXXFLAGS="-O2" ./configure
          (on bash)

    2)  Run make command to build the tools and libraries.
        For example,
          $ make

        If you want to change the platform OS or architecture,
        run ./configure again and type
          $ make clean && make

    3)  Run make command to install the tools, libraries,
        and manuals.

          # make install


  Under Windows NT/2000/XP Operating Systems:

    I'm sorry, no project file, Makefile or *.mak file is provided.
    Please make all the libraries as "static library" manually.
    And, please make all the programs manually.


5. Troubleshooting

  1)  If some typedefs for unsigned variables, uchar, ushort, ulong
      and uint, are missing or conflict with system definitions,
      edit "include/utypes.h" according to your environment.

  2)  Under AIX4, "install" command may not work correctly for
      non-root users.  Copy files manually in such a case.

  3)  Under Windows, a header file "unistd.h" does not exist.
      Create an empty file named "unistd.h" and use it.


6. Testing Environments

    The current release has been tested in the following environments.

  Machine:         Sun Ultra 20 M2 (Opteron 1218 2.6GHz)
  OS:              Solaris 10 x86
  Compilers:       gcc-3.4.3

  Machine:         Sun Blade 1500 Silver (UltraSPARC-IIIi 1.5GHz)
  OS:              Solaris 10
  Compilers:       gcc-3.4.3

  Machine:         PC with an Opteron 285 (2.6GHz)
  OS:              SuSE Linux 10.0
                     with kernel 2.6.13-15.18-smp
  Compilers:       gcc-4.1.1

  Machine:         NEC TX7/i9610
  OS:              SUSE LINUX Enterprise Server 9 (ia64)
  Compilers:       NEC/Intel C++ Itanium Compiler, Revision 5.2.1
  Configuration:   CC=ecc CXX=ecpc CFLAGS=-O2 CXXFLAGS=-O2


                        Dr. Hideaki Goto,
                        Cyberscience Center,
                        Tohoku University, Sendai 980-8578, Japan.
                        email:  hgot((at))isc.tohoku.ac.jp
