00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00041 #ifndef __vtkVideoSource_h
00042 #define __vtkVideoSource_h
00043
00044 #include "vtkImageSource.h"
00045
00046 class vtkTimerLog;
00047 class vtkCriticalSection;
00048 class vtkMultiThreader;
00049 class vtkScalarsToColors;
00050
00051 class VTK_HYBRID_EXPORT vtkVideoSource : public vtkImageSource
00052 {
00053 public:
00054 static vtkVideoSource *New();
00055 vtkTypeRevisionMacro(vtkVideoSource,vtkImageSource);
00056 void PrintSelf(ostream& os, vtkIndent indent);
00057
00060 virtual void Record();
00061
00064 virtual void Play();
00065
00067 virtual void Stop();
00068
00073 virtual void Rewind();
00074
00077 virtual void FastForward();
00078
00081 virtual void Seek(int n);
00082
00084 virtual void Grab();
00085
00087
00089 vtkGetMacro(Recording,int);
00091
00093
00095 vtkGetMacro(Playing,int);
00097
00099
00104 virtual void SetFrameSize(int x, int y, int z);
00105 virtual void SetFrameSize(int dim[3]) {
00106 this->SetFrameSize(dim[0], dim[1], dim[2]); };
00107 vtkGetVector3Macro(FrameSize,int);
00109
00111
00112 virtual void SetFrameRate(float rate);
00113 vtkGetMacro(FrameRate,float);
00115
00117
00119 virtual void SetOutputFormat(int format);
00120 void SetOutputFormatToLuminance() { this->SetOutputFormat(VTK_LUMINANCE); };
00121 void SetOutputFormatToRGB() { this->SetOutputFormat(VTK_RGB); };
00122 void SetOutputFormatToRGBA() { this->SetOutputFormat(VTK_RGBA); };
00123 vtkGetMacro(OutputFormat,int);
00125
00127
00129 virtual void SetFrameBufferSize(int FrameBufferSize);
00130 vtkGetMacro(FrameBufferSize,int);
00132
00134
00137 vtkSetMacro(NumberOfOutputFrames,int);
00138 vtkGetMacro(NumberOfOutputFrames,int);
00140
00142
00144 vtkBooleanMacro(AutoAdvance,int);
00145 vtkSetMacro(AutoAdvance,int)
00146 vtkGetMacro(AutoAdvance,int);
00148
00150
00154 virtual void SetClipRegion(int r[6]) {
00155 this->SetClipRegion(r[0],r[1],r[2],r[3],r[4],r[5]); };
00156 virtual void SetClipRegion(int x0, int x1, int y0, int y1, int z0, int z1);
00157 vtkGetVector6Macro(ClipRegion,int);
00159
00161
00168 vtkSetVector6Macro(OutputWholeExtent,int);
00169 vtkGetVector6Macro(OutputWholeExtent,int);
00171
00173
00174 vtkSetVector3Macro(DataSpacing,double);
00175 vtkGetVector3Macro(DataSpacing,double);
00177
00179
00181 vtkSetVector3Macro(DataOrigin,double);
00182 vtkGetVector3Macro(DataOrigin,double);
00184
00186
00189 vtkSetMacro(Opacity,float);
00190 vtkGetMacro(Opacity,float);
00192
00194
00196 vtkGetMacro(FrameCount, int);
00197 vtkSetMacro(FrameCount, int);
00199
00201
00203 vtkGetMacro(FrameIndex, int);
00205
00210 virtual double GetFrameTimeStamp(int frame);
00211
00215 double GetFrameTimeStamp() { return this->FrameTimeStamp; };
00216
00218
00220 virtual void Initialize();
00221 virtual int GetInitialized() { return this->Initialized; };
00223
00226 virtual void ReleaseSystemResources();
00227
00231 virtual void InternalGrab();
00232
00234
00236 void SetStartTimeStamp(double t) { this->StartTimeStamp = t; };
00237 double GetStartTimeStamp() { return this->StartTimeStamp; };
00239
00240 protected:
00241 vtkVideoSource();
00242 ~vtkVideoSource();
00243 void ExecuteInformation();
00244
00245 int Initialized;
00246
00247 int FrameSize[3];
00248 int ClipRegion[6];
00249 int OutputWholeExtent[6];
00250 double DataSpacing[3];
00251 double DataOrigin[3];
00252 int OutputFormat;
00253
00254 int NumberOfScalarComponents;
00255
00256
00257 int FrameOutputExtent[6];
00258
00259
00260
00261 int LastNumberOfScalarComponents;
00262 int LastOutputExtent[6];
00263
00264 int Recording;
00265 int Playing;
00266 float FrameRate;
00267 int FrameCount;
00268 int FrameIndex;
00269 double StartTimeStamp;
00270 double FrameTimeStamp;
00271
00272 int AutoAdvance;
00273 int NumberOfOutputFrames;
00274
00275 float Opacity;
00276
00277
00278 int FlipFrames;
00279
00280
00281 int OutputNeedsInitialization;
00282
00283
00284 vtkMultiThreader *PlayerThreader;
00285 int PlayerThreadId;
00286
00287
00288
00289 vtkCriticalSection *FrameBufferMutex;
00290
00291
00292
00293 int FrameBufferBitsPerPixel;
00294
00295 int FrameBufferRowAlignment;
00296
00297
00298 int FrameBufferExtent[6];
00299
00300 int FrameBufferSize;
00301 int FrameBufferIndex;
00302 void **FrameBuffer;
00303 double *FrameBufferTimeStamps;
00304
00306
00307 virtual void UpdateFrameBuffer();
00308 virtual void AdvanceFrameBuffer(int n);
00309 virtual void ExecuteData(vtkDataObject *data);
00310
00311 virtual void UnpackRasterLine(char *outPtr, char *rowPtr,
00312 int start, int count);
00314
00315 private:
00316 vtkVideoSource(const vtkVideoSource&);
00317 void operator=(const vtkVideoSource&);
00318 };
00319
00320 #endif
00321
00322
00323
00324
00325