ITK  4.3.0
Insight Segmentation and Registration Toolkit
itkVideoIOBase.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef __itkVideoIOBase_h
19 #define __itkVideoIOBase_h
20 
21 #include "itkImageIOBase.h"
22 #include "itkExceptionObject.h"
23 #include "vnl/vnl_vector.h"
24 
25 #include <string>
26 
27 namespace itk
28 {
48 class ITK_EXPORT VideoIOBase : public ImageIOBase
49 {
50 public:
52  typedef VideoIOBase Self;
56 
58  typedef double TemporalOffsetType;
60  typedef double TemporalRatioType;
61 
64 
66  itkTypeMacro(VideoIOBase, Superclass);
67 
69  virtual void FinishReadingOrWriting() = 0;
70 
71  /*-------- This part of the interface deals with reading data. ------ */
72 
74  typedef enum {ReadFromFile, ReadFromCamera} ReadType;
75 
77  virtual void SetReadFromFile() = 0;
78 
80  virtual void SetReadFromCamera() = 0;
81 
84  return this->m_ReadType;
85  }
86 
89  virtual bool CanReadCamera( CameraIDType cameraID ) const = 0;
90 
93  virtual bool SetNextFrameToRead( FrameOffsetType frameNumber ) = 0;
94 
96  virtual TemporalOffsetType GetPositionInMSec() const = 0;
97  virtual TemporalRatioType GetRatio() const = 0;
98  virtual FrameOffsetType GetFrameTotal() const = 0;
99  virtual TemporalRatioType GetFramesPerSecond() const = 0;
100  virtual FrameOffsetType GetCurrentFrame() const = 0;
101  virtual FrameOffsetType GetLastIFrame() const = 0;
103 
104  /*-------- This part of the interfaces deals with writing data. ----- */
105 
107  virtual void SetWriterParameters( TemporalRatioType framesPerSecond,
108  const std::vector<SizeValueType>& dim,
109  const char* fourCC,
110  unsigned int nChannels,
111  IOComponentType componentType) = 0;
112 
113 protected:
114 
115  VideoIOBase();
116  virtual ~VideoIOBase();
117 
118  void PrintSelf(std::ostream & os, Indent indent) const;
119 
131 
132 private:
133  VideoIOBase(const Self &); //purposely not implemented
134  void operator=(const Self &); //purposely not implemented
135 
136 };
137 
138 } // end namespace itk
139 
140 #endif // __itkVideoIOBase_h
141