home *** CD-ROM | disk | FTP | other *** search
- /************************************************************************
-
- NAME demo.c
-
- VERSION 1.00
-
- LAST EDIT Thursday 08-Apr-93 23:50:35
-
- LOCKED BY -
-
- DESCRIPTION demo-functions for Library
-
- HISTORY Author Date Comment
- ---------------------------------------------------
- ds 30-04-93 created
-
- *************************************************************************/
-
- #include <exec/types.h>
- #include <exec/libraries.h>
- #include <proto/exec.h>
- #include <proto/dos.h>
-
- #include "/include/fm.h"
- #include "/include/fmpragma.h"
-
-
- struct Library *FrameMachineBase;
- extern struct Library *SysBase;
- extern struct DOSBase *DOSBase;
-
- VOID main(int argc, char *argv[])
- {
- WORD status;
- WORD xpos, ypos, loop;
-
- FrameMachineBase = OpenLibrary("framemachine.library",0);
- if (FrameMachineBase)
- {
- /* NEVER! Forget to lock FrameMachine! */
- LockFM();
-
- xpos = 0; ypos=0;
- DisplaySize(PDP_360);
- DisplayPos(&xpos, &ypos);
-
- if (PrismAttached())
- {
- /* Show RGB->YUV-Conversation: */
- printf("\nTransfering RGB24-Data to Prism24...\n");
- status = PrepWrite(640,512, WRITE_COLOR, NULL, NULL, NULL);
- if (!status)
- {
- UBYTE r[640],g[640],b[640];
- WORD xloop, yloop;
-
- for (yloop=0; yloop<512 && !status; yloop++)
- {
- /* Make new line of RGB-Data: */
- for (xloop=0; xloop<640; xloop++)
- {
- r[xloop] = xloop;
- g[xloop] = yloop;
- b[xloop] = 0;
- }
-
- status = WriteRGB24Line(r,g,b);
- }
-
- EndWrite();
-
- printf("...done. Errors:%s\n", ExplainStatus(status));
- }
- }
-
- printf("\nToying around with display...\n");
- status = DisplaySize(PDP_360);
- if (!status)
- {
- xpos = 0;
- ypos = 100;
- DisplayPos(&xpos, &ypos);
- }
-
- DigiState(TRUE); /* Activate Digitizer */
- Delay(100);
-
- DigiState(FALSE); /* Hold current frame */
- Delay(100);
- xpos=300;
- ypos= 100;
- DisplayPos(&xpos, &ypos);
-
- DigiState(TRUE); /* Activate Digitizer */
- Delay(100);
-
- SnapShot(); /* make a full resolution snapshot */
- Delay(100);
-
- printf("\nPreviewing...\n");
- status = FastPreview(MD_QUATER);
- printf("...done. Errors:%s\n", ExplainStatus(status));
-
- /* Recording 10 frames to ram: */
- printf("\nRecording 10 frames to 'ram:test.edan'\n");
- if (!status) status = DisplaySize(PDP_360);
- if (!status) status = DigiState(TRUE);
-
- status = PrepSaveEDAN("RAM:test.EDAN", 10, EDAN_COLOR);
- if (!status)
- for (loop=0; loop<10 && !status; loop++)
- status = RecordFrame();
- EndSaveEDAN();
- printf("...done. Errors:%s\n", ExplainStatus(status));
-
- DisplaySize(PDP_720);
- DigiState(TRUE);
- Delay(100);
-
- printf("\nPlaying 10 frames from 'ram:test.edan' in slow motion...\n");
- status = PrepLoadEDAN("ram:test.EDAN", 0);
- while (!status)
- {
- status = NextFrame();
- Delay(25);
- }
- EndLoadEDAN();
- printf("...done. Errors:%s\n", ExplainStatus(status));
-
- printf("\nClearing display...\n");
- status = ClearDisplay();
- printf("...done. Errors:%s\n", ExplainStatus(status));
-
- printf("\n\n Thats all folks!\n");
-
- UnLockFM();
- }
-
-
-
- if (FrameMachineBase) CloseLibrary(FrameMachineBase);
- }
-
-
-
-