home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD1.iso / GFX / ADPro251-3.DMS / ADPro251-3.adf / FREDScripts.lha / FREDOperators / AdjustBalancing.fred.pre < prev    next >
Encoding:
Text File  |  1994-01-31  |  2.8 KB  |  116 lines

  1. /*
  2. ** AdjustBalancing.fred.pre
  3. **
  4. ** $VER: AdjustBalancing.pre 1.2.0 (23.10.93)
  5. **
  6. ** If the AdjustBalancing.fred script appears in the InvokeADPro list,
  7. ** this program will ask the user to enter the new Balancing settings
  8. ** for all frames.  Alternatively, the user can specify that the program
  9. ** query for frame-specific settings.
  10. **
  11. ** Clips Exported:
  12. **    FREDGlobalModify    -    ~0 if operation is global
  13. **                    0 if it should be frame-specific
  14. **    FREDRedLevel        -    Red component value
  15. **    FREDGreenLevel        -    Green component value
  16. **    FREDBlueLevel        -    Blue component value
  17. **    FREDBrightnessLevel    -    Brightness component value
  18. **    FREDContrastLevel    -    Contrast component value
  19. **    FREDGammaLevel        -    Gamma component value
  20. **
  21. ** NOTE: Clip names are case sensitive.
  22. **
  23. ** This script requires FRED v1.4.0 (or higher) to run.  Also required is
  24. ** ADPro v2.5.0 (or higher).
  25. **
  26. ** Copyright © 1993 ASDG, Incorporated
  27. ** All Rights Reserved
  28. **
  29. ** GAMMA ARexx command changed in ADPRO 2.0.4
  30. ** The new range is -50 to 50, not 0 to 100
  31. ** updated this script Monday 26-Jul-93, joe porkka (After ADPRO 2.3)
  32. */
  33.  
  34.  
  35. ADDRESS "ADPro"
  36. OPTIONS RESULTS
  37.  
  38. PARSE ARG NumberOfCells NumberOfFrames
  39.  
  40. NL = '0A'X
  41. SQ = '27'X
  42. DQ = '22'X
  43. TRUE  = 1
  44. FALSE = 0
  45.  
  46.  
  47. /*
  48. ** Ask if the operation should be done globally or on
  49. ** a frame-by-frame basis.
  50. */
  51.  
  52. ADPRO_TO_FRONT
  53.  
  54. OKAYN '"AdjustBalancing.fred"' '"Do global modification?"' '"Global|Frame-Specific|Cancel"'
  55. IF (RC = 0) THEN DO
  56.     SCREEN_TO_FRONT "FRED"
  57.     EXIT 10
  58. END
  59. ELSE
  60.     GlobalModify = 2 - RC
  61.  
  62. SCREEN_TO_FRONT "FRED"
  63.  
  64.  
  65. /*
  66. ** Ask the user for the new Balancing values.
  67. */
  68.  
  69. IF (GlobalModify ~= 0) THEN DO
  70.     CALL "FREDSCRIPTS:FREDFunctions/GetANumber" '"Red level"' 0 (-50) 50 TRUE
  71.     IF (RESULT = ((-50)-1)) THEN
  72.         EXIT 10
  73.     RedLevel = RESULT
  74.  
  75.     CALL "FREDSCRIPTS:FREDFunctions/GetANumber" '"Green level"' 0 (-50) 50 TRUE
  76.     IF (RESULT = ((-50)-1)) THEN
  77.         EXIT 10
  78.     GreenLevel = RESULT
  79.  
  80.     CALL "FREDSCRIPTS:FREDFunctions/GetANumber" '"Blue level"' 0 (-50) 50 TRUE
  81.     IF (RESULT = ((-50)-1)) THEN
  82.         EXIT 10
  83.     BlueLevel = RESULT
  84.  
  85.     CALL "FREDSCRIPTS:FREDFunctions/GetANumber" '"Brightness level"' 0 (-50) 50 TRUE
  86.     IF (RESULT = ((-50)-1)) THEN
  87.         EXIT 10
  88.     BrightnessLevel = RESULT
  89.  
  90.     CALL "FREDSCRIPTS:FREDFunctions/GetANumber" '"Contrast level"' 0 (-50) 50 TRUE
  91.     IF (RESULT = ((-50)-1)) THEN
  92.         EXIT 10
  93.     ContrastLevel = RESULT
  94.  
  95.     CALL "FREDSCRIPTS:FREDFunctions/GetANumber" '"Gamma level"' 0 (-50) 50 TRUE    /* 50 0 100 -- Pre ADPro 2.0.4 */
  96.     IF (RESULT = ((-50)-1)) THEN
  97.         EXIT 10
  98.     GammaLevel = RESULT
  99.  
  100.     SETCLIP( "FREDRedLevel", RedLevel )
  101.     SETCLIP( "FREDGreenLevel", GreenLevel )
  102.     SETCLIP( "FREDBlueLevel", BlueLevel )
  103.     SETCLIP( "FREDBrightnessLevel", BrightnessLevel )
  104.     SETCLIP( "FREDContrastLevel", ContrastLevel )
  105.     SETCLIP( "FREDGammaLevel", GammaLevel )
  106. END
  107.  
  108.  
  109. /*
  110. ** Update the clips.
  111. */
  112.  
  113. SETCLIP( "FREDGlobalModify", GlobalModify )
  114.  
  115. EXIT 0
  116.