Date: 6-19-92 V.1.01 The ARexx Cookbook Companion Disk. All programs EXCEPT those in directories c, Libs, ConMan, Rexxarplib, snap, Rexxmathlib, PopCLI, and Rexxutil are copyright (c) 1992 by Merrill Callaway all rights reserved. My ARexx programs are NOT PUBLIC DOMAIN! The ARexx programs except as noted above, are not freely distributable and may not be uploaded to BBS, copied (except for a personal backup copy) or otherwise distributed without express written permission of Merrill Callaway. ONLY the ARexx programs noted above are priced at $9.95. The Libraries, snap, PopCLI, and ConMan are included FREE (of my charge) AS A CONVENIENCE ONLY and are included exactly as downloaded from BIX (Byte Information Exchange--BBS) (except dissolved, and text reader icons added). THE LIBRARIES, SNAP, POPCLI, AND CONMAN ARE COPYRIGHT BY THEIR RESPECTIVE AUTHORS. IF THEY REQUEST SHAREWARE, CONTRIBUTIONS SHOULD BE SENT DIRECTLY TO THEM (SEE THEIR DOCS). THIS DISK CONTAINS NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. The programs in The ARexx Cookbook, except for the ADPro Scale Utility programs are in the Rexxc directory. Copy these programs to your Rexx or Rexxc directory. Copy the "#?.library" files in the Rexxarplib, Rexxmathlib and Rexxutil directories to your sys:Libs directory. For convenience, all these library files and some auxiliary libraries have been collected in this disk's Libs directory. The docs for the Libraries are in the LibDocs drawer and you may print or copy them as you desire. Snap is mentioned in the book. It is shareware and included in the snap directory. See snap docs for further information. PopCLI is provided free and is in the directory by that name. Pursuant to the docs, it is free to distribute provided the docs are included intact, with the executable, and that no charge is made to distribute it. For installation procedures, see PopCLI docs. *************************************************************************** USER-STARTUP FOR AREXX, ETC. *************************************************************************** Note about snap: You may program any of the "hot keys" in snap. If you have a "stock" system 2.0, and have not changed the IControl in Prefs, then there will be a conflict with snap, unless you change one or the other. IControl defaults to a Left-Amiga with Left Mouse Button for the "screen drag", whereas snap defaults to a Left-Amiga with Left Mouse Button for snapping text. ONE OF THESE MUST CHANGE FOR SNAP TO WORK! I changed my "screen drag" to Ctrl with Left Mouse Button and left snap in the default. The example below resets the snap "insert key" to "y" instead of "i" because of a similar conflict in my system. See snap docs for more information. Here are my own ARexx-related SYS:S/user-startup lines which start all the utilities such as snap, WShell2.0, and PopCLI: assign rexx: sys:rexxc sys:s c:rexxmast >NIL: run >nil: snap -i15 stack 8192 ; the main WShell I use: DHOpts PIP: CNC:0/200/640/125/WShell/CLOSE/S* MENU sys:S/CNC-Menus ;file completer program with WShell fcomp >nil: ;uncomment the following if you want WShell to be the system shell. ;CAUTION: I've found that there are some problems with this... ;assign CON: dismount ;DHOpts CON:0/200/640/125/DisplayHandler!/CLOSE/S* ;resident Shell l:wshellseg system pure resident WShell l:wshellseg system pure copy :s/env ENVARC: quiet c:popcli 400 nowb cmd newwsh console cnc:menu#cnc-menus path sys:rexxc add ;the following rexx program loads your libraries at once. ;see the rexxc directory...Make sure this follows running rexxmast! C:rx sys:rexxc/setup.rexx ;setexecute is for WShell. C:setexecute *************************************************************************** The special instructions for the ADPro Scale Utility follow: *************************************************************************** ADPro Scale Utility V1.1 Bugs, comments and additional disk purchases: Merrill Callaway WHITESTONE 511-A Girard Blvd. SE Albuquerque, NM 87106 USA (505) 268-0678 HISTORY: These programs were developed on an Amiga 3000 running system 2.04 and Kickstart 37.175 on ROM. Also, the code uses WShell 2.0 using the CNC: handler, but if you don't have WShell, there are instructions for changing the code to use ConMan instead (included free, but with a separate shareware contribution requested by William Hawes, the author.) INSTALL: Copy the files in Libs to your sys:libs directory. Copy the files in Rexx to your sys:Rexx or sys:Rexxc directory. Copy the files in S to your sys:S directory. Copy the files in C to your sys:C directory (FD anim utilities). Copy the file ARexxCOOKBOOK:snap/snap to your C: directory (see snap.doc). Note: Change the path name in the S: directory file start-adproconsole to where you keep your ADPro pictures. The path on this disk says they are in "data:adpro/pix" but you should change this to where you keep your pix. Also the "cls" command is an alias from WShell to clear the screen. You may delete it as well from both S: files if you don't use WShell. Make sure to ASSIGN REXX: to your rexx or rexxc directory in your user startup sequence. If you run System 2.04 and WShell 2.0 that's all you do. If you have System 2.04 and DO NOT use WShell 2.0 then: Swap the line in the "F1.adpro" file that reads: "C:newwsh console cnc:/22/622/110/...etc. with the one below which reads: "NEWSHELL CON:/22/622/110/...etc. This will allow the AmigaDOS console handler to do its job. SYSTEM 1.3: If you run System 1.3 and don't use WShell already, you may need to install ConMan as the console handler program. See the ConMan directory. ConMan is superior to the AmigaDOS 1.3 console handler, and your CLI or Shell will be better off with it anyway (in System 1.3). ConMan may have a bit set wrong in some versions. The "execute" bit should be set or it will not work! If you DO NOT choose to use ConMan, then the "ADPro ARexx Commands" and the "Scanner Pixels" buttons may not work. If you use WShell 2.0 (highly recommended), then the code is OK as is. If you are using ConMan and have it installed properly (see the ConMan docs in that directory), then swap the line in the "F1.adpro" file that reads: "C:newwsh console cnc:/22/622/110/...etc. with the one below which reads: "NEWSHELL CON:/22/622/110/...etc. as above. ConMan supports the AmigaDOS console handler transparently. NOTE: In ConMan, ONLY IF the resolution of the WorkBench is the same (hires/interlace) as the ADPro Scale Utility screen, will the consoles open on the APS ADPro public screen, even under 2.04 on ROM. You can pull down or swap the public screen in case you need to use a low-res or nonlaced WB screen for some reason and the shell console will be on the WorkBench. Screen note: If the WB screen is low-res and ADPro Scale Utility has to open a custom public screen then you should go into the guiTerm.rexx program and uncomment the last command which closes down the screen. There is a comment to point which command to uncomment in the file. The logo will not work under system 2.03. If you have system 2.03 (interim) software, comment out the call to IFFimage(SCALEHOST,... in the files guiHELP.rexx and guiPostMsg.rexx. Put /* in front of and */ after the offending line to comment it out. Some other systems may have trouble with this function, so try commenting out the IFFimage call section if you have trouble with the window opening OK. If you want to use 8 colors (in WB 2.04) and extra colors in the logo, then rename the file: guiPIC8colorWB.iff to guiPIC.iff,after renaming guiPIC.iff to something else. OPERATION: ARexx MUST BE RUNNING! If you haven't done so already, then in your user-startup (sys 2.04) or startupii (system 1.3) put in the following lines: assign rexx: sys:rexxc sys:s path sys:rexxc add rexxmast >NIL: rx setup.rexx The setup.rexx program automatically loads all the support libraries, so you never have to worry about it again. The libraries take up no room, since they sleep until called. TO START: Press function key F2 while in ADPro to launch the program. The upper gadget opens four gadgets that let you scale the image data to the pixel aspect only. Each gadget executes the appropriate operation. The "pick" gadget lets you input your own custom numbers in a pop-up string requester. The image will be scaled to the pixel aspect only and not to the screen size. The operation will scale UP. There is a possibility to run out of memory if you scale a very large image, in which case the operation scales DOWN in size. The middle gadget calls up a series of gadgets designed to scale to aspect AND scale to any Amiga screen format from any other. The lower gadgets like to see RENDERED data as well as RAW data. If you forgot to render your image first, then a requester pops up asking if you want to "Smart Render" or "Exit". The "Smart Render" gadget looks at the pixel aspect of your raw data, and tries to determine which screen format it was intended for. In most cases, it is smart enough to guess, but if you have been scaling a lot, or otherwise messed up the pixel aspect, it may not guess correctly. In that case, choose exit, render in the format you like, and reenter the program to scale to screen, using the Scale to Display Only gadget. The gadgets ABOVE "Scale to Display Only" are for changing the pixel aspect AND the screen format at the same time. These are useful for converting in one step an image from a 1:1 pixel aspect scanner to an Amiga Screen format. Once you have scaled to a screen format stick to the "default" setting of "Scale to Display Only" to change to another screen format. The pixel aspect shown in these gadgets is the pixel aspect for "HiRes Interlace". If some other Amiga screen format is chosen, then the final pixel aspect will be adjusted according to the correct pixel aspect for that resolution. The "Y Overscan" gadget selects one of two options: (1) Keep Image Aspect (the default); and (2) Fill Screen. The first keeps the Image Aspect when you go from standard to Overscan by using the same percentage increase in the X and the Y directions: 15%. If you select "Fill Screen", then the FULL 20% Y Overscan is implemented, even though the image aspect will be "stretched" and extra 5% in the Y direction. This is handy if you want a High Res 640x400 image to fill the screen instead of not quite reaching the bottom border, as for instance, you'd want if you were making something for a video. The extra 5% stretch is not as noticeable as a black band at the bottom! Anyway, I've given you the option. With the Y Overscan on Fill Screen, a 640x400 image translates to a 736x480 image; on Keep Aspect, to a 736x460 image. In non-interlace, it's 240 and 230 pixels, respectively. WARNING! THIS PROGRAM ALTERS YOUR IMAGE DATA! MAKE A BACKUP BEFORE YOU TRY! The "SET PixAsp" gadget resets the Pixel Aspect of the image in ADPro with out scaling the image. Use it if you've scaled a picture a lot before you use ADPro Scale Utility. The intent of the program is to be used once or twice on one image. Repeatedly re-scaling your data back and forth will lose data, particularly if you go from a high res to low and back. One of the best uses is when you have a 1:1 pixel aspect in an image loaded from an Epson ES 300C scanner, and you want to take it to DPaintIV, DCTV, etc. Just select the proper button and it will be scaled properly, so that your image looks right, assuming you have calibrated you monitor correctly using the vertical height adjustment. To calibrate, use DPaint in "Be Square" mode and actually measure a square you drew. Use a PLASTIC (not metal!) ruler. Adjust the vertical height on your monitor until the square really measures as a square. The "Firecracker" button opens a window of scaling buttons which allow you to scale to or between any of the Firecracker24 (Impulse) board's resolutions. There are two buttons to turn on or off the ADPro display of the finished scaled image. NOTE!!! ADPro's FC24 Saver does NOT support all the Firecracker's resolutions! Only the 482 pixel high resolution is displayed when you use ADPro, so any images scaled to a height of 241 pixels will look "squashed" when displayed by ADPro. However, if saved as 24-bit IFF and loaded into Light24 (the FC24 Paint Program), then it will look fine, provided you set the resolution in Light24 to match the image's. The "Start Light24 Paint" button starts this program to paint on the picture or to load another. Make sure to save your picture in ADPro first, because if you change the resolution when Light24 wakes up, you lose the image, but not internally in ADPro. Running ADPro and Light24 with a large image will be detrimental to your memory! ARexx Command console F1 Launch: This program may be started on the ADPro screen by pressing function key F1 while in the ADPro screen. A console will open prompting you to enter ADPro ARexx commands. Gadget Launch: The "ARexx Commands" button starts a console to enter ADPro ARexx commands which are executed one at a time as you enter them. This is handy to explore the different ARexx commands that control ADPro. If you press [Rtn] without a valid command, you exit the program and the console window becomes an ordinary Shell or WShell, which you may close or enter commands, etc. To get the ARexx console back, close the window and click on its button again. *** P.rexx A program to calculate the pixels to scan to fill screen. *** The program p.rexx is run from a the "Scanner Pixels" button at the bottom. Its window operates similarly to the "ARexx Commands" window above. It calculates the number of pixels you must scan on an Epson ES300C scanner (with 1:1 pixel aspect) to fit a full screen in various Amiga program screen formats and pixels aspect ratios (i.e. DeluxePaint uses 10:11 pixel aspect). AFTER using the ADPro Scale Utility to scale to pixel aspect, the image will fill the screen! Example: An image to be scanned to fill a 640x400 high res interlace Amiga Screen Format after scaling to 10:11 pixel aspect will need you to scan 640x440 pixels in the Epson scanner. *************************************************************************** Showiff24.rexx is a program to display iff24 images on the FC from a shell or from Directory Opus: showiff24.dopus shows an iff-24 file in ADPro when you select it in Directory Opus. The program with the Firecracker24 called "showiff24" doesn't work very well. If you use the overlay mode, and try to show a file, everything is OK until you send "aoff" to turn off the Amiga overlay. The picture snaps smaller than the screen, a most annoying bug! This program fixes all that, provided you have ADPro. It uses ADPro to display iff24 files on the FC; a much better solution. May be run from Directory Opus by setting the gadget as "executable" and then in the command line: RX sys:rexxc/showiff24.dopus {fu} Set: output window, run asynchronously, and no filename quote. This allows the selected IFF 24 file to become an Argument to the program. It is then displayed on the FC24 after ADPro is opened. May also be run from the shell with the file as argument, or the program will prompt you. If you run it from dopus w/o specifying (selecting) a file, then the program prompts you to input a filename in the dopus output window. *************************************************************************** SCENERY ANIMATOR P.rexx also tells you what frame buffer dimensions to save if you have Scenery Animator and want to render to a Firecracker, not normally supported by Scenery Animator. After you run p.rexx and determine which Firecracker resolution you want, then enter the resulting dimensions in the frame buffer gadget in the "screen" window. Select IFF24 for the render mode, and after your file is rendered to, then use ADPro Scale Utility and the Firecracker button to select again the resolution you to want render. ADPro does the rest! You can get distortion-free 24-bit images this way with Scenery Animator! I hope that this program helps to eliminate the tedium of transforming between screen formats and scaling to pixel aspects.