home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-12-13 | 57.3 KB | 1,650 lines |
- Newsgroups: comp.sources.misc
- Path: sparky!kent
- From: cristy@eplrx7.es.duPont.com (John Cristy)
- Subject: v34i030: imagemagick - X11 image processing and display v2.2, Part02/26
- Message-ID: <1992Dec13.202231.7585@sparky.imd.sterling.com>
- Followup-To: comp.sources.d
- X-Md4-Signature: a4d4fb489fd5de30ba971d79d788ebb1
- Sender: kent@sparky.imd.sterling.com (Kent Landfield)
- Organization: Sterling Software
- References: <csm-v34i028=imagemagick.141926@sparky.IMD.Sterling.COM>
- Date: Sun, 13 Dec 1992 20:22:31 GMT
- Approved: kent@sparky.imd.sterling.com
- Lines: 1635
-
- Submitted-by: cristy@eplrx7.es.duPont.com (John Cristy)
- Posting-number: Volume 34, Issue 30
- Archive-name: imagemagick/part02
- Environment: UNIX, VMS, X11, SGI, DEC, Cray, Sun, Vax
-
- #!/bin/sh
- # this is Part.02 (part 2 of a multipart archive)
- # do not concatenate these parts, unpack them in order with /bin/sh
- # file ImageMagick/colors.c continued
- #
- if test ! -r _shar_seq_.tmp; then
- echo 'Please unpack part 1 first!'
- exit 1
- fi
- (read Scheck
- if test "$Scheck" != 2; then
- echo Please unpack part "$Scheck" next!
- exit 1
- else
- exit 0
- fi
- ) < _shar_seq_.tmp || exit 1
- if test ! -f _shar_wnt_.tmp; then
- echo 'x - still skipping ImageMagick/colors.c'
- else
- echo 'x - continuing file ImageMagick/colors.c'
- sed 's/^X//' << 'SHAR_EOF' >> 'ImageMagick/colors.c' &&
- % Software Design %
- % John Cristy %
- % July 1992 %
- % %
- % %
- % Copyright 1992 E. I. du Pont de Nemours & Company %
- % %
- % Permission to use, copy, modify, distribute, and sell this software and %
- % its documentation for any purpose is hereby granted without fee, %
- % provided that the above Copyright notice appear in all copies and that %
- % both that Copyright notice and this permission notice appear in %
- % supporting documentation, and that the name of E. I. du Pont de Nemours %
- % & Company not be used in advertising or publicity pertaining to %
- % distribution of the software without specific, written prior %
- % permission. E. I. du Pont de Nemours & Company makes no representations %
- % about the suitability of this software for any purpose. It is provided %
- % "as is" without express or implied warranty. %
- % %
- % E. I. du Pont de Nemours & Company disclaims all warranties with regard %
- % to this software, including all implied warranties of merchantability %
- % and fitness, in no event shall E. I. du Pont de Nemours & Company be %
- % liable for any special, indirect or consequential damages or any %
- % damages whatsoever resulting from loss of use, data or profits, whether %
- % in an action of contract, negligence or other tortious action, arising %
- % out of or in connection with the use or performance of this software. %
- % %
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- %
- %
- %
- */
- X
- /*
- X Include declarations.
- */
- #include "display.h"
- #include "image.h"
- /*
- X Define declarations.
- */
- #define MaxTreeDepth 8 /* Log2(MaxRGB) */
- #define NodesInAList 2048
- X
- /*
- X Structures.
- */
- typedef struct _Node
- {
- X struct _Node
- X *child[8];
- X
- X unsigned char
- X mid_red,
- X mid_green,
- X mid_blue;
- } Node;
- X
- typedef struct _Nodes
- {
- X Node
- X nodes[NodesInAList];
- X
- X struct _Nodes
- X *next;
- } Nodes;
- X
- typedef struct _Cube
- {
- X Node
- X *root,
- X *leaf;
- X
- X unsigned int
- X colors;
- X
- X unsigned int
- X free_nodes;
- X
- X Node
- X *node;
- X
- X Nodes
- X *node_list;
- } Cube;
- X
- /*
- X Global variables.
- */
- static Cube
- X cube;
- X
- /*
- X External declarations.
- */
- extern char
- X *application_name;
- X
- /*
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % %
- % %
- % %
- % I n i t i a l i z e N o d e %
- % %
- % %
- % %
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- %
- % Function InitializeNode allocates memory for a new node in the color cube
- % tree and presets all fields to zero.
- %
- % The format of the InitializeNode routine is:
- %
- % node=InitializeNode(mid_red,mid_green,mid_blue)
- %
- % A description of each parameter follows.
- %
- % o mid_red: Specifies the mid point of the red axis for this node.
- %
- % o mid_green: Specifies the mid point of the green axis for this node.
- %
- % o mid_blue: Specifies the mid point of the blue axis for this node.
- %
- %
- */
- static Node *InitializeNode(mid_red,mid_green,mid_blue)
- register unsigned char
- X mid_red,
- X mid_green,
- X mid_blue;
- {
- X register int
- X i;
- X
- X register Node
- X *node;
- X
- X if (cube.free_nodes == 0)
- X {
- X register Nodes
- X *nodes;
- X
- X /*
- X Allocate a new nodes of nodes.
- X */
- X nodes=(Nodes *) malloc(sizeof(Nodes));
- X if (nodes == (Nodes *) NULL)
- X return((Node *) NULL);
- X nodes->next=cube.node_list;
- X cube.node_list=nodes;
- X cube.node=nodes->nodes;
- X cube.free_nodes=NodesInAList;
- X }
- X cube.free_nodes--;
- X node=cube.node++;
- X for (i=0; i < 8; i++)
- X node->child[i]=(Node *) NULL;
- X node->mid_red=mid_red;
- X node->mid_green=mid_green;
- X node->mid_blue=mid_blue;
- X return(node);
- }
- X
- /*
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % %
- % %
- % %
- % N u m b e r C o l o r s %
- % %
- % %
- % %
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- %
- % Function NumberColors returns the number of unique colors in an image.
- %
- % The format of the NumberColors routine is:
- %
- % number_colors=NumberColors(image)
- %
- % A description of each parameter follows.
- %
- % o image: The address of a byte (8 bits) array of run-length
- % encoded pixel data of your source image. The sum of the
- % run-length counts in the source image must be equal to or exceed
- % the number of pixels.
- %
- %
- */
- unsigned int NumberColors(image)
- Image
- X *image;
- {
- X Nodes
- X *nodes;
- X
- X register RunlengthPacket
- X *p;
- X
- X register int
- X i;
- X
- X register Node
- X *node;
- X
- X register unsigned char
- X bisect,
- X id;
- X
- X register unsigned int
- X level;
- X
- X /*
- X Initialize color description tree.
- X */
- X cube.node_list=(Nodes *) NULL;
- X cube.colors=0;
- X cube.free_nodes=0;
- X cube.root=InitializeNode(MaxRGB >> 1,MaxRGB >> 1,MaxRGB >> 1);
- X cube.leaf=InitializeNode(0,0,0);
- X if ((cube.root == (Node *) NULL) || (cube.leaf == (Node *) NULL))
- X {
- X Warning("unable to count colors","memory allocation failed");
- X return(0);
- X }
- X p=image->pixels;
- X for (i=0; i < image->packets; i++)
- X {
- X /*
- X Start at the root and proceed level by level.
- X */
- X node=cube.root;
- X for (level=1; level < MaxTreeDepth; level++)
- X {
- X id=(p->red >= node->mid_red ? 1 : 0) |
- X (p->green >= node->mid_green ? 1 : 0) << 1 |
- X (p->blue >= node->mid_blue ? 1 : 0) << 2;
- X if (node->child[id] == (Node *) NULL)
- X {
- X bisect=(unsigned int) (1 << (MaxTreeDepth-level)) >> 1;
- X node->child[id]=InitializeNode(
- X node->mid_red+(id & 1 ? bisect : -bisect),
- X node->mid_green+(id & 2 ? bisect : -bisect),
- X node->mid_blue+(id & 4 ? bisect : -bisect));
- X if (node->child[id] == (Node *) NULL)
- X {
- X Warning("unable to count colors","memory allocation failed");
- X return(0);
- X }
- X }
- X node=node->child[id];
- X }
- X id=(p->red >= node->mid_red ? 1 : 0) |
- X (p->green >= node->mid_green ? 1 : 0) << 1 |
- X (p->blue >= node->mid_blue ? 1 : 0) << 2;
- X if (node->child[id] == (Node *) NULL)
- X {
- X node->child[id]=cube.leaf;
- X cube.colors++;
- X }
- X p++;
- X }
- X /*
- X Release color cube tree storage.
- X */
- X do
- X {
- X nodes=cube.node_list->next;
- X (void) free((char *) cube.node_list);
- X cube.node_list=nodes;
- X }
- X while (cube.node_list != (Nodes *) NULL);
- X return(cube.colors);
- }
- SHAR_EOF
- echo 'File ImageMagick/colors.c is complete' &&
- chmod 0644 ImageMagick/colors.c ||
- echo 'restore of ImageMagick/colors.c failed'
- Wc_c="`wc -c < 'ImageMagick/colors.c'`"
- test 9232 -eq "$Wc_c" ||
- echo 'ImageMagick/colors.c: original size 9232, current size' "$Wc_c"
- rm -f _shar_wnt_.tmp
- fi
- # ============= ImageMagick/Make.com ==============
- if test -f 'ImageMagick/Make.com' -a X"$1" != X"-c"; then
- echo 'x - skipping ImageMagick/Make.com (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- echo 'x - extracting ImageMagick/Make.com (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'ImageMagick/Make.com' &&
- $!
- $! Make ImageMagick X image utilities for VMS.
- $!
- $
- $define/nolog X11 decw$include:
- $define/nolog sys sys$library:
- $link_options="/nodebug/notraceback"
- $define/nolog lnk$library sys$library:vaxcrtl
- $
- $if ((p1.nes."").and.(p1.nes."display")) then goto SkipDisplay
- $write sys$output "Making Display..."
- $call Make display
- $call Make X
- $call Make image
- $call Make rotate
- $call Make quantize
- $call Make colors
- $call Make signature
- $call Make compress
- $call Make alien
- $call Make PreRvIcccm
- $
- $link'link_options' display,X,image,rotate,quantize,colors,signature, -
- X compress,alien,PreRvIcccm,sys$input:/opt
- sys$share:decw$xlibshr.exe/share
- $
- $display:==$'f$environment("default")'display
- $write sys$output "..symbol DISPLAY defined."
- $
- $SkipDisplay:
- $if ((p1.nes."").and.(p1.nes."import")) then goto SkipImport
- $write sys$output "Making Import..."
- $call Make import
- $call Make X
- $call Make image
- $call Make rotate
- $call Make quantize
- $call Make colors
- $call Make signature
- $call Make compress
- $call Make alien
- $call Make PreRvIcccm
- $
- $link'link_options' import,X,image,rotate,quantize,colors,signature,compress, -
- X alien,PreRvIcccm,sys$input:/opt
- sys$share:decw$xlibshr.exe/share
- $
- $import:==$'f$environment("default")'import
- $write sys$output "..symbol IMPORT defined."
- $SkipImport:
- $
- $if ((p1.nes."").and.(p1.nes."XtoPS")) then goto SkipXtoPS
- $write sys$output "Making XtoPS..."
- $call Make XtoPS
- $call Make X
- $call Make image
- $call Make rotate
- $call Make quantize
- $call Make colors
- $call Make signature
- $call Make compress
- $call Make PreRvIcccm
- $
- $link'link_options' XtoPS,X,image,rotate,quantize,colors,signature,compress, -
- X alien,PreRvIcccm,sys$input:/opt
- sys$share:decw$xlibshr.exe/share
- $
- $XtoPS:== $'f$environment("default")'XtoPS
- $write sys$output "..symbol XTOPS defined."
- $
- $SkipXtoPS:
- $if ((p1.nes."").and.(p1.nes."animate")) then goto SkipAnimate
- $write sys$output "Making Animate..."
- $call Make animate
- $call Make X
- $call Make image
- $call Make rotate
- $call Make quantize
- $call Make colors
- $call Make signature
- $call Make compress
- $call Make alien
- $call Make PreRvIcccm
- $
- $link'link_options' animate,X,image,rotate,quantize,colors,signature, -
- X compress,alien,PreRvIcccm,sys$input:/opt
- sys$share:decw$xlibshr.exe/share
- $
- $animate:==$'f$environment("default")'animate
- $write sys$output "..symbol ANIMATE defined."
- $
- $SkipAnimate:
- $if ((p1.nes."").and.(p1.nes."montage")) then goto SkipMontage
- $write sys$output "Making Montage..."
- $call Make montage
- $call Make X
- $call Make image
- $call Make rotate
- $call Make quantize
- $call Make colors
- $call Make compress
- $call Make alien
- $call Make PreRvIcccm
- $
- $link'link_options' montage,X,image,rotate,quantize,colors,signature, -
- X compress,alien,PreRvIcccm,sys$input:/opt
- sys$share:decw$xlibshr.exe/share
- $
- $montage:==$'f$environment("default")'montage
- $write sys$output "..symbol MONTAGE defined."
- $
- $SkipMontage:
- $type sys$input
- X
- Use this command to specify which X server to contact:
- X
- X $set display/create/node=node_name::
- X
- This can be done automatically from your LOGIN.COM with the following
- command:
- X
- X $if (f$trnlmn("sys$rem_node").nes."") then -
- X $ set display/create/node='f$trnlmn("sys$rem_node")'
- $write sys$output "Making in [.utilities]"
- $set default [.utilities]
- $@make
- $exit
- $
- $Make: subroutine
- $!
- $! A very primitive "make" (or MMS) hack for DCL.
- $!
- $if (p1.eqs."") then exit
- $source_file=f$search(f$parse(p1,".c"))
- $if (source_file.nes."")
- $ then
- $ object_file=f$parse(source_file,,,"name")+".obj"
- $ object_file=f$search( object_file )
- $ if (object_file.nes."")
- $ then
- $ object_time=f$file_attribute(object_file,"cdt")
- $ source_time=f$file_attribute(source_file,"cdt")
- $ if (f$cvtime(object_time).lts.f$cvtime(source_time)) then -
- $ object_file=""
- $ endif
- $ if (object_file.eqs."")
- $ then
- $ write sys$output "Compiling ",p1
- $ cc/nodebug/optimize 'source_file'
- $ endif
- $ endif
- $exit
- $endsubroutine
- SHAR_EOF
- chmod 0644 ImageMagick/Make.com ||
- echo 'restore of ImageMagick/Make.com failed'
- Wc_c="`wc -c < 'ImageMagick/Make.com'`"
- test 3952 -eq "$Wc_c" ||
- echo 'ImageMagick/Make.com: original size 3952, current size' "$Wc_c"
- rm -f _shar_wnt_.tmp
- fi
- # ============= ImageMagick/display.h ==============
- if test -f 'ImageMagick/display.h' -a X"$1" != X"-c"; then
- echo 'x - skipping ImageMagick/display.h (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- echo 'x - extracting ImageMagick/display.h (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'ImageMagick/display.h' &&
- /*
- X Include declarations
- */
- #include <stdio.h>
- #if defined(__STDC__) || defined(sgi) || defined(AIXV3)
- #include <stdlib.h>
- #include <unistd.h>
- #else
- #ifndef vms
- #include <malloc.h>
- #include <memory.h>
- #endif
- #endif
- #include <ctype.h>
- #include <string.h>
- #include <math.h>
- #undef index
- X
- /*
- X Define declarations for the Display program.
- */
- #if __STDC__ || defined(sgi) || defined(AIXV3)
- #define _Declare(formal_parameters) formal_parameters
- #else
- #define const
- #define _Declare(formal_parameters) ()
- #endif
- #define DownShift(x) ((int) ((x)+(1L << 15)) >> 16)
- #define False 0
- #define Max(x,y) (((x) > (y)) ? (x) : (y))
- #define Min(x,y) (((x) < (y)) ? (x) : (y))
- #define MinInfoSize (1 << 18)
- #define True 1
- #define UpShift(x) ((x) << 16)
- #define UpShifted(x) ((int) ((x)*(1L << 16)+0.5))
- #define Warning(message,qualifier) \
- { \
- X (void) fprintf(stderr,"%s: %s",application_name,message); \
- X if (qualifier != (char *) NULL) \
- X (void) fprintf(stderr," (%s)",qualifier); \
- X (void) fprintf(stderr,".\n"); \
- }
- #ifdef vms
- #define pclose(file) exit(1)
- #define popen(command,mode) exit(1)
- #define unlink(file) remove(file)
- #endif
- X
- /*
- X Variable declarations.
- */
- #ifndef lint
- static char
- X Version[]="@(#)ImageMagick 2.2 92/12/10 cristy@dupont.com";
- #endif
- SHAR_EOF
- chmod 0644 ImageMagick/display.h ||
- echo 'restore of ImageMagick/display.h failed'
- Wc_c="`wc -c < 'ImageMagick/display.h'`"
- test 1270 -eq "$Wc_c" ||
- echo 'ImageMagick/display.h: original size 1270, current size' "$Wc_c"
- rm -f _shar_wnt_.tmp
- fi
- # ============= ImageMagick/display.man ==============
- if test -f 'ImageMagick/display.man' -a X"$1" != X"-c"; then
- echo 'x - skipping ImageMagick/display.man (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- echo 'x - extracting ImageMagick/display.man (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'ImageMagick/display.man' &&
- .ad l
- .nh
- .TH DISPLAY 1 "10 October 1992" "ImageMagick"
- .SH NAME
- display - display an image on any workstation running X
- .SH SYNOPSIS
- .B "display" [ \fIoptions\fP ...] \fIfile\fP
- [ [ \fIoptions\fP ...] \fIfile\fP ...]
- .SH DESCRIPTION
- \fIDisplay\fP is a machine architecture independent image processing
- and display program. It can display an image on any workstation
- display running an X server. \fIDisplay\fP first determines the
- hardware capabilities of the workstation. If the number of unique
- colors in the image is less than or equal to the number the workstation
- can support, the image is displayed in an X window. Otherwise the
- number of colors in the image is first reduced to match the color
- resolution of the workstation before it is displayed.
- .PP
- This means that a continuous-tone 24 bits-per-pixel image can display on a
- 8 bit pseudo-color device or monochrome device. In most instances the
- reduced color image closely resembles the original. Alternatively, a
- monochrome or pseudo-color image can display on a continuous-tone 24
- bits-per-pixel device.
- .SH EXAMPLES
- To scale an image of a cockatoo to exactly 640 pixels in width and 480
- pixels in height and position the window at location (200,200), use:
- .PP
- X display -geometry 640x480\+200\+200 cockatoo.miff
- .PP
- To display an image of a cockatoo without a border centered on a
- backdrop, use:
- .PP
- X display +borderwidth -backdrop cockatoo.miff
- .PP
- To tile an image of a cockatoo onto the root window, use:
- .PP
- X display -window root cockatoo.miff
- .SH OPTIONS
- .TP 5
- .B "-backdrop"
- display the image centered on a backdrop.
- X
- This backdrop covers the entire workstation screen and is useful for
- hiding other X window activity while viewing the image. The color of
- the backdrop is specified as the background color. Refer to \fBX
- RESOURCES\fP for details.
- .TP 5
- .B "-clip \fI<width>x<height>{\+-}<x offset>{\+-}<y offset>\fP"
- preferred size and location of the clipped image. See \fBX(1)\fP for details
- about the geometry specification.
- X
- Use clipping to apply image processing options to, or display, a
- particular area of an image.
- X
- The equivalent X resource for this option is \fBclipGeometry\fP
- (class \fBClipGeometry\fP). See \fBX RESOURCES\fP for details.
- .TP 5
- .B "-colormap \fItype\fP"
- the type of colormap: \fIShared\fP or \fIPrivate\fP.
- X
- This option only applies when the default X server visual is
- \fIPseudoColor\fP or \fIGrayScale\fP. Refer to \fB-visual\fP for more
- details. By default, a shared colormap is allocated. The image shares
- colors with other X clients. Some image colors could be approximated,
- therefore your image may look very different than intended. Choose
- \fIPrivate\fP and the image colors appear exactly as they are
- defined. However, other clients may go "technicolor" when the image
- colormap is installed.
- .TP 5
- .B "-colors \fIvalue\fP"
- preferred number of colors in the image.
- X
- The actual number of colors in the image may be less than your request,
- but never more. Note, this is a color reduction option. Images with
- less unique colors than specified with this option will remain unchanged.
- Refer to \fBQuantize(9)\fP for more details.
- X
- Note, options \fB-dither\fP, \fB-colorspace\fP, and \fB-treedepth\fP affect
- the color reduction algorithm.
- .TP 5
- .B "-colorspace \fIvalue\fP"
- the type of colorspace: \fIGRAY\fP, \fIRGB\fP, \fIXYZ\fP, \fIYIQ\fP, or
- \fIYUV\fP.
- X
- Color reduction, by default, takes place in the RGB color space.
- Empirical evidence suggests that distances in color spaces such as YUV
- or YIQ correspond to perceptual color differences more closely
- than do distances in RGB space. These color spaces may give better
- results when color reducing an image. Refer to \fBQuantize(9)\fP for
- more details.
- X
- The \fB-colors\fP or \fB-monochrome\fP option is required for this option
- to take effect.
- .TP 5
- .B "-compress \fItype\fP"
- the type of image compression: \fIQEncoded\fP or \fIRunlengthEncoded\fP.
- X
- Use this option with \fB-write\fP to specify the the type of image
- compression. See \fBMIFF(5)\fP for details.
- X
- Specify \fB\+compress\fP to store the binary image in an uncompressed format.
- The default is the compression type of the specified image file.
- .TP 5
- .B "-delay \fIseconds\fP"
- display the next image after pausing.
- X
- This option is useful when viewing several images in sequence. Each
- image will display and wait the number of seconds specified before the
- next image is displayed. The default is to display the image
- and wait until you choose to display the next image or terminate the
- program.
- .TP 5
- .B "-density \fI<width>x<height>
- vertical and horizonal density of the image.
- X
- This option specifies an image density whose interpretation changes
- with the type of image. The default is 72 dots per inch in the
- horizonal and vertical direction for Postscript. Text files default to
- 80 characters in width and 60 lines in height. Use this option to
- alter the default density.
- .TP 5
- .B "-display \fIhost:display[.screen]\fP"
- specifies the X server to contact; see \fBX(1)\fP.
- .TP 5
- .B "-dither"
- apply Floyd/Steinberg error diffusion to the image.
- X
- The basic strategy of dithering is to trade intensity resolution for
- spatial resolution by averaging the intensities of several neighboring
- pixels. Images which suffer from severe contouring when reducing colors
- can be improved with this option.
- X
- The \fB-colors\fP or \fB-monochrome\fP option is required
- for this option to take effect.
- .TP 5
- .B "-enhance"
- apply a digital filter to enhance a noisy image.
- .TP 5
- .B "-gamma \fIvalue\fP"
- level of gamma correction.
- X
- The same color image displayed on two different workstations may look
- different due to differences in the display monitor. Use gamma
- correction to adjust for this color difference. Reasonable values
- extend from 0.8 to 2.3.
- .TP 5
- .B "-geometry \fI<width>x<height>{\+-}<x offset>{\+-}<y offset>\fP"
- preferred size and location of the image window. See \fBX(1)\fP for details
- about the geometry specification. By default, the window size is the image
- size and the location is choosen by you when it is mapped.
- X
- If the specified image size is smaller than the actual image size, the
- image is first reduced to an integral of the specified image size with
- an antialias digital filter. The image is then scaled to the exact
- specified image size with pixel replication. If the specified image
- size is greater than the actual image size, the image is first enlarged
- to an integral of the specified image size with bilinear
- interpolation. The image is then scaled to the exact specified image
- size with pixel replication.
- X
- When displaying an image on an X server, \fI<x offset>\fP and
- \fI<y offset>\fP is relative to the root window. When printing an image,
- \fI<x offset>\fP and \fI<y offset>\fP is relative to a Postscript
- page. See \fB-print\fP for more details.
- X
- The equivalent X resource for this option is \fBimageGeometry\fP
- (class \fBImageGeometry\fP). See \fBX RESOURCES\fP for details.
- .TP 5
- .B "-inverse"
- apply color inversion to image.
- X
- The red, green, and blue intensities of an image are negated.
- .TP 5
- .B "-map \fItype\fP"
- display image using this Standard Colormap type.
- X
- Choose from these Standard Colormap types:
- X
- X default
- X best
- X red
- X green
- X blue
- X gray
- X
- The X server must support the Standard Colormap you choose, otherwise an
- error occurs. See \fBxstdcmap(1)\fP for one way of creating Standard
- Colormaps.
- .TP 5
- .B "-monochrome"
- transform the image to black and white.
- X
- Monochrome images can benefit from error diffusion. Use \fB-dither\fP with
- this option to diffuse the error.
- .TP 5
- .B "-noise"
- reduce the noise in an image with a noise peak elimination filter.
- X
- The principal function of noise peak elimination filter is to smooth
- the objects within an image without losing edge information and without
- creating undesired structures. The central idea of the algorithm is to
- replace a pixel with its next neighbor in value within a 3 x 3 window,
- if this pixel has been found to be noise. A pixel is defined as noise
- if and only if this pixel is a maximum or minimum within the 3 x 3 window.
- .TP 5
- .B "-normalize"
- tranform image to span the full range of color values. This is a contrast
- enhancement technique.
- .TP 5
- .B "-print \fIfile\fP"
- write image as encapsulated Postscript to a file.
- X
- If \fIfile\fP already exists, you will be prompted as to whether
- it should be overwritten.
- X
- By default, the image is scaled and centered to fit on an 612x792 point
- Postscript page. To specify a specific image size or a particular location on
- the Postscript page, use \fB-geometry\fP.
- X
- By default the image is output in portrait mode. Use \fB-rotate 90\fP to
- display the image in landscape mode.
- X
- You can view \fIfile\fP with any Postscript compatible viewer or
- printer. The image is displayed as color on viewers and printers that
- support color Postscript, otherwise it is displayed as grayscale.
- X
- The equivalent X resource for this option is \fBprintFilename\fP
- (class \fBPrintFilename\fP). See \fBX RESOURCES\fP for details.
- .TP 5
- .B "-reflect"
- create a "mirror image" by reflecting the image scanlines.
- .TP 5
- .B "-rotate \fIdegrees\fP"
- apply Paeth image rotation to the image.
- .TP 5
- .B "-scale \fI<width factor>x<height factor>\fP"
- preferred size factors of the image.
- X
- This option behaves like \fB-geometry\fP except the width and height values
- are relative instead of absolute. The image size is multiplied by the
- width and height factors to obtain the final image dimensions. If only
- one factor is specified, both the width and height factors assume the
- value.
- X
- Factors may be fractional. For example, a factor of 1.5 will increase the
- image size by one and one-half.
- X
- The equivalent X resource for this option is \fBscaleGeometry\fP
- (class \fBScaleGeometry\fP). See \fBX RESOURCES\fP for details.
- .TP 5
- .B "-scene \fIvalue\fP"
- image scene number.
- .TP 5
- .B "-treedepth \fIvalue\fP"
- Normally, this integer value is zero or one. A zero or one tells
- \fIdisplay\fP to choose a optimal tree depth for the color reduction
- algorithm.
- X
- An optimal depth generally allows the best representation of the source
- image with the fastest computational speed and the least amount of
- memory. However, the default depth is inappropriate for some images.
- To assure the best representation, try values between 2 and 8 for this
- parameter. Refer to \fBQuantize(9)\fP for more details.
- X
- The \fB-colors\fP or \fB-monochrome\fP option is required
- for this option to take effect.
- .TP 5
- .B -verbose
- print detailed information about the image.
- X
- This information is printed: image scene number; image name; image
- size; the image class (\fIDirectClass\fP or \fIPseudoClass\fP); the total
- number of unique colors; and the number of seconds to read and
- transform the image. Refer to \fBMIFF(5)\fP for a description of
- the image class.
- X
- If \fB-colors\fP is also specified, the total unique colors in the image
- and color reduction error values are printed. Refer to \fBQuantize(9)\fP
- for a description of these values.
- .TP 5
- .B "-visual \fItype\fP"
- display image using this visual type.
- X
- Choose from these visual classes:
- X
- X StaticGray
- X GrayScale
- X StaticColor
- X PseudoColor
- X TrueColor
- X DirectColor
- X default
- X \fIvisual id\fP
- X
- The X server must support the visual you choose, otherwise an error occurs.
- If a visual is not specified, the visual class that can display the most
- simultaneous colors on the default X server screen is choosen.
- .TP 5
- .B "-window \fIid\fP"
- set the background pixmap of this window to the image.
- X
- \fIid\fP can be a window id or name. Specify \fBroot\fP to select X's root
- window as the target window.
- X
- By default the image is tiled onto the background of the target
- window. If \fB-backdrop\fP or \fB-geometry\fP are specified, the
- image is surrounded by the background color. Refer to \fBX
- RESOURCES\fP for details.
- X
- The image will not display on the root window if the image has more
- unique colors than the target window colormap allows. Use
- \fB-colors\fP to reduce the number of colors.
- .TP 5
- .B "-write \fIfile\fP"
- write image to a file.
- X
- If \fIfile\fP already exists, you will be prompted as to whether
- it should be overwritten.
- X
- By default, the image is stored in the MIFF image format. If the number of
- unique colors in the image exceed 65535, it is stored as \fIDirectClass\fP;
- otherwise, it is stored as \fIPseudoClass\fP format. Refer to \fBMIFF(5)\fP
- for more details.
- X
- By default, the image is written in the format that it was read in as.
- To specify a particular image format, prefix \fIfile\fP with the image
- type and a colon (i.e. mtv:image) or specify the image type as the
- filename suffix (i.e. image.mtv). See \fBconvert(1)\fP for a list of
- valid image formats. If \fIfile\fP has the extension \fB.Z\fP, the
- file size is reduced using Lempel-Ziv coding with \fBcompress\fP. If
- \fIfile\fP already exists, you will be prompted as to whether it should
- be overwritten.
- X
- Use \fB-compress\fP to specify the type of image compression.
- X
- The equivalent X resource for this option is \fBwriteFilename\fP
- (class \fBWriteFilename\fP). See \fBX RESOURCES\fP for details.
- .PP
- In addition to those listed above, you can specify these standard X
- resources as command line options: \fB-background\fP,
- \fB-bordercolor\fP, \fB-borderwidth\fP, \fB-font\fP,
- \fB-foreground\fP, \fB-iconGeometry\fP, \fB-iconic\fP, \fB-name\fP, or
- \fB-title\fP. See \fBX RESOURCES\fP for details.
- .PP
- Any option you specify on the command line remains in effect until it is
- explicitly changed by specifying the option again with a different effect.
- For example to display two images, the first with 32 colors, and the
- second with only 16 colors, use:
- .PP
- X display -colors 32 cockatoo.miff -colors 16 macaw.miff
- .PP
- Change \fI-\fP to \fI\+\fP in any option above to reverse its effect.
- For example, specify \fB\+compress\fP to store the binary image in an
- uncompressed format.
- .PP
- \fIfile\fP specifies the image filename. By default, the image format
- is determined by its magic number. To specify a particular image format, precede
- the filename with an image format name and a colon (i.e.
- mtv:image) or specify the image type as the filename suffix (i.e. image.mtv).
- See \fBconvert(1)\fP for a list of valid image formats. Specify \fIfile\fP
- as \fI-\fP for standard input or output. If \fIfile\fP has the
- extension \fB.Z\fP, the file is decoded with \fIuncompress\fP.
- .SH BUTTONS
- The effects of each button press is described below. Three buttons are
- required. If you have a two button mouse, button 1 and 3 are returned.
- Press ALT and button 3 to simulate button 2.
- .TP 5
- .B "1"
- Press and drag to select a command from a pop-up menu. Choose from
- these commands:
- X
- X Image Info
- X Reflect
- X Rotate Right
- X Rotate Left
- X Half Size
- X Double Size
- X Restore
- X Annotate
- X Composite
- X Write
- X Print
- X Next
- X Last
- X Quit
- .TP 5
- .B "2"
- Press and drag to define a region of the image to clip. Release the button
- to crop the image, or return the pointer to the location of the initial button
- press to cancel the cropping operation.
- .TP 5
- .B "3"
- Press and drag to define a region of the image to magnify.
- X
- Note, this button behaves differently for a composite MIFF image
- created with \fImontage\fP. Choose a particular tile of the composite
- and press this button, the image represented by the tile is then
- displayed. To return to the composite MIFF image, choose \fINext\fP
- from the command menu (refer to Button 1). See \fBmontage(1)\fP and
- \fBMIFF(5)\fP for more details.
- X
- .SH KEYBOARD ACCELERATORS
- .TP 5
- .B "i"
- Press to display information about the image. Press any key or button to
- erase the information.
- X
- This information is printed: image scene number; image name; image
- size; the visual class (see \fB-visual\fP); and the total number of
- unique colors in the image.
- .TP 5
- .B "r"
- Press to reflect the image scanlines.
- .TP 5
- .B "/"
- Press to rotate the image 90 degrees clockwise.
- .TP 5
- .B "\e"
- Press to rotate the image 90 degrees counter-clockwise.
- .TP 5
- .B "<"
- Press to half the image size.
- .TP 5
- .B ">"
- Press to double the image size.
- .TP 5
- .B "o"
- Press to restore the image to its original size.
- .TP 5
- .B "a"
- Press to annotate the image with text.
- X
- Refer to \fBIMAGE ANNOTATION\fP for more details.
- .TP 5
- .B "c"
- Press to composite the image with another.
- X
- Refer to \fBIMAGE COMPOSITING\fP for more details.
- .TP 5
- .B "w"
- Press to write the image to a file.
- .TP 5
- .B "p"
- Press to print the image to a file.
- .TP 5
- .B "n"
- Press to display the next image.
- .TP 5
- .B "l"
- Press to display the last image.
- .TP 5
- .B "q"
- Press to discard all images and exit program.
- .TP 5
- .B "1-9"
- Press to change the level of magnification.
- .SH "X RESOURCES"
- \fIDisplay\fP options can appear on the command line or in your X
- resource file. Options on the command line supersede values specified
- in your X resource file. See \fBX(1)\fP for more information on X
- resources.
- X
- All \fIdisplay\fP options have a corresponding X resource. In addition,
- \fIdisplay\fP uses the following X resources:
- .TP 5
- .B background (\fPclass\fB Background)
- Specifies the preferred color to use for the image window background. The
- default is black.
- .TP 5
- .B borderColor (\fPclass\fB BorderColor)
- Specifies the preferred color to use for the image window border. The
- default is white.
- .TP 5
- .B borderWidth (\fPclass\fB BorderWidth)
- Specifies the width in pixels of the image window border. The default is 2.
- .TP 5
- .B font (\fPclass\fB Font)
- Specifies the name of the preferred font to use when displaying text
- within the image window. The default is \fI/g9x15\fP, \fIfixed\fP, or
- \fI/g6x13\fP determined by the image window size.
- .TP 5
- .B font[1-9] (\fPclass\fB Font[1-9])
- Specifies the name of the preferred font to use when annotating the
- image window with text. The default fonts are \fIfixed\fP,
- \fIvariable\fP, \fI5x8\fP, \fI6x10\fP, \fI7x13bold\fP, \fI8x13bold\fP,
- \fI9x15bold\fP, \fI10x20\fP, and \fI12x24\fP. Refer to \fBIMAGE
- ANNOTATION\fP for more details.
- .TP 5
- .B foreground (\fPclass\fB Foreground)
- Specifies the preferred color to use for text within the image window. The
- default is white.
- .TP 5
- .B iconGeometry (\fPclass\fB IconGeometry)
- Specifies the preferred size and position of the application when
- iconified. It is not necessarily obeyed by all window managers.
- .TP 5
- .B iconic (\fPclass\fB Iconic)
- This resource indicates that you would prefer that the application's
- windows initially not be visible as if the windows had be immediately
- iconified by you. Window managers may choose not to honor the
- application's request.
- .TP 5
- .B magnify (\fPclass\fB Magnify)
- specifies an integral factor by which the image should be enlarged. The
- default is 2.
- X
- This value only affects the magnification window which is invoked with
- button number 1 after the image is displayed. Refer to \fBBUTTONS\fP
- for more details.
- .TP 5
- .B name (\fPclass\fB Name)
- This resource specifies the name under which resources for the
- application should be found. This resource is useful in shell aliases to
- distinguish between invocations of an application, without resorting to
- creating links to alter the executable file name. The default is the
- application name.
- .TP 5
- .B pen[1-9] (\fPclass\fB Pen[1-9])
- Specifies the color of the preferred font to use when annotating the
- image window with text. The default colors are \fIblack\fP,
- \fIblue\fP, \fIgreen\fP, \fIcyan\fP, \fIgray\fP, \fIred\fP,
- \fImagenta\fP, \fIyellow\fP, and \fIwhite\fP. Refer to \fBIMAGE
- ANNOTATION\fP for more details.
- .TP 5
- .B title (\fPclass\fB Title)
- This resource specifies the title to be used for the image window. This
- information is sometimes used by a window manager to provide a
- header identifying the window. The default is the image file name.
- .SH IMAGE PANNING
- When an image exceeds the width or height of the X server screen,
- \fIdisplay\fP maps a small panning window. The rectangle within the
- panning window shows the area that is currently displayed in the
- the image window. To "pan" about the image, press and drag the mouse
- within the panning window. The panning rectangle moves with the mouse
- and the image window is updated to reflect the location of the
- rectangle within the panning window. When you have selected the area
- of the image you wish to view, just release the mouse button.
- X
- The panning window goes away if the image becomes smaller than the
- dimensions of the X server screen.
- .SH IMAGE ANNOTATION
- An image is annotated with text interactively. There is no command
- line argument to annotate an image. To begin, press button 1 and
- choose \fIAnnotate Image\fP from the command menu (see \fBBUTTONS\fP).
- Alternatively, press \fIa\fP in the image window (see \fBKEYBOARD
- ACCELERATORS\fP). To exit immediately, press \fIESC\fP.
- .PP
- A small window appears showing the location of the cursor in the image
- window. You are now in \fIannotate mode\fP. To exit immediately,
- press \fIESC\fP. In \fIannotate mode\fP a button press has a different
- effect than described in \fBBUTTONS\fP. Press a button to affect this
- behavior:
- .TP 5
- .B "1"
- Press to select a location within the image window to begin entering text.
- .TP 5
- .B "2"
- Press and drag to select a font from a pop-up menu. Choose from
- these fonts:
- X
- X fixed
- X variable
- X 5x8
- X 6x10
- X 7x13bold
- X 8x13bold
- X 9x15bold
- X 10x20
- X 12x24
- X
- Other fonts can be specified by setting the X resources \fBfont1\fP through
- \fBfont9\fP. Refer to \fBX RESOURCES\fP for more details.
- .TP 5
- .B "3"
- Press and drag to select a font color from a pop-up menu. Choose from
- these font colors:
- X
- X black
- X blue
- X cyan
- X green
- X gray
- X red
- X magenta
- X yellow
- X white
- X
- Other font colors can be specified by setting the X resources \fBpen1\fP
- through \fBpen9\fP. Refer to \fBX RESOURCES\fP for more details.
- .PP
- Choosing a font and its color is optional. The default font is
- \fIfixed\fP and the default color is \fIblack\fP. However, you must
- choose a location to begin entering text and press button 1. An
- underscore character will appear at the location of the cursor where
- you pressed button 1. The cursor changes to a pencil to indicate
- you are in \fItext mode\fP. To exit immediately, press \fIESC\fP.
- .PP
- In \fItext mode\fP, any key presses will display the character at
- the location of the underscore and advance the underscore cursor.
- Enter your text and once completed press \fIESC\fP to finish your image
- annotation. To correct errors press \fIBACK SPACE\fP. To delete an
- entire line of text, press \fIDELETE\fP. Any text that exceeds the
- boundaries of the image window is automatically continued onto the next
- line.
- .PP
- Before exiting \fItext mode\fP, immediately after pressing the
- \fIESC\fP key, the image is permanently updated with the text you
- entered. There is no way to `undo' your changes so be careful to
- check your text before you press \fIESC\fP.
- .PP
- The actual color you request for the font is saved in the image.
- However, the color that appears in your image window may be different.
- For example, on a monochrome screen the text will appear black or white even
- if you choose the color red as the font color. However, the image saved to
- a file with \fB-write\fP will be written with red lettering. To assure
- the correct color text in the final image, any \fIPseudoClass\fP image
- is promoted to \fIDirectClass\fP (see \fBMIFF(5)\fP). To
- force a \fIPseudoClass\fP image to remain \fIPseudoClass\fP, use
- \fB-colors\fP.
- .SH IMAGE COMPOSITING
- An image composite is created interactively. There is no command line
- argument to composite an image. To begin, press button 1 and choose
- \fIComposite Image\fP from the command menu (see \fBBUTTONS\fP).
- Alternatively, press \fIc\fP in the image window (see \fBKEYBOARD
- ACCELERATORS\fP).
- .PP
- First a popup window is displayed requesting you to enter an image name.
- Press \fIRETURN\fP, enter 'X:', or type a file name. Press \fIRETURN\fP if
- you choose not to create a composite image. When you specify \fBX:\fP
- as your file name, the filename has special meaning. It specifies an X
- window by id, name, or \fBroot\fP. If no filename is specified, the
- window is selected by clicking the mouse in the desired window. See
- \fBXtoPS(1)\fP for details.
- .PP
- A small window appears showing the location of the cursor in the image
- window. You are now in \fIcomposite mode\fP. To exit immediately,
- press \fIESC\fP. In \fIcomposite mode\fP a button press has a
- different effect than described in \fBBUTTONS\fP. Press a button to
- affect this behavior:
- .TP 5
- .B "1"
- Press to select a location within \fIimage window\fP to composite your
- image.
- .TP 5
- .B "2"
- Press and drag to select a composite operation from a pop-up menu.
- Choose from these composite operations:
- X
- X over
- X in
- X out
- X atop
- X xor
- X plus
- X minus
- X add
- X subtract
- X difference
- X replace
- .PP
- The operations behaves as follows:
- .TP 9
- .B over
- The result will be the union of the two image shapes, with \fIimage\fP
- obscuring \fIimage window\fP in the region of overlap.
- .TP 9
- .B in
- The result is simply \fIimage\fP cut by the shape of \fIimage
- window\fP. None of the image data of \fIimage window\fP will be in the
- result.
- .TP 9
- .B out
- The resulting image is \fIimage\fP with the shape of \fIimage window\fP
- cut out.
- .TP 9
- .B atop
- The result is the same shape as image \fIimage window\fP, with
- \fIimage\fP obscuring \fIimage window\fP where the image shapes
- overlap. Note this differs from \fBover\fP because the portion of
- \fIimage\fP outside \fIimage window\fP's shape does not appear in the
- result.
- .TP 9
- .B xor
- The result is the image data from both \fIimage\fP and \fIimage window\fP
- that is outside the overlap region. The overlap region will be blank.
- .TP 9
- .B plus
- The result is just the sum of the image data. Output values are
- clipped to 255 (no overflow). This operation is independent
- of the alpha channels.
- .TP 9
- .B minus
- The result of \fIimage\fP \- \fIimage window\fP, with underflow clipped
- to zero. The alpha channel is ignored (set to 255, full coverage).
- .TP 9
- .B add
- The result of \fIimage\fP + \fIimage window\fP, with overflow wrapping
- around (\fImod\fP 256).
- .TP 9
- .B subtract
- The result of \fIimage\fP - \fIimage window\fP, with underflow wrapping
- around (\fImod\fP 256). The \fBadd\fP and \fBsubtract\fP operators can
- be used to perform reversible transformations.
- .TP 9
- .B difference
- The result of abs(\fIimage\fP \- \fIimage window\fP). This is useful
- for comparing two very similar images.
- .TP 9
- .B replace
- The resulting image is \fIimage window\fP replaced with \fIimage\fP.
- Here the alpha information is ignored.
- .PP
- The image compositor requires an alpha, or matte channel in the image
- for some operations. This extra channel usually defines a mask which
- represents a sort of a cookie-cutter for the image. This is the case
- when alpha is 255 (full coverage) for pixels inside the shape, zero
- outside, and between zero and 255 on the boundary. If \fIimage\fP does
- not have an alpha channel, it is initialized with 0 for any pixel
- matching in color to pixel location (0,0), otherwise 255.
- .PP
- Note that alpha information for \fIimage window\fP is not retained for
- colormapped X server visuals (e.g. \fIStaticColor\fP,
- \fIStaticColor\fP, \fIGrayScale\fP, \fIPseudoColor\fP). Correct
- compositing behavior may require a \fITrueColor\fP or \fIDirectColor\fP
- visual or a \fIStandard Colormap\fP.
- .PP
- Choosing a composite operator is optional. The default operator is
- \Ifover\fP. However, you must choose a location to composite your image
- and press button 1. Press and hold button 1 before releasing and an
- outline of the image will appear to help you identify your location.
- .PP
- Immediately after releasing button 1, \fIimage window\fP is
- permanently updated with your composited image. There is no way to
- `undo' your changes. Be careful when choosing your location.
- .PP
- The actual colors of the composite image is saved. However, the color
- that appears in \fIimage window\fP may be different. For example, on a
- monochrome screen \fIimage window\fP will appear black or white even
- though your composited image may have many colors. If the image is
- saved to a file it is written with the correct colors. To assure the
- correct colors are saved in the final image, any \fIPseudoClass\fP
- image is promoted to \fIDirectClass\fP (see \fBMIFF(5)\fP). To force a
- \fIPseudoClass\fP image to remain \fIPseudoClass\fP, use \fB-colors\fP.
- .SH ENVIRONMENT
- .TP 5
- .B DISPLAY
- To get the default host, display number, and screen.
- .SH SEE ALSO
- import(1), mogrify(1), convert(1), Quantize(9), MIFF(5), X(1), xstdcmap(1),
- more(1), compress(1),
- .SH COPYRIGHT
- Copyright 1992 E. I. du Pont de Nemours & Company
- .PP
- Permission to use, copy, modify, distribute, and sell this software and
- its documentation for any purpose is hereby granted without fee,
- provided that the above copyright notice appear in all copies and that
- both that copyright notice and this permission notice appear in
- supporting documentation, and that the name of E. I. du Pont de Nemours
- & Company not be used in advertising or publicity pertaining to
- distribution of the software without specific, written prior
- permission. E. I. du Pont de Nemours & Company makes no representations
- about the suitability of this software for any purpose. It is provided
- "as is" without express or implied warranty.
- .PP
- E. I. du Pont de Nemours & Company disclaims all warranties with regard
- to this software, including all implied warranties of merchantability
- and fitness, in no event shall E. I. du Pont de Nemours & Company be
- liable for any special, indirect or consequential damages or any
- damages whatsoever resulting from loss of use, data or profits, whether
- in an action of contract, negligence or other tortious action, arising
- out of or in connection with the use or performance of this software.
- .SH ACKNOWLEDGEMENTS
- The MIT X Consortium for making network transparent graphics a reality.
- .PP
- Rod Bogart and John W. Peterson, University of Utah. Image
- compositing is loosely based on \fIrlecomp\fP of the Utah Raster
- Toolkit.
- .PP
- Michael Halle, Spatial Imaging Group at MIT, for the initial
- implementation of Alan Paeth's image rotation algorithm.
- .PP
- David Pensak, E. I. du Pont de Nemours & Company, for providing a
- computing environment that made this program possible.
- .PP
- Paul Raveling, USC Information Sciences Institute, for the original
- idea of using space subdivision for the color reduction algorithm.
- .SH AUTHORS
- John Cristy, E.I. du Pont de Nemours & Company Incorporated
- SHAR_EOF
- chmod 0644 ImageMagick/display.man ||
- echo 'restore of ImageMagick/display.man failed'
- Wc_c="`wc -c < 'ImageMagick/display.man'`"
- test 30521 -eq "$Wc_c" ||
- echo 'ImageMagick/display.man: original size 30521, current size' "$Wc_c"
- rm -f _shar_wnt_.tmp
- fi
- # ============= ImageMagick/xtp/Makefile ==============
- if test ! -d 'ImageMagick/xtp'; then
- echo 'x - creating directory ImageMagick/xtp'
- mkdir 'ImageMagick/xtp'
- fi
- if test -f 'ImageMagick/xtp/Makefile' -a X"$1" != X"-c"; then
- echo 'x - skipping ImageMagick/xtp/Makefile (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- echo 'x - extracting ImageMagick/xtp/Makefile (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'ImageMagick/xtp/Makefile' &&
- #
- # Generic makefile for display, animate, montage, XtoPS, and import for
- # computers that do not have xmkmf.
- #
- # Copyright 1992 E. I. du Pont de Nemours & Company
- #
- # Permission to use, copy, modify, distribute, and sell this software and
- # its documentation for any purpose is hereby granted without fee,
- # provided that the above Copyright notice appear in all copies and that
- # both that Copyright notice and this permission notice appear in
- # supporting documentation, and that the name of E. I. du Pont de Nemours
- # & Company not be used in advertising or publicity pertaining to
- # distribution of the software without specific, written prior
- # permission. E. I. du Pont de Nemours & Company makes no representations
- # about the suitability of this software for any purpose. It is provided
- # "as is" without express or implied warranty.
- #
- # E. I. du Pont de Nemours & Company disclaims all warranties with regard
- # to this software, including all implied warranties of merchantability
- # and fitness, in no event shall E. I. du Pont de Nemours & Company be
- # liable for any special, indirect or consequential damages or any
- # damages whatsoever resulting from loss of use, data or profits, whether
- # in an action of contract, negligence or other tortious action, arising
- # out of or in connection with the use or performance of this software.
- #
- X
- CC= cc -O
- DESTDIR= /usr/local/bin
- INSTALL = install -c
- RM= /bin/rm -f
- #SYS_LIBRARIES= -lnsl
- X
- XXTPObjects= xtp.o network.o regular.o
- X
- PROGRAMS= xtp
- X
- all: $(PROGRAMS)
- X
- xtp: $(XTPObjects)
- X $(RM) $@
- X $(CC) -o $@ $(XTPObjects) $(SYS_LIBRARIES)
- X
- clean::
- X $(RM) xtp
- X
- install:: xtp
- X $(INSTALL) xtp $(DESTDIR)
- X
- clean::
- X $(RM) *.ln *.bak *.o core errs ,* *~ *.a .emacs_* make.log MakeOut
- SHAR_EOF
- chmod 0644 ImageMagick/xtp/Makefile ||
- echo 'restore of ImageMagick/xtp/Makefile failed'
- Wc_c="`wc -c < 'ImageMagick/xtp/Makefile'`"
- test 1752 -eq "$Wc_c" ||
- echo 'ImageMagick/xtp/Makefile: original size 1752, current size' "$Wc_c"
- rm -f _shar_wnt_.tmp
- fi
- # ============= ImageMagick/xtp/Imakefile ==============
- if test -f 'ImageMagick/xtp/Imakefile' -a X"$1" != X"-c"; then
- echo 'x - skipping ImageMagick/xtp/Imakefile (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- echo 'x - extracting ImageMagick/xtp/Imakefile (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'ImageMagick/xtp/Imakefile' &&
- #
- # Imakefile for xtp.
- #
- # Copyright 1992 E. I. du Pont de Nemours & Company
- #
- # Permission to use, copy, modify, distribute, and sell this software and
- # its documentation for any purpose is hereby granted without fee,
- # provided that the above Copyright notice appear in all copies and that
- # both that Copyright notice and this permission notice appear in
- # supporting documentation, and that the name of E. I. du Pont de Nemours
- # & Company not be used in advertising or publicity pertaining to
- # distribution of the software without specific, written prior
- # permission. E. I. du Pont de Nemours & Company makes no representations
- # about the suitability of this software for any purpose. It is provided
- # "as is" without express or implied warranty.
- #
- # E. I. du Pont de Nemours & Company disclaims all warranties with regard
- # to this software, including all implied warranties of merchantability
- # and fitness, in no event shall E. I. du Pont de Nemours & Company be
- # liable for any special, indirect or consequential damages or any
- # damages whatsoever resulting from loss of use, data or profits, whether
- # in an action of contract, negligence or other tortious action, arising
- # out of or in connection with the use or performance of this software.
- #
- X
- #include "../Magick.tmpl"
- X
- XXTPObjects= xtp.o network.o regular.o
- X
- PROGRAMS= xtp
- X
- AllTarget($(PROGRAMS))
- X
- NormalProgramTarget(xtp,$(XTPObjects), , , )
- InstallProgram(xtp,$(LOCALDIR))
- InstallManPage(xtp,$(MANDIR))
- SHAR_EOF
- chmod 0644 ImageMagick/xtp/Imakefile ||
- echo 'restore of ImageMagick/xtp/Imakefile failed'
- Wc_c="`wc -c < 'ImageMagick/xtp/Imakefile'`"
- test 1497 -eq "$Wc_c" ||
- echo 'ImageMagick/xtp/Imakefile: original size 1497, current size' "$Wc_c"
- rm -f _shar_wnt_.tmp
- fi
- # ============= ImageMagick/xtp/xtp.h ==============
- if test -f 'ImageMagick/xtp/xtp.h' -a X"$1" != X"-c"; then
- echo 'x - skipping ImageMagick/xtp/xtp.h (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- echo 'x - extracting ImageMagick/xtp/xtp.h (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'ImageMagick/xtp/xtp.h' &&
- /*
- X Include declarations
- */
- #include <stdio.h>
- #if __STDC__ || defined(sgi) || defined(AIXV3)
- #include <stdlib.h>
- #else
- #ifndef vms
- #include <malloc.h>
- #include <memory.h>
- X
- extern long
- X strtol(),
- X time();
- #endif
- #endif
- #include <ctype.h>
- #include <math.h>
- #include <string.h>
- X
- /*
- X Define declarations for the Display program.
- */
- #if __STDC__ || defined(sgi) || defined(AIXV3)
- #define _Declare(formal_parameters) formal_parameters
- #else
- #define const
- #define _Declare(formal_parameters) ()
- #endif
- #define False 0
- #define True 1
- #define Warning(message,qualifier) \
- { \
- X (void) fprintf(stderr,"%s: %s",application_name,message); \
- X if (qualifier != (char *) NULL) \
- X (void) fprintf(stderr," (%s)",qualifier); \
- X (void) fprintf(stderr,".\n"); \
- }
- X
- #ifndef lint
- static char
- X Version[]="@(#)ImageMagick 2.1 92/10/10 cristy@dupont.com";
- #endif
- SHAR_EOF
- chmod 0644 ImageMagick/xtp/xtp.h ||
- echo 'restore of ImageMagick/xtp/xtp.h failed'
- Wc_c="`wc -c < 'ImageMagick/xtp/xtp.h'`"
- test 861 -eq "$Wc_c" ||
- echo 'ImageMagick/xtp/xtp.h: original size 861, current size' "$Wc_c"
- rm -f _shar_wnt_.tmp
- fi
- # ============= ImageMagick/xtp/README ==============
- if test -f 'ImageMagick/xtp/README' -a X"$1" != X"-c"; then
- echo 'x - skipping ImageMagick/xtp/README (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- echo 'x - extracting ImageMagick/xtp/README (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'ImageMagick/xtp/README' &&
- XXtp is a utility for retrieving, listing, or printing files from a
- remote network site. Xtp performs most of the same functions as the
- ftp program, but does not require any interactive commands. You simply
- specify the file transfer task on the command line and xtp performs the
- transfer automatically.
- X
- To retrieve file contrib/ImageMagick.tar.Z from host export.lcs.mit.edu,
- use:
- X
- X xtp -binary -retrieve ImageMagick.tar.Z export.lcs.mit.edu contrib
- X
- XXtp requires 4.3 BSD compatibilities. I have successfully executed it on
- a SUN, DEC Ultrix, MIPS, IBM RS/6000, and Ardent Titan.
- X
- The author is cristy@dupont.com. Comments, suggestions, etc, are
- welcome, but be kind.
- X
- ---
- X
- Copyright 1990 E. I. Dupont de Nemours & Company
- X
- Permission to use, copy, modify, distribute, and sell this software and
- its documentation for any purpose is hereby granted without fee,
- provided that the above copyright notice appear in all copies and that
- both that copyright notice and this permission notice appear in
- supporting documentation, and that the name of E. I. Dupont de Nemours
- & Company not be used in advertising or publicity pertaining to
- distribution of the software without specific, written prior
- permission. E. I. Dupont de Nemours & Company makes no representations
- about the suitability of this software for any purpose. It is provided
- "as is" without express or implied warranty.
- X
- E. I. Dupont de Nemours & Company disclaims all warranties with regard
- to this software, including all implied warranties of merchantability
- and fitness, in no event shall E. I. Dupont de Nemours & Company be
- liable for any special, indirect or consequential damages or any
- damages whatsoever resulting from loss of use, data or profits, whether
- in an action of contract, negligence or other tortious action, arising
- out of or in connection with the use or performance of this software.
- X
- SHAR_EOF
- chmod 0644 ImageMagick/xtp/README ||
- echo 'restore of ImageMagick/xtp/README failed'
- Wc_c="`wc -c < 'ImageMagick/xtp/README'`"
- test 1876 -eq "$Wc_c" ||
- echo 'ImageMagick/xtp/README: original size 1876, current size' "$Wc_c"
- rm -f _shar_wnt_.tmp
- fi
- # ============= ImageMagick/xtp/regular.c ==============
- if test -f 'ImageMagick/xtp/regular.c' -a X"$1" != X"-c"; then
- echo 'x - skipping ImageMagick/xtp/regular.c (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- echo 'x - extracting ImageMagick/xtp/regular.c (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'ImageMagick/xtp/regular.c' &&
- /*
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % %
- % %
- % %
- % RRRR EEEEE GGGG U U L AAA RRRR %
- % R R E G U U L A A R R %
- % RRRR EEE G GG U U L AAAAA RRRR %
- % R R E G G U U L A A R R %
- % R R EEEEE GGGG UUU LLLLL A A R R %
- % %
- % %
- % Regular Expression Interpreter. %
- % %
- % %
- % %
- % Software Design %
- % John Cristy %
- % July 1992 %
- % %
- % %
- % Copyright 1992 E. I. Dupont de Nemours & Company %
- % %
- % Permission to use, copy, modify, distribute, and sell this software and %
- % its documentation for any purpose is hereby granted without fee, %
- % provided that the above Copyright notice appear in all copies and that %
- % both that Copyright notice and this permission notice appear in %
- % supporting documentation, and that the name of E. I. Dupont de Nemours %
- SHAR_EOF
- true || echo 'restore of ImageMagick/xtp/regular.c failed'
- fi
- echo 'End of part 2'
- echo 'File ImageMagick/xtp/regular.c is continued in part 3'
- echo 3 > _shar_seq_.tmp
- exit 0
- exit 0 # Just in case...
-