home *** CD-ROM | disk | FTP | other *** search
- /*
- *
- * Relief V 1.1, 1993 Markus Moenig
- *
- * Creates a new project with an relief effect from your source project.
- * Needs AdPro !!
- * The new project will also be in the format of the selected save module.
- *
- * The loader/saver of the source project can be either picture
- * or animation modules.
- *
- * A new project will be opened for the resulting pictures/animation.
- *
- * Thanks to Lutz Fauska for the original relief script.
- */
-
- OPTIONS RESULTS
-
- ADDRESS MAINACTOR
-
- ScreenToFront
- PrintAndStoreTXT "Relief V1.1 ..."
-
- IF ~SHOW('P','ADPro') THEN DO /* if not allready running, start adpro */
- ADDRESS MAINACTOR PrintTXT "Invoking AdPro ..."
- ADDRESS COMMAND 'run >NIL: <NIL: adpro:adpro BEHIND MAXMEM=1000000'
- ADDRESS COMMAND Wait 5
- END
-
- ADDRESS MAINACTOR
-
- GetSPName
-
- IF rc = 0 THEN DO /* check if project loaded */
-
- PARSE VAR RESULT firstname secondname . /* store name of the animation */
- /* or the names of the picture list */
- ScreenToFront
-
- DeSelectAll
-
- GetSPSaver
- PARSE VAR RESULT savertype savername . /* store type, name of saver module */
-
- /* Store general infos of the project */
- GetSPInfo
- PARSE VAR RESULT width height colors pics caching loop cpf .
-
- IF savertype = "PIC" THEN
- picformat=savername
- ELSE DO
- picformat=IFF
- SetSPSaver PIC picformat
- END
-
- ADDRESS "ADPro"
- LFormat "Universal"
- PSTATUS UNLOCKED
- ORIENTATION PORTRAIT
- SFormat picformat
-
- ADDRESS MAINACTOR
-
- RequestSaveFile "Select Name of Project" /* Ask for Project Name */
-
- IF RC = 10 THEN DO
- PrintTXT "Aborting ..."
- EXIT
- END
-
- newname = RESULT /* new name = RESULT */
-
- SelectAll
-
- saveargs=newname
-
- Save saveargs /* Save Pictures */
-
- DO i=1 to pics /* Scale all pics */
-
- actualpic=newname || "." || Right("00000" || i, 5)
- PrintTxt "ADPro adds relief to Picture" i
-
- ADDRESS "ADPro"
- Load actualpic
- RENDER_TYPE colors
- OPERATOR "NEGATIVE"
- Load actualpic 1 1 50 -1 -1 -1
- OPERATOR "COLOR_TO_GRAY"
- CONTRAST 50
- OPERATOR "NEGATIVE"
- Execute
- Save actualpic IMAGE
-
- ADDRESS MAINACTOR
-
- END
-
- IF caching = "CACHING=YES" THEN /* Was the old project cached ? */
-
- OpenNewProject "CACHING" /* If yes new project is also cached */
-
- ELSE
-
- OpenNewProject /* If not new project is not cached */
-
- SetSPLoader PIC picformat /* Set the new projects loader module */
-
- firstpic=newname || "." || Right("00000" || 1, 5)
- lastpic=newname || "." || Right("00000" || pics, 5)
-
- LoadProject firstpic lastpic /* Load picture list */
-
- SetSPSaver savertype savername
-
- IF savertype = "ANIM" THEN DO /* If we wanted a new animation, */
- /* we have to build it */
- SelectAll
- saveargs=newname || " " || cpf || " " || loop
- Save saveargs
- UnloadProject
-
- DO i=1 TO pics /* delete temporary pics */
- actualpic=newname || "." || Right("00000" || i, 5)
- PrintTxt "Delete " || actualpic
- ADDRESS COMMAND "delete " || actualpic || "#?"
- END
-
- SetSPLoader savertype savername
- LoadProject newname
- END
-
- PrintAndStoreTXT "READY !!!!"
- END
-