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 =========================================================================*/
32 #ifndef vtkMILVideoSource_h
33 #define vtkMILVideoSource_h
34 
35 #include "vtkIOVideoModule.h" // For export macro
36 #include "vtkVideoSource.h"
37 
38 // digitizer hardware
39 #define VTK_MIL_DEFAULT 0
40 #define VTK_MIL_METEOR "M_SYSTEM_METEOR"
41 #define VTK_MIL_METEOR_II "M_SYSTEM_METEOR_II"
42 #define VTK_MIL_METEOR_II_DIG "M_SYSTEM_METEOR_II_DIG"
43 #define VTK_MIL_METEOR_II_CL "M_SYSTEM_METEOR_II_CL"
44 #define VTK_MIL_METEOR_II_1394 "M_SYSTEM_METEOR_II_1394"
45 #define VTK_MIL_CORONA "M_SYSTEM_CORONA"
46 #define VTK_MIL_CORONA_II "M_SYSTEM_CORONA_II"
47 #define VTK_MIL_PULSAR "M_SYSTEM_PULSAR"
48 #define VTK_MIL_GENESIS "M_SYSTEM_GENESIS"
49 #define VTK_MIL_GENESIS_PLUS "M_SYSTEM_GENESIS_PLUS"
50 #define VTK_MIL_ORION "M_SYSTEM_ORION"
51 #define VTK_MIL_CRONOS "M_SYSTEM_CRONOS"
52 #define VTK_MIL_ODYSSEY "M_SYSTEM_ODYSSEY"
53 
54 // video inputs:
55 #define VTK_MIL_MONO 0
56 #define VTK_MIL_COMPOSITE 1
57 #define VTK_MIL_YC 2
58 #define VTK_MIL_RGB 3
59 #define VTK_MIL_DIGITAL 4
60 
61 // video formats:
62 #define VTK_MIL_RS170 0
63 #define VTK_MIL_NTSC 1
64 #define VTK_MIL_CCIR 2
65 #define VTK_MIL_PAL 3
66 #define VTK_MIL_SECAM 4
67 #define VTK_MIL_NONSTANDARD 5
68 
69 class VTKIOVIDEO_EXPORT vtkMILVideoSource : public vtkVideoSource
70 {
71 public:
72  static vtkMILVideoSource* New();
74  void PrintSelf(ostream& os, vtkIndent indent);
75 
79  void Record() override;
80 
84  void Play() override;
85 
89  void Stop() override;
90 
94  void Grab() override;
95 
99  void SetFrameSize(int x, int y, int z) override;
100 
104  void SetOutputFormat(int format) override;
105 
107 
110  virtual void SetVideoChannel(int channel);
111  vtkGetMacro(VideoChannel, int);
113 
115 
118  virtual void SetVideoFormat(int format);
119  void SetVideoFormatToNTSC() { this->SetVideoFormat(VTK_MIL_NTSC); }
120  void SetVideoFormatToPAL() { this->SetVideoFormat(VTK_MIL_PAL); }
121  void SetVideoFormatToSECAM() { this->SetVideoFormat(VTK_MIL_SECAM); }
122  void SetVideoFormatToRS170() { this->SetVideoFormat(VTK_MIL_RS170); }
123  void SetVideoFormatToCCIR() { this->SetVideoFormat(VTK_MIL_CCIR); }
124  void SetVideoFormatToNonStandard() { this->SetVideoFormat(VTK_MIL_NONSTANDARD); }
125  vtkGetMacro(VideoFormat, int);
127 
129 
132  virtual void SetVideoInput(int input);
133  void SetVideoInputToMono() { this->SetVideoInput(VTK_MIL_MONO); }
134  void SetVideoInputToComposite() { this->SetVideoInput(VTK_MIL_COMPOSITE); }
135  void SetVideoInputToYC() { this->SetVideoInput(VTK_MIL_YC); }
136  void SetVideoInputToRGB() { this->SetVideoInput(VTK_MIL_RGB); }
137  void SetVideoInputToDigital() { this->SetVideoInput(VTK_MIL_DIGITAL); }
138  vtkGetMacro(VideoInput, int);
140 
142 
149  virtual void SetContrastLevel(float contrast);
150  vtkGetMacro(ContrastLevel, float);
151  virtual void SetBrightnessLevel(float brightness);
152  vtkGetMacro(BrightnessLevel, float);
153  virtual void SetHueLevel(float hue);
154  vtkGetMacro(HueLevel, float);
155  virtual void SetSaturationLevel(float saturation);
156  vtkGetMacro(SaturationLevel, float);
158 
160 
164  virtual void SetBlackLevel(float value);
165  virtual float GetBlackLevel() { return this->BlackLevel; }
166  virtual void SetWhiteLevel(float value);
167  virtual float GetWhiteLevel() { return this->WhiteLevel; }
169 
171 
175  vtkSetStringMacro(MILSystemType);
176  vtkGetStringMacro(MILSystemType);
177  void SetMILSystemTypeToMeteor() { this->SetMILSystemType(VTK_MIL_METEOR); }
178  void SetMILSystemTypeToMeteorII() { this->SetMILSystemType(VTK_MIL_METEOR_II); }
179  void SetMILSystemTypeToMeteorIIDig() { this->SetMILSystemType(VTK_MIL_METEOR_II_DIG); }
180  void SetMILSystemTypeToMeteorIICL() { this->SetMILSystemType(VTK_MIL_METEOR_II_CL); }
181  void SetMILSystemTypeToMeteorII1394() { this->SetMILSystemType(VTK_MIL_METEOR_II_1394); }
182  void SetMILSystemTypeToCorona() { this->SetMILSystemType(VTK_MIL_CORONA); }
183  void SetMILSystemTypeToCoronaII() { this->SetMILSystemType(VTK_MIL_CORONA_II); }
184  void SetMILSystemTypeToPulsar() { this->SetMILSystemType(VTK_MIL_PULSAR); }
185  void SetMILSystemTypeToGenesis() { this->SetMILSystemType(VTK_MIL_GENESIS); }
186  void SetMILSystemTypeToGenesisPlus() { this->SetMILSystemType(VTK_MIL_GENESIS_PLUS); }
187  void SetMILSystemTypeToOrion() { this->SetMILSystemType(VTK_MIL_ORION); }
188  void SetMILSystemTypeToCronos() { this->SetMILSystemType(VTK_MIL_CRONOS); }
189  void SetMILSystemTypeToOdyssey() { this->SetMILSystemType(VTK_MIL_ODYSSEY); }
191 
192 
195  vtkSetMacro(MILSystemNumber, int);
196  vtkGetMacro(MILSystemNumber, int);
198 
200 
203  vtkSetStringMacro(MILDigitizerDCF);
204  vtkGetStringMacro(MILDigitizerDCF);
206 
208 
211  vtkSetMacro(MILDigitizerNumber, int);
212  vtkGetMacro(MILDigitizerNumber, int);
214 
216 
219  virtual void SetMILErrorMessages(int yesno);
220  vtkBooleanMacro(MILErrorMessages, int);
221  vtkGetMacro(MILErrorMessages, int);
223 
225 
228  vtkSetMacro(MILAppID, long);
229  vtkGetMacro(MILAppID, long);
230  vtkSetMacro(MILSysID, long);
231  vtkGetMacro(MILSysID, long);
232  vtkGetMacro(MILDigID, long);
233  vtkGetMacro(MILBufID, long);
235 
240  void Initialize() override;
241 
246  void ReleaseSystemResources() override;
247 
249 
256  void InternalGrab() override;
258 
259 protected:
261  ~vtkMILVideoSource() override;
262 
263  virtual void AllocateMILDigitizer();
264  virtual void AllocateMILBuffer();
265 
266  virtual char* MILInterpreterForSystem(const char* system);
268 
273 
276  float HueLevel;
278 
279  float BlackLevel;
280  float WhiteLevel;
281 
282  int FrameMaxSize[2];
283 
284  long MILAppID;
285  long MILSysID;
286  long MILDigID;
287  long MILBufID;
288  // long MILDispBufID;
289  // long MILDispID;
290 
293 
296 
298 
301 
303 
310  double CreateTimeStampForFrame(unsigned long frame);
311 
313  unsigned long LastFrameCount;
316 
317 private:
318  vtkMILVideoSource(const vtkMILVideoSource&) = delete;
319  void operator=(const vtkMILVideoSource&) = delete;
320 };
321 
322 #endif
vtkMILVideoSource::EstimatedFramePeriod
double EstimatedFramePeriod
Definition: vtkMILVideoSource.h:314
vtkMILVideoSource::SetVideoFormatToNTSC
void SetVideoFormatToNTSC()
Definition: vtkMILVideoSource.h:119
VTK_MIL_PULSAR
#define VTK_MIL_PULSAR
Definition: vtkMILVideoSource.h:47
vtkMILVideoSource::VideoInputForColor
int VideoInputForColor
Definition: vtkMILVideoSource.h:271
vtkVideoSource::Play
virtual void Play()
Play through the 'tape' sequentially at the specified frame rate.
vtkMILVideoSource::MILSysID
long MILSysID
Definition: vtkMILVideoSource.h:285
vtkMILVideoSource::SetMILSystemTypeToGenesisPlus
void SetMILSystemTypeToGenesisPlus()
Definition: vtkMILVideoSource.h:186
vtkMILVideoSource::SetVideoInputToComposite
void SetVideoInputToComposite()
Definition: vtkMILVideoSource.h:134
vtkMILVideoSource::SetMILSystemTypeToPulsar
void SetMILSystemTypeToPulsar()
Definition: vtkMILVideoSource.h:184
vtkVideoSource::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
VTK_MIL_YC
#define VTK_MIL_YC
Definition: vtkMILVideoSource.h:57
vtkMILVideoSource::SetMILSystemTypeToMeteorIIDig
void SetMILSystemTypeToMeteorIIDig()
Definition: vtkMILVideoSource.h:179
vtkMILVideoSource::SetMILSystemTypeToCronos
void SetMILSystemTypeToCronos()
Definition: vtkMILVideoSource.h:188
vtkX3D::value
Definition: vtkX3D.h:226
VTK_MIL_METEOR_II
#define VTK_MIL_METEOR_II
Definition: vtkMILVideoSource.h:41
vtkMILVideoSource::FatalMILError
int FatalMILError
Definition: vtkMILVideoSource.h:302
VTK_MIL_PAL
#define VTK_MIL_PAL
Definition: vtkMILVideoSource.h:65
vtkMILVideoSource::MILSystemNumber
int MILSystemNumber
Definition: vtkMILVideoSource.h:292
vtkMILVideoSource::BlackLevel
float BlackLevel
Definition: vtkMILVideoSource.h:279
vtkVideoSource::InternalGrab
virtual void InternalGrab()
The internal function which actually does the grab.
vtkMILVideoSource::LastTimeStamp
double LastTimeStamp
Definition: vtkMILVideoSource.h:312
vtkMILVideoSource::SetMILSystemTypeToMeteorIICL
void SetMILSystemTypeToMeteorIICL()
Definition: vtkMILVideoSource.h:180
VTK_MIL_METEOR_II_1394
#define VTK_MIL_METEOR_II_1394
Definition: vtkMILVideoSource.h:44
VTK_MIL_RS170
#define VTK_MIL_RS170
Definition: vtkMILVideoSource.h:62
vtkVideoSource.h
vtkMILVideoSource::SaturationLevel
float SaturationLevel
Definition: vtkMILVideoSource.h:277
vtkMILVideoSource::SetMILSystemTypeToGenesis
void SetMILSystemTypeToGenesis()
Definition: vtkMILVideoSource.h:185
vtkMILVideoSource::FrameCounter
int FrameCounter
Definition: vtkMILVideoSource.h:254
VTK_MIL_SECAM
#define VTK_MIL_SECAM
Definition: vtkMILVideoSource.h:66
vtkMILVideoSource::ContrastLevel
float ContrastLevel
Definition: vtkMILVideoSource.h:274
vtkMILVideoSource::MILInterpreterDLL
char * MILInterpreterDLL
Definition: vtkMILVideoSource.h:267
VTK_MIL_COMPOSITE
#define VTK_MIL_COMPOSITE
Definition: vtkMILVideoSource.h:56
VTK_MIL_METEOR_II_CL
#define VTK_MIL_METEOR_II_CL
Definition: vtkMILVideoSource.h:43
vtkMILVideoSource::OldUserDataPtr
void * OldUserDataPtr
Definition: vtkMILVideoSource.h:253
vtkMILVideoSource::SetVideoInputToRGB
void SetVideoInputToRGB()
Definition: vtkMILVideoSource.h:136
VTK_MIL_CRONOS
#define VTK_MIL_CRONOS
Definition: vtkMILVideoSource.h:51
vtkMILVideoSource::SetMILSystemTypeToCorona
void SetMILSystemTypeToCorona()
Definition: vtkMILVideoSource.h:182
vtkVideoSource::Stop
virtual void Stop()
Stop recording or playing.
VTK_MIL_RGB
#define VTK_MIL_RGB
Definition: vtkMILVideoSource.h:58
vtkMILVideoSource::SetVideoInputToMono
void SetVideoInputToMono()
Definition: vtkMILVideoSource.h:133
vtkMILVideoSource::SetVideoInputToDigital
void SetVideoInputToDigital()
Definition: vtkMILVideoSource.h:137
vtkMILVideoSource::SetMILSystemTypeToMeteorII1394
void SetMILSystemTypeToMeteorII1394()
Definition: vtkMILVideoSource.h:181
VTK_MIL_ORION
#define VTK_MIL_ORION
Definition: vtkMILVideoSource.h:50
VTK_MIL_GENESIS
#define VTK_MIL_GENESIS
Definition: vtkMILVideoSource.h:48
vtkMILVideoSource
Matrox Imaging Library frame grabbers.
Definition: vtkMILVideoSource.h:69
vtkMILVideoSource::VideoInput
int VideoInput
Definition: vtkMILVideoSource.h:270
VTK_MIL_GENESIS_PLUS
#define VTK_MIL_GENESIS_PLUS
Definition: vtkMILVideoSource.h:49
vtkMILVideoSource::SetMILSystemTypeToMeteorII
void SetMILSystemTypeToMeteorII()
Definition: vtkMILVideoSource.h:178
VTK_MIL_MONO
#define VTK_MIL_MONO
Definition: vtkMILVideoSource.h:55
vtkMILVideoSource::GetBlackLevel
virtual float GetBlackLevel()
Definition: vtkMILVideoSource.h:165
vtkMILVideoSource::VideoFormat
int VideoFormat
Definition: vtkMILVideoSource.h:272
vtkVideoSource::ReleaseSystemResources
virtual void ReleaseSystemResources()
Release the video driver.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkMILVideoSource::ForceGrab
int ForceGrab
Definition: vtkMILVideoSource.h:255
vtkMILVideoSource::SetVideoInputToYC
void SetVideoInputToYC()
Definition: vtkMILVideoSource.h:135
VTK_MIL_CCIR
#define VTK_MIL_CCIR
Definition: vtkMILVideoSource.h:64
vtkMILVideoSource::MILSysInternallyAllocated
int MILSysInternallyAllocated
Definition: vtkMILVideoSource.h:300
vtkMILVideoSource::SetMILSystemTypeToCoronaII
void SetMILSystemTypeToCoronaII()
Definition: vtkMILVideoSource.h:183
vtkVideoSource::New
static vtkVideoSource * New()
vtkMILVideoSource::MILErrorMessages
int MILErrorMessages
Definition: vtkMILVideoSource.h:297
VTK_MIL_NONSTANDARD
#define VTK_MIL_NONSTANDARD
Definition: vtkMILVideoSource.h:67
vtkMILVideoSource::SetVideoFormatToRS170
void SetVideoFormatToRS170()
Definition: vtkMILVideoSource.h:122
vtkVideoSource::SetOutputFormat
virtual void SetOutputFormat(int format)
Set the output format.
vtkMILVideoSource::SetMILSystemTypeToOdyssey
void SetMILSystemTypeToOdyssey()
Definition: vtkMILVideoSource.h:189
vtkVideoSource::Grab
virtual void Grab()
Grab a single video frame.
vtkMILVideoSource::HueLevel
float HueLevel
Definition: vtkMILVideoSource.h:276
VTK_MIL_DIGITAL
#define VTK_MIL_DIGITAL
Definition: vtkMILVideoSource.h:59
vtkMILVideoSource::LastFrameCount
unsigned long LastFrameCount
Definition: vtkMILVideoSource.h:313
VTK_MIL_NTSC
#define VTK_MIL_NTSC
Definition: vtkMILVideoSource.h:63
vtkMILVideoSource::OldHookFunction
void * OldHookFunction
For internal use only.
Definition: vtkMILVideoSource.h:252
vtkMILVideoSource::SetVideoFormatToCCIR
void SetVideoFormatToCCIR()
Definition: vtkMILVideoSource.h:123
vtkMILVideoSource::GetWhiteLevel
virtual float GetWhiteLevel()
Definition: vtkMILVideoSource.h:167
VTK_MIL_METEOR
#define VTK_MIL_METEOR
Definition: vtkMILVideoSource.h:40
vtkMILVideoSource::VideoChannel
int VideoChannel
Definition: vtkMILVideoSource.h:269
vtkMILVideoSource::SetMILSystemTypeToOrion
void SetMILSystemTypeToOrion()
Definition: vtkMILVideoSource.h:187
vtkMILVideoSource::SetVideoFormatToPAL
void SetVideoFormatToPAL()
Definition: vtkMILVideoSource.h:120
vtkMILVideoSource::MILSystemType
char * MILSystemType
Definition: vtkMILVideoSource.h:291
vtkMILVideoSource::MILDigID
long MILDigID
Definition: vtkMILVideoSource.h:286
VTK_MIL_METEOR_II_DIG
#define VTK_MIL_METEOR_II_DIG
Definition: vtkMILVideoSource.h:42
vtkMILVideoSource::MILBufID
long MILBufID
Definition: vtkMILVideoSource.h:287
vtkVideoSource::SetFrameSize
virtual void SetFrameSize(int x, int y, int z)
Set the full-frame size.
vtkMILVideoSource::SetVideoFormatToNonStandard
void SetVideoFormatToNonStandard()
Definition: vtkMILVideoSource.h:124
vtkVideoSource::Record
virtual void Record()
Record incoming video at the specified FrameRate.
vtkMILVideoSource::SetMILSystemTypeToMeteor
void SetMILSystemTypeToMeteor()
Definition: vtkMILVideoSource.h:177
vtkMILVideoSource::MILAppInternallyAllocated
int MILAppInternallyAllocated
Definition: vtkMILVideoSource.h:299
vtkMILVideoSource::WhiteLevel
float WhiteLevel
Definition: vtkMILVideoSource.h:280
vtkMILVideoSource::MILAppID
long MILAppID
Definition: vtkMILVideoSource.h:284
VTK_MIL_ODYSSEY
#define VTK_MIL_ODYSSEY
Definition: vtkMILVideoSource.h:52
VTK_MIL_CORONA
#define VTK_MIL_CORONA
Definition: vtkMILVideoSource.h:45
vtkMILVideoSource::SetVideoFormatToSECAM
void SetVideoFormatToSECAM()
Definition: vtkMILVideoSource.h:121
vtkVideoSource::Initialize
virtual void Initialize()
Initialize the hardware.
VTK_MIL_CORONA_II
#define VTK_MIL_CORONA_II
Definition: vtkMILVideoSource.h:46
vtkMILVideoSource::MILDigitizerDCF
char * MILDigitizerDCF
Definition: vtkMILVideoSource.h:295
vtkMILVideoSource::NextFramePeriod
double NextFramePeriod
Definition: vtkMILVideoSource.h:315
vtkMILVideoSource::BrightnessLevel
float BrightnessLevel
Definition: vtkMILVideoSource.h:275
vtkVideoSource
Superclass of video input devices for VTK.
Definition: vtkVideoSource.h:43
vtkMILVideoSource::MILDigitizerNumber
int MILDigitizerNumber
Definition: vtkMILVideoSource.h:294