home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / GRAPHICS / MISC / PVQUAN15.ZIP / PVQUAN.DOC < prev    next >
Encoding:
Text File  |  1992-04-06  |  29.1 KB  |  696 lines

  1.  
  2.                           PVQUANT Version 1.50
  3.  
  4.                            A Colour Quantiser
  5.                                 for the
  6.                     Persistence of Vision Raytracer
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23. Written and Distributed by:
  24.  
  25. Frank van der Hulst,
  26. 101 Epuni St,
  27. Lower Hutt,
  28. New Zealand
  29.  
  30. Electronic mail to:
  31. UseNet:   frank@cit.ac.nz, frank@whare.cavebbs.gen.nz
  32. FidoNet:  frank vanderhulst at GenBoard (Node 3:771/160)
  33.  
  34. 03 April 1992
  35. ───────────────────────────────────────────────────────────────────────────
  36.  
  37. These programs are freely distributable.  The authors retain the
  38. copyright to the program but authorizes free distribution by BBS'es,
  39. networks, magnetic media, etc.  The distributor may charge no more than
  40. five dollars ($5) U.S. for this software.
  41.  
  42. The images and data files generated by these programs are the property
  43. of the user of the software and may be used for any purpose without
  44. restriction.
  45.  
  46. The authors make no guarantees or warranties with these programs and
  47. claim no responsibility for any damage or loss of time caused by this
  48. program. Bug reports may be sent to the authors but the authors are
  49. under no obligation to provide bug fixes, features, or any support for
  50. this software.
  51.  
  52. The following conditions are placed on the use of this program:
  53.  
  54. 1) That it should not be used as part of any commercial package without
  55.     the explicit written consent of the author.
  56.  
  57. 2) If you make any changes to the source code, please let me know.
  58.     That's the way this program was built!
  59.  
  60. 3) This text file must accompany the program.
  61.  
  62. This manual is divided into the following sections:
  63.  
  64.    1) Archive Description
  65.    2) Background
  66.    3) Getting Started
  67.    4) Command Line Parameters
  68.    5) Output File Format
  69.    6) Source Code Information
  70.    7) Displaying the Images
  71.    8) Animation
  72.    9) Compiling the Code
  73.   10) Porting to Different Platforms
  74.  
  75. 1) Archive Description
  76. ~~~~~~~~~~~~~~~~~~~~~~
  77. This archive contains C source code for a set of programs to convert
  78. image files produced by DKB-Trace or Persistence of Vision raytracer
  79. into a format suitable for display on a VGA screen, or to GIF format. It
  80. includes programs to generate a single stereoscopic 3D image from two
  81. views of a scene, as well as programs to produce animation from multiple
  82. ray-traced images.
  83.  
  84. The programs (or large parts of them) were written by several different
  85. people. All of the programs are in the public domain to some extent,
  86. with some restrictions put on them by their respective authors. I have
  87. collected these from various places, ported them to Turbo-C and GNU C if
  88. necessary, and formatted them in a way that I like. The copyright for
  89. each program still belongs to its author -- my copyright claim extends
  90. only to the collection of programs (like the editor of a journal, for
  91. example).
  92.  
  93. QUANT (HECKBERT & OCTREE):
  94.   Colour quantisation program which post-processes raw image files
  95.   produced by the Persistence of Vision Ray Tracer (PoV Ray). Two
  96.   versions can be compiled: one uses Heckbert's median-splitting
  97.   algorithm, whereas the other uses Octree quantisation.
  98.  
  99. DISPLAY:
  100.   Displays either 320x400 or 320x200 images, either 2D, or stereo 3D. 3D
  101.   images require Sega 3D-glasses to be connected to the serial port for
  102.   viewing.
  103.  
  104. MAKEANIM:
  105.   Reads an animation source file (*.ANM), and uses it to generate data
  106.   files for the PoV ray tracer.
  107.  
  108. ANIMGIF:
  109.   Produces a .GIF file containing a series of images to be displayed by
  110.   ANIM.
  111.  
  112. ANIMFLI:
  113.   Produces a .FLI file containing a series of images to be displayed by
  114.   a .FLI player (e.g. Autodesk's AAPLAY).
  115.  
  116. ANIM:
  117.    Produces animation on a 320*200 screen using page flipping, including
  118.    sound.
  119.  
  120. Files contained in this archive:
  121. -------------------------------
  122. QUANT.ZIP     Quantiser source code
  123. PAC_BASE.DAT  Sample PoVRay data file for generating animation
  124. SHAPES.DAT    Required to produce sample animation image
  125. MAZE.IFF      Required to produce sample animation image
  126. INCLUDE.ZIP   To be unzipped to C include directory
  127. VGA.ZIP       VGA 320x200x256x4 & 320x400x256x2 driver source code
  128. GIFLIB.ZIP    GIF encoding/decoding
  129. ANIM.SH       Unix shell script for generating animation
  130. TRACE.SH      Unix shell script to run ANIM.SH as background task
  131. PACMAN.ANM    Sample animation script
  132. ANIM.ZIP      Animation source code
  133. QUANT.DOC     Documentation
  134. README        This file
  135. FLILIB.ZIP    FLI creation routines
  136.  
  137. 2) Background
  138. ~~~~~~~~~~~~~
  139. I have a 286 PC clone with a VGA screen, and am interested in virtual
  140. reality. I realise that a 286 doesn't have the horsepower to be good for
  141. that, but that's all I got. Attached to this I have a pair of Sega 3D
  142. glasses, which allows me to view see a 3D image by displaying
  143. stereoscopic pairs of images on the screen.
  144.  
  145. I started off drawing images with Turbo C, but that was time-consuming
  146. and not very effective. I then got a copy of DBW_RENDER and used it
  147. (over many nights over many weeks) to produce images. In the meantime,
  148. Craig Kolb had sent me a copy of his COLORQUANT code, which I ported to
  149. Turbo C. I also found code to display images in 320x400 mode on my VGA.
  150. Finally I could display some good images. I modified the quantiser to
  151. read two input files to produce one palette, so that I could display a
  152. 3D image.
  153.  
  154. The primitives available in DBW_RENDER were very limited, so I switched
  155. to DKB-TRACE v2.12. And ran my machine day and night for months.
  156.  
  157. Then I got access to a 486 running SCO Unix. Great! My 286 took a rest
  158. at nights, because I could generate the most complex scenes in only a
  159. few hours. Unfortunately, I couldn't display the images, or even move
  160. them easily from the 486 (the only direct interchange medium is 360K
  161. floppies, and the QRT-format files are too big). Also working with the
  162. QRT-format was clumsy, so I converted the quantiser to read raw format
  163. files (each of which is only 128K long, thus easily transported). Then I
  164. saw a copy of the Octree quantisation code on UseNet, so I tried that.
  165. It was much faster (a real advantage on the PC) but produced inferior
  166. results. Next step was to move the quantiser to Unix, and suddenly the
  167. Heckbert technique was best.
  168.  
  169. The extra speed of the Unix box opened up some new possibilities -- I
  170. started to look at animation. I could generate about seven images per
  171. hour, then use a display program to flip them up one by one. That works
  172. fine (although it needs a lot of memory on the PC).
  173.  
  174. Then I received an assembler source file by K. Heidenstrom which did
  175. page flipping in 320*200*256 mode. This makes animation easier, since
  176. each image requires less memory. It also makes 3D animation possible.
  177.  
  178. Now I have easier access to a Sun IPC workstation than the the '486 --
  179. so I've ported the raytracer and other files to compile using the GNU C
  180. compiler gcc.
  181.  
  182. The GIF display program needs lots of memory, and the files (even after
  183. GIF compression) are huge... the GIF standard isn't well suited to
  184. animation. So I took the FLILIB source from Simtel... that was designed
  185. to be compiled on the PC using TurboC (included was 8086 assembler
  186. source code to open and close files, amongst other things). I ported
  187. that to gcc, converting things back to C and fixing some annoying
  188. pointer addressing problems.
  189.  
  190. Next is Floyd-Steinberg dithering, to remove unwanted "banding" of
  191. coloured regions (called false contours).
  192.  
  193. Or maybe adding sound to a FLI player. Or perhaps 3d animation....
  194.  
  195. 3) Getting Started
  196. ~~~~~~~~~~~~~~~~~~
  197. Before quantising an image, you must create one! Use either DKB-TRACE or
  198. PoVRAY to produce output in the "Targa" format.
  199.  
  200. I use the following command line:
  201.         PVRAY -ipacman.dat -opacman.tga -w320 -h400 -v +ft +p +x -a
  202.  
  203. See the raytracer documentation on what all the above mean. Most
  204. important is the "+ft" option which tells the raytracer to produce
  205. "Targa" files. The quantiser can also read "raw" format files (use the
  206. "+fr" switch). If you use this (there's no real reason why you should)
  207. and run PVRAY on a PC, you'll probably need to rename the files
  208. produced. By default it gives extensions of .R8, .G8, and .B8, whereas
  209. QUANT needs extensions of .RED, .GRN, and .BLU.
  210.  
  211. Now try running the OCTREE quantiser program:
  212.         OCTREE pacman
  213.  
  214. 4) Command Line Parameters
  215. ~~~~~~~~~~~~~~~~~~~~~~~~~~
  216. QUANT is a program to convert image files produced by DKB-Trace or
  217. Persistence of Vision raytracer into a format suitable for display on a
  218. VGA screen.
  219.  
  220. To do this, it must select 256 colours from a palette of 256K colours to
  221. best represent the colours in the image file which are selected from a
  222. palette of 16 million. In other words, it must "quantise" the colours in
  223. the image file (which are selected from a palette of 16 million) into a
  224. set of 256 colours selected from a palette of 256K colours.
  225.  
  226. QUANT is a colour quantisation program which post-processes raw image
  227. files produced by the Persistence of Vision Ray Tracer (PoV Ray). Two
  228. versions can be compiled: one uses Heckbert's median-splitting
  229. algorithm, whereas the other uses Octree quantisation. The Heckbert
  230. version takes much longer to run, especially on a 286. On the other
  231. hand, it produces much better results. The Octree version is faster, but
  232. not as good.
  233.  
  234. As an additional feature, the program allows the user to generate a single
  235. palette from several image files, thus making it possible to produce a
  236. stereoscopic 3D image from two views of a scene, or animation.
  237.  
  238. Command line format:
  239.         HECKBERT [-C=colours][-W=width][-H=height][-D=display][-T=type]
  240.                  [-O=outputbits][-S=speed][-N=numfiles] file_name
  241. or
  242.         OCTREE   [-C=colours][-W=width][-H=height][-D=display][-T=type]
  243.                  [-O=outputbits][-N=numfiles] file_name
  244.  
  245. If no parameters are given, a usage message is shown.
  246.  
  247.                                                                  Default
  248.                                                                  value
  249.               outputbits   = bits per colour being output          [6]
  250.               intype       = 0 or 1 to select input format         [0]
  251.                              0 selects raw files (.RED, .GRN, .BLU)
  252.                              1 selects Targa (.TGA)
  253.               type         = 0, 1 or 2 to select output format     [1]
  254.                              0 selects 4-planar output for 320x400
  255.                                or 320x200 images
  256.                              1 selects linear output
  257.                              2 selects GIF output. Only one image at a
  258.                                time can be converted to GIF format.
  259.               display      = 1 to display while outputting         [1]
  260.                              Only available on the PC.
  261.               colours      = number of separate colours to produce [256]
  262.               width        = number of pixels wide the image is    [320]
  263.               height       = number of pixels high the image is    [200]
  264.               speed        = 1 or 0 for fast or slow quantisation  [0]
  265.                              Heckbert speed switch. If zero, the program
  266.                              does another pass through the data, to find
  267.                              the optimal palette selection. This pass is
  268.                              much slower than the earlier passes, and
  269.                              produces slightly better results.
  270.               numfiles     = number of files to convert            [1]
  271.                              If numfiles = 1, QUANT calculates a palette
  272.                              for that file and writes it to disk with a
  273.                              .2D extension.
  274.                              If numfiles = 2, QUANT calculates one
  275.                              combined palette from both images, then
  276.                              writes this palette, as well as the data
  277.                              from both files to an output file with a
  278.                              .3D extension.
  279.                              If numfiles > 2, QUANT assumes this is an
  280.                              animation sequence, and generates one
  281.                              palette for all the files, then writes the
  282.                              output in the form of several 2D-format
  283.                              files (one for each input file), all with
  284.                              the same palette. The files are named
  285.                              FILE_0.0, FILE_0.1, FILE_0.2, ...
  286.  
  287.               file_name      the base part of the filename(s) of files
  288.                              to be converted -- a numeric part and an
  289.                              extension are added automatically. The
  290.                              numeric part consists of an underscore
  291.                              followed by a number, and the extension
  292.                              will depend on the input file type. (e.g.
  293.                              if the file_name is PAC and the input type
  294.                              is Targa, the first file read will be
  295.                              PAC_0.TGA.
  296.  
  297. When the final result is to be a .FLI file, it may be better to generate
  298. the palette for each image separately, since .FLI players can use
  299. different palettes for each frame.
  300.  
  301. For example,
  302.  
  303.     C:\>OCTREE GLASS -c=16
  304.  
  305. will open the files GLASS.RED, GLASS.GRN, and GLASS.BLU, use Octree
  306. quantisation to find the 16 best colours, then write the output to to
  307. the file GLASS.2D. As it creates the file, it will display the image on
  308. the screen.
  309.  
  310.     C:\>HECKBERT PACMAN -n=2 -c=64 -d=0
  311.  
  312. will open the files PACMAN_0.RED, PACMAN_0.GRN, and PACMAN_0.BLU, then
  313. the files PACMAN_1.RED, PACMAN_1.GRN, and PACMAN_1.BLU, then create the
  314. file PACMAN.3D. This will be done using Heckbert's median-splitting
  315. algorithm.
  316.  
  317.     C:\>HECKBERT PACMAN -i=1 -t=1
  318.  
  319. will open the file PACMAN.TGA, and create the file PACMAN.2D. This will
  320. be done using Heckbert's median-splitting algorithm.
  321.  
  322.     C:\>HECKBERT TEST -n=4
  323.  
  324. will read the files TEST_0.RED/GRN/BLU, TEST_1.RED/GRN/BLU, etc., then
  325. create the files TEST_0.0, TEST_0.1, TEST_0.2, and TEST_0.3. This will
  326. be done using Heckbert's median-splitting algorithm.
  327.  
  328. Note that both versions of QUANT require large amounts of memory.
  329.  
  330.  
  331. 5) Output File Format
  332. ~~~~~~~~~~~~~~~~~~~~~
  333. QUANT produces output in one of four possible output formats:
  334.  
  335.         GIF
  336.         2D -- a single image
  337.         3D -- two stereoscopic images of the same scene
  338.         nn -- animation
  339.  
  340. The GIF output file can be displayed using a GIF display program such as
  341. CSHOW or Image Alchemy. The 2D and 3D format files can be displayed
  342. using the provided DISPLAY program. The animation output is in the form
  343. of several 2D-format files (one for each input file), all with the same
  344. palette. The files are named FILE_1.1, FILE_1.2, FILE_1.3, ...
  345.  
  346. The 2D and 3D files have the following format:
  347.     7-byte header
  348.     256*3-byte palette
  349.     one or two screen images (one byte per pixel).
  350.  
  351. The header consists of:
  352.  
  353.         <signature>      - 2 bytes long, value '2D' or '3D', depending
  354.                            on the image type.
  355.         <num columns>   - 2 bytes long (LS byte first)
  356.         <num rows>      - 2 bytes long (LS byte first)
  357.         <num colours>   - 1 byte
  358.  
  359. The palette consists of a series of 3-byte fields, each corresponding to
  360. the combination of blue, green, and red signals for the corresponding
  361. colour. A zero value in the <num colours> field represents 256 colours.
  362.  
  363. A screen image can be in one of two formats: 4-planar or linear
  364. (corresponding to setting the type command line parameter to 0 or 1).
  365. The 4-planar format was designed to make it fast and easy to display an
  366. image in either 320x400x256 or 320x200x256 mode. To facilitate this, the
  367. format of screen image(s) is similar to the memory organisation of the
  368. VGA card in that mode. For any other image size, the program
  369. automatically outputs images in the linear format.
  370.  
  371. Each byte is used by the VGA card as an index into the palette, which is
  372. then used to display the correct colour on the screen.
  373.  
  374. For the 4-planar format of a 320x400 image, each screen image is made up
  375. of 128,000 bytes, one per pixel. Because of the memory organisation of
  376. the VGA card, each image is made up of 4 banks of 32,000 bytes. A VGA
  377. register is set, then a bank is loaded into VGA memory. Each bank
  378. consists of 80 bytes per scan line by 400 scan lines. The bytes from the
  379. four banks illuminate adjacent pixels. For a 4-planar 320x200 image, the
  380. total image size is 64,000 bytes, made up of 4 banks of 16,000.
  381.  
  382. In the linear format, each byte in turn is stored.
  383.  
  384. 6) Source Code Information
  385. ~~~~~~~~~~~~~~~~~~~~~~~~~~
  386. This program is the amalgamation of several pieces of work by different
  387. authors:
  388.  
  389. The colour quantisation algorithms used in QUANT come from two sources:
  390. 1. The files OCTREE.C and OCTREE.H are based on code written by Wolfgang
  391. Stuerzlinger who placed it in the public domain. The code implements the
  392. algorithm described in:
  393.  
  394.         Graphic Gems, edited by Andrew Glassner
  395.         Article: A Simple Method for Color Quantisation: Octree Quantisation,
  396.         pg. 287 ff
  397.         by:      Michael Gervautz, Werner Purgathofer
  398.                  Technical University Vienna, Austria
  399.  
  400. 2. The files HECKBERT.C and HECKBERT.H are based on COLORQUANT.C written
  401. by Craig E Kolb who placed it in the public domain.
  402.  
  403. The GIF output code is based on code in version 1.1 (Sep. 1990) of
  404. Gif-Lib, a package written by Gershon Elber.
  405.  
  406. The FLI creation code comes from FLI.LIB (Dec 1989) by Jim Kent of
  407. Dancing Flame, San Francisco. Following is an excerpt from his README
  408. file:
  409.  
  410.         Fli.lib and the associated source and documentation files are
  411.         Copyright 1990 Dancing Flame, San Francisco.  Permission is
  412.         granted to distribute fli.lib and to use fli.lib in any
  413.         non-commercial program. If you would like to use fli.lib in a
  414.         commercial program please contact Dancing Flame.  The normal
  415.         licensing fee is the retail price of 5 copies of the program you
  416.         are selling.
  417.  
  418.             Dancing Flame
  419.             3312 16th St.
  420.             San Francisco, CA 94114.
  421.             (415) 861-6119
  422.  
  423. The VGA 320*400 output is based on a program published by Michael Abrash
  424. in Programmer's Journal.
  425.  
  426. The VGA 320*200 output is based on a program (FLIPDEMO.ASM) sent to me
  427. by K. Heidenstrom.
  428.  
  429. All of the above programs are in the public domain.
  430.  
  431. I took all these bits and chopped them round a bit to make them work the
  432. way I like, and added my own code to do things like outputting to my
  433. 2D/3D file, virtual memory management, handle command line parameters, etc.
  434.  
  435.  
  436. 7) Displaying the Images
  437. ~~~~~~~~~~~~~~~~~~~~~~~~
  438. The DISPLAY program provided will display either 320x400 or 320x200
  439. images, either 2D, or stereo 3D. According to Abrash's article, this
  440. should work on any VGA or SVGA card. (On one machine which has a VGA
  441. card, this didn't work). It has the following command line
  442. options:
  443.  
  444. Command line format:
  445.         display FILE1 [FILE2]... [/W] [/C] [/R] [/H]
  446.  
  447.         where FILE1, FILE2... are the names (with extensions) of files
  448.                               to be displayed.
  449.  
  450.         /W    => wait after each following image has been displayed
  451.     /C    => clear screen after each image
  452.         /R    => reverse eye-image sync for following 3D images
  453.         /H    => toggle screen height between 400 and 200 line modes
  454.  
  455. Each of these switches acts as a toggle. The program has the following
  456. defaults:
  457.          wait after each image for a keypress before displaying the next
  458.          clear the screen after each image
  459.          first image of a 3D-pair is for left eye, second is for right eye
  460.          400 line mode
  461.  
  462. 8) Animation
  463. ~~~~~~~~~~~~
  464. Four programs are provided to support animation:
  465.         1)      MAKEANIM generates .DAT files for PoVRay
  466.         2)      ANIMGIF converts multiple 2D files produced by QUANT
  467.                 into a single multi-image GIF file
  468.         3)      ANIM displays the resulting animation.
  469.         4)      ANIMFLI converts multiple 2D files into a FLI file
  470.  
  471. MAKEANIM:
  472.     This program reads an animation source file (*.ANM), and uses it to
  473.     generate data files for the PoV ray tracer. An initial data file
  474.     must also be given.
  475.  
  476.     Command format:
  477.          MAKEANIM data animation
  478.  
  479.         The animation file is a text file with the following format:
  480.         Line 1: time, sound, name1  [,name2]...
  481.         Line 2:   t1,    s1, value1 [,value2]...
  482.  
  483.     name1, name2, etc. are the names of items #declared in the initial data
  484.     file, separated by commas. The names must be in the same order as they
  485.     are #defined in the data file.
  486.  
  487.         t1 is the time in milliseconds, expressed as an integer, that
  488.         this image is to be displayed for.
  489.  
  490.         s1 is the frequency of sound, expressed as an integer, to be
  491.         produced while this image is displayed. A frequency of 0
  492.         represents no sound.
  493.  
  494.         The t1 and s1 values are ignored by MAKEANIM -- they are used by
  495.         ANIM (see below).
  496.  
  497.         value1, value2, etc. are the values to be assigned to those
  498.         #defined items, separated by commas. Each line represents one
  499.         screen.
  500.  
  501.     This program reads the initial data file, searching for the lines where
  502.     the items named in the animation file are defined.
  503.  
  504.     Data files are then generated, replacing the lines containing the
  505.     #defines identified with new values.
  506.  
  507.         For example, assuming the following is contained in a file
  508.         called PACMAN.ANM.
  509.  
  510. time, sound, lip_upper_angle, lip_lower_angle
  511.   10,     0,             -35,             +10
  512.   20,     0,             -28,              +8
  513.   10,   500,             -20,              +6
  514.   10,   800,             -12,              +4
  515.  
  516.         Executing
  517.  
  518. MAKEANIM PAC_BASE PACMAN
  519.  
  520.         would make 4 copies of PAC_BASE.DAT, generate 4 data files,
  521.         named PACMAN_1.DAT, PACMAN_2.DAT, PACMAN_3.DAT, and
  522.         PACMAN_4.DAT, with the given values being inserted into the
  523.         lines which define lip_upper_angle and lip_lower_angle. These 4
  524.         files are then given to PoVRay to generate 4 scenes.
  525.  
  526. ANIMGIF:
  527.   This program produces a .GIF file containing a series of images to be
  528.   displayed. The images to be read in must be generated by QUANT (either
  529.   version) with the output format set to "type 0" (4-planar). Images are
  530.   stored in the GIF file in a 4-planar format. For example, a 320x200
  531.   image appears to a conventional GIF display program as if it is
  532.   80x800.
  533.  
  534.   The first image in the file is complete, but the others only contain
  535.   part of the image. The program calculates the location of the first
  536.   and last lines which are different between two graphic images. The
  537.   segment between these two lines is stored in GIF format. This file can
  538.   then be read by ANIM to produce animation.
  539.  
  540.   The differences stored in the GIF file are designed to use two frame
  541.   buffers, so they correspond to the following:
  542.  
  543.   GIF Image 1 contains the entire first frame (320x200)
  544.             2 contains the difference between image 1 & frame 2
  545.             3                                       1         3
  546.             4                                       2         4
  547.             5                                       3         5
  548.             6                                       4         6
  549.             etc.
  550.  
  551. Command line format:
  552.         ANIMGIF INPUT_FILE OUTPUT_FILE
  553.  
  554.         where INPUT_FILE is the name (without any extension) of the
  555.         sequence of input files to be loaded into the GIF
  556.  
  557.         OUTPUT_FILE is the name (without extension) of the GIF file to
  558.         be created.
  559.  
  560. ANIM:
  561.    This program produces animation on a 320*200 screen using page flipping.
  562.    The command line parameter is the name (without extension) of the GIF
  563.    file (produced by ANIMGIF above) containing the sequence of images.
  564.  
  565. Command line format:
  566.         ANIM INPUT_FILE [/B[D/G/N] [/T[1/0]] [/S[1/0]]
  567.  
  568.    Note that ANIM *must* be run on a PC with a VGA card. It expands the
  569.    GIF contents to memory, using all available memory (conventional
  570.    memory first, then XMS, then EMS). Note that to use XMS a suitable
  571.    driver such as HIMEM.SYS must be loaded first. Similarly, to use EMS
  572.    a driver must first be loaded.
  573.  
  574.    INPUT_FILE specifies the name of the file to be displayed without any
  575.    extension. ANIM opens the corresponding .GIF file to extract the
  576.    images, and also reads the corresponding .ANM file to find the time
  577.    and sound information.
  578.  
  579.    The -B(uffer) parameter controls what the program will do if it runs
  580.    out of memory.
  581.  
  582.    -BD instructs it to continue to expand the GIF images to a file
  583.    called ANIM.TMP. The resulting animation will be very slow, though,
  584.    unless you have a very fast hard disk with a large cache.
  585.  
  586.    -BG instructs it to expand the remaining images "on-the-fly" from the
  587.    original GIF file. This is even slower than using -BD, and only
  588.    useful on a very fast machine.
  589.  
  590.    -BN (the default) instructs the program to stop expanding images.
  591.  
  592.    The -T(ext) parameter controls whether the program displays the
  593.    images as it decompresses them.
  594.  
  595.    -T0 instructs it to display images.
  596.  
  597.    -T1 (the default) instructs it to display text information, such as
  598.    the destination of each image, on the screen while decompressing
  599.    images.
  600.  
  601.    The -S(ound) parameter controls whether the program makes sounds as
  602.    indicated in the .ANM file.
  603.  
  604.    -S0 instructs it to not make any sounds.
  605.  
  606.    -S1 (the default) instructs it to make sounds.
  607.  
  608.    While images are being decompressed, pressing the ESC key aborts the
  609.    decompression phase and moves immediately to the display phase.
  610.  
  611.    When all the images have been read (or if you decide not to use a
  612.    disk buffer, or press ESC), it will display the animation on the
  613.    screen. Pressing any key will stop the program at the end of the
  614.    sequence and return to DOS.
  615.  
  616. ANIMFLI:
  617.   This program produces a .FLI file containing a series of images to be
  618.   displayed. The images to be read in must be generated by QUANT (either
  619.   version) with the output format set to "type 1" (single plane) Image
  620.   size must be 320x200.
  621.  
  622.   This file can then be read by any standard FLI player to produce
  623.   animation. Note that this will not use some of the information in the
  624.   file read by MAKEANIM -- all images are displayed for the same length
  625.   of time, and no sound is produced.
  626.  
  627. Command line format:
  628.         ANIMFLI INPUT_FILE OUTPUT_FILE
  629.  
  630.         where INPUT_FILE is the name (without any extension) of the
  631.         sequence of input files to be loaded into the FLI
  632.  
  633.         OUTPUT_FILE is the name (without extension) of the FLI file to
  634.         be created.
  635.  
  636. 9) Compiling the Code
  637. ~~~~~~~~~~~~~~~~~~~~~
  638.     1) Create a subdirectory for each ZIP file contained in this
  639.        archive (QUANT, ANIM, VGA, GIFLIB, FLILIB), and unZIP each of the
  640.        ZIP files to its directory. UnZIP the INCLUDE.ZIP to your include
  641.        directory.
  642.  
  643.     2) Move to the VGA directory, and edit MAKEFILE to use your compiler
  644.        and library manager. Then use your make utility to create VGA.LIB
  645.        in your LIB directory.
  646.  
  647.     3) Move to the GIFLIB directory, and edit MAKEFILE to use your
  648.        compiler and library manager. Then use your make utility to
  649.        create GIFLIB.LIB in your LIB directory.
  650.  
  651.     4) Move to the FLILIB directory, and edit MAKEFILE to use your
  652.        compiler and library manager. Then use your make utility to
  653.        create FLILIB.LIB in your LIB directory.
  654.  
  655.     5) Move to the QUANT directory, and edit the makefiles OCTREE.MAK,
  656.        HECKBERT.MAK, and DISPLAY.MAK as above, and again make the
  657.        various programs. Alternatively, in Turbo C use the IDE with the
  658.        appropriate project files. To compile the Heckbert version using
  659.        Turbo C's IDE, you need to define the symbol HECKBERT in the
  660.        Compiler/Defines menu.
  661.  
  662.        Note that OCTREE and HECKBERT have some filenames in common which
  663.        are not compatible from one version to another. After
  664.        successfully compiling and linking one version, you should delete
  665.        all the object files produced by that before compiling and
  666.        linking the other version.
  667.  
  668.     6) Move to the ANIM directory, and edit the makefiles MAKEANIM.MAK,
  669.        ANIMGIF.MAK, and ANIM.MAK as above, and again make the various
  670.        programs. Alternatively, in Turbo C use the IDE with the appropriate
  671.        project files.
  672.  
  673.        ANIM also requires the XMSLIB.H and EMSLIB.H files, as well as
  674.        XMSLIBC.OBJ and EMSLIBC.OBJ.
  675.  
  676.        These all relate to the XMSLIB and EMSLIB packages written by
  677.        James W Birdsall. I used XMSLIB v1.21 and EMSLIB v2.15.
  678.  
  679.        The licence conditions for these does not allow them to be
  680.        distributed. They are available from various sources, including
  681.        the SIMTEL archive.
  682.  
  683. 10) Porting to Different Platforms
  684. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  685. I've tried to make QUANT portable. So far, it's working out fairly well.
  686. All the programs (except ANIM and DISPLAY -- they are specific to
  687. MS-DOS) compile cleanly and run properly (no warnings, no errors) using
  688. either Turbo-C v2.01, GNU C, or SCO Unix.
  689.  
  690. If you want to port QUANT to another system, please try to modify the
  691. core as little as possible.
  692.  
  693. Similarly, if you implement a different quantisation algorithm, try to
  694. keep it as a separate module.
  695.  
  696.