#!/bin/ksh # # Script '$HOME/sgiRGB2hprtl_HPDesignJet' # # ------------------------------------------------------------------------ # # An evolving master-copy of this script is the # script: sgiRGB2hprtl_HPDesignJet in $FEDIR/scripts # where FEDIR=/apps/nns_com/fea # # ------------------------------------------------------------------------ # EVOLUTION: # # Created from Montandon's script '$HOME/sgiscrn2hprtl_HPDesignJet' # by removing the screen-capture stuff at the front of that script # -- i.e. assuming the user already has an SGI-RGB file. # ######################################################################### # # Purpose: To provide high quality HP printer files (i.e. PRINTOUT) to # large-scale DesignJet plotters from SGI RGB files. # ######################################################################### # # Called by: Manually (Could use an alias, like # alias rgb2dnj='$HOME/sgiRGB2hprtl_HPDesignJet' # in user .profile file. # Example call by alias name at command line: # rgb2dnj my.rgb) # or, usually, # Iconize this script with SGI Toolchest 'Find,An Icon' # and drop RGB file icons on the script icon. # # This script uses variable $1 to get RGB filename. ######################################################################### # # Critical component: # Uses Image Alchemy to create an HP-RTL file (for color DesignJet # large-scale plotters) # --- including DesignJet plotters WITHOUT PostScript interpreters. # (There is no 'tortl' utility delivered with IRIX.) # # Creates relatively SMALL, 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. # ######################################################################### # # Processing logic: # Uses the 'alchemy' program -- to translate the .rgb file into a # 1) color HP-RTL DesignJet-plottable file # or 2) gray HP-RTL DesignJet-plottable file # or 3) black-white HP-RTL DesignJet-plottable file. # # -------------------------------------------------------------------------- # # Uses 'xconfirm' to ask # 1) whether a color or gray-scale or black-white plot is wanted. # 2) Invert image? -- esp. black background to white. # 3) Uses 'imgworks' (or 'imgview') to view the to-be-translated # .rgb file. # (imgworks or imgview could be used to crop the .rgb file # before feeding it to Alchemy for the conversion to RTL .) # 4) Size of plot -- scaled into an A,B,C,D,or E size area. # x) DotsPerInch wanted -- 300 or 600 (or 200 or 150). # (Instead of prompting, sets DPI based on plot-size requested.) # x) What type of scaling algorithm to use to scale the raster # image to the plot area? (a,b,c, or d) # (Using 'b' seems best; but 'a' has to be used with --r13.) # 6) Blur? -- none, moderate, or heavy. # (Using alchemy 'b' scaling type with r2 or r11 is probably # better for anti-aliasing than using blur on the SGI-rgb file.) # # 6) whether printout is wanted. # 7) DesignJet plotter to use. # # -------------------------------------------------------------------------- # Background-related processing (in step 2): # # To output 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 a color shaded # design on a white background. # # To output GRAY-SCALE images, optionally uses 'invert' to # change the black background to white (and, perhaps unfortunately, # other blacks to white and inverts grays). I.e. end result can # be gray design info on a white background. # # To output BLACK-WHITE images (esp. wireframe/lines/text images), # uses 'imgexp' to convert gray to black (or white) -- after, # optionally, using 'invert' to switch black/white. I.e. end result # can be black design info on a white background (or white # design info on a black background). # # -------------------------------------------------------------------------- # # Note1: In Jul98, there was no viewer on SGI for HP-RTL (or HP-PCL) files. # An appropriate HP-compatible plotter is the viewer for these files. # # Note2: Instead of putting HP 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 10 Meg) FILEOUT may be set to a local file like # /local/scratch/${USER}_temp.rtl. # ############################################################################# # SCRIPT HISTORY: # # Written by: Blaise Montandon E40/C61 10Jul98 based on # sgiscrn2hprtl_HPDesignJet # Updated by: Blaise Montandon E40/C61 20Jul98 Added quick/or/smooth prompt # for r13 & a-scaling or for # r2/r11 & b-scaling. ############################################################################# # # Title for xconfirm windows: WINTITLE="SGIrgb2hpDesignJet" # Postion xconfirm windows -- 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. RGBFILE=$1 if test ! -f $RGBFILE then /usr/bin/X11/xconfirm -c $WINGEOM -header "$WINTITLE" \ -B DISMISS \ -t " Current directory: `pwd`" \ -t "" \ -t "The input FILE" \ -t "" \ -t " $RGBFILE" \ -t "" \ -t "DOES NOT EXIST. " \ -t "" \ -icon warning exit fi # For lp/lpr print-command-determination scripts: FEDIR="/apps/nns_com/fea" # For rgb file conversions -- tobw, invert, blur, etc. TEMPRGB="/local/scratch/${USER}_temp.rgb" TEMPRGB2="/local/scratch/${USER}_temp.rgb2" # export TEMPRGB rm -f $TEMPRGB cp $RGBFILE $TEMPRGB if test ! -f $TEMPRGB then /usr/bin/X11/xconfirm -c $WINGEOM -header "$WINTITLE" \ -B DISMISS \ -t " Current directory: `pwd`" \ -t "" \ -t "CANNOT COPY YOUR RGB FILE" \ -t "" \ -t " $RGBFILE" \ -t "" \ -t "TO " \ -t "" \ -t " $TEMPRGB" \ -t "" \ -t "CALL AN SGI or I-DEAS System Administrator for help." \ -t "" \ -icon warning exit fi # For location of alchemy executable: # ALCHEMYDIR="/apps/nns_com/fea/bin/alchemy.dir" ALCHEMYDIR="/apps/alchemy/ver1.11" ######## START of prompt parms ############################################# # #ORIENT="LAND" # #ORIENT="PORT" # ORIENT="" #COLORIND="BW" #COLORIND="GRAY" #COLORIND="COLOR" COLORIND="" #INVERTYN="NO" #INVERTYN="YES" INVERTYN="" # BACKGRND="BLACK" # BACKGRND="WHITE" BACKGRND="" #BLURLEV="MEDIUM" #BLURLEV="HEAVY" #BLURLEV="NONE" BLURLEV="" #SHORGB="NO" = do not show temp.rgb in imgworks/imgview #SHORGB="" = show temp.rgb in imgworks/imgview SHORGB="" #VIEWERRGB="imgworks" VIEWERRGB="imgview" #PLOTSIZE="D" #PLOTSIZE="C" #PLOTSIZE="B" #PLOTSIZE="A" PLOTSIZE="" #DPI="300" #DPI="600" #DPI="" DPI="50" #NNS_HPBWTYPE="HPRTL" #NNS_HPBWTYPE="HPPCL" # (RTL is good for ink-jets; PCL better for laser printers) NNS_HPBWTYPE="HPRTL" # ......... START of printer-prompt parms .............................. #NNS_HPCOLOR_PRINTER="HP_iaw###" # NNS_HPCOLOR_PRTRDESC="Bldg Column Dept" # NNS_HPCOLOR_PRINTER="B600_P141770" # NNS_HPCOLOR_PRTRDESC="B600-1 H-5 near E40" NNS_HPCOLOR_PRINTER="" NNS_HPCOLOR_PRTRDESC="" #NNS_HPBW_PRINTER="HP_iaw###" # NNS_HPCOLOR_PRTRDESC="Bldg Column Dept" #NNS_HPBW_PRINTER="B600_P141770" #NNS_HPBW_PRTRDESC="B600-1 H-5 near E40" NNS_HPBW_PRINTER="" NNS_HPBW_PRTRDESC="" ############### Some NNS DesignJet plotters ############################### # B600_P123591 B600-2 B-2 near Program Conference Room # B600_P141772 B600-2 I-3 near VIVID cluster # B600_P141770 B600-1 H-5 near E40 # # B160_P122902 B160-2 B-5 near E62 & E64 (near hull & machinery) # B160_P122905 B160-2 A-10 near E65 (piping) # B160_P122906 B160-2 D-12 near E63 (electrical) # B160_P122907 B160-2 for Mylar only -- E64 (machinery) ############### Some NNS DesignJet plotters ############################### #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="YES" # ......... END of printer-prompt parms .................................. #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="NO" ############ END of prompt parms ########################################## CHOICES="Choices so far:" CHOICES2=" " ####### Set color or gray or black-white indicator ######################### if test "$COLORIND" = "" then # -t " $CHOICES" \ # -t "" \ COLORIND=`/usr/bin/X11/xconfirm -c $WINGEOM -header "$WINTITLE" \ -b BW -b GRAY -B COLOR \ -t "SELECT PLOT COLOR PREFERENCE:" \ -t " 1) COLOR" \ -t " 2) GRAY" \ -t " 3) BW = pure Black-White" \ -t "" \ -t " -- for the HP DesignJet plotter output file." \ -t "" \ -t "NOTE1: GRAY or BW will trigger copying the rgb file to" \ -t " a gray-scale rgb." \ -t "" \ -t "NOTE2: Choosing BW will lead to prompts for converting gray picture pixels" \ -t " to white on a black background -- or black on a white background." \ -icon warning` CHOICES=$CHOICES" $COLORIND" fi if test \( "$COLORIND" = "BW" -o "$COLORIND" = "GRAY" \) then /usr/sbin/tobw $TEMPRGB $TEMPRGB2 /sbin/rm $TEMPRGB /sbin/mv $TEMPRGB2 $TEMPRGB fi ####### Set 'invert' parm ################################### if test "$INVERTYN" = "" then INVERTMSG="INVERT THE GRAYS IN THE IMAGE; SWITCH BLACK & WHITE?" if test "$COLORIND" = "COLOR" then INVERTMSG="CHANGE BLACK TO WHITE in the image?" fi INVERTYN=`/usr/bin/X11/xconfirm -c $WINGEOM -header "$WINTITLE" \ -B NO -b YES \ -t " $CHOICES" \ -t "" \ -t "The image has been COPIED INTO FILE" \ -t " $TEMPRGB" \ -t "" \ -t "$INVERTMSG" \ -t "especially, black background to white." \ -t "YES or NO." \ -t "" \ -t "NOTE: To save ink, BEST TO USE WHITE BACKGROUND" \ -t " rather than black." \ -t "" \ -icon warning` CHOICES=$CHOICES" Invert= $INVERTYN" fi if test "$INVERTYN" = "YES" then if test "$COLORIND" = "COLOR" then /usr/sbin/repcolor $TEMPRGB $TEMPRGB2 0 0 0 255 255 255 0 /sbin/rm $TEMPRGB /sbin/mv $TEMPRGB2 $TEMPRGB fi if test \( "$COLORIND" = "GRAY" -o "$COLORIND" = "BW" \) then # # # NOTE: Choosing 'GRAY' or 'BW' at the color prompt above, # # triggered using 'tobw' to create a black-white .rgb. # /usr/sbin/invert $TEMPRGB $TEMPRGB2 /sbin/rm $TEMPRGB /sbin/mv $TEMPRGB2 $TEMPRGB fi fi ####### CONVERT GRAY-RGB TO BLACK-WHITE -- ############################## ####### using 'imgexp' to map color/gray to white. ###################### if test "$COLORIND" = "BW" then ####### Set 'background' parm ################################### if test "$BACKGRND" = "" then BACKGRND=`/usr/bin/X11/xconfirm -c $WINGEOM -header "$WINTITLE" \ -B WHITE -b BLACK \ -t " $CHOICES" \ -t "" \ -t "Is the BACKGROUND in your image going to be" \ -t "BLACK OR WHITE?" \ -t "" \ -t " Your response is used to determine whether GRAYs will be changed to" \ -t " black (for a white background) -- or to white (on black background)." \ -t "" \ -icon warning` CHOICES=$CHOICES" BACKGD= $BACKGRND" fi if test "$BACKGRND" = "BLACK" then /usr/sbin/imgexp $TEMPRGB $TEMPRGB2 0 1 /sbin/rm $TEMPRGB /sbin/mv $TEMPRGB2 $TEMPRGB else /usr/sbin/imgexp $TEMPRGB $TEMPRGB2 254 255 /sbin/rm $TEMPRGB /sbin/mv $TEMPRGB2 $TEMPRGB fi fi ####### 'Blur' (anti-alias) image ####################################### if test "$BLURLEV" = "" then BLURLEV=`/usr/bin/X11/xconfirm -c $WINGEOM -header "$WINTITLE" \ -B NONE -b MEDIUM -bHEAVY \ -t " $CHOICES" \ -t "" \ -t "BLUR THE IMAGE? -- to attempt to reduce 'jaggies'." \ -t "" \ -t "OPTIONS: NONE, MEDIUM, HEAVY" \ -t "" \ -t "Warning: Blur will reduce the resolution of text and lines." \ -t "But it can soften jaggies on shaded images." \ -t "" \ -icon warning` CHOICES=$CHOICES" Blur= $BLURLEV" fi if test \( "$BLURLEV" = "MEDIUM" -o "$BLURLEV" = "HEAVY" \) then /usr/bin/X11/xconfirm -c $WINGEOM -header "$WINTITLE" \ -B DISMISS \ -t "The BLUR OPERATION will take several seconds. Hang on." \ -icon warning & fi IMGX=`/usr/sbin/imgsize $TEMPRGB | awk '{print $1}'` IMGY=`/usr/sbin/imgsize $TEMPRGB | awk '{print $2}'` if test "$BLURLEV" = "MEDIUM" then /usr/sbin/blur $TEMPRGB $TEMPRGB2 $IMGX $IMGY /sbin/rm $TEMPRGB /sbin/mv $TEMPRGB2 $TEMPRGB fi if test "$BLURLEV" = "HEAVY" then IMGX2=`echo "scale = 10; 0.60*$IMGX" | bc` IMGY2=`echo "scale = 10; 0.60*$IMGY" | bc` /usr/sbin/blur $TEMPRGB $TEMPRGB2 $IMGX2 $IMGY2 /sbin/rm $TEMPRGB /sbin/mv $TEMPRGB2 $TEMPRGB fi ####### Display .rgb file to be converted by Alchemy #################### if test "$SHORGB" = "" then # /usr/sbin/imgworks -nofork $TEMPRGB # /usr/sbin/imgworks $TEMPRGB # /usr/sbin/imgview -geometry +950+000 $TEMPRGB $VIEWERRGB -geometry 256x256+450+750 $TEMPRGB fi ####### Set Plot-size preference ########################################### if test "$PLOTSIZE" = "" then PLOTSIZE=`/usr/bin/X11/xconfirm -c $WINGEOM -header "$WINTITLE" \ -B A -b B -b C -b D -b E \ -t " $CHOICES" \ -t "" \ -t "SELECT PLOT-SIZE -- A,B,C,D,E." \ -t "" \ -t " A 8.5 x 11.0 in. ( 215.9 x 279.4 mm)" \ -t " B 11.0 x 17.0 in. ( 279.4 x 431.8 mm)" \ -t " C 17.0 x 22.0 in. ( 431.8 x 558.8 mm)" \ -t " D 22.0 x 34.0 in. ( 558.8 x 863.6 mm)" \ -t " E 34.0 x 44.0 in. ( 863.6 x 1117.6 mm)" \ -t "" \ -t "(The image will be scaled to fit within the plot area chosen.)" \ -t "" \ -t "(Dots-per-inch is automatically chosen so that the plot files will" \ -t " be no larger than about 8 Megabytes.)" \ -t "" \ -icon warning` CHOICES=$CHOICES" Plotsize= $PLOTSIZE" fi if test "$PLOTSIZE" = "A" then XLIM="11i" YLIM="8.5i" DPI=300 fi if test "$PLOTSIZE" = "B" then XLIM="17i" YLIM="11i" # DPI=150 DPI=200 fi if test "$PLOTSIZE" = "C" then XLIM="22i" YLIM="17i" # DPI=100 DPI=150 fi if test "$PLOTSIZE" = "D" then XLIM="34i" YLIM="22i" # DPI=75 DPI=100 fi if test "$PLOTSIZE" = "E" then XLIM="44i" YLIM="34i" # DPI=50 DPI=75 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" \ -t "" \ -t "SELECT DPI PREFERENCE -- 300 or 600 (or 150 or 200)." \ -t "" \ -t "(A higher DPI means longer translation and bigger plot file" \ -t " and bigger network impact -- but MAY give better quality.)" \ -t "" \ -icon warning` CHOICES=$CHOICES" DPI= $DPI" fi ####### Set RTL type (& scaling type) ################################### if test "$RTLTYPE" = "" then RTLTYPE=`/usr/bin/X11/xconfirm -c $WINGEOM -header "$WINTITLE" \ -B QUICK -b ALT1 -b ALT2 \ -t " $CHOICES" \ -t "" \ -t "QUICKer translation" \ -t " -or-" \ -t "ALTernate scaling of output" \ -t "" \ -t "from the Image Alchemy translator?" \ -t "" \ -t "NOTE: ALT1 is generally better quality than ALT2." \ -icon warning` CHOICES=$CHOICES" RTLTYPE= $RTLTYPE" fi RTLNUM="--r13" SCALTYP="a" if test "$RTLTYPE" = "ALT1" then RTLNUM="--r11" SCALTYP="b" DPI=300 fi if test "$RTLTYPE" = "ALT2" then RTLNUM="--r2" SCALTYP="b" fi ####### Set Scaling preference ########################################### if test "$SCALTYP" = "" then SCALTYP=`/usr/bin/X11/xconfirm -c $WINGEOM -header "$WINTITLE" \ -b d -b c -B b -b a \ -t "$CHOICES" \ -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 "" \ -icon warning` CHOICES=$CHOICES" ScaleType= $SCALTYP" fi ####### Run Alchemy ########################################### FILEOUT="/local/scratch/${USER}_temp.rtl" ############################################## # For color images (24-bit SGI-RGB to HP-RTL): ############################################## if test "$COLORIND" = "COLOR" then 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 \ $ALCHEMYDIR/alchemy $TEMPRGB \ $FILEOUT -o \ -24 $RTLNUM \ -X$SCALTYP$XLIM \ -Y$SCALTYP$YLIM \ -D $DPI $DPI \ -+ \ -Gi0.4 -Go1.0 \ -ds3 RETCODE=$? set - ############################################################################## # GRAY TREATMENT (BLACK 'UNDERCOVER' REMOVAL): # -C$ALCHEMYDIR/samples/sample.ucr \ # .ucr gave too much black with --r13; even used with -Gi & -Go. # Use -C with type --r2 or --r11, NOT --r13 ?? ############################################################################## # TWO ALTERNATES FOR SPECIFYING SIZE & RESOLUTION: # --X$XLIM \ # --Y$YLIM \ # 2) # -X$SCALTYP$XLIM \ # -Y$SCALTYP$YLIM \ # -D $DPI $DPI \ ############################################################################## # TYPICAL MESSAGES FROM ALCHEMY WHEN WRITING RTL: # # "Reading SGI Image file /local/scratch/bmo01_temp.rgb # Writing HP RTL file /local/scratch/bmo01_temp.rtl (output type 13)" # # "Reading SGI Image file /local/scratch/bmo01_temp.rgb # Writing HP RTL file /local/scratch/bmo01_temp.rtl (output type 2) # Switching to 1 bit CMYK output" # # "Reading SGI Image file /local/scratch/bmo01_temp.rgb # Writing HP RTL file /local/scratch/bmo01_temp.rtl (output type 11) # 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 RTL NOTES: # # 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." # # For 24-bit SGI-RGB to color HP-RTL: #=========================================================================== # 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) #=========================================================================== # GAMMA: # -------------------------------------------------------------------------- # Might need to use Gamma parms like the following to compensate # for 'dot gain' (darkness; lots of ink) in printouts: # -Gi0.3 -Go1.0 ############################################################################ NNS_HP_PRINTER=$NNS_HPCOLOR_PRINTER NNS_HP_PRTRDESC=$NNS_HPCOLOR_PRTRDESC NNS_HP_PRTRVAR=NNS_HPCOLOR_PRINTER fi ############################################ # GRAY (8-bit) SGI-RGB to GRAY-SCALE HP-RTL: ############################################ if test "$COLORIND" = "GRAY" then 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 \ $ALCHEMYDIR/alchemy $TEMPRGB \ $FILEOUT -o \ -b $RTLNUM \ -X$SCALTYP$XLIM \ -Y$SCALTYP$YLIM \ -D $DPI $DPI \ -+ \ -Gi0.6 -Go1.0 \ -ds3 RETCODE=$? set - ############################################################################## # GRAY TREATMENT (BLACK 'UNDERCOVER' REMOVAL): # -C$ALCHEMYDIR/samples/gray.ucr \ # .ucr gave lots of black with --r13; used with -Gi & -Go. # Gives black image, even after removing -Gi0.6 -Go1.0 . # Use -C with type --r2 or --r11, NOT --r13 ?? # # A locally-created UnderColor Removal file for RTL (or PCL): # -C $FEDIR/helps/alchemy_black.ucr \ ############################################################################## # TWO ALTERNATES FOR SPECIFYING SIZE & RESOLUTION: # 1) # --X$XLIM \ # --Y$YLIM \ # 2) # -X$SCALTYP$XLIM \ # -Y$SCALTYP$YLIM \ # -D $DPI $DPI \ ############################################################################## # ALCHEMY RTL (& possibly-related PCL) NOTES: # # For RTL *DeskJet* gray output: --r9 -b -8 -c2 # # For PCL: # '-P## -8 -b -c256' gets changed by Alchemy to '-P## -8 -b -c2' # # -d0 (no dithering) with '--r9' causes image to come out black&white # (no gray). # # "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)." # # For GRAY SGI-RGB (8-bit) to GRAY-SCALE HP-RTL: #=========================================================================== # 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) #=========================================================================== # 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_PRTRDESC=$NNS_HPBW_PRTRDESC NNS_HP_PRTRVAR=NNS_HPBW_PRINTER fi ################################################# # For GRAY (8-bit) SGI-RGB to black-white HP-RTL: ################################################# if test "$COLORIND" = "BW" then 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 \ $ALCHEMYDIR/alchemy $TEMPRGB \ $FILEOUT -o \ -b $RTLNUM \ -X$SCALTYP$XLIM \ -Y$SCALTYP$YLIM \ -D $DPI $DPI \ -+ \ -Gi0.6 -Go1.0 \ -d0 RETCODE=$? set - ############################################################################## # GRAY TREATMENT (BLACK 'UNDERCOVER' REMOVAL): # -C$ALCHEMYDIR/samples/gray.ucr \ # NOTE: Pure black-and-white is faster without undercover removal file. # ############################################################################## # TWO ALTERNATES FOR SPECIFYING SIZE & RESOLUTION: # 1) # --X$XLIM \ # --Y$YLIM \ # 2) # -X$SCALTYP$XLIM \ # -Y$SCALTYP$YLIM \ # -D $DPI $DPI \ ########################################################################### # ALCHEMY RTL NOTES # (for GRAY SGI-RGB (8-bit) to BLACK-WHITE HP-RTL): # # For RTL *DeskJet* gray output: --r9 -b -8 -c2 # # For PCL: # '-P## -8 -b -c256' gets changed by Alchemy to '-P## -8 -b -c2' # #=========================================================================== # 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) # # "If the input is black & white, you can do the conversion ... with # dithering off. This will result in a faster conversion." # # THUS: No dithering (-d0) is OK for black-white RTL (& PCL) and # should be faster. #=========================================================================== # 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_PRTRDESC=$NNS_HPCOLOR_PRTRDESC NNS_HP_PRTRVAR=NNS_HPCOLOR_PRINTER fi if test ! $RETCODE = 0 then /usr/bin/X11/xconfirm -c $WINGEOM -header "$WINTITLE" -B DISMISS \ -t "$CHOICES" \ -t " $CHOICES2" \ -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 # ####### 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 "$CHOICES" \ # -t "$CHOICES2" \ # -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 if test "$NNS_HP_PRINTER" = "" then NNS_HP_PRINTERID=`/usr/bin/X11/xconfirm -c $WINGEOM -header "$WINTITLE" \ -font Screen15 \ -B NoPlot -b 141770 -b 141772 -b 123591 \ -b 122907 -b 122906 -b 122905 -b 122902 \ -t " $CHOICES" \ -t "" \ -t "Some NNS HP-DesignJet Plotters:" \ -t "" \ -t "lpr-name Location" \ -t "_____________ ________________________________________________________________" \ -t "B160:" \ -t " B160_P122902 B160-2 B-5 near E62 & E64 (near hull & machinery) " \ -t " B160_P122905 B160-2 A-10 near E65 (piping)" \ -t " B160_P122906 B160-2 D-12 near E63 (electrical)" \ -t " B160_P122907 B160-2 for Mylar only -- E64 (machinery)" \ -t "B600:" \ -t " B600_P123591 B600-2 B-2 near Program Conference Room" \ -t " B600_P141772 B600-2 I-3 near VIVID cluster" \ -t " B600_P141770 B600-1 H-5 near E40" \ -t "" \ -icon warning` fi if test "$NNS_HP_PRINTERID" = "NoPlot" then /usr/bin/X11/xconfirm -c $WINGEOM -header "$WINTITLE" \ -b DISMISS \ -t "$CHOICES" \ -t "$CHOICES2" \ -t "" \ -t "The HP-RTL output file is in" \ -t "" \ -t "$FILEOUT" \ -t "" \ -t "You can send the HP plot file to an HP-DesignJet plotter using the" \ -t "Unix 'lpr' command (and a 'P' plot queue, for binary plot files)." \ -t "Example:" \ -t " lpr -PBxxx_P##### $FILEOUT " \ -t "" \ -icon warning exit fi NNS_HP_PRINTER="NOT_SET_YET_IN_SCRIPT" case $NNS_HP_PRINTERID in 122902) NNS_HP_PRINTER=B160_P122902 ;; 122905) NNS_HP_PRINTER=B160_P122905 ;; 122906) NNS_HP_PRINTER=B160_P122906 ;; 122907) NNS_HP_PRINTER=B160_P122907 ;; 123591) NNS_HP_PRINTER=B600_P123591 ;; 141772) NNS_HP_PRINTER=B600_P141772 ;; 141770) NNS_HP_PRINTER=B600_P141770 ;; esac ####### Do Print-Y/N section, if NNS_HP_PRINTER is set. ################### # if test "$PRINTYN" = "" then PRINTYN=`/usr/bin/X11/xconfirm -c $WINGEOM -header "$WINTITLE" \ -b YES -B NO \ -t "$CHOICES" \ -t "$CHOICES2" \ -t "" \ -t "REALLY SEND PLOT FILE to plotter ${NNS_HP_PRINTER} ?" \ -t "" \ -icon warning` fi # if test "$PRINTYN" = "NO" if test ! "$PRINTYN" = "YES" 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 "$CHOICES" \ -t "$CHOICES2" \ -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 #########################