home *** CD-ROM | disk | FTP | other *** search
- /**********************************************************************/
- /* */
- /* vcr.c : Some simple routines to record images from screen to VCR */
- /* using IRIS. The vcr function library is not included. If */
- /* you wish to record to vcr, please modify the following code*/
- /* */
- /* It's a bit messy, but it's all I have time to do right */
- /* now. (b.k.) */
- /* */
- /* Copyright (C) 1992, Bernard Kwok */
- /* All rights reserved. */
- /* Revision 1.0 */
- /* May, 1992 */
- /**********************************************************************/
- #include <stdio.h>
- #include <gl/gl.h>
- #include <gl/device.h>
- #include <gl/addrs.h>
- #include <gl/cg2vme.h>
- #include "/cs/u/vgrlab/src/lib/VCRlib/VCRlib.h"
- #include "vcr.h"
-
- Vcr_params vcr_params = {
- NTSC, /* Default NTCS size */
- XMAX170, YMAX170
- };
-
- /*
- * Setup parameters for recording
- */
- void vcr_set_mode(mode)
- int mode;
- { vcr_params.mode = mode; }
-
- /*
- * Start recording
- */
- void vcr_start_record()
- {
- if (vcr_params.mode == REC) {
- VCR_open();
- VCR_init(ONE_SHOT_MODE);
- VCR_RECORD();
- VCR_RECORD();
- }
- }
-
- /*
- * Window setup (call before calling winopen). Fixed size at lower left.
- */
- void vcr_setup_window(bord)
- int bord;
- {
- if (!bord)
- noborder();
- prefposition(0,vcr_params.width-1,0,vcr_params.height-1);
- prefsize(vcr_params.width,vcr_params.height);
- maxsize(vcr_params.width,vcr_params.height);
- minsize(vcr_params.width,vcr_params.height);
- }
-
- /*
- * Once window is up, set video parameters
- */
- void vcr_start_video()
- {
- if (vcr_params.mode == REC) {
- setvideo (DE_R1, (long) 0); /* reset the de3 */
- setvideo (DE_R1, DER1_G_170 | DER1_UNBLANK); /* genlocked RS170 */
- setvideo (CG_MODE, 0x2); /* set cg2 to mode 2 */
- }
- }
-
- /*
- * Grab whats on the window. Do after evey draw, and swapbuffer.
- */
- void vcr_grab()
- {
- if (vcr_params.mode == REC) VCR_RECORD();
- }
-
- /*
- * Stop recording
- */
- void vcr_stop_record()
- {
- if (vcr_params.mode == REC) {
- VCR_STOP();
- VCR_close();
- }
- }
-
- /*
- * Reset video parameters
- */
- void vcr_end_video()
- {
- if (vcr_params.mode == REC)
- setvideo (DE_R1, DER1_60HZ | DER1_SYNCG | DER1_UNBLANK);
- }
-
-
-
-
-
-
-