First commit ~0,10

This commit is contained in:
2021-09-08 21:26:43 +02:00
commit 37dffcdec3
188 changed files with 23679 additions and 0 deletions

22
G/DOC/GENERAL.DOC Normal file
View File

@ -0,0 +1,22 @@
General information - GIF utilities
-----------------------------------
Each of the utilities provided in 'util' directory perform some kind of
filtering, generating new image, or dumping it to a device.
Because they are not fast, a filter will print (in increasing) order the
current input image line number, any time it needs to read the input, and
will print output image line number (in decreasing order) any time it dumps
out. Other utilities, that only read or write, will always print that half
the same way (but in increasing order). This is true only for utilities
that decodes the data. Utilities (like GifPos that only change positions)
that copies the image as block of compressed data, will print nothing for
two reasons: they can not idetify line number, and mainly as they are much
faster.
Some of the utilities requirs memory in the order of the whole screen, while
others read one scan line at a time. Each utility DOC file, has entry called
'Memory Usage' which will be one of: Line (memory required is in the order
of one scan line), Image (order of biggest image in GIF file), or Screen (order
of GIF file screen). In all cases, a byte is allocated per pixel, so image of
320 by 200 pixels will requires ~64k bytes to hold.

88
G/DOC/GIF2BGI.DOC Normal file
View File

@ -0,0 +1,88 @@
Gif2BGI
--------
Program to display images saved as GIF files on IBM PC display devices using
the BGI (Borland) driver interface.
The program has few stages as follows:
1. Reads GIF file header and determines size of it.
2. Dynamically allocate enough memory to hold all the image internally.
One byte per pixel is always allocated, so a little bit more than
width*height (of screen, not image) bytes are required.
3. Reads all the image in. Interlaced images are read correctly in, although
they are displayed sequentially.
4. Display first image using the defaults as set by the command line option.
5. Goes to interactive mode. For full description of the interactive mode
see below
Usage:
------
Gif2BGI [-q] [-d BGI Directory] [-u UserBGIDrv.Mode] [-z ZoomFactor] [-b]
[-h] GifFile
If no GifFile is given, Gif2BGI will try to read stdin for GIF file.
Memory required:
----------------
Screen.
Options:
--------
1. [-q] : quite mode. Default off on MSDOS, on on unix. Controls printout
of running scan lines. Use -q- to turn off.
2. [-d BGI Directory] : Where should we look for default drivers (as supplied
by Borland). For example '-d c:/tc/bgi'.
3. [-u UserBGIDrv.Mode] : Specifies user defined BGI driver. If for example
you have a BGI driver for your special vga called MYVGA.BGI and you want
to run it in mode 2 then type '-u c:/tc/bgi/myvga.2'. Note the absolute
path to the driver must be specified. Also note that we use '/' and not
'\' so they would not be treated as options.
4. [-z ZoomFactor] : Sets zoom factor of the image. Zoom factor should be
power of 2 up to 256. Default is 1 (no zoom).
5. [-h] : print one command line help, similar to Usage above.
Interactive mode:
-----------------
Once the image is displayed, the program goes into interactive mode
which recognizes the following commands:
1. C - get Color and Position.
In this sub menu, a cursor appears, and the Color of the pixel the cursor
is on, with its position in GIF file screen are printed. The 4 arrows may
be used (shifted for faster movement) to move the cursor. Any other key will
abort this sub mode.
2. D - Zoom Down by factor of 2 unless current zoom factor is 1.
3. R - Redraw the image.
4. S - print Status of image and program.
5. U - Zoom Up by factor of 2 unless current zoom factor is 256.
6. 4 arrow keys can be used to pan to the desire direction, if the image
overflow to that direction. If, on the other hand, the image fit into the
Hercules device, arrow keys are ignored. The panning steps are 1/2 screen if
not on image end.
7. ' ' - Space bar may be used to abort current image drawing.
8. ESC - Escape key may be used to abort the program.
Notes:
------
As no color quantization is used in this program if a GIF image has more
colors than the BGI driver support, this program will abort.
This driver is optimized for drivers with one byte per pixel (256 colors)
and will run MUCH faster in these cases.
Bugs:
-----
For some reason I could not figure out on my ATI wonder card, int 10h call
10h (AH = AL = 10h) to set the color registers sometimes result with wrong
colors. Direct access of the card registers gives correct results. I dont do
that to make this program portable but if your driver gives wrong colors it
is probably because it is using this bios call. Any one has anything to add?

62
G/DOC/GIF2EPSN.DOC Normal file
View File

@ -0,0 +1,62 @@
Gif2Epsn
--------
Program to dump images saved as GIF files on Epson type printers.
Usage:
------
Usage: Gif2Epsn [-q] [-d DitherSize] [-t BWThreshold] [-m Mapping] [-i] [-n]
[-p PrinterName] [-h] GifFile
If no GifFile is given, Gif2Epsn will try to read stdin for GIF file.
Memory required:
----------------
Screen.
Options:
--------
1. [-q] : quite mode. Default off on MSDOS, on on unix. Controls printout
of running scan lines. Use -q- to turn off.
2. [-d DitherSize] : Sets size of dithering matrix, where DitherSize can be
2,3 or 4 only (for 2x2, 3x3 and 4x4 dithering matrices). Default is 2.
Note image will be displayed in this mode only if Mapping (see -m)
selected this mode.
3. [-t BWThreshold] : Sets threshold level for B&W mapping in percent.
This threshold level is used in the different mappings as selected via -m.
Default is 19%.
4. [-m mapping] : Select method to map colors to B&W. Mapping can be:
0 : Every none background color is considered foreground (white color but
is drawn as black by printer, unless -i is specified).
1 : 0.3 * RED + 0.59 * GREEN + 0.11 * YELLOW > BWThreshold is considered
white color.
2 : Colors are mapped as in 1, and use dithering of size as defined using
-d option. BWthreshold is used here as scaler.
Default is option 0.
5. [-i] : Invert the image, i.e. black -> white, white -> black.
6. [-n] : Nicer image. Uses double density feature of Epson printer, to make
nicer result. This takes more time (and kill your ink cartridge
faster...) but results are usually better.
7. [-p PrinterName] : by default output is sent to LPT1:. If other device
or disk file is required, they should be specified here. Note
devices are NOT specifed with colon, so to use LPT2: instead:
'-p lpt2' is required. Nothing is sent to stdout. If a disk file is
created: '-p file1.eps' then it can be printed any time by the
copy command: 'copy file1.eps prn:/b'. Note the /b for binary copy.
8. [-h] : print one command line help, similar to Usage above.
Notes:
------
The output has aspect ratio of 1, so square image, will be square in its
hardcopy as well.
The widest image can be printed is 640 pixels, on 8 inches paper. You
probably will need to flip wider images, if height is less than that:
'gifflip -r x29.gif | gif2epsn'. Wider images will be clipped.
This utility dumps output to a file/printer directly. I guess it will have
only a limited usage on unix system...

82
G/DOC/GIF2HERC.DOC Normal file
View File

