home *** CD-ROM | disk | FTP | other *** search
- /*
- ** SaveAsSUNRASTER.fred
- **
- ** $VER: SaveAsSUNRASTER.fred 1.1.0 (24.10.93)
- **
- ** This program can be run from an InvokeADPro list to save images in
- ** SUNRASTER format. Including this program automatically causes a pre script
- ** to be executed as well (to select the SUNRASTER file extension).
- **
- ** It is up to the user to include the necessary scripts to create raw or
- ** rendered data. This script will only try to save out what you tell it,
- ** and not do any error detecting regarding what type of image data is
- ** available.
- **
- ** Clips Imported:
- ** FREDSUNRASTERSaveType - Image type to save
- ** FREDSUNRASTERSaveCompression - Type of compression to use
- ** FREDSUNRASTERFNameSelect - String describing how the filename
- ** should be modified
- ** FREDSUNRASTERSeqFileSelect - Name of sequence file created
- **
- ** NOTE: Clip names are case sensitive.
- **
- ** This script requires FRED v1.4.0 (or higher) to run. Also required is
- ** ADPro v2.5.0 (or higher) and Professional Conversion Pack v2.1.0
- ** (or higher).
- **
- ** Copyright © 1992-1993 ASDG, Incorporated
- ** All Rights Reserved
- */
-
-
- ADDRESS "ADPro"
- OPTIONS RESULTS
-
- PARSE ARG FrameNum FrameFName Length LoadFlag FirstCallSeq FirstCallCell
-
- NL = '0A'X
- SQ = '27'X
- DQ = '22'X
- TRUE = 1
- FALSE = 0
-
- FrameFName = STRIP(STRIP(FrameFName , "B" , " ") , "B" , '"')
-
-
- /*
- ** Get the required parameters. Error if any are missing.
- */
-
- SaveType = GETCLIP( "FREDSUNRASTERSaveType" )
- IF (SaveType = "") THEN DO
- ADPRO_TO_FRONT
- OKAY1 "Required clip, FREDSUNRASTERSaveType," || NL ||,
- "is not specified."
- SCREEN_TO_FRONT "FRED"
- EXIT 10
- END
-
- SaveCompression = GETCLIP( "FREDSUNRASTERSaveCompression" )
-
- FNameSelect = GETCLIP( "FREDSUNRASTERFNameSelect" )
- IF (FNameSelect = "") THEN DO
- ADPRO_TO_FRONT
- OKAY1 "Required clip, FREDSUNRASTERFNameSelect," || NL ||,
- "is not specified."
- SCREEN_TO_FRONT "FRED"
- EXIT 10
- END
-
- SeqFileSelect = GETCLIP( "FREDSUNRASTERSeqFileSelect" )
- IF (SeqFileSelect = "") THEN DO
- ADPRO_TO_FRONT
- OKAY1 "Required clip, FREDSUNRASTERSeqFileSelect," || NL ||,
- "is not specified."
- SCREEN_TO_FRONT "FRED"
- EXIT 10
- END
-
-
- /*
- ** See what type of data is loaded in ADPro/MorphPlus.
- */
-
- CALL "FREDSCRIPTS:FREDFunctions/CheckForRawImageData" TRUE
- IF (RESULT ~= 0) THEN
- EXIT 10
-
-
- /*
- ** SUNRASTER images cannot be in an Amiga-specific format, such as EHB, HAM, or HAM8.
- */
-
- RENDER_TYPE
- RenderType = ADPRO_RESULT
- IF (RC ~= 0) THEN DO
- ADPRO_TO_FRONT
- OKAY1 "Error retrieving render type."
- SCREEN_TO_FRONT "FRED"
- EXIT 10
- END
-
- IF (RenderType = "EHB") | (RenderType = "HAM") | (RenderType = "HAM8") THEN DO
- ADPRO_TO_FRONT
- OKAY1 RenderType || " images are not supported" || NL ||,
- "as valid SUNRASTER files."
- SCREEN_TO_FRONT "FRED"
- EXIT 10
- END
-
-
- /*
- ** Do the save. If we aren't using the same filename, we will use the
- ** same basename and make every effort possible to replace the
- ** perceived filename extension with the selected SUNRASTER extension.
- */
-
- CALL "FREDSCRIPTS:FREDFunctions/ModifyFilename" FNameSelect '"'FrameFName'"' FrameNum FALSE
- NewFName = '"'RESULT'"'
-
- SAVER "SUNRASTER" NewFName SaveType SaveCompression
- IF (RC ~= 0) THEN DO
- Why = ADPRO_RESULT
- ADPRO_TO_FRONT
- OKAY1 "SUNRASTER save failed:" || NL || Why || NL ||,
- "Argument Information:" || NL ||,
- "Filename = " || NewFName || NL ||,
- "Type = " || SaveType || NL ||,
- "Compression = " || SaveCompression
- SCREEN_TO_FRONT "FRED"
- EXIT 10
- END
-
- CALL "FREDSCRIPTS:FREDFunctions/SeqFileAppend" SeqFileSelect NewFName 1
-
- EXIT 0
-