ITK  4.9.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 "ITKVideoIOExport.h"
24 #include "vnl/vnl_vector.h"
25 
26 #include <string>
27 
28 namespace itk
29 {
49 class ITKVideoIO_EXPORT VideoIOBase : public ImageIOBase
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  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
120 
132 
133 private:
134  VideoIOBase(const Self &) ITK_DELETE_FUNCTION;
135  void operator=(const Self &) ITK_DELETE_FUNCTION;
136 
137 };
138 
139 } // end namespace itk
140 
141 #endif // itkVideoIOBase_h
Light weight base class for most itk classes.
Abstract superclass defines video IO interface.
TemporalRatioType m_FramesPerSecond
FrameOffsetType m_IFrameInterval
FrameOffsetType m_FrameTotal
Abstract superclass defines image IO interface.
FrameOffsetType m_LastIFrame
TemporalRatioType m_Ratio
VideoIOBase Self
unsigned long SizeValueType
Definition: itkIntTypes.h:143
ReadType GetReadType()
SizeValueType FrameOffsetType
SizeValueType CameraIDType
FrameOffsetType m_CurrentFrame
::itk::SizeValueType SizeValueType
ImageIOBase Superclass
SmartPointer< Self > Pointer
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Base class for most ITK classes.
Definition: itkObject.h:57
TemporalOffsetType m_PositionInMSec
double TemporalRatioType
double TemporalOffsetType