seejpeg  v1.2

------------------------------------------------------------------
Copyright (C) 1993 Evan Harris

Permission is granted to freely redistribute and modify this code,
providing the author(s) get credit for having written it.
------------------------------------------------------------------

seejpeg is another JPEG viewer which utilizes svgalib and contains
limited GIF, PPM and TARGA viewing support.

The most useful feature of seejpeg is that it automatically decides on
the "best" video mode to use based on the image being displayed and
the video card being used.  To aid it, various hints may be given as
program options.  In the worst case, it may be overridden.

Video modes supported are limited to 1280x1024, 1024x768, 800x600,
640x480 and 320x200 in 256, 32K or 16M colours (assuming the video
card, and svgalib, supports these modes).  Logical screen sizes are
only limited by the size of video memory.

After loading the image, if it is larger than the screen size the
arrow keys may be used to scroll around that part of the image which
could be loaded into video memory.  Pressing any other key exits the
program.

Program options:
-q	QUANTIZE PICTURE (256 colour mode)		(JPEG only)
	This option forces the image to be quantized into a colour
	map with 256 entries, and subsequently seejpeg uses a 256
	colour mode.  If this option is not given seejpeg will not
	use a 256 colour mode unless the TESTMODE is not available
	(see below) in which case it will implicitly set -q.
	The default quantization to use is two pass quantization -
	this is memory intensive and may cause the machine to page
	if the image is large or memory is small.  This should be
	the only occasion in which seejpeg causes a machine to page.
-1	ONE PASS QUANTIZATION (-q implicit)		(JPEG only)
	As -q, except that it uses one pass quantization.  This does
	not cause a machine to page, but the results are worse, unless
	the image is greyscale.
-g	FORCE GREYSCALE MODE (-1 implicit)		(JPEG only)
	Display the image in greyscale.  This is not necessary for
	an image compressed using the greyscale option on cjpeg as this
	mode will be set automatically.  It can be used for images
	compressed without the greyscale flag, or for displaying colour
	images in greyscale.
-v	VERBOSE
	Display the video modes being used, the program version number
	and lots of other stuff.  Without this option, seejpeg operates
	silently.
-w	ONLY USE WIDTH TO DETERMINE VIDEO MODE
	By default, the video mode chosen is the smallest one possible
	which is not smaller than the image.  This may not be desirable
	for long, thin images.  It may be preferable to choose the
	video mode based on the width only, rather than the width and
	height, in which case this option should be used.
-f F	SET FUZZ FACTOR TO DETERMINE VIDEO MODE
	A video mode is selected if it is larger than the image.
	Using this option allows a video mode to be selected if it is
	larger than (or equal to) F * image_width and F * image_height.
	Currently, F must be in the range [0.5,1.0].  This option may
	be used in conjunction with -w to only use the image width.
-F S	FORCE THE USE OF THE GIVEN VIDEO MODE
	To completely override the video mode selection routines a
	video mode string (e.g. G640x480x32K) may be given instead.
	If this is a 256 colour mode, quantization (-q) is
	automatically selected.

In addition to colour and greyscale JPEG formats, GIF, PPM and TARGA
image formats are supported to a limited degree.  If the image is in
GIF, PPM or TARGA format the -q, -1 and -g options are inoperative
and, as a result, some video modes are not available for selection
using -F.

Unfortunately, due to a limitation in libjpeg, the GIF support has to
perform its own colour map construction so it can use 256 colour
modes.  This may cause problems, although I haven't seen any yet.  GIF
support currently only uses 256 colour modes, however changing this
should be easy, if the demand is there for it.  GIF support has had
limited testing.

PPM support is barely tested.  It uses 16M or 32K modes for colour
images, and 256 modes for greyscale images.

TARGA support is completely untested as I've never seen or generated a
TARGA image.  The -targa option of cjpeg is not included in seejpeg,
let me know if something like it is required.

This program requires version 0.8 or higher of svgalib.

Compilation options:
NO_32K_CASCADE	If the best mode is available in 16M and 32K modes and
		the complete image doesn't fit in memory using the 16M
		mode, the 16M mode is discarded and 32K mode used instead.
		If you define this option this action does not happen.
		The only time I can think of this option being useful is
		if a video card supports 16M modes but not 32K modes.
TESTMODE	This video mode is tested for -
		If the video card supports it, we assume that hicolor or
		truecolor (32K or 16M) modes are available.
		If the video card doesn't support it, we assume that only
		256 colour modes are supported.
		If this is not set in the Makefile, it is assumed to
		be G640x480x32K.  If there is a video card which supports
		hicolor or truecolor but not this mode, let me know of
		a better default to test for and I'll change it in the
		next release.
Unless you change one of these options, or the default binary location,
changing the Makefile should no longer be necessary.

The current version was compiled and tested with svgalib version 0.81
and a 1MB CLGD5426 based video card.  There are no known bugs with
this configuration.  If you find a bug with any configuration please
report it, including all the information displayed using the "-v"
option.

Please send any feedback, especially bug reports, to:

Evan Harris (evan@cs.mu.oz.au)
