			      Vimage 1.0
		   Copyright (c) 1995, Joe Traister

Vimage is a picture viewing program for Linux using the SVGA library.
It can view a number of popular image formats, including JPEG, GIF,
Sun Rasterfiles, PBM files, and Targa files. It was developed using
a Slackware 2.2.0 installation of Linux on a 486DX2-66 with 16M RAM
and a Cirrus Logic 5428 VLB Video board with 2M video RAM.

There are three methods of file input for vimage. A single file can be
piped as the standard input (i.e. cat file.jpg | vimage), given
explicitly on the command line (i.e. vimage file.jpg), or the files
may be specified in a slide file (i.e. vimage -s file.pics). A slide
file must contain the number of filenames in the file as the first
line of the file. Each following line should contain the name of a
single file.

If there is only one file to display, vimage displays the file on the
screen, waits for a keypress, and then exits. If there is more than
one file, and the -c option is not used, each file specified will be
displayed for 6 seconds (overridden by the -d option). After showing
all the images once, vimage will exit. If the -l option is used, the
images will repeat the specified number of times and then vimage will
exit.

When the -c option is given to vimage, all the files listed on the
command line or in the slide file are displayed in an ncurses-based
file selector. To move the highlight cursor, use the arrow keys. To
view an image, press enter when its name is in the highlight
cursor. To return to the file selector, press any key. Pressing the
'D' key causes vimage to ask if you want to delete the file. The
spacebar is used to toggle the file's mark. Use the 's' key to view
the marked files in a slide show. Use 'S' to save the list of marked
filenames to be used with the -s command line switch. The 'c' key
clears all marks. The 'x' key displays image statistics. 'H' or 'h'
causes vimage to display a help screen with these options. To quit
vimage, press the 'q' key or the ESC key. Note that the -c option
ignores the use of -R, -r, -l, -d and -x options, although any of the
display options may be used with it (-2, -f, -a and -m).

The video mode used for display defaults to G320x200x256. This default
can be overridden by using the GSVGAMODE environment variable, which
can be overridden by using the -m option followed by a video mode name
(i.e. G1024x768x256). If the -a option is given, all other methods of
setting the display mode are ignored, and the pictures are displayed
with the best match of colors and resolution. (See note about Cirrus
Logic 5426/8 2M boards).

When displaying 24-bit images on an 8-bit display, vimage uses a 6x7x6
RGB color cube, combined with a Floyd-Steinberg dither to map the
image to 8-bit. A 6x7x6 palette was used instead of the standard 6x6x6
palette to increase the luminous precision of the palette. (The green
channel accounts for 58.7% of the luminosity, or brightness, of a
pixel.) The palette to be used to display the image can be computed
using a Heckbert median cut algorithm by using the -2 option.  In
addition, a Floyd-Steinberg dither can be applied by also supplying
the -f option. The -f option is functional only with the -2
option. The use of the -2 option usually results in a better display
quality. However, it it much slower than using the RGB color cube.

The -x option causes vimage not to display any pictures, but prints
the size, number of colors and type of image instead. The -q option
causes vimage to ignore files it can't process and proceed to the next
file to be displayed without giving an error message.

NOTE: The SVGA driver for Linux exhibits problems initializing 24-bit
display modes with Cirrus Logic CLDG-5426/28 cards. For this reason a
compile-time define has been added to force the driver to use only 8-,
15- and 16-bit modes when displaying with the -a option. The bug does
not appear to affect displaying all the files in the same video mode,
regardless of the number of colors, so you can still use true-color
modes with these cards without the -a option.

INSTALLATION
1) Edit Makefile.

To include JPEG support, set JPEG_DEF = -DJPEG_SUPPORT, set JPEG_INC
to the directory where your libjpeg include files are, and set
JPEG_LIB = -ljpeg -lm. Note that the math library is necessary if you
use libjpeg. (If the JPEG library is not in your default ld search path,
put -L <directory> in front of -ljpeg -lm.)

To disable JPEG support, define JPEG_DEF, JPEG_INC and JPEG_LIB as empty
strings.

To include ncurses support, set NCURSES_DEF = -DNCURSES_SUPPORT, set
NCURSES_INC to the directory where the ncurses include files are, and set
NCURSES_LIB = -lncurses, or use NCURSES_LIB = -L <directory> -lncurses
if the ncurses library is not in your default search path.

To disable ncurses support, define NCURSES_DEF, NCURSES_INC, and
NCURSES_LIB to empty strings.

If you have a Cirrus Logic CLDG-5426/8, define SVGABUG_DEF = -DBAD_CIRRUS_2M.
The current SVGA driver has a problem with mode switching on these cards when
24-bit modes are used. This definition will force vimage to use only 8-, 15-
and 16-bit color modes when vimage is determining the video mode (-a switch).
It will not disable the use of true-color modes when the -a switch is not used.

Set BINDIR to the directory name where you want the binary installed, set
MANDIR to the directory where the manpage should be installed.

2) make

After setting the above defines use "make" to compile to program. When you
have a good make, use "make install" as root to install the program and set
the correct permissions. Use "make install.man" to install the manpage.
