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

  1. /*
  2. ** Blur.fred
  3. **
  4. ** $VER: Blur.fred 1.2.0 (23.10.93)
  5. **
  6. ** This program can be run from an InvokeADPro list to blur the current
  7. ** frame or test how many pixels will be affected using the defined
  8. ** blur settings.
  9. **
  10. ** Clips Imported:
  11. **    FREDCenterWeight    -    Center weight value
  12. **    FREDThreshold        -    Threshold value
  13. **    FREDTestMode        -    ~0 if only testing images
  14. **                    0 if doing actual operation
  15. **
  16. ** NOTE: Clip names are case sensitive.
  17. **
  18. ** This script requires FRED v1.4.0 (or higher) to run.  Also required is
  19. ** ADPro v2.5.0 (or higher).
  20. **
  21. ** Copyright © 1993 ASDG, Incorporated
  22. ** All Rights Reserved
  23. */
  24.  
  25.  
  26. ADDRESS "ADPro"
  27. OPTIONS RESULTS
  28.  
  29. PARSE ARG FrameNum FrameFName Length LoadFlag FirstCallSeq FirstCallCell
  30.  
  31. NL = '0A'X
  32. SQ = '27'X
  33. DQ = '22'X
  34. TRUE = 1
  35. FALSE = 0
  36.  
  37.  
  38. /*
  39. ** Get the required clips.  Error if any are missing.
  40. */
  41.  
  42. CenterWeight = GETCLIP( "FREDCenterWeight" )
  43. IF (CenterWeight = "") THEN DO
  44.     ADPRO_TO_FRONT
  45.     OKAY1 "Required clip, FREDCenterWeight," || NL ||,
  46.         "is not specified."
  47.     SCREEN_TO_FRONT "FRED"
  48.     EXIT 10
  49. END
  50.  
  51. Threshold = GETCLIP( "FREDThreshold" )
  52. IF (Threshold = "") THEN DO
  53.     ADPRO_TO_FRONT
  54.     OKAY1 "Required clip, FREDThreshold," || NL ||,
  55.         "is not specified."
  56.     SCREEN_TO_FRONT "FRED"
  57.     EXIT 10
  58. END
  59.  
  60. TestMode = GETCLIP( "FREDTestMode" )
  61. IF (TestMode = "") THEN DO
  62.     ADPRO_TO_FRONT
  63.     OKAY1 "Required clip, FREDTestMode," || NL ||,
  64.         "is not specified."
  65.     SCREEN_TO_FRONT "FRED"
  66.     EXIT 10
  67. END
  68.  
  69.  
  70. /*
  71. ** See what type of data is loaded in ADPro/MorphPlus.
  72. */
  73.  
  74. CALL "FREDSCRIPTS:FREDFunctions/CheckForRawImageData" TRUE
  75. IF (RESULT ~= 0) THEN
  76.     EXIT 10
  77.  
  78.  
  79. /*
  80. ** Do the Blur operation.  If we're only doing a test, display the
  81. ** results on the ADPro/MorphPlus screen.
  82. */
  83.  
  84. IF (TestMode = 0) THEN DO
  85.     OPERATOR "BLUR" CenterWeight Threshold
  86.     Why = ADPRO_RESULT
  87.     IF (RC ~= 0) THEN DO
  88.         ADPRO_TO_FRONT
  89.         OKAY1 "The operator BLUR" || NL ||,
  90.             "failed to execute." || NL ||,
  91.             Why || NL ||,
  92.             "Argument Information:" || NL ||,
  93.             "CenterWeight = " || CenterWeight || NL ||,
  94.             "Threshold = " || Threshold
  95.         SCREEN_TO_FRONT "FRED"
  96.         EXIT 10
  97.     END
  98. END
  99. ELSE IF (TestMode = 1) THEN DO
  100.     OPERATOR "BLUR" CenterWeight Threshold "TEST"
  101.     Why = ADPRO_RESULT
  102.     IF (RC ~= 0) THEN DO
  103.         ADPRO_TO_FRONT
  104.         OKAY1 "The operator BLUR" || NL ||,
  105.             "failed to execute." || NL ||,
  106.             Why || NL ||,
  107.             "Argument Information:" || NL ||,
  108.             "CenterWeight = " || CenterWeight || NL ||,
  109.             "Threshold = " || Threshold
  110.         SCREEN_TO_FRONT "FRED"
  111.         EXIT 10
  112.     END
  113.  
  114.     ADPRO_TO_FRONT
  115.     OKAY1 "Frame# " || FrameNum || NL ||,
  116.         FrameFName || NL || NL ||,
  117.         Why || " Pixels Affected"
  118.     SCREEN_TO_FRONT "FRED"
  119. END
  120.  
  121. EXIT 0
  122.