ITK  5.2.0
Insight Toolkit
itkVideoSource.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright NumFOCUS
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 itkVideoSource_h
19 #define itkVideoSource_h
20 
22 #include "itkVideoStream.h"
23 
24 namespace itk
25 {
26 
43 template <typename TOutputVideoStream>
44 class ITK_TEMPLATE_EXPORT VideoSource : public TemporalProcessObject
45 {
46 public:
47  ITK_DISALLOW_COPY_AND_MOVE(VideoSource);
48 
49  /*-TYPEDEFS----------------------------------------------------------------*/
50 
52  using Self = VideoSource;
57  using OutputVideoStreamType = TOutputVideoStream;
58 
67 
68  itkNewMacro(Self);
69 
71  itkTypeMacro(VideoSource, TemporalProcessObject);
72 
73  /*-PUBLIC METHODS----------------------------------------------------------*/
74 
76  static constexpr unsigned int OutputFrameDimension = OutputFrameType::ImageDimension;
77  static unsigned int
79  {
80  return OutputFrameType::ImageDimension;
81  }
82 
87  OutputVideoStreamType *
88  GetOutput();
89 
90  OutputVideoStreamType *
91  GetOutput(unsigned int idx);
92 
95  virtual void
96  GraftNthOutput(unsigned int idx, OutputVideoStreamType * graft);
97 
101  virtual void
102  GraftOutput(OutputVideoStreamType * graft);
103 
108  using Superclass::MakeOutput;
110  MakeOutput(DataObjectPointerArraySizeType idx) override;
111 
112 protected:
124  void
125  GenerateOutputRequestedTemporalRegion(TemporalDataObject * output) override;
126 
132  void
133  TemporalStreamingGenerateData() override;
134 
146  virtual void
147  ThreadedGenerateData(const OutputFrameSpatialRegionType & outputRegionForThread, int threadId);
148 
154  virtual void
155  AllocateOutputs();
156 
159  virtual void
161  {}
162 
165  virtual void
167  {}
168 
172  virtual int
173  SplitRequestedSpatialRegion(int i, int num, OutputFrameSpatialRegionType & splitRegion);
174 
178  ThreaderCallback(void * arg);
179 
183  {
185  };
186 
187  VideoSource();
188  ~VideoSource() override = default;
189  void
190  PrintSelf(std::ostream & os, Indent indent) const override;
191 
192 private:
193 }; // end class VideoSource
194 
195 } // end namespace itk
196 
197 #ifndef ITK_MANUAL_INSTANTIATION
198 # include "itkVideoSource.hxx"
199 #endif
200 
201 #endif
itk::VideoSource< itk::VideoStream< TImageToImageFilter::OutputImageType > >::OutputFrameSpacingType
typename OutputVideoStreamType::SpacingType OutputFrameSpacingType
Definition: itkVideoSource.h:64
itk::VideoStream::FrameType
TFrameType FrameType
Definition: itkVideoStream.h:54
itk::GTest::TypedefsAndConstructors::Dimension2::DirectionType
ImageBaseType::DirectionType DirectionType
Definition: itkGTestTypedefsAndConstructors.h:52
itkVideoStream.h
itk::GTest::TypedefsAndConstructors::Dimension2::PointType
ImageBaseType::PointType PointType
Definition: itkGTestTypedefsAndConstructors.h:51
itk::VideoStream::SpatialRegionType
typename FrameType::RegionType SpatialRegionType
Definition: itkVideoStream.h:59
itk::VideoStream::PixelType
typename FrameType::PixelType PixelType
Definition: itkVideoStream.h:61
itk::GTest::TypedefsAndConstructors::Dimension2::SizeType
ImageBaseType::SizeType SizeType
Definition: itkGTestTypedefsAndConstructors.h:49
itk::VideoSource< itk::VideoStream< TImageToImageFilter::OutputImageType > >::OutputFrameIndexType
typename OutputVideoStreamType::IndexType OutputFrameIndexType
Definition: itkVideoSource.h:61
itk::VideoSource::AfterThreadedGenerateData
virtual void AfterThreadedGenerateData()
Definition: itkVideoSource.h:166
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::ProcessObject::DataObjectPointerArraySizeType
DataObjectPointerArray::size_type DataObjectPointerArraySizeType
Definition: itkProcessObject.h:193
itk::TemporalProcessObject
TemporalProcessObject implements a ProcessObject for the itk pipeline with the notion of a temporal r...
Definition: itkTemporalProcessObject.h:66
itkTemporalProcessObject.h
itk::VideoSource< itk::VideoStream< TImageToImageFilter::OutputImageType > >::OutputFrameSizeType
typename OutputVideoStreamType::SizeType OutputFrameSizeType
Definition: itkVideoSource.h:65
itk::VideoSource::BeforeThreadedGenerateData
virtual void BeforeThreadedGenerateData()
Definition: itkVideoSource.h:160
itk::GTest::TypedefsAndConstructors::Dimension2::IndexType
ImageBaseType::IndexType IndexType
Definition: itkGTestTypedefsAndConstructors.h:50
itk::ITK_THREAD_RETURN_FUNCTION_CALL_CONVENTION
itk::ITK_THREAD_RETURN_TYPE ITK_THREAD_RETURN_FUNCTION_CALL_CONVENTION
Definition: itkThreadSupport.h:82
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:59
itk::VideoSource< itk::VideoStream< TImageToImageFilter::OutputImageType > >::OutputFrameDirectionType
typename OutputVideoStreamType::DirectionType OutputFrameDirectionType
Definition: itkVideoSource.h:66
itk::VideoSource< itk::VideoStream< TImageToImageFilter::OutputImageType > >::OutputFrameSpatialRegionType
typename OutputVideoStreamType::SpatialRegionType OutputFrameSpatialRegionType
Definition: itkVideoSource.h:60
itk::VideoSource< itk::VideoStream< TImageToImageFilter::OutputImageType > >::OutputFramePixelType
typename OutputVideoStreamType::PixelType OutputFramePixelType
Definition: itkVideoSource.h:62
itk::VideoSource< itk::VideoStream< TImageToImageFilter::OutputImageType > >::OutputFramePointType
typename OutputVideoStreamType::PointType OutputFramePointType
Definition: itkVideoSource.h:63
itk::WeakPointer
Implements a weak reference to an object.
Definition: itkWeakPointer.h:44
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::VideoStream
A DataObject that holds a buffered portion of a video.
Definition: itkVideoStream.h:42
itk::VideoSource::ThreadStruct
Definition: itkVideoSource.h:182
itk::VideoStream::SpacingType
typename FrameType::SpacingType SpacingType
Definition: itkVideoStream.h:63
itk::VideoSource
A TemporalProcessObject that produces a VideoStream.
Definition: itkVideoSource.h:44
itk::VideoSource::ThreadStruct::Filter
Pointer Filter
Definition: itkVideoSource.h:184
itk::VideoSource::GetOutputFrameDimension
static unsigned int GetOutputFrameDimension()
Definition: itkVideoSource.h:78
itk::TemporalDataObject
DataObject subclass with knowledge of temporal region.
Definition: itkTemporalDataObject.h:65
itk::VideoSource< itk::VideoStream< TImageToImageFilter::OutputImageType > >::OutputFrameType
typename OutputVideoStreamType::FrameType OutputFrameType
Definition: itkVideoSource.h:59