tclRegPrint.c

 Contains TCL verb routine to print images as PostScript files.
 This routine operates on regions whose pixels are of any
 supported type.  It uses the
 
 C primitives for printing images  built into dervish,
 which, in turn, use Floyd-Stienberg dithering.

 

For operations on arbitrary X window displays of images, see xdither.



regPrint

 Render an image of the region to the named postscript file.
 By default, the image is printed reversed: (sky is white).
 The -gamma switch is used to lighten/darken (higher values/lower values)
 Its default value is 0.0 (apply no gamma correction).

 

By default (or if thresh is equal to or larger than sat), the image is sampled and saturation and threshold values are calculated. The saturation and threshold values are always returned as a list (e.g., {thresh 500.0000} {sat 1000.0000}) even if explicitly set.

The sqrt option applies a sqrt to the image intensity when turning the pixels into postscript. It is a useful option for quick look printing. When using the sqrt option, a value for gamma of 3.2 is useful.

Labels may be applied anywhere on the image by passing a list to the routine. The format is {row col text}. The text will appear at that row and col. If the text has whitespace between words, then the syntax is: {row col {text}}. If the text is "circle","box", or "triangle" then the syntax is: {row col text width}, where width is the (diameter, width, base length) of the (circle, box, triangle) in pixels. The glyph will be drawn centered upon the target row and col. If the text is "rect" then the syntax is: {row col drow dcol} where drow and dcol are the row and column widths. If the text is "line" then the syntax is: {row col text row2 col2} and the line will be drawn between the points. In detail, if the first characters of the text are these keywords, then the glyphs will be drawn.

 The postscript file is an attempt at Encapsulated PostScript,
 but it acts somewhat strangely when used in this form in TeX file.
 To use the file in a TeX file, the following sequence will be useful:

 \input epsf                         % get encapsulated postscript macros
 % To match the centering of the original regPrint file, recall that
 % TeX has 1in default margins, and use:
 \hoffset=-0.5in
 \voffset=-0.5in
 \epsfile[40 264 572 752]{coma.ps}   % put *.ps file into document
 % you will have to get the exact numbers from the ps file itself,
 % at the like similar to %%BoundingBox 40 264 572 752
 \vskip 0.5cm                 % put a decent space between image and text

TCL SYNTAX:
  regPrint  "<region>" "<file>" "-title" "-width" "-height" "-gamma" "-dpi" "-thresh" "-sat" "-noreverse" "-sqrt" "-nodither" "-pixlabels" 

TCL HELP STRING:
  Print a region to a postscript file

TCL ARGUMENTS:
                 : 
  "<region>"   : Handle to region
  "<file>"     : File to put Postcript into
  "-title"       : Title to print (def: name of region)
  "-width"       : Width of paper in inches (def: 8.5)
  "-height"      : Height of paper in inches (def: 11.0)
  "-gamma"       : Lighten or darken the image (def: 0.0)
  "-dpi"         : Target resolution of printer (def: 300)
  "-thresh"      : Threshhold (def: compute threshold)
  "-sat"         : Saturation (def: computer saturation)
  "-noreverse"   : If present do not reverse the image
  "-sqrt"        : Apply sqrt intensity mapping (def: linear mapping)
  "-nodither"    : If present do not apply FS dithering to image
  "-pixlabels"   : If present use the list of lists provided to label 
                image (def: no labels)