Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

Hybrid/vtkMILVideoSource.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkMILVideoSource.h,v $
00005   Language:  C++
00006 
00007   Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen 
00008   All rights reserved.
00009   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00010 
00011      This software is distributed WITHOUT ANY WARRANTY; without even 
00012      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00013      PURPOSE.  See the above copyright notice for more information.
00014 
00015 =========================================================================*/
00045 #ifndef __vtkMILVideoSource_h
00046 #define __vtkMILVideoSource_h
00047 
00048 #include "vtkVideoSource.h"
00049 
00050 // digitizer hardware
00051 #define VTK_MIL_DEFAULT        0
00052 #define VTK_MIL_METEOR         "M_SYSTEM_METEOR"
00053 #define VTK_MIL_METEOR_II      "M_SYSTEM_METEOR_II"
00054 #define VTK_MIL_METEOR_II_DIG  "M_SYSTEM_METEOR_II_DIG"
00055 #define VTK_MIL_METEOR_II_CL   "M_SYSTEM_METEOR_II_CL"
00056 #define VTK_MIL_METEOR_II_1394 "M_SYSTEM_METEOR_II_1394"
00057 #define VTK_MIL_CORONA         "M_SYSTEM_CORONA"
00058 #define VTK_MIL_CORONA_II      "M_SYSTEM_CORONA_II"
00059 #define VTK_MIL_PULSAR         "M_SYSTEM_PULSAR"
00060 #define VTK_MIL_GENESIS        "M_SYSTEM_GENESIS"
00061 #define VTK_MIL_GENESIS_PLUS   "M_SYSTEM_GENESIS_PLUS"
00062 #define VTK_MIL_ORION          "M_SYSTEM_ORION"
00063 #define VTK_MIL_CRONOS         "M_SYSTEM_CRONOS"
00064 #define VTK_MIL_ODYSSEY        "M_SYSTEM_ODYSSEY"
00065 
00066 // video inputs: 
00067 #define VTK_MIL_MONO          0
00068 #define VTK_MIL_COMPOSITE     1
00069 #define VTK_MIL_YC            2
00070 #define VTK_MIL_RGB           3
00071 #define VTK_MIL_DIGITAL       4
00072 
00073 // video formats:
00074 #define VTK_MIL_RS170         0
00075 #define VTK_MIL_NTSC          1
00076 #define VTK_MIL_CCIR          2 
00077 #define VTK_MIL_PAL           3 
00078 #define VTK_MIL_SECAM         4
00079 #define VTK_MIL_NONSTANDARD   5       
00080 
00081 class VTK_HYBRID_EXPORT vtkMILVideoSource : public vtkVideoSource
00082 {
00083 public:
00084   static vtkMILVideoSource *New();
00085   vtkTypeRevisionMacro(vtkMILVideoSource,vtkVideoSource);
00086   void PrintSelf(ostream& os, vtkIndent indent);   
00087 
00089   void Record();
00090 
00092   void Play();
00093 
00095   void Stop();
00096 
00098   void Grab();
00099  
00101   void SetFrameSize(int x, int y, int z);
00102   
00104   void SetOutputFormat(int format);
00105 
00107 
00108   virtual void SetVideoChannel(int channel);
00109   vtkGetMacro(VideoChannel, int);
00111 
00113 
00114   virtual void SetVideoFormat(int format);
00115   void SetVideoFormatToNTSC() { this->SetVideoFormat(VTK_MIL_NTSC); };
00116   void SetVideoFormatToPAL() { this->SetVideoFormat(VTK_MIL_PAL); };
00117   void SetVideoFormatToSECAM() { this->SetVideoFormat(VTK_MIL_SECAM); };
00118   void SetVideoFormatToRS170() { this->SetVideoFormat(VTK_MIL_RS170); };
00119   void SetVideoFormatToCCIR() { this->SetVideoFormat(VTK_MIL_CCIR); };
00120   void SetVideoFormatToNonStandard() { 
00121     this->SetVideoFormat(VTK_MIL_NONSTANDARD); };
00122   vtkGetMacro(VideoFormat,int);
00124   
00126 
00127   virtual void SetVideoInput(int input);
00128   void SetVideoInputToMono() { this->SetVideoInput(VTK_MIL_MONO); };
00129   void SetVideoInputToComposite() {this->SetVideoInput(VTK_MIL_COMPOSITE);};
00130   void SetVideoInputToYC() { this->SetVideoInput(VTK_MIL_YC); };
00131   void SetVideoInputToRGB() { this->SetVideoInput(VTK_MIL_RGB); };
00132   void SetVideoInputToDigital() { this->SetVideoInput(VTK_MIL_DIGITAL); };
00133   vtkGetMacro(VideoInput,int);
00135 
00137 
00140   virtual void SetContrastLevel(float contrast);
00141   vtkGetMacro(ContrastLevel,float);
00142   virtual void SetBrightnessLevel(float brightness);
00143   vtkGetMacro(BrightnessLevel,float);
00144   virtual void SetHueLevel(float hue);
00145   vtkGetMacro(HueLevel,float);
00146   virtual void SetSaturationLevel(float saturation);
00147   vtkGetMacro(SaturationLevel,float);
00149 
00151 
00153   virtual void SetBlackLevel(float value);
00154   virtual float GetBlackLevel() {
00155     return this->BlackLevel; };
00156   virtual void SetWhiteLevel(float value);
00157   virtual float GetWhiteLevel() {
00158     return this->WhiteLevel; };
00160 
00162 
00164   vtkSetStringMacro(MILSystemType);
00165   vtkGetStringMacro(MILSystemType);
00166   void SetMILSystemTypeToMeteor() { this->SetMILSystemType(VTK_MIL_METEOR); };
00167   void SetMILSystemTypeToMeteorII() { this->SetMILSystemType(VTK_MIL_METEOR_II); };
00168   void SetMILSystemTypeToMeteorIIDig() { this->SetMILSystemType(VTK_MIL_METEOR_II_DIG); };
00169   void SetMILSystemTypeToMeteorIICL() { this->SetMILSystemType(VTK_MIL_METEOR_II_CL); };
00170   void SetMILSystemTypeToMeteorII1394() { this->SetMILSystemType(VTK_MIL_METEOR_II_1394); };
00171   void SetMILSystemTypeToCorona() { this->SetMILSystemType(VTK_MIL_CORONA); };
00172   void SetMILSystemTypeToCoronaII() { this->SetMILSystemType(VTK_MIL_CORONA_II); };
00173   void SetMILSystemTypeToPulsar() { this->SetMILSystemType(VTK_MIL_PULSAR); };
00174   void SetMILSystemTypeToGenesis() { this->SetMILSystemType(VTK_MIL_GENESIS); };
00175   void SetMILSystemTypeToGenesisPlus() { this->SetMILSystemType(VTK_MIL_GENESIS_PLUS); };
00176   void SetMILSystemTypeToOrion() { this->SetMILSystemType(VTK_MIL_ORION); };
00177   void SetMILSystemTypeToCronos() { this->SetMILSystemType(VTK_MIL_CRONOS); };
00178   void SetMILSystemTypeToOdyssey() { this->SetMILSystemType(VTK_MIL_ODYSSEY); };
00179   // Description:
00180   // Set the system number if you have multiple systems of the same type
00181   vtkSetMacro(MILSystemNumber,int);
00182   vtkGetMacro(MILSystemNumber,int);
00184 
00186 
00187   vtkSetStringMacro(MILDigitizerDCF);
00188   vtkGetStringMacro(MILDigitizerDCF);
00190 
00192 
00193   vtkSetMacro(MILDigitizerNumber,int);
00194   vtkGetMacro(MILDigitizerNumber,int);
00196 
00198 
00199   virtual void SetMILErrorMessages(int yesno);
00200   vtkBooleanMacro(MILErrorMessages,int);
00201   vtkGetMacro(MILErrorMessages,int);
00203 
00205 
00206   vtkSetMacro(MILAppID,long);
00207   vtkGetMacro(MILAppID,long);
00208   vtkSetMacro(MILSysID,long);
00209   vtkGetMacro(MILSysID,long);
00210   vtkGetMacro(MILDigID,long);
00211   vtkGetMacro(MILBufID,long);
00213 
00216   void Initialize();
00217 
00219   void ReleaseSystemResources();
00220 
00222 
00223   void *OldHookFunction;
00224   void *OldUserDataPtr;
00225   int FrameCounter;
00226   int ForceGrab;
00227   void InternalGrab();
00229 
00230 protected:
00231   vtkMILVideoSource();
00232   ~vtkMILVideoSource();
00233 
00234   virtual void AllocateMILDigitizer();
00235   virtual void AllocateMILBuffer();
00236 
00237   virtual void *MILInterpreterForSystem(const char *system);
00238   char *MILInterpreterDLL;
00239 
00240   int VideoChannel;
00241   int VideoInput;
00242   int VideoInputForColor;
00243   int VideoFormat;
00244 
00245   float ContrastLevel;
00246   float BrightnessLevel;
00247   float HueLevel;
00248   float SaturationLevel;
00249 
00250   float BlackLevel;
00251   float WhiteLevel;
00252 
00253   int FrameMaxSize[2];
00254 
00255   long MILAppID;
00256   long MILSysID;
00257   long MILDigID;
00258   long MILBufID;
00259   // long MILDispBufID;
00260   // long MILDispID;
00261 
00262   char *MILSystemType;
00263   int MILSystemNumber;
00264 
00265   int MILDigitizerNumber;
00266   char *MILDigitizerDCF;
00267 
00268   int MILErrorMessages;
00269 
00270   int MILAppInternallyAllocated;
00271   int MILSysInternallyAllocated;
00272 
00273   int FatalMILError;
00274 
00278   double CreateTimeStampForFrame(unsigned long frame);
00279 
00280   double LastTimeStamp;
00281   unsigned long LastFrameCount;
00282   double EstimatedFramePeriod;
00283   double NextFramePeriod;
00284 
00285 private:
00286   vtkMILVideoSource(const vtkMILVideoSource&);  // Not implemented.
00287   void operator=(const vtkMILVideoSource&);  // Not implemented.
00288 };
00289 
00290 #endif