ITK  4.2.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 
51 public:
53  typedef VideoIOBase Self;
57 
59  typedef double TemporalOffsetType;
61  typedef double TemporalRatioType;
62 
65 
67  itkTypeMacro(VideoIOBase, Superclass);
68 
70  virtual void FinishReadingOrWriting() = 0;
71 
72  /*-------- This part of the interface deals with reading data. ------ */
73 
75  typedef enum {ReadFromFile, ReadFromCamera} ReadType;
76 
78  virtual void SetReadFromFile() = 0;
79 
81  virtual void SetReadFromCamera() = 0;
82 
85  return this->m_ReadType;
86  }
87 
90  virtual bool CanReadCamera( CameraIDType cameraID ) const = 0;
91 
94  virtual bool SetNextFrameToRead( FrameOffsetType frameNumber ) = 0;
95 
97  virtual TemporalOffsetType GetPositionInMSec() const = 0;
98  virtual TemporalRatioType GetRatio() const = 0;
99  virtual FrameOffsetType GetFrameTotal() const = 0;
100  virtual TemporalRatioType GetFramesPerSecond() const = 0;
101  virtual FrameOffsetType GetCurrentFrame() const = 0;
102  virtual FrameOffsetType GetLastIFrame() const = 0;
104 
105  /*-------- This part of the interfaces deals with writing data. ----- */
106 
108  virtual void SetWriterParameters( TemporalRatioType framesPerSecond,
109  const std::vector<SizeValueType>& dim,
110  const char* fourCC,
111  unsigned int nChannels,
112  IOComponentType componentType) = 0;
113 
114 protected:
115 
116  VideoIOBase();
117  virtual ~VideoIOBase();
118 
119  void PrintSelf(std::ostream & os, Indent indent) const;
120 
132 
133 private:
134  VideoIOBase(const Self &); //purposely not implemented
135  void operator=(const Self &); //purposely not implemented
136 
137 };
138 
139 } // end namespace itk
140 
141 #endif // __itkVideoIOBase_h
142