home *** CD-ROM | disk | FTP | other *** search
- /*
- -----------------------------------------------------------------------------
- This AREXX-Script will morph any image by any number of frames to any image.
- The endmorph-image and the number of frames must be specified by the user
- in the arguments .
- Warning! The number of colors is determined by the 2nd argument!
-
- Host address: ADPro (Art Department Professional ®ASDG)
- Written by Jan Van Overbeke, 3-DEE, ©1993.
- Read the AREXX-Scripti doc, for more information about operation and rights!
- -----------------------------------------------------------------------------
- */
-
- arg filename endmorphname frames
- if ~exists(filename)|filename='' then do
- say 'Unable to find the image !!'
- say 'See Ya...'
- say ''
- exit
- end
-
- /* ---- If the 2nd argument does not have a path, ---- */
- /* ---- we'll have to give it one. ---- */
- /* --------------------------------------------------- */
- endmorph=endmorphname
- if pos('/',endmorphname)=0 & pos(':',endmorphname)=0 then do
- endpath=lastpos('/',filename)
- if endpath=0 then endpath=lastpos(':',filename)
- endmorph=delstr(filename,endpath+1)||endmorphname
- end
-
- if ~exists(endmorph) then do
- say 'Unable to find the endmorph image.'
- say 'End of program.'
- say ''
- exit
- end
- if frames<1|frames>9999 then do
- say 'Invalid argument: frames out of range.'
- say 'See Ya......'
- say ''
- exit
- end
-
- options results
- address 'ADPro'
- say 'Morph: Written by JAN VAN OVERBEKE, 3-DEE, ©1993'
- say 'Image: 'filename
- say 'Endmorph: 'endmorph
- say 'Frames-in-between: 'frames
- say 'SAVE: IFF Original Colors of the endmorph (!)'
- say ''
-
- SFORMAT "IFF"
- if RC~=0 then do
- say 'Unable to select the IFF saver!'
- say 'See Ya......'
- say ''
- exit
- end
-
- LFORMAT "UNIVERSAL"
- if RC ~=0 then do
- say 'Unable to select the UNIVERSAL loader.'
- say 'See Ya...'
- say ''
- exit
- end
-
- /* ---- One test needs one load! ---- */
- /* ---------------------------------- */
- percent=trunc(100/(frames+1))
- say 'Loading1 for 'percent'%.........'
- first='ok'
- load endmorph
- if RC~=0 then do
- say 'Unable to load the enmorph!'
- say 'See Ya......'
- say ''
- exit
- end
-
- /* ---- Get some info about image: 24Bit? Gray? ---- */
- /* ------------------------------------------------- */
- IMAGE
- help=ADPRO_RESULT
- dontrender='ok'
- graymode='no'
- if pos('Rendered',help)>0 | pos('BITPLANE',help)>0 then dontrender='nok'
- if pos('GRAY',help)>0 then graymode='yes'
- render_type
- colors=ADPRO_RESULT
-
- do t=1 to frames
- percent=trunc(t*100/(frames+1))
-
- if first='nok' then do
- say 'Loading1 for 'percent'%.........'
- LOAD endmorph
- if RC ~=0 then do
- say 'Had some problems while loading the endmorph.'
- say 'See Ya...'
- say ''
- exit
- end
- end
- first='nok'
-
- /* ---- ADPro doesn't allow to overlay color on gray ---- */
- /* ------------------------------------------------------ */
- if graymode='yes' then do
- say 'Setting Color data.....'
- operator Gray_To_Color
- if RC~=0 then do
- say 'Gray_To_Color failed!!!'
- say 'See Ya.....'
- say ''
- exit
- end
- end
-
- say 'Loading 2ndPart....'
- LOAD filename 0 0 percent -1 -1 -1
- if RC ~=0 then do
- say 'Had some problems while loading the image.'
- say 'See Ya.'
- say ''
- exit
- end
-
- /* ---- Make the palette fit the image ---- */
- /* ---- and render a new one ---- */
- /* ---- if we do need one ---- */
- /* ---------------------------------------- */
- if dontrender='nok' then do
- say 'Converting......'
- savemode='IMAGE'
- render_type colors
- palette=0
- if colors='HAM' then palette=16
- if colors='HAM8' then palette=64
- if palette=0 then palette=colors
- ptotal palette
- pused palette
- execute
- if RC ~= 0 then do
- say 'Execute failed.'
- say 'See Ya...'
- say ''
- exit
- end
- say 'Saving IMAGE 'colors'.....'
- end
- else do
- savemode='RAW'
- say 'Saving RAW......'
- end
-
- say ''
- dest=filename'.'percent'%'
- SAVE dest savemode
- if RC~=0 then do
- say 'Problems while saving: NOT SAVED.'
- say 'See Ya...'
- say ''
- exit
- end
- end
- say ''
- exit
-