@ -0,0 +1,82 @@
Gif2Herc
--------
Program to display images saved as GIF files on IBM PC Hercules graphic card.
The program has few stages as follows:
1. Reads GIF file header and determines size of it.
2. Dynamically allocate enough memory to hold all the image internally.
One byte per pixel is always allocated, so a little bit more than
width*height (of screen, not image) bytes are required.
3. Reads all the image in. Interlaced images are read correctly in, although
they are displayed sequentially.
4. Display first image using the defaults as set by the command line option.
5. Goes to interactive mode. For full description of the interactive mode
see below
Usage:
------
Gif2Herc [-q] [-d DitherSize] [-z ZoomFactor] [-t BWThreshold] [-m Mapping]
[-i] [-b] [-h] GifFile
If no GifFile is given, Gif2Herc will try to read stdin for GIF file.
Memory required:
----------------
Screen.
Options:
--------
1. [-q] : quite mode. Default off on MSDOS, on on unix. Controls printout
of running scan lines. Use -q- to turn off.
2. [-d DitherSize] : Sets size of dithering matrix, where DitherSize can be
2,3 or 4 only (for 2x2, 3x3 and 4x4 dithering matrices). Default is 2.
Note image will be displayed in this mode only if Mapping (see -m)
selected this mode.
3. [-z ZoomFactor] : Sets zoom factor of the image. Zoom factor should be
power of 2 up to 256. Default is 1 (no zoom).
4. [-t BWThreshold] : Sets threshold level for B&W mapping in percent.
This threshold level is used in the different mappings as selected via -m.
Default is 19%.
5. [-m mapping] : Select method to map colors to B&W. Mapping can be:
0 : Every none background color is considered foreground (white).
1 : 0.3 * RED + 0.59 * GREEN + 0.11 * YELLOW > BWThreshold is considered
white.
2 : Colors are mapped as in 1, and use dithering of size as defined using
-d option. BWthreshold is used here as scaler.
Default is option 0 which is much faster than the other two.
6. [-i] : Invert the image, i.e. black -> white, white -> black.
7. [-b] : Disable beeps. Every time image is complete, or wrong key was
presses, sound is generated. -b disables that.
8. [-h] : print one command line help, similar to Usage above.
Interactive mode:
-----------------
Once the image is displayed, the program goes into interactive mode
which recognizes the following commands:
1. C - get Color and Position.
In this sub menu, a cursor appears, and the Color of the pixel the cursor
is on, with its position in GIF file screen are printed. The 4 arrows may
be used (shifted for faster movement) to move the cursor. Any other key will
abort this sub mode.
2. D - Zoom Down by factor of 2 unless current zoom factor is 1.
3. H - Increase dither matrix size, unless current size is maximum (4), were
size is set to minimum (2).
4. I - Invert the image, i.e. white -> black, black -> white.
5. M - increase Color -> BW mapping method, unless current method is maximum
(2), were method is set to minimum (0).
6. R - Redraw the image.
7. S - print Status of image and program.
8. U - Zoom Up by factor of 2 unless current zoom factor is 256.
9. 4 arrow keys can be used to pan to the desire direction, if the image
overflow to that direction. If, on the other hand, the image fit into the
Hercules device, arrow keys are ignored. The panning steps are 1/2 screen if
not on image end.
9. ' ' - Space bar may be used to abort current image drawing.
10. ESC - Escape key may be used to abort the program.

30
G/DOC/GIF2IRIS.DOC Normal file
View File

@ -0,0 +1,30 @@
Gif2Iris
--------
Program to display images saved as GIF files under SGI NeWs window system.
Usage:
------
Gif2Iris [-q] [-f] [-p PosX PosY] [-f] [-h] GifFile
If no GifFile is given, Gif2Iris will try to read stdin for GIF file.
Memory required:
----------------
Screen.
Options:
--------
1. [-q] : quite mode. Default off on MSDOS, on on unix. Controls printout
of running scan lines. Use -q- to turn off.
4. [-f] : Force Gif2Iris to stay in foreground.
2. [-p PosX PosY] : defines position of image on screen. By default the
program will prompt for position.
5. [-h] : print one command line help, similar to Usage above.

42
G/DOC/GIF2PS.DOC Normal file
View File

