VTK: Common/DataModel/vtkImageIterator.h Source File

| VTK 9.3.1

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
44 vtkImageIterator();
45
49 vtkImageIterator(vtkImageData* id, int* ext);
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;
78 DType* SpanEndPointer;
79 DType* SliceEndPointer;
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
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:52
vtkImageIterator
a simple image iterator
Definition: vtkImageIterator.h:36
vtkImageIterator::Initialize
void Initialize(vtkImageData *id, int *ext)
Initialize the image iterator for a given image data, and given extent.
vtkImageIterator::vtkImageIterator
vtkImageIterator(vtkImageData *id, int *ext)
Create an image iterator for a given image data and a given extent.
vtkImageIterator::SpanEndPointer
DType * SpanEndPointer
Definition: vtkImageIterator.h:78
vtkImageIterator::Pointer
DType * Pointer
Definition: vtkImageIterator.h:77
vtkImageIterator::SliceEndPointer
DType * SliceEndPointer
Definition: vtkImageIterator.h:79
vtkImageIterator::EndPointer
DType * EndPointer
Definition: vtkImageIterator.h:80
vtkImageIterator::vtkImageIterator
vtkImageIterator()
Default empty constructor, useful only when creating an array of iterators You need to call Initializ...
vtkImageIterator::BeginSpan
SpanIterator BeginSpan()
Return an iterator (pointer) for the span.
Definition: vtkImageIterator.h:64
vtkImageIterator::NextSpan
void NextSpan()
Move the iterator to the next span.
vtkImageIterator::SpanIterator
DType * SpanIterator
Definition: vtkImageIterator.h:38
vtkImageIterator::EndSpan
SpanIterator EndSpan()
Return an iterator (pointer) for the end of the span.
Definition: vtkImageIterator.h:69
vtkImageIterator::IsAtEnd
vtkTypeBool IsAtEnd()
Test if the end of the extent has been reached.
Definition: vtkImageIterator.h:74
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:64
vtkExternTemplateMacro
vtkExternTemplateMacro(extern template class VTKCOMMONDATAMODEL_EXPORT vtkImageIterator)
vtkSystemIncludes.h
vtkIdType
int vtkIdType
Definition: vtkType.h:315