home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / x / volume20 / imagemgc / part26 < prev    next >
Encoding:
Text File  |  1993-07-13  |  50.3 KB  |  1,379 lines

  1. Newsgroups: comp.sources.x
  2. From: cristy@eplrx7.es.duPont.com (Cristy)
  3. Subject: v20i082:  imagemagic - X11 image processing and display, Part26/38
  4. Message-ID: <1993Jul14.232021.22484@sparky.sterling.com>
  5. X-Md4-Signature: f0aba1f876e750cb7ce60922247dac9b
  6. Sender: chris@sparky.sterling.com (Chris Olson)
  7. Organization: Sterling Software
  8. Date: Wed, 14 Jul 1993 23:20:21 GMT
  9. Approved: chris@sterling.com
  10.  
  11. Submitted-by: cristy@eplrx7.es.duPont.com (Cristy)
  12. Posting-number: Volume 20, Issue 82
  13. Archive-name: imagemagic/part26
  14. Environment: X11
  15. Supersedes: imagemagic: Volume 13, Issue 17-37
  16.  
  17. #!/bin/sh
  18. # this is magick.26 (part 26 of ImageMagick)
  19. # do not concatenate these parts, unpack them in order with /bin/sh
  20. # file ImageMagick/display.man continued
  21. #
  22. if test ! -r _shar_seq_.tmp; then
  23.     echo 'Please unpack part 1 first!'
  24.     exit 1
  25. fi
  26. (read Scheck
  27.  if test "$Scheck" != 26; then
  28.     echo Please unpack part "$Scheck" next!
  29.     exit 1
  30.  else
  31.     exit 0
  32.  fi
  33. ) < _shar_seq_.tmp || exit 1
  34. if test ! -f _shar_wnt_.tmp; then
  35.     echo 'x - still skipping ImageMagick/display.man'
  36. else
  37. echo 'x - continuing file ImageMagick/display.man'
  38. sed 's/^X//' << 'SHAR_EOF' >> 'ImageMagick/display.man' &&
  39. to take effect.
  40. .TP 5
  41. .B "-compress \fItype\fP"
  42. the type of image compression: \fIQEncoded\fP or \fIRunlengthEncoded\fP.
  43. X
  44. Use this option with \fB-write\fP to specify the the type of image
  45. compression.  See \fBmiff(5)\fP for details.
  46. X
  47. Specify \fB\+compress\fP to store the binary image in an uncompressed format.
  48. The default is the compression type of the specified image file.
  49. .TP 5
  50. .B "-delay \fIseconds\fP"
  51. display the next image after pausing.
  52. X
  53. This option is useful when viewing several images in sequence.  Each
  54. image will display and wait the number of seconds specified before the
  55. next image is displayed.  The default is to display the image
  56. and wait until you choose to display the next image or terminate the
  57. program.
  58. .TP 5
  59. .B "-density \fI<width>x<height>
  60. vertical and horizonal density of the image.
  61. X
  62. This option specifies an image density whose interpretation changes
  63. with the type of image.  The default is 72 dots per inch in the
  64. horizonal and vertical direction for Postscript.  Text files default to
  65. 80 characters in width and 60 lines in height.  Use this option to
  66. alter the default density.
  67. .TP 5
  68. .B "-display \fIhost:display[.screen]\fP"
  69. specifies the X server to contact; see \fBX(1)\fP.
  70. .TP 5
  71. .B "-dither"
  72. apply Floyd/Steinberg error diffusion to the image.
  73. X
  74. The basic strategy of dithering is to trade intensity resolution for
  75. spatial resolution by averaging the intensities of several neighboring
  76. pixels.  Images which suffer from severe contouring when reducing colors
  77. can be improved with this option.
  78. X
  79. The \fB-colors\fP or \fB-monochrome\fP option is required
  80. for this option to take effect.
  81. .TP 5
  82. .B "-enhance"
  83. apply a digital filter to enhance a noisy image.
  84. .TP 5
  85. .B "-gamma \fIvalue\fP"
  86. level of gamma correction.
  87. X
  88. The same color image displayed on two different workstations may look
  89. different due to differences in the display monitor.  Use gamma
  90. correction to adjust for this color difference.  Reasonable values
  91. extend from 0.8 to 2.3.
  92. .TP 5
  93. .B "-geometry \fI<width>x<height>{\+-}<x offset>{\+-}<y offset>\fP"
  94. preferred size and location of the image window.  See \fBX(1)\fP for details
  95. about the geometry specification.  By default, the window size is the image
  96. size and the location is choosen by you when it is mapped.
  97. X
  98. If the specified image size is smaller than the actual image size, the
  99. image is first reduced to an integral of the specified image size with
  100. an antialias digital filter.  The image is then scaled to the exact
  101. specified image size with pixel replication.  If the specified image
  102. size is greater than the actual image size, the image is first enlarged
  103. to an integral of the specified image size with bilinear
  104. interpolation.  The image is then scaled to the exact specified image
  105. size with pixel replication.
  106. X
  107. When displaying an image on an X server, \fI<x offset>\fP and
  108. \fI<y offset>\fP is relative to the root window.
  109. X
  110. The equivalent X resource for this option is \fBimageGeometry\fP
  111. (class \fBImageGeometry\fP).  See \fBX RESOURCES\fP for details.
  112. .TP 5
  113. .B "-interlace \fItype\fP"
  114. the type of interlacing scheme: \fBNONE\fP, \fBLINE\fP, or \fBPLANE\fP.
  115. X
  116. This option is used to specify the type of interlacing scheme for raw
  117. image formats such as \fBRGB\fP or \fBYUV\fP.  \fBNONE\fP means do not
  118. interlace (RGBRGBRGBRGBRGBRGB...), \fBLINE\fP uses scanline
  119. interlacing (RRR...GGG...BBB...RRR...GGG...BBB...), and \fBPLANE\fP uses
  120. plane interlacing (RRRRRR...GGGGGG...BBBBBB...).
  121. .TP 5
  122. .B "-inverse"
  123. apply color inversion to image.
  124. X
  125. The red, green, and blue intensities of an image are negated.
  126. .TP 5
  127. .B "-map \fItype\fP"
  128. display image using this Standard Colormap type.
  129. X
  130. Choose from these Standard Colormap types:
  131. X
  132. X    default
  133. X    best
  134. X    red
  135. X    green
  136. X    blue
  137. X    gray
  138. X
  139. The X server must support the Standard Colormap you choose, otherwise an
  140. error occurs.  See \fBxstdcmap(1)\fP for one way of creating Standard
  141. Colormaps.
  142. .TP 5
  143. .B "-monochrome"
  144. transform the image to black and white.
  145. X
  146. Monochrome images can benefit from error diffusion.  Use \fB-dither\fP with
  147. this option to diffuse the error.
  148. .TP 5
  149. .B "-noise"
  150. reduce the noise in an image with a noise peak elimination filter.
  151. X
  152. The principal function of noise peak elimination filter is to smooth
  153. the objects within an image without losing edge information and without
  154. creating undesired structures.  The central idea of the algorithm is to
  155. replace a pixel with its next neighbor in value within a 3 x 3 window,
  156. if this pixel has been found to be noise.  A pixel is defined as noise
  157. if and only if this pixel is a maximum or minimum within the 3 x 3 window.
  158. .TP 5
  159. .B "-normalize"
  160. tranform image to span the full range of color values.
  161. X
  162. This is a contrast enhancement technique.
  163. .TP 5
  164. .B "-page \fI<width>x<height>{\+-}<x offset>{\+-}<y offset>\fP"
  165. size and location of the Postscript page.
  166. X
  167. Use this option to specify the dimensions of the Postscript page in picas.  The
  168. default is to center the image on a letter page, 612 by 792 dots per inch.
  169. Other common sizes are:
  170. X
  171. X    540x720   Note
  172. X    612x1008  Legal
  173. X    842x1190  A3
  174. X    595x842   A4
  175. X    421x595   A5
  176. X    297x421   A6
  177. X    709x1002  B4
  178. X    612x936   U.S. Foolscap
  179. X    612x936   European Foolscap
  180. X    396x612   Half Letter
  181. X    792x1224  11x17
  182. X    1224x792  Ledger
  183. X
  184. The page geometry is relative to the vertical and horizonal density of the
  185. Postscript page.  See \fB-density\fP for details.
  186. .TP 5
  187. .B "-quality \fIvalue\fP"
  188. JPEG quality setting.
  189. X
  190. Quality is 0 (worst) to 100 (best). The default is 75.
  191. .TP 5
  192. .B "-reflect"
  193. create a "mirror image" by reflecting the image scanlines.
  194. .TP 5
  195. .B "-rotate \fIdegrees\fP"
  196. apply Paeth image rotation to the image.
  197. X
  198. Empty triangles left over from rotating the image are filled with
  199. the color defined by the pixel at location (0,0).
  200. .TP 5
  201. .B "-scale \fI<width factor>x<height factor>\fP"
  202. preferred size factors of the image.
  203. X
  204. This option behaves like \fB-geometry\fP except the width and height values
  205. are relative instead of absolute.  The image size is multiplied by the
  206. width and height factors to obtain the final image dimensions.  If only
  207. one factor is specified, both the width and height factors assume the
  208. value.
  209. X
  210. Factors may be fractional.  To increase the size of an image, use a
  211. scale factor greater than 1.0.  To decrease an image's size, use a
  212. scale factor less than 1.0.  Default is 1.0.
  213. X
  214. The equivalent X resource for this option is \fBscaleGeometry\fP
  215. (class \fBScaleGeometry\fP).  See \fBX RESOURCES\fP for details.
  216. .TP 5
  217. .B "-scene \fIvalue\fP"
  218. image scene number.
  219. .TP 5
  220. .B "-treedepth \fIvalue\fP"
  221. Normally, this integer value is zero or one.  A zero or one tells
  222. \fBdisplay\fP to choose a optimal tree depth for the color reduction
  223. algorithm.
  224. X
  225. An optimal depth generally allows the best representation of the source
  226. image with the fastest computational speed and the least amount of
  227. memory.  However, the default depth is inappropriate for some images.
  228. To assure the best representation, try values between 2 and 8 for this
  229. parameter.  Refer to \fBquantize(9)\fP for more details.
  230. X
  231. The \fB-colors\fP or \fB-monochrome\fP option is required
  232. for this option to take effect.
  233. .TP 5
  234. .B "-update \fIseconds\fP"
  235. detect when image file is modified and redisplay.
  236. X
  237. Suppose that while you are displaying an image the file that is
  238. currently displayed is over-written.  \fBdisplay\fP will automatically
  239. detect that the input file has been changed and update the displayed
  240. image accordingly.
  241. .TP 5
  242. .B -verbose
  243. print detailed information about the image.
  244. X
  245. This information is printed: image scene number;  image name;  image
  246. size; the image class (\fIDirectClass\fP or \fIPseudoClass\fP);  the total
  247. number of unique colors;  and the number of seconds to read and
  248. transform the image.  Refer to \fBmiff(5)\fP for a description of
  249. the image class.
  250. X
  251. If \fB-colors\fP is also specified, the total unique colors in the image
  252. and color reduction error values are printed.  Refer to \fBquantize(9)\fP
  253. for a description of these values.
  254. .TP 5
  255. .B "-visual \fItype\fP"
  256. display image using this visual type.
  257. X
  258. Choose from these visual classes:
  259. X
  260. X    StaticGray
  261. X    GrayScale
  262. X    StaticColor
  263. X    PseudoColor
  264. X    TrueColor
  265. X    DirectColor
  266. X    default
  267. X    \fIvisual id\fP
  268. X
  269. The X server must support the visual you choose, otherwise an error occurs.
  270. If a visual is not specified, the visual class that can display the most
  271. simultaneous colors on the default X server screen is choosen.
  272. .TP 5
  273. .B "-window \fIid\fP"
  274. set the background pixmap of this window to the image.
  275. X
  276. \fIid\fP can be a window id or name.  Specify \fBroot\fP to select X's root
  277. window as the target window.
  278. X
  279. By default the image is tiled onto the background of the target
  280. window.   If \fB-backdrop\fP or \fB-geometry\fP are specified, the
  281. image is surrounded by the background color.  Refer to \fBX
  282. RESOURCES\fP for details.
  283. X
  284. The image will not display on the root window if the image has more
  285. unique colors than the target window colormap allows.  Use
  286. \fB-colors\fP to reduce the number of colors.
  287. .TP 5
  288. .B "-write \fIfilename\fP"
  289. write image to a file.
  290. X
  291. If \fIfile\fP already exists, you will be prompted as to whether
  292. it should be overwritten.
  293. X
  294. If the image format is MIFF and the number of unique colors in the image
  295. exceeds 4096, it is stored as \fIDirectClass\fP; otherwise, it is
  296. stored as \fIPseudoClass\fP format.  Refer to \fBmiff(5)\fP for more
  297. details.
  298. X
  299. By default, the image is written in the format that it was read in as.
  300. To specify a particular image format, prefix \fIfile\fP with the image
  301. type and a colon (i.e. ps:image) or specify the image type as the
  302. filename suffix (i.e. image.ps).  See \fBconvert(1)\fP for a list of
  303. valid image formats.  If \fIfile\fP has the extension \fB.Z\fP or
  304. \fB.gz\fP, the file size is compressed using with \fBcompress\fP
  305. or \fBgzip\fP respectively.  If \fIfile\fP already exists, you will be
  306. prompted as to whether it should be overwritten.
  307. X
  308. Use \fB-compress\fP to specify the type of image compression.
  309. X
  310. The equivalent X resource for this option is \fBwriteFilename\fP
  311. (class \fBWriteFilename\fP).  See \fBX RESOURCES\fP for details.
  312. .PP
  313. In addition to those listed above, you can specify these standard X
  314. resources as command line options:  \fB-background\fP,
  315. \fB-bordercolor\fP, \fB-borderwidth\fP,  \fB-font\fP,
  316. \fB-foreground\fP, \fB-iconGeometry\fP, \fB-iconic\fP, \fB-name\fP, or
  317. \fB-title\fP.  See \fBX RESOURCES\fP for details.
  318. .PP
  319. Any option you specify on the command line remains in effect until it is
  320. explicitly changed by specifying the option again with a different effect.
  321. For example to display two images, the first with 32 colors, and the
  322. second with only 16 colors, use:
  323. .PP
  324. X     display -colors 32 cockatoo.miff -colors 16 macaw.miff
  325. .PP
  326. Change \fI-\fP to \fI\+\fP in any option above to reverse its effect.
  327. For example, specify \fB\+compress\fP to store the binary image in an
  328. uncompressed format.
  329. .PP
  330. By default, the image format is determined by its magic number. To
  331. specify a particular image format, precede the filename with an image
  332. format name and a colon (i.e. ps:image) or specify the image type as
  333. the filename suffix (i.e. image.ps).  See \fBconvert(1)\fP for a list
  334. of valid image formats.
  335. .PP
  336. When you specify \fBX\fP as your image type, the filename has special
  337. meaning.  It specifies an X window by id, name, or \fBroot\fP.  If no
  338. filename is specified, the window is selected by clicking the mouse in
  339. the desired window.
  340. .PP
  341. Specify \fIfile\fP as \fI-\fP for standard input.  If \fIfile\fP has
  342. the extension \fB.Z\fP or \fB.gz\fP, the file is uncompressed with
  343. \fBuncompress\fP or \fBgunzip\fP respectively.
  344. .SH BUTTONS
  345. The effects of each button press is described below.  Three buttons are
  346. required.  If you have a two button mouse, button 1 and 3 are returned.
  347. Press ALT and button 3 to simulate button 2.
  348. .TP 5
  349. .B "1"
  350. Press and drag to select a command from a pop-up menu.  Choose from
  351. these commands:
  352. X
  353. X    Image Info
  354. X    Reflect
  355. X    Rotate Right
  356. X    Rotate Left
  357. X    Half Size
  358. X    Double Size
  359. X    Restore
  360. X    Annotate
  361. X    Composite
  362. X    Load
  363. X    Write
  364. X    Next
  365. X    Previous
  366. X    Quit
  367. .TP 5
  368. .B "2"
  369. Press and drag to define a region of the image to clip.  Release the button
  370. to crop the image, or return the pointer to the location of the initial button
  371. press to cancel the cropping operation.
  372. .TP 5
  373. .B "3"
  374. Press and drag to define a region of the image to magnify.
  375. X
  376. Note, this button behaves differently for a composite MIFF image
  377. created with \fBmontage\fP.  Choose a particular tile of the composite
  378. and press this button, the image represented by the tile is then
  379. displayed.  To return to the composite MIFF image, choose \fINext\fP
  380. from the command menu (refer to Button 1).  See \fBmontage(1)\fP and
  381. \fBmiff(5)\fP for more details.
  382. X
  383. .SH KEYBOARD ACCELERATORS
  384. .TP 5
  385. .B "i"
  386. Press to display information about the image.  Press any key or button to
  387. erase the information.
  388. X
  389. This information is printed: image scene number; image name; image
  390. size; the visual class (see \fB-visual\fP); and the total number of
  391. unique colors in the image.
  392. .TP 5
  393. .B "r"
  394. Press to reflect the image scanlines.
  395. .TP 5
  396. .B "/"
  397. Press to rotate the image 90 degrees clockwise.
  398. .TP 5
  399. .B "\e"
  400. Press to rotate the image 90 degrees counter-clockwise.
  401. .TP 5
  402. .B "<"
  403. Press to half the image size.
  404. .TP 5
  405. .B ">"
  406. Press to double the image size.
  407. .TP 5
  408. .B "o"
  409. Press to restore the image to its original size.
  410. .TP 5
  411. .B "a"
  412. Press to annotate the image with text.
  413. X
  414. Refer to \fBIMAGE ANNOTATION\fP for more details.
  415. .TP 5
  416. .B "c"
  417. Press to composite the image with another.
  418. X
  419. Refer to \fBIMAGE COMPOSITING\fP for more details.
  420. .TP 5
  421. .B "l"
  422. Press to load an image from a file.
  423. .TP 5
  424. .B "w"
  425. Press to write the image to a file.
  426. .TP 5
  427. .B "n"
  428. Press to display the next image.
  429. .TP 5
  430. .B "p"
  431. Press to display the previous image.
  432. .TP 5
  433. .B "q"
  434. Press to discard all images and exit program.
  435. .TP 5
  436. .B "1-9"
  437. Press to change the level of magnification.
  438. X
  439. Use the arrow keys to move the image one pixel up, down, left, or right within
  440. the magnify window.  Be sure to first map the magnify window by pressing
  441. button 3.
  442. X
  443. Press \fB<ctrl>\fP and one of the arrow keys to trim off one pixel from
  444. any side of the image.  You can closely define the area of the image
  445. you want to crop with button 2.  Use the trimming keys for a more 
  446. precise measurement.
  447. .SH "X RESOURCES"
  448. \fBdisplay\fP options can appear on the command line or in your X
  449. resource file.  Options on the command line supersede values specified
  450. in your X resource file.  See \fBX(1)\fP for more information on X
  451. resources.
  452. X
  453. All \fBdisplay\fP options have a corresponding X resource.  In addition,
  454. \fBdisplay\fP uses the following X resources:
  455. .TP 5
  456. .B background (\fPclass\fB Background)
  457. Specifies the preferred color to use for the image window background.  The
  458. default is black.
  459. .TP 5
  460. .B borderColor (\fPclass\fB BorderColor)
  461. Specifies the preferred color to use for the image window border.  The
  462. default is white.
  463. .TP 5
  464. .B borderWidth (\fPclass\fB BorderWidth)
  465. Specifies the width in pixels of the image window border.  The default is 2.
  466. .TP 5
  467. .B font (\fPclass\fB Font)
  468. Specifies the name of the preferred font to use when displaying text
  469. within the image window.  The default is \fI9x15\fP, \fIfixed\fP, or
  470. \fI6x13\fP determined by the image window size.
  471. .TP 5
  472. .B font[1-9] (\fPclass\fB Font[1-9])
  473. Specifies the name of the preferred font to use when annotating the
  474. image window with text.  The default fonts are \fIfixed\fP,
  475. \fIvariable\fP, \fI5x8\fP, \fI6x10\fP, \fI7x13bold\fP, \fI8x13bold\fP,
  476. \fI9x15bold\fP, \fI10x20\fP, and \fI12x24\fP.  Refer to \fBIMAGE
  477. ANNOTATION\fP for more details.
  478. .TP 5
  479. .B foreground (\fPclass\fB Foreground)
  480. Specifies the preferred color to use for text within the image window.  The
  481. default is white.
  482. .TP 5
  483. .B iconGeometry (\fPclass\fB IconGeometry)
  484. Specifies the preferred size and position of the application when
  485. iconified.  It is not necessarily obeyed by all window managers.
  486. .TP 5
  487. .B iconic (\fPclass\fB Iconic)
  488. This resource indicates that you would prefer that the application's
  489. windows initially not be visible as if the windows had be immediately
  490. iconified by you.  Window managers may choose not to honor the
  491. application's request.
  492. .TP 5
  493. .B magnify (\fPclass\fB Magnify)
  494. specifies an integral factor by which the image should be enlarged.  The
  495. default is 2.
  496. X
  497. This value only affects the magnification window which is invoked with
  498. button number 3 after the image is displayed.  Refer to \fBBUTTONS\fP
  499. for more details.
  500. .TP 5
  501. .B name (\fPclass\fB Name)
  502. This resource specifies the name under which resources for the
  503. application should be found.  This resource is useful in shell aliases to
  504. distinguish between invocations of an application, without resorting to
  505. creating links to alter the executable file name.  The default is the
  506. application name.
  507. .TP 5
  508. .B pen[1-9] (\fPclass\fB Pen[1-9])
  509. Specifies the color of the preferred font to use when annotating the
  510. image window with text.  The default colors are \fIblack\fP,
  511. \fIblue\fP, \fIgreen\fP, \fIcyan\fP, \fIgray\fP, \fIred\fP,
  512. \fImagenta\fP, \fIyellow\fP, and \fIwhite\fP.  Refer to \fBIMAGE
  513. ANNOTATION\fP for more details.
  514. .TP 5
  515. .B title (\fPclass\fB Title)
  516. This resource specifies the title to be used for the image window.  This
  517. information is sometimes used by a window manager to provide a
  518. header identifying the window.  The default is the image file name.
  519. .TP 5
  520. .B usePixmap (\fPclass\fB UsePixmap)
  521. Images are maintained as a XImage by default.  Set this resource to True
  522. to utilize a server Pixmap instead.  This option is useful if your image
  523. exceeds the dimensions of your server screen and you intend to pan the
  524. image.  The panning is much faster with Pixmaps than with a XImage.
  525. Pixmaps are considered a precious resource, use them with discretion.
  526. .SH IMAGE PANNING
  527. When an image exceeds the width or height of the X server screen,
  528. \fBdisplay\fP maps a small panning window.  The rectangle within the
  529. panning window shows the area that is currently displayed in the
  530. the image window.  To "pan" about the image, press and drag the mouse
  531. within the panning window.  The panning rectangle moves with the mouse
  532. and the image window is updated to reflect the location of the
  533. rectangle within the panning window.  When you have selected the area
  534. of the image you wish to view, just release the mouse button.
  535. X
  536. Use the arrow keys to pan the image one pixel up, down, left, or right within
  537. the image window.
  538. X
  539. The panning window goes away if the image becomes smaller than the
  540. dimensions of the X server screen.
  541. .SH IMAGE ANNOTATION
  542. An image is annotated with text interactively.  There is no command
  543. line argument to annotate an image.  To begin, press button 1 and
  544. choose \fIAnnotate Image\fP from the command menu (see \fBBUTTONS\fP).
  545. Alternatively, press \fIa\fP in the image window (see \fBKEYBOARD
  546. ACCELERATORS\fP).  To exit immediately, press \fIESC\fP.
  547. .PP
  548. A small window appears showing the location of the cursor in the image
  549. window.  You are now in \fIannotate mode\fP.  To exit immediately,
  550. press \fIESC\fP. In \fIannotate mode\fP a button press has a different
  551. effect than described in \fBBUTTONS\fP.  Press a button to affect this
  552. behavior:
  553. .TP 5
  554. .B "1"
  555. Press to select a location within the image window to begin entering text.
  556. .TP 5
  557. .B "2"
  558. Press and drag to select a font from a pop-up menu.  Choose from
  559. these fonts:
  560. X
  561. X    fixed
  562. X    variable
  563. X    5x8
  564. X    6x10
  565. X    7x13bold
  566. X    8x13bold
  567. X    9x15bold
  568. X    10x20
  569. X    12x24
  570. X
  571. Other fonts can be specified by setting the X resources \fBfont1\fP through
  572. \fBfont9\fP.  Refer to \fBX RESOURCES\fP for more details.
  573. .TP 5
  574. .B "3"
  575. Press and drag to select a font color from a pop-up menu.  Choose from
  576. these font colors:
  577. X
  578. X    black
  579. X    blue
  580. X    cyan
  581. X    green
  582. X    gray
  583. X    red
  584. X    magenta
  585. X    yellow
  586. X    white
  587. X
  588. Other font colors can be specified by setting the X resources \fBpen1\fP
  589. through \fBpen9\fP.  Refer to \fBX RESOURCES\fP for more details.
  590. .PP
  591. Choosing a font and its color is optional.  The default font is
  592. \fIfixed\fP and the default color is \fIblack\fP.  However, you must
  593. choose a location to begin entering text and press button 1.  An
  594. underscore character will appear at the location of the cursor where
  595. you pressed button 1.  The cursor changes to a pencil to indicate
  596. you are in \fItext mode\fP.  To exit immediately, press \fIESC\fP.
  597. .PP
  598. In \fItext mode\fP, any key presses will display the character at
  599. the location of the underscore and advance the underscore cursor.
  600. Enter your text and once completed press \fIESC\fP to finish your image
  601. annotation.  To correct errors press \fIBACK SPACE\fP.  To delete an
  602. entire line of text, press \fIDELETE\fP.  Any text that exceeds the
  603. boundaries of the image window is automatically continued onto the next
  604. line.
  605. .PP
  606. Before exiting \fItext mode\fP, immediately after pressing the
  607. \fIESC\fP key, the image is permanently updated with the text you
  608. entered.  There is no way to `undo' your changes so be careful to
  609. check your text before you press \fIESC\fP.
  610. .PP
  611. The actual color you request for the font is saved in the image.
  612. However, the color that appears in your image window may be different.
  613. For example, on a monochrome screen the text will appear black or white even
  614. if you choose the color red as the font color.  However, the image saved to
  615. a file with \fB-write\fP will be written with red lettering.  To assure
  616. the correct color text in the final image, any \fIPseudoClass\fP image
  617. is promoted to \fIDirectClass\fP (see \fBmiff(5)\fP).  To
  618. force a \fIPseudoClass\fP image to remain \fIPseudoClass\fP, use
  619. \fB-colors\fP.
  620. .SH IMAGE COMPOSITING
  621. An image composite is created interactively.  There is no command line
  622. argument to composite an image.  To begin, press button 1 and choose
  623. \fIComposite Image\fP from the command menu (see \fBBUTTONS\fP).
  624. Alternatively, press \fIc\fP in the image window (see \fBKEYBOARD
  625. ACCELERATORS\fP).
  626. .PP
  627. First a popup window is displayed requesting you to enter an image name.  
  628. Press \fIRETURN\fP, enter 'X:', or type a file name.  Press \fIRETURN\fP if
  629. you choose not to create a composite image.  When you specify \fBX:\fP
  630. as your file name, the filename has special meaning.  It specifies an X
  631. window by id, name, or \fBroot\fP.  If no filename is specified, the
  632. window is selected by clicking the mouse in the desired window.  See
  633. \fBimport(1)\fP for details.
  634. .PP
  635. A small window appears showing the location of the cursor in the image
  636. window.  You are now in \fIcomposite mode\fP.  To exit immediately,
  637. press \fIESC\fP.  In \fIcomposite mode\fP a button press has a
  638. different effect than described in \fBBUTTONS\fP.  Press a button to
  639. affect this behavior: 
  640. .TP 5
  641. .B "1"
  642. Press to select a location within \fIimage window\fP to composite your
  643. image.
  644. .TP 5
  645. .B "2"
  646. Press and drag to select a composite operation from a pop-up menu.
  647. Choose from these composite operations:
  648. X
  649. X    over
  650. X    in
  651. X    out
  652. X    atop
  653. X    xor
  654. X    plus
  655. X    minus
  656. X    add
  657. X    subtract
  658. X    difference
  659. X    replace
  660. .PP
  661. The operations behaves as follows:
  662. .TP 9
  663. .B over
  664. The result will be the union of the two image shapes, with \fIimage\fP
  665. obscuring \fIimage window\fP in the region of overlap.
  666. .TP 9
  667. .B in
  668. The result is simply \fIimage\fP cut by the shape of \fIimage
  669. window\fP.  None of the image data of \fIimage window\fP will be in the
  670. result.
  671. .TP 9
  672. .B out
  673. The resulting image is \fIimage\fP with the shape of \fIimage window\fP
  674. cut out.
  675. .TP 9
  676. .B atop
  677. The result is the same shape as image \fIimage window\fP, with
  678. \fIimage\fP obscuring \fIimage window\fP where the image shapes
  679. overlap.  Note this differs from \fBover\fP because the portion of
  680. \fIimage\fP outside \fIimage window\fP's shape does not appear in the
  681. result.
  682. .TP 9
  683. .B xor
  684. The result is the image data from both \fIimage\fP and \fIimage window\fP
  685. that is outside the overlap region.  The overlap region will be blank.
  686. .TP 9
  687. .B plus
  688. The result is just the sum of the image data.  Output values are
  689. clipped to 255 (no overflow).  This operation is independent
  690. of the alpha channels.
  691. .TP 9
  692. .B minus
  693. The result of \fIimage\fP \- \fIimage window\fP, with underflow clipped
  694. to zero.  The alpha channel is ignored (set to 255, full coverage).
  695. .TP 9
  696. .B add
  697. The result of \fIimage\fP + \fIimage window\fP, with overflow wrapping
  698. around (\fImod\fP 256).
  699. .TP 9
  700. .B subtract
  701. The result of \fIimage\fP - \fIimage window\fP, with underflow wrapping
  702. around (\fImod\fP 256).  The \fBadd\fP and \fBsubtract\fP operators can
  703. be used to perform reversible transformations.
  704. .TP 9
  705. .B difference
  706. The result of abs(\fIimage\fP \- \fIimage window\fP).  This is useful
  707. for comparing two very similar images.
  708. .TP 9
  709. .B replace
  710. The resulting image is \fIimage window\fP replaced with \fIimage\fP.
  711. Here the alpha information is ignored.
  712. .PP
  713. The image compositor requires an alpha, or matte channel in the image
  714. for some operations.  This extra channel usually defines a mask which
  715. represents a sort of a cookie-cutter for the image.  This is the case
  716. when alpha is 255 (full coverage) for pixels inside the shape, zero
  717. outside, and between zero and 255 on the boundary.  If \fIimage\fP does
  718. not have an alpha channel, it is initialized with 0 for any pixel
  719. matching in color to pixel location (0,0), otherwise 255.
  720. .PP
  721. Note that alpha information for \fIimage window\fP is not retained for
  722. colormapped X server visuals (e.g. \fIStaticColor\fP,
  723. \fIStaticColor\fP, \fIGrayScale\fP, \fIPseudoColor\fP).  Correct
  724. compositing behavior may require a \fITrueColor\fP or \fIDirectColor\fP
  725. visual or a \fIStandard Colormap\fP.
  726. .PP
  727. Choosing a composite operator is optional.  The default operator is
  728. \fIover\fP.  However, you must choose a location to composite your image
  729. and press button 1.  Press and hold button 1 before releasing and an
  730. outline of the image will appear to help you identify your location.
  731. .PP
  732. Immediately after releasing button 1, \fIimage window\fP is
  733. permanently updated with your composited image.  There is no way to
  734. `undo' your changes.  Be careful when choosing your location.
  735. .PP
  736. The actual colors of the composite image is saved.  However, the color
  737. that appears in \fIimage window\fP may be different.  For example, on a
  738. monochrome screen \fIimage window\fP will appear black or white even
  739. though your composited image may have many colors.  If the image is
  740. saved to a file it is written with the correct colors.  To assure the
  741. correct colors are saved in the final image, any \fIPseudoClass\fP
  742. image is promoted to \fIDirectClass\fP (see \fBmiff(5)\fP).  To force a
  743. \fIPseudoClass\fP image to remain \fIPseudoClass\fP, use \fB-colors\fP.
  744. .SH ENVIRONMENT
  745. .TP 5
  746. .B display
  747. To get the default host, display number, and screen.
  748. .SH SEE ALSO
  749. .B
  750. import(1), mogrify(1), convert(1), quantize(9), miff(5), X(1), xstdcmap(1), more(1), compress(1)
  751. .SH COPYRIGHT
  752. Copyright 1993 E. I. du Pont de Nemours & Company
  753. .PP
  754. Permission to use, copy, modify, distribute, and sell this software and
  755. its documentation for any purpose is hereby granted without fee,
  756. provided that the above copyright notice appear in all copies and that
  757. both that copyright notice and this permission notice appear in
  758. supporting documentation, and that the name of E. I. du Pont de Nemours
  759. & Company not be used in advertising or publicity pertaining to
  760. distribution of the software without specific, written prior
  761. permission.  E. I. du Pont de Nemours & Company makes no representations
  762. about the suitability of this software for any purpose.  It is provided
  763. "as is" without express or implied warranty.
  764. .PP
  765. E. I. du Pont de Nemours & Company disclaims all warranties with regard
  766. to this software, including all implied warranties of merchantability
  767. and fitness, in no event shall E. I. du Pont de Nemours & Company be
  768. liable for any special, indirect or consequential damages or any
  769. damages whatsoever resulting from loss of use, data or profits, whether
  770. in an action of contract, negligence or other tortious action, arising
  771. out of or in connection with the use or performance of this software.
  772. .SH ACKNOWLEDGEMENTS
  773. The MIT X Consortium for making network transparent graphics a reality.
  774. .PP
  775. Rod Bogart and John W. Peterson, University of Utah.  Image
  776. compositing is loosely based on \fIrlecomp\fP of the Utah Raster
  777. Toolkit.
  778. .PP
  779. Michael Halle, Spatial Imaging Group at MIT, for the initial
  780. implementation of Alan Paeth's image rotation algorithm.
  781. .PP
  782. David Pensak, E. I. du Pont de Nemours & Company, for providing a
  783. computing environment that made this program possible.
  784. .PP
  785. Paul Raveling, USC Information Sciences Institute, for the original
  786. idea of using space subdivision for the color reduction algorithm.
  787. .SH AUTHORS
  788. John Cristy, E.I. du Pont de Nemours & Company Incorporated
  789. SHAR_EOF
  790. echo 'File ImageMagick/display.man is complete' &&
  791. chmod 0644 ImageMagick/display.man ||
  792. echo 'restore of ImageMagick/display.man failed'
  793. Wc_c="`wc -c < 'ImageMagick/display.man'`"
  794. test 32428 -eq "$Wc_c" ||
  795.     echo 'ImageMagick/display.man: original size 32428, current size' "$Wc_c"
  796. rm -f _shar_wnt_.tmp
  797. fi
  798. # ============= ImageMagick/import.c ==============
  799. if test -f 'ImageMagick/import.c' -a X"$1" != X"-c"; then
  800.     echo 'x - skipping ImageMagick/import.c (File already exists)'
  801.     rm -f _shar_wnt_.tmp
  802. else
  803. > _shar_wnt_.tmp
  804. echo 'x - extracting ImageMagick/import.c (Text)'
  805. sed 's/^X//' << 'SHAR_EOF' > 'ImageMagick/import.c' &&
  806. /*
  807. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  808. %                                                                             %
  809. %                                                                             %
  810. %                                                                             %
  811. %                 IIIII  M   M  PPPP    OOO   RRRR    TTTTT                   %
  812. %                   I    MM MM  P   P  O   O  R   R     T                     %
  813. %                   I    M M M  PPPP   O   O  RRRR      T                     %
  814. %                   I    M   M  P      O   O  R R       T                     %
  815. %                 IIIII  M   M  P       OOO   R  R      T                     %
  816. %                                                                             %
  817. %                                                                             %
  818. %             Import X11 image to a machine independent format.               %
  819. %                                                                             %
  820. %                                                                             %
  821. %                                                                             %
  822. %                           Software Design                                   %
  823. %                             John Cristy                                     %
  824. %                              July 1992                                      %
  825. %                                                                             %
  826. %                                                                             %
  827. %  Copyright 1993 E. I. du Pont de Nemours & Company                          %
  828. %                                                                             %
  829. %  Permission to use, copy, modify, distribute, and sell this software and    %
  830. %  its documentation for any purpose is hereby granted without fee,           %
  831. %  provided that the above Copyright notice appear in all copies and that     %
  832. %  both that Copyright notice and this permission notice appear in            %
  833. %  supporting documentation, and that the name of E. I. du Pont de Nemours    %
  834. %  & Company not be used in advertising or publicity pertaining to            %
  835. %  distribution of the software without specific, written prior               %
  836. %  permission.  E. I. du Pont de Nemours & Company makes no representations   %
  837. %  about the suitability of this software for any purpose.  It is provided    %
  838. %  "as is" without express or implied warranty.                               %
  839. %                                                                             %
  840. %  E. I. du Pont de Nemours & Company disclaims all warranties with regard    %
  841. %  to this software, including all implied warranties of merchantability      %
  842. %  and fitness, in no event shall E. I. du Pont de Nemours & Company be       %
  843. %  liable for any special, indirect or consequential damages or any           %
  844. %  damages whatsoever resulting from loss of use, data or profits, whether    %
  845. %  in an action of contract, negligence or other tortious action, arising     %
  846. %  out of or in connection with the use or performance of this software.      %
  847. %                                                                             %
  848. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  849. %
  850. %  Import is an X Window System window dumping utility.  Import allows X
  851. %  users to store window images in a specially formatted dump file.  This
  852. %  file can then be read by the Display utility for redisplay, printing,
  853. %  editing, formatting, archiving, image processing, etc.  The target
  854. %  window can be specified by id or name or be selected by clicking the
  855. %  mouse in the desired window.  The keyboard bell is rung once at the
  856. %  beginning of the dump and twice when the dump is completed.
  857. %
  858. %  The import program command syntax is:
  859. %
  860. %  Usage: import [options ...] file
  861. %
  862. %  Where options include:
  863. %    -border             include image borders in the output image
  864. %    -compress type      RunlengthEncoded or QEncoded
  865. %    -delay seconds      pause before selecting target window
  866. %    -descend            obtain image by descending window hierarchy
  867. %    -density geometry   vertical and horizonal density of the image
  868. %    -display server     X server to contact
  869. %    -frame              include window manager frame
  870. %    -geometry geometry  preferred size and location of the image
  871. %    -interlace type     NONE, LINE, or PLANE
  872. %    -monochrome         transform image to black and white
  873. %    -page geometry      size and location of the Postscript page
  874. %    -quality value      JPEG quality setting
  875. %    -rotate degrees     apply Paeth rotation to the image
  876. %    -scene value        image scene number
  877. %    -screen             select image from root window
  878. %    -verbose            print detailed information about the image
  879. %    -window id          select window with this id or name
  880. %
  881. %  Change '-' to '+' in any option above to reverse its effect.
  882. %  For example, +frame means do not window manager frame.
  883. %
  884. %  By default, 'file' is written in the Postscript image format.  To specify
  885. %  a particular image format, precede the filename with an image format
  886. %  name and a colon (i.e. ps:image) or specify the image type as the
  887. %  filename suffix (i.e. image.ps).  Specify 'file' as '-' for standard
  888. %  input or output.
  889. %
  890. %
  891. */
  892. X
  893. /*
  894. X  Include declarations.
  895. */
  896. #include "display.h"
  897. #include "image.h"
  898. #include "X.h"
  899. X
  900. /*
  901. X  Global declarations.
  902. */
  903. char
  904. X  *client_name;
  905. X
  906. /*
  907. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  908. %                                                                             %
  909. %                                                                             %
  910. %                                                                             %
  911. %   E r r o r                                                                 %
  912. %                                                                             %
  913. %                                                                             %
  914. %                                                                             %
  915. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  916. %
  917. %  Function Error displays an error message and then terminates the program.
  918. %
  919. %  The format of the Error routine is:
  920. %
  921. %      Error(message,qualifier)
  922. %
  923. %  A description of each parameter follows:
  924. %
  925. %    o message: Specifies the message to display before terminating the
  926. %      program.
  927. %
  928. %    o qualifier: Specifies any qualifier to the message.
  929. %
  930. %
  931. */
  932. void Error(message,qualifier)
  933. char
  934. X  *message,
  935. X  *qualifier;
  936. {
  937. X  (void) fprintf(stderr,"%s: %s",client_name,message);
  938. X  if (qualifier != (char *) NULL)
  939. X    (void) fprintf(stderr," (%s)",qualifier);
  940. X  (void) fprintf(stderr,".\n");
  941. X  exit(1);
  942. }
  943. X
  944. /*
  945. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  946. %                                                                             %
  947. %                                                                             %
  948. %                                                                             %
  949. %   U s a g e                                                                 %
  950. %                                                                             %
  951. %                                                                             %
  952. %                                                                             %
  953. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  954. %
  955. %  Procedure Usage displays the program usage;
  956. %
  957. %  The format of the Usage routine is:
  958. %
  959. %      Usage()
  960. %
  961. %
  962. */
  963. static void Usage()
  964. {
  965. X  char
  966. X    **p;
  967. X
  968. X  static char
  969. X    *options[]=
  970. X    {
  971. X      "-border             include image borders in the output image",
  972. X      "-compress type      RunlengthEncoded or QEncoded",
  973. X      "-delay seconds      pause before selecting target window",
  974. X      "-descend            obtain image by descending window hierarchy",
  975. X      "-density geometry   vertical and horizonal density of the image",
  976. X      "-display server     X server to contact",
  977. X      "-frame              include window manager frame",
  978. X      "-geometry geometry  preferred size and location of the image",
  979. X      "-interlace type     NONE, LINE, or PLANE",
  980. X      "-monochrome         transform image to black and white",
  981. X      "-page geometry      size and location of the Postscript page",
  982. X      "-quality value      JPEG quality setting",
  983. X      "-rotate degrees     apply Paeth rotation to the image",
  984. X      "-scene value        image scene number",
  985. X      "-screen             select image from root window",
  986. X      "-verbose            print detailed information about the image",
  987. X      "-window id          select window with this id or name",
  988. X      (char *) NULL
  989. X    };
  990. X  (void) fprintf(stderr,"Usage: %s [options ...] file\n",client_name);
  991. X  (void) fprintf(stderr,"\nWhere options include:\n");
  992. X  for (p=options; *p != (char *) NULL; p++)
  993. X    (void) fprintf(stderr,"  %s\n",*p);
  994. X  (void) fprintf(stderr,
  995. X    "\nChange '-' to '+' in any option above to reverse its effect.\n");
  996. X  (void) fprintf(stderr,
  997. X    "For example, +frame means do not include window manager frame.\n");
  998. X  (void) fprintf(stderr,
  999. X  "\nBy default, 'file' is written in the Postscript image format.  To\n");
  1000. X  (void) fprintf(stderr,
  1001. X    "specify a particular image format, precede the filename with an image\n");
  1002. X  (void) fprintf(stderr,
  1003. X    "format name and a colon (i.e. ps:image) or specify the image type as\n");
  1004. X  (void) fprintf(stderr,
  1005. X    "the filename suffix (i.e. image.ps).  Specify 'file' as '-' for\n");
  1006. X  (void) fprintf(stderr,"standard input or output.\n");
  1007. X  exit(1);
  1008. }
  1009. X
  1010. /*
  1011. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1012. %                                                                             %
  1013. %                                                                             %
  1014. %                                                                             %
  1015. %    M a i n                                                                  %
  1016. %                                                                             %
  1017. %                                                                             %
  1018. %                                                                             %
  1019. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1020. %
  1021. %
  1022. */
  1023. int main(argc,argv)
  1024. int
  1025. X  argc;
  1026. X
  1027. char
  1028. X  *argv[];
  1029. {
  1030. X  char
  1031. X    *density,
  1032. X    *filename,
  1033. X    *option,
  1034. X    *page_geometry,
  1035. X    *resource_value,
  1036. X    *server_name,
  1037. X    *target_window;
  1038. X
  1039. X  Display
  1040. X    *display;
  1041. X
  1042. X  Image
  1043. X    *image;
  1044. X
  1045. X  ImageInfo
  1046. X    image_info;
  1047. X
  1048. X  int
  1049. X    degrees,
  1050. X    i,
  1051. X    x;
  1052. X
  1053. X  time_t
  1054. X    start_time;
  1055. X
  1056. X  unsigned int
  1057. X    borders,
  1058. X    compression,
  1059. X    descend,
  1060. X    frame,
  1061. X    interlace,
  1062. X    quality,
  1063. X    scene,
  1064. X    screen,
  1065. X    verbose;
  1066. X
  1067. X  XResourceInfo
  1068. X    resource_info;
  1069. X
  1070. X  XrmDatabase
  1071. X    resource_database,
  1072. X    server_database;
  1073. X
  1074. X  /*
  1075. X    Display usage profile if there are no command line arguments.
  1076. X  */
  1077. X  client_name=(*argv);
  1078. X  if (argc < 2)
  1079. X    Usage();
  1080. X  /*
  1081. X    Connect to X server.
  1082. X  */
  1083. X  server_name=(char *) NULL;
  1084. X  for (i=1; i < argc; i++)
  1085. X  {
  1086. X    /*
  1087. X      Check command line for server name.
  1088. X    */
  1089. X    option=argv[i];
  1090. X    if (((int) strlen(option) > 1) && ((*option == '-') || (*option == '+')))
  1091. X      if (strncmp("dis",option+1,3) == 0)
  1092. X        {
  1093. X          /*
  1094. X            User specified server name.
  1095. X          */
  1096. X          i++;
  1097. X          if (i == argc)
  1098. X            Error("missing server name on -display",(char *) NULL);
  1099. X          server_name=argv[i];
  1100. X          break;
  1101. X        }
  1102. X  }
  1103. X  display=XOpenDisplay(server_name);
  1104. X  if (display == (Display *) NULL)
  1105. X    Error("unable to connect to X server",XDisplayName(server_name));
  1106. X  /*
  1107. X    Set our forgiving error handler.
  1108. X  */
  1109. X  XSetErrorHandler(XError);
  1110. X  /*
  1111. X    Initialize resource database.
  1112. X  */
  1113. X  XrmInitialize();
  1114. X  resource_database=XrmGetDatabase(display);
  1115. X  resource_value=XResourceManagerString(display);
  1116. X  if (resource_value == (char *) NULL)
  1117. X    resource_value="";
  1118. X  server_database=XrmGetStringDatabase(resource_value);
  1119. X  XrmMergeDatabases(server_database,&resource_database);
  1120. X  /*
  1121. X    Get user defaults from X resource database.
  1122. X  */
  1123. X  XGetResourceInfo(resource_database,client_name,&resource_info);
  1124. X  resource_value=XGetResource(resource_database,client_name,"borders","False");
  1125. X  borders=IsTrue(resource_value);
  1126. X  resource_value=
  1127. X    XGetResource(resource_database,client_name,"compression","Runlength");
  1128. X  if (Latin1Compare("qencoded",resource_value) == 0)
  1129. X    compression=QEncodedCompression;
  1130. X  else
  1131. X    compression=RunlengthEncodedCompression;
  1132. X  density=XGetResource(resource_database,client_name,"density",(char *) NULL);
  1133. X  resource_value=XGetResource(resource_database,client_name,"descend","False");
  1134. X  descend=IsTrue(resource_value);
  1135. X  resource_value=XGetResource(resource_database,client_name,"frame","False");
  1136. X  frame=IsTrue(resource_value);
  1137. X  resource_value=
  1138. X    XGetResource(resource_database,client_name,"interlace","none");
  1139. X  interlace=UndefinedInterlace;
  1140. X  if (Latin1Compare("none",resource_value) == 0)
  1141. X    interlace=NoneInterlace;
  1142. X  if (Latin1Compare("line",resource_value) == 0)
  1143. X    interlace=LineInterlace;
  1144. X  if (Latin1Compare("plane",resource_value) == 0)
  1145. X    interlace=PlaneInterlace;
  1146. X  if (interlace == UndefinedInterlace)
  1147. X    Warning("unrecognized interlace type",resource_value);
  1148. X  page_geometry=
  1149. X    XGetResource(resource_database,client_name,"pageGeometry",(char *) NULL);
  1150. X  resource_value=XGetResource(resource_database,client_name,"quality","75");
  1151. X  quality=atoi(resource_value);
  1152. X  resource_value=XGetResource(resource_database,client_name,"rotate","0");
  1153. X  degrees=atoi(resource_value);
  1154. X  resource_value=XGetResource(resource_database,client_name,"scene","0");
  1155. X  scene=atoi(resource_value);
  1156. X  resource_value=XGetResource(resource_database,client_name,"screen","False");
  1157. X  screen=IsTrue(resource_value);
  1158. X  resource_value=XGetResource(resource_database,client_name,"verbose","False");
  1159. X  verbose=IsTrue(resource_value);
  1160. X  /*
  1161. X    Check command syntax.
  1162. X  */
  1163. X  filename=(char *) NULL;
  1164. X  target_window=(char *) NULL;
  1165. X  for (i=1; i < argc; i++)
  1166. X  {
  1167. X    option=argv[i];
  1168. X    if (((int) strlen(option) < 2) || ((*option != '-') && (*option != '+')))
  1169. X      filename=argv[i];
  1170. X    else
  1171. X      switch(*(option+1))
  1172. X      {
  1173. X        case 'b':
  1174. X        {
  1175. X          borders=(*option == '-');
  1176. X          break;
  1177. X        }
  1178. X        case 'c':
  1179. X        {
  1180. X          compression=NoCompression;
  1181. X          if (*option == '-')
  1182. X            {
  1183. X              i++;
  1184. X              if (i == argc)
  1185. X                Error("missing type on -compress",(char *) NULL);
  1186. X              if ((*argv[i] == 'R') || (*argv[i] == 'r'))
  1187. X                compression=RunlengthEncodedCompression;
  1188. X              else
  1189. X                if ((*argv[i] == 'Q') || (*argv[i] == 'q'))
  1190. X                  compression=QEncodedCompression;
  1191. X                else
  1192. X                  Error("invalid compression type on -compress",(char *) NULL);
  1193. X            }
  1194. X          break;
  1195. X        }
  1196. X        case 'd':
  1197. X        {
  1198. X          if (strncmp("delay",option+1,3) == 0)
  1199. X            {
  1200. X              resource_info.delay=0;
  1201. X              if (*option == '-')
  1202. X                {
  1203. X                  i++;
  1204. X                  if ((i == argc) || !sscanf(argv[i],"%d",&x))
  1205. X                    Error("missing seconds on -delay",(char *) NULL);
  1206. X                  resource_info.delay=atoi(argv[i]);
  1207. X                }
  1208. X              break;
  1209. X            }
  1210. X          if (strncmp("density",option+1,3) == 0)
  1211. X            {
  1212. X              density=(char *) NULL;
  1213. X              if (*option == '-')
  1214. X                {
  1215. X                  i++;
  1216. X                  if (i == argc)
  1217. X                    Error("missing geometry on -density",(char *) NULL);
  1218. X                  density=argv[i];
  1219. X                }
  1220. X              break;
  1221. X            }
  1222. X          if (strncmp("descend",option+1,3) == 0)
  1223. X            {
  1224. X              descend=(*option == '-');
  1225. X              break;
  1226. X            }
  1227. X          if (strncmp("display",option+1,3) == 0)
  1228. X            {
  1229. X              server_name=(char *) NULL;
  1230. X              if (*option == '-')
  1231. X                {
  1232. X                  i++;
  1233. X                  if (i == argc)
  1234. X                    Error("missing server name on -display",(char *) NULL);
  1235. X                  server_name=argv[i];
  1236. X                }
  1237. X              break;
  1238. X            }
  1239. X          Error("unrecognized option",option);
  1240. X          break;
  1241. X        }
  1242. X        case 'f':
  1243. X        {
  1244. X          frame=(*option == '-');
  1245. X          break;
  1246. X        }
  1247. X        case 'g':
  1248. X        {
  1249. X          if (strncmp("geometry",option+1,2) == 0)
  1250. X            {
  1251. X              resource_info.image_geometry=(char *) NULL;
  1252. X              if (*option == '-')
  1253. X                {
  1254. X                  i++;
  1255. X                  if (i == argc)
  1256. X                    Error("missing geometry on -geometry",(char *) NULL);
  1257. X                  resource_info.image_geometry=argv[i];
  1258. X                }
  1259. X              break;
  1260. X            }
  1261. X          Error("unrecognized option",option);
  1262. X          break;
  1263. X        }
  1264. X        case 'h':
  1265. X        {
  1266. X          Usage();
  1267. X          break;
  1268. X        }
  1269. X        case 'i':
  1270. X        {
  1271. X          if (strncmp("interlace",option+1,3) == 0)
  1272. X            {
  1273. X              interlace=NoneInterlace;
  1274. X              if (*option == '-')
  1275. X                {
  1276. X                  i++;
  1277. X                  if (i == argc)
  1278. X                    Error("missing type on -interlace",(char *) NULL);
  1279. X                  option=argv[i];
  1280. X                  interlace=UndefinedInterlace;
  1281. X                  if (Latin1Compare("none",option) == 0)
  1282. X                    interlace=NoneInterlace;
  1283. X                  if (Latin1Compare("line",option) == 0)
  1284. X                    interlace=LineInterlace;
  1285. X                  if (Latin1Compare("plane",option) == 0)
  1286. X                    interlace=PlaneInterlace;
  1287. X                  if (interlace == UndefinedInterlace)
  1288. X                    Error("invalid interlace type on -interlace",option);
  1289. X                }
  1290. X              break;
  1291. X            }
  1292. X          Error("unrecognized option",option);
  1293. X          break;
  1294. X        }
  1295. X        case 'm':
  1296. X        {
  1297. X          resource_info.monochrome=(*option == '-');
  1298. X          break;
  1299. X        }
  1300. X        case 'p':
  1301. X        {
  1302. X          if (strncmp("page",option+1,2) == 0)
  1303. X            {
  1304. X              page_geometry=(char *) NULL;
  1305. X              if (*option == '-')
  1306. X                {
  1307. X                  i++;
  1308. X                  if (i == argc)
  1309. X                    Error("missing page geometry on -page",(char *) NULL);
  1310. X                  page_geometry=argv[i];
  1311. X                }
  1312. X              break;
  1313. X            }
  1314. X          Error("unrecognized option",option);
  1315. X          break;
  1316. X        }
  1317. X        case 'q':
  1318. X        {
  1319. X          i++;
  1320. X          if ((i == argc) || !sscanf(argv[i],"%d",&x))
  1321. X            Error("missing quality on -quality",(char *) NULL);
  1322. X          quality=atoi(argv[i]);
  1323. X          break;
  1324. X        }
  1325. X        case 'r':
  1326. X        {
  1327. X          if (strncmp("rotate",option+1,3) == 0)
  1328. X            {
  1329. X              degrees=0;
  1330. X              if (*option == '-')
  1331. X                {
  1332. X                  i++;
  1333. X                  if ((i == argc) || !sscanf(argv[i],"%d",&x))
  1334. X                    Error("missing degrees on -rotate",(char *) NULL);
  1335. X                  degrees=atoi(argv[i]);
  1336. X                }
  1337. X              break;
  1338. X            }
  1339. X          Error("unrecognized option",option);
  1340. X          break;
  1341. X        }
  1342. X        case 's':
  1343. X        {
  1344. X          if (strncmp("scene",option+1,4) == 0)
  1345. X            {
  1346. X              i++;
  1347. X              if ((i == argc) || !sscanf(argv[i],"%d",&x))
  1348. X                Error("missing scene on -scene",(char *) NULL);
  1349. X              scene=atoi(argv[i]);
  1350. X              break;
  1351. X            }
  1352. X          if (strncmp("screen",option+1,4) == 0)
  1353. X            {
  1354. X              screen=(*option == '-');
  1355. X              break;
  1356. X            }
  1357. X          Error("unrecognized option",option);
  1358. X          break;
  1359. X        }
  1360. X        case 'w':
  1361. X        {
  1362. X          i++;
  1363. X          if (i == argc)
  1364. X            Error("missing id, name, or 'root' on -window",(char *) NULL);
  1365. SHAR_EOF
  1366. true || echo 'restore of ImageMagick/import.c failed'
  1367. fi
  1368. echo 'End of ImageMagick part 26'
  1369. echo 'File ImageMagick/import.c is continued in part 27'
  1370. echo 27 > _shar_seq_.tmp
  1371. exit 0
  1372.  
  1373. exit 0 # Just in case...
  1374. -- 
  1375.   // chris@Sterling.COM           | Send comp.sources.x submissions to:
  1376. \X/  Amiga - The only way to fly! |    sources-x@sterling.com
  1377.  "It's intuitively obvious to the |
  1378.   most casual observer..."        | GCS d+/-- p+ c++ l+ m+ s++/+ g+ w+ t+ r+ x+
  1379.