#!/bin/ksh # # Script: hc_idgrfx2hpA_prtr in $FEDIR/scripts # where FEDIR=/apps/nns_com/fea # # Motivation: # Uses A=Alchemy to create # 1) HP-PCL (for gray-scale/black-white Laserjet/Deskjet printers) # OR # 2) HP-RTL (for color Deskjet/Laserjet printers) # --- especially for Deskjet/Laserjet printers WITHOUT PostScript # interpreters. (There is no 'topcl' or 'tortl' utility delivered # with IRIX.) # # ALSO -- SMALLER, Alchemy-translated screen-capture files (of # hi-quality) -- i.e. faster printouts and less network traffic # compared to the SGI 'tops' utility, which converts SGI .rgb # files to huge Postscript files. # # Purpose: To provide high quality HP printer files (i.e. PRINTOUT) from # an SGI # 1) I-DEAS Master Series (Design or Simulation) Graphics area # of the screen, # or 2) lower-left of that area, # or 3) entire SGI screen (for 'tutorial' screen prints or for # screen print from any application). # # Processing logic: # Uses 'scrsave' (and 'izoom') and 'alchemy' programs -- # to create # 1) color HP-RTL print file # or 2) gray HP-PCL print file # or 3) black-white HP-PCL print file. # # To output BLACK-WHITE images (esp. wireframe/lines/text images), # uses 'imgexp' to convert color/gray to white and, optionally, # uses 'invert' to switch black/white. I.e. end result can be black # design info on a white background. # # To output GRAY-SCALE OR COLOR images, optionally uses 'repcolor' to # change the black background to white (and, perhaps unfortunately, # other blacks to white). I.e. end result can be gray or color # design info on a white background. # # Uses 'xconfirm' to ask # 1) what part of screen is wanted # ('IDEASgfx','LowLeft','ALLscrn') # 2) whether a landscape or portrait orientation print is wanted # 3) whether a color (HP-RTL) or gray-scale (HP-PCL) or # black-white (HP-PCL) print is wanted. # <'scrsave' is executed at this point.> # 4) Invert image? -- esp. black background to white. # 5) DotsPerInch wanted -- 300 or 600 (or 200 or 150). # 6) What type of scaling algorithm to use to scale the raster # image to the 8.16"x10.66" printable area? (a,b,c, or d) # (Using 'b' seems best; de-activated this prompt.) # # Uses 'imgworks' to immediately review the scrsave-created # .rgb file. (Could be used to crop .rgb file before feeding it # to Alchemy for the conversion to RTL or PCL.) # # Uses 'xconfirm' to ask whether printout is wanted. If so, # uses NNS_HPBW_PRINTER or NNS_HPCOLOR_PRINTER to determine whether # to print and where to print. # # Note1: # In Mar98, there was no viewer on SGI for HP-PCL or HP-RTL files. # An appropriate HP-compatible printer is the viewer for these files. # # Note2: Instead of putting HP PCL/RTL files in a /local/scratch directory, # the FILEOUT variable below can be set to direct the output file # to $HOME/temp.pcl or $HOME/temp.rtl -- for example, to facilitate # FTP of the file to a PC-NT file system via login to the 'sgia' # server rather than the SGI workstation. However, # to keep down traffic on the network for these rather large files # (about 1 to 5 Meg) FILEOUT may be set to a local file like # /local/scratch/${USER}_temp.pcl (or .rtl). # # Written by: Blaise Montandon E40/C61 7Apr98 based on hc_idgrfx2hpA, which # was based on hc_idgrfx2gifA: # add ALLscrn; improve # SHRINK,izoom opts; add # printer prompts # Updated by: Blaise Montandon E40/C61 22Apr98 Added 2 yellow horizontal # lines to mark LowLeft area # Updated by: Blaise Montandon E40/C61 24Apr98 Handle the 2 yellow horizontal # lines better for landscape # Updated by: Blaise Montandon E40/C61 11May98 Added vars at top of script # facilitate setting defaults in copies of this script # Updated by: Blaise Montandon E40/C61 26May98 Separated del-rgb & no-printer # xconfirm msgs #ORIENT="LAND" #ORIENT="PORT" ORIENT="" #SCRAREA="ALLscrn" #SCRAREA="IDEASgfx" #SCRAREA="LowLeft" SCRAREA="" #COLORIND="BW" #COLORIND="GRAY" #COLORIND="COLOR" COLORIND="" #NNS_HPCOLOR_PRINTER="tek##" #NNS_HPCOLOR_PRINTER="HP_iaw###" NNS_HPCOLOR_PRINTER="" #NNS_HPBW_PRINTER="B###_P#####" #NNS_HPBW_PRINTER="HP_iaw###" NNS_HPBW_PRINTER="" #PRINTYN="NO" = no prompt whether to print AND exit w/o printing #PRINTYN="YES" = no prompt whether to print; go ahead and print #PRINTYN="" = prompt whether to print (YES/NO) PRINTYN="" #PRT_HP_YN="NO" = no warning about HP file print AND exit w/o printing #PRT_HP_YN="YES" = no warning/really-print prompt; print #PRT_HP_YN="" = warn about HP file print & 'really-print?' prompt (YES/NO) PRT_HP_YN="" #INVERTYN="NO" #INVERTYN="YES" INVERTYN="" #DPI="300" #DPI="600" DPI="" #SHORGB="NO" = do not show temp.rgb in imgworks #SHORGB="" = show temp.rgb in imgworks SHORGB="" #DELRGB="NO" = no prompt for delete of temp.rgb AND no delete #DELRGB="YES" = no prompt; delete temp.rgb #DELRGB="" = prompt for delete of temp.rgb DELRGB="" WINTITLE="SGIgrafix2hp_prtr" # Right side of the screen WINGEOM="-geometry +960+450" # 'man X' says # +0+0 upper left hand corner. # -0+0 upper right hand corner. # -0-0 lower right hand corner. # +0-0 lower left hand corner. FEDIR="/apps/nns_com/fea" TEMPRGB="/local/scratch/${USER}_temp.rgb" TEMPRGB2="/local/scratch/${USER}_temp.rgb2" # export TEMPRGB ####### Ask for print orientation ######################################## if test "$ORIENT" = "" then ORIENT=`/usr/bin/X11/xconfirm -c $WINGEOM -header "$WINTITLE" \ -b LAND -B PORT \ -t "" \ -t "SELECT PRINTOUT ORIENTATION --" \ -t "" \ -t "PORTRAIT OR LANDSCAPE." \ -t "" \ -icon warning` fi ####### Set LowLeft X-capture-limit ######################################## XPIXLIM="640" XINCHLIM="6.5" if test "$ORIENT" = "LAND" then XPIXLIM="480" XINCHLIM="4.9" fi ####### Indicate the Lower-Left area of IDEASgfx area #################### ####### by drawing lines on the screen. #################### LINERGBFIL="/local/scratch/line3thick.rgb" /sbin/rm -f $LINERGBFIL /usr/sbin/conimg $LINERGBFIL $XPIXLIM 3 255 255 000 /usr/sbin/ipaste -n -o 10 187 $LINERGBFIL /usr/sbin/ipaste -n -o 10 670 $LINERGBFIL /sbin/rm -f $LINERGBFIL ####### Ask for ALLscrn or IDEASgfx or Lower-Left area #################### if test "$SCRAREA" = "" then SCRAREA=`/usr/bin/X11/xconfirm -c $WINGEOM -header "$WINTITLE" \ -b ALLscrn -b IDEASgfx -B LowLeft \ -t " Choices so far: $ORIENT" \ -t "" \ -t "CAPTURE (as an SGI .rgb file and convert to HP print file)" \ -t "" \ -t "1) The entire screen area (1280x1024) (~13.0\"x10.4\")" \ -t "" \ -t "--OR--" \ -t "" \ -t "2) The I-DEAS Design/Simulation Graphics area (1067x796) (~10.8\"x8.1\")" \ -t " (the *usual* I-DEAS Graphics area of the screen)" \ -t "" \ -t "--OR--" \ -t "" \ -t "3) LOWER-LEFT 'quarter' of the I-DEAS Graphics area (${XPIXLIM}x480) (~${XINCHLIM}\"x4.9\")?" \ -t " (NOTE:" \ -t " 'Lower-Left' avoids having to zoom captured image down to 640x480" \ -t " for the 'demo' Alchemy program. The zoom fuzzes thin lines and" \ -t " text, especially one-pixel wide lines & text." \ -t " The two yellow horizontal lines indicate the extent of the Lower-Left" \ -t " box. They can be removed: put mouse cursor on each line & press Esc.)" \ -icon warning` fi if test "$SCRAREA" = "ALLscrn" then SCRCORNERS="" SHRINK=".468" if test "$ORIENT" = "LAND" then SHRINK=".375" fi fi if test "$SCRAREA" = "IDEASgfx" then SCRCORNERS="10 1076 190 985" SHRINK=".599" if test "$ORIENT" = "LAND" then SHRINK=".449" fi fi if test "$SCRAREA" = "LowLeft" then SCRCORNERS="10 649 190 669" SHRINK="1.0" if test "$ORIENT" = "LAND" then # SCRCORNERS="10 649 190 669" # SHRINK="0.75" # To avoid having to shrink, change from 640x480 to 480x640. # SCRCORNERS="10 489 190 829" # To avoid having to shrink and not make capture taller than length, # changed from 640x480 to 480x480. SCRCORNERS="10 489 190 669" SHRINK="1.0" fi fi ####### Set color or gray indicator ################################### if test "$COLORIND" = "" then COLORIND=`/usr/bin/X11/xconfirm -c $WINGEOM -header "$WINTITLE" \ -b BW -b GRAY -B COLOR \ -t " Choices so far: $ORIENT $SCRAREA" \ -t "" \ -t "*** THE SCREEN CAPTURE WILL BE PERFORMED AFTER THIS SELECTION. ***" \ -t " (It will take about 10 seconds.) HAVE YOU POSITIONED YOUR MODEL?" \ -t "" \ -t "SELECT COLOR PREFERENCE -- " \ -t " 1) COLOR" \ -t " 2) GRAY" \ -t " 3) BW = pure Black-White" \ -t "" \ -t " -- for the HP printer output file." \ -t "" \ -t "NOTE: BW will trigger converting colored-or-gray design-info to white on" \ -t " the black design background. Then you can switch white & black" \ -t " to get .rgb & HP-printer files with white background and black info." \ -icon warning` fi RGBCOLOR="" if test "$COLORIND" = "BW" then RGBCOLOR="-b" fi # # # For GRAY, rather than capture the screen with 'scrsave -b', one can # # # use the '-b' parm on Alchemy to let Alchemy give # # # gray-scale images from a color .rgb file. NOTE: # # # Alchemy with -b seems to give good gray-scale Postscript from a color # # # .rgb -- but not good gray-scale RTL or PCL. # if test "$COLORIND" = "GRAY" then RGBCOLOR="-b" fi ####### 'Kill' the lines on the screen that indicate #################### ####### the Lower-Left area of IDEASgfx area. #################### ps -ef | grep ipaste | grep -v grep | awk '{ print $2 }' | \ xargs kill -9 {} 2> /dev/null ####### Create .rgb file #################################################### ####### sleep 5 allows time for xconfirm window to completely disappear ##### ####### and for most 3D GL images to regenerate. ##### /sbin/sleep 5 /usr/sbin/scrsave $TEMPRGB $SCRCORNERS $RGBCOLOR ####### Flip-90 section ################################### # XLIM=8.16i YLIM=10.66i # CENTER="8.5i 11i" # Offsets seem to have to be in 10s of inches, i.e. use 1/10 of offset inches. # Perhaps it is better to do Offsets in pixels/dots. Ex: -100p 200p # OFFSET="-0.04i 0.10i" # OFFSET="030p 900p" OFFSET="030p 300p" FLIPMSG="" if test "$ORIENT" = "LAND" then /usr/sbin/iflip $TEMPRGB $TEMPRGB2 90 /sbin/rm -f $TEMPRGB /sbin/mv $TEMPRGB2 $TEMPRGB XLIM=8.16i YLIM=10.66i # CENTER="8.5i 11i" # # XLIM=10.66i # YLIM=8.16i # CENTER="11i 8.5i" # # Offsets seem to have to be in 10s of inches, i.e. use 1/10 of offset inches. # Perhaps it is better to do Offsets in pixels/dots. Ex: -100p 200p # OFFSET="-0.08i 0.07i" # pretty good; too narrow at bottom of landscape # OFFSET="030p 400p" OFFSET="030p 250p" FLIPMSG="Image has been rotated 90 degrees for landscape print." fi ####### END of Flip-90 section ########################################### ####### Zoom-down to within 640x480 ################################### # The SHRINK statements and # this 'izoom' section could be removed if a 'professional' version of # Image Alchemy were licensed, instead of the demo version limited to # 640x480 image file input. Ref: nnsFEAmenu opt 'u g a h' # ZOOMMSG="" ZOOMMSG2="" if test ! "$SHRINK" = "1.0" then # /usr/sbin/izoom $TEMPRGB $TEMPRGB2 $SHRINK $SHRINK -i # /usr/sbin/izoom $TEMPRGB $TEMPRGB2 $SHRINK $SHRINK -g -w 0.65 # /usr/sbin/izoom $TEMPRGB $TEMPRGB2 $SHRINK $SHRINK -m -w 0.65 # /usr/sbin/izoom $TEMPRGB $TEMPRGB2 $SHRINK $SHRINK -b -w 0.65 /usr/sbin/izoom $TEMPRGB $TEMPRGB2 $SHRINK $SHRINK -q -w 0.65 /sbin/rm -f $TEMPRGB /sbin/mv $TEMPRGB2 $TEMPRGB ZOOMMSG="The .rgb capture file was zoomed within 640x480 limits" ZOOMMSG2="-- to use the demo/evaluation Alchemy program." fi ####### END of Zoom-down section ########################################### ####### 'imgexp' color/gray to white ######################################## # # # Choosing 'BW' at the color prompt above, # # triggered 'scrsave -b' to be # # used to capture a black-white .rgb. # # Alternative method of creating black-white .rgb: # /usr/sbin/tobw $TEMPRGB $TEMPRGB2 # /sbin/rm $TEMPRGB # /sbin/mv $TEMPRGB2 $TEMPRGB # if test ! "$COLORIND" = "COLOR" if test "$COLORIND" = "BW" then /usr/sbin/imgexp $TEMPRGB $TEMPRGB2 0 1 /sbin/rm $TEMPRGB /sbin/mv $TEMPRGB2 $TEMPRGB fi ####### Set 'invert' parm ################################### if test "$INVERTYN" = "" then INVERTYN=`/usr/bin/X11/xconfirm -c $WINGEOM -header "$WINTITLE" \ -B NO -b YES \ -t " Choices so far: $ORIENT $SCRAREA $COLORIND" \ -t "" \ -t "THE IMAGE HAS BEEN CAPTURED IN FILE" \ -t " $TEMPRGB" \ -t "" \ -t "$ZOOMMSG" \ -t "$ZOOMMSG2" \ -t "" \ -t "INVERT THE COLORS IN THE IMAGE? -- in particular," \ -t "black background to white? YES or NO." \ -t "" \ -icon warning` fi if test "$INVERTYN" = "YES" then if test "$COLORIND" = "BW" then /usr/sbin/invert $TEMPRGB $TEMPRGB2 /sbin/rm $TEMPRGB /sbin/mv $TEMPRGB2 $TEMPRGB fi if test \( "$COLORIND" = "COLOR" -o "$COLORIND" = "GRAY" \) then /usr/sbin/repcolor $TEMPRGB $TEMPRGB2 0 0 0 255 255 255 0 /sbin/rm $TEMPRGB /sbin/mv $TEMPRGB2 $TEMPRGB fi fi ####### Set DPI preference ########################################### if test "$DPI" = "" then DPI=`/usr/bin/X11/xconfirm -c $WINGEOM -header "$WINTITLE" \ -B 300 -b 600 -b 200 -b 150 \ -t "Choices so far: $ORIENT $SCRAREA $COLORIND Invert: $INVERTYN" \ -t "" \ -t "SELECT DPI PREFERENCE -- 300 or 600 (or 150 or 200)." \ -t "" \ -t "(Then wait about 20 seconds for a gray HP print file" \ -t " to be created, 60 seconds for color -- much longer for 600 dpi.)" \ -t "" \ -t "(600 or 200 can be used for LaserJet 4, 5, etc. LaserJet 3 and" \ -t " before, and most color Deskjets, should use 300 or 150.)" \ -t "" \ -t " NOTE:" \ -t " After the HP-PCL file (or color HP-RTL file) is created," \ -t " the .rgb file will be shown with 'imgworks' and" \ -t " the HP file can be sent to an HP Laserjet (or Deskjet)." \ -t "" \ -icon warning` fi ####### Set Scaling preference ########################################### SCALTYP="b" # if test "$SCALTYP" = "" # then # # SCALTYP=`/usr/bin/X11/xconfirm -c $WINGEOM \ # -header "$WINTITLE" -b d -b c -B b -b a \ # -t "Chosen so far: $SCRAREA $ORIENT $COLORIND Invert: $INVERTYN DPI: $DPI" \ # -t "" \ # -t "SELECT SCALING ALGORITHM." \ # -t "" \ # -t "a - Nearest Neighbor" \ # -t "" \ # -t "b - Averaging/Linear-Interpolation (default)" \ # -t "" \ # -t "c - Lanczos2" \ # -t "" \ # -t "d - Lanczos3" \ # -t "" \ # -t " NOTE:" \ # -t " After the HP-PCL file (or color HP-RTL file) is created," \ # -t " the .rgb file will be shown with 'imgworks' and" \ # -t " the HP file can be sent to an HP Laserjet (or Deskjet)." \ # -t "" \ # -icon warning` # # fi ####### Display .rgb file to be converted by Alchemy #################### if test "$SHORGB" = "" then # /usr/sbin/imgworks -nofork $TEMPRGB /usr/sbin/imgworks $TEMPRGB fi ####### Run Alchemy ########################################### ############################################## # For color images (24-bit SGI-RGB to HP-RTL): ############################################## if test "$COLORIND" = "COLOR" then FILEOUT="/local/scratch/${USER}_temp.rtl" set -x xwsh -bg blue4 -fg white \ -title "$WINTITLE" -name "$WINTITLE" \ -fn -*-screen-medium-r-normal--15-*-*-*-m-80-iso8859-1 \ -geometry 80x18+010+450 -e \ /apps/nns_com/fea/bin/alchemy.dir/alchemy $TEMPRGB \ $FILEOUT -o \ --r9 -24 \ -X$SCALTYP$XLIM -Y$SCALTYP$YLIM \ -D $DPI $DPI \ -+ \ -_ $OFFSET \ -Gi0.4 -Go1.0 \ -ds3 RETCODE=$? set - # The following --_ (centering option) seems to put the picture too low on # the page -- in portrait mode. # --_ $CENTER \ # where CENTER = 8.5i 11i # Typical messages from Alchemy when writing RTL: # # "Writing HP RTL file /local/scratch/bmo01_temp.rtl (output type 9) # Switching to 1 bit CMYK output" # # "The output gamma for a 1 bit, black and white or 4 bit CMYK image # is inherently 1.0. Automatically changing the output gamma to 1.0 # and the input gamma to 0.50 (which will have the requested effect)." # # Alchemy can create 3 different types of RTL: # - CMYK, 1 bit per component per pixel (4 bits/pixel? "4-channel"?) # - 24 bits per pixel # - black & white, 1 bit per pixel # # "Alchemy will generate a color RTL file unless the input file is # black & white or grayscale or the -b option is specified as part # of the conversion." # # "If the input is black & white, you can do the conversion ... with # dithering off. This will result in a faster conversion." # # --r0: Paintjet uncompressed # --r9: Paintjet TIFF compressed # # --r1: DesignJet 650C uncompressed # --r2: DesignJet 650C TIFF compressed (default) # # --r6: DesignJet 650C uncompressed, on the fly # --r7: DesignJet 650C TIFF compressed, on the fly # # --r11: DesignJet 650C compressed, 4-channel # --r12: DesignJet 650C compressed, on the fly, 4-channel # # --r13: DesignJet 650C compressed, 24-bit # --r14: DesignJet 650C compressed, on the fly, 24-bit # # "Types 2 and 7 always perform 100% black removal." # "Types 13 and 14 send send 24-bit data to the plotter, allowing it # to perform the RGB to CMYK conversion." # "Types 13 and 14 can be used to scale the image, by specifying a different # DPI value than the 300 DPI value the plotter natively uses." # -ds3 # # -Gi0.6 -Go1.0 # # -_ $OFFSET # -_ 0.0i 0.0i # -_ 100p 100p # # --_ $CENTER # --_ 8.5i 11i # --_ 11i 8.5i # --_ 1250 3300 # --_ 1250p 3300p # # For 24-bit SGI-RGB to color HP-RTL: ############################################################################ # Quantization: Alchemy does no Heckbert quantization when creating # 1-bit CMYK output. So Heckbert quantization parms # -zh# and -zp# are not applicable for .rgb to .rtl conversion. ############################################################################ # Dithering: # -------------------------------------------------------------------------- # -d1 HSI uses Floyd-Steinberg (the default) for 24bit->8bit images # -ds3 HSI suggests Jarvis,Judice,&Ninke (with serpentine) for # color images to black-white and 1bit CMYK (for printer/plotter) ############################################################################ # DPI: # -------------------------------------------------------------------------- # Might need to use '-D 300 300' for HP printers before the Laserjet 4 series ############################################################################ # GAMMA: # -------------------------------------------------------------------------- # Might need to use Gamma parms like the following to compensate # for 'dot gain' (darkness; lots of ink) in printouts: # -Gi0.4 -Go1.0 ############################################################################ NNS_HP_PRINTER=$NNS_HPCOLOR_PRINTER NNS_HP_PRTRVAR=NNS_HPCOLOR_PRINTER fi ###################################################### # 24-bit SGI-RGB to GRAY-SCALE 1-bit-per-pixel HP-PCL: ###################################################### if test "$COLORIND" = "GRAY" then # FILEOUT="/local/scratch/${USER}_temp.pcl" FILEOUT="/local/scratch/${USER}_temp.rtl" PCLTYP="53" if test \( "$DPI" = "600" -o "$DPI" = "200" \) then PCLTYP="153" fi set -x xwsh -bg blue4 -fg white \ -title "$WINTITLE" -name "$WINTITLE" \ -fn -*-screen-medium-r-normal--15-*-*-*-m-80-iso8859-1 \ -geometry 80x18+010+450 -e \ /apps/nns_com/fea/bin/alchemy.dir/alchemy $TEMPRGB \ $FILEOUT -o \ --r9 -b -8 -c2 \ -X$SCALTYP$XLIM -Y$SCALTYP$YLIM \ -D $DPI $DPI \ -+ \ -_ $OFFSET \ -Gi0.35 -Go1.0 \ -ds3 RETCODE=$? set - # UnderColor Removal file for RTL (or PCL): # -C $FEDIR/helps/alchemy_black.ucr \ # Gamma parms for RTL (or PCL): # -Gi0.35 -Go1.0 \ # For use in place of the '--r' line, for PCL output instead of RTL: # -P$PCLTYP -8 -b -c2 \ # The following --_ (centering option) seems to put the picture rather low on # the page -- in portrait mode. # --_ $CENTER \ # where CENTER = 8.5i 11i # NOTE: -d0 (no dithering) causes image to come out black&white (no gray). # Typical messages from Alchemy when writing PCL: # # "Writing HP PCL file /local/scratch/bmo01_temp.pcl (compression type 50)" # # "The output gamma for a 1 bit, black and white or 4 bit CMYK image # is inherently 1.0. Automatically changing the output gamma to 1.0 # and the input gamma to 0.50 (which will have the requested effect)." # -P50 asks for expanded margins (near the edges of the page) # '-P## -8 -b -c256' gets changed by Alchemy to '-P## -8 -b -c2' # "PCL files are always 1-bit black & white files. # Alchemy assumes '-b -c2 -8' when writing a PCL file." # # -P0: uncompressed # -P1: RLE compressed # -P2: TIFF compressed # -P3: Delta Row compressed # # -P0: Portrait # -P10: Landscape # # -P0: Standard margins # -P50: Expanded margins # # -P100: Laserjet4 # # "When converting color or gray-scale images to PCL, you will probably # want to scale the output so the image will be larger than the input # image. This will allow the dithering to preserve more detail in the # image." # # "The best quality dither for PCL output is generally type 3 (Jarvis, # Judice, & Ninke), with a serpentine raster, and some dithering # noise (use -ds3 10, for example)." # # Allowable resolutions by Alchemy PCL: 75, 100 150, 300 DPI # (200 or 600 DPI for Laserjet4) # # If you specify another resolution, Alchemy automatically uses the # next higher resolution. # -_ $OFFSET # -_ 0.0i 0.0i # # --_ $CENTER # --_ 8.5i 11i # --_ 11i 8.5i # --_ 1250p 3300p # --_ 1250 3300 # # For 24-bit to GRAY-SCALE 1-bit HP-PCL: ############################################################################ # Quantization: Alchemy does not seem to do Heckbert quantization when '-b' # is present with the -8 and -c2 parameters -- for # creation of a gray-scale (1-bit) HP-PCL file. So Heckbert # quantization parameters -zh# and -zp# are not applicable # for .rgb to gray-scale (1-bit) HP-PCL conversion. ############################################################################ # If one goes from 24-bit to 8-bit color (-8 -c256), # default quantization-dithering is '-zh0 -zp0 -d1'. # -------------------------------------------------------------------------- # -zh1 (Heckbert quantization method 1) is recommended by HSI when reducing # to small # of colors; default is method 0. # -------------------------------------------------------------------------- # -zp2 specifies 'corner' color-choice method instead of 'mean' (0, the # default). ############################################################################ # Dithering: # -------------------------------------------------------------------------- # -d1 HSI uses Floyd-Steinberg (the default) for 24bit->8bit images # -ds3 HSI suggests Jarvis,Judice,&Ninke (with serpentine) for # color images to black-white and 1bit CMYK (for printer/plotter) ############################################################################ # DPI: # -------------------------------------------------------------------------- # Might need to use '-D 300 300' for HP printers before the Laserjet 4 series ############################################################################ # GAMMA: # -------------------------------------------------------------------------- # Might need to use Gamma parms like the following to compensate # for 'dot gain' (darkness; lots of ink) in printouts: # -Gi0.4 -Go1.0 ############################################################################ NNS_HP_PRINTER=$NNS_HPBW_PRINTER NNS_HP_PRTRVAR=NNS_HPBW_PRINTER fi ################################################################# # For color images (24-bit SGI-RGB) to black-white, 1-bit HP-PCL: ################################################################# if test "$COLORIND" = "BW" then # FILEOUT="/local/scratch/${USER}_temp.pcl" FILEOUT="/local/scratch/${USER}_temp.rtl" PCLTYP="53" if test \( "$DPI" = "600" -o "$DPI" = "200" \) then PCLTYP="153" fi set -x xwsh -bg blue4 -fg white \ -title "$WINTITLE" -name "$WINTITLE" \ -fn -*-screen-medium-r-normal--15-*-*-*-m-80-iso8859-1 \ -geometry 80x18+010+450 -e \ /apps/nns_com/fea/bin/alchemy.dir/alchemy $TEMPRGB \ $FILEOUT -o \ --r9 -8 -b -c2 \ -X$SCALTYP$XLIM -Y$SCALTYP$YLIM \ -D $DPI $DPI \ -+ \ -_ $OFFSET \ -Gi0.5 -Go1.0 \ -d0 RETCODE=$? set - # For use in place of the '--r' line, for PCL output instead of RTL: # -P$PCLTYP -8 -b -c2 \ # -ds3 # NOTE: No dithering (-d0) is OK for black-white PCL & RTL and # should be faster. Also pure black-and-white is also # faster without undercover removal file. # # Probably PCL is like RTL: # "If the input is black & white, you can do the conversion ... with # dithering off. This will result in a faster conversion." # The following --_ (centering option) seems to put the picture rather low on # the page -- in portrait mode. # --_ $CENTER \ # where CENTER = 8.5i 11i # -P50 asks for expanded margins (near the edges of the page) # See -P## parm defs in GRAY section above. # -_ $OFFSET # -_ 0.0i 0.0i # # --_ $CENTER # --_ 8.5i 11i # --_ 11i 8.5i # --_ 1250p 3300p # --_ 1250 3300 # # For 24-bit to BLACK-WHITE 1-bit HP-PCL: ############################################################################ # Quantization: Alchemy does not seem to do Heckbert quantization when '-b' # is present with the -8 parameter (and -c2) -- for creation # of a paletted (black-white, 1-bit). Nor does Alchemy # do Heckbert quantization during conversion to 1-bit HP-PCL. ############################################################################ # Dithering: # Probably PCL is like RTL: # "If the input is black & white, you can do the conversion ... with # dithering off. This will result in a faster conversion." # -------------------------------------------------------------------------- # -d1 HSI uses Floyd-Steinberg (the default) for 24bit->8bit images # -ds3 HSI suggests Jarvis,Judice,&Ninke (with serpentine) for # color images to black-white and 1bit CMYK (for printer/plotter) ############################################################################ # DPI: # -------------------------------------------------------------------------- # Might want to use '-D 300 300' for HP printers before the Laserjet 4 series ############################################################################ # GAMMA: # -------------------------------------------------------------------------- # Might want to use Gamma parms like the following to compensate # for 'dot gain' (darkness; lots of ink) in printouts: # -Gi0.6 -Go1.0 ############################################################################ NNS_HP_PRINTER=$NNS_HPCOLOR_PRINTER NNS_HP_PRTRVAR=NNS_HPCOLOR_PRINTER fi if test ! $RETCODE = 0 then /usr/bin/X11/xconfirm -c $WINGEOM -header "$WINTITLE" -B DISMISS \ -t "You Chose: $ORIENT $SCRAREA $COLORIND Invert: $INVERTYN" \ -t " DPI: $DPI" \ -t "" \ -t "Alchemy returned an error." \ -t "" \ -t "To see messages, you can run this utility -- " \ -t "" \ -t "$0" \ -t "" \ -t "-- in a Unix shell window." \ -t "" \ -icon warning exit fi # # /usr/sbin/imgworks -nofork $TEMPRGB # /usr/sbin/imgworks $TEMPRGB (moved above) # ####### If NNS_HP_PRINTER var not set, show how-to-print message ###### # ####### and then exit. ###### if test "$NNS_HP_PRINTER" = "" then JUNK=`/usr/bin/X11/xconfirm -c $WINGEOM -header "$WINTITLE" \ -B DISMISS \ -t "You Chose: $ORIENT $SCRAREA $COLORIND Invert: $INVERTYN DPI: $DPI" \ -t "" \ -t "PROCESS IS COMPLETE. CREATED FILE '$FILEOUT'" \ -t "" \ -t "$NNS_HP_PRTRVAR is not set -- in your .profile file or in this script." \ -t "*** NO PRINT sent now." \ -t "" \ -t "You can send the HP print file to an HP-compatible printer" \ -t "using the Unix lp 'raw' command (or lpr raw queue), like" \ -t "" \ -t " lp -c -d -oraw -onobanner $FILEOUT" \ -t " ( lpr -PBxxx_P##### $FILEOUT )" \ -t " -OR-" \ -t "The HP print file can be ftp-ed to a PC LAN (or moved by" \ -t "diskette/tape to a PC) for printing via the old DOS command:" \ -t " copy /b filename.rtl lpt1:" \ -t "to a printer connected to the parallel port on a PC." \ -t "" \ -icon warning` exit fi ####### Do Print-Y/N section, if NNS_HP_PRINTER is set. ################### # if test "$PRINTYN" = "" then PRINTYN=`/usr/bin/X11/xconfirm -c -header "$WINTITLE" \ -b YES -B NO \ -t "Choices: $ORIENT $SCRAREA $COLORIND Invert: $INVERTYN DPI: $DPI" \ -t "" \ -t "PRINT TO ${NNS_HP_PRTRVAR} = ${NNS_HP_PRINTER} ?" \ -t "" \ -icon warning` fi if test "$PRINTYN" = "NO" then exit fi ####### END of Print-Y/N section ########################################### # ################ START of section to ######################### # ################ PRINT HP file TO NNS_HP_PRINTER, ######################### # ################ which is set above from ######################### # ################ NNS_HPBW_PRINTER or NNS_HPCOLOR_PRINTER ################# if test ! "$NNS_HP_PRINTER" = "" then # FEDIR=/apps/nns_com/fea NNS_PRTR=$NNS_HP_PRINTER ### For testing: ## NNS_PRTR=B600xxxx ## NNS_PRTR="B600_Pxxxxx" ## NNS_PRTR="HP_iawxxx" ## NNS_PRTR="dumbo" # set -x LPRAW="-oraw" LPNOBANNER="-onobanner" . $FEDIR/scripts/set_prtcmd_bwdesk_noprompts if test ! $RETCODE = 0 then xconfirm -c -header "PRINT - Warning" -B DISMISS \ -t "$PRTQ_TYPE Printer $NNS_PRTR" \ -t "is not defined to this machine, `hostname`." \ -t "Try another printer," \ -t "or call SGI SysAdmins at 8-HELP -- " \ -t "or call an I-DEAS Admin in E40/C61." \ -icon warning exit fi # . $FEDIR/scripts/chk_psprtr # if test ! $RETCODE = 0 # then # exit # fi if test "$PRT_HP_YN" = "" then PRT_HP_YN=`xconfirm -c -header "HP-PRINT - Warning" -b NO -B YES \ -t "This utility prints an HP printer file." \ -t "" \ -t "If the printer you chose ($NNS_PRTR) is not equipped to" \ -t "interpret HP PCL/RTL printer files -- i.e. if the printer" \ -t "is not an HP-compatible printer, it may print many pages" \ -t "of gobbledy-gook instead of a picture on a single page. " \ -t "" \ -t "Do you want to send the print to the printer??" \ -icon warning` fi if test "$PRT_HP_YN" = "NO" then exit fi # set - ### For testing: # echo $NNS_PRT_CMD set -x cat $FILEOUT | $NNS_PRT_CMD # /sbin/rm -f ${TEMPPREF}temp.rgb # /sbin/rm -f $FILEOUT set - fi # ################ END of section to ############################## # ################ PRINT HP file TO NNS_HPBW_PRINTER ######################### # ################ or NNS_HPCOLOR_PRINTER ############################## # ################ Section to delete temp .rgb file ######################### if test "$DELRGB" = "" then ZOOMNOTE="" if test ! "$ZOOMMSG" = "" then ZOOMNOTE="zoomed down" fi DELRGB=`/usr/bin/X11/xconfirm -c $WINGEOM -header "$WINTITLE" \ -b NO -B YES \ -t "You Chose: $ORIENT $SCRAREA $COLORIND Invert: $INVERTYN DPI: $DPI" \ -t "" \ -t "DELETE the $ZOOMNOTE .rgb temporary work file ..." \ -t "$TEMPRGB ? (Yes or No)" \ -t "" \ -icon warning` fi if test "$DELRGB" = "YES" then /sbin/rm -f $TEMPRGB fi # ########## End of Section to delete temp .rgb file #########################