home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / x / volume13 / imagemagic / part01 next >
Internet Message Format  |  1991-05-22  |  75KB

  1. Path: uunet!cs.utexas.edu!sun-barr!newstop!exodus!dupont.com!cristy
  2. From: cristy@dupont.com
  3. Newsgroups: comp.sources.x
  4. Subject: v13i017: ImageMagick - Graphics display programs, Part01/21
  5. Message-ID: <csx-13i017:imagemagic@uunet.UU.NET>
  6. Date: 22 May 91 08:50:52 GMT
  7. Sender: news@exodus.Eng.Sun.COM
  8. Lines: 2223
  9. Approved: argv@sun.com
  10.  
  11. Submitted-by: cristy@dupont.com
  12. Posting-number: Volume 13, Issue 17
  13. Archive-name: imagemagic/part01
  14.  
  15. The X utilites read and write MIFF images.  Refer to the end of the
  16. README for more information about MIFF.  You can find filters to
  17. convert to and from the MIFF format in the 'filters' directory.
  18.  
  19.  
  20. #!/bin/sh
  21. # This is ImageMagick, a shell archive (produced by shar 3.49)
  22. # To extract the files from this archive, save it to a file, remove
  23. # everything above the "!/bin/sh" line above, and type "sh file_name".
  24. #
  25. # made 05/14/1991 13:45 UTC by cristy@dupont.com
  26. # Source directory /internet/cristy/ImageMagick
  27. #
  28. # existing files will NOT be overwritten unless -c is specified
  29. #
  30. # This is part 1 of a multipart archive                                    
  31. # do not concatenate these parts, unpack them in order with /bin/sh        
  32. #
  33. # This shar contains:
  34. # length  mode       name
  35. # ------ ---------- ------------------------------------------
  36. #    929 -rwxr-xr-x ImageMagick/Imakefile
  37. #  10190 -rwxr-xr-x ImageMagick/Makefile
  38. #    904 -rwxr-xr-x ImageMagick/PreR4Icccm.h
  39. #   8665 -rwxr-xr-x ImageMagick/README
  40. #  16185 -rwxr-xr-x ImageMagick/XtoPS.c
  41. #   5731 -rwxr-xr-x ImageMagick/XtoPS.man
  42. #   2570 -rwxr-xr-x ImageMagick/Manifest.ps
  43. #   9085 -rwxr-xr-x ImageMagick/colors.c
  44. #   3167 -rwxr-xr-x ImageMagick/Make.com
  45. #   1993 -rwxr-xr-x ImageMagick/display.h
  46. #  33436 -rwxr-xr-x ImageMagick/display.man
  47. #   8840 -rwxr-xr-x ImageMagick/xtp/Makefile
  48. #    143 -rwxr-xr-x ImageMagick/xtp/Imakefile
  49. #   8203 -rwxr-xr-x ImageMagick/xtp/xtp.1
  50. #   1872 -rwxr-xr-x ImageMagick/xtp/README
  51. #  33398 -rwxr-xr-x ImageMagick/xtp/regular.c
  52. #   1245 -rwxr-xr-x ImageMagick/xtp/regular.h
  53. #  37231 -rwxr-xr-x ImageMagick/xtp/xtp.c
  54. #   5832 -rwxr-xr-x ImageMagick/xtp/xtp.man
  55. # 121441 -rwxr-xr-x ImageMagick/image.c
  56. #  38867 -rwx------ ImageMagick/images/swan.miff.Z
  57. # 204043 -rwx------ ImageMagick/images/mandrill.miff.Z
  58. #  14198 -rwxr-xr-x ImageMagick/import.c
  59. #   3992 -rwxr-xr-x ImageMagick/import.man
  60. #  22830 -rwxr-xr-x ImageMagick/kolb.c
  61. #  20010 -rwxr-xr-x ImageMagick/quantize.c
  62. #  32713 -rwxr-xr-x ImageMagick/rotate.c
  63. #  23716 -rwxr-xr-x ImageMagick/compress.c
  64. #    563 -rwxr-xr-x ImageMagick/image.h
  65. #  14700 -rwxr-xr-x ImageMagick/filters/Makefile
  66. #  20330 -rwxr-xr-x ImageMagick/filters/GIFtoMIFF.c
  67. #  20166 -rwxr-xr-x ImageMagick/filters/SUNtoMIFF.c
  68. #  25596 -rwxr-xr-x ImageMagick/filters/TIFFtoMIFF.c
  69. #  11939 -rwxr-xr-x ImageMagick/filters/MIFFtoTIFF.c
  70. #  13529 -rwxr-xr-x ImageMagick/filters/MIFFtoSUN.c
  71. #  10081 -rwxr-xr-x ImageMagick/filters/MIFFtoAVS.c
  72. #  12689 -rwxr-xr-x ImageMagick/filters/AVStoMIFF.c
  73. #  22134 -rwxr-xr-x ImageMagick/filters/XWDtoMIFF.c
  74. #   4132 -rwxr-xr-x ImageMagick/filters/Imakefile
  75. #  11243 -rwxr-xr-x ImageMagick/filters/MIFFtoXBM.c
  76. #  13275 -rwxr-xr-x ImageMagick/filters/XBMtoMIFF.c
  77. #  12416 -rwxr-xr-x ImageMagick/filters/PPMtoMIFF.c
  78. #  31233 -rwxr-xr-x ImageMagick/filters/TIFFtoSUN.c
  79. #   9806 -rwxr-xr-x ImageMagick/filters/MIFFtoPPM.c
  80. #  12356 -rwxr-xr-x ImageMagick/filters/MTVtoMIFF.c
  81. #  11346 -rwxr-xr-x ImageMagick/filters/ANIMOLtoMIFF.c
  82. #  12419 -rwxr-xr-x ImageMagick/filters/GRAYtoMIFF.c
  83. #   9941 -rwxr-xr-x ImageMagick/filters/MIFFtoGRAY.c
  84. #   9938 -rwxr-xr-x ImageMagick/filters/MIFFtoMTV.c
  85. #   9872 -rwxr-xr-x ImageMagick/filters/MIFFtoRGB.c
  86. #  15929 -rwxr-xr-x ImageMagick/filters/MIFFtoXWD.c
  87. #   1055 -rwxr-xr-x ImageMagick/filters/README
  88. #  12104 -rwxr-xr-x ImageMagick/filters/RGBtoMIFF.c
  89. #  22524 -rwxr-xr-x ImageMagick/filters/MIFFtoGIF.c
  90. # 148390 -rwxr-xr-x ImageMagick/display.c
  91. #   2573 -rwxr-xr-x ImageMagick/X.h
  92. #  29239 -rwxr-xr-x ImageMagick/animate.man
  93. #   2779 -rwxr-xr-x ImageMagick/Announce
  94. #  99539 -rwxr-xr-x ImageMagick/X.c
  95. #    487 -rwxr-xr-x ImageMagick/animate.h
  96. #  73911 -rwxr-xr-x ImageMagick/animate.c
  97. #   3056 -rwxr-xr-x ImageMagick/PreR4Icccm.c
  98. #     22 -rwxr-xr-x ImageMagick/patchlevel.h
  99. #
  100. if test -r _shar_seq_.tmp; then
  101.     echo 'Must unpack archives in sequence!'
  102.     echo Please unpack part `cat _shar_seq_.tmp` next
  103.     exit 1
  104. fi
  105. # ============= ImageMagick/Imakefile ==============
  106. if test ! -d 'ImageMagick'; then
  107.     echo 'x - creating directory ImageMagick'
  108.     mkdir 'ImageMagick'
  109. fi
  110. if test -f 'ImageMagick/Imakefile' -a X"$1" != X"-c"; then
  111.     echo 'x - skipping ImageMagick/Imakefile (File already exists)'
  112.     rm -f _shar_wnt_.tmp
  113. else
  114. > _shar_wnt_.tmp
  115. echo 'x - extracting ImageMagick/Imakefile (Text)'
  116. sed 's/^X//' << 'SHAR_EOF' > 'ImageMagick/Imakefile' &&
  117. EXTRA_LIBRARIES= $(XLIB) -lm
  118. PROGRAMS= display import XtoPS animate
  119. SRCS= display.c X.c image.c kolb.c quantize.c colors.c rotate.c compress.c\
  120. X  PreR4Icccm.c
  121. OBJS= display.o X.o image.o kolb.o quantize.o colors.o rotate.o compress.o\
  122. X  PreR4Icccm.o
  123. ImportObjects= import.o X.o image.o kolb.o quantize.o rotate.o compress.o\
  124. X  PreR4Icccm.o
  125. XXtoPSObjects= XtoPS.o X.o image.o kolb.o quantize.o rotate.o compress.o\
  126. X  PreR4Icccm.o
  127. AnimateObjects= animate.o X.o image.o kolb.o quantize.o colors.o rotate.o\
  128. X  compress.o PreR4Icccm.o
  129. X
  130. AllTarget($(PROGRAMS))
  131. X
  132. ComplexProgramTarget(display)
  133. SingleProgramTarget(import,$(ImportObjects), , )
  134. InstallProgram(import,$(BINDIR))
  135. InstallManPage(import,$(MANDIR))
  136. SingleProgramTarget(XtoPS,$(XtoPSObjects), , )
  137. InstallProgram(XtoPS,$(BINDIR))
  138. InstallManPage(XtoPS,$(MANDIR))
  139. SingleProgramTarget(animate,$(AnimateObjects), , )
  140. InstallProgram(animate,$(BINDIR))
  141. InstallManPage(animate,$(MANDIR))
  142. SHAR_EOF
  143. chmod 0755 ImageMagick/Imakefile ||
  144. echo 'restore of ImageMagick/Imakefile failed'
  145. Wc_c="`wc -c < 'ImageMagick/Imakefile'`"
  146. test 929 -eq "$Wc_c" ||
  147.     echo 'ImageMagick/Imakefile: original size 929, current size' "$Wc_c"
  148. rm -f _shar_wnt_.tmp
  149. fi
  150. # ============= ImageMagick/Makefile ==============
  151. if test -f 'ImageMagick/Makefile' -a X"$1" != X"-c"; then
  152.     echo 'x - skipping ImageMagick/Makefile (File already exists)'
  153.     rm -f _shar_wnt_.tmp
  154. else
  155. > _shar_wnt_.tmp
  156. echo 'x - extracting ImageMagick/Makefile (Text)'
  157. sed 's/^X//' << 'SHAR_EOF' > 'ImageMagick/Makefile' &&
  158. # Makefile generated by imake - do not edit!
  159. # $XConsortium: imake.c,v 1.51 89/12/12 12:37:30 jim Exp $
  160. #
  161. # The cpp used on this machine replaces all newlines and multiple tabs and
  162. # spaces in a macro expansion with a single space.  Imake tries to compensate
  163. # for this, but is not always successful.
  164. #
  165. X
  166. ###########################################################################
  167. # Makefile generated from "Imake.tmpl" and <Imakefile>
  168. # $XConsortium: Imake.tmpl,v 1.77 89/12/18 17:01:37 jim Exp $
  169. #
  170. # Platform-specific parameters may be set in the appropriate .cf
  171. # configuration files.  Site-wide parameters may be set in the file
  172. # site.def.  Full rebuilds are recommended if any parameters are changed.
  173. #
  174. # If your C preprocessor doesn't define any unique symbols, you'll need
  175. # to set BOOTSTRAPCFLAGS when rebuilding imake (usually when doing
  176. # "make Makefile", "make Makefiles", or "make World").
  177. #
  178. # If you absolutely can't get imake to work, you'll need to set the
  179. # variables at the top of each Makefile as well as the dependencies at the
  180. # bottom (makedepend will do this automatically).
  181. #
  182. X
  183. ###########################################################################
  184. # platform-specific configuration parameters - edit sun.cf to change
  185. X
  186. # platform:  $XConsortium: sun.cf,v 1.38 89/12/23 16:10:10 jim Exp $
  187. # operating system:  SunOS 4.0.3
  188. X
  189. ###########################################################################
  190. # site-specific configuration parameters - edit site.def to change
  191. X
  192. # site:  $XConsortium: site.def,v 1.21 89/12/06 11:46:50 jim Exp $
  193. X
  194. X            SHELL = /bin/sh
  195. X
  196. X              TOP = .
  197. X      CURRENT_DIR = .
  198. X
  199. X               AR = ar cq
  200. X  BOOTSTRAPCFLAGS =
  201. X               CC = cc
  202. X
  203. X         COMPRESS = compress
  204. X              CPP = /lib/cpp $(STD_CPP_DEFINES)
  205. X    PREPROCESSCMD = cc -E $(STD_CPP_DEFINES)
  206. X          INSTALL = install
  207. X               LD = ld
  208. X             LINT = lint
  209. X      LINTLIBFLAG = -C
  210. X         LINTOPTS = -axz
  211. X               LN = ln -s
  212. X             MAKE = make
  213. X               MV = mv
  214. X               CP = cp
  215. X           RANLIB = ranlib
  216. X  RANLIBINSTFLAGS =
  217. X               RM = rm -f
  218. X     STD_INCLUDES =
  219. X  STD_CPP_DEFINES =
  220. X      STD_DEFINES =
  221. X EXTRA_LOAD_FLAGS =
  222. X  EXTRA_LIBRARIES =
  223. X             TAGS = ctags
  224. X
  225. X    SHAREDCODEDEF = -DSHAREDCODE
  226. X         SHLIBDEF = -DSUNSHLIB
  227. X
  228. X    PROTO_DEFINES =
  229. X
  230. X     INSTPGMFLAGS =
  231. X
  232. X     INSTBINFLAGS = -m 0755
  233. X     INSTUIDFLAGS = -m 4755
  234. X     INSTLIBFLAGS = -m 0664
  235. X     INSTINCFLAGS = -m 0444
  236. X     INSTMANFLAGS = -m 0444
  237. X     INSTDATFLAGS = -m 0444
  238. X    INSTKMEMFLAGS = -m 4755
  239. X
  240. X          DESTDIR =
  241. X
  242. X     TOP_INCLUDES = -I$(INCROOT)
  243. X
  244. X      CDEBUGFLAGS = -O
  245. X        CCOPTIONS =
  246. X      COMPATFLAGS =
  247. X
  248. X      ALLINCLUDES = $(STD_INCLUDES) $(TOP_INCLUDES) $(INCLUDES) $(EXTRA_INCLUDES)
  249. X       ALLDEFINES = $(ALLINCLUDES) $(STD_DEFINES) $(PROTO_DEFINES) $(DEFINES) $(COMPATFLAGS)
  250. X           CFLAGS = $(CDEBUGFLAGS) $(CCOPTIONS) $(ALLDEFINES)
  251. X        LINTFLAGS = $(LINTOPTS) -DLINT $(ALLDEFINES)
  252. X           LDLIBS = $(SYS_LIBRARIES) $(EXTRA_LIBRARIES)
  253. X        LDOPTIONS = $(CDEBUGFLAGS) $(CCOPTIONS)
  254. X   LDCOMBINEFLAGS = -X -r
  255. X
  256. X        MACROFILE = sun.cf
  257. X           RM_CMD = $(RM) *.CKP *.ln *.BAK *.bak *.o core errs ,* *~ *.a .emacs_* tags TAGS make.log MakeOut
  258. X
  259. X    IMAKE_DEFINES =
  260. X
  261. X         IRULESRC = $(CONFIGDIR)
  262. X        IMAKE_CMD = $(IMAKE) -DUseInstalled -I$(IRULESRC) $(IMAKE_DEFINES)
  263. X
  264. X     ICONFIGFILES = $(IRULESRC)/Imake.tmpl $(IRULESRC)/Imake.rules \
  265. X            $(IRULESRC)/Project.tmpl $(IRULESRC)/site.def \
  266. X            $(IRULESRC)/$(MACROFILE) $(EXTRA_ICONFIGFILES)
  267. X
  268. ###########################################################################
  269. # X Window System Build Parameters
  270. # $XConsortium: Project.tmpl,v 1.63 89/12/18 16:46:44 jim Exp $
  271. X
  272. ###########################################################################
  273. # X Window System make variables; this need to be coordinated with rules
  274. # $XConsortium: Project.tmpl,v 1.63 89/12/18 16:46:44 jim Exp $
  275. X
  276. X          PATHSEP = /
  277. X        USRLIBDIR = $(DESTDIR)/usr/lib
  278. X           BINDIR = $(DESTDIR)/usr/bin/X11
  279. X          INCROOT = $(DESTDIR)/usr/include
  280. X     BUILDINCROOT = $(TOP)
  281. X      BUILDINCDIR = $(BUILDINCROOT)/X11
  282. X      BUILDINCTOP = ..
  283. X           INCDIR = $(INCROOT)/X11
  284. X           ADMDIR = $(DESTDIR)/usr/adm
  285. X           LIBDIR = $(USRLIBDIR)/X11
  286. X        CONFIGDIR = $(LIBDIR)/config
  287. X       LINTLIBDIR = $(USRLIBDIR)/lint
  288. X
  289. X          FONTDIR = $(LIBDIR)/fonts
  290. X         XINITDIR = $(LIBDIR)/xinit
  291. X           XDMDIR = $(LIBDIR)/xdm
  292. X           AWMDIR = $(LIBDIR)/awm
  293. X           TWMDIR = $(LIBDIR)/twm
  294. X           GWMDIR = $(LIBDIR)/gwm
  295. X          MANPATH = $(DESTDIR)/usr/man
  296. X    MANSOURCEPATH = $(MANPATH)/man
  297. X           MANDIR = $(MANSOURCEPATH)n
  298. X        LIBMANDIR = $(MANSOURCEPATH)3
  299. X      XAPPLOADDIR = $(LIBDIR)/app-defaults
  300. X
  301. X        SOXLIBREV = 4.2
  302. X          SOXTREV = 4.0
  303. X         SOXAWREV = 4.0
  304. X        SOOLDXREV = 4.0
  305. X         SOXMUREV = 4.0
  306. X        SOXEXTREV = 4.0
  307. X
  308. X       FONTCFLAGS = -t
  309. X
  310. X     INSTAPPFLAGS = $(INSTDATFLAGS)
  311. X
  312. X            IMAKE = imake
  313. X           DEPEND = makedepend
  314. X              RGB = rgb
  315. X            FONTC = bdftosnf
  316. X        MKFONTDIR = mkfontdir
  317. X        MKDIRHIER = /bin/sh $(BINDIR)/mkdirhier.sh
  318. X
  319. X        CONFIGSRC = $(TOP)/config
  320. X        CLIENTSRC = $(TOP)/clients
  321. X          DEMOSRC = $(TOP)/demos
  322. X           LIBSRC = $(TOP)/lib
  323. X          FONTSRC = $(TOP)/fonts
  324. X       INCLUDESRC = $(TOP)/X11
  325. X        SERVERSRC = $(TOP)/server
  326. X          UTILSRC = $(TOP)/util
  327. X        SCRIPTSRC = $(UTILSRC)/scripts
  328. X       EXAMPLESRC = $(TOP)/examples
  329. X       CONTRIBSRC = $(TOP)/../contrib
  330. X           DOCSRC = $(TOP)/doc
  331. X           RGBSRC = $(TOP)/rgb
  332. X        DEPENDSRC = $(UTILSRC)/makedepend
  333. X         IMAKESRC = $(CONFIGSRC)
  334. X         XAUTHSRC = $(LIBSRC)/Xau
  335. X          XLIBSRC = $(LIBSRC)/X
  336. X           XMUSRC = $(LIBSRC)/Xmu
  337. X       TOOLKITSRC = $(LIBSRC)/Xt
  338. X       AWIDGETSRC = $(LIBSRC)/Xaw
  339. X       OLDXLIBSRC = $(LIBSRC)/oldX
  340. X      XDMCPLIBSRC = $(LIBSRC)/Xdmcp
  341. X      BDFTOSNFSRC = $(FONTSRC)/bdftosnf
  342. X     MKFONTDIRSRC = $(FONTSRC)/mkfontdir
  343. X     EXTENSIONSRC = $(TOP)/extensions
  344. X
  345. X  DEPEXTENSIONLIB = $(USRLIBDIR)/libXext.a
  346. X     EXTENSIONLIB =  -lXext
  347. X
  348. X          DEPXLIB = $(DEPEXTENSIONLIB)
  349. X             XLIB = $(EXTENSIONLIB) -lX11
  350. X
  351. X      DEPXAUTHLIB = $(USRLIBDIR)/libXau.a
  352. X         XAUTHLIB =  -lXau
  353. X
  354. X        DEPXMULIB =
  355. X           XMULIB = -lXmu
  356. X
  357. X       DEPOLDXLIB =
  358. X          OLDXLIB = -loldX
  359. X
  360. X      DEPXTOOLLIB =
  361. X         XTOOLLIB = -lXt
  362. X
  363. X        DEPXAWLIB =
  364. X           XAWLIB = -lXaw
  365. X
  366. X LINTEXTENSIONLIB = $(USRLIBDIR)/llib-lXext.ln
  367. X         LINTXLIB = $(USRLIBDIR)/llib-lX11.ln
  368. X          LINTXMU = $(USRLIBDIR)/llib-lXmu.ln
  369. X        LINTXTOOL = $(USRLIBDIR)/llib-lXt.ln
  370. X          LINTXAW = $(USRLIBDIR)/llib-lXaw.ln
  371. X
  372. X          DEPLIBS = $(DEPXAWLIB) $(DEPXMULIB) $(DEPXTOOLLIB) $(DEPXLIB)
  373. X
  374. X         DEPLIBS1 = $(DEPLIBS)
  375. X         DEPLIBS2 = $(DEPLIBS)
  376. X         DEPLIBS3 = $(DEPLIBS)
  377. X
  378. ###########################################################################
  379. # Imake rules for building libraries, programs, scripts, and data files
  380. # rules:  $XConsortium: Imake.rules,v 1.67 89/12/18 17:14:15 jim Exp $
  381. X
  382. ###########################################################################
  383. # start of Imakefile
  384. X
  385. EXTRA_LIBRARIES= $(XLIB) -lm
  386. PROGRAMS= display import XtoPS animate
  387. SRCS= display.c X.c image.c kolb.c quantize.c colors.c rotate.c compress.c\
  388. X  PreR4Icccm.c
  389. OBJS= display.o X.o image.o kolb.o quantize.o colors.o rotate.o compress.o\
  390. X  PreR4Icccm.o
  391. ImportObjects= import.o X.o image.o kolb.o quantize.o rotate.o compress.o\
  392. X  PreR4Icccm.o
  393. XXtoPSObjects= XtoPS.o X.o image.o kolb.o quantize.o rotate.o compress.o\
  394. X  PreR4Icccm.o
  395. AnimateObjects= animate.o X.o image.o kolb.o quantize.o colors.o rotate.o\
  396. X  compress.o PreR4Icccm.o
  397. X
  398. all:: $(PROGRAMS)
  399. X
  400. X PROGRAM = display
  401. X
  402. all:: display
  403. X
  404. display: $(OBJS) $(DEPLIBS)
  405. X    $(RM) $@
  406. X    $(CC) -o $@ $(OBJS) $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) $(EXTRA_LOAD_FLAGS)
  407. X
  408. saber_display:
  409. X    #load $(ALLDEFINES) $(SRCS) $(LOCAL_LIBRARIES) $(SYS_LIBRARIES) $(EXTRA_LIBRARIES)
  410. X
  411. osaber_display:
  412. X    #load $(ALLDEFINES) $(OBJS) $(LOCAL_LIBRARIES) $(SYS_LIBRARIES) $(EXTRA_LIBRARIES)
  413. X
  414. install:: display
  415. X    $(INSTALL) -c $(INSTPGMFLAGS)   display $(BINDIR)
  416. X
  417. install.man:: display.man
  418. X    $(INSTALL) -c $(INSTMANFLAGS) display.man $(MANDIR)/display.n
  419. X
  420. depend::
  421. X    $(DEPEND) -s "# DO NOT DELETE" -- $(ALLDEFINES) -- $(SRCS)
  422. X
  423. lint:
  424. X    $(LINT) $(LINTFLAGS) $(SRCS) $(LINTLIBS)
  425. lint1:
  426. X    $(LINT) $(LINTFLAGS) $(FILE) $(LINTLIBS)
  427. X
  428. clean::
  429. X    $(RM) $(PROGRAM)
  430. X
  431. import: $(ImportObjects)
  432. X    $(RM) $@
  433. X    $(CC) -o $@ $(ImportObjects) $(LDOPTIONS)   $(LDLIBS)   $(EXTRA_LOAD_FLAGS)
  434. X
  435. clean::
  436. X    $(RM) import
  437. X
  438. install:: import
  439. X    $(INSTALL) -c $(INSTPGMFLAGS)   import $(BINDIR)
  440. X
  441. install.man:: import.man
  442. X    $(INSTALL) -c $(INSTMANFLAGS) import.man $(MANDIR)/import.n
  443. X
  444. XXtoPS: $(XtoPSObjects)
  445. X    $(RM) $@
  446. X    $(CC) -o $@ $(XtoPSObjects) $(LDOPTIONS)   $(LDLIBS)   $(EXTRA_LOAD_FLAGS)
  447. X
  448. clean::
  449. X    $(RM) XtoPS
  450. X
  451. install:: XtoPS
  452. X    $(INSTALL) -c $(INSTPGMFLAGS)   XtoPS $(BINDIR)
  453. X
  454. install.man:: XtoPS.man
  455. X    $(INSTALL) -c $(INSTMANFLAGS) XtoPS.man $(MANDIR)/XtoPS.n
  456. X
  457. animate: $(AnimateObjects)
  458. X    $(RM) $@
  459. X    $(CC) -o $@ $(AnimateObjects) $(LDOPTIONS)   $(LDLIBS)   $(EXTRA_LOAD_FLAGS)
  460. X
  461. clean::
  462. X    $(RM) animate
  463. X
  464. install:: animate
  465. X    $(INSTALL) -c $(INSTPGMFLAGS)   animate $(BINDIR)
  466. X
  467. install.man:: animate.man
  468. X    $(INSTALL) -c $(INSTMANFLAGS) animate.man $(MANDIR)/animate.n
  469. X
  470. ###########################################################################
  471. # common rules for all Makefiles - do not edit
  472. X
  473. emptyrule::
  474. X
  475. clean::
  476. X    $(RM_CMD) \#*
  477. X
  478. Makefile::
  479. X    -@if [ -f Makefile ]; then \
  480. X    echo "    $(RM) Makefile.bak; $(MV) Makefile Makefile.bak"; \
  481. X    $(RM) Makefile.bak; $(MV) Makefile Makefile.bak; \
  482. X    else exit 0; fi
  483. X    $(IMAKE_CMD) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT_DIR)
  484. X
  485. tags::
  486. X    $(TAGS) -w *.[ch]
  487. X    $(TAGS) -xw *.[ch] > TAGS
  488. X
  489. saber:
  490. X    #load $(ALLDEFINES) $(SRCS)
  491. X
  492. osaber:
  493. X    #load $(ALLDEFINES) $(OBJS)
  494. X
  495. ###########################################################################
  496. # empty rules for directories that do not have SUBDIRS - do not edit
  497. X
  498. install::
  499. X    @echo "install in $(CURRENT_DIR) done"
  500. X
  501. install.man::
  502. X    @echo "install.man in $(CURRENT_DIR) done"
  503. X
  504. Makefiles::
  505. X
  506. includes::
  507. X
  508. ###########################################################################
  509. # dependencies generated by makedepend
  510. X
  511. SHAR_EOF
  512. chmod 0755 ImageMagick/Makefile ||
  513. echo 'restore of ImageMagick/Makefile failed'
  514. Wc_c="`wc -c < 'ImageMagick/Makefile'`"
  515. test 10190 -eq "$Wc_c" ||
  516.     echo 'ImageMagick/Makefile: original size 10190, current size' "$Wc_c"
  517. rm -f _shar_wnt_.tmp
  518. fi
  519. # ============= ImageMagick/PreR4Icccm.h ==============
  520. if test -f 'ImageMagick/PreR4Icccm.h' -a X"$1" != X"-c"; then
  521.     echo 'x - skipping ImageMagick/PreR4Icccm.h (File already exists)'
  522.     rm -f _shar_wnt_.tmp
  523. else
  524. > _shar_wnt_.tmp
  525. echo 'x - extracting ImageMagick/PreR4Icccm.h (Text)'
  526. sed 's/^X//' << 'SHAR_EOF' > 'ImageMagick/PreR4Icccm.h' &&
  527. /*
  528. X  Compatability defines for pre X11R4 ICCCM.
  529. */
  530. #ifdef vms
  531. #define XMaxRequestSize(display)  16384
  532. #endif
  533. X
  534. #define XInductColormap(display,colormap)  XInstallColormap(display,colormap)
  535. #define XUninductColormap(display,colormap)  XUninstallColormap(display,colormap)
  536. X
  537. typedef struct _XTextProperty
  538. {
  539. X  unsigned char
  540. X    *value;
  541. X
  542. X  Atom
  543. X    encoding;
  544. X
  545. X  int
  546. X    format;
  547. X
  548. X  unsigned long
  549. X    nitems;
  550. } XTextProperty;
  551. X
  552. /*
  553. X  Pre R4 ICCCM compatibility routines.
  554. */
  555. extern int
  556. X  XWMGeometry();
  557. X
  558. extern Status
  559. X  XGetRGBColormaps(),
  560. X  XGetWMName(),
  561. X  XReconfigureWMWindow(),
  562. X  XSetWMProtocols(),
  563. X  XWithdrawWindow();
  564. X
  565. extern XClassHint
  566. X  *XAllocClassHint();
  567. X
  568. extern XIconSize
  569. X  *XAllocIconSize();
  570. X
  571. extern XSizeHints
  572. X  *XAllocSizeHints();
  573. X
  574. extern XStandardColormap
  575. X  *XAllocStandardColormap();
  576. X
  577. extern XWMHints
  578. X  *XAllocWMHints();
  579. X
  580. extern VisualID
  581. X  XVisualIDFromVisual();
  582. X
  583. extern void
  584. X  XSetWMProperties();
  585. SHAR_EOF
  586. chmod 0755 ImageMagick/PreR4Icccm.h ||
  587. echo 'restore of ImageMagick/PreR4Icccm.h failed'
  588. Wc_c="`wc -c < 'ImageMagick/PreR4Icccm.h'`"
  589. test 904 -eq "$Wc_c" ||
  590.     echo 'ImageMagick/PreR4Icccm.h: original size 904, current size' "$Wc_c"
  591. rm -f _shar_wnt_.tmp
  592. fi
  593. # ============= ImageMagick/README ==============
  594. if test -f 'ImageMagick/README' -a X"$1" != X"-c"; then
  595.     echo 'x - skipping ImageMagick/README (File already exists)'
  596.     rm -f _shar_wnt_.tmp
  597. else
  598. > _shar_wnt_.tmp
  599. echo 'x - extracting ImageMagick/README (Text)'
  600. sed 's/^X//' << 'SHAR_EOF' > 'ImageMagick/README' &&
  601. AUTHOR
  602. X
  603. X  The author is cristy@dupont.com.  Comments, suggestions, or bug reports
  604. X  are welcome, but be kind.
  605. X
  606. X
  607. AVAILABLILITY
  608. X
  609. X  Anonymous FTP at export.lcs.mit.edu, file contrib/ImageMagick.tar.Z.
  610. X  I will post to comp.sources.x after a short testing period to assure
  611. X  that any bugs are fixed.
  612. X
  613. X
  614. UNIX COMPILATION
  615. X
  616. X  Type:
  617. X
  618. X    uncompress ImageMagick.tar.Z
  619. X    tar xvf ImageMagick.tar
  620. X    cd ImageMagick
  621. X    xmkmf
  622. X    make
  623. X
  624. X  If you do not have 'xmkmf', edit 'Makefile' as required by your
  625. X  hardware environment and type 'make'.  The included Makefile is for a
  626. X  SUN SPARC architecture.
  627. X
  628. X  Finally type:
  629. X
  630. X    display images/mandrill.miff
  631. X    display -monochrome -dither images/mandrill.miff
  632. X
  633. X  You can find other example images in the 'images' directory.
  634. X
  635. X  Be sure to read the manual pages for the display, import, and XtoPS
  636. X  utilities.
  637. X
  638. X  The X utilites read and write MIFF images.  Refer to the end of this
  639. X  message for more information about MIFF.  You can find filters to
  640. X  convert to and from the MIFF format in the 'filters' directory.  Change
  641. X  directory to the 'filters' directory and type 'make' to build them.  
  642. X
  643. X  Two examples of using a filter follow:
  644. X
  645. X    GIFtoMIFF image.gif - | display -
  646. X
  647. X      or
  648. X
  649. X    TIFFtoMIFF image.tiff image.miff
  650. X    display image.miff
  651. X
  652. X  The TIFFtoMIFF and MIFFtoTIFF filters require Sam Leffler's TIFF
  653. X  software available via FTP as ucbvax.berkeley.edu:pub/tiff/v2.2.tar.Z.
  654. X
  655. X  The PPMtoMIFF and MIFFtoPPM filters require Jef Poskanzer's PBMPLUS
  656. X  software available via FTP as export.lcs.mit.edu:contrib/pbmplus.tar.Z.
  657. X
  658. X  I could not include my color reduction algorithm because it is
  659. X  proprietary.  But I did include Craig Kolb's.  I have not tested his
  660. X  algorithm extensively.
  661. X
  662. X
  663. VMS COMPILATION
  664. X
  665. X  Type
  666. X
  667. X    @make
  668. X    set display/create/node=node_name::
  669. X
  670. X  where node_name is the DECNET X server to contact.
  671. X
  672. X  Finally type:
  673. X
  674. X    display images/mandrill.miff
  675. X    display -monochrome -dither images/mandrill.miff
  676. X
  677. ANIMATION
  678. X  
  679. X  To prevent colormap flashing, use a Standard Colormap or a static
  680. X  visual.  You can define a Standard Colormap with the xstdcmap
  681. X  command.  For example, to use the "best" Standard Colormap, type:
  682. X
  683. X    xstdcmap -best
  684. X    animate -map best scenes/dna.*
  685. X
  686. X  or use a static visual:
  687. X
  688. X    animate -visual staticcolor scenes/dna.*
  689. X
  690. X  Images filenames may appear in any order on the command line if the
  691. X  scene keyword is specified in the MIFF image.  A scene is specified
  692. X  when converting from another image format to MIFF by using the
  693. X  "scene" option with any filter.  To convert a TIFF images to a MIFF
  694. X  image as scene #2, type:
  695. X
  696. X    TIFFtoMIFF -scene 2 image.tiff image.miff
  697. X
  698. NOTES
  699. X
  700. X  1.  If you get a compile error on XTextProperty in PreR4Icccm.h, change it to 
  701. X      _XTextProperty. If you get a compile error on XVisualIDFromVisual 
  702. X      in PreR4Icccm.c, change it to _XVisualIDFromVisual.
  703. X
  704. X  2.  24 bit images are reduced to 244 colors on an 8 bit display to help
  705. X      prevent colormap flashing.  If you want all 256 colors, type
  706. X
  707. X        display -colors 256 image.miff
  708. X
  709. X      To further help reduce colormap flashing, do not install the default
  710. X      standard colormap (RGB_DEFAULT_MAP).
  711. X
  712. X  3.  If you have an 8 bit server and need to look at a 24 bit image
  713. X      frequently, reduce the number of colors to 256 once and write to
  714. X      a new image.  Then display this new image.  For example,
  715. X
  716. X        display -colors 256 -dither -write image.8bit image.24bit
  717. X        display image.8bit
  718. X
  719. X  4.  Use the import program to read any X window into a file that the
  720. X      display program can read.  Use the XtoPS utility to read any X
  721. X      window and output it as Postscript.
  722. X
  723. X  5.  Machine dependancies:
  724. X
  725. X      For MacX, set the DISPLAY variable to host:0.2 for the color rootless
  726. X      window.
  727. X
  728. X      I suspect all the following problems will be fixed when these
  729. X      vendors upgrade to X11R4.  I find conditional compilation
  730. X      statements offensive.  So if you have any of the following
  731. X      problems, the fix must be applied manually.
  732. X
  733. X      HP machines using Motif do not always generate an initial
  734. X      exposure event and therefore requires an extra XPutimage
  735. X      immediately following the X event loop in display.c.  The code 
  736. X      should look like this:
  737. X
  738. X        /*
  739. X            Respond to events.
  740. X        */
  741. X        XPutImage(display,image_window.id,image_window.graphic_context,
  742. X          image_window.ximage,0,0,0,0,image_window.width,image_window.height);
  743. X
  744. X      MIPS does not always generate exposure events correctly when
  745. X      displaying a monochrome image on their color server.  Holes in the
  746. X      image may appear when an area is blocked then exposed.  I do not
  747. X      currently have a solution for this problem.
  748. X
  749. X      On the Stardent put
  750. X
  751. X        *installColormap:  on
  752. X
  753. X      in your X resource file.
  754. X
  755. X  6.  I never had a chance to test this on a 16 bit machine.  If someone
  756. X      gets it working let me know and send any bug fixes.  Perhaps I
  757. X      should change 'unsigned int' to 'unsigned long'.
  758. X
  759. X  7.  Scanned images may not benefit from my runlength-encoded
  760. X      compression.  To store images uncompressed, use this command:
  761. X
  762. X        display +display +compress -write uncompressed.image compressed.image
  763. X
  764. X  8.  On occasion, a window manager (twm) may get in strange state which will 
  765. X      cause the display program to work improperly.  Fix this by restarting the
  766. X      window manager.
  767. X
  768. X  9.  If the image is displayed with incorrect colors, try using a different
  769. X      visual.  Type xdpyinfo and choose an alternative visual (if one exists)
  770. X      by either visual class or visual id.  For example, to specifically 
  771. X      choose a PseudoColor visual on a server that supports it, type
  772. X
  773. X        display -visual pseudocolor image.miff
  774. X
  775. X 10.  Make sure that the include file math.h defines the function atof as
  776. X      type double.  Otherwise the -gamma option will not work properly.
  777. X
  778. X
  779. MIFF IMAGE FORMAT
  780. X
  781. X  MIFF is an image format, which I developed.  I like it because it
  782. X
  783. X    1) It is machine independant.  It can be read on virtually any computer.  
  784. X       No byte swapping is necessary.
  785. X
  786. X    2) It has a text header.  Most image formats are coded in binary and you
  787. X       cannot easily tell attributes about the image.  Use 'more' on MIFF
  788. X       image files and the attributes are displayed in text form.
  789. X
  790. X    3) It can handle runlength-encoded images.  Although most scanned images
  791. X       do not benefit from runlength-encoding, most computer-generated images
  792. X       do.  Images of mostly uniform colors have a high compression ratio and
  793. X       therefore take up less memory and disk space.
  794. X
  795. X  One way to get an image into MIFF format is to use one of the filters in
  796. X  the 'filters' directory or read it from an X window using the
  797. X  'import' program.  Alternatively, type the necessary header
  798. X  information in a file with a text editor.  Next, dump the binary
  799. X  bytes into another file.  Finally, type
  800. X
  801. X    cat header binary_image | display -write image.miff -
  802. X
  803. X  For example, suppose you have a raw red, green, blue image file on disk
  804. X  that is 640 by 480.  The header file would look like this:
  805. X
  806. X    id=ImageMagick columns=640 rows=480 :
  807. X
  808. X  The image file would have red, green, blue tuples (rgbrgbrgb...).
  809. X
  810. X  Refer to the 'display' manual page for more details.
  811. X
  812. ACKNOWLEDGEMENTS
  813. X
  814. X  Stuart Kemp (cpsrk@marlin.jcu.edu.au) for discovering that the 
  815. X  Postscript in image.c did not clear the stack properly.
  816. X
  817. COPYRIGHT
  818. X
  819. X  Copyright 1990 E. I. Dupont de Nemours & Company
  820. X
  821. X  Permission to use, copy, modify, distribute, and sell this software and
  822. X  its documentation for any purpose is hereby granted without fee,
  823. X  provided that the above copyright notice appear in all copies and that
  824. X  both that copyright notice and this permission notice appear in
  825. X  supporting documentation, and that the name of E. I. Dupont de Nemours
  826. X  & Company not be used in advertising or publicity pertaining to
  827. X  distribution of the software without specific, written prior
  828. X  permission.  E. I. Dupont de Nemours & Company makes no representations
  829. X  about the suitability of this software for any purpose.  It is provided
  830. X  "as is" without express or implied warranty.
  831. X
  832. X  E. I. Dupont de Nemours & Company disclaims all warranties with regard
  833. X  to this software, including all implied warranties of merchantability
  834. X  and fitness, in no event shall E. I. Dupont de Nemours & Company be
  835. X  liable for any special, indirect or consequential damages or any
  836. X  damages whatsoever resulting from loss of use, data or profits, whether
  837. X  in an action of contract, negligence or other tortious action, arising
  838. X  out of or in connection with the use or performance of this software.
  839. SHAR_EOF
  840. chmod 0755 ImageMagick/README ||
  841. echo 'restore of ImageMagick/README failed'
  842. Wc_c="`wc -c < 'ImageMagick/README'`"
  843. test 8665 -eq "$Wc_c" ||
  844.     echo 'ImageMagick/README: original size 8665, current size' "$Wc_c"
  845. rm -f _shar_wnt_.tmp
  846. fi
  847. # ============= ImageMagick/XtoPS.c ==============
  848. if test -f 'ImageMagick/XtoPS.c' -a X"$1" != X"-c"; then
  849.     echo 'x - skipping ImageMagick/XtoPS.c (File already exists)'
  850.     rm -f _shar_wnt_.tmp
  851. else
  852. > _shar_wnt_.tmp
  853. echo 'x - extracting ImageMagick/XtoPS.c (Text)'
  854. sed 's/^X//' << 'SHAR_EOF' > 'ImageMagick/XtoPS.c' &&
  855. /*
  856. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  857. %                                                                             %
  858. %                                                                             %
  859. %                     X   X  TTTTT   OOO   PPPP   SSSSS                       %
  860. %                      X X     T    O   O  P   P  S                           %
  861. %                       X      T    O   O  PPPP    SSS                        %
  862. %                      X X     T    O   O  P          S                       %
  863. %                     X   X    T     OOO   P      SSSSS                       %
  864. %                                                                             %
  865. %                                                                             %
  866. %                  Import X11 image to a Postscript format.                   %
  867. %                                                                             %
  868. %                                                                             %
  869. %                           Software Design                                   %
  870. %                             John Cristy                                     %
  871. %                            January  1991                                    %
  872. %                                                                             %
  873. %                                                                             %
  874. %  Copyright 1991 E. I. Dupont de Nemours & Company                           %
  875. %                                                                             %
  876. %  Permission to use, copy, modify, distribute, and sell this software and    %
  877. %  its documentation for any purpose is hereby granted without fee,           %
  878. %  provided that the above Copyright notice appear in all copies and that     %
  879. %  both that Copyright notice and this permission notice appear in            %
  880. %  supporting documentation, and that the name of E. I. Dupont de Nemours     %
  881. %  & Company not be used in advertising or publicity pertaining to            %
  882. %  distribution of the software without specific, written prior               %
  883. %  permission.  E. I. Dupont de Nemours & Company makes no representations    %
  884. %  about the suitability of this software for any purpose.  It is provided    %
  885. %  "as is" without express or implied warranty.                               %
  886. %                                                                             %
  887. %  E. I. Dupont de Nemours & Company disclaims all warranties with regard     %
  888. %  to this software, including all implied warranties of merchantability      %
  889. %  and fitness, in no event shall E. I. Dupont de Nemours & Company be        %
  890. %  liable for any special, indirect or consequential damages or any           %
  891. %  damages whatsoever resulting from loss of use, data or profits, whether    %
  892. %  in an action of contract, negligence or other tortious action, arising     %
  893. %  out of or in connection with the use or performance of this software.      %
  894. %                                                                             %
  895. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  896. %
  897. %  XtoPS is an X Window System window dumping utility.  XtoPS reads an
  898. %  image from any visible window on an X server and outputs it to an
  899. %  encapsulated Postscript file.  You can view this file with any
  900. %  Postscript compatible viewer or printer.  The image is displayed in
  901. %  color on viewers or printers that support color Postscript, otherwise
  902. %  it is displayed as grayscale.  The target window can be specified by id
  903. %  or name or be selected by clicking the mouse in the desired window.
  904. %  The keyboard bell is rung once at the beginning of the dump and twice
  905. %  when the dump is completed.
  906. %
  907. %  The XtoPS program command syntax is: 
  908. %
  909. %  Usage: XtoPS [options ...] file
  910. %
  911. %  Where options include:
  912. %    -border             include image borders in the output image
  913. %    -display server     X server to contact
  914. %    -frame              include window manager frame
  915. %    -geometry geometry  preferred size and location of the image 
  916. %    -id number          select window with this resource id
  917. %    -monochrome         transform image to black and white
  918. %    -name name          select window with this WM_NAME property
  919. %    -root               select root window
  920. %    -rotate degrees     apply Paeth rotation to the image
  921. %    -scale geometry     preferred size factors of the image
  922. %    -screen             select image from root window
  923. %
  924. %  Change '-' to '+' in any option above to reverse its effect.
  925. %  For example, +frame means do not window manager frame.
  926. %
  927. %  Specify 'file' as '-' for standard input or output.
  928. %
  929. %
  930. */
  931. X
  932. /*
  933. X  Include declarations.
  934. */
  935. #include "display.h"
  936. #include "image.h"
  937. #include "X.h"
  938. X
  939. /*
  940. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  941. %                                                                             %
  942. %                                                                             %
  943. %                                                                             %
  944. %   E r r o r                                                                 %
  945. %                                                                             %
  946. %                                                                             %
  947. %                                                                             %
  948. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  949. %
  950. %  Function Error displays an error message and then terminates the program.
  951. %
  952. %  The format of the Error routine is: 
  953. %
  954. %      Error(message,qualifier)
  955. %
  956. %  A description of each parameter follows: 
  957. %
  958. %    o message: Specifies the message to display before terminating the
  959. %      program.
  960. %
  961. %    o qualifier: Specifies any qualifier to the message.
  962. %
  963. %
  964. */
  965. void Error(message,qualifier)
  966. char
  967. X  *message,
  968. X  *qualifier;
  969. {
  970. X  (void) fprintf(stderr,"%s: %s",application_name,message);
  971. X  if (qualifier != (char *) NULL)
  972. X    (void) fprintf(stderr," (%s)",qualifier);
  973. X  (void) fprintf(stderr,".\n");
  974. X  exit(1);
  975. }
  976. X
  977. /*
  978. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  979. %                                                                             %
  980. %                                                                             %
  981. %                                                                             %
  982. %   U s a g e                                                                 %
  983. %                                                                             %
  984. %                                                                             %
  985. %                                                                             %
  986. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  987. %
  988. %  Procedure Usage displays the program usage;
  989. %
  990. %  The format of the Usage routine is:
  991. %
  992. %      Usage(message)
  993. %
  994. %  A description of each parameter follows:
  995. %
  996. %    message:Specifies a specific message to display to the user.
  997. %
  998. */
  999. static void Usage(message)
  1000. char
  1001. X  *message;
  1002. {
  1003. X  char
  1004. X    **p;
  1005. X
  1006. X  static char
  1007. X    *options[]=
  1008. X    {
  1009. X      "-border             include image borders in the output image",
  1010. X      "-display server     X server to contact",
  1011. X      "-frame              include window manager frame",
  1012. X      "-geometry geometry  preferred size and location of the image",
  1013. X      "-id number          select window with this resource id",
  1014. X      "-monochrome         transform image to black and white",
  1015. X      "-name name          select window with this WM_NAME property",
  1016. X      "-root               select root window",
  1017. X      "-rotate degrees     apply Paeth rotation to the image",
  1018. X      "-scale geometry     preferred size factors of the image",
  1019. X      "-screen             select image from root window",
  1020. X      (char *) NULL
  1021. X    };
  1022. X  if (message != (char *) NULL)
  1023. X    (void) fprintf(stderr,"Can't continue, %s.\n\n",message);
  1024. X  (void) fprintf(stderr,"Usage: %s [options ...] file\n",application_name);
  1025. X  (void) fprintf(stderr,"\nWhere options include:\n");
  1026. X  for (p=options; *p != (char *) NULL; p++)
  1027. X    (void) fprintf(stderr,"  %s\n",*p);
  1028. X  (void) fprintf(stderr,
  1029. X    "\nChange '-' to '+' in any option above to reverse its effect.\n");
  1030. X  (void) fprintf(stderr,
  1031. X    "For example, +frame means do not include window manager frame.\n");
  1032. X  (void) fprintf(stderr,"\nSpecify 'file' as '-' for standard output.\n");
  1033. X  exit(1);
  1034. }
  1035. X
  1036. /*
  1037. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1038. %                                                                             %
  1039. %                                                                             %
  1040. %                                                                             %
  1041. %    M a i n                                                                  %
  1042. %                                                                             %
  1043. %                                                                             %
  1044. %                                                                             %
  1045. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1046. %
  1047. %
  1048. */
  1049. int main(argc,argv)
  1050. int
  1051. X  argc;
  1052. X
  1053. char
  1054. X  *argv[];
  1055. {
  1056. X  char
  1057. X    *filename,
  1058. X    *image_geometry,
  1059. X    *option,
  1060. X    *scale_geometry,
  1061. X    *server_name,
  1062. X    *user_default;
  1063. X
  1064. X  Display
  1065. X    *display;
  1066. X
  1067. X  Image
  1068. X    *image;
  1069. X
  1070. X  int
  1071. X    degrees,
  1072. X    i;
  1073. X
  1074. X  unsigned int
  1075. X    borders,
  1076. X    frame,
  1077. X    j,
  1078. X    monochrome,
  1079. X    screen;
  1080. X
  1081. X  Window
  1082. X    client_window,
  1083. X    root_window,
  1084. X    target_window;
  1085. X
  1086. X  /*
  1087. X    Display usage profile if there are no command line arguments.
  1088. X  */
  1089. X  application_name=(*argv);
  1090. X  if (argc < 2)
  1091. X    Usage((char *) NULL);
  1092. X  /*
  1093. X    Connect to X server.
  1094. X  */
  1095. X  server_name=(char *) NULL;
  1096. X  for (i=1; i < argc; i++)
  1097. X  {
  1098. X    /*
  1099. X      Check command line for server name.
  1100. X    */
  1101. X    option=argv[i];
  1102. X    if ((strlen(option) > 1) && ((*option == '-') || (*option == '+')))
  1103. X      if (strncmp("dis",option+1,3) == 0)
  1104. X        {
  1105. X          /*
  1106. X            User specified server name.
  1107. X          */
  1108. X          i++;
  1109. X          if (i == argc)
  1110. X            Usage("missing server name on -display");
  1111. X          server_name=argv[i];
  1112. X          break;
  1113. X        }
  1114. X  }
  1115. X  display=XOpenDisplay(server_name);
  1116. X  if (display == (Display *) NULL)
  1117. X    Error("unable to connect to X server",XDisplayName(server_name));
  1118. X  root_window=XRootWindow(display,XDefaultScreen(display));
  1119. X  /*
  1120. X    Get X defaults.
  1121. X  */
  1122. X  user_default=XGetDefault(display,application_name,"borders");
  1123. X  borders=IsTrue(user_default);
  1124. X  user_default=XGetDefault(display,application_name,"degrees");
  1125. X  degrees=(user_default == (char *) NULL) ? 0 : atoi(user_default);
  1126. X  user_default=XGetDefault(display,application_name,"geometry");
  1127. X  if (user_default == (char *) NULL)
  1128. X    user_default=XGetDefault(display,application_name,"Geometry");
  1129. X  image_geometry=user_default;
  1130. X  user_default=XGetDefault(display,application_name,"frame");
  1131. X  frame=IsTrue(user_default);
  1132. X  user_default=XGetDefault(display,application_name,"monochrome");
  1133. X  monochrome=IsTrue(user_default);
  1134. X  user_default=XGetDefault(display,application_name,"scale");
  1135. X  if (user_default == (char *) NULL)
  1136. X    user_default=XGetDefault(display,application_name,"Scale");
  1137. X  scale_geometry=user_default;
  1138. X  user_default=XGetDefault(display,application_name,"screen");
  1139. X  screen=IsTrue(user_default);
  1140. X  /*
  1141. X    Check command syntax.
  1142. X  */
  1143. X  filename=(char *) NULL;
  1144. X  target_window=(Window) NULL;
  1145. X  for (i=1; i < argc; i++)
  1146. X  {
  1147. X    option=argv[i];
  1148. X    if ((strlen(option) < 2) || ((*option != '-') && (*option != '+')))
  1149. X      filename=argv[i];
  1150. X    else
  1151. X      switch(*(option+1))
  1152. X      {
  1153. X        case 'b':
  1154. X        {
  1155. X          borders=(*option == '-');
  1156. X          break;
  1157. X        }
  1158. X        case 'd':
  1159. X        {
  1160. X          /*
  1161. X            User specified server name.
  1162. X          */
  1163. X          i++;
  1164. X          if (i == argc)
  1165. X            Usage("missing server name on -display");
  1166. X          server_name=argv[i];
  1167. X          break;
  1168. X        }
  1169. X        case 'g':
  1170. X        {
  1171. X          /*
  1172. X            User specified server name.
  1173. X          */
  1174. X          i++;
  1175. X          if (i == argc)
  1176. X            Usage("missing geometry on -geometry");
  1177. X          image_geometry=argv[i];
  1178. X          break;
  1179. X        }
  1180. X        case 'h':
  1181. X        {
  1182. X          Usage((char *) NULL);
  1183. X          break;
  1184. X        }
  1185. X        case 'f':
  1186. X        {
  1187. X          frame=(*option == '-');
  1188. X          break;
  1189. X        }
  1190. X        case 'i':
  1191. X        {
  1192. X          i++;
  1193. X          if (i == argc)
  1194. X            Usage("missing id on -id");
  1195. X          option=argv[i];
  1196. X          target_window=(Window) strtol(option,(char **) NULL,0);
  1197. X          break;
  1198. X        }
  1199. X        case 'm':
  1200. X        {
  1201. X          monochrome=(*option == '-');
  1202. X          break;
  1203. X        }
  1204. X        case 'n':
  1205. X        {
  1206. X          i++;
  1207. X          if (i == argc)
  1208. X            Usage("missing name on -name");
  1209. X          option=argv[i]; 
  1210. X          target_window=XWindowByName(display,root_window,option);
  1211. X          if (target_window == (Window) NULL)
  1212. X            (void) fprintf(stderr,"No window with name %s exists!\n",option);
  1213. X          break;
  1214. X        }
  1215. X        case 'r': 
  1216. X        {
  1217. X          if (strncmp("roo",option+1,3) == 0)
  1218. X            target_window=root_window;
  1219. X          else
  1220. X            if (strncmp("rot",option+1,3) == 0)
  1221. X              {
  1222. X                degrees=0.0;
  1223. X                if (*option == '-')
  1224. X                  {
  1225. X                    i++;
  1226. X                    if (i == argc)
  1227. X                      Usage("missing degrees on -rotate");
  1228. X                    degrees=atoi(argv[i]);
  1229. X                  }
  1230. X              }
  1231. X            else
  1232. X              Usage(option);
  1233. X          break;
  1234. X        }
  1235. X        case 's': 
  1236. X        {
  1237. X          if (strncmp("scale",option+1,4) == 0)
  1238. X            {
  1239. X              scale_geometry=(char *) NULL;
  1240. X              if (*option == '-')
  1241. X                {
  1242. X                  i++;
  1243. X                  if (i == argc)
  1244. X                    Usage("missing scale geometry on -scale");
  1245. X                  scale_geometry=argv[i];
  1246. X                }
  1247. X              }
  1248. X            else
  1249. X              if (strncmp("screen",option+1,4) == 0)
  1250. X                screen=(*option == '-');
  1251. X              else
  1252. X                Usage((char *) NULL);
  1253. X          break;
  1254. X        }
  1255. X        default:
  1256. X          Usage((char *) NULL);
  1257. X      }
  1258. X  }
  1259. X  if (filename == (char *) NULL)
  1260. X    Usage("missing an image file name");
  1261. X  /*
  1262. X    If the window is not specified, let the user choose one with the mouse.
  1263. X  */
  1264. X  if (target_window == (Window) NULL)
  1265. X    target_window=XSelectWindow(display,root_window);
  1266. X  client_window=target_window;
  1267. X  if (target_window != root_window)
  1268. X    if (XGetGeometry(display,target_window,&root_window,&i,&i,&j,&j,&j,&j) != 0)
  1269. X      {
  1270. X        /*
  1271. X          Get client window.
  1272. X        */
  1273. X        client_window=XClientWindow(display,target_window);
  1274. X        if (!frame)
  1275. X          target_window=client_window;
  1276. X      }
  1277. X  image=XReadImage(display,root_window,target_window,client_window,screen,
  1278. X    borders);
  1279. X  if (image == (Image *) NULL)
  1280. X    exit(1);
  1281. X  if (image_geometry || scale_geometry)
  1282. X    image=TransformImage(image,(char *) NULL,image_geometry,scale_geometry);
  1283. X  if ((degrees % 360) != 0)
  1284. X    {
  1285. X      Image
  1286. X        *rotated_image;
  1287. X
  1288. X      /*
  1289. X        Rotate image.
  1290. X      */
  1291. X      rotated_image=RotateImage(image,(double) degrees,False);
  1292. X      if (rotated_image != (Image *) NULL)
  1293. X        {
  1294. X          DestroyImage(image);
  1295. X          image=rotated_image;
  1296. X        }
  1297. X    }
  1298. X  if (monochrome)
  1299. X    {
  1300. X      register unsigned int
  1301. X        bit;
  1302. X
  1303. X      /*
  1304. X        Convert image to monochrome PseudoColor class.
  1305. X      */
  1306. X      (void) QuantizeImage(image,2,0,False,True);
  1307. X      bit=Intensity(image->colormap[0]) > Intensity(image->colormap[1]);
  1308. X      image->colormap[bit].red=0;
  1309. X      image->colormap[bit].green=0;
  1310. X      image->colormap[bit].blue=0;
  1311. X      image->colormap[!bit].red=255;
  1312. X      image->colormap[!bit].green=255;
  1313. X      image->colormap[!bit].blue=255;
  1314. X    }
  1315. X  (void) strcpy(image->filename,filename);
  1316. X  (void) fprintf(stderr,"%s %dx%d\n",image->filename,image->columns,
  1317. X    image->rows);
  1318. X  (void) PrintImage(image,image_geometry);
  1319. X  DestroyImage(image);
  1320. X  return(False);
  1321. }
  1322. SHAR_EOF
  1323. chmod 0755 ImageMagick/XtoPS.c ||
  1324. echo 'restore of ImageMagick/XtoPS.c failed'
  1325. Wc_c="`wc -c < 'ImageMagick/XtoPS.c'`"
  1326. test 16185 -eq "$Wc_c" ||
  1327.     echo 'ImageMagick/XtoPS.c: original size 16185, current size' "$Wc_c"
  1328. rm -f _shar_wnt_.tmp
  1329. fi
  1330. # ============= ImageMagick/XtoPS.man ==============
  1331. if test -f 'ImageMagick/XtoPS.man' -a X"$1" != X"-c"; then
  1332.     echo 'x - skipping ImageMagick/XtoPS.man (File already exists)'
  1333.     rm -f _shar_wnt_.tmp
  1334. else
  1335. > _shar_wnt_.tmp
  1336. echo 'x - extracting ImageMagick/XtoPS.man (Text)'
  1337. sed 's/^X//' << 'SHAR_EOF' > 'ImageMagick/XtoPS.man' &&
  1338. .ad l
  1339. .nh
  1340. .TH XtoPS 1 "1 January 1991" "X Version 11"
  1341. .SH NAME
  1342. XXtoPS - dump an image of an X window as encapsulated Postscript
  1343. .SH SYNOPSIS
  1344. .B "XtoPS"
  1345. [ \fIoptions\fP ... ] \fIfile\fP
  1346. .SH DESCRIPTION
  1347. .PP
  1348. .I XtoPS
  1349. is an X Window System window dumping utility.
  1350. .I XtoPS
  1351. reads an image from any visible window on an X server and outputs it to
  1352. an encapsulated Postscript file.  You can view this file with any
  1353. Postscript compatible viewer or printer.  The image is displayed in
  1354. color on Postscript viewers or printers that support color, otherwise
  1355. it is displayed as grayscale.
  1356. .pp
  1357. The target window can be specified by id or name or be selected by
  1358. clicking the mouse in the desired window.  The keyboard bell is rung
  1359. once at the beginning of the dump and twice when the dump is
  1360. completed.
  1361. .SH EXAMPLES
  1362. .PP
  1363. To select a X window and save it as encapsulated Postscript in a file on 
  1364. disk titled window.ps, use:
  1365. .PP
  1366. X     XtoPS window.ps
  1367. .PP
  1368. To select a X window and save it as encapsulated Postscript in a file on
  1369. disk titled figure.ps to include in another document, use:
  1370. .PP
  1371. X     XtoPS -geometry +0+0 figure.ps
  1372. .PP
  1373. To save the entire X server screen as encapsulated Postscript in a file on
  1374. disk titled root.ps, use:
  1375. .PP
  1376. X     XtoPS -root root.ps
  1377. .SH OPTIONS
  1378. \fIXtoPS\fP options can appear on the command line or in your X resources
  1379. file (see X(1)).  Options on the command line supercede values specified
  1380. in your X resources file.
  1381. .TP 5
  1382. .B "-border"
  1383. include image borders in the output image.
  1384. .TP 5
  1385. .B "-display \fIhost:display[.screen]\fP"
  1386. specifies the X server to contact; see \fBX(1)\fP.
  1387. .TP 5
  1388. .B "-frame"
  1389. include window manager frame.
  1390. .TP 5
  1391. .B "-geometry \fI<width>x<height>{\+-}<x offset>{\+-}<y offset>\fP"
  1392. preferred size and location of the image on the Postscript page.  
  1393. See \fBX(1)\fP for details about the geometry specification.  By default, 
  1394. the image is centered and scaled to fit on the Postscript page.
  1395. X
  1396. If the specified image size is smaller than the actual image size, the
  1397. image is first reduced to an integral of the specified image size with
  1398. an antialias digital filter.  The image is then scaled to the exact
  1399. specified image size with pixel replication.  If the specified image
  1400. size is greater than the actual image size, the image is first enlarged
  1401. to an integral of the specified image size with bilinear
  1402. interpolation.  The image is then scaled to the exact specified image
  1403. size with pixel replication.
  1404. .TP 5
  1405. .B "-id \fIvalue\fP"
  1406. select window with this resource id.
  1407. X
  1408. See \fBxwininfo(1)\fP for one way of listing window resource id's.
  1409. .TP 5
  1410. .B "-monochrome"
  1411. transform image to black and white.
  1412. .TP 5
  1413. .B "-name \fIname\fP"
  1414. select window with this WM_NAME property.
  1415. X
  1416. See \fBxprop(1)\fP for one way of listing window property's.
  1417. .TP 5
  1418. .B "-root"
  1419. select root window.
  1420. .TP 5
  1421. .B "-rotate \fIdegrees\fP"
  1422. apply Paeth image rotation to the image.
  1423. X
  1424. By default the image is output in portrait mode.  Use \fB-rotate 90\fP to
  1425. display the image in landscape mode.
  1426. .TP 5
  1427. .B "-scale \fI<width factor>x<height factor>\fP"
  1428. preferred size factors of the image.
  1429. X
  1430. This option behaves like \fB-geometry\fP except the width and height values
  1431. are relative instead of absolute.  The image size is multiplied by the
  1432. width and height factors to obtain the final image dimensions.  If only
  1433. one factor is specified, both the width and height factors assume the
  1434. value.
  1435. X
  1436. Factors may be fractional.  For example, a factor of 1.5 will increase the
  1437. image size by one and one-half.
  1438. .TP 5
  1439. .B "-screen"
  1440. This option indicates that the GetImage request used to obtain the image
  1441. should be done on the root window, rather than directly on the specified
  1442. window.  In this way, you can obtain pieces of other windows that overlap
  1443. the specified window, and more importantly, you can capture menus or other
  1444. popups that are independent windows but appear over the specified window.
  1445. .PP
  1446. Change \fI-\fP to \fI+\fP in any option above to reverse its effect.  For
  1447. example \fB+frame\fP means do not include window manager frame.
  1448. .PP
  1449. Specify \fIfile\fP as \fI-\fP for standard input or output.
  1450. .PP
  1451. .SH ENVIRONMENT
  1452. .PP
  1453. .TP 5
  1454. .B DISPLAY
  1455. To get the default host, display number, and screen.
  1456. .SH SEE ALSO
  1457. XX(1), display(1), import(1)
  1458. .SH COPYRIGHT
  1459. Copyright 1991 E. I. Dupont de Nemours & Company                           
  1460. .PP                                                                           
  1461. Permission to use, copy, modify, distribute, and sell this software and    
  1462. its documentation for any purpose is hereby granted without fee,           
  1463. provided that the above copyright notice appear in all copies and that     
  1464. both that copyright notice and this permission notice appear in            
  1465. supporting documentation, and that the name of E. I. Dupont de Nemours     
  1466. & Company not be used in advertising or publicity pertaining to            
  1467. distribution of the software without specific, written prior               
  1468. permission.  E. I. Dupont de Nemours & Company makes no representations    
  1469. about the suitability of this software for any purpose.  It is provided    
  1470. "as is" without express or implied warranty.                               
  1471. .PP
  1472. E. I. Dupont de Nemours & Company disclaims all warranties with regard     
  1473. to this software, including all implied warranties of merchantability      
  1474. and fitness, in no event shall E. I. Dupont de Nemours & Company be        
  1475. liable for any special, indirect or consequential damages or any           
  1476. damages whatsoever resulting from loss of use, data or profits, whether    
  1477. in an action of contract, negligence or other tortious action, arising     
  1478. out of or in connection with the use or performance of this software.      
  1479. .SH AUTHORS
  1480. John Cristy, E.I. DuPont De Nemours & Company Incorporated
  1481. X
  1482. SHAR_EOF
  1483. chmod 0755 ImageMagick/XtoPS.man ||
  1484. echo 'restore of ImageMagick/XtoPS.man failed'
  1485. Wc_c="`wc -c < 'ImageMagick/XtoPS.man'`"
  1486. test 5731 -eq "$Wc_c" ||
  1487.     echo 'ImageMagick/XtoPS.man: original size 5731, current size' "$Wc_c"
  1488. rm -f _shar_wnt_.tmp
  1489. fi
  1490. # ============= ImageMagick/Manifest.ps ==============
  1491. if test -f 'ImageMagick/Manifest.ps' -a X"$1" != X"-c"; then
  1492.     echo 'x - skipping ImageMagick/Manifest.ps (File already exists)'
  1493.     rm -f _shar_wnt_.tmp
  1494. else
  1495. > _shar_wnt_.tmp
  1496. echo 'x - extracting ImageMagick/Manifest.ps (Binary)'
  1497. sed 's/^X//' << 'SHAR_EOF' > _shar_tmp_.tmp &&
  1498. begin 600 ImageMagick/Manifest.ps
  1499. M)2%04RU!9&]B92TR+C`@15!31BTR+C`*)254:71L93H@*$1I<F5C=&]R>2!M
  1500. M87`@;V8@26UA9V5-86=I8VLI"B4E0W)E871O<CH@<'-T<F5E+"`H0RD@,3DY
  1501. M,"!':7-L92!!87,L($Y2"B4E1&]C=6UE;G1&;VYT<SH@5&EM97,M4F]M86X*
  1502. M)25";W5N9&EN9T)O>#H@-C`@.3(@,S`U(#<T,@HV,"XP(#`@=')A;G-L871E
  1503. M"B]S('MS:&]W?2!B:6YD(&1E9@HO;2![;6]V971O?2!B:6YD(&1E9@HO5&EM
  1504. M97,M4F]M86X@9FEN9&9O;G0@,3`@<V-A;&5F;VYT('-E=&9O;G0*,"XQ('-E
  1505. M=&QI;F5W:61T:`HY,"`W,S(@;2A!;FYO=6YC92ES"CDP(#<R,B!M*$EM86ME
  1506. M9FEL92ES"CDP(#<Q,B!M*$UA:V4N8V]M*7,*.3`@-S`R(&TH36%K969I;&4I
  1507. M<PHY,"`V.3(@;2A-86YI9F5S="YP<RES"CDP(#8X,B!M*%!R95(T26-C8VTN
  1508. M8RES"CDP(#8W,B!M*%!R95(T26-C8VTN:"ES"CDP(#8V,B!M*%)%041-12ES
  1509. M"CDP(#8U,B!M*%@N8RES"CDP(#8T,B!M*%@N:"ES"CDP(#8S,B!M*%AT;U!3
  1510. M+F,I<PHY,"`V,C(@;2A8=&]04RYM86XI<PHY,"`V,3(@;2AA;FEM871E+F,I
  1511. M<PHY,"`V,#(@;2AA;FEM871E+F@I<PHY,"`U.3(@;2AA;FEM871E+FUA;BES
  1512. M"CDP(#4X,B!M*&-O;&]R<RYC*7,*.3`@-3<R(&TH8V]M<')E<W,N8RES"CDP
  1513. M(#4V,B!M*&1I<W!L87DN8RES"CDP(#4U,B!M*&1I<W!L87DN:"ES"CDP(#4T
  1514. M,B!M*&1I<W!L87DN;6%N*7,*,3@P(#4S,B!M*$%64W1O34E&1BYC*7,*,3@P
  1515. M(#4R,B!M*$=)1G1O34E&1BYC*7,*,3@P(#4Q,B!M*$=205ET;TU)1D8N8RES
  1516. M"C$X,"`U,#(@;2A);6%K969I;&4I<PHQ.#`@-#DR(&TH34E&1G1O0593+F,I
  1517. M<PHQ.#`@-#@R(&TH34E&1G1O1TE&+F,I<PHQ.#`@-#<R(&TH34E&1G1O1U)!
  1518. M62YC*7,*,3@P(#0V,B!M*$U)1D9T;TU45BYC*7,*,3@P(#0U,B!M*$U)1D9T
  1519. M;U!032YC*7,*,3@P(#0T,B!M*$U)1D9T;U)'0BYC*7,*,3@P(#0S,B!M*$U)
  1520. M1D9T;U-53BYC*7,*,3@P(#0R,B!M*$U)1D9T;U1)1D8N8RES"C$X,"`T,3(@
  1521. M;2A-249&=&]80DTN8RES"C$X,"`T,#(@;2A-249&=&]85T0N8RES"C$X,"`S
  1522. M.3(@;2A-5%9T;TU)1D8N8RES"C$X,"`S.#(@;2A-86ME9FEL92ES"C$X,"`S
  1523. M-S(@;2A04$UT;TU)1D8N8RES"C$X,"`S-C(@;2A214%$344I<PHQ.#`@,S4R
  1524. M(&TH4D="=&]-249&+F,I<PHQ.#`@,S0R(&TH4U5.=&]-249&+F,I<PHQ.#`@
  1525. M,S,R(&TH5$E&1G1O34E&1BYC*7,*,3@P(#,R,B!M*%1)1D9T;U-53BES"C$X
  1526. M,"`S,3(@;2A4249&=&]354XN8RES"C$X,"`S,#(@;2A63U)4=&]-249&+F,I
  1527. M<PHQ.#`@,CDR(&TH6$)-=&]-249&+F,I<PHQ.#`@,C@R(&TH6%=$=&]-249&
  1528. M+F,I<PHY,"`T,#<@;2AF:6QT97)S*7,**&9I;'1E<G,I('-T<FEN9W=I9'1H
  1529. M('!O<"`Y,2XP(&%D9"`T,3`N,R!M"EL@-3,U+C,@-3(U+C,@-3$U+C,@-3`U
  1530. M+C,@-#DU+C,@-#@U+C,@-#<U+C,@-#8U+C,@-#4U+C,@-#0U+C,@-#,U+C,@
  1531. M-#(U+C,@-#$U+C,@-#`U+C,@,SDU+C,@,S@U+C,@,S<U+C,@,S8U+C,@,S4U
  1532. M+C,@,S0U+C,@,S,U+C,@,S(U+C,@,S$U+C,@,S`U+C,@,CDU+C,@,C@U+C-=
  1533. M"GMG<V%V92`Q-S8N,"!E>&-H(&QI;F5T;R!S=')O:V4@9W)E<W1O<F5](&9O
  1534. M<F%L;`HY,"`R-S(@;2AI;6%G92YC*7,*.3`@,C8R(&TH:6UA9V4N:"ES"C$X
  1535. M,"`R-3(@;2AD;F$N;6EF9BES"C$X,"`R-#(@;2AM86YD<FEL;"YM:69F*7,*
  1536. M,3@P(#(S,B!M*'-W86XN;6EF9BES"C$X,"`R,C(@;2AT86)L92YM:69F*7,*
  1537. M.3`@,C,W(&TH:6UA9V5S*7,**&EM86=E<RD@<W1R:6YG=VED=&@@<&]P(#DQ
  1538. M+C`@861D(#(T,"XS(&T*6R`R-34N,R`R-#4N,R`R,S4N,R`R,C4N,UT*>V=S
  1539. M879E(#$W-BXP(&5X8V@@;&EN971O('-T<F]K92!G<F5S=&]R97T@9F]R86QL
  1540. M"CDP(#(Q,B!M*&EM<&]R="YC*7,*.3`@,C`R(&TH:6UP;W)T+FUA;BES"CDP
  1541. M(#$Y,B!M*&MO;&(N8RES"CDP(#$X,B!M*'%U86YT:7IE+F,I<PHY,"`Q-S(@
  1542. M;2AR;W1A=&4N8RES"CDP(#$V,B!M*'-C96YE<RES"C$X,"`Q-3(@;2A);6%K
  1543. M969I;&4I<PHQ.#`@,30R(&TH36%K969I;&4I<PHQ.#`@,3,R(&TH4D5!1$U%
  1544. M*7,*,3@P(#$R,B!M*')E9W5L87(N8RES"C$X,"`Q,3(@;2AR96=U;&%R+F@I
  1545. M<PHQ.#`@,3`R(&TH>'1P+F,I<PHQ.#`@.3(@;2AX='`N;6%N*7,*.3`@,3(R
  1546. M(&TH>'1P*7,**'AT<"D@<W1R:6YG=VED=&@@<&]P(#DQ+C`@861D(#$R-2XS
  1547. M(&T*6R`Q-34N,R`Q-#4N,R`Q,S4N,R`Q,C4N,R`Q,34N,R`Q,#4N,R`Y-2XS
  1548. M70I[9W-A=F4@,3<V+C`@97AC:"!L:6YE=&\@<W1R;VME(&=R97-T;W)E?2!F
  1549. M;W)A;&P*,"`T,C<@;2A);6%G94UA9VEC:RES"BA);6%G94UA9VEC:RD@<W1R
  1550. M:6YG=VED=&@@<&]P(#$N,"!A9&0@-#,P+C,@;0I;(#<S-2XS(#<R-2XS(#<Q
  1551. M-2XS(#<P-2XS(#8Y-2XS(#8X-2XS(#8W-2XS(#8V-2XS(#8U-2XS(#8T-2XS
  1552. M(#8S-2XS(#8R-2XS(#8Q-2XS(#8P-2XS(#4Y-2XS(#4X-2XS(#4W-2XS(#4V
  1553. M-2XS(#4U-2XS(#4T-2XS(#0Q,"XS(#(W-2XS(#(V-2XS(#(T,"XS(#(Q-2XS
  1554. M(#(P-2XS(#$Y-2XS(#$X-2XS(#$W-2XS(#$V-2XS(#$R-2XS70I[9W-A=F4@
  1555. M.#8N,"!E>&-H(&QI;F5T;R!S=')O:V4@9W)E<W1O<F5](&9O<F%L;`IS:&]W
  1556. %<&%G90IE
  1557. `
  1558. end
  1559. SHAR_EOF
  1560. echo 'uudecoding file ImageMagick/Manifest.ps' &&
  1561. uudecode < _shar_tmp_.tmp && rm -f _shar_tmp_.tmp &&
  1562. chmod 0755 ImageMagick/Manifest.ps ||
  1563. echo 'restore of ImageMagick/Manifest.ps failed'
  1564. Wc_c="`wc -c < 'ImageMagick/Manifest.ps'`"
  1565. test 2570 -eq "$Wc_c" ||
  1566.     echo 'ImageMagick/Manifest.ps: original size 2570, current size' "$Wc_c"
  1567. rm -f _shar_wnt_.tmp
  1568. fi
  1569. # ============= ImageMagick/colors.c ==============
  1570. if test -f 'ImageMagick/colors.c' -a X"$1" != X"-c"; then
  1571.     echo 'x - skipping ImageMagick/colors.c (File already exists)'
  1572.     rm -f _shar_wnt_.tmp
  1573. else
  1574. > _shar_wnt_.tmp
  1575. echo 'x - extracting ImageMagick/colors.c (Text)'
  1576. sed 's/^X//' << 'SHAR_EOF' > 'ImageMagick/colors.c' &&
  1577. /*
  1578. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1579. %                                                                             %
  1580. %                                                                             %
  1581. %                                                                             %
  1582. %                  CCCC   OOO   L       OOO   RRRR    SSSSS                   %
  1583. %                 C      O   O  L      O   O  R   R   SS                      %
  1584. %                 C      O   O  L      O   O  RRRR     SSS                    %
  1585. %                 C      O   O  L      O   O  R R        SS                   %
  1586. %                  CCCC   OOO   LLLLL   OOO   R  R    SSSSS                   %
  1587. %                                                                             %
  1588. %                                                                             %
  1589. %                       Count the Colors in an Image                          %
  1590. %                                                                             %
  1591. %                                                                             %
  1592. %                                                                             %
  1593. %                           Software Design                                   %
  1594. %                             John Cristy                                     %
  1595. %                            January  1991                                    %
  1596. %                                                                             %
  1597. %                                                                             %
  1598. %  Copyright 1991 E. I. Dupont de Nemours & Company                           %
  1599. %                                                                             %
  1600. %  Permission to use, copy, modify, distribute, and sell this software and    %
  1601. %  its documentation for any purpose is hereby granted without fee,           %
  1602. %  provided that the above Copyright notice appear in all copies and that     %
  1603. %  both that Copyright notice and this permission notice appear in            %
  1604. %  supporting documentation, and that the name of E. I. Dupont de Nemours     %
  1605. %  & Company not be used in advertising or publicity pertaining to            %
  1606. %  distribution of the software without specific, written prior               %
  1607. %  permission.  E. I. Dupont de Nemours & Company makes no representations    %
  1608. %  about the suitability of this software for any purpose.  It is provided    %
  1609. %  "as is" without express or implied warranty.                               %
  1610. %                                                                             %
  1611. %  E. I. Dupont de Nemours & Company disclaims all warranties with regard     %
  1612. %  to this software, including all implied warranties of merchantability      %
  1613. %  and fitness, in no event shall E. I. Dupont de Nemours & Company be        %
  1614. %  liable for any special, indirect or consequential damages or any           %
  1615. %  damages whatsoever resulting from loss of use, data or profits, whether    %
  1616. %  in an action of contract, negligence or other tortious action, arising     %
  1617. %  out of or in connection with the use or performance of this software.      %
  1618. %                                                                             %
  1619. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1620. %
  1621. %
  1622. %
  1623. */
  1624. X
  1625. /*
  1626. X  Include declarations.
  1627. */
  1628. #include "display.h"
  1629. #include "image.h"
  1630. /*
  1631. X  Define declarations.
  1632. */
  1633. #define MaxTreeDepth  8  /* Log2(MaxRgb) */
  1634. #define NodesInAList  2047
  1635. X
  1636. /*
  1637. X  Structures.
  1638. */
  1639. typedef struct _Node
  1640. {
  1641. X  struct _Node
  1642. X    *child[8];
  1643. X
  1644. X  unsigned char
  1645. X    mid_red,
  1646. X    mid_green,
  1647. X    mid_blue;
  1648. } Node;
  1649. X
  1650. typedef struct _Nodes
  1651. {
  1652. X  Node
  1653. X    nodes[NodesInAList];
  1654. X
  1655. X  struct _Nodes
  1656. X    *next;
  1657. } Nodes;
  1658. X
  1659. typedef struct _Cube
  1660. {
  1661. X  Node
  1662. X    *root,
  1663. X    *leaf;
  1664. X
  1665. X  unsigned int
  1666. X    colors;
  1667. X
  1668. X  unsigned int
  1669. X    free_nodes;
  1670. X
  1671. X  Node
  1672. X    *node;
  1673. X
  1674. X  Nodes
  1675. X    *node_list;
  1676. } Cube;
  1677. X
  1678. /*
  1679. X  Global variables.
  1680. */
  1681. static Cube
  1682. X  cube;
  1683. X
  1684. /*
  1685. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1686. %                                                                             %
  1687. %                                                                             %
  1688. %                                                                             %
  1689. %  I n i t i a l i z e N o d e                                                %
  1690. %                                                                             %
  1691. %                                                                             %
  1692. %                                                                             %
  1693. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1694. %
  1695. %  Function InitializeNode allocates memory for a new node in the color cube
  1696. %  tree and presets all fields to zero.
  1697. %
  1698. %  The format of the InitializeNode routine is: 
  1699. %
  1700. %      node=InitializeNode(mid_red,mid_green,mid_blue)
  1701. %
  1702. %  A description of each parameter follows.
  1703. %
  1704. %    o mid_red: Specifies the mid point of the red axis for this node.
  1705. %
  1706. %    o mid_green: Specifies the mid point of the green axis for this node.
  1707. %
  1708. %    o mid_blue: Specifies the mid point of the blue axis for this node.
  1709. %
  1710. %
  1711. */
  1712. static Node *InitializeNode(mid_red,mid_green,mid_blue)
  1713. register unsigned char
  1714. X  mid_red,
  1715. X  mid_green,
  1716. X  mid_blue;
  1717. {
  1718. X  register int
  1719. X    i;
  1720. X
  1721. X  register Node
  1722. X    *node;
  1723. X
  1724. X  if (cube.free_nodes == 0)
  1725. X    {
  1726. X      register Nodes
  1727. X        *nodes;
  1728. X
  1729. X      /*
  1730. X        Allocate a new nodes of nodes.
  1731. X      */
  1732. X      nodes=(Nodes *) malloc(sizeof(Nodes));
  1733. X      if (nodes == (Nodes *) NULL)
  1734. X        return((Node *) NULL);
  1735. X      nodes->next=cube.node_list;
  1736. X      cube.node_list=nodes;
  1737. X      cube.node=nodes->nodes;
  1738. X      cube.free_nodes=NodesInAList;
  1739. X    }
  1740. X  cube.free_nodes--;
  1741. X  node=cube.node++;
  1742. X  for (i=0; i < 8; i++)
  1743. X    node->child[i]=(Node *) NULL;
  1744. X  node->mid_red=mid_red;
  1745. X  node->mid_green=mid_green;
  1746. X  node->mid_blue=mid_blue;
  1747. X  return(node);
  1748. }
  1749. X
  1750. /*
  1751. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1752. %                                                                             %
  1753. %                                                                             %
  1754. %                                                                             %
  1755. %  N u m b e r C o l o r s                                                    %
  1756. %                                                                             %
  1757. %                                                                             %
  1758. %                                                                             %
  1759. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1760. %
  1761. %  Function NumberColors returns the number of unique colors in an image.
  1762. %
  1763. %  The format of the NumberColors routine is: 
  1764. %
  1765. %      number_colors=NumberColors(image)
  1766. %
  1767. %  A description of each parameter follows.
  1768. %
  1769. %    o image: The address of a byte (8 bits) array of run-length
  1770. %      encoded pixel data of your source image.  The sum of the
  1771. %      run-length counts in the source image must be equal to or exceed
  1772. %      the number of pixels.
  1773. %
  1774. %
  1775. */
  1776. unsigned int NumberColors(image)
  1777. Image
  1778. X  *image;
  1779. {
  1780. X  Nodes
  1781. X    *nodes;
  1782. X
  1783. X  register RunlengthPacket
  1784. X    *p;
  1785. X
  1786. X  register int
  1787. X    i;
  1788. X
  1789. X  register Node
  1790. X    *node;
  1791. X
  1792. X  register unsigned char
  1793. X    bisect,
  1794. X    id;
  1795. X
  1796. X  register unsigned int
  1797. X    level;
  1798. X
  1799. X  /*
  1800. X    Initialize color description tree.
  1801. X  */
  1802. X  cube.node_list=(Nodes *) NULL;
  1803. X  cube.colors=0;
  1804. X  cube.free_nodes=0;
  1805. X  cube.root=InitializeNode(MaxRgb >> 1,MaxRgb >> 1,MaxRgb >> 1);
  1806. X  cube.leaf=InitializeNode(0,0,0);
  1807. X  if ((cube.root == (Node *) NULL) || (cube.leaf == (Node *) NULL))
  1808. X    {
  1809. X      Warning("unable to count colors","memory allocation failed");
  1810. X      return(0);
  1811. X    }
  1812. X  p=image->pixels;
  1813. X  for (i=0; i < image->packets; i++)
  1814. X  {
  1815. X    /*
  1816. X      Start at the root and proceed level by level.
  1817. X    */
  1818. X    node=cube.root;
  1819. X    for (level=1; level < MaxTreeDepth; level++)
  1820. X    {
  1821. X      id=(p->red > node->mid_red) | (p->green > node->mid_green) << 1 |
  1822. X        (p->blue > node->mid_blue) << 2;
  1823. X      if (node->child[id] == (Node *) NULL)
  1824. X        {
  1825. X          bisect=(1 << (MaxTreeDepth-level)) >> 1;
  1826. X          node->child[id]=InitializeNode(
  1827. X            node->mid_red+(id & 1 ? bisect : -bisect),
  1828. X            node->mid_green+(id & 2 ? bisect : -bisect),
  1829. X            node->mid_blue+(id & 4 ? bisect : -bisect));
  1830. X          if (node->child[id] == (Node *) NULL)
  1831. X            {
  1832. X              Warning("unable to count colors","memory allocation failed");
  1833. X              return(0);
  1834. X            }
  1835. X        }
  1836. X      node=node->child[id];
  1837. X    }
  1838. X    id=(p->red > node->mid_red) | (p->green > node->mid_green) << 1 |
  1839. X      (p->blue > node->mid_blue) << 2;
  1840. X    if (node->child[id] == (Node *) NULL)
  1841. X      {
  1842. X        node->child[id]=cube.leaf;
  1843. X        cube.colors++;
  1844. X      }
  1845. X    p++;
  1846. X  }
  1847. X  /*
  1848. X    Release color cube tree storage.
  1849. X  */
  1850. X  do
  1851. X  {
  1852. X    nodes=cube.node_list->next;
  1853. X    (void) free((char *) cube.node_list);
  1854. X    cube.node_list=nodes;
  1855. X  }
  1856. X  while (cube.node_list != (Nodes *) NULL);
  1857. X  return(cube.colors);
  1858. }
  1859. SHAR_EOF
  1860. chmod 0755 ImageMagick/colors.c ||
  1861. echo 'restore of ImageMagick/colors.c failed'
  1862. Wc_c="`wc -c < 'ImageMagick/colors.c'`"
  1863. test 9085 -eq "$Wc_c" ||
  1864.     echo 'ImageMagick/colors.c: original size 9085, current size' "$Wc_c"
  1865. rm -f _shar_wnt_.tmp
  1866. fi
  1867. # ============= ImageMagick/Make.com ==============
  1868. if test -f 'ImageMagick/Make.com' -a X"$1" != X"-c"; then
  1869.     echo 'x - skipping ImageMagick/Make.com (File already exists)'
  1870.     rm -f _shar_wnt_.tmp
  1871. else
  1872. > _shar_wnt_.tmp
  1873. echo 'x - extracting ImageMagick/Make.com (Text)'
  1874. sed 's/^X//' << 'SHAR_EOF' > 'ImageMagick/Make.com' &&
  1875. $!
  1876. $! Make ImageMagick X image utilities for VMS.
  1877. $!
  1878. $
  1879. $define/nolog X11 decw$include:
  1880. $define/nolog sys sys$library:
  1881. $link_options="/nodebug/notraceback"
  1882. $define/nolog lnk$library sys$library:vaxcrtl
  1883. $
  1884. $if ((p1.nes."").and.(p1.nes."Display")) then goto SkipDisplay
  1885. $write sys$output "Making Display..."
  1886. $call Make display
  1887. $call Make X
  1888. $call Make image
  1889. $call Make kolb
  1890. $call Make quantize
  1891. $call Make colors
  1892. $call Make rotate
  1893. $call Make compress
  1894. $call Make PreR4Icccm
  1895. $
  1896. $link'link_options' display,X,image,rotate,kolb,quantize,colors,compress,PreR4Icccm,sys$input:/opt
  1897. sys$share:decw$xlibshr.exe/share
  1898. $
  1899. $animate:==$'f$environment("default")'animate
  1900. $write sys$output "..symbol ANIMATE defined."
  1901. $
  1902. $SkipDisplay:
  1903. $if ((p1.nes."").and.(p1.nes."Display")) then goto SkipAnimate
  1904. $write sys$output "Making Animate..."
  1905. $call Make animate
  1906. $call Make X
  1907. $call Make image
  1908. $call Make kolb
  1909. $call Make quantize
  1910. $call Make colors
  1911. $call Make rotate
  1912. $call Make compress
  1913. $call Make PreR4Icccm
  1914. $
  1915. $link'link_options' animate,X,image,rotate,kolb,quantize,colors,compress,PreR4Icccm,sys$input:/opt
  1916. sys$share:decw$xlibshr.exe/share
  1917. $
  1918. $display:==$'f$environment("default")'display
  1919. $write sys$output "..symbol DISPLAY defined."
  1920. $
  1921. $SkipAnimate:
  1922. $if ((p1.nes."").and.(p1.nes."Import")) then goto SkipImport
  1923. $write sys$output "Making Import..."
  1924. $call Make import
  1925. $call Make X
  1926. $call Make image
  1927. $call Make kolb
  1928. $call Make quantize
  1929. $call Make rotate
  1930. $call Make compress
  1931. $call Make PreR4Icccm
  1932. $
  1933. $link'link_options' import,X,image,kolb,quantize,rotate,compress,PreR4Icccm,sys$input:/opt
  1934. sys$share:decw$xlibshr.exe/share
  1935. $
  1936. $import:==$'f$environment("default")'import
  1937. $write sys$output "..symbol IMPORT defined."
  1938. $SkipImport:
  1939. $
  1940. $if ((p1.nes."").and.(p1.nes."XtoPS")) then goto SkipXtoPS
  1941. $write sys$output "Making XtoPS..."
  1942. $call Make XtoPS
  1943. $call Make X
  1944. $call Make image
  1945. $call Make kolb
  1946. $call Make quantize
  1947. $call Make rotate
  1948. $call Make compress
  1949. $call Make PreR4Icccm
  1950. $
  1951. $link'link_options' XtoPS,X,image,kolb,quantize,rotate,compress,PreR4Icccm,sys$input:/opt
  1952. sys$share:decw$xlibshr.exe/share
  1953. $
  1954. $XtoPS:== $'f$environment("default")'XtoPS
  1955. $write sys$output "..symbol XTOPS defined."
  1956. $
  1957. $SkipXtoPS:
  1958. $type sys$input
  1959. X
  1960. Use this command to specify which X server to contact:
  1961. X
  1962. X  $set display/create/node=node_name::
  1963. X
  1964. This can be done automatically from your LOGIN.COM with the following 
  1965. command:
  1966. X
  1967. X  $if (f$trnlmn("sys$rem_node").nes."") then -
  1968. X  $  set display/create/node='f$trnlmn("sys$rem_node")'
  1969. $exit
  1970. $
  1971. $Make: subroutine
  1972. $!
  1973. $! A very primitive "make" (or MMS) hack for DCL.
  1974. $!
  1975. $if (p1.eqs."") then exit
  1976. $source_file=f$search(f$parse(p1,".c"))
  1977. $if (source_file.nes."")
  1978. $  then
  1979. $    object_file=f$parse(source_file,,,"name")+".obj"
  1980. $    object_file=f$search( object_file )
  1981. $    if (object_file.nes."") 
  1982. $      then
  1983. $        object_time=f$file_attribute(object_file,"cdt")
  1984. $        source_time=f$file_attribute(source_file,"cdt")
  1985. $        if (f$cvtime(object_time).lts.f$cvtime(source_time)) then -
  1986. $          object_file=""
  1987. $      endif
  1988. $    if (object_file.eqs."") 
  1989. $      then
  1990. $        write sys$output "Compiling ",p1
  1991. $        cc/nodebug/optimize 'source_file'
  1992. $      endif
  1993. $  endif
  1994. $exit
  1995. $endsubroutine
  1996. X
  1997. SHAR_EOF
  1998. chmod 0755 ImageMagick/Make.com ||
  1999. echo 'restore of ImageMagick/Make.com failed'
  2000. Wc_c="`wc -c < 'ImageMagick/Make.com'`"
  2001. test 3167 -eq "$Wc_c" ||
  2002.     echo 'ImageMagick/Make.com: original size 3167, current size' "$Wc_c"
  2003. rm -f _shar_wnt_.tmp
  2004. fi
  2005. # ============= ImageMagick/display.h ==============
  2006. if test -f 'ImageMagick/display.h' -a X"$1" != X"-c"; then
  2007.     echo 'x - skipping ImageMagick/display.h (File already exists)'
  2008.     rm -f _shar_wnt_.tmp
  2009. else
  2010. > _shar_wnt_.tmp
  2011. echo 'x - extracting ImageMagick/display.h (Text)'
  2012. sed 's/^X//' << 'SHAR_EOF' > 'ImageMagick/display.h' &&
  2013. X
  2014. /*
  2015. X  Include declarations
  2016. */
  2017. #include <stdio.h>
  2018. #include <ctype.h>
  2019. #include <math.h>
  2020. #ifdef __STDC__
  2021. #include <stdlib.h>
  2022. #else
  2023. #ifndef vms
  2024. #include <malloc.h>
  2025. #include <memory.h>
  2026. X
  2027. extern long
  2028. X  strtol(),
  2029. X  time();
  2030. #endif
  2031. #endif
  2032. X
  2033. /*
  2034. X  Define declarations for the Display program.
  2035. */
  2036. #define False  0
  2037. #define Intensity(color)  \
  2038. X  (((color).red*77+(color).green*150+(color).blue*29) >> 8)
  2039. #define Max(x,y)  (((x) > (y)) ? (x) : (y))
  2040. #define MaxColormapSize  65535
  2041. #define MaxImageSize  (4096*4096)
  2042. #define MaxRgb  255
  2043. #define MaxRunlength  255
  2044. #define Min(x,y)  (((x) < (y)) ? (x) : (y))
  2045. #define MinInfoSize (1 << 18)
  2046. #define True  1
  2047. #define Warning(message,qualifier)  \
  2048. {  \
  2049. X  (void) fprintf(stderr,"%s: %s",application_name,message);  \
  2050. X  if (qualifier != (char *) NULL)  \
  2051. X    (void) fprintf(stderr," (%s)",qualifier);  \
  2052. X  (void) fprintf(stderr,".\n");  \
  2053. }
  2054. X
  2055. /*
  2056. X  Image Id's
  2057. */
  2058. #define UnknownId  0
  2059. #define ImageMagickId  1
  2060. /*
  2061. X  Image classes:
  2062. */
  2063. #define UnknownClass  0
  2064. #define DirectClass  1
  2065. #define PseudoClass  2
  2066. /*
  2067. X  Image compression algorithms:
  2068. */
  2069. #define UnknownCompression  0
  2070. #define NoCompression  1
  2071. #define RunlengthEncodedCompression  2
  2072. #define QEncodedCompression  3
  2073. X
  2074. /*
  2075. X  Typedef declarations for the Display program.
  2076. */
  2077. typedef struct _ColorPacket
  2078. {
  2079. X  unsigned char
  2080. X    red,
  2081. X    green,
  2082. X    blue;
  2083. X
  2084. X  unsigned short
  2085. X    index;
  2086. } ColorPacket;
  2087. X
  2088. typedef struct _RunlengthPacket
  2089. {
  2090. X  unsigned char
  2091. X    red,
  2092. X    green,
  2093. X    blue,
  2094. X    length;
  2095. X
  2096. X  unsigned short
  2097. X    index;
  2098. } RunlengthPacket;
  2099. X
  2100. typedef struct _Image
  2101. {
  2102. X  FILE
  2103. X    *file;
  2104. X
  2105. X  char
  2106. X    filename[256];
  2107. X
  2108. X  char
  2109. X    *comments;
  2110. X
  2111. X  unsigned int
  2112. X    id,
  2113. X    class,
  2114. X    compression,
  2115. X    columns,
  2116. X    rows;
  2117. X
  2118. X  unsigned int
  2119. X    colors;
  2120. X
  2121. X  ColorPacket
  2122. X    *colormap;
  2123. X
  2124. X  unsigned int
  2125. X    packets,
  2126. X    runlength;
  2127. X
  2128. X  RunlengthPacket
  2129. X    *pixels;
  2130. X
  2131. X  unsigned int
  2132. X    scene;
  2133. } Image;
  2134. X
  2135. /*
  2136. X  Variable declarations.
  2137. */
  2138. char
  2139. X  *application_name;
  2140. X
  2141. #ifndef lint
  2142. static char 
  2143. X  Version[]="@(#)ImageMagick 91/01/01 cristy@dupont.com";
  2144. #endif
  2145. SHAR_EOF
  2146. chmod 0755 ImageMagick/display.h ||
  2147. echo 'restore of ImageMagick/display.h failed'
  2148. Wc_c="`wc -c < 'ImageMagick/display.h'`"
  2149. test 1993 -eq "$Wc_c" ||
  2150.     echo 'ImageMagick/display.h: original size 1993, current size' "$Wc_c"
  2151. rm -f _shar_wnt_.tmp
  2152. fi
  2153. # ============= ImageMagick/display.man ==============
  2154. if test -f 'ImageMagick/display.man' -a X"$1" != X"-c"; then
  2155.     echo 'x - skipping ImageMagick/display.man (File already exists)'
  2156.     rm -f _shar_wnt_.tmp
  2157. else
  2158. > _shar_wnt_.tmp
  2159. echo 'x - extracting ImageMagick/display.man (Text)'
  2160. sed 's/^X//' << 'SHAR_EOF' > 'ImageMagick/display.man' &&
  2161. .ad l
  2162. .nh
  2163. .TH DISPLAY 1 "1 January 1991" "X Version 11"
  2164. .SH NAME
  2165. display - display an image on any workstation running X
  2166. .SH SYNOPSIS
  2167. .B "display" [ \fIoptions\fP ...] \fIfile\fP
  2168. [ [ \fIoptions\fP ...] \fIfile\fP ...]
  2169. .SH DESCRIPTION
  2170. \fIDisplay\fP is a machine architecture independent image processing
  2171. and display program.  It can display any image in the MIFF format on
  2172. any workstation display running an X server.  \fIDisplay\fP first
  2173. determines the hardware capabilities of the workstation.  If the number
  2174. of unique colors in the image is less than or equal to the number the
  2175. workstation can support, the image is displayed in an X window.
  2176. Otherwise the number of colors in the image is first reduced to match
  2177. the color resolution of the workstation before it is displayed.
  2178. .PP
  2179. This means that a continuous-tone 24 bits/pixel image can display on a
  2180. 8 bit pseudo-color device or monochrome device.  In most instances the
  2181. reduced color image closely resembles the original.  Alternatively, a
  2182. monochrome or pseudo-color image can display on a continuous-tone 24
  2183. bits/pixels device.
  2184. .SH EXAMPLES
  2185. To scale an image of a cockatoo to exactly 640 pixels in width and 480
  2186. pixels in height and position the window at location (200,200), use:
  2187. .PP
  2188. X     display -geometry 640x480\+200\+200 cockatoo.miff
  2189. .PP
  2190. To display an image of a cockatoo without a border centered on a
  2191. backdrop, use:
  2192. .PP
  2193. X     display -backdrop -borderwidth 0 cockatoo.miff
  2194. .PP
  2195. To tile an image of a cockatoo onto the root window, use:
  2196. .PP
  2197. X     display -root cockatoo.miff
  2198. .SH OPTIONS
  2199. .TP 5
  2200. .B "-backdrop"
  2201. display the image centered on a backdrop.
  2202. X
  2203. This backdrop covers the entire workstation screen and is useful for
  2204. hiding other X window activity while viewing the image.   The color of
  2205. the backdrop is specified as the background color.  Refer to \fBX
  2206. RESOURCES\fP for details.
  2207. .TP 5
  2208. .B "-clip \fI<width>x<height>{\+-}<x offset>{\+-}<y offset>\fP"
  2209. preferred size and location of the clipped image.  See \fBX(1)\fP for details 
  2210. about the geometry specification.
  2211. X
  2212. Use clipping to apply image processing options, or display, only a
  2213. particular area of an image.  
  2214. .TP 5
  2215. .B "-colors \fIvalue\fP"
  2216. preferred number of colors in the image.  
  2217. X
  2218. The actual number of colors in the image may be less than your request,
  2219. but never more.  Note, this is a color reduction option.  Images with
  2220. less unique colors than specified with this option will remain unchanged.
  2221. Refer to \fBCOLOR REDUCTION ALGORITHM\fP for more details.
  2222. SHAR_EOF
  2223. true || echo 'restore of ImageMagick/display.man failed'
  2224. fi
  2225. echo 'End of ImageMagick part 1'
  2226. echo 'File ImageMagick/display.man is continued in part 2'
  2227. echo 2 > _shar_seq_.tmp
  2228. exit 0
  2229. --
  2230. Dan Heller
  2231. O'Reilly && Associates       Z-Code Software    Comp-sources-x:
  2232. Senior Writer                President          comp-sources-x@uunet.uu.net
  2233. argv@ora.com                 argv@zipcode.com
  2234.