@ -0,0 +1,42 @@
Gif2PS
------
Program to print GIF file on later printers supporting Postscript.
Usage:
------
Usage: Gif2PS [-q] [-x] [-y] [-s SizeX SizeY] [-p PosX PosY] [-i]
[-n #Copies] [-h] GifFile
If no GifFile is given, Gif2PS will try to read stdin for GIF file.
Memory required:
----------------
Line.
Options:
--------
1. [-q] : quite mode. Default off on MSDOS, on on unix. Controls printout
of running scan lines. Use -q- to turn off.
2. [-x] : Force image to be horizontal. By default image will be positioned
so it will be the biggest. If -x then image will be scaled to be biggest
possible horizontally.
3. [-y] : Same as -x but vertically.
4. [-s SizeX SizeY] : Force image size to be SizeX by SizeY inches.
If image will exit page dimensions, it will scream and die.
Page dimensions are 8.5 by 11.0 inches but only 7.5 by 9.0 are assumed to
be printable.
5. [-p PosX PosY] : Force image lower left corner to be as PosX PosY.
If image will exit page dimensions, it will scream and die.
6. [-i] : Image will be inverted (Black -> White and vice versa).
Mapping from colors is done by 0.3 * RED + 0.59 * GREEN + 0.11 * BLUE
and sometimes inverting the image will look better.
7. [-n #Copies] : Number of copies to print. 1 by default.
8. [-h] : print one command line help, similar to Usage above.

36
G/DOC/GIF2RGB.DOC Normal file
View File

@ -0,0 +1,36 @@
Gif2RGB
-------
Program to convert images saved as GIF to 24 bits RGB image(s).
Usage:
------
Usage: Gif2RGB [-q] [-1] [-o OutFileName] [-h] GifFile
If no GifFile is given, Gif2RGB will try to read stdin for GIF file.
Memory required:
----------------
Screen.
Options:
--------
1. [-q] : quite mode. Default off on MSDOS, on on unix. Controls printout
of running scan lines. Use -q- to turn off.2
2. [-1] : Only one file in the format of RGBRGB... triplates (Each of R, G, B
is a byte) is being written. This file size is 3 * Width * Height.
If stdout is used for output, this option is implicitly applied.
The default (if not '-1') is 3 files with the names OutFileName.R,
OutFileName.G, OutFileName.B, each of which is Width * Height bytes.
3. [-o OutFileName] : specifies the name of the out file (see also '-1'
above).
3. [-h] : print one command line help, similar to Usage above.
Notes:
------

33
G/DOC/GIF2RLE.DOC Normal file
View File

@ -0,0 +1,33 @@
Gif2Rle
-------
Program to convert images saved as GIF to RLE (utah raster toolkit) format.
Usage:
------
Usage: Gif2Rle [-q] [-a] [-h] GifFile
If no GifFile is given, Gif2Rle will try to read stdin for GIF file.
Memory required:
----------------
Screen.
Options:
--------
1. [-q] : quite mode. Default off on MSDOS, on on unix. Controls printout
of running scan lines. Use -q- to turn off.
2. [-a] : Add alpha channel (see rle document) to the output data file.n
3. [-h] : print one command line help, similar to Usage above.
Notes:
------
This routine must be linked with the rle toolkit library librle.a.
As you want to convert images to RLE format, it is reasonable to assume you
have this library available...

37
G/DOC/GIF2X11.DOC Normal file
View File

@ -0,0 +1,37 @@
Gif2X11
--------
Program to display images saved as GIF files under X window system.
Usage:
------
Gif2X11 [-q] [-p PosX PosY] [-d Display] [-f] [-h] GifFile
If no GifFile is given, Gif2X11 will try to read stdin for GIF file.
Note no support exists for setting this program option through X data base
(i.e .Xdefaults)
Memory required:
----------------
Screen.
Options:
--------
1. [-q] : quite mode. Default off on MSDOS, on on unix. Controls printout
of running scan lines. Use -q- to turn off.
2. [-p PosX PosY] : set the position of image on screen. By default the
program will prompt for position.
3. [-d Display] : what server should be connect to.
4. Force attempt to allocate exact colors. This usually will result with
very wrong image if not enough colors can be allocated as the rest of
them will be approximated to the closest one. By default the list bits
of the colors are stripped until success (in allocation) which looks much
better.
5. [-h] : print one command line help, similar to Usage above.

35
G/DOC/GIFASM.DOC Normal file
View File

@ -0,0 +1,35 @@
GifAsm
------
Program to assemble few GIF files into one, or disassemble single GIF file
with multiple images into single image files.
Usage:
------
Usage: GifAsm [-q] [-a] [-d OutFileName] [-h] GifFile(s)
If no GifFile is given, GifAsm will try to read stdin for GIF file, if
in disassembly mode only (-d).
Memory required:
----------------
Line.
Options:
--------
1. [-q] : quite mode. Default off on MSDOS, on on unix. Controls printout
of running scan lines. Use -q- to turn off.
2. [-a] : Assemble. This is the default, and the GifFile(s) are assembled to
stdout. Note the screen descriptor (including screen color map) is taken
from the first file, while other screen descriptors are ignored.
As this mode requires at list 2 GIF files as input, no attempt will be
made to read stdin if none specified on command line.
3. [-d OutFileName] : Disassmble GifFile (if specified on command line) or
stdin, into several files of the form OutFileNameXX, where XX are two
decimal digits. Obviously up to 100 files can be generated this way.
Note in this mode nothing is sent to stdout.
4. [-h] : print one command line help, similar to Usage above.

53
G/DOC/GIFBG.DOC Normal file
View File

@ -0,0 +1,53 @@
GifBG
-----
Program to generate Back Ground with optionally gradually changing intensity
in any of the basic 8 directions, as a GIF file.
Usage:
------
Usage: GifBG [-q] [-d Dir] [-l #Lvls] [-c R G B] [-m MinI] [-M MaxI]
[-s W H] [-h]
GifBG reads no input, and will dump the created GIF file to stdout.
Memory required:
----------------
Line.
Options:
--------
1. [-q] : quite mode. Default off on MSDOS, on on unix. Controls printout
of running scan lines. Use -q- to turn off.
2. [-d Dir] : select direction the intensity of the background should increase.
Direction can be one of the 8 principle directions:
"T" - for Top "TR" - for Top Right
"R" - for Right "BR" - for Bottom Right
"B" - for Bottom "BL" - for Bottom Left
"L" - for left "TL" - for Top Left
The compass directions may be use as synonym for the above directions, so
for example "NE" is equal to "TR".
Direction is case insensitive.
Default direction is Top (North).
3. [-l #Lvls] : Number of levels the color is going to be scaled to.
Default is 16.
4. [-c R G B] : The color to use as the primary back ground color to scale.
This color is scaled between the minimum intensity (MinI) and maximum
intensity (MaxI) from one end of the screen to the end as defined by Dir.
see below (-m & -M) for MinI & MaxI. Default is Blue (0, 0, 255).
5. [-m MinI] : Minimum intensity (in percent) to scale color. Default 10%
6. [-M MaxI] : Maximum intensity (in percent) to scale color. Default 100%
7. [-s W H] : Size of image to create. Default 640 by 350.
8. [-h] : print one command line help, similar to Usage above.
Notes:
------
If MinI == MaxI = 100 (%) and #Lvls == 2 then boolean mask image of specified
size will be created - all forground. This can be used as a square mask for
gifcomb utility.


40
G/DOC/GIFCLIP.DOC Normal file
View File

@ -0,0 +1,40 @@
GifClip
-------
Program to clip images in GIF files. Only one image in GIF file can be modified
at a time. Neither image relative position to screen, nor screen sizes are
modified (use GifPos for that).
Usage:
------
Usage: GifClip [-q] [-i Xmin Ymin Xmax Ymax] [-n n Xmin Ymin Xmax Ymax] [-h]
GifFile
If no GifFile is given, GifClip will try to read stdin for GIF file.
Memory required:
----------------
Line.
Options:
--------
1. [-q] : quite mode. Default off on MSDOS, on on unix. Controls printout
of running scan lines. Use -q- to turn off.
2. [-i Xmin Ymin Xmax Ymax] : Clip first image to the dimensions as specified
by the 4 coordinates (Xmin Ymin Xmax Ymax) of a box clipping region.
For example: '-i 11 22 33 44' will crop the box from top left [11,22]
to bottom right [33,44] out of the first image.
If the first parameter is bigger than third one (Xmin > Xmax) - they are
swapped. Same for Y.
Dimensions of cropped image must be confined to original image width and
height. Note the clipped image include both min & max boundry, and image
of width W can have coordinates 0 to W-1 (zero based).
Only one of -i or -n can be specified.
3. [-n n Xmin Ymin Xmax Ymax] : same as -i above but for the nth image:
'-n 1 11 22 33 44' is exactly the same as the example in -i. Only one of
-i or -n can be specified.
4. [-h] : print one command line help, similar to Usage above.

38
G/DOC/GIFCLRMP.DOC Normal file
View File

@ -0,0 +1,38 @@
GifCrlMp
--------
Program to modify GIF image colormaps. Any specific image in GIF file can
be modified at a time, or the global screen one.
Usage:
------
Usage: GifClrMp [-q] [-s] [-l ColorMapFile] [-g Gamma] [-i Image#] [-h]
GifFile
If no GifFile is given, GifClip will try to read stdin for GIF file.
Memory required:
----------------
Line.
Options:
--------
1. [-q] : quite mode. Default off on MSDOS, on on unix. Controls printout
of running scan lines. Use -q- to turn off.
2. [-s] : Select the global screen color map.
3. [-l ColorMapFile] : load color map from this file instead of select color
map.
4. [-g Gamma] : Apply gamma correction to selected color map.
5. [-i Image#] : Select the i image color map.
6. [-h] : print one command line help, similar to Usage above.
Notes
-----
1. Default operation is to dump out the selected color map in text format.
2. The file to load/dump is simply one color map entry per line. Each such
entry line has four integers: "ColorIndex Red Green Blue", where color
index is in ascending order starting from 1.

34
G/DOC/GIFCOMB.DOC Normal file
View File

@ -0,0 +1,34 @@
GifComb
-------
Program to combine 2 GIF images of exactly same size, into one. The color maps
are merged and the result should not exceed 256 colors. A boolean mask GIF
file can be used to set which pixel from two images to use each location.
Otherwise any background color from first image is converted to second image
color at that point. Only first image of each file is combined, which again
all file first images must be of exactly the same size.
Usage:
------
Usage: GifComb [-q] [-m MaskGIFFile] [-h] GifFiles
Two GIF files must be specified although the mask GIF file is optional.
Memory required:
----------------
Line.
Options:
--------
1. [-q] : quite mode. Default off on MSDOS, on on unix. Controls printout
of running scan lines. Use -q- to turn off.
2. [-m MaskGIFFile] : the MaskGIFfile can be regular GIF file whose first
image has same dimensions as the combined images. Any non background color
in it will select Image 1 Pixel to output, otherwise Image2 pixel will be
selected. Usually this image will be boolean (two colors only) but does
not have to be!
3. [-h] : print one command line help, similar to Usage above.

26
G/DOC/GIFFIX.DOC Normal file
View File

@ -0,0 +1,26 @@
GifFix
------
Program to attempt and fix broken GIF images.
Currently will "fix" images terminated prematurely by filling the rest of
the image with the darkest color found in image.
Usage:
------
Usage: GifFix [-q] [-h] GifFile
If no GifFile is given, GifFix will try to read stdin for GIF file.
Memory required:
----------------
Line.
Options:
--------
1. [-q] : quite mode. Default off on MSDOS, on on unix. Controls printout
of running scan lines. Use -q- to turn off.
2. [-h] : print one command line help, similar to Usage above.

32
G/DOC/GIFFLIP.DOC Normal file
View File

@ -0,0 +1,32 @@
GifFlip
-------
Program to flip (mirror) GIF file along X or Y axes, or rotate the GIF
file 90 degrees to the left or to the right
Usage:
------
Usage: GifFlip [-q] [-r] [-l] [-x] [-y] [-h] GifFile
If no GifFile is given, GifFlip will try to read stdin for GIF file.
Memory required:
----------------
Image.
Options:
--------
1. [-q] : quite mode. Default off on MSDOS, on on unix. Controls printout
of running scan lines. Use -q- to turn off.
2. [-r] : Rotate the GIF file to the right.
3. [-l] : Rotate the GIF file to the left.
4. [-x] : mirror the GIF file along X axis. Very useful if GIF file was
created from another format in with the first line in at image bottom.
Effectively flips first row with last.
5. [-y] : mirror the GIF file along Y axis.
Effectively flips first column with last.
6. [-h] : print one command line help, similar to Usage above.

43
G/DOC/GIFHISTO.DOC Normal file
View File

@ -0,0 +1,43 @@
GifHisto
--------
Program to create histogram of number of pixels using each color. Output
can be formated into a GIF histogram file, or text file - both goes to
stdout.
Usage:
------
Usage: GifHisto [-q] [-t] [-s Width Height] [-n ImageNumber] [-b] [-h] GifFile
If no GifFile is given, GifHisto will try to read stdin for GIF file.
Memory required:
----------------
Line.
Options:
--------
1. [-q] : quite mode. Default off on MSDOS, on on unix. Controls printout
of running scan lines. Use -q- to turn off.
2. [-t] : Force output to be text file of the form: Size of colormap lines
each contains two integers: number of times color appeared, and color
index. This in increasing color index order. This output can be fed
directly to msdos SORT program if number of times color appears ordering
is desired.
The colrmap picked is the one to be used for the image to generate
histogram for, as defined in GIF format.
3. [-s Width Height] : Size of GIF histogram file. The Height of the
histogram should be power of 2 dividable by number of colors in colormap.
Width sets the resolution (accuracy if you like) of the histogram as
the maximum histogram bar is scaled to fit it.
4. [-n ImageNumber] : Image number to test. Default is one.
5. [-b] : Zeros the background color count. As only linear scale bars is
supported and usually the background appears much more times then rest
of colors, deleting back ground count will improve the scaling of other
colors.
6. [-h] : print one command line help, similar to Usage above.

28
G/DOC/GIFINTER.DOC Normal file
View File

@ -0,0 +1,28 @@
GifInter
--------
Program to convert between interlaced and non interlaced images in GIF file.
Usage:
------
Usage: GifInter [-q] [-i] [-s] [-h] GifFile
If no GifFile is given, GifInter will try to read stdin for GIF file.
Memory required:
----------------
Image.
Options:
--------
1. [-q] : quite mode. Default off on MSDOS, on on unix. Controls printout
of running scan lines. Use -q- to turn off.
2. [-i] : Force all images in GIF file be interlaced.
3. [-s] : Force all images in GIF file be sequencial (default).
4. [-h] : print one command line help, similar to Usage above.

32
G/DOC/GIFINTO.DOC Normal file
View File

@ -0,0 +1,32 @@
GifInto
-------
Program to save stdin into a file with given name, iff the result file has
size bigger than specified (see below). This can be used to save result in
same files name we started a chain of pipes.
Usage:
------
Usage: GifInto [-q] [-s MinFileSize] [-h] GifFile
GifInto always read from stdin for GIF file.
Memory required:
----------------
Line.
Options:
--------
1. [-q] : quite mode. Default off on MSDOS, on on unix. Controls printout
of running scan lines. Use -q- to turn off.
2. [-s MinFileSize] : If file is less than MinFileSize, it is deleted and
not renamed to given name. This will prevent from killing the file we
start with along the pipe, if result is empty file, or none complete.
The default for file size is 14 bytes which is 1 bigger than GIF file
stamp (6 bytes) and GIF file screen descriptor (7 bytes), so GIF file with
only GIF stamp and screen descriptor will not be renamed.
3. [-h] : print one command line help, similar to Usage above.

33
G/DOC/GIFPOS.DOC Normal file
View File

@ -0,0 +1,33 @@
GifPos
------
Program to change GIF screen size and reposition images. No test is made to
make sure changes will generate valid GIF files (i.e. images are still
confined to screen etc.)
Usage:
------
Usage: GifPos [-q] [-s Width Height] [-i Left Top] [-n n Left Top] [-h] GifFile
If no GifFile is given, GifPos will try to read stdin for GIF file.
Memory required:
----------------
Line.
Options:
--------
1. [-q] : quite mode. Default off on MSDOS, on on unix. Controls printout
of running scan lines. Use -q- to turn off.
2. [-s Width Height] : set the new screen dimensions, so for example
'-s 1000 800' will set screen to width of 1000 and height of 800.
3. [-i Left Top] : set image relative to screen position, so for example
'-i 100 80' will set image left position to 100 and top position to 80.
This sets the position of the first image only.
4. [-n n Left Top] : set image n relative to screen position, so for
example '-n 3 100 80' will set the third image position as in 2.
5. [-h] : print one command line help, similar to Usage above.

40
G/DOC/GIFROTAT.DOC Normal file
View File

@ -0,0 +1,40 @@
GifRotat
--------
Program to rotate a gif image by an arbitrary angle.
Usage:
------
Usage: GifRotat -a Angle [-q] [-s Width Height] [-h] GifFile
If no GifFile is given, GifRotat will try to read stdin for GIF file.
Memory required:
----------------
Screen (of source image).
Options:
--------
1. -a Angle : Specifies the angle to rotate in degrees with respect to
the X (horizontal) axis.
2. [-q] : quite mode. Default off on MSDOS, on on unix. Controls printout
of running scan lines. Use -q- to turn off.2
3. [-s Width Height] : Since rotated image will have the same image size as
original, some parts of the image will by clipped out and lost. By
specifing a (bigger) size explicitly using the '-s' option, these parts
may be saved.
3. [-h] : print one command line help, similar to Usage above.
Notes:
------
Image is rotated around its center. No filtering is performed on the output
which have identical color map as the input. This is mainly since filtering
will require color quantization which is very memory/time intensive and
out of MSDOS memory limits even for small images.

33
G/DOC/GIFRSIZE.DOC Normal file
View File

@ -0,0 +1,33 @@
GifRSize
--------
Program to resize image size by integer factor, using bits deleting (scaling
down) and bits duplication (scaling up).
Usage:
------
Usage: GifRSize [-q] [-S X Y] [-s Scale] [-x XScale] [-y YScale] [-h] GifFile
If no GifFile is given, GifRSize will try to read stdin for GIF file.
Memory required:
----------------
Line.
Options:
--------
1. [-q] : quite mode. Default off on MSDOS, on on unix. Controls printout
of running scan lines. Use -q- to turn off.
2. [-S X Y] : specifies the exact screen dimension of the output GIF.
2. [-s Scale] : Set scaling factor for both x & y direction to Scale.
Default is 0.5. Note this is a floating point number.
3. [-x XScale] : Set scaling factor for x direction to Scale. Default is 0.5.
Note this is a floating point number.
4. [-y YScale] : Set scaling factor for y direction to Scale. Default is 0.5.
Note this is a floating point number.
7. [-h] : print one command line help, similar to Usage above.

41
G/DOC/GIFTEXT.DOC Normal file
View File

@ -0,0 +1,41 @@
GifText
-------
Program to print (text only) general information about GIF file
Usage:
------
Usage: GifText [-q] [-c] [-e] [-z] [-p] [-r] [-h] GifFile
If no GifFile is given, GifText will try to read stdin for GIF file.
As giftext can generate huge amount of data, ^C will kill it, but 'q' will
stop only the printing (of one of -e, -z, -p), while file integrity will still
be checked.
Memory required:
----------------
Line.
Options:
--------
1. [-q] : quite mode. Default off on MSDOS, on on unix. Controls printout
of running scan lines. Use -q- to turn off.
2. [-c] : Dumps also color maps.
3. [-e] : Dumps also encoded bytes - the pixels after compressed using LZ
algorithm and chained to form bytes. This is the form the data is saved
in the GIF file. Dumps in hex - 2 digit per byte.
4. [-z] : Dumps also the LZ codes of the image. Dumps in hex - 3 digits per
code (as we are limited to 12 bits).
5. [-p] : Dumps aslo the pixels of the image. Dumps in hex - 2 digit per
pixel (<=byte).
6. [-r] : Dumps raw pixels as one byte per pixel. This option inhibit all other
options and only the pixels are dumped. This option may be used to convert
gif file into raw data. Note the color map can be extracted by gifclrmp
utility. If more than one image exists, all images will be dumped in order.
7. [-h] : print one command line help, similar to Usage above.

32
G/DOC/GIFWEDGE.DOC Normal file
View File

@ -0,0 +1,32 @@
GifWedge
--------
Program to create a test GIF image with intensity levels of the RGB colors
YCM colors and white.
Usage:
------
Usage: GifWedge [-q] [-l #Lvls] [-s SizeX SizeY] [-h]
Memory required:
----------------
Line.
Options:
--------
1. [-q] : quite mode. Default off on MSDOS, on on unix. Controls printout
of running scan lines. Use -q- to turn off.
2. [-l #Lvls] : Set number of intensity levels per color. This number must be
power of two up to 32 as Gif format can only have 256 color simultanuously
and 7 basic colors are to be displayed.
3. [-s SizeX SizeY] : Force image size to be SizeX by SizeY pixels.
Image size will be rounded down to be a multiple of number of intensities
horizontally, and 7 (colors) vertically.
4. [-h] : print one command line help, similar to Usage above.

477
G/DOC/GIF_LIB.DOC Normal file
View File

@ -0,0 +1,477 @@
GIF library document
--------------------
Gershon Elber, May 1991
-----------------------
Version 1.2
-----------
The Graphics Interchange Format(c) is the Copyright property of
CompuServe Incorporated. GIF(sm) is a Service Mark property of CompuServe
Incorporated.
This library was written once I didnt find anything similar and I
wanted one. I was inspired from the rle Utah tool kit, which I hoped to port
to an IBM PC, but found it to be too machine specific, and its compression
ratio too low. I compromised on the GIF format while I am not sure how long
8 bits per pixel will be enough.
This document explains the GIF library kernel on directory GIF/LIB.
The kernel is built to the gif_libl.lib which is used in all the utilities
on GIF/UTIL, or can be used in any application needs to read/write GIF file
format. This document does NOT explain the GIF file format and assumes it
is known, at list to the level of the GIF file structure.
When a GIF file is opened, a GIF file descriptor is maintained which
is a pointer to GifFileType structure as follows:
typedef struct GifFileType {
int SWidth, SHeight, /* Screen dimensions */
SColorResolution, SBitsPerPixel; /* How many colors can we generate? */
SBackGroundColor, /* I hope you understand this one... */
ILeft, ITop, IWidth, IHeight, /* Current image dimensions */
IInterlace, /* Sequential/Interlaced lines */
IBitsPerPixel; /* How many colors this image has? */
GifColorType *SColorMap, *IColorMap; /* NULL if not exists */
void *Private; /* The regular user should not mess with this one! */
} GifFileType;
This structure was copied from gif_lib.h - the header file for the GIF
library. Any application program that uses the gif_libl.lib library should
include it. All items begin with S refer to GIF Screen, while the ones with I
to current image (note GIF file may have more than one image). The user NEVER
writes into this structure, but can read any of these items at any time it is
proper (image information is invalid until first image was read/write).
As the library needs to save its own internal data also, a Private
pointer to internal structure is also saved there. Applications should ignore
this item.
The library has no static data. This means that it is fully reentrant
and any number of GIF files (up to memory limits) can be opened for
read/write. Instead of the static data, internal structure pointed by the
Private pointer is used.
The library do allocates its own memory dynamically, on opening of
file, and releases that once closed. The user is NEVER requires to allocate
any memory for any of the functions of this library (unless the provided
parameters, such as image line, were prefered to be allocated dynammically by
the user) nor to free them directly. In order to reduce disk access, the file
buffer is increased to FILE_BUFFER_SIZE (defined in gif_lib.h). The library
was compiled in large model as the memory allocated per file is quite big:
about 17k for decoding (DGIF_LIB.C), and 32k for encoding (EGIF_LIB.C),
excluding the FILE_BUFFER_SIZE.
We now can see what the library contains (directory GIF/LIB):
1. EGIF_LIB.C - Encoding routines, all prefixed with E.
2. DGIF_LIB.C - Decoding routines, all prefixed with D.
3. DEV2GIF.C - Routines to convert specific device buffers into GIF files.
4. GIF_ERR.C - Error handler for the library.
The library has fifth hashing table file in which is accessed internally
only.
Major part of the routines returns ERROR (see gif_lib.h) if something went
wrong or OK otherwise. Once ERROR received, GIF_ERR.C module can be used to
do something about it.
In addition a module to scan the command line arguments was added.
This module is called GETARG.C and its headers are in GETARG.H. see header
of GETARG.C for details on its usage.
ENCODING (EGIF_LIB.C)
---------------------
GifFileType *EGifOpenFileName(char *GifFileName, int GifTestExistance);
Open a new GIF file using the given GifFileName. If GifTestExistance
is TRUE, and file exists, the file is not destroyed, and NULL returned.
If any error occurs, NULL is returned and Error handler can be used
to get the exact error (see GIF_ERR.C).
The file is opened in binary mode, and its buffer size is set to
FILE_BUFFER_SIZE bytes.
GifFileType *EGifOpenFileHandle(int GifFileHandle);
Open a new GIF file using the given GifFileHandle
If any error occurs, NULL is returned and Error handler can be used
to get the exact error (see GIF_ERR.C)
The file is opened in binary mode, and its buffer size is set to
FILE_BUFFER_SIZE bytes.
void EGifSetGifVersion(char *Version);
Sets the GIF version of all files to be open from this point (until
another call to this routine is made. Version is a 3 characters
string of the form "87a" or "89a". No test is made to validate this
string.
int EGifPutScreenDesc(GifFileType *GifFile,
int GifWidth, int GifHeight, int GifColorRes, int GifBackGround,
int GifBitsPerPixel, GifColorType *GifColorMap);
Update GifFile Screen parameters, in GifFile structure and in real
file. if error occurs returns ERROR (see gif_lib.h), otherwise OK.
This routine should be called immediately after the GIF file was
opened.
int EGifPutImageDesc(GifFileType *GifFile,
int GifLeft, int GifTop, int Width, int GifHeight, int GifInterlace,
int GifBitsPerPixel, GifColorType *GifColorMap);
Update GifFile Image parameters, in GifFile structure and in real
file. if error occurs returns ERROR (see gif_lib.h), otherwise OK.
This routine should be called each time a new image should be
dumped to the file.
int EGifPutLine(GifFileType *GifFile, PixelType *GifLine, int GifLineLen);
Dumps block of pixels out to the GIF file. The line length can be
of any length. More than that, this routine may be interleaved with
EGifPutPixel, until all pixels were sent.
Returns ERROR if something went wrong, OK otherwise.
int EGifPutPixel(GifFileType *GifFile, PixelType GifPixel);
Dumps one pixel to the GIF file. This routine may be interleaved
with EGifPutLine, until all pixels were sent. Because of the overhead
per each call, the usage of this routine is not recommended.
Returns ERROR if something went wrong, OK otherwise.
int EGifPutComment(GifFileType *GifFile, char *GifComment);
Uses extension GIF records to save a string as a comment is the file.
The extension code is 'C' (for Comment). This is optional in GIF file.
Returns ERROR if something went wrong, OK otherwise.
int EGifPutExtension(GifFileType *GifFile, int GifExtCode, int GifExtLen,
void *GifExtension);
Dumps the given extension block into the GIF file. Extension blocks
are optional in GIF file. Extension blocks of more than 255 bytes or
more than one block are not supported.
Returns ERROR if something went wrong, OK otherwise.
int EGifPutCode(GifFileType *GifFile, int *GifCodeSize,
ByteType **GifCodeBlock);
It sometimes may be desired to write the compressed code as is
without decoding it. For example a filter for GIF file that change
only screen size (GifPos), does not need the exact pixel values and
pipes out the compressed image as is, make this process much faster.
This routine do exactly that (with EGifPutCodeNext), and can be
used instead of EGifPutLine. This usually works with the
DGifGetCode/DgifGetCodeNext routines, which reads the compressed
code, while EGifPutCode/EGifPutCodeNext write it out. See GifPos.c
for example.
Returns ERROR if something went wrong, OK otherwise.
int EGifPutCodeNext(GifFileType *GifFile, ByteType **GifCodeBlock);
See EGifPutCode above.
int EGifCloseFile(GifFileType *GifFile);
Close GIF file and free all memory allocated for it. GifFile should
not be used, once this routine was called.
Returns ERROR if something went wrong, OK otherwise.
DECODING (DGIF_LIB.C)
---------------------
GifFileType *DGifOpenFileName(char *GifFileName);
Open a new GIF file using the given GifFileName, and read its Screen
information.
If any error occurs, NULL is returned and Error handler can be used
to get the exact error (see GIF_ERR.C).
The file is opened in binary mode, and its buffer size is set to
FILE_BUFFER_SIZE bytes.
GifFileType *DGifOpenFileHandle(int GifFileHandle);
Open a new GIF file using the given GifFileHandle, and read its
Screen information.
If any error occurs, NULL is returned and Error handler can be used
to get the exact error (see GIF_ERR.C)
The file is opened in binary mode, and its buffer size is set to
FILE_BUFFER_SIZE bytes.
int DGifGetScreenDesc(GifFileType *GifFile);
Reads the screen information into the GifFile structure. Note this
routine is automatically called once a file is opened, and therefore
usually not needed.
Returns ERROR if something went wrong, OK otherwise.
int DGifGetRecordType(GifFileType *GifFile, GifRecordType *GifType);
As the GIF file can have different records in arbitrary order, this
routine should be called once the file was open to detect the next
record type, and act upon it. Few types might be returned in GifType:
1. UndefinedRecordType - something is wrong!
2. ScreenDescRecordType - screen information. As the screen information
is automatically read in when the file is open, this usually would
not happen.
3. ImageDescRecordType - next record is Image.
4. ExtensionRecordType - next record is extension block.
5. TerminateRecordType - last record reached, can close the file.
The first Two types can usually be ignored.
Returns ERROR if something went wrong, OK otherwise.
int DGifGetImageDesc(GifFileType *GifFile);
Reads the image information into the GifFile structure.
Returns ERROR if something went wrong, OK otherwise.
int DGifGetLine(GifFileType *GifFile, PixelType *GifLine, int GifLineLen);
Load block of pixels from the GIF file. The line length can be
of any length. More than that, this routine may be interleaved with
DGifGetPixel, until all pixels were read.
Returns ERROR if something went wrong, OK otherwise.
int DGifGetPixel(GifFileType *GifFile, PixelType GifPixel);
Loads one pixel from the GIF file. This routine may be interleaved
with DGifGetLine, until all pixels were read. Because of the overhead
per each call, the usage of this routine is not recommended.
Returns ERROR if something went wrong, OK otherwise.
int DGifGetComment(GifFileType *GifFile, char *GifComment);
Load comment from the GIF file. Because DGifGetRecordType will
only tell this records is of type extension, this routine should be
called iff it is known %100 that is must be a comment.
For definition of comment, see EGifPutComment.
Returns ERROR if something went wrong, OK otherwise.
int DGifGetExtension(GifFileType *GifFile, int *GifExtCode,
ByteType **GifExtension);
Loads the given extension block from the GIF file. Extension blocks
are optional in GIF file. This routine should be follows by
DGifGetExtensionNext - see below
Returns ERROR if something went wrong, OK otherwise.
int DGifGetExtensionNext(GifFileType *GifFile, ByteType **GifExtension);
As extensions may contain more than one block, use this routine to
continue after DGifGetExtension, until *GifExtension is NULL.
Returns ERROR if something went wrong, OK otherwise.
int DGifGetCode(GifFileType *GifFile, int *GifCodeSize,
ByteType **GifCodeBlock);
It sometimes may be desired to read the compressed code as is
without decoding it. This routine do exactly that (with
DGifGetCodeNext), and can be used instead of DGifGetLine.
This compressed code information can be written out using the
EGifPutCode/EGifPutCodeNext sequence (see GifPos.c for example).
Returns ERROR if something went wrong, OK otherwise.
int DGifGetCodeNext(GifFileType *GifFile, ByteType **GifCodeBlock);
See DGifGetCode above.
int DGifGetLZCodes(GifFileType *GifFile, int *GifCode);
This routine can be called instead of DGifGetLine/DGifGetPixel or
DGifGetCode/DGifGetCodeNext to get the 12 bits LZ codes of the images.
It may be used mainly for debugging purposes (see GifText.c for
example).
Returns ERROR if something went wrong, OK otherwise.
int DGifCloseFile(GifFileType *GifFile);
Close GIF file and free all memory allocated for it. GifFile should
not be used, once this routine was called.
Returns ERROR if something went wrong, OK otherwise.
ERROR HANDLING (EGIF_LIB.C)
---------------------------
void PrintGifError(void)
Print one line diagnostic on the last gif_lib error to stderr.
int GifLastError(void)
Return last gif_lib error, and clear the error.
Note it is the user responsibility to call the file closing routine,
so the file will be closed (if was opened), and memory will be released
(if was allocated).
The different error types are defined in gif_lib.h.
DEVICE SPECIFIC (XXX2GIF.C)
---------------------------
int DumpScreen2Gif(char *FileName, int ReqGraphDriver, int ReqGraphMode1,
int ReqGraphMode2);
Dumps the whole device buffer as specified by GraphDriver and
GraphMode (as defined in TC 2.0 graphics.h) into FileName as GIF file.
Current devices supported:
1. Hercules.
2. EGA, EGA64, EGAMONO (all modes - see TC graphics.h).
3. VGA (all modes - see TC graphics.h).
4. SVGA_SPECIAL. This mode is special and not supported by Borland
graphics.h. ReqGraphDriver must be equal to 999, and ReqGraphMode
is ignored. This modes assumes 800 by 600 in 16 colors.
Returns ERROR if something went wrong, OK otherwise.
5. SGI 4D using gl graphic library - window dump.
6. X11 window dump.
COMMAND LINE PARSING (GETARG.C)
-------------------------------
int GAGetArgs(int argc, char **argv, char *CtrlStr, ...);
Main routine of this module. Given the argc & argv as received by
the main procedure, the command line CtrlStr, and the addresses of
all parameters, parse the command line, and update the parameters.
The CtrlStr defines what types of variables should follow. Look
at the beginning of getarg.c for exact usage.
Returns 0 if successful, error number (as defined by getarg.h)
otherwise.
void GAPrintErrMsg(int Error);
If error occurred in GAGetARgs, this routine may be used to print
one line diagnostic to stderr.
void GAPrintHowTo(char *CtrlStr);
Given same CtrlStr as for GAGetArgs, can be used to print a
one line 'how to use'
Skeleton of GIF filter
----------------------
This completes the functions, application can access. An application
skeleton usually will look like (assuming it is a filter - read GIF file,
modifies it, and write new GIF file) the following example, which only copy
a GIF file from stdin to stdout. Please give a pick to the utilities on the
util directory to get more idea once you fill comfortable with this skeleton.
Also try to follow the coding standards of this package if you want me to
officially add your new utility to it.
#include "getarg.h"
main(... )
{
GifFile *GifFileIn, *GifFileOut;
GAGetArgs( argc, argv, CtrlStr, ... ); /* Process command line */
/* Use the stdin as input (note this also read screen descriptor in: */
if ((GifFileIn = DGifOpenFileHandle(0)) == NULL)
QuitGifError(GifFileIn, GifFileOut);
/* Use the stdout as output: */
if ((GifFileOut = EGifOpenFileHandle(1)) == NULL)
QuitGifError(GifFileIn, GifFileOut);
/* And dump out its screen information: */
if (EGifPutScreenDesc(GifFileOut,
GifFileIn -> SWidth, GifFileIn -> SHeight,
GifFileIn -> SColorResolution, GifFileIn -> SBackGroundColor,
GifFileIn -> SBitsPerPixel, GifFileIn -> SColorMap) == ERROR)
QuitGifError(GifFileIn, GifFileOut);
/* Scan the content of the input GIF file and load the image(s) in: */
do {
if (DGifGetRecordType(GifFileIn, &RecordType) == ERROR)
QuitGifError(GifFileIn, GifFileOut);
switch (RecordType) {
case IMAGE_DESC_RECORD_TYPE:
if (DGifGetImageDesc(GifFileIn) == ERROR)
QuitGifError(GifFileIn, GifFileOut);
/* Put image descriptor to out file: */
if (EGifPutImageDesc(GifFileOut,
GifFileIn -> ILeft, GifFileIn -> ITop,
GifFileIn -> IWidth, GifFileIn -> IHeight,
GifFileIn -> IInterlace, GifFileIn -> IBitsPerPixel,
GifFileIn -> IColorMap) == ERROR)
QuitGifError(GifFileIn, GifFileOut);
/* Now read image itself in decoded form as we dont really */
/* care what we have there, and this is much faster. */
if (DGifGetCode(GifFileIn, &CodeSize, &CodeBlock) == ERROR ||
EGifPutCode(GifFileOut, CodeSize, CodeBlock) == ERROR)
QuitGifError(GifFileIn, GifFileOut);
while (CodeBlock != NULL) {
if (DGifGetCodeNext(GifFileIn, &CodeBlock) == ERROR ||
EGifPutCodeNext(GifFileOut, CodeBlock) == ERROR)
QuitGifError(GifFileIn, GifFileOut);
}
break;
case EXTENSION_RECORD_TYPE:
/* Skip any extension blocks in file: */
if (DGifGetExtension(GifFileIn, &ExtCode, &Extension) == ERROR)
QuitGifError(GifFileIn, GifFileOut);
if (EGifPutExtension(GifFileOut, ExtCode, Extension[0],
Extension) == ERROR)
QuitGifError(GifFileIn, GifFileOut);
/* No support to more than one extension blocks, so discard: */
while (Extension != NULL) {
if (DGifGetExtensionNext(GifFileIn, &Extension) == ERROR)
QuitGifError(GifFileIn, GifFileOut);
}
break;
case TERMINATE_RECORD_TYPE:
break;
default: /* Should be traps by DGifGetRecordType */
break;
}
}
while (RecordType != TERMINATE_RECORD_TYPE);
if (DGifCloseFile(GifFileIn) == ERROR)
QuitGifError(GifFileIn, GifFileOut);
if (EGifCloseFile(GifFileOut) == ERROR)
QuitGifError(GifFileIn, GifFileOut);
}
/******************************************************************************
* Close both input and output file (if open), and exit. *
******************************************************************************/
static void QuitGifError(GifFileType *GifFileIn, GifFileType *GifFileOut)
{
PrintGifError();
if (GifFileIn != NULL) DGifCloseFile(GifFileIn);
if (GifFileOut != NULL) EGifCloseFile(GifFileOut);
exit(1);
}

125
G/DOC/LIBERROR.DOC Normal file
View File

@ -0,0 +1,125 @@
GIF_LIB ERROR
-------------
Errors as reported from the GIF_LIB library are divided to 2 major parts:
the encoder (errors prefixed by E_GIF_ERR), and the decoder (errors prefixed
by D_GIF_ERR). This document explains them briefly:
Encoding errors:
----------------
1. E_GIF_ERR_OpenFailed
Message printed using PrintGifError: "Failed to open given file"
IO error result when attempt to open the given GIF file.
2. E_GIF_ERR_WriteFailed
Message printed using PrintGifError: "Failed to Write to given file"
IO error result when attempt to write to the given GIF file.
3. E_GIF_ERR_HasScrnDscr
Message printed using PrintGifError: "Screen Descriptor already been set"
Attempt to write second screen descriptor to same GIF file. GIF file should
have exactly one screen descriptor which should be set directly after the
file is opened.
4. E_GIF_ERR_HasImagDscr
Message printed using PrintGifError: "Image Descriptor is still active"
Image descriptor should be sent before and image dump, and no second
image descriptor should be sent before current image dump ended. This error
occured probably because current image was not complete.
5. E_GIF_ERR_NoColorMap
Message printed using PrintGifError: "Neither Global Nor Local color map"
An image must have either global (screen) or local (image) color map.
Neither were given in this case.
6. E_GIF_ERR_DataTooBig
Message printed using PrintGifError: "#Pixels bigger than Width * Height"
The number of pixels dumped for this image is bigger than specified by
image Height times image Width.
7. E_GIF_ERR_NotEnoughMem
Message printed using PrintGifError: "Fail to allocate required memory"
Once an attemp is made to open GIF file, special structures are allocated
to hold internal data for it. If allocation fails this error is returned.
8. E_GIF_ERR_DiskIsFull
Message printed using PrintGifError: "Write failed (disk full?)"
Writing encoded data failed.
9. E_GIF_ERR_CloseFailed
Message printed using PrintGifError: "Failed to close given file"
Closing file failed.
10. E_GIF_ERR_NotWriteable
Message printed using PrintGifError: "Given file was not opened for write"
GIF files can be opened both for read (DGIF part of library) and write
(EGIF part of library). This error occurs when a file is opened for read
(using DGIF) is given to one of the encoding (EGIF) routines.
Encoding errors:
----------------
1. D_GIF_ERR_OpenFailed
Message printed using PrintGifError: "Failed to open given file"
IO error result when attempt to open the given GIF file.
2. D_GIF_ERR_ReadFailed
Message printed using PrintGifError: "Failed to Read from given file"
IO error result when attempt to write to the given GIF file.
3. D_GIF_ERR_NotGifFile
Message printed using PrintGifError: "Given file is NOT GIF file"
GIF files should have special stamp identifies them as such, If that stamp
is not found, this error is issued.
4. D_GIF_ERR_NoScrnDscr
Message printed using PrintGifError: "No Screen Descriptor detected"
Each GIF file should have screen descriptor in its header. This error will
be generated if no such descriptor was found.
5. D_GIF_ERR_NoImagDscr
Message printed using PrintGifError: "No Image Descriptor detected"
Each image should have image descriptor in its header. This error will
be generated if no such descriptor was found.
6. D_GIF_ERR_NoColorMap
Message printed using PrintGifError: "Neither Global Nor Local color map"
An image must have either global (screen) or local (image) color map.
Neither were given in this case.
7. D_GIF_ERR_WrongRecord
Message printed using PrintGifError: "Wrong record type detected"
Each record in GIF file has special identifier, in its header. If the
record has wrong identifier, this error is generated.
8. D_GIF_ERR_DataTooBig
Message printed using PrintGifError: "#Pixels bigger than Width * Height"
The number of pixels dumped for this image is bigger than specified by
image Height times image Width.
9. D_GIF_ERR_NotEnoughMem
Message printed using PrintGifError: "Fail to allocate required memory"
Once an attemp is made to open GIF file, special structures are allocated
to hold internal data for it. If allocation fails this error is returned.
10. D_GIF_ERR_CloseFailed
Message printed using PrintGifError: "Failed to close given file"
Closing file failed.
11. D_GIF_ERR_NotReadable
Message printed using PrintGifError: "Given file was not opened for read"
GIF files can be opened both for read (DGIF part of library) and write
(EGIF part of library). This error occurs when a file is opened for write
(using EGIF) is given to one of the decoding (DGIF) routines.
12. D_GIF_ERR_ImageDefect
Message printed using PrintGifError: "Image is defective, decoding aborted"
This error is generated, once the decoding failed - probably image is
defect.
13. D_GIF_ERR_EOFTooSoon
Message printed using PrintGifError: "Image EOF detected, before image complete"
This error is generated once EOF code is detected in encoded image before
all the pixels (Width * Height) has be decoded.

36
G/DOC/RAW2GIF.DOC Normal file
View File

@ -0,0 +1,36 @@
Raw2Gif
-------
Program to convert RAW image data into GIF files. Only one image can be
handled. The RAW image file, assumes to hold one pixel color in one byte,
and therefore the file size must be Width times Height as specified by the
-s option below.
Usage:
------
Usage: Raw2Gif [-q] -s Width Height [-p ColorMapFile] [-h] RawFile
If no RawFile is given, Raw2Gif will try to read stdin for RAW data.
Gif File is dumped to stdout.
Memory required:
----------------
Line.
Options:
--------
1. [-q] : quite mode. Default off on MSDOS, on on unix. Controls printout
of running scan lines. Use -q- to turn off.
2. -s Width Height : the dimensions of the image MUST be specified in the
command line. The RAW image file size must be exactly Width times Height
bytes (each byte is one pixel color).
3. [-p ColorMapFile] : Color map to load for given RAW image. This file has
4 integers in line (ColorIndex Red Green Blue), and the ColorIndex is
in order starting from 1. See GifClrMp, which can also use/create these
bitmap files. If no color map is specified, uses the EGA 16 color pallete
as default color map.
4. [-h] : print one command line help, similar to Usage above.

39
G/DOC/RGB2GIF.DOC Normal file
View File

@ -0,0 +1,39 @@
RGB2Gif
-------
Program to convert 24 bit images to a GIF image using color quantization.
Usage:
------
Usage: RGB2Gif [-q] [-c #Colors] [-1] -s Width Height [-h] RGBFile
If no RGBFile is given, RGB2Gif will try to read stdin for GIF file.
Memory required:
----------------
Screen.
Options:
--------
1. [-q] : quite mode. Default off on MSDOS, on on unix. Controls printout
of running scan lines. Use -q- to turn off.
2. [-c #Colors] specifies number of colors to use, in bits per pixels, so
'-c 8' specifies actually 256 colors (maximum and default).
3. [-1] : Only one file in the format of RGBRGB... triplates (Each of R, G, B
is a byte) is read from input. This file size is 3 * Width * Height (see
'-s' below. If stdin is used for input, this option is implicitly applied.
The default (if not '-1') is 3 files with the names RGBFile.R, RGBFile.G,
RGBFile.B, each of which is Width * Height bytes.
4. [-s Width Height] specifies the size of the image to read.
5. [-h] : print one command line help, similar to Usage above.
Notes:
------
Due to 8088 limitation, on MSDOS, maximum image size can not exceed
64k pixels.

36
G/DOC/RLE2GIF.DOC Normal file
View File

@ -0,0 +1,36 @@
Rle2Gif
-------
Program to convert images saved as RLE (utah raster toolkit) to GIF format.
Usage:
------
Usage: Rle2Gif [-q] [-c #Colors] [-h] RleFile
If no RleFile is given, Rle2Gif will try to read stdin for Rle file.
Memory required:
----------------
Screen.
Options:
--------
1. [-q] : quite mode. Default off on MSDOS, on on unix. Controls printout
of running scan lines. Use -q- to turn off.
2. [-c #Colors] : Select size of color map in the output Gif file. #Colors
should be given as the based 2 log of number of colors. Default is 8
which is 256 colors, and which is also the maximum.
3. [-h] : print one command line help, similar to Usage above.
Notes:
------
As the RLE format allows full 24 bits per pixel (8 per primmery color)
Colors must be quantized to the number of colors as set by the [-c] option,
above. This process is quite slow. See the quantize.c file in the lib
directory for the reference for this quantization algorithm (median cut).

48
G/DOC/TEXT2GIF.DOC Normal file
View File

@ -0,0 +1,48 @@
Text2Gif
--------
Program to generate gif images out of regular text. Text can be one line
or multi line, and is converted using 8 by 8 fix font.
Usage:
------
Usage: Text2Gif [-q] [-s ClrMapSize] [-f FGClr] [-c R G B] [-t "Text"] [-h]
Text2Gif read stdin if no text is provided in the command line (-t),
and will dump the created GIF file to stdout.
Memory required:
----------------
Line.
Options:
--------
1. [-q] : quite mode. Default off on MSDOS, on on unix. Controls printout
of running scan lines. Use -q- to turn off.
2. [-s ClrMapSize] explicitly defines the size of the color map of the
resulting gif image. Usually the image will be bicolor with fg as color
1, unless [-f] is explicitly given in case the color map size will be
big enough to hold it. However it is sometimes convenient to set the
color map size to certain size while the fg color is small mainly so
this image may be merged with another (images must match color map size).
3. [-f FG] : select foreground index (background is always 0). By default
it is one and therefore the image result is bicolored.
if FG is set to n then color map will be created with 2^k entries where
2^k > n for minimum k, assuming k <= 8. This color map will be all zeros
except this forground index. This option is useful if this text image
should be integrated into other image colormap using their colors.
4. [-c R G B] : The color to use as the foreground color. While by default.
5. [-t "Text"] : in case of one line text, it can be provided on the command
line. Note you must encapsulate the Text within quotes if it has spaces
(The quotes themselves are not part of the text). If no -t option is
provided, stdin is read until end of file.
6. [-h] : print one command line help, similar to Usage above.
Notes:
------
There is a hard bound limit on the number of lines, and it is set to 100.