home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD1.iso / GFX / Converter / AD2.55-C.DMS / in.adf / FREDScripts.lha / FREDOperators / Saturation.fred.pre < prev    next >
Encoding:
Text File  |  1994-01-31  |  2.0 KB  |  99 lines

  1. /*
  2. ** Saturation.fred.pre
  3. **
  4. ** $VER: Saturation.fred.pre 1.1.0 (23.10.93)
  5. **
  6. ** If the Saturation.fred script appears in the InvokeADPro list,
  7. ** this program will ask the user for the type and amount of saturation.
  8. **
  9. ** Clips Exported:
  10. **    FREDSaturationType    -    Type of saturation.
  11. **    FREDSaturationAmt    -    Amount of saturation.
  12. **
  13. ** NOTE: Clip names are case sensitive.
  14. **
  15. ** This script requires FRED v1.4.0 (or higher) to run.  Also required is
  16. ** ADPro v2.5.0 (or higher).
  17. **
  18. ** Copyright © 1993 ASDG, Incorporated
  19. ** All Rights Reserved
  20. */
  21.  
  22.  
  23. ADDRESS "ADPro"
  24. OPTIONS RESULTS
  25.  
  26. PARSE ARG NumberOfCells NumberOfFrames
  27.  
  28. NL = '0A'X
  29. SQ = '27'X
  30. DQ = '22'X
  31. TRUE  = 1
  32. FALSE = 0
  33.  
  34.  
  35. /*
  36. ** Ask the user which type of saturation should be used.
  37. */
  38.  
  39. SaturationID.0 = "HSV"
  40. SaturationID.1 = "HLS"
  41. SaturationID.2 = "YUV"
  42. MinSaturationID = 0
  43. MaxSaturationID = 2
  44. DefSaturationID = 0
  45.  
  46. String = '"' || SaturationID.DefSaturationID || '"'
  47. DO LoopCounter = MinSaturationID TO MaxSaturationID
  48.     String = String '"' || SaturationID.LoopCounter || '"'
  49. END
  50.  
  51. continue = 0
  52. DO UNTIL (continue = 1)
  53.     ADPRO_TO_FRONT
  54.  
  55.     LISTVIEW '"Saturation Types:"' (MaxSaturationID-MinSaturationID+1) ITEMS String
  56.     LISTVIEW_RC = RC
  57.     PARSE VAR ADPRO_RESULT '"'SaturationTypeStr'"' scratch
  58.  
  59.     IF (LISTVIEW_RC ~= 0) & (LISTVIEW_RC ~= 1) THEN DO
  60.         ADPRO_TO_FRONT
  61.  
  62.         OKAYN '"Saturation.fred"' '"This value is required."' '"Retry|Cancel"'
  63.         IF (RC = 0) THEN
  64.             EXIT 10
  65.     END
  66.     ELSE
  67.         continue = 1
  68. END
  69.  
  70. SaturationSelected = MinSaturationID
  71. DO WHILE (SaturationSelected <= MaxSaturationID) & (COMPARE( SaturationTypeStr, SaturationID.SaturationSelected ) ~= 0)
  72.     SaturationSelected = SaturationSelected + 1
  73. END
  74.  
  75. SaturationType = SaturationID.SaturationSelected
  76.  
  77. SCREEN_TO_FRONT "FRED"
  78.  
  79.  
  80. /*
  81. ** Ask the user for the amount of saturation.
  82. */
  83.  
  84. CALL "FREDSCRIPTS:FREDFunctions/GetANumber" '"Saturation Amount?"' 0 (-100) 9999 TRUE
  85. IF (RESULT = ((-100)-1)) THEN
  86.     EXIT
  87. ELSE
  88.     SaturationAmt = RESULT
  89.  
  90.  
  91. /*
  92. ** Update the clips.
  93. */
  94.  
  95. SETCLIP( "FREDSaturationType", SaturationType )
  96. SETCLIP( "FREDSaturationAmt", SaturationAmt )
  97.  
  98. EXIT 0
  99.