/* $VER: DropShadow.rx 1.0 (28.12.96). Based on BatchCore.rx 1.2 (1.07.96) Copyright © 1996 Joe Angell, Technomage Productions. Creates a drop shadow, provided an Alpha image and a currently selected main image. See http://www.tmproductions.com/articles/art-dropshadows.html for more information. EMail ideas or bugs to JAngell@TMProductions.com */ options results address PHOTOGENICS.1 /* -------------------- Setup --------------------------------------------------- */ OPENPROGRESS '"Adding Drop Shadow..."' '"Set up... "' /* open the progress */ SETPROGRESS "" 0 /* -------------------- Main Stuff ----------------------------------------------- */ TRACE ?ALL BUFFER /* Get Primary Image Buffer */ image = result ALPHA /* Get Alpha Image Buffer */ alpha = result /* ---------------------- Actually do the processing... ---------------------- */ SETPROGRESS '"Inverting Alpha..."' 7 INVERTALPHA /* Invert the Alpha channel */ /* SETPROGRESS '"Creating Shadow Template..."' 15*/ CLONE alpha /* Clone the Alpha image into Shadow */ shadow = result SETIMAGE alpha /* Take the Alpha image out of the Alpha Channel */ /* ------------------- Make the Shadow into a Shadow ---------------------- */ SETPROGRESS '"Brightening Shadow..."' 23 PAINTMODE shadow "Brightness" /* Set mode to Brightness, value 120 */ MODEOPTS shadow 120 FILLIMAGE shadow /* Fill the image with Brightness */ SETPROGRESS '"Brightening Shadow: Fixing..."' 30 FIX shadow /* Fix the Brightness down */ SETPROGRESS '"Defocusing Shadow, Pass 1..."' 38 PAINTMODE shadow "Defocus" /* Set mode to Defocus, value 2 */ MODEOPTS shadow 2 FILLIMAGE shadow /* First Fill/Fix cycle */ SETPROGRESS '"Defocusing Shadow, Pass 1: Fixing..."' 46 FIX shadow SETPROGRESS '"Defocusing Shadow, Pass 2..."' 53 FILLIMAGE shadow /* Second Fill/Fix cycle */ SETPROGRESS '"Defocusing Shadow, Pass 2: Fixing..."' FIX shadow SETPROGRESS '"Shifting Shadow..."' 61 PAINTMODE shadow "Roll" /* Set mod to Roll, value 5X, 5Y. */ MODEOPTS shadow 5 5 FILLIMAGE shadow /* Fill the image with a Roll */ SETPROGRESS '"Shifting Shadow: Fixing..."' 69 FIX shadow /* Fix the Roll down */ /* ------------------- Merge the Shadow into the Image -------------------- */ SETALPHA alpha SETSECONDARY shadow SETPROGRESS '"Merging Image and Shadow..."' 76 SETIMAGE image PAINTMODE image "RubTexture" /* Set image mode to RubThru, no offset */ MODEOPTS image 0 0 FILLIMAGE image /* Add the shadow to the image with the alpha */ SETPROGRESS '"Merging Image and Shadow: Fixing..."' 84 FIX image /* Fix the shadow in place */ INVERTALPHA /* Set the Alpha as it was */ /* ------------------- Close the images ----------------------------------- */ SETPROGRESS '"Clean Up..."' 92 CLOSE shadow /* Close the Shadow */ CLOSEPROGRESS /* shuts the progress window off and quits the script */ exit