home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD1.iso / GFX / Converter / BB_IENG3.LZX / ImageEngineerV3.0 / ARexx / EdgeEffect.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  1996-04-24  |  2.1 KB  |  92 lines

  1. /*********************************/
  2. /* Image Engineer Macro script   */
  3. /* by Simon Edwards              */
  4. /* 27/3/96                       */
  5. /*                               */
  6. /* Edge Effect                   */
  7. /*********************************/
  8.  
  9. Options results
  10. signal on error            /* Setup a place for errors to go */
  11.  
  12. if arg()==0 then exit
  13.  
  14. project_info arg(1) WIDTH
  15. width=RESULT
  16. project_info arg(1) HEIGHT
  17. height=RESULT
  18.  
  19. 'REQUEST "Image to use for alpha channel" "Spherical|Spherical2|Gradient|Highlight|Highlight2"'
  20. reply=RESULT
  21.  
  22. select
  23.     when reply=1 then alphaname='IE:alpha/Spherical.alpha'
  24.     when reply=2 then alphaname='IE:alpha/Spherical2.alpha'
  25.     when reply=3 then alphaname='IE:alpha/Gradient.alpha'
  26.     when reply=4 then alphaname='IE:alpha/highlight.alpha'
  27.     when reply=0 then alphaname='IE:alpha/highlight2.alpha'
  28. end
  29.  
  30. 'OPEN "'||alphaname||'" 8BIT'
  31. alphachannel=result
  32. SCALE alphachannel width height BEST
  33. newalpha=result
  34. CLOSE alphachannel
  35.  
  36. 'GET_FILE "Choose Image to apply to edge" "Ok"'
  37. edgeeffectname=RESULT
  38.  
  39. 'OPEN "'||edgeeffectname||'" 8BIT'
  40. edgeimage=RESULT
  41.  
  42. RESIZE edgeimage width height TILE
  43. newedgeimage=RESULT
  44. CLOSE edgeimage
  45.  
  46. HISTOGRAM_EQUALIZATION newedgeimage
  47. edgeimage=RESULT
  48. CLOSE newedgeimage
  49.  
  50. CONTRAST_STRETCH edgeimage
  51. newedgeimage=RESULT
  52. CLOSE edgeimage
  53.  
  54. 'CONTRAST '||newedgeimage||' -1'
  55. edgeimage=RESULT
  56. CLOSE newedgeimage
  57.  
  58. MARK edgeimage PRIMARY
  59. MARK newalpha ALPHA
  60. HALFTONE
  61. resultalpha=RESULT
  62.  
  63. CLOSE newalpha
  64. CLOSE edgeimage
  65.  
  66. NEGATIVE resultalpha
  67. newalpha=RESULT
  68.  
  69. CLOSE resultalpha
  70.  
  71. MARK newalpha ALPHA
  72.  
  73. exit
  74.  
  75. /*******************************************************************/
  76. /* This is where control goes when an error code is returned by IE */
  77. /* It puts up a message saying what happened and on which line     */
  78. /*******************************************************************/
  79. error:
  80. if RC=5 then do            /* Did the user just cancel us? */
  81.     IE_TO_FRONT
  82.     LAST_ERROR
  83.     'REQUEST "'||RESULT||'"'
  84.     exit
  85. end
  86. else do
  87.     IE_TO_FRONT
  88.     LAST_ERROR
  89.     'REQUEST "Error detected!!!'||D2C(10)||'Image Engineer error message is as follows'||D2C(10)||result||D2C(10)||'Script failed on line '||SIGL||'"' 'Doh!'
  90.     exit
  91. end
  92.