~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Linux Cross Reference
Tina4/src/tools/fgrabber/grab_tool.c

Version: ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2 
  3 Grab_Tool: grab.c
  4 
  5 Tinatool for grabbing images from the DASM box via the DASMServer
  6 
  7 Author: A.J.Lacey
  8 Date:   28-1-93; version 1.0
  9                 15.1.96; version 2.0
 10 
 11 */
 12 
 13 #include <stdio.h>
 14 #include <tina/sys.h>
 15 #include <tina/sysfuncs.h>
 16 #include <tina/math.h>
 17 #include <tina/mathfuncs.h>
 18 #include <tina/grabdefs.h>
 19 #include <tina/grabsrv.h>
 20 #include <tina/grabpro.h>
 21 
 22 
 23 static Grabber *params = NULL;
 24 
 25 
 26 void    im_type_set(int type)
 27 {
 28         params->st_pair = type;
 29 }
 30 
 31 
 32 
 33 void    im_format_set(int type)
 34 {
 35         params->format = type;
 36 }
 37 
 38 
 39 void    device_set(int type)
 40 {
 41         params->device = type;
 42 }
 43 
 44 
 45 
 46 void     grab_go(void)
 47 {
 48         switch (params->device)
 49         {
 50                 case DASM:
 51                         strcpy(params->service, DASM_SERVICE);
 52                         strcpy(params->host, DASM_HOST);
 53                         dasm_grab(params);
 54                         break;
 55 
 56                 case S2200:
 57                         strcpy(params->service, S2200_SERVICE);
 58                         strcpy(params->host, S2200_HOST);
 59                         format("Grabtool: S2200 not yet supported\n");
 60                         break;
 61 
 62                 case VPIX:
 63                         strcpy(params->service, VPIX_SERVICE);
 64                         strcpy(params->host, VPIX_HOST);
 65                         format("Grabtool: VPIX not yet supported\n");
 66                         break;
 67         }
 68 
 69 }
 70 
 71 
 72 
 73 void            image_params_dialog(void)
 74 {
 75         static int dialog = 0;
 76 
 77         if (dialog)
 78         {
 79                 tw_show_dialog(dialog);
 80                 return;
 81         }
 82 
 83         dialog = tw_dialog("Image Params");
 84 
 85         tw_iglobal("Width   :", &(params->width), 10);
 86         tw_newrow();
 87         tw_iglobal("Height  :", &(params->length), 10);
 88         tw_newrow();
 89         tw_iglobal("Spacing :", &(params->spacing), 10);
 90         tw_newrow();
 91         tw_iglobal("Number  :", &(params->number), 10);
 92 
 93         tw_end_dialog();
 94 }
 95 
 96 
 97 
 98 
 99 void            grab_tool(int x, int y)
100 {
101         static int tool = 0;
102 
103     if (tool)
104     {
105                 tw_show_tool(tool);
106                 return;
107     }
108 
109         if ((params = grstruct_alloc(params)) != NULL)
110         {
111                 params = init_grstruct(params);
112         tool = tw_tool("Grab Tool", x, y);
113 
114                 tw_sglobal("File Name :", params->filename, 30);
115                 tw_newrow();
116                 tw_choice("File Format ", im_format_set, 0, "AIFF", "PGM", "MaGIK", "RAW", NULL);
117                 tw_newrow();
118                 tw_choice("Image Type ", im_type_set, 0, "Mono", "Stereo", NULL);
119                 tw_newrow();
120                 tw_choice("Device ", device_set, 0, "Dasm", "S2200", "VideoPix", NULL);
121                 tw_newrow();
122                 tw_button("Image Params", image_params_dialog, NULL);
123                 tw_newrow();
124                 tw_button("Configure Dasm", dasm_config, params);       
125                 tw_button("GO", grab_go, params);
126 
127         tw_end_tool();
128         }
129 
130 }
131 
132 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.