mcgrew@dartagnan.rutgers.edu (Charles Mcgrew) (12/12/89)
Submitted-by: everson@compsci.bristol.ac.uk Posting-number: Volume 1, Issue 86 Archive-name: alv/part02 #! /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 2 (of 10)." # Contents: doc/blackwhite.ms doc/installation.ms # doc/man/man1/array2ras.1 doc/man/man1/blend.1 # doc/man/man1/convert.1 doc/man/man1/hist.1 doc/man/man1/hough.1 # doc/man/man1/ras2array.1 doc/man/man1/ras2lw.1 # doc/man/man1/rasremap.1 doc/man/man1/rasscale.1 # doc/man/man1/rasval.1 doc/man/man1/scr2ras.1 doc/man/man1/winlev.1 # src/box.c src/convert.c src/dither.c src/equalise.c src/halftone.c # src/invert.c src/p_confirm.c src/p_include.h src/ras2im.c # src/rasinfo.c src/rasrange.c src/rasregion.c src/rasthresh.c # Wrapped by everson@kukini on Tue Oct 17 07:45:06 1989 PATH=/bin:/usr/bin:/usr/ucb ; export PATH if test -f 'doc/blackwhite.ms' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'doc/blackwhite.ms'\" else echo shar: Extracting \"'doc/blackwhite.ms'\" \(1304 characters\) sed "s/^X//" >'doc/blackwhite.ms' <<'END_OF_FILE' X.SH Using ALV with a Black and White Sun Workstation X.PP Due to the modularity of the X.I ALV toolkit, the only program which requires knowledge of whether it is running on a black and white or a colour Sun workstation is X.I dsp (1). X X.I Dsp (1) is able to decide for itself whether you are using a black and white workstation. If you are, then after reading in the image it checks to see whether the depth of the image allows it to be directly displayed. If not directly displayable and the image is less than 8 bits deep, then it is passed through a program to convert it to 1 bit depth. The program used is specified at compile time and is normally X.I ras8to1 (1). This program allows conversion of both colour and greyscale images using error diffusion, dot diffusion or ordered dither together with optional edge enhancement. X.PP To set which options X.I ras8to1 (1) is to use modify your X.I ~/.alv_profile (5) file (or the file specified in your X.I ALV shell environment variable) to, say for dot diffusion with edge enhancement, to include the line: X.IP ras8to1:-d -e X.PP The program used to convert to 1 bit depth can be altered by specifying the -8filter option to X.I dsp (1) or, for a slightly more permanent change, adding or altering the X.I dsp (1) line in your X.I ~/.alv_profile (5) file. END_OF_FILE if test 1304 -ne `wc -c <'doc/blackwhite.ms'`; then echo shar: \"'doc/blackwhite.ms'\" unpacked with wrong size! fi # end of 'doc/blackwhite.ms' fi if test -f 'doc/installation.ms' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'doc/installation.ms'\" else echo shar: Extracting \"'doc/installation.ms'\" \(1189 characters\) sed "s/^X//" >'doc/installation.ms' <<'END_OF_FILE' X.SH Installation X.PP Installing the software is fairly simple, viz: X.IP 1) cd to the src directory X.IP 2) Decide whether you want to merge the object code of the toolkit into a single binary. This will save you considerable amounts of disk space X(approx 6Meg) under SUNOS 3.5 or earlier and about 0.5Meg under SUNOS4.0 or higher. If you do decide to do this then execute the following commands: X.br X cp Makefile Makefile-standalone X.br X cp Makefile-merge Makefile X.br If you do not want to do this (you are probably running SUNOS4.0 or later in this case), ie you want to compile each program standalone, then simply continue. X.IP 3) XEdit the Makefile, setting the variables BINDIR, MANDIR, FILDIR to be the desired directory locations of the compiled programs, the manual pages and the filters respectively. NB. The -DSUNOS3 option is no longer needed. X.IP 4) Type "make install". The compilation could take up to 15 minutes. X.IP 5) XEmail alv-users-request@cs.bris.ac.uk to ask to join the support mailing list. NB: If you received this distribution direct from the author via email, you are already on this list. X.PP You are advised to read the tutorial before working with the toolkit. END_OF_FILE if test 1189 -ne `wc -c <'doc/installation.ms'`; then echo shar: \"'doc/installation.ms'\" unpacked with wrong size! fi # end of 'doc/installation.ms' fi if test -f 'doc/man/man1/array2ras.1' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'doc/man/man1/array2ras.1'\" else echo shar: Extracting \"'doc/man/man1/array2ras.1'\" \(1537 characters\) sed "s/^X//" >'doc/man/man1/array2ras.1' <<'END_OF_FILE' X.TH ARRAY2RAS 1 "15th January 1989" X.SH NAME array2ras \- convert array format to raster X.SH SYNOPSIS X.B array2ras X[ X.B -X xsize X] X[ X.B -Y ysize X] X[ X-d depth X] X[ X.B "infile | -" X] X[ X.B "outfile | -" X] X.SH DESCRIPTION X.I Array2ras converts an array format, of unsigned chars, shorts or longs, to a raster. The array is stored in row major order. (ie x dimension varies fastest). X.PP Note that this command uses files of exactly the correct format for use with the X.I taread (1) command included in the software for Sun's TAAC1 application accelerator. X.SH OPTIONS The X.I -X option specifies the X dimension of the raster. The default is 512. X.PP The X.I -Y option specifies the Y dimension of the raster. The default is 512. X.PP The X.I -d option specifies the depth of the raster. The default is 8. 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 ras2array (1) , X.BI taread (1) , X.BI alv_profile (5) , X.BI "TAAC-1 User Guide" 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.IP "mem_create returned NULL" There was insufficient memory available to allocate space for an raster in memory. X.IP "Can't read images of that depth" The program is only able to read images of 8, 16 or 32 bits deep. X.IP "Error reading image data (possible file size error)" Reading a row of the raster from the input stream failed. END_OF_FILE if test 1537 -ne `wc -c <'doc/man/man1/array2ras.1'`; then echo shar: \"'doc/man/man1/array2ras.1'\" unpacked with wrong size! fi # end of 'doc/man/man1/array2ras.1' fi if test -f 'doc/man/man1/blend.1' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'doc/man/man1/blend.1'\" else echo shar: Extracting \"'doc/man/man1/blend.1'\" \(1438 characters\) sed "s/^X//" >'doc/man/man1/blend.1' <<'END_OF_FILE' X.TH BLEND 1 "15th January 1989" X.SH NAME blend \- blend two rasters X.SH SYNOPSIS X.B blend X[ X.BI -f filename1 X] X[ X.BI -w weighting1 X] X[ X.BI -F filename2 X] X[ X.BI -W weighting2 X] X[ X.B "outfile | -" X] X.SH DESCRIPTION X.I Blend takes two images as input and merges the two together on a pixel by pixel basis using a weighting factor for each image. X.SH OPTIONS The two images are specified to the program by each using a pair of command line arguments ( X.BI -f filename1 -w weighting1 and X.BI -F filename2 -W weighting2 X). If either the -f or -F arguments are not present then the program attempts to read that image from its standard input stream. X.PP If either the -w or -W arguments are not present then the default weighting of 1 is used for the appropriate image. 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 alternate profile. X.SH "SEE ALSO" X.BI alv (1) , X.BI alv_profile (5) , X.BI rasterfile (5) X.SH DIAGNOSTICS X.IP "Image dimensions not equal" Only 2 images of identical dimensions (including depth) may be merged. X.IP "Can't blend an image with itself" This message is often seen when neither -f nor -F options are specifed and the program attempts to merge the image on the standard input with itself. X.IP "Can't open filename" The program does not have the required access permissions to the file or it doesn't exist. END_OF_FILE if test 1438 -ne `wc -c <'doc/man/man1/blend.1'`; then echo shar: \"'doc/man/man1/blend.1'\" unpacked with wrong size! fi # end of 'doc/man/man1/blend.1' fi if test -f 'doc/man/man1/convert.1' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'doc/man/man1/convert.1'\" else echo shar: Extracting \"'doc/man/man1/convert.1'\" \(1571 characters\) sed "s/^X//" >'doc/man/man1/convert.1' <<'END_OF_FILE' X.TH CONVERT 1 "15th January 1989" X.SH NAME convert \- convert text file to raster X.SH SYNOPSIS X.B convert X[ X.B -w width X] X[ X.B -h height X] X[ X.B -d depth X] X[ X.B "infile | -" X] X[ X.B "outfile | -" X] X.SH DESCRIPTION X.I Convert converts a textual representation of a raster into a raster. This is particularly useful in creating simple images using a text editor, such as X.I vi (1) and then X.I convert (1) to convert the image to a raster format. X.PP The textual format is a list of positive integers, separated by whitespace (spaces, blanks and new-lines) and each representing an individual pixel. The pixels are listed in row-major order ( x-dimension varies fastest). The following is valid input for X.I convert (1) : X.sp X.br X1 1 1 1 1 1 1 1 1 1 X.br X0 1 2 1 2 1 2 1 2 0 X.br X0 2 2 3 4 2 1 2 23 3 X.br X3 3 6 7 2 6 72 87 7 1 0 X.br X.SH OPTIONS Theconvolve.1 X X.I -w option specifies the input width. The default value is 10. X.PP The X.I -h option specifies the input height. The default value is 10. X.PP The X.I -d option specifies the input depth. The default value is 8. 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 vi (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.IP "mem_create returned NULL" There was insufficient memory available to allocate space for an raster in memory. END_OF_FILE if test 1571 -ne `wc -c <'doc/man/man1/convert.1'`; then echo shar: \"'doc/man/man1/convert.1'\" unpacked with wrong size! fi # end of 'doc/man/man1/convert.1' fi if test -f 'doc/man/man1/hist.1' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'doc/man/man1/hist.1'\" else echo shar: Extracting \"'doc/man/man1/hist.1'\" \(1455 characters\) sed "s/^X//" >'doc/man/man1/hist.1' <<'END_OF_FILE' X.TH HIST 1 "15th January 1989" X.SH NAME hist \- display histogram of a raster X.SH SYNOPSIS X.B hist X[ X.B -l X] X[ X.B -v X] X[ X.B -b X] X[ X.B "infile | -" X] X.SH DESCRIPTION X.I Hist displays a X.I sunview (1) window containing a histogram of the input raster. The X axis represents the greylevel intensities and the Y axis represents their occurance. X.PP The mean, median, mode, standard deviation, maximum greylevel and minimum greylevels are printed out on the standard error stream of the tool. X.SH OPTIONS The X.B -l option causes a logarithmic histogram to be displayed. X.PP The X.B -v option causes the histogram to have vertical lines drawn between greylevel histogram bars. X.PP The X.B -b option causes the bit restrict option to be set for this tool, overriding the setting in X.I ~/.alv_profile (5). This is useful for images which do not use the whole range of greylevel intensities available to them as the extra time of setting up blank areas of the histogram are avoided. X.PP X.I Hist takes standard X.I sunview (1) arguments for positioning the window etc. 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 sunveiw (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. END_OF_FILE if test 1455 -ne `wc -c <'doc/man/man1/hist.1'`; then echo shar: \"'doc/man/man1/hist.1'\" unpacked with wrong size! fi # end of 'doc/man/man1/hist.1' fi if test -f 'doc/man/man1/hough.1' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'doc/man/man1/hough.1'\" else echo shar: Extracting \"'doc/man/man1/hough.1'\" \(1470 characters\) sed "s/^X//" >'doc/man/man1/hough.1' <<'END_OF_FILE' X.TH HOUGH 1 "1st March 1989" X.SH NAME hough \- perform hough transformation X.SH SYNOPSIS X.B hough X[ X.B "infile | -" X] X[ X.B "outfile | -" X] X.SH DESCRIPTION X.I Hough perfoms a hough transform on a 1 bit deep raster to produce an 8 bit deep output of hough space. X.PP In the output raster the X axis represents theta and the Y axis r. The origin for the the hough transformation is taken to be the centre of the image so as to keep the range of r, and hence the size of the final image, to a minimum. X.PP Integer lookup tables for sin and cos are used. These record the actual value * 1000. This has the effect of workimg to three decimal places but speeds up the transformation tremendously; however, this will cause a loss of accuracy on values of r over 1000. As the maximum possible value of r for a normal (256 x 256) image is 181, this should not be a problem. The transformation is only performed over 180 degrees as the 'second half' is just a reflection of the first 180 degrees and is not necessary. 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 "Can't open file" The file does not have the correct access permissions to the file, or it does not exist. X.IP "Input Image must be 1 bit deep" The program can only operate on bi-level images. END_OF_FILE if test 1470 -ne `wc -c <'doc/man/man1/hough.1'`; then echo shar: \"'doc/man/man1/hough.1'\" unpacked with wrong size! fi # end of 'doc/man/man1/hough.1' fi if test -f 'doc/man/man1/ras2array.1' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'doc/man/man1/ras2array.1'\" else echo shar: Extracting \"'doc/man/man1/ras2array.1'\" \(1441 characters\) sed "s/^X//" >'doc/man/man1/ras2array.1' <<'END_OF_FILE' X.TH RAS2ARRAY 1 "15th January 1989" X.SH NAME ras2array \- convert raster to array format X.SH SYNOPSIS X.B ras2array X[ X.B "infile | -" X] X[ X.B "outfile | -" X] X.SH DESCRIPTION X.I Ras2array converts the raster to an array format, of unsigned chars, shorts or longs, depending whether the raster depth is upto 8bits, 16 bits, or 32 bits respectively. The array is stored in row major order. (ie x dimension varies fastest). X.PP Note that this command produces files of exactly the correct format for use with the X.I taload (1) command included in the software for Sun's TAAC1 application accelerator. X.PP This allows rasters to be loaded upto the TAAC, be processed on it X(perhaps using the image processing demo, ip) and then downloaded back to a raster using X.I taread (1) and X.I array2ras (1). 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 taload (1) , X.BI alv_profile (5) , X.BI "TAAC-1 User Guide" 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.IP "Don't know how to write 24 bit images" The program is unable to write 24 bit images. X.I ta_load (1) is also unable to read them. X.IP "Error writing image data (possible file size error)" Writing a row of the raster to the output stream failed. END_OF_FILE if test 1441 -ne `wc -c <'doc/man/man1/ras2array.1'`; then echo shar: \"'doc/man/man1/ras2array.1'\" unpacked with wrong size! fi # end of 'doc/man/man1/ras2array.1' fi if test -f 'doc/man/man1/ras2lw.1' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'doc/man/man1/ras2lw.1'\" else echo shar: Extracting \"'doc/man/man1/ras2lw.1'\" \(1615 characters\) sed "s/^X//" >'doc/man/man1/ras2lw.1' <<'END_OF_FILE' X.TH RAS2LW 1 "15th January 1989" X.SH NAME ras2lw \- print raster on postscript printer X.SH SYNOPSIS X.B ras2lw X[ X.B -m X] X[ X.B -s X] X[ X.B -l X] X[ X.B -t title-string X] X[ X.B -T X] X[ X.B "infile | -" X] X X.SH DESCRIPTION X.I Ras2lw prints a raster on a postscript printer, such as a Sun Laserwriter. X.SH OPTIONS X.PP The X.I -m option causes email to be sent to you when the printout has completed. (Useful if your office is down the corridor from the printer). X.PP The X.I -s option causes the image to be scaled so as to approximately fill half of a page of A4 paper. This is the default. X.PP The X.I -l option causes the image to be scaled so as to fill a page of A4 paper. X.PP The X.I -t option allows the user to speciy a title for the image which will be printed above the image X.PP The X.I -T option causes the postscript needed to display the picture to be displayed on the standard output in a format suitable for including in TeX documents using the TeX X.I special command. 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 print images with depth greater than 8 bits" The program can only print images of 8 bits depth or less. X.IP "Cannot open a pipe to lpr" The program was unable to open a pipe to lpr. Possibly the program name has been incorrectly specified when installed. X.IP "Can't open file" The file does not have the correct access permissions to the file, or it does not exist. X END_OF_FILE if test 1615 -ne `wc -c <'doc/man/man1/ras2lw.1'`; then echo shar: \"'doc/man/man1/ras2lw.1'\" unpacked with wrong size! fi # end of 'doc/man/man1/ras2lw.1' fi if test -f 'doc/man/man1/rasremap.1' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'doc/man/man1/rasremap.1'\" else echo shar: Extracting \"'doc/man/man1/rasremap.1'\" \(1592 characters\) sed "s/^X//" >'doc/man/man1/rasremap.1' <<'END_OF_FILE' X.TH RASREMAP 1 "30th March 1989" X.SH NAME rasremap \- map image pixel values to their lookup table values X.SH SYNOPSIS X.B rasremap X[ X.B -f rasterfile X] X[ X.B -l LUTfile X] X[ X.B "outfile | -" X] X.SH DESCRIPTION X.I Rasremap produces a Sun rasterfile with a 1:1 mapping of pixel values to display values, and a maptype of RMT_EQUAL_RGB. If the input file already has such a lookup table (LUT), the image pixel values are translated to their LUT equivalents. If an input LUT file (produced by X.I cst X) is specified, these values are used for the translation. In this way, a contrast-stretch or other image enhancement expressed through the LUTs can be imprinted on the actual pixel values. This is useful if the image is to be further processed by programs which ignore LUTs. The complete rasterfile consists of 800 bytes of header information + image data. This program is only suitable for greyscale images. X.SH OPTIONS The X.I -l option specifies a 768-byte LUT, such as is produced by X.I cst. X.PP 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 cst (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.IP "This isn't a Sun rasterfile" The file does not begin with the magic number 0x59a66a95 . X.SH AUTHOR Bryan Dawson, Keele University Geography Dept. (JANET: ged08@keele.seq1) X X END_OF_FILE if test 1592 -ne `wc -c <'doc/man/man1/rasremap.1'`; then echo shar: \"'doc/man/man1/rasremap.1'\" unpacked with wrong size! fi # end of 'doc/man/man1/rasremap.1' fi if test -f 'doc/man/man1/rasscale.1' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'doc/man/man1/rasscale.1'\" else echo shar: Extracting \"'doc/man/man1/rasscale.1'\" \(1170 characters\) sed "s/^X//" >'doc/man/man1/rasscale.1' <<'END_OF_FILE' X.TH RASSCALE 1 "15th January 1989" X.SH NAME rasscale, double, triple, quad, half, third, quarter \- scale a raster X.SH SYNOPSIS X.B rasscale X[ X.B -s scale X] X[ X.B "infile | -" X] X[ X.B "outfile | -" X] X.SH DESCRIPTION X.I Rasscale scales a raster using pixel replication/pixel subsampling by the specified scaling factor. X.PP If a symbolic link is made to the program, using X.I ld (1), and is called X.I double (1), X.I triple (1), X.I quad (1), X.I half (1), X.I third (1) or X.I quarter (1) and the symbolic link to the program is then executed the raster will be scaled by the appropriate scaling factor. X.SH OPTIONS The X.I -s option specifies the scaling factor. The default is 1. 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 "Can't open file" The file does not have the correct access permissions to the file, or it does not exist. X.IP "mem_create returned NULL" There was insufficient memory available to allocate space for an raster in memory. X X END_OF_FILE if test 1170 -ne `wc -c <'doc/man/man1/rasscale.1'`; then echo shar: \"'doc/man/man1/rasscale.1'\" unpacked with wrong size! fi # end of 'doc/man/man1/rasscale.1' fi if test -f 'doc/man/man1/rasval.1' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'doc/man/man1/rasval.1'\" else echo shar: Extracting \"'doc/man/man1/rasval.1'\" \(1340 characters\) sed "s/^X//" >'doc/man/man1/rasval.1' <<'END_OF_FILE' X.TH RASVAL 1 "15th January 1989" X.SH NAME rasval \- print greylevels of a raster X.SH SYNOPSIS X.B rasval X[ X.B -x xoffset X] X[ X.B -y yoffset X] X[ X.B -X xsize X] X[ X.B -Y ysize X] X[ X.B -n X] X[ X.B "infile | -" X] X.SH DESCRIPTION X.I Rasval displays the greylevels of a region of the input raster. By default, X.I rasval displays the greylevels present in a 10 by 10 cell square in the top left hand corner of the raster. X.SH OPTIONS The X.I -x option specifies the x offset. The default is 0. X.PP The X.I -y option specifies the y offset. The default is 0. X.PP The X.I -X option specifies the X size of the output display. The default is 10. X.PP The X.I -Y option specifies the Y size of the output display. The default is 10. X.PP The X.I -n option causes no headers to be printed. The output is then suitable for use as input to X.I convert (1). 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 convert (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.IP "pr_region returned NULL" There was insufficient memory available to allocate space for an raster in memory. END_OF_FILE if test 1340 -ne `wc -c <'doc/man/man1/rasval.1'`; then echo shar: \"'doc/man/man1/rasval.1'\" unpacked with wrong size! fi # end of 'doc/man/man1/rasval.1' fi if test -f 'doc/man/man1/scr2ras.1' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'doc/man/man1/scr2ras.1'\" else echo shar: Extracting \"'doc/man/man1/scr2ras.1'\" \(1162 characters\) sed "s/^X//" >'doc/man/man1/scr2ras.1' <<'END_OF_FILE' X.TH SCR2RAS 1 "15th January 1989" X.SH NAME scr2ras \- interactive screendump X.SH SYNOPSIS X.B scr2ras X[ X.B "outfile | -" X] X.SH DESCRIPTION X.I Scr2ras changes the mouse cursor to be a corner of an expanding box. If the user presses the left mouse button and, while holding down the button, moves the mouse so as to expand the box and then releases the button, a raster of the area bounded by the box will be output. X.PP The program runs under X.I sunview (1) 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 sunview (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.IP "Can't open /dev/fb" The frame buffer device does not exist. X.IP "mem_create returned NULL" There was insufficient memory available to allocate space for an raster in memory. X.SH "ORIGINAL AUTHOR" Originally written by Richard Tobin, Applications Institute, Edinburgh University, UK (1987). X.SH BUGS None END_OF_FILE if test 1162 -ne `wc -c <'doc/man/man1/scr2ras.1'`; then echo shar: \"'doc/man/man1/scr2ras.1'\" unpacked with wrong size! fi # end of 'doc/man/man1/scr2ras.1' fi if test -f 'doc/man/man1/winlev.1' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'doc/man/man1/winlev.1'\" else echo shar: Extracting \"'doc/man/man1/winlev.1'\" \(1335 characters\) sed "s/^X//" >'doc/man/man1/winlev.1' <<'END_OF_FILE' X.TH WINLEV 1 "15th January 1989" X.SH NAME winlev \- map raster to 8 bits deep X.SH SYNOPSIS X.B winlev X[ X.B -w window X] X[ X.B -l level X] X[ X.B "infile | -" X] X[ X.B "outfile | -" X] X.SH DESCRIPTION X.I Winlev converts a raster to 8 bits deep by mapping the 8 bits of output image to a window within the N bits of input image. X.SH OPTIONS The X.I -w option specifies the window size. The default value is 512. X.PP The X.I -l option specifies the position of the centre of the window in the input greylevels. This is known as the level and is set to the mean greylevel of the input image by default. 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 "level setting outside range of levels in image" Attempting to position the window outside the range of levels available. X.IP "window setting outside range of levels in image" Attempting to position the window outside the range of levels available. X.IP "Can't open file" The file does not have the correct access permissions to the file, or it does not exist. X.IP "mem_create returned NULL" There was insufficient memory available to allocate space for an raster in memory. X END_OF_FILE if test 1335 -ne `wc -c <'doc/man/man1/winlev.1'`; then echo shar: \"'doc/man/man1/winlev.1'\" unpacked with wrong size! fi # end of 'doc/man/man1/winlev.1' fi if test -f 'src/box.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'src/box.c'\" else echo shar: Extracting \"'src/box.c'\" \(1271 characters\) sed "s/^X//" >'src/box.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 box_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 colormap_t colormap; 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, &colormap)) == NULL) X error(PR_IO_ERR_RASREAD); X X if (bitrestrict) X levels = calc_max(pr)+1; X else X levels = MAXLEVEL(pr->pr_depth); X X pr_vector(pr, 0, 0, pr->pr_size.x - 1, 0, PIX_SRC, levels); X pr_vector(pr, pr->pr_size.x - 1, 0, pr->pr_size.x - 1, pr->pr_size.y - 1, PIX_SRC, levels); X pr_vector(pr, pr->pr_size.x - 1, pr->pr_size.y - 1, 0, pr->pr_size.y - 1, PIX_SRC, levels); X pr_vector(pr, 0, pr->pr_size.y - 1, 0, 0, PIX_SRC, levels); X X pr_dump(pr, stdout, &colormap, RT_STANDARD, 0); X} END_OF_FILE if test 1271 -ne `wc -c <'src/box.c'`; then echo shar: \"'src/box.c'\" unpacked with wrong size! fi # end of 'src/box.c' fi if test -f 'src/convert.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'src/convert.c'\" else echo shar: Extracting \"'src/convert.c'\" \(1463 characters\) sed "s/^X//" >'src/convert.c' <<'END_OF_FILE' X#include "defs.h" X char *progname; X X#ifdef STANDALONE main(argc, argv, envp) X#else convert_main(argc, argv, envp) X#endif X int argc; X char **argv; X char **envp; X{ X register int i, j; X int width, height; X int depth, depth_reqd; X Pixrect *pr; X int ival; X int files; X int minval, maxval; X X width = height = 10; X depth_reqd = 8; X X progname = strsave(argv[0]); X parse_profile(&argc, argv, envp); X X while ((gc = getopt(argc, argv, "w:h:d:")) != EOF) X switch (gc) { X case 'w': X width = atoi(optarg); X break; X case 'h': X height = atoi(optarg); X break; X case 'd': X depth_reqd = atoi(optarg); X break; X case '?': X errflag++; X break; X } X X if (errflag) X error((char *) 0, "Usage: %s: [-w width] [-h height] [-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 = ROUND_DEPTH(depth_reqd)) == NOT_SUPPORTED) X error(ALV_ERR_DEPTH_NO_SUPPORT); X X maxval = MAXLEVEL(depth_reqd); X minval = 0; X X if ((pr = mem_create(width, height, depth)) == NULL) X error("mem_create returned NULL"); X X for (j = 0; j < height; j++) X for (i = 0; i < width; i++) { X scanf("%d", &ival); X ival = MAX(minval, ival); X ival = MIN(maxval, ival); X pr_put(pr, i, j, ival); X } X X pr_dump(pr, stdout, NULL, RT_STANDARD, 0); X} END_OF_FILE if test 1463 -ne `wc -c <'src/convert.c'`; then echo shar: \"'src/convert.c'\" unpacked with wrong size! fi # end of 'src/convert.c' fi if test -f 'src/dither.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'src/dither.c'\" else echo shar: Extracting \"'src/dither.c'\" \(1638 characters\) sed "s/^X//" >'src/dither.c' <<'END_OF_FILE' X#include <stdio.h> X#include "defs.h" X int mask[] = { X 126, 222, 167, 200, 216, 181, X 230, 210, 94, 72, 242, 232, X 153, 111, 36, 52, 193, 255, X 200, 216, 181, 126, 222, 167, X 72, 242, 232, 230, 210, 94, X 52, 193, 255, 153, 111, 36 X}; X#define BOXSIZE 6 X char *progname; char *filename; Pixrect *pr1, *pr2; X X#ifdef STANDALONE main(argc, argv, envp) X#else dither_main(argc, argv, envp) X#endif X int argc; X char **argv; X char **envp; X{ X int boxsize; X int mp; X register int i, j, x, y; X int levels; X X boxsize = BOXSIZE; 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 != 8) X error("Input image not 8 bits deep"); X X if ((pr2 = mem_create(pr1->pr_size.x, pr1->pr_size.y, 1)) == NULL) X error("mem_create returned NULL"); X X for (y = 0; y < pr1->pr_size.y; y += boxsize) X for (x = 0; x < pr1->pr_size.x; x += boxsize) X for (j = 0, mp = 0; j < boxsize; j++) X for (i = 0; i < boxsize; i++) X pr_put(pr2, x + i, y + j, (pr_get(pr1, x + i, y + j) > mask[mp++]) ? 0 : 1); X X pr_dump(pr2, stdout, NULL, RT_STANDARD, 0); X} END_OF_FILE if test 1638 -ne `wc -c <'src/dither.c'`; then echo shar: \"'src/dither.c'\" unpacked with wrong size! fi # end of 'src/dither.c' fi if test -f 'src/equalise.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'src/equalise.c'\" else echo shar: Extracting \"'src/equalise.c'\" \(1622 characters\) sed "s/^X//" >'src/equalise.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 equalise_main(argc, argv, envp) X#endif X int argc; X char **argv; X char **envp; X{ X register int i, j; X int temp, n; X int hist[10000][2]; X int sum, max_val; X X progname = strsave(argv[0]); X parse_profile(&argc, argv, envp); X X strcpy(filename, "stdin"); 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 if (pr->pr_depth == 1) { X pr_dump(pr, stdout, NULL, RT_STANDARD, 0); X exit(0); X } X X if (bitrestrict) X max_val = calc_max(pr); X else X max_val = MAXLEVEL(pr->pr_depth); X X for (i = 0; i < max_val; i++) X hist[i][0] = hist[i][1] = 0; X X for(i=0;i<pr->pr_size.x;i++) X for(j=0;j<pr->pr_size.y;j++) X hist[pr_get(pr,i,j)][0]++; X X n = pr->pr_size.x * pr->pr_size.y; X sum = 0; X for (i = 0; i < max_val; i++) { X sum += hist[i][0]; X temp = sum * max_val / n; X temp = (temp > max_val) ? max_val : temp; X hist[i][1] = temp; X } X X for(i=0;i<pr->pr_size.x;i++) X for(j=0;j<pr->pr_size.y;j++) X pr_put(pr,i ,j , hist[pr_get(pr,i,j)][1]); X X pr_dump(pr, stdout, NULL, RT_STANDARD, 0); X} END_OF_FILE if test 1622 -ne `wc -c <'src/equalise.c'`; then echo shar: \"'src/equalise.c'\" unpacked with wrong size! fi # end of 'src/equalise.c' fi if test -f 'src/halftone.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'src/halftone.c'\" else echo shar: Extracting \"'src/halftone.c'\" \(1727 characters\) sed "s/^X//" >'src/halftone.c' <<'END_OF_FILE' X#include <stdio.h> X#include "defs.h" X#include "pattern.h" X char *progname; char *filename; Pixrect *pr1, *pr2; X X#ifdef STANDALONE main(argc, argv, envp) X#else halftone_main(argc, argv, envp) X#endif X int argc; X char **argv; X char **envp; X{ X register int i, j; X int x, y; X int *p_pat; X Pixrect *pattern; X int bs_cu; 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 != 8) X error("image not 8 bits deep"); X X if ((pattern = mem_create(BOXSIZE, BOXSIZE * 50, 1)) == NULL) X error("mem_create returned NULL");; X X if ((pr2 = mem_create(pr1->pr_size.x * BOXSIZE, pr1->pr_size.y * BOXSIZE, 1)) == NULL) X error("mem_create returned NULL"); X X p_pat = &pat[0]; X for (y = 0; y < BOXSIZE * 10; y++) X for (x = 0; x < BOXSIZE; x++, p_pat++) X pr_rop(pattern, x, y, 1, 1, (*p_pat) ? PIX_CLR : PIX_SET, (Pixrect *) 0, 0, 0); X X bs_cu = BOXSIZE * BOXSIZE * BOXSIZE; X for (j = 0; j < pr1->pr_size.y; j++) X for (i = 0; i < pr1->pr_size.x; i++) X pr_rop(pr2, i * BOXSIZE, j * BOXSIZE, BOXSIZE, BOXSIZE, PIX_SRC, pattern, 0, BOXSIZE * ((pr_get(pr1, i, j) + (bs_cu - 1)) / bs_cu)); X X pr_dump(pr2, stdout, NULL, RT_STANDARD, 0); X} END_OF_FILE if test 1727 -ne `wc -c <'src/halftone.c'`; then echo shar: \"'src/halftone.c'\" unpacked with wrong size! fi # end of 'src/halftone.c' fi if test -f 'src/invert.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'src/invert.c'\" else echo shar: Extracting \"'src/invert.c'\" \(1184 characters\) sed "s/^X//" >'src/invert.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 invert_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 int val; X colormap_t colormap; 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, &colormap)) == NULL) X error(PR_IO_ERR_RASREAD); X X if (bitrestrict) X levels = calc_max(pr)+1; X else X levels = MAXLEVEL(pr->pr_depth); X X for (j = 0; j < pr->pr_size.y; j++) X for (i = 0; i < pr->pr_size.x; i++) { X val = abs(levels - pr_get(pr,i,j)); X pr_put(pr, i, j, val); X } X X pr_dump(pr, stdout, &colormap, RT_STANDARD, 0); X} END_OF_FILE if test 1184 -ne `wc -c <'src/invert.c'`; then echo shar: \"'src/invert.c'\" unpacked with wrong size! fi # end of 'src/invert.c' fi if test -f 'src/p_confirm.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'src/p_confirm.c'\" else echo shar: Extracting \"'src/p_confirm.c'\" \(1190 characters\) sed "s/^X//" >'src/p_confirm.c' <<'END_OF_FILE' X/*************************************** palettetool_confirm.c ******** X * by Hsuan Chang (hsc%vanderbilt@csnet-relay) X * 7/1/87 X */ X#include <suntool/sunview.h> X#include <suntool/canvas.h> X#include <suntool/panel.h> X#include <stdio.h> X extern Frame base_frame; X X/* confirm procedure */ confirm() X{ X struct fullscreen *fsh; X struct inputevent event; X int fd, X result; X X /* obtain handles to the whole tool and its environment */ X fd = (int)window_get(base_frame, WIN_FD); X fsh = (struct fullscreen *)fullscreen_init(fd); X X /* replace the cursor with a confirm cursor */ X window_set(base_frame, X WIN_CONSUME_PICK_EVENTS, WIN_NO_EVENTS, WIN_MOUSE_BUTTONS, 0, X 0); X /* X * confirm loop, only mouse button press will terminate it. X * the screen blinks if other events occur X */ X while (TRUE) { X if (input_readevent(fd, &event) == -1) { X perror("Cursor_confirm input failed"); X abort(); X } X switch (event.ie_code) { X case MS_MIDDLE: X case MS_RIGHT: X result = FALSE; X break; X case MS_LEFT: X result = TRUE; X break; X default: X continue; X } X break; X } X /* get back to normal environment */ X fullscreen_destroy(fsh); X return(result); X} END_OF_FILE if test 1190 -ne `wc -c <'src/p_confirm.c'`; then echo shar: \"'src/p_confirm.c'\" unpacked with wrong size! fi # end of 'src/p_confirm.c' fi if test -f 'src/p_include.h' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'src/p_include.h'\" else echo shar: Extracting \"'src/p_include.h'\" \(1309 characters\) sed "s/^X//" >'src/p_include.h' <<'END_OF_FILE' X#include "defs.h" X X#define MAX_CMAP_LEN 256 X#define FGCOLOR MAX_CMAP_LEN-1 X#define BGCOLOR 0 X#define CMAP_NAME "palette" X X#define set_color(q,i,j,k) r[q]=i; g[q]=j; b[q]=k X#define ijton(i,j) 24*j+i X unsigned char r[MAX_CMAP_LEN], X g[MAX_CMAP_LEN], X b[MAX_CMAP_LEN]; /* current copy of the colormap */ X unsigned char old_r, old_g, old_b; X/* right-mouse-paint saved copy, length */ unsigned char undo_r[MAX_CMAP_LEN], X undo_g[MAX_CMAP_LEN], X undo_b[MAX_CMAP_LEN]; int undo_start, undo_len; X char *progname; int selected_i; int selected_j; int selected_n; int hi, hj; int highlighted; int selected; char s[256]; X int xoff; int yoff; int xspace; int yspace; int cwidth; int cheight; int bar_offset; X X XFrame base_frame; Canvas single_canvas, X display_canvas, X multiple_canvas; Panel control_panel; Panel_item file_name_item, X red_slider, X green_slider, X blue_slider, X msg_item; Pixrect *pr; colormap_t colormap; Cursor brush_cursor; X extern void draw_a_box(), X fill_a_box(), X reset_proc(), X save_proc(), X load_proc(), X done_proc(), X quit_proc(), X red_proc(), X green_proc(), X blue_proc(), X paint_multiple_canvas(), X paint_single_canvas(), X multiple_canvas_event_proc(), X display_event_proc(), X single_canvas_event_proc(), X put_colors(), X update_colors(); END_OF_FILE if test 1309 -ne `wc -c <'src/p_include.h'`; then echo shar: \"'src/p_include.h'\" unpacked with wrong size! fi # end of 'src/p_include.h' fi if test -f 'src/ras2im.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'src/ras2im.c'\" else echo shar: Extracting \"'src/ras2im.c'\" \(1297 characters\) sed "s/^X//" >'src/ras2im.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 ras2im_main(argc, argv, envp) X#endif X int argc; X char **argv; X char **envp; X{ X register int i, j; X char title[252]; X X for (i = 0; i < 252; i++) X title[i] = '\0'; X X progname = strsave(argv[0]); X parse_profile(&argc, argv, envp); X strcpy(title, "stdin"); 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 if (stream == 1) X strcpy(title, argv[optind]); X } X X if ((pr = pr_load(stdin, NULL)) == NULL) X error(PR_IO_ERR_RASREAD); X X if (pr->pr_depth != 8) X error("old ALV image format files must be 8 bits deep"); X X putw(pr->pr_size.x << 16 | pr->pr_size.y, stdout); X X for (i = 0; i < 252; i++) X putc(title[i], stdout); X X for (j = 0; j < pr->pr_size.y; j++) X for (i = 0; i < pr->pr_size.x; i++) X putc(pr_get(pr, i, j), stdout); X} END_OF_FILE if test 1297 -ne `wc -c <'src/ras2im.c'`; then echo shar: \"'src/ras2im.c'\" unpacked with wrong size! fi # end of 'src/ras2im.c' fi if test -f 'src/rasinfo.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'src/rasinfo.c'\" else echo shar: Extracting \"'src/rasinfo.c'\" \(1400 characters\) sed "s/^X//" >'src/rasinfo.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 rasinfo_main(argc, argv, envp) X#endif X int argc; X char **argv; X char **envp; X{ X int i; X int print_cmap = FALSE, print_size = TRUE; X colormap_t colormap; X X progname = strsave(argv[0]); X parse_profile(&argc, argv, envp); X X while ((gc = getopt(argc, argv, "nc")) != EOF) X switch (gc) { X case 'n': X print_size = FALSE; X break; X case 'c': X print_cmap = TRUE; X break; X case '?': X errflag++; X break; X } X X if (errflag) X error((char *) 0, "Usage: %s: [-c] [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 ((pr = pr_load(stdin, &colormap)) == NULL) X error(PR_IO_ERR_RASREAD); X X if (print_size) { X printf("xsize = %d\n", pr->pr_size.x); X printf("ysize = %d\n", pr->pr_size.y); X printf("depth = %d\n", pr->pr_depth); X } X X if (print_cmap) { X printf("Colourmap length = %d\n", colormap.length); X if (colormap.length == 0) X printf("No colourmap associated with image - ALV tools assume greyscale\n"); X else X for (i = 0; i < colormap.length; i++) X printf("%d: %d %d %d\n", i, colormap.map[0][i], colormap.map[1][i], colormap.map[2][i]); X } X} END_OF_FILE if test 1400 -ne `wc -c <'src/rasinfo.c'`; then echo shar: \"'src/rasinfo.c'\" unpacked with wrong size! fi # end of 'src/rasinfo.c' fi if test -f 'src/rasrange.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'src/rasrange.c'\" else echo shar: Extracting \"'src/rasrange.c'\" \(1442 characters\) sed "s/^X//" >'src/rasrange.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 rasrange_main(argc, argv, envp) X#endif X int argc; X char **argv; X char **envp; X{ X register int i, j; X int pix, bottom, top; X int levels; X colormap_t colormap; X X bottom = top = 0; X progname = strsave(argv[0]); X parse_profile(&argc, argv, envp); X X while ((gc = getopt(argc, argv, "l:h:")) != EOF) X switch (gc) { X case 'l': X bottom = atoi(optarg); X break; X case 'h': X top = atoi(optarg); X break; X case '?': X errflag++; X break; X } X X if (errflag) X error((char *) 0, "Usage: %s: [-l low-val] [-h high-val] [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 if (bitrestrict) X levels = calc_max(pr)+1; X else X levels = MAXLEVEL(pr->pr_depth); X X if (top == 0) X top = levels; X X for (j = 0; j < pr->pr_size.y; j++) X for (i = 0; i < pr->pr_size.x; i++) { X pix = (pr_get(pr, i, j) - bottom) * levels / (top - bottom); X pix = MAX(pix, 0); X pr_put(pr, i, j, MIN(pix, levels)); X } X X pr_dump(pr, stdout, &colormap, RT_STANDARD, 0); X} END_OF_FILE if test 1442 -ne `wc -c <'src/rasrange.c'`; then echo shar: \"'src/rasrange.c'\" unpacked with wrong size! fi # end of 'src/rasrange.c' fi if test -f 'src/rasregion.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'src/rasregion.c'\" else echo shar: Extracting \"'src/rasregion.c'\" \(1598 characters\) sed "s/^X//" >'src/rasregion.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 rasregion_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 int xoffset, yoffset, xsize, ysize; X colormap_t colormap; X X xsize = ysize = 0; X xoffset = yoffset = -1; X progname = strsave(argv[0]); X parse_profile(&argc, argv, envp); X X while ((gc = getopt(argc, argv, "x: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 '?': X errflag++; X break; X } X X if (errflag) X error((char *) 0, "Usage: %s: [-x xoffset] [-y yoffset] [-X xsize] [-Y ysize] [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 (xsize == 0) X xsize = pr1->pr_size.x / 2; X X if (ysize == 0) X ysize = pr1->pr_size.y / 2; X X if (xoffset == -1) X xoffset = pr1->pr_size.x / 4; X X if (yoffset == -1) X yoffset = pr1->pr_size.y / 4; X X if ((pr2 = pr_region(pr1, xoffset, yoffset, xsize, ysize)) == NULL) X error("pr_region returned NULL"); X X pr_dump(pr2, stdout, &colormap, RT_STANDARD, 0); X} END_OF_FILE if test 1598 -ne `wc -c <'src/rasregion.c'`; then echo shar: \"'src/rasregion.c'\" unpacked with wrong size! fi # end of 'src/rasregion.c' fi if test -f 'src/rasthresh.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'src/rasthresh.c'\" else echo shar: Extracting \"'src/rasthresh.c'\" \(1443 characters\) sed "s/^X//" >'src/rasthresh.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 rasthresh_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 int threshold; X colormap_t colormap; X X threshold = -1; X progname = strsave(argv[0]); X parse_profile(&argc, argv, envp); X X while ((gc = getopt(argc, argv, "t:")) != EOF) X switch (gc) { X case 't': X threshold = atoi(optarg); X break; X case '?': X errflag++; X break; X } X X if (errflag) X error((char *) 0, "Usage: %s: [-t threshold] [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 (threshold == -1) { X if (bitrestrict) X threshold = (calc_max(pr1)+1) / 2; X else X threshold = MAXLEVEL(pr1->pr_depth) / 2; X } X if ((pr2 = mem_create(pr1->pr_size.x, pr1->pr_size.y, 1)) == NULL) X error("mem_create returned NULL"); X X for (j = 0; j < pr1->pr_size.y; j++) X for (i = 0; i < pr1->pr_size.x; i++) X pr_put(pr2, i, j, (pr_get(pr1, i, j) > threshold) ? 1 : 0); X X pr_dump(pr2, stdout, &colormap, RT_STANDARD, 0); X} END_OF_FILE if test 1443 -ne `wc -c <'src/rasthresh.c'`; then echo shar: \"'src/rasthresh.c'\" unpacked with wrong size! fi # end of 'src/rasthresh.c' fi echo shar: End of archive 2 \(of 10\). cp /dev/null ark2isdone 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