home *** CD-ROM | disk | FTP | other *** search
- /*
- ** SimpleRotate.fred
- **
- ** $VER: SimpleRotate.fred 1.2.0 (23.10.93)
- **
- ** This program can be run from an InvokeADPro list to rotate the current
- ** frame by the previously defined amount. Note that the rotation will be
- ** centered on the image and encompass the entire image.
- **
- ** Clips Imported:
- ** FREDCurrentRotateAmount - Current Rotate amount (degrees)
- ** FREDRotateIncrement - Rotate increment per frame
- **
- ** Clips Exported:
- ** FREDCurrentRotateAmount - Current Rotate 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.
- */
-
- RotateAmount = GETCLIP( "FREDCurrentRotateAmount" )
- IF (RotateAmount = "") THEN DO
- ADPRO_TO_FRONT
- OKAY1 "Required clip, FREDCurrentRotateAmount," || NL ||,
- "is not specified."
- SCREEN_TO_FRONT "FRED"
- EXIT 10
- END
-
- RotateIncrement = GETCLIP( "FREDRotateIncrement" )
- IF (RotateIncrement = "") THEN DO
- ADPRO_TO_FRONT
- OKAY1 "Required clip, FREDRotateIncrement," || 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 Rotate operation, with the rotate circle centered on the image
- ** and encompassing the entire image.
- */
-
- XSIZE
- CenterX = ADPRO_RESULT / 2
-
- YSIZE
- CenterY = ADPRO_RESULT / 2
-
- OPERATOR "ROTATE",
- "CENTER" CenterX CenterY,
- "RADIUS" CenterX + CenterY,
- "AMOUNT" RotateAmount,
- "BLUR_RADIUS" 5,
- "QUALITY_HIGH"
- IF (RC ~= 0) THEN DO
- Why = ADPRO_RESULT
- ADPRO_TO_FRONT
- OKAY1 "The operator ROTATE" || NL ||,
- "failed to execute." || NL ||,
- Why
- SCREEN_TO_FRONT "FRED"
- EXIT 10
- END
-
-
- /*
- ** Update the clips.
- */
-
- SETCLIP( "FREDCurrentRotateAmount", RotateAmount + RotateIncrement )
- SETCLIP( "FREDOverrideLength", 1 )
-
- EXIT 0
-