home *** CD-ROM | disk | FTP | other *** search
- /*
- ** DynamicRange.fred.pre
- **
- ** $VER: DynamicRange.fred.pre 1.2.0 (23.10.93)
- **
- ** If the DynamicRange.fred script appears in the InvokeADPro list,
- ** this program will ask the user to enter the minimum and maximum values
- ** for all frames. Alternatively, the user can specify that the program
- ** query for frame-specific results or only display the current range.
- **
- ** Clips Exported:
- ** FREDTestMode - ~0 if only testing images
- ** 0 if doing actual operation
- ** FREDGlobalModify - ~0 if operation is global
- ** 0 if it should be frame-specific
- ** FREDDynamicRangeMin - Minimum value (default)
- ** FREDDynamicRangeMax - Maximum value (default)
- **
- ** 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 NumberOfCells NumberOfFrames
-
- NL = '0A'X
- SQ = '27'X
- DQ = '22'X
- TRUE = 1
- FALSE = 0
-
-
- ADPRO_TO_FRONT
-
- OKAYN '"DynamicRange.fred"' '"Query range only?"' '"Check|Change|Cancel"'
- IF (RC = 0) THEN DO
- SCREEN_TO_FRONT "FRED"
- EXIT 10
- END
- ELSE
- TestMode = 2 - RC
-
- IF (TestMode = 0) THEN DO
- /*
- ** Ask ask if the operation should be done globally or on
- ** a frame-by-frame basis.
- */
-
- ADPRO_TO_FRONT
-
- OKAYN '"DynamicRange.fred"' '"Do global modification?"' '"Global|Frame-Specific|Cancel"'
- IF (RC = 0) THEN DO
- SCREEN_TO_FRONT "FRED"
- EXIT 10
- END
- ELSE
- GlobalModify = 2 - RC
-
- SCREEN_TO_FRONT "FRED"
-
-
- /*
- ** Ask the user for the new min and max values.
- */
- IF (GlobalModify ~= 0) THEN DO
- CALL "FREDSCRIPTS:FREDFunctions/GetANumber" '"Minimum value"' 0 0 255 TRUE
- IF (RESULT = (0-1)) THEN
- EXIT 10
- RangeMin = RESULT
-
- CALL "FREDSCRIPTS:FREDFunctions/GetANumber" '"Maximum value"' 255 RangeMin 255 TRUE
- IF (RESULT = (RangeMin-1)) THEN
- EXIT 10
- RangeMax = RESULT
- END
- END
-
-
- /*
- ** Update the clips.
- */
-
- SETCLIP( "FREDTestMode", TestMode )
- SETCLIP( "FREDGlobalModify", GlobalModify )
- SETCLIP( "FREDDynamicRangeMin", RangeMin )
- SETCLIP( "FREDDynamicRangeMax", RangeMax )
-
- EXIT 0
-