VTK
vtkMILVideoSource.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkMILVideoSource.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
31 #ifndef __vtkMILVideoSource_h
32 #define __vtkMILVideoSource_h
33 
34 #include "vtkVideoSource.h"
35 
36 // digitizer hardware
37 #define VTK_MIL_DEFAULT 0
38 #define VTK_MIL_METEOR "M_SYSTEM_METEOR"
39 #define VTK_MIL_METEOR_II "M_SYSTEM_METEOR_II"
40 #define VTK_MIL_METEOR_II_DIG "M_SYSTEM_METEOR_II_DIG"
41 #define VTK_MIL_METEOR_II_CL "M_SYSTEM_METEOR_II_CL"
42 #define VTK_MIL_METEOR_II_1394 "M_SYSTEM_METEOR_II_1394"
43 #define VTK_MIL_CORONA "M_SYSTEM_CORONA"
44 #define VTK_MIL_CORONA_II "M_SYSTEM_CORONA_II"
45 #define VTK_MIL_PULSAR "M_SYSTEM_PULSAR"
46 #define VTK_MIL_GENESIS "M_SYSTEM_GENESIS"
47 #define VTK_MIL_GENESIS_PLUS "M_SYSTEM_GENESIS_PLUS"
48 #define VTK_MIL_ORION "M_SYSTEM_ORION"
49 #define VTK_MIL_CRONOS "M_SYSTEM_CRONOS"
50 #define VTK_MIL_ODYSSEY "M_SYSTEM_ODYSSEY"
51 
52 // video inputs:
53 #define VTK_MIL_MONO 0
54 #define VTK_MIL_COMPOSITE 1
55 #define VTK_MIL_YC 2
56 #define VTK_MIL_RGB 3
57 #define VTK_MIL_DIGITAL 4
58 
59 // video formats:
60 #define VTK_MIL_RS170 0
61 #define VTK_MIL_NTSC 1
62 #define VTK_MIL_CCIR 2
63 #define VTK_MIL_PAL 3
64 #define VTK_MIL_SECAM 4
65 #define VTK_MIL_NONSTANDARD 5
66 
68 {
69 public:
70  static vtkMILVideoSource *New();
72  void PrintSelf(ostream& os, vtkIndent indent);
73 
75  void Record();
76 
78  void Play();
79 
81  void Stop();
82 
84  void Grab();
85 
87  void SetFrameSize(int x, int y, int z);
88 
90  void SetOutputFormat(int format);
91 
93 
94  virtual void SetVideoChannel(int channel);
95  vtkGetMacro(VideoChannel, int);
97 
99 
100  virtual void SetVideoFormat(int format);
101  void SetVideoFormatToNTSC() { this->SetVideoFormat(VTK_MIL_NTSC); };
102  void SetVideoFormatToPAL() { this->SetVideoFormat(VTK_MIL_PAL); };
103  void SetVideoFormatToSECAM() { this->SetVideoFormat(VTK_MIL_SECAM); };
104  void SetVideoFormatToRS170() { this->SetVideoFormat(VTK_MIL_RS170); };
105  void SetVideoFormatToCCIR() { this->SetVideoFormat(VTK_MIL_CCIR); };
107  this->SetVideoFormat(VTK_MIL_NONSTANDARD); };
108  vtkGetMacro(VideoFormat,int);
110 
112 
113  virtual void SetVideoInput(int input);
114  void SetVideoInputToMono() { this->SetVideoInput(VTK_MIL_MONO); };
115  void SetVideoInputToComposite() {this->SetVideoInput(VTK_MIL_COMPOSITE);};
116  void SetVideoInputToYC() { this->SetVideoInput(VTK_MIL_YC); };
117  void SetVideoInputToRGB() { this->SetVideoInput(VTK_MIL_RGB); };
118  void SetVideoInputToDigital() { this->SetVideoInput(VTK_MIL_DIGITAL); };
119  vtkGetMacro(VideoInput,int);
121 
123 
126  virtual void SetContrastLevel(float contrast);
127  vtkGetMacro(ContrastLevel,float);
128  virtual void SetBrightnessLevel(float brightness);
129  vtkGetMacro(BrightnessLevel,float);
130  virtual void SetHueLevel(float hue);
131  vtkGetMacro(HueLevel,float);
132  virtual void SetSaturationLevel(float saturation);
133  vtkGetMacro(SaturationLevel,float);
135 
137 
139  virtual void SetBlackLevel(float value);
140  virtual float GetBlackLevel() {
141  return this->BlackLevel; };
142  virtual void SetWhiteLevel(float value);
143  virtual float GetWhiteLevel() {
144  return this->WhiteLevel; };
146 
148 
150  vtkSetStringMacro(MILSystemType);
151  vtkGetStringMacro(MILSystemType);
152  void SetMILSystemTypeToMeteor() { this->SetMILSystemType(VTK_MIL_METEOR); };
153  void SetMILSystemTypeToMeteorII() { this->SetMILSystemType(VTK_MIL_METEOR_II); };
154  void SetMILSystemTypeToMeteorIIDig() { this->SetMILSystemType(VTK_MIL_METEOR_II_DIG); };
155  void SetMILSystemTypeToMeteorIICL() { this->SetMILSystemType(VTK_MIL_METEOR_II_CL); };
156  void SetMILSystemTypeToMeteorII1394() { this->SetMILSystemType(VTK_MIL_METEOR_II_1394); };
157  void SetMILSystemTypeToCorona() { this->SetMILSystemType(VTK_MIL_CORONA); };
158  void SetMILSystemTypeToCoronaII() { this->SetMILSystemType(VTK_MIL_CORONA_II); };
159  void SetMILSystemTypeToPulsar() { this->SetMILSystemType(VTK_MIL_PULSAR); };
160  void SetMILSystemTypeToGenesis() { this->SetMILSystemType(VTK_MIL_GENESIS); };
161  void SetMILSystemTypeToGenesisPlus() { this->SetMILSystemType(VTK_MIL_GENESIS_PLUS); };
162  void SetMILSystemTypeToOrion() { this->SetMILSystemType(VTK_MIL_ORION); };
163  void SetMILSystemTypeToCronos() { this->SetMILSystemType(VTK_MIL_CRONOS); };
164  void SetMILSystemTypeToOdyssey() { this->SetMILSystemType(VTK_MIL_ODYSSEY); };
165  // Description:
166  // Set the system number if you have multiple systems of the same type
167  vtkSetMacro(MILSystemNumber,int);
168  vtkGetMacro(MILSystemNumber,int);
170 
172 
173  vtkSetStringMacro(MILDigitizerDCF);
174  vtkGetStringMacro(MILDigitizerDCF);
176 
178 
179  vtkSetMacro(MILDigitizerNumber,int);
180  vtkGetMacro(MILDigitizerNumber,int);
182 
184 
185  virtual void SetMILErrorMessages(int yesno);
186  vtkBooleanMacro(MILErrorMessages,int);
187  vtkGetMacro(MILErrorMessages,int);
189 
191 
192  vtkSetMacro(MILAppID,long);
193  vtkGetMacro(MILAppID,long);
194  vtkSetMacro(MILSysID,long);
195  vtkGetMacro(MILSysID,long);
196  vtkGetMacro(MILDigID,long);
197  vtkGetMacro(MILBufID,long);
199 
202  void Initialize();
203 
205  void ReleaseSystemResources();
206 
208 
213  void InternalGrab();
215 
216 protected:
219 
220  virtual void AllocateMILDigitizer();
221  virtual void AllocateMILBuffer();
222 
223  virtual char *MILInterpreterForSystem(const char *system);
225 
230 
233  float HueLevel;
235 
236  float BlackLevel;
237  float WhiteLevel;
238 
239  int FrameMaxSize[2];
240 
241  long MILAppID;
242  long MILSysID;
243  long MILDigID;
244  long MILBufID;
245  // long MILDispBufID;
246  // long MILDispID;
247 
250 
253 
255 
258 
260 
264  double CreateTimeStampForFrame(unsigned long frame);
265 
267  unsigned long LastFrameCount;
270 
271 private:
272  vtkMILVideoSource(const vtkMILVideoSource&); // Not implemented.
273  void operator=(const vtkMILVideoSource&); // Not implemented.
274 };
275 
276 #endif