VTK  9.3.0
vtkImageIterator.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
26 #ifndef vtkImageIterator_h
27 #define vtkImageIterator_h
28 
29 #include "vtkCommonDataModelModule.h" // For export macro
30 #include "vtkSystemIncludes.h"
31 VTK_ABI_NAMESPACE_BEGIN
32 class vtkImageData;
33 
34 template <class DType>
35 class VTKCOMMONDATAMODEL_EXPORT vtkImageIterator
36 {
37 public:
38  typedef DType* SpanIterator;
39 
45 
50 
54  void Initialize(vtkImageData* id, int* ext);
55 
59  void NextSpan();
60 
64  SpanIterator BeginSpan() { return this->Pointer; }
65 
69  SpanIterator EndSpan() { return this->SpanEndPointer; }
70 
74  vtkTypeBool IsAtEnd() { return (this->Pointer >= this->EndPointer); }
75 
76 protected:
77  DType* Pointer;
80  DType* EndPointer;
81  vtkIdType Increments[3];
82  vtkIdType ContinuousIncrements[3];
83 };
84 
85 #ifndef vtkImageIterator_cxx
86 #ifdef _MSC_VER
87 #pragma warning(push)
88 // The following is needed when the vtkImageIterator is declared
89 // dllexport and is used from another class in vtkCommonCore
90 #pragma warning(disable : 4910) // extern and dllexport incompatible
91 #endif
92 vtkExternTemplateMacro(extern template class VTKCOMMONDATAMODEL_EXPORT vtkImageIterator);
93 #ifdef _MSC_VER
94 #pragma warning(pop)
95 #endif
96 #endif
97 
98 VTK_ABI_NAMESPACE_END
99 #endif
100 // VTK-HeaderTest-Exclude: vtkImageIterator.h
topologically and geometrically regular array of data
Definition: vtkImageData.h:52
a simple image iterator
void Initialize(vtkImageData *id, int *ext)
Initialize the image iterator for a given image data, and given extent.
vtkImageIterator(vtkImageData *id, int *ext)
Create an image iterator for a given image data and a given extent.
vtkImageIterator()
Default empty constructor, useful only when creating an array of iterators You need to call Initializ...
SpanIterator BeginSpan()
Return an iterator (pointer) for the span.
void NextSpan()
Move the iterator to the next span.
SpanIterator EndSpan()
Return an iterator (pointer) for the end of the span.
vtkTypeBool IsAtEnd()
Test if the end of the extent has been reached.
int vtkTypeBool
Definition: vtkABI.h:64
vtkExternTemplateMacro(extern template class VTKCOMMONDATAMODEL_EXPORT vtkImageIterator)
int vtkIdType
Definition: vtkType.h:315