ITK  6.0.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 * https://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
24namespace itk
25{
26
43template <typename TOutputVideoStream>
44class ITK_TEMPLATE_EXPORT VideoSource : public TemporalProcessObject
45{
46public:
47 ITK_DISALLOW_COPY_AND_MOVE(VideoSource);
48
49 /*-TYPEDEFS----------------------------------------------------------------*/
50
57 using OutputVideoStreamType = TOutputVideoStream;
58
59 using OutputFrameType = typename OutputVideoStreamType::FrameType;
60 using OutputFrameSpatialRegionType = typename OutputVideoStreamType::SpatialRegionType;
62 using OutputFramePixelType = typename OutputVideoStreamType::PixelType;
64 using OutputFrameSpacingType = typename OutputVideoStreamType::SpacingType;
67
68 itkNewMacro(Self);
69
71 itkOverrideGetNameOfClassMacro(VideoSource);
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 *
89
91 GetOutput(unsigned int idx);
92
95 virtual void
96 GraftNthOutput(unsigned int idx, OutputVideoStreamType * graft);
97
101 virtual void
103
108 using Superclass::MakeOutput;
111
112protected:
124 void
126
132 void
134
146 virtual void
147 ThreadedGenerateData(const OutputFrameSpatialRegionType & outputRegionForThread, int threadId);
148
154 virtual void
156
159 virtual void
161 {}
162
165 virtual void
167 {}
168
172 virtual int
174
178 ThreaderCallback(void * arg);
179
183 {
185 };
186
188 ~VideoSource() override = default;
189 void
190 PrintSelf(std::ostream & os, Indent indent) const override;
191
192private:
193}; // end class VideoSource
194
195} // end namespace itk
196
197#ifndef ITK_MANUAL_INSTANTIATION
198# include "itkVideoSource.hxx"
199#endif
200
201#endif
Control indentation during Print() invocation.
Definition: itkIndent.h:50
Light weight base class for most itk classes.
DataObjectPointerArray::size_type DataObjectPointerArraySizeType
DataObject subclass with knowledge of temporal region.
TemporalProcessObject implements a ProcessObject for the itk pipeline with the notion of a temporal r...
A TemporalProcessObject that produces a VideoStream.
void PrintSelf(std::ostream &os, Indent indent) const override
typename OutputVideoStreamType::SpatialRegionType OutputFrameSpatialRegionType
OutputVideoStreamType * GetOutput()
virtual void AllocateOutputs()
typename OutputVideoStreamType::DirectionType OutputFrameDirectionType
virtual void AfterThreadedGenerateData()
virtual void GraftOutput(OutputVideoStreamType *graft)
void TemporalStreamingGenerateData() override
typename OutputVideoStreamType::FrameType OutputFrameType
static ITK_THREAD_RETURN_FUNCTION_CALL_CONVENTION ThreaderCallback(void *arg)
typename OutputVideoStreamType::PixelType OutputFramePixelType
typename OutputVideoStreamType::SpacingType OutputFrameSpacingType
OutputVideoStreamType * GetOutput(unsigned int idx)
DataObjectPointer MakeOutput(DataObjectPointerArraySizeType idx) override
Make a DataObject of the correct type to used as the specified output.
virtual int SplitRequestedSpatialRegion(int i, int num, OutputFrameSpatialRegionType &splitRegion)
~VideoSource() override=default
typename OutputVideoStreamType::PointType OutputFramePointType
void GenerateOutputRequestedTemporalRegion(TemporalDataObject *output) override
virtual void ThreadedGenerateData(const OutputFrameSpatialRegionType &outputRegionForThread, int threadId)
typename OutputVideoStreamType::SizeType OutputFrameSizeType
TOutputVideoStream OutputVideoStreamType
typename OutputVideoStreamType::IndexType OutputFrameIndexType
static unsigned int GetOutputFrameDimension()
virtual void GraftNthOutput(unsigned int idx, OutputVideoStreamType *graft)
virtual void BeforeThreadedGenerateData()
Implements a weak reference to an object.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
itk::ITK_THREAD_RETURN_TYPE ITK_THREAD_RETURN_FUNCTION_CALL_CONVENTION