mcgrew@dartagnan.rutgers.edu (Charles Mcgrew) (12/12/89)
Submitted-by: everson@compsci.bristol.ac.uk Posting-number: Volume 1, Issue 87 Archive-name: alv/part03 #! /bin/sh # This is a shell archive. Remove anything before this line, then unpack # it by saving it into a file and typing "sh file". To overwrite existing # files, type "sh file -c". You can also feed this as standard input via # unshar, or by typing "sh <file", e.g.. If this archive is complete, you # will see the following message at the end: # "End of archive 3 (of 10)." # Contents: doc/man/man1/cst.1 doc/man/man1/ras8to1.1 # doc/man/man1/transform.1 doc/man/man5/alv_profile.5 # doc/philosophy.ms images/icons/cst.icon images/icons/dsp.icon # images/icons/glass.icon images/icons/hist.icon # images/icons/palette.icon images/icons/winlev8.icon # src/array2ras.c src/blend.c src/ffill.c src/hough.c src/p_panel.c # src/ras2array.c src/rasscale.c src/rasval.c # Wrapped by everson@kukini on Tue Oct 17 07:45:08 1989 PATH=/bin:/usr/bin:/usr/ucb ; export PATH if test -f 'doc/man/man1/cst.1' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'doc/man/man1/cst.1'\" else echo shar: Extracting \"'doc/man/man1/cst.1'\" \(1943 characters\) sed "s/^X//" >'doc/man/man1/cst.1' <<'END_OF_FILE' X.TH CST 1 "27th March 1989" X.SH NAME cst \- interactive contrast stretching and thresholding of an 8 bit deep raster. X.SH SYNOPSIS X.B cst X[ X.I sunview arguments X] X.SH DESCRIPTION X.I cst creates a X.I sunview (1) window allowing the user to interactively set upper and lower thresholds for every 8 bit greyscale image displayed on the screen. Pixels with values below the lower threshold are mapped to black; above the higher threshold, to white. The remaining pixels are linearly mapped to the range 1..254. The display graph shows the mapping from the pixel values (x-axis) to the lookup table values (y-axis). This is done by manipulating the workstation colourmap entries. The lookup table data may be written to a file. X.SH BUTTONS X.IP X.B Left mouse button : The cursor position when the left button is pressed sets the lower threshold. X.IP X.B Right mouse button : Sets the upper threshold. X.IP X.B Middle mouse button : Sets a pivot point. The ramp gradient is changed about the pivot point. Two different contrast stretches are applied, one each side of the pivot. X.IP X.I Reset : Click twice to reset the lookup tables and the display to their initial states. X.IP X.I Save : Writes the lookup tables out to a file called clut. X.I nnn where nnn is an incrementing number. X.IP X.I Normal/Invert : Toggles between positive and negative image displays. X.SH OPTIONS The program takes standard X.I sunview (1) arguments. X.SH FILES X.IP ~/.alv_profile Global switches and standard command line arguments for each tool. X.SH "ENVIROMENT VARIABLES" X.IP ALV If set, the pathname of an alternative profile. X.SH "SEE ALSO" X.BI alv (1) , X.BI winlev8 (1) , X.BI rasremap (1) , X.BI sunview (1) , X.BI alv_profile (5) , X.SH BUGS X.I Cst should not be able to manipulate the colourmaps of non-8-bit-deep rasters. X.SH AUTHOR Bryan Dawson, University of Keele. Based on X.I winlev8 from the ALV suite of programs by Phill Everson, University of Bristol. END_OF_FILE if test 1943 -ne `wc -c <'doc/man/man1/cst.1'`; then echo shar: \"'doc/man/man1/cst.1'\" unpacked with wrong size! fi # end of 'doc/man/man1/cst.1' fi if test -f 'doc/man/man1/ras8to1.1' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'doc/man/man1/ras8to1.1'\" else echo shar: Extracting \"'doc/man/man1/ras8to1.1'\" \(1912 characters\) sed "s/^X//" >'doc/man/man1/ras8to1.1' <<'END_OF_FILE' X.TH RAS8TO1 1 "30th March 1989" X.SH NAME ras8to1 \- map image pixel values to their lookup table values X.SH SYNOPSIS X.B ras8to1 X[ X.B -r X] X[ X.B -o X] X[ X.B -d X] X[ X.B -e X] X[ X-g X] X[ X.B "infile | -" X] X[ X.B "outfile | -" X] X.SH DESCRIPTION X.I Ras8to1 converts a 8-bit deep Sun raster file to a 1-bit deep monochrome raster file. If the image has no colourmap, then it is assumed to be greyscale. X It implements several halftone algorithms from "Digital Halftones by Dot Diffusion" in "ACM Transactions on Graphics", such as error diffusion, ordered dither and dot diffusion with and without edge enhancement. X It works on both coour and greyscale images. X.SH OPTIONS X.PP The X.B -r option specifes error diffusion. The default is to use error diffusion. X.PP The X.B -o option specifies ordered dither. The default is no ordered dither. X.PP The X.B -d option specifies dot diffusion. The default is no dot diffusion. X.PP Obviously, the above options are mutually exclusive. If more than one is specified in the program's argument list then the last is used. X.PP The X.B -e option specifies edge enhancement. The default is no edge enhancement. X.PP The X.B -g option specifies that the associated colourmap is to be overridden and the image treated as if it were a greyscale image. By default, if an image has no colourmap, then it is assumed to be greyscale otherwise the given colourmap is used. X.SH FILES X.IP ~/.alv_profile Global switches and standard command line arguments for each tool. X.SH "ENVIRONMENT VARIABLES" X.IP ALV If set, the pathname of an alternative profile. X.SH "SEE ALSO" X.BI alv (1) , X.BI rasinfo (1) , X.BI alv_profile (5) , X.BI rasterfile (5) X.SH DIAGNOSTICS X.IP "Can't open file" The file does not have the correct access permissions to the file, or it does not exist. X.SH AUTHOR Hong Min, SUNY, USA. Minor modifications by Phill Everson, University of Bristol, UK for inclusion in the ALV toolkit. END_OF_FILE if test 1912 -ne `wc -c <'doc/man/man1/ras8to1.1'`; then echo shar: \"'doc/man/man1/ras8to1.1'\" unpacked with wrong size! fi # end of 'doc/man/man1/ras8to1.1' fi if test -f 'doc/man/man1/transform.1' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'doc/man/man1/transform.1'\" else echo shar: Extracting \"'doc/man/man1/transform.1'\" \(1712 characters\) sed "s/^X//" >'doc/man/man1/transform.1' <<'END_OF_FILE' X.TH TRANSFORM 1 "15th January 1989" X.SH NAME transform \ -perform rotation / shearing on a raster X.SH SYNOPSIS X.B transform X[[ X.BI -x xcoord X] X[ X.BI -y ycoord X] X[ X.BI -a angle X]] | [[ X.BI -X x-shear X] X[ X.BI -Y y-shear X]] X[ X.B "infile | -" X] X[ X.B "outfile | -" X] X.SH DESCRIPTION X.I Transform performs either an arbitrary rotation of a raster about a point or an arbitrary shearing in either the X, Y or both dimensions. X.PP The algorithm used is to transform the start and end points of each row in the input raster into the output coordinate system and then to use Bresenham's Line Algorithm to position the pixels along the row in the output raster. X.SH OPTIONS X.PP The X.I -x and X.I -y options specify the point about which rotation is to take place. The default is (0, 0). X.PP The X.I -a option specifies the angle of rotation, in radians, with a positive angle being regarded as a clockwise rotation. The default is PI / 2. X.PP The X.I -X and X.I -Y options specify the x and y shear values respectively. Each has a default value of 0. X.SH FILES X.IP ~/.alv_profile Global switches and standard command line arguments for each tool. X.SH "ENVIROMENT VARIABLES" X.IP ALV If set, the pathname of an alternative profile. X.SH "SEE ALSO" X.BI alv(1) , X.BI alv_profile(5) , X.BI rasterfile(5) X.SH DIAGNOSTICS X.IP "Cannot rotate and shear in same invocation" The program does not support rotation and shearing in the same invocation. X.IP "mem_create returned NULL" There was insufficient memory available to allocate space for an image in memory. X.IP "Can't open file" The file does not have the correct access permissions to the file, or it does not exist. X.SH WARNING This code is still under development - do not trust. END_OF_FILE if test 1712 -ne `wc -c <'doc/man/man1/transform.1'`; then echo shar: \"'doc/man/man1/transform.1'\" unpacked with wrong size! fi # end of 'doc/man/man1/transform.1' fi if test -f 'doc/man/man5/alv_profile.5' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'doc/man/man5/alv_profile.5'\" else echo shar: Extracting \"'doc/man/man5/alv_profile.5'\" \(2231 characters\) sed "s/^X//" >'doc/man/man5/alv_profile.5' <<'END_OF_FILE' X.TH ALV_PROFILE 5 "11th April 1989" X.SH NAME alv_profile \- ALV toolkit profile X.SH SYNOPSIS X.B ~/.alv_profile X.SH DESCRIPTION X.I Alv_profile contains standard settings for the X.I ALV toolkit programs. Lines starting with a hash ('#') are comments and every other line of the file must be in one of two formats. X.PP The first, contains a word setting a toolkit wide option. Currently, there are two such options available: X.IP "bit-restrict | bitrestrict" forces tools to consider the maximum greylevel capable of being stored in a raster as the maximum greylevel in the raster, rather than the maximum level capable of being stored in the raster. This is for use, say, in storing 12 bit deep images in 16 bit deep rasters. X.IP "mono-override | mono-overwrite" allows the full 256 colourmap entries of an image to be used in the display of an image. In X.I dsp the 0, 254 and 255 entries of the colourmap are by default set to a monochrome colourmap so that the remainder of the screen is not obviously affected by displaying the raster. Pixels with these values in the colour map are set equal to the displayable value nearest them. Setting this option overrides this and allows the 0 and 255 colourmap entries to be set to the values intended for display of the image. X.PP The second format consists of two parts, the basename of an X.I ALV program, followed by a colon (':') and then a list of command-line options. These options will be placed at the front of the command-line before it is parsed by any tool on execution. Because when parsing the command-line options each tool allows contradictory options, taking the last entered to be the option required, this allows the X.I ~/.alv_profile to be used as a list of defaults, which are user-configurable and which may be overridden on an individual basis by the user at will, simply by entering the option required on the command-line when invoking the tool. X.PP XFor example, the following is a valid X.I ~/.alv_profile : X.sp X# Mainly use 12 bit-deep files stored in 16 bits. X.br bit-restrict X.br X# vertical bars in histogram X.br hist: -v X.br X# raster displays fire up iconic X.br dsp: -WI X.SH "ENVIROMENT VARIABLES" X.IP ALV If set, the pathname of an alternative profile. END_OF_FILE if test 2231 -ne `wc -c <'doc/man/man5/alv_profile.5'`; then echo shar: \"'doc/man/man5/alv_profile.5'\" unpacked with wrong size! fi # end of 'doc/man/man5/alv_profile.5' fi if test -f 'doc/philosophy.ms' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'doc/philosophy.ms'\" else echo shar: Extracting \"'doc/philosophy.ms'\" \(2314 characters\) sed "s/^X//" >'doc/philosophy.ms' <<'END_OF_FILE' X.SH 1 Philosophy X.SH 2 Overview X.PP The ALV toolkit has been designed with what is hoped is a consistent philosophy based on that of X.UX to enable users who already know X.UX to gain expertise quickly and for more experienced users of the toolkit to aid their comprehension of the interfaces to new tools. X.PP The toolkit is made up of many separate programs which can communicate with each other via intermediary files or X.UX pipes using a common file format. Although each of the individual tools are quite simple, very powerful combinations of tools (perhaps stored in shell scripts) can be quickly constructed. X.SH 2 XFile Format X.PP The image file format used is the standard Sun rasterfile format. This has the advantages that images may be easily transfered between packages, that images can be edited using graphics editors, such as touchup 1, X.FS 1 A fullscreen public domain graphics editor by Ray Kreisel X<rayk@sbcs.sunysb.edu> X.FE and that images can be manipulated/created by the standard Sun programs X.I screendump (1), X.I screenload (1) (now superseeded by X.I scrload (1)), etc. X.PP Colour images have colourmaps associated with them in the normal way for Sun rasterfiles. If an image has no colourmap, the it is assumed to be a greyscale image. X.SH 2 Command Line Argument Conventions X.PP All of the programs in the toolkit have a consistent convention for command line arguments, viz: X.IP \(bu If the program requires an input file (called "infile") it can be read on the standard input stream. X.IP \(bu If the program produces an output file (called "outfile") it can be written to the standard output stream. X.IP \(bu If a filename argument is replaced by a "-" (minus sign) then that file is replaced by the standard input or standard output stream as appropriate. X.IP \(bu In programs which do not have required arguments if there are two arguments in the argument list not preceeded by a "-" (minus sign) then the first is regarded as being the infile and the second as the outfile. If there is only one argument not preceeded by a "-" then it is the infile. X.IP \(bu The arguments from the users profile ($HOME/.alv_profile or the file named in the shell X.I ALV ennviroment variable) are placed in front of the arguments entered by the program invoker before any arguments are parsed. END_OF_FILE if test 2314 -ne `wc -c <'doc/philosophy.ms'`; then echo shar: \"'doc/philosophy.ms'\" unpacked with wrong size! fi # end of 'doc/philosophy.ms' fi if test -f 'images/icons/cst.icon' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'images/icons/cst.icon'\" else echo shar: Extracting \"'images/icons/cst.icon'\" \(1933 characters\) sed "s/^X//" >'images/icons/cst.icon' <<'END_OF_FILE' X/* Format_version=1, Width=64, Height=64, Depth=1, Valid_bits_per_item=16 X */ X 0xFFFF,0xFFFF,0xFFFF,0xFFFF,0x8000,0x0000,0x0000,0x0001, X 0xBFFF,0xFFFF,0xFFFF,0xFFFD,0xA000,0x0000,0x0000,0x0005, X 0xA000,0x0000,0x0000,0x0005,0xA000,0x2288,0x55DD,0xFF85, X 0xA000,0x4422,0xAABB,0xFF85,0xA000,0x1122,0x55EE,0xFF85, X 0xA000,0x8888,0xAA77,0xFF85,0xA000,0x2288,0x55DD,0xFF85, X 0xA000,0x4422,0xAABB,0xFF85,0xA000,0x1122,0x55EE,0xFF85, X 0xA000,0x8888,0xAA77,0xFF85,0xA000,0x2288,0x55DD,0xFF85, X 0xA000,0x4422,0xAABB,0xFF85,0xA000,0x1122,0x55EE,0xFF85, X 0xA000,0x8888,0xAA77,0xFF85,0xA000,0x2288,0x55DD,0xFF85, X 0xA000,0x4422,0xAABB,0xFF85,0xA000,0x1122,0x55EE,0xFF85, X 0xA000,0x8888,0xAA77,0xFF85,0xA000,0x2288,0x55DD,0xFF85, X 0xA000,0x4422,0xAABB,0xFF85,0xA000,0x1122,0x55EE,0xFF85, X 0xA000,0x8888,0xAA77,0xFF85,0xA000,0x2288,0x55DD,0xFF85, X 0xA000,0x4422,0xAABB,0xFF85,0xA000,0x1122,0x55EE,0xFF85, X 0xA000,0x8888,0xAA77,0xFF85,0xA000,0x2288,0x55DD,0xFF85, X 0xA000,0x4422,0xAABB,0xFF85,0xA000,0x1122,0x55EE,0xFF85, X 0xA000,0x8888,0xAA77,0xFF85,0xA000,0x2288,0x55DD,0xFF85, X 0xA000,0x4422,0xAABB,0xFF85,0xA000,0x1122,0x55EE,0xFF85, X 0xA000,0x8888,0xAA77,0xFF85,0xA000,0x2288,0x55DD,0xFF85, X 0xA000,0x4422,0xAABB,0xFF85,0xA000,0x1122,0x55EE,0xFF85, X 0xA000,0x8888,0xAA77,0xFF85,0xA000,0x2288,0x55DD,0xFF85, X 0xA000,0x4422,0xAABB,0xFF85,0xA000,0x1122,0x55EE,0xFF85, X 0xA000,0x8888,0xAA77,0xFF85,0xA000,0x0000,0x0000,0x0005, X 0xA000,0x0000,0x0000,0x0005,0xA000,0x0000,0x0000,0x0005, X 0xA000,0x0000,0x1000,0x0005,0xA000,0x0000,0x1000,0x0005, X 0xA000,0x0E1C,0x7C00,0x0005,0xA000,0x1122,0x1000,0x0005, X 0xA000,0x1020,0x1000,0x0005,0xA000,0x101C,0x1000,0x0005, X 0xA000,0x1002,0x1000,0x0005,0xA000,0x1122,0x1000,0x0005, X 0xA000,0x0E1C,0x0C00,0x0005,0xA000,0x0000,0x0000,0x0005, X 0xA000,0x0000,0x0000,0x0005,0xA000,0x0000,0x0000,0x0005, X 0xA000,0x0000,0x0000,0x0005,0xBFFF,0xFFFF,0xFFFF,0xFFFD, X 0x8000,0x0000,0x0000,0x0001,0xFFFF,0xFFFF,0xFFFF,0xFFFF END_OF_FILE if test 1933 -ne `wc -c <'images/icons/cst.icon'`; then echo shar: \"'images/icons/cst.icon'\" unpacked with wrong size! fi # end of 'images/icons/cst.icon' fi if test -f 'images/icons/dsp.icon' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'images/icons/dsp.icon'\" else echo shar: Extracting \"'images/icons/dsp.icon'\" \(1933 characters\) sed "s/^X//" >'images/icons/dsp.icon' <<'END_OF_FILE' X/* Format_version=1, Width=64, Height=64, Depth=1, Valid_bits_per_item=16 X */ X 0xFFFF,0xFFFF,0xFFFF,0xFFFF,0x8000,0x0000,0x0000,0x0001, X 0x8000,0x0000,0x0000,0x0001,0x8000,0x0000,0x0000,0x0001, X 0x9FFF,0xFFFF,0xFFFF,0xFFFD,0x9000,0x0000,0x0000,0x0005, X 0x9000,0x0000,0x07C0,0x0005,0x9000,0x0000,0x1FF0,0x0005, X 0x9000,0x0000,0x3FF8,0x0005,0x9000,0x0000,0x7FFC,0x0005, X 0x9000,0x0000,0xFFFE,0x0005,0x9000,0x0000,0xFFFE,0x0005, X 0x9000,0x8001,0xFFFF,0x0005,0x9002,0x2001,0xFFFF,0x0005, X 0x9004,0x4401,0xFFFF,0x0005,0x9011,0x1221,0xFFFF,0x0005, X 0x9088,0x888B,0xFFFF,0x0005,0x9022,0x0885,0xFFFF,0x8005, X 0x9044,0x222A,0xFFFF,0xA005,0x9111,0x2215,0x7FFE,0xE805, X 0x9088,0x88AA,0xBFFF,0x7405,0x9220,0x88C1,0x5FFD,0xDC05, X 0x9042,0x2200,0xBFFB,0xBB05,0x9112,0x2200,0x4EEE,0xEE05, X 0x9088,0x8800,0x3777,0x7705,0x9228,0x8800,0x1DDD,0xDD85, X 0x9042,0x2000,0x1BBB,0xBB85,0x9112,0x2000,0x0EEE,0xEEC5, X 0x9088,0x8800,0x1777,0x7745,0x9028,0x8800,0x1DDD,0xDDC5, X 0x9002,0x2200,0x3BBB,0xBB85,0x9012,0x2200,0x6EEE,0xEEC5, X 0x9000,0x8880,0xF777,0x7745,0x9000,0x8881,0x5DDD,0xDD85, X 0x9002,0x2222,0xBBBB,0xBB85,0x9002,0x2222,0x4EEE,0xEE05, X 0x9000,0x8888,0x9777,0x7705,0x9000,0x8888,0x8DDD,0xDC05, X 0x9000,0x2222,0x03BB,0xB805,0x9000,0x2222,0x02EE,0xE805, X 0x9000,0x0888,0x0077,0x6005,0x9000,0x0088,0x001D,0x8005, X 0x9000,0x0000,0x0000,0x0005,0x9000,0x0000,0x0000,0x0005, X 0x9FFF,0xFFFF,0xFFFF,0xFFFD,0x8000,0x0000,0x0000,0x0001, X 0x8000,0x0000,0x0000,0x0001,0x8000,0x01C0,0x0000,0x0001, X 0x8000,0x0120,0x0000,0x0001,0x8000,0x0111,0xC580,0x0001, X 0x8000,0x0112,0x2640,0x0001,0x8000,0x0112,0x0440,0x0001, X 0x8000,0x0111,0xC440,0x0001,0x8000,0x0110,0x2440,0x0001, X 0x8000,0x0122,0x2640,0x0001,0x8000,0x01C1,0xC580,0x0001, X 0x8000,0x0000,0x0400,0x0001,0x8000,0x0000,0x0400,0x0001, X 0x8000,0x0000,0x0400,0x0001,0x8000,0x0000,0x0000,0x0001, X 0x8000,0x0000,0x0000,0x0001,0x8000,0x0000,0x0000,0x0001, X 0x8000,0x0000,0x0000,0x0001,0xFFFF,0xFFFF,0xFFFF,0xFFFF END_OF_FILE if test 1933 -ne `wc -c <'images/icons/dsp.icon'`; then echo shar: \"'images/icons/dsp.icon'\" unpacked with wrong size! fi # end of 'images/icons/dsp.icon' fi if test -f 'images/icons/glass.icon' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'images/icons/glass.icon'\" else echo shar: Extracting \"'images/icons/glass.icon'\" \(1933 characters\) sed "s/^X//" >'images/icons/glass.icon' <<'END_OF_FILE' X/* Format_version=1, Width=64, Height=64, Depth=1, Valid_bits_per_item=16 X */ X 0x8888,0x8888,0x8888,0x8888,0x8888,0x8888,0x8888,0x8888, X 0x2222,0x2222,0x2222,0x2222,0x2222,0x2222,0x2222,0x2222, X 0x8888,0x8888,0x8888,0x8888,0x8888,0x8BF8,0x8888,0x8888, X 0x2222,0x1CC7,0x2222,0x2222,0x2222,0x70C1,0xE222,0x2222, X 0x8888,0xC0C0,0xE888,0x8888,0x888B,0xC0C0,0xF888,0x8888, X 0x2226,0x0C0C,0x0E22,0x2222,0x2224,0x0C0C,0x0C22,0x2222, X 0x888C,0x0C0C,0x0E88,0x8888,0x889C,0x0C0C,0x0F08,0x8888, X 0x2230,0xC0C0,0xC122,0x2222,0x2230,0xC0C0,0xC1A2,0x2222, X 0x88A0,0xC0C0,0xC088,0x8888,0x88A0,0xC0C0,0xC088,0x8888, X 0x2240,0x0000,0x0062,0x2222,0x2246,0x0C0C,0x0C62,0x2222, X 0x88C6,0x0C0C,0x0C48,0x8888,0x88C6,0x0C0C,0x0C48,0x8888, X 0x2246,0x0C0C,0x0C62,0x2222,0x2240,0x0000,0x0062,0x2222, X 0x88C0,0xC0C0,0xC1C8,0x8888,0x88A0,0xC0C0,0xC188,0x8888, X 0x2220,0xC0C0,0xC1A2,0x2222,0x2230,0xC0C0,0xC1A2,0x2222, X 0x8890,0x0000,0x0188,0x8888,0x8896,0x0C0C,0x0F88,0x8888, X 0x222E,0x0C0C,0x0F22,0x2222,0x2226,0x0C0C,0x0FA2,0x2222, X 0x888E,0x0C0C,0x0FC8,0x8888,0x888B,0xC0C0,0xFFC8,0x8888, X 0x2222,0xC0C0,0xE7F2,0x2222,0x2222,0x70C1,0xE3F2,0x2222, X 0x8888,0x9CCF,0x09F8,0x8888,0x8888,0x8BF8,0x88FC,0x8888, X 0x2222,0x2222,0x227E,0x2222,0x2222,0x2222,0x223F,0x2222, X 0x8888,0x8888,0x889F,0x8888,0x8888,0x8888,0x888F,0xC888, X 0x2222,0x2222,0x2227,0xE222,0x2222,0x2222,0x2223,0xF222, X 0x8888,0x8888,0x8889,0xF888,0x8888,0x8888,0x8888,0xF888, X 0x2222,0x2222,0x2222,0x7A22,0x2222,0x2222,0x2222,0x3222, X 0x8888,0x8888,0x8888,0x8888,0x8888,0x8888,0x8888,0x8888, X 0x2222,0x2222,0x2222,0x2222,0x2222,0x2222,0x2222,0x2222, X 0x8888,0x8888,0x8888,0x8888,0x8888,0x8888,0x8888,0x8888, X 0x2222,0x2222,0x2222,0x2222,0x2222,0x2222,0x2222,0x2222, X 0x8888,0x8888,0x8888,0x8888,0x8888,0x8888,0x8888,0x8888, X 0x2222,0x2222,0x2222,0x2222,0x2222,0x2222,0x2222,0x2222, X 0x8888,0x8888,0x8888,0x8888,0x8888,0x8888,0x8888,0x8888, X 0x2222,0x2222,0x2222,0x2222,0x2222,0x2222,0x2222,0x2222 END_OF_FILE if test 1933 -ne `wc -c <'images/icons/glass.icon'`; then echo shar: \"'images/icons/glass.icon'\" unpacked with wrong size! fi # end of 'images/icons/glass.icon' fi if test -f 'images/icons/hist.icon' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'images/icons/hist.icon'\" else echo shar: Extracting \"'images/icons/hist.icon'\" \(1933 characters\) sed "s/^X//" >'images/icons/hist.icon' <<'END_OF_FILE' X/* Format_version=1, Width=64, Height=64, Depth=1, Valid_bits_per_item=16 X */ X 0xFFFF,0xFFFF,0xFFFF,0xFFFF,0x8000,0x0000,0x0000,0x0001, X 0x8000,0x0000,0x0000,0x0001,0x8000,0x0000,0x0000,0x0001, X 0x8000,0x0000,0x0000,0x0001,0x8000,0x0000,0x0000,0x0001, X 0x8000,0x0000,0x0000,0x0001,0x8000,0x0000,0x0000,0x0001, X 0x8000,0x0000,0x0000,0x0001,0x8000,0x0000,0x0000,0x0001, X 0x8000,0x0000,0x0000,0x0001,0x8000,0x0000,0x0000,0x0001, X 0x8000,0x0000,0x2000,0x0001,0x8000,0x0000,0x2000,0x0001, X 0x8000,0x0000,0x2000,0x0001,0x8000,0x0000,0x2000,0x0001, X 0x8002,0x0800,0x2008,0x0001,0x8002,0x0800,0x2008,0x0001, X 0x8002,0x0800,0x2008,0x0001,0x8002,0x0800,0x2008,0x0001, X 0x800A,0x0A00,0x2008,0x8081,0x800A,0x0A00,0x2008,0x8081, X 0x800A,0x0A00,0x2008,0x8081,0x800A,0x0A00,0x2008,0x8081, X 0x800A,0x0A00,0x2808,0x8081,0x800A,0x0A00,0x2808,0x8081, X 0x800A,0x0A00,0x2808,0x8081,0x800A,0x0A00,0x2808,0x8081, X 0x800A,0x8A00,0x2888,0x8281,0x800A,0x8A00,0x2888,0x8281, X 0x800A,0x8A00,0x2888,0x8281,0x800A,0x8A00,0x2888,0x8281, X 0x800A,0x8A00,0xA8A8,0x8281,0x800A,0x8A00,0xA8A8,0x8281, X 0x800A,0x8A00,0xA8A8,0x8281,0x800A,0x8A02,0xA8A8,0x8A81, X 0x802A,0x8A8A,0xAAAA,0x8A81,0x802A,0x8A8A,0xAAAA,0x8A81, X 0x802A,0x8A8A,0xAAAA,0x8A81,0x802A,0x8A8A,0xAAAA,0x8A81, X 0x80AA,0xAAAA,0xAAAA,0xAA81,0x80AA,0xAAAA,0xAAAA,0xAA81, X 0x80AA,0xAAAA,0xAAAA,0xAA81,0x80FF,0xFFFF,0xFFFF,0xFF81, X 0x8000,0x0000,0x0000,0x0001,0x8000,0x0000,0x0000,0x0001, X 0x8000,0x0000,0x0000,0x0001,0x8000,0x0000,0x0000,0x0001, X 0x8000,0x1108,0x0020,0x0001,0x8000,0x1100,0x0020,0x0001, X 0x8000,0x1138,0x38F8,0x0001,0x8000,0x1108,0x4420,0x0001, X 0x8000,0x1F08,0x4020,0x0001,0x8000,0x1108,0x3820,0x0001, X 0x8000,0x1108,0x0420,0x0001,0x8000,0x1108,0x4420,0x0001, X 0x8000,0x1108,0x3818,0x0001,0x8000,0x0000,0x0000,0x0001, X 0x8000,0x0000,0x0000,0x0001,0x8000,0x0000,0x0000,0x0001, X 0x8000,0x0000,0x0000,0x0001,0x8000,0x0000,0x0000,0x0001, X 0x8000,0x0000,0x0000,0x0001,0xFFFF,0xFFFF,0xFFFF,0xFFFF END_OF_FILE if test 1933 -ne `wc -c <'images/icons/hist.icon'`; then echo shar: \"'images/icons/hist.icon'\" unpacked with wrong size! fi # end of 'images/icons/hist.icon' fi if test -f 'images/icons/palette.icon' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'images/icons/palette.icon'\" else echo shar: Extracting \"'images/icons/palette.icon'\" \(1933 characters\) sed "s/^X//" >'images/icons/palette.icon' <<'END_OF_FILE' X/* Format_version=1, Width=64, Height=64, Depth=1, Valid_bits_per_item=16 X */ X 0xFFFF,0xFFFF,0xFFFF,0xFFFF,0x8000,0x0000,0x0000,0x0001, X 0x8000,0x0000,0x0000,0x0001,0x8000,0x0000,0x0000,0x0001, X 0x8000,0x0000,0x3FF8,0x0001,0x8000,0x0000,0xC007,0xC001, X 0x8000,0x000F,0x0000,0x7001,0x8000,0x0038,0x0000,0x1801, X 0x8000,0x00C0,0x0000,0x0C01,0x8000,0x0300,0x0000,0x0601, X 0x8000,0x0C00,0x0000,0x0301,0x8000,0x3000,0x0000,0x0301, X 0x8000,0xC000,0x0000,0x0101,0x8001,0x8000,0x2000,0x0101, X 0x8006,0x0004,0x4000,0x0181,0x8018,0x0011,0x1000,0x0181, X 0x8020,0x0088,0x8801,0x4101,0x8040,0x0022,0x2005,0xD081, X 0x8180,0x0444,0x4403,0xB081,0x8200,0x1111,0x100E,0xE881, X 0x8200,0x8888,0x8807,0x7101,0x8C00,0x2222,0x200D,0xD101, X 0x8800,0x4444,0x4003,0xBB01,0x9001,0x1111,0x1006,0xE601, X 0x9000,0x8888,0x8001,0x6601,0xA002,0x2220,0x0000,0xCC01, X 0xA000,0x4440,0x0000,0x1801,0xC001,0x1100,0x0000,0x1001, X 0xC000,0x8880,0x0000,0x3001,0xC000,0x2200,0x0000,0x2001, X 0xC000,0x0400,0x0000,0x4001,0x8000,0x0000,0x0000,0x8001, X 0x8000,0x0000,0x0081,0x8001,0x8000,0x0000,0x5541,0x0001, X 0x8000,0x0000,0xAA82,0x0001,0x8000,0x0001,0x5504,0x0001, X 0x8000,0x0002,0xAA88,0x0001,0x8000,0x0001,0x5510,0x0001, X 0xC000,0xE002,0x2A20,0x0001,0xC003,0xF800,0x5440,0x0001, X 0xC003,0xF800,0xA180,0x0001,0xF187,0xFC00,0x4700,0x0001, X 0x9E67,0xFC00,0x1800,0x0001,0x8017,0xFC00,0x6000,0x0001, X 0x801B,0xF800,0x8000,0x0001,0x800B,0xF80B,0x0000,0x0001, X 0x8008,0xE078,0x0000,0x0001,0x8004,0x0780,0x0000,0x0001, X 0x8003,0xFC00,0x0000,0x0001,0x8000,0x0000,0x0000,0x0001, X 0x8000,0x0000,0x0000,0x0001,0x8078,0x00E0,0x0102,0x0001, X 0x8044,0x0020,0x0102,0x0001,0x8044,0x7021,0xC7CF,0x8E01, X 0x8044,0x8822,0x2102,0x1101,0x8078,0x0822,0x2102,0x1101, X 0x8040,0x7823,0xE102,0x1F01,0x8040,0x8822,0x0102,0x1001, X 0x8040,0x8822,0x2102,0x1101,0x8040,0x7821,0xC0C1,0x8E01, X 0x8000,0x0000,0x0000,0x0001,0x8000,0x0000,0x0000,0x0001, X 0x8000,0x0000,0x0000,0x0001,0xFFFF,0xFFFF,0xFFFF,0xFFFF END_OF_FILE if test 1933 -ne `wc -c <'images/icons/palette.icon'`; then echo shar: \"'images/icons/palette.icon'\" unpacked with wrong size! fi # end of 'images/icons/palette.icon' fi if test -f 'images/icons/winlev8.icon' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'images/icons/winlev8.icon'\" else echo shar: Extracting \"'images/icons/winlev8.icon'\" \(1933 characters\) sed "s/^X//" >'images/icons/winlev8.icon' <<'END_OF_FILE' X/* Format_version=1, Width=64, Height=64, Depth=1, Valid_bits_per_item=16 X */ X 0xFFFF,0xFFFF,0xFFFF,0xFFFF,0x8000,0x0000,0x0000,0x0001, X 0x8000,0x0000,0x0000,0x0001,0x8000,0x1122,0x55EE,0xFF81, X 0x8000,0x8888,0xAA77,0xFF81,0x8000,0x2288,0x55DD,0xFF81, X 0x8000,0x4422,0xAABB,0xFF81,0x8000,0x1122,0x55EE,0xFF81, X 0x8000,0x8888,0xAA77,0xFF81,0x8000,0x2288,0x55DD,0xFF81, X 0x8000,0x4422,0xAABB,0xFF81,0x8000,0x1122,0x55EE,0xFF81, X 0x8000,0x8888,0xAA77,0xFF81,0x8000,0x2288,0x55DD,0xFF81, X 0x8000,0x4422,0xAABB,0xFF81,0x8000,0x1122,0x55EE,0xFF81, X 0x8000,0x8888,0xAA77,0xFF81,0x8000,0x2288,0x55DD,0xFF81, X 0x8000,0x4422,0xAABB,0xFF81,0x8000,0x1122,0x55EE,0xFF81, X 0x8000,0x8888,0xAA77,0xFF81,0x8000,0x2288,0x55DD,0xFF81, X 0x8000,0x4422,0xAABB,0xFF81,0x8000,0x1122,0x55EE,0xFF81, X 0x8000,0x8888,0xAA77,0xFF81,0x8000,0x2288,0x55DD,0xFF81, X 0x8000,0x4422,0xAABB,0xFF81,0x8000,0x1122,0x55EE,0xFF81, X 0x8000,0x8888,0xAA77,0xFF81,0x8000,0x2288,0x55DD,0xFF81, X 0x8000,0x4422,0xAABB,0xFF81,0x8000,0x1122,0x55EE,0xFF81, X 0x8000,0x8888,0xAA77,0xFF81,0x8000,0x2288,0x55DD,0xFF81, X 0x8000,0x4422,0xAABB,0xFF81,0x8000,0x1122,0x55EE,0xFF81, X 0x8000,0x8888,0xAA77,0xFF81,0x8000,0x2288,0x55DD,0xFF81, X 0x8000,0x4422,0xAABB,0xFF81,0x8000,0x1122,0x55EE,0xFF81, X 0x8000,0x8888,0xAA77,0xFF81,0x8000,0x2288,0x55DD,0xFF81, X 0x8000,0x4422,0xAABB,0xFF81,0x8000,0x1122,0x55EE,0xFF81, X 0x8000,0x8888,0xAA77,0xFF81,0x8000,0x0000,0x0000,0x0001, X 0x8000,0x0000,0x0000,0x0001,0x8000,0x0000,0x0000,0x0001, X 0x8000,0x0000,0x0000,0x0001,0x8000,0x0000,0x0000,0x0001, X 0x8041,0x1001,0x0000,0x0701,0x8041,0x0001,0x0000,0x0881, X 0x8041,0x70B1,0x01C4,0x4881,0x8049,0x10C9,0x0224,0x4881, X 0x802A,0x1089,0x0224,0x4701,0x802A,0x1089,0x03E2,0x8881, X 0x802A,0x1089,0x0202,0x8881,0x8014,0x1089,0x0221,0x0881, X 0x8014,0x1089,0xF1C1,0x0701,0x8000,0x0000,0x0000,0x0001, X 0x8000,0x0000,0x0000,0x0001,0x8000,0x0000,0x0000,0x0001, X 0x8000,0x0000,0x0000,0x0001,0xFFFF,0xFFFF,0xFFFF,0xFFFF END_OF_FILE if test 1933 -ne `wc -c <'images/icons/winlev8.icon'`; then echo shar: \"'images/icons/winlev8.icon'\" unpacked with wrong size! fi # end of 'images/icons/winlev8.icon' fi if test -f 'src/array2ras.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'src/array2ras.c'\" else echo shar: Extracting \"'src/array2ras.c'\" \(2602 characters\) sed "s/^X//" >'src/array2ras.c' <<'END_OF_FILE' X#include <stdio.h> X#include "defs.h" X char *progname; char *filename; Pixrect *pr; X X#ifdef STANDALONE main(argc, argv, envp) X#else array2ras_main(argc, argv, envp) X#endif X int argc; X char **argv; X char **envp; X{ X colormap_t colormap; X register int x, y; X int xsize, ysize, depth; X short *shortimage, *shortptr; X unsigned char *charimage, *charptr; X long *longimage, *longptr; X X xsize = ysize = 512; X depth = 8; X progname = strsave(argv[0]); X parse_profile(&argc, argv, envp); X X while ((gc = getopt(argc, argv, "X:Y:d:")) != EOF) X switch (gc) { X case 'X': X xsize = atoi(optarg); X break; X case 'Y': X ysize = atoi(optarg); X break; X case 'd': X depth = atoi(optarg); X break; X case '?': X errflag++; X break; X } X X if (errflag) X error((char *) 0, "Usage: %s: [-X xsize] [-Y ysize] [-d depth] [infile] [outfile]\n", progname); X X for (stream = 0; optind < argc; stream++, optind++) X if (stream < 2 && strcmp(argv[optind], "-") != 0) X if (freopen(argv[optind], mode[stream], f[stream]) == NULL) X error("%s %s", PR_IO_ERR_INFILE, argv[optind]); X X if (depth != 8 && depth != 16 && depth != 32) X error("Cannot read images of that depth"); X X if ((pr = mem_create(xsize, ysize, depth)) == NULL) X error("mem_create returned NULL"); X X switch (depth) { X case 8: X charimage = (unsigned char *) malloc(sizeof(unsigned char) * pr->pr_size.x); X for (y = 0; y < pr->pr_size.y; y++) { X charptr = charimage; X if (fread(charimage, sizeof(*charimage), pr->pr_size.x, stdin) != pr->pr_size.x) X error("Error reading image data (possible file size error)"); X for (x = 0; x < pr->pr_size.x; x++) X pr_put(pr, x, y, (char) *charptr++); X } X free(charimage); X break; X case 16: X shortimage = (short *) malloc(sizeof(short) * pr->pr_size.x); X for (y = 0; y < pr->pr_size.y; y++) { X shortptr = shortimage; X if (fread(shortimage, sizeof(*shortimage), pr->pr_size.x, stdin) != pr->pr_size.x) X error("Error reading image data (possible file size error)"); X for (x = 0; x < pr->pr_size.x; x++) X pr_put(pr, x, y, (short) *shortptr++); X } X free(shortimage); X break; X case 32: X longimage = (long *) malloc(sizeof(long) * pr->pr_size.x); X for (y = 0; y < pr->pr_size.y; y++) { X longptr = longimage; X if (fread(longimage, sizeof(*longimage), pr->pr_size.x, stdin) != pr->pr_size.x) X error("Error reading image data (possible file size error)"); X for (x = 0; x < pr->pr_size.x; x++) X pr_put(pr, x, y, (long) *longptr++); X } X free(longimage); X break; X } X colormap.type = RMT_NONE; X colormap.length = 0; X pr_dump(pr, stdout, &colormap, RT_STANDARD, 0); X} END_OF_FILE if test 2602 -ne `wc -c <'src/array2ras.c'`; then echo shar: \"'src/array2ras.c'\" unpacked with wrong size! fi # end of 'src/array2ras.c' fi if test -f 'src/blend.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'src/blend.c'\" else echo shar: Extracting \"'src/blend.c'\" \(1867 characters\) sed "s/^X//" >'src/blend.c' <<'END_OF_FILE' X#include <stdio.h> X#include "defs.h" X char *progname; Pixrect *pr1, *pr2; X X#ifdef STANDALONE main(argc, argv, envp) X#else blend_main(argc, argv, envp) X#endif X int argc; X char **argv; X char **envp; X{ X register int i, j; X int pix1, pix2, outpix; X FILE *f1, *f2; X float wt1, wt2; X X f1 = stdin; X f2 = stdin; X wt1 = wt2 = 1.; X progname = strsave(argv[0]); X parse_profile(&argc, argv, envp); X X while ((gc = getopt(argc, argv, "f:w:F:W:")) != EOF) X switch (gc) { X case 'f': X if ((f1 = fopen(optarg, "r")) == NULL) X error("Can't open %s\n", optarg); X break; X case 'F': X if ((f2 = fopen(optarg, "r")) == NULL) X error("Can't open %s\n", optarg); X break; X case 'w': X wt1 = atof(optarg); X break; X case 'W': X wt2 = atof(optarg); X break; X case '?': X errflag++; X break; X } X X if (errflag) X error((char *) 0, "Usage: %s: [-f filename1] [-w weighting1] [-F filename2] [-W weighting2] [outfile] \n", progname); X X for (stream = 0; optind < argc; stream++, optind++) X if (stream == 0 && strcmp(argv[optind], "-") != 0) X if (freopen(argv[optind], "w", stdout) == NULL) X error("%s %s", PR_IO_ERR_INFILE, argv[optind]); X X if (f1 == f2) X error("Can't blend an image with itself\n"); X X if ((pr1 = pr_load(f1, NULL)) == NULL) X error(PR_IO_ERR_RASREAD); X X if ((pr2 = pr_load(f2, NULL)) == NULL) X error(PR_IO_ERR_RASREAD); X X if (pr1->pr_size.x != pr2->pr_size.x || pr1->pr_size.y != pr2->pr_size.y || pr1->pr_depth != pr2->pr_depth) X error("Image dimensions not equal\n"); X X for (j = 0; j < pr1->pr_size.y; j++) X for (i = 0; i < pr1->pr_size.x; i++) { X pix1 = pr_get(pr1, i, j); X pix2 = pr_get(pr2, i, j); X outpix = (int) (((float) pix1 * wt1 + (float) pix2 * wt2) / (wt1 + wt2)); X pr_put(pr1, i, j, outpix); X } X X pr_dump(pr1, stdout, NULL, RT_STANDARD, 0); X} END_OF_FILE if test 1867 -ne `wc -c <'src/blend.c'`; then echo shar: \"'src/blend.c'\" unpacked with wrong size! fi # end of 'src/blend.c' fi if test -f 'src/ffill.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'src/ffill.c'\" else echo shar: Extracting \"'src/ffill.c'\" \(1840 characters\) sed "s/^X//" >'src/ffill.c' <<'END_OF_FILE' X#include "defs.h" X Pixrect *pr; char *progname; char filename[BUFSIZ]; X X#ifdef STANDALONE main(argc, argv, envp) X#else ffill_main(argc, argv, envp) X#endif X int argc; X char **argv; X char **envp; X{ X int i; X FILE *fp; X int xpos, ypos; X int boundary; X colormap_t colormap; X X xpos = ypos = boundary = 0; X progname = strsave(argv[0]); X parse_profile(&argc, argv, envp); X X while ((gc = getopt(argc, argv, "x:y:b:")) != EOF) X switch (gc) { X case 'x': X xpos = atoi(optarg); X break; X case 'y': X ypos = atoi(optarg); X break; X case 'b': X boundary = atoi(optarg); X break; X case '?': X errflag++; X break; X } X X if (errflag) X error((char *) 0, "Usage: %s: [-b boundary] [-x xpos] [-y ypos] [infile] [outfile]\n", progname); X X for (stream = 0; optind < argc; stream++, optind++) X if (stream < 2 && strcmp(argv[optind], "-") != 0) X if (freopen(argv[optind], mode[stream], f[stream]) == NULL) X error("%s %s", PR_IO_ERR_INFILE, argv[optind]); X X if ((pr = pr_load(stdin, &colormap)) == NULL) X error(PR_IO_ERR_RASREAD); X X ffill(xpos, ypos, boundary); X X pr_dump(pr, stdout, &colormap, RT_STANDARD, 0); X} X ffill(x, y, n) int x,y,n; X{ X register int i, j, k; X X if (x < 0 || x >= pr->pr_size.x || y < 0 || y >= pr->pr_size.y || pr_get(pr, x, y) == n) X return; X X pr_put(pr, x, y, n); X X for (i = x - 1; i >= 0; i--) /* to the left */ X if (pr_get(pr, i, y) != n) X pr_put(pr, i, y, n); X else X break; X X for (j = x + 1; j < pr->pr_size.x; j++) /* to the right */ X if (pr_get(pr, j, y) != n) X pr_put(pr, j, y, n); X else X break; X X for (k = i + 1; k < j; k++) { X if (y > 0 && pr_get(pr, k, y - 1) != n) X ffill(k, y - 1, n); X if (y < pr->pr_size.y - 1 && pr_get(pr, k, y + 1) != n) X ffill(k, y + 1, n); X } X} X X X END_OF_FILE if test 1840 -ne `wc -c <'src/ffill.c'`; then echo shar: \"'src/ffill.c'\" unpacked with wrong size! fi # end of 'src/ffill.c' fi if test -f 'src/hough.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'src/hough.c'\" else echo shar: Extracting \"'src/hough.c'\" \(2417 characters\) sed "s/^X//" >'src/hough.c' <<'END_OF_FILE' X#include <stdio.h> X#include "defs.h" X X#define BLACK 0 X#define DEG2RAD (M_PI/180.) X char *progname; char *filename; Pixrect *pr1, *pr2; X X#ifdef STANDALONE main(argc, argv, envp) X#else hough_main(argc, argv, envp) X#endif X int argc; X char **argv; X char **envp; X{ X register int i, j; X int levels; X Pixrect *hough(); X X progname = strsave(argv[0]); X parse_profile(&argc, argv, envp); X X while ((gc = getopt(argc, argv, " ")) != EOF) X switch (gc) { X case '?': X errflag++; X break; X } X X if (errflag) X error((char *) 0, "Usage: %s: [infile] [outfile]\n", progname); X X for (stream = 0; optind < argc; stream++, optind++) X if (stream < 2 && strcmp(argv[optind], "-") != 0) X if (freopen(argv[optind], mode[stream], f[stream]) == NULL) X error("%s %s", PR_IO_ERR_INFILE, argv[optind]); X X if ((pr1 = pr_load(stdin, NULL)) == NULL) X error(PR_IO_ERR_RASREAD); X X if (pr1->pr_depth != 1) X error("Input image must be 1 bit deep"); X X pr2 = hough(pr1); X X pr_dump(pr2, stdout, NULL, RT_STANDARD, 0); X} X X X Pixrect *hough (pr) Pixrect *pr; X{ X double sqrt (); /* square root function */ X Pixrect *hp; /* new image for hough transformation */ X int xoff, yoff; /* centre image = origin hough space */ X register int r, theta; /* coords in hough space */ X register int x, y; /* coords in image */ X int maxr; /* max val of r possible for image */ X int c[180], s[180]; /* lookup tables for cos and sin */ X X /* initialise variables */ X X xoff = pr->pr_size.x/2; X yoff = pr->pr_size.y/2; X maxr = (int) (sqrt ((double) (pr->pr_size.x * pr->pr_size.x + pr->pr_size.y * pr->pr_size.y)) / 2); X X for (theta = 0; theta < 180; theta++) { X c[theta] = (int) (cos (DEG2RAD * theta) * 1000); X s[theta] = (int) (sin (DEG2RAD * theta) * 1000); X } X X /* create new image */ X X if ((hp = mem_create (180, 2 * maxr + 1, 8)) == NULL) X error("mem_create returned NULL"); X X for (r = 0; r < 2 * maxr + 1; r++) X for (theta = 0; theta < 180; theta++) X pr_put(hp, theta, r, 0); X X /* step through image */ X X for (y = 0; y < pr->pr_size.y; y++) X for (x = 0; x < pr->pr_size.x; x++) X if (pr_get(pr, x,y) == BLACK) X for (theta = 0; theta < 180; ++theta) { X r = (y - yoff) * s[theta] - (x - xoff) * c[theta]; X r = r < 0 ? r / 1000 : r / 1000 + 1; X pr_put(hp, theta, maxr + r, pr_get(hp, theta, maxr + r) +1); X } X X return (hp); X} X END_OF_FILE if test 2417 -ne `wc -c <'src/hough.c'`; then echo shar: \"'src/hough.c'\" unpacked with wrong size! fi # end of 'src/hough.c' fi if test -f 'src/p_panel.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'src/p_panel.c'\" else echo shar: Extracting \"'src/p_panel.c'\" \(2662 characters\) sed "s/^X//" >'src/p_panel.c' <<'END_OF_FILE' X/*************************************************** palette_panel.c X **********/ X X#include "p_include.h" X panel_creation() X{ X file_name_item = panel_create_item(control_panel, PANEL_TEXT, X PANEL_LABEL_STRING, "File: ", X PANEL_VALUE_DISPLAY_LENGTH, 40, X PANEL_ITEM_X, ATTR_COL(1), X PANEL_ITEM_Y, ATTR_ROW(1), X 0); X X panel_create_item(control_panel, PANEL_BUTTON, X PANEL_LABEL_IMAGE, X panel_button_image(control_panel, "Load", 7, 0), X PANEL_NOTIFY_PROC, load_proc, X PANEL_ITEM_X, ATTR_COL(60), X PANEL_ITEM_Y, ATTR_ROW(1), X 0); X X panel_create_item(control_panel, PANEL_BUTTON, X PANEL_LABEL_IMAGE, X panel_button_image(control_panel, "Save", 7, 0), X PANEL_NOTIFY_PROC, save_proc, X PANEL_ITEM_X, ATTR_COL(60), X PANEL_ITEM_Y, ATTR_ROW(2), X 0); X X panel_create_item(control_panel, PANEL_BUTTON, X PANEL_LABEL_IMAGE, X panel_button_image(control_panel, "Reset", 7, 0), X PANEL_NOTIFY_PROC, reset_proc, X PANEL_ITEM_X, ATTR_COL(60), X PANEL_ITEM_Y, ATTR_ROW(3), X 0); X X panel_create_item(control_panel, PANEL_BUTTON, X PANEL_LABEL_IMAGE, X panel_button_image(control_panel, "Quit", 7, 0), X PANEL_NOTIFY_PROC, quit_proc, X PANEL_ITEM_X, ATTR_COL(60), X PANEL_ITEM_Y, ATTR_ROW(4), X 0); X X red_slider = panel_create_item(control_panel, PANEL_SLIDER, X PANEL_LABEL_STRING, "Red: ", X PANEL_VALUE, 0, X PANEL_MIN_VALUE, 0, X PANEL_MAX_VALUE, 255, X PANEL_SLIDER_WIDTH, 256, X PANEL_NOTIFY_LEVEL, PANEL_ALL, X PANEL_NOTIFY_PROC, red_proc, X PANEL_ITEM_X, ATTR_COL(1), X PANEL_ITEM_Y, ATTR_ROW(2), X 0); X X green_slider = panel_create_item(control_panel, PANEL_SLIDER, X PANEL_LABEL_STRING, "Green:", X PANEL_VALUE, 0, X PANEL_MIN_VALUE, 0, X PANEL_MAX_VALUE, 255, X PANEL_SLIDER_WIDTH, 256, X PANEL_NOTIFY_LEVEL, PANEL_ALL, X PANEL_NOTIFY_PROC, green_proc, X PANEL_ITEM_X, ATTR_COL(1), X PANEL_ITEM_Y, ATTR_ROW(3), X 0); X X blue_slider = panel_create_item(control_panel, PANEL_SLIDER, X PANEL_LABEL_STRING, "Blue: ", X PANEL_VALUE, 0, X PANEL_MIN_VALUE, 0, X PANEL_MAX_VALUE, 255, X PANEL_SLIDER_WIDTH, 256, X PANEL_NOTIFY_LEVEL, PANEL_ALL, X PANEL_NOTIFY_PROC, blue_proc, X PANEL_ITEM_X, ATTR_COL(1), X PANEL_ITEM_Y, ATTR_ROW(4), X 0); X X msg_item = panel_create_item(control_panel, PANEL_TEXT, X PANEL_LABEL_STRING, "", X PANEL_VALUE_STORED_LENGTH, 120, X PANEL_VALUE_DISPLAY_LENGTH, 80, X PANEL_ITEM_X, ATTR_COL(1), X PANEL_ITEM_Y, ATTR_ROW(5), X 0); X X window_fit_height(control_panel); X} X END_OF_FILE if test 2662 -ne `wc -c <'src/p_panel.c'`; then echo shar: \"'src/p_panel.c'\" unpacked with wrong size! fi # end of 'src/p_panel.c' fi if test -f 'src/ras2array.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'src/ras2array.c'\" else echo shar: Extracting \"'src/ras2array.c'\" \(2278 characters\) sed "s/^X//" >'src/ras2array.c' <<'END_OF_FILE' X#include <stdio.h> X#include "defs.h" X char *progname; char *filename; Pixrect *pr; X X#ifdef STANDALONE main(argc, argv, envp) X#else ras2array_main(argc, argv, envp) X#endif X int argc; X char **argv; X char **envp; X{ X register int x, y; X short *shortimage, *shortptr; X unsigned char *charimage, *charptr; X long *longimage, *longptr; X X progname = strsave(argv[0]); X parse_profile(&argc, argv, envp); X X while ((gc = getopt(argc, argv, " ")) != EOF) X switch (gc) { X case '?': X errflag++; X break; X } X X if (errflag) X error((char *) 0, "Usage: %s: [infile] [outfile]\n", progname); X X for (stream = 0; optind < argc; stream++, optind++) X if (stream < 2 && strcmp(argv[optind], "-") != 0) X if (freopen(argv[optind], mode[stream], f[stream]) == NULL) X error("%s %s", PR_IO_ERR_INFILE, argv[optind]); X X if ((pr = pr_load(stdin, NULL)) == NULL) X error(PR_IO_ERR_RASREAD); X X switch (pr->pr_depth) { X case 8: X charimage = (unsigned char *) malloc(sizeof(unsigned char) * pr->pr_size.x); X for (y = 0; y < pr->pr_size.y; y++) { X charptr = charimage; X for (x = 0; x < pr->pr_size.x; x++) X *charptr++ = (char) pr_get(pr, x, y); X if (fwrite(charimage, sizeof(*charimage), pr->pr_size.x, stdout) != pr->pr_size.x) X error("Error writing image data (possible file size error)"); X } X free(charimage); X break; X case 16: X shortimage = (short *) malloc(sizeof(short) * pr->pr_size.x); X for (y = 0; y < pr->pr_size.y; y++) { X shortptr = shortimage; X for (x = 0; x < pr->pr_size.x; x++) X *shortptr++ = (short) pr_get(pr, x, y); X if (fwrite(shortimage, sizeof(*shortimage), pr->pr_size.x, stdout) != pr->pr_size.x) X error("Error writing image data (possible file size error)"); X } X free(shortimage); X break; X case 24: X error("Don't know how to write 24 bit images"); X break; X case 32: X longimage = (long *) malloc(sizeof(long) * pr->pr_size.x); X for (y = 0; y < pr->pr_size.y; y++) { X longptr = longimage; X for (x = 0; x < pr->pr_size.x; x++) X *longptr++ = (long) pr_get(pr, x, y); X if (fwrite(longimage, sizeof(*longimage), pr->pr_size.x, stdout) != pr->pr_size.x) X error("Error writing image data (possible file size error)"); X } X free(longimage); X break; X } X} END_OF_FILE if test 2278 -ne `wc -c <'src/ras2array.c'`; then echo shar: \"'src/ras2array.c'\" unpacked with wrong size! fi # end of 'src/ras2array.c' fi if test -f 'src/rasscale.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'src/rasscale.c'\" else echo shar: Extracting \"'src/rasscale.c'\" \(1939 characters\) sed "s/^X//" >'src/rasscale.c' <<'END_OF_FILE' X#include <stdio.h> X#include "defs.h" X char *progname; char *filename; Pixrect *pr1, *pr2; X X#ifdef STANDALONE main(argc, argv, envp) X#else rasscale_main(argc, argv, envp) X#endif X int argc; X char **argv; X char **envp; X{ X register int i, j; X float scale; X int xsize, ysize; X colormap_t colormap; X X xsize = ysize = 0; X scale = 1.; X X if (strrchr(argv[0],'/') == NULL) X progname = strsave(argv[0]); X else progname = strsave(strrchr(argv[0],'/')+1); X X warning("progname = %s",progname); X parse_profile(&argc, argv, envp); X X while ((gc = getopt(argc, argv, "s:")) != EOF) X switch (gc) { X case 's': X scale = atof(optarg); X break; X case '?': X errflag++; X break; X } X X if (errflag) X error((char *) 0, "Usage: %s: [-s scale] [infile] [outfile]\n", progname); X X for (stream = 0; optind < argc; stream++, optind++) X if (stream < 2 && strcmp(argv[optind], "-") != 0) X if (freopen(argv[optind], mode[stream], f[stream]) == NULL) X error("%s %s", PR_IO_ERR_INFILE, argv[optind]); X X if ((pr1 = pr_load(stdin, &colormap)) == NULL) X error(PR_IO_ERR_RASREAD); X X if (strcmp(progname, "double") == 0) X scale = 2.; X else if (strcmp(progname, "triple") == 0) X scale = 3.; X else if (strcmp(progname, "quad") == 0) X scale = 4.; X else if (strcmp(progname, "half") == 0) X scale = 0.5; X else if (strcmp(progname, "third") == 0) X scale = 1. / 3.; X else if (strcmp(progname, "quarter") == 0) X scale = 0.25; X X if (xsize == 0) X xsize = (int) (pr1->pr_size.x * scale); X if (ysize == 0) X ysize = (int) (pr1->pr_size.y * scale); X X if ((pr2 = mem_create(xsize, ysize, pr1->pr_depth)) == NULL) X error("%s : mem_create returned NULL\n", progname); X X for (j = 0; j < pr2->pr_size.y; j++) X for (i = 0; i < pr2->pr_size.x; i++) X pr_put(pr2, i, j, pr_get(pr1, (int) ((float) i / scale), (int) ((float) j / scale))); X X pr_dump(pr2, stdout, &colormap, RT_STANDARD, 0); X} END_OF_FILE if test 1939 -ne `wc -c <'src/rasscale.c'`; then echo shar: \"'src/rasscale.c'\" unpacked with wrong size! fi # end of 'src/rasscale.c' fi if test -f 'src/rasval.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'src/rasval.c'\" else echo shar: Extracting \"'src/rasval.c'\" \(1820 characters\) sed "s/^X//" >'src/rasval.c' <<'END_OF_FILE' X#include <stdio.h> X#include "defs.h" X X#define BOLD_ON "\033[7m" X#define BOLD_OFF "\033[m" X char *progname; char *filename; Pixrect *pr1, *pr2; X X#ifdef STANDALONE main(argc, argv, envp) X#else rasval_main(argc, argv, envp) X#endif X int argc; X char **argv; X char **envp; X{ X register int i, j; X int noheaders, xoffset, yoffset, xsize, ysize; X colormap_t colormap; X X noheaders = xsize = ysize = xoffset = yoffset = 0; X progname = strsave(argv[0]); X parse_profile(&argc, argv, envp); X X while ((gc = getopt(argc, argv, "nx:y:X:Y:")) != EOF) X switch (gc) { X case 'x': X xoffset = atoi(optarg); X break; X case 'y': X yoffset = atoi(optarg); X break; X case 'X': X xsize = atoi(optarg); X break; X case 'Y': X ysize = atoi(optarg); X break; X case 'n': X noheaders++; X break; X case '?': X errflag++; X break; X } X X if (errflag) X error((char *) 0, "Usage: %s: [-n] [-x xoffset] [-y yoffset] [-X xsize] [-Y Ysize] [infile]\n", progname); X X for (stream = 0; optind < argc; stream++, optind++) X if (stream == 0 && strcmp(argv[optind], "-") != 0) X if (freopen(argv[optind], mode[stream], f[stream]) == NULL) X error("%s %s", PR_IO_ERR_INFILE, argv[optind]); X X if ((pr1 = pr_load(stdin, &colormap)) == NULL) X error(PR_IO_ERR_RASREAD); X X if (xsize == 0) X xsize = 10; X if (ysize == 0) X ysize = 10; X X if ((pr2 = pr_region(pr1, xoffset, yoffset, xsize, ysize)) == NULL) X error("pr_region returned NULL"); X X if (!noheaders) { X printf(" %s", BOLD_ON); X for (i = 0; i < pr2->pr_size.x; i++) X printf("%6d", xoffset + i); X putchar('\n'); X } X for (j = 0; j < pr2->pr_size.y; j++) { X if (!noheaders) X printf("%s%7d%s", BOLD_ON, yoffset + j, BOLD_OFF); X for (i = 0; i < pr2->pr_size.x; i++) X printf("%6d", pr_get(pr2, i, j)); X putchar('\n'); X } X} END_OF_FILE if test 1820 -ne `wc -c <'src/rasval.c'`; then echo shar: \"'src/rasval.c'\" unpacked with wrong size! fi # end of 'src/rasval.c' fi echo shar: End of archive 3 \(of 10\). cp /dev/null ark3isdone MISSING="" for I in 1 2 3 4 5 6 7 8 9 10 ; do if test ! -f ark${I}isdone ; then MISSING="${MISSING} ${I}" fi done if test "${MISSING}" = "" ; then echo You have unpacked all 10 archives. rm -f ark[1-9]isdone ark[1-9][0-9]isdone else echo You still need to unpack the following archives: echo " " ${MISSING} fi ## End of shell archive. exit 0