/* ** SimpleTwirl.fred ** ** $VER: SimpleTwirl.fred 1.2.0 (23.10.93) ** ** This program can be run from an InvokeADPro list to twirl the current ** frame by the previously defined amount. Note that the twirl will be ** centered on the image and encompass the entire image. ** ** Clips Imported: ** FREDCurrentTwirlAmount - Current Twirl amount (degrees) ** FREDTwirlIncrement - Twirl increment per frame ** ** Clips Exported: ** FREDCurrentTwirlAmount - Current Twirl amount (degrees) ** FREDOverrideLength - Override Length parameter flag ** (if 1, override the Length) ** ** NOTE: Clip names are case sensitive. ** ** This script requires FRED v1.4.0 (or higher) to run. Also required is ** ADPro v2.5.0 (or higher). ** ** Copyright © 1992-1993 ASDG, Incorporated ** All Rights Reserved */ ADDRESS "ADPro" OPTIONS RESULTS PARSE ARG FrameNum FrameFName Length LoadFlag FirstCallSeq FirstCallCell NL = '0A'X SQ = '27'X DQ = '22'X TRUE = 1 FALSE = 0 /* ** Get the required clips. Error if any are missing. */ TwirlAmount = GETCLIP( "FREDCurrentTwirlAmount" ) IF (TwirlAmount = "") THEN DO ADPRO_TO_FRONT OKAY1 "Required clip, FREDCurrentTwirlAmount," || NL ||, "is not specified." SCREEN_TO_FRONT "FRED" EXIT 10 END TwirlIncrement = GETCLIP( "FREDTwirlIncrement" ) IF (TwirlIncrement = "") THEN DO ADPRO_TO_FRONT OKAY1 "Required clip, FREDTwirlIncrement," || NL ||, "is not specified." SCREEN_TO_FRONT "FRED" EXIT 10 END /* ** See what type of data is loaded in ADPro/MorphPlus. */ CALL "FREDSCRIPTS:FREDFunctions/CheckForRawImageData" TRUE IF (RESULT ~= 0) THEN EXIT 10 /* ** Do the Twirl operation, with the twirl circle centered on the image ** and encompassing the entire image. */ XSIZE CenterX = ADPRO_RESULT / 2 YSIZE CenterY = ADPRO_RESULT / 2 OPERATOR "TWIRL", "CENTER" CenterX CenterY, "RADIUS" CenterX + CenterY, "AMOUNT" TwirlAmount, "BLUR_RADIUS" 5, "QUALITY_HIGH" IF (RC ~= 0) THEN DO Why = ADPRO_RESULT ADPRO_TO_FRONT OKAY1 "The operator TWIRL" || NL ||, "failed to execute." || NL ||, Why SCREEN_TO_FRONT "FRED" EXIT 10 END /* ** Update the clips. */ SETCLIP( "FREDCurrentTwirlAmount", TwirlAmount + TwirlIncrement ) SETCLIP( "FREDOverrideLength", 1 ) EXIT 0