ITK  5.2.0
Insight Toolkit
itkImageBufferRange.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 
19 #ifndef itkImageBufferRange_h
20 #define itkImageBufferRange_h
21 
22 #include <cassert>
23 #include <cstddef> // For ptrdiff_t.
24 #include <iterator> // For random_access_iterator_tag.
25 #include <limits>
26 #include <type_traits> // For conditional, is_same, and is_const.
27 
28 #include "itkMacro.h" // For itkNotUsed.
33 #include "itkImageRegion.h"
34 
35 namespace itk
36 {
37 
72 template <typename TImage>
73 class ImageBufferRange final
74 {
75 private:
76  using ImageType = TImage;
77  using PixelType = typename TImage::PixelType;
78  using InternalPixelType = typename TImage::InternalPixelType;
79  using AccessorFunctorType = typename TImage::AccessorFunctorType;
80 
81  // Tells whether or not this range supports direct pixel access. If it does,
82  // iterator::operator*() returns a reference to the internally stored pixel,
83  // otherwise iterator::operator*() returns a proxy, which internally uses the
84  // AccessorFunctor of the image to access the pixel indirectly.
85  constexpr static bool SupportsDirectPixelAccess =
86  std::is_same<PixelType, InternalPixelType>::value &&
87  std::is_same<typename TImage::AccessorType, DefaultPixelAccessor<PixelType>>::value &&
88  std::is_same<AccessorFunctorType, DefaultPixelAccessorFunctor<typename std::remove_const<TImage>::type>>::value;
89 
90  // Tells whether or not this range is using a pointer as iterator.
92 
94  {};
95 
97  typename std::conditional<SupportsDirectPixelAccess, EmptyAccessorFunctor, AccessorFunctorType>::type;
98 
99  // PixelProxy: internal class that aims to act like a reference to a pixel:
100  // It acts either like 'PixelType &' or like 'const PixelType &', depending
101  // on its boolean template argument, VIsConst.
102  // The proxy retrieves the pixel value using the AccessorFunctor from the image.
103  // Note: the extra TDummy argument aims to fix AppleClang 6.0.0.6000056 error
104  // "explicit specialization of 'PixelProxy'"and GCC 5.4.0 error "explicit
105  // specialization in non-namespace scope".
106  template <bool VIsConst, typename TDummy = void>
108  {};
109 
110  // PixelProxy specialization for const pixel types:
111  // acts like 'const PixelType &'
112  template <typename TDummy>
113  class PixelProxy<true, TDummy> final
114  {
115  private:
116  // Reference to the internal representation of the pixel, located in the image buffer.
118 
119  // The accessor functor of the image.
121 
122  public:
123  // Deleted member functions:
124  PixelProxy() = delete;
125  PixelProxy &
126  operator=(const PixelProxy &) = delete;
127 
128  // Explicitly-defaulted member functions:
129  PixelProxy(const PixelProxy &) ITK_NOEXCEPT = default;
130  ~PixelProxy() = default;
131 
132  // Constructor, called directly by operator*() of the iterator class.
133  PixelProxy(const InternalPixelType & internalPixel, const AccessorFunctorType & accessorFunctor) ITK_NOEXCEPT
134  : m_InternalPixel{ internalPixel }
135  , m_AccessorFunctor(accessorFunctor)
136  {}
137 
138  // Allows implicit conversion from non-const to const proxy.
139  PixelProxy(const PixelProxy<false> & pixelProxy) ITK_NOEXCEPT
140  : m_InternalPixel{ pixelProxy.m_InternalPixel }
141  , m_AccessorFunctor{ pixelProxy.m_AccessorFunctor }
142  {}
143 
144  // Conversion operator.
145  operator PixelType() const ITK_NOEXCEPT { return m_AccessorFunctor.Get(m_InternalPixel); }
146  };
147 
148 
149  // PixelProxy specialization for non-const pixel types:
150  // acts like 'PixelType &'.
151  template <typename TDummy>
152  class PixelProxy<false, TDummy> final
153  {
154  private:
155  // The const proxy is a friend, to ease implementing conversion from
156  // a non-const proxy to a const proxy.
157  friend class PixelProxy<true>;
158 
159  // Reference to the internal representation of the pixel, located in the image buffer.
161 
162  // The accessor functor of the image.
164 
165  public:
166  // Deleted member functions:
167  PixelProxy() = delete;
168 
169  // Explicitly-defaulted member functions:
170  ~PixelProxy() = default;
171  PixelProxy(const PixelProxy &) ITK_NOEXCEPT = default;
172 
173  // Constructor, called directly by operator*() of the iterator class.
174  explicit PixelProxy(InternalPixelType & internalPixel, const AccessorFunctorType & accessorFunctor) ITK_NOEXCEPT
175  : m_InternalPixel{ internalPixel }
176  , m_AccessorFunctor(accessorFunctor)
177  {}
178 
179  // Conversion operator.
180  operator PixelType() const ITK_NOEXCEPT { return m_AccessorFunctor.Get(m_InternalPixel); }
181 
182  // Operator to assign a pixel value to the proxy.
183  PixelProxy &
184  operator=(const PixelType & pixelValue) ITK_NOEXCEPT
185  {
186  m_AccessorFunctor.Set(m_InternalPixel, pixelValue);
187  return *this;
188  }
189 
190  // Copy-assignment operator.
191  PixelProxy &
192  operator=(const PixelProxy & pixelProxy) ITK_NOEXCEPT
193  {
194  // Note that this assignment operator only copies the pixel value.
195  // That is the normal behavior when a reference is assigned to another.
196  const PixelType pixelValue = pixelProxy;
197  *this = pixelValue;
198  return *this;
199  }
200 
201 
202  friend void
203  swap(PixelProxy lhs, PixelProxy rhs) ITK_NOEXCEPT
204  {
205  const auto lhsPixelValue = lhs.m_AccessorFunctor.Get(lhs.m_InternalPixel);
206  const auto rhsPixelValue = rhs.m_AccessorFunctor.Get(rhs.m_InternalPixel);
207 
208  // Swap only the pixel values, not the image buffer pointers!
209  lhs.m_AccessorFunctor.Set(lhs.m_InternalPixel, rhsPixelValue);
210  rhs.m_AccessorFunctor.Set(rhs.m_InternalPixel, lhsPixelValue);
211  }
212  };
213 
214 
227  template <bool VIsConst>
228  class QualifiedIterator final
229  {
230  private:
231  // Const and non-const iterators are friends, in order to implement the
232  // constructor that allow conversion from non-const to const iterator.
233  friend class QualifiedIterator<!VIsConst>;
234 
235  // ImageBufferRange is a friend, as it should be the only one that can
236  // directly use the private constructor of the iterator.
237  friend class ImageBufferRange;
238 
239  // Image type class that is either 'const' or non-const qualified, depending on QualifiedIterator and TImage.
240  using QualifiedImageType = typename std::conditional<VIsConst, const ImageType, ImageType>::type;
241 
242  static constexpr bool IsImageTypeConst = std::is_const<QualifiedImageType>::value;
243 
245  typename std::conditional<IsImageTypeConst, const InternalPixelType, InternalPixelType>::type;
246 
247  // Pixel type class that is either 'const' or non-const qualified, depending on QualifiedImageType.
248  using QualifiedPixelType = typename std::conditional<IsImageTypeConst, const PixelType, PixelType>::type;
249 
250 
251  // Wraps a reference to a pixel.
253  {
254  public:
256 
257  // Wraps the pixel reference that is specified by the first argument.
258  // Note: the second parameter is unused, but it is there just to support
259  // the use case of iterator::operator*(), which uses either
260  // PixelReferenceWrapper or PixelProxy, interchangeable, in a generic way.
261  // (PixelProxy has an explicit constructor for which the second parameter
262  // is its essential AccessorFunctor parameter!)
264  EmptyAccessorFunctor itkNotUsed(accessorFunctor)) ITK_NOEXCEPT : m_Pixel(pixel)
265  {}
266 
267  // Converts implicitly to a reference to the pixel.
268  operator QualifiedPixelType &() const ITK_NOEXCEPT { return m_Pixel; }
269  };
270 
271 
272  // QualifiedIterator data members (strictly private):
273 
274  // The accessor functor of the image.
276 
277  // Pointer to the current pixel.
279 
280  // Private constructor, used to create the begin and the end iterator of a range.
281  // Only used by its friend class ImageBufferRange.
283  QualifiedInternalPixelType * const internalPixelPointer) ITK_NOEXCEPT
284  :
285  // Note: Use parentheses instead of curly braces to initialize data members,
286  // to avoid AppleClang 6.0.0.6000056 compilation error, "no viable conversion..."
287  m_OptionalAccessorFunctor(accessorFunctor)
288  , m_InternalPixelPointer{ internalPixelPointer }
289  {}
290 
291  public:
292  // Types conforming the iterator requirements of the C++ standard library:
293  using difference_type = std::ptrdiff_t;
295  using reference =
296  typename std::conditional<SupportsDirectPixelAccess, QualifiedPixelType &, PixelProxy<IsImageTypeConst>>::type;
298  using iterator_category = std::random_access_iterator_tag;
299 
300 
311  QualifiedIterator() = default;
312 
315  QualifiedIterator(const QualifiedIterator<false> & arg) ITK_NOEXCEPT
316  :
317  // Note: Use parentheses instead of curly braces to initialize data members,
318  // to avoid AppleClang 6.0.0.6000056 compilation error, "no viable conversion..."
319  m_OptionalAccessorFunctor(arg.m_OptionalAccessorFunctor)
320  , m_InternalPixelPointer{ arg.m_InternalPixelPointer }
321  {}
323 
324 
326  reference operator*() const ITK_NOEXCEPT
327  {
328  assert(m_InternalPixelPointer != nullptr);
329 
330  using PixelWrapper = typename std::conditional<SupportsDirectPixelAccess, PixelReferenceWrapper, reference>::type;
331 
332  return PixelWrapper{ *m_InternalPixelPointer, m_OptionalAccessorFunctor };
333  }
334 
335 
338  operator++() ITK_NOEXCEPT
339  {
340  assert(m_InternalPixelPointer != nullptr);
342  return *this;
343  }
345 
346 
350  operator++(int) ITK_NOEXCEPT
351  {
352  auto result = *this;
353  ++(*this);
354  return result;
355  }
357 
358 
361  operator--() ITK_NOEXCEPT
362  {
363  assert(m_InternalPixelPointer != nullptr);
365  return *this;
366  }
368 
369 
373  operator--(int) ITK_NOEXCEPT
374  {
375  auto result = *this;
376  --(*this);
377  return result;
378  }
380 
381 
385  friend bool
386  operator==(const QualifiedIterator & lhs, const QualifiedIterator & rhs) ITK_NOEXCEPT
387  {
388  return lhs.m_InternalPixelPointer == rhs.m_InternalPixelPointer;
389  }
390 
391 
393  friend bool
394  operator!=(const QualifiedIterator & lhs, const QualifiedIterator & rhs) ITK_NOEXCEPT
395  {
396  // Implemented just like the corresponding std::rel_ops operator.
397  return !(lhs == rhs);
398  }
399 
400 
402  friend bool
403  operator<(const QualifiedIterator & lhs, const QualifiedIterator & rhs) ITK_NOEXCEPT
404  {
405  return lhs.m_InternalPixelPointer < rhs.m_InternalPixelPointer;
406  }
407 
408 
410  friend bool
411  operator>(const QualifiedIterator & lhs, const QualifiedIterator & rhs) ITK_NOEXCEPT
412  {
413  // Implemented just like the corresponding std::rel_ops operator.
414  return rhs < lhs;
415  }
416 
417 
419  friend bool
420  operator<=(const QualifiedIterator & lhs, const QualifiedIterator & rhs) ITK_NOEXCEPT
421  {
422  // Implemented just like the corresponding std::rel_ops operator.
423  return !(rhs < lhs);
424  }
425 
426 
428  friend bool
429  operator>=(const QualifiedIterator & lhs, const QualifiedIterator & rhs) ITK_NOEXCEPT
430  {
431  // Implemented just like the corresponding std::rel_ops operator.
432  return !(lhs < rhs);
433  }
434 
435 
437  friend QualifiedIterator &
438  operator+=(QualifiedIterator & it, const difference_type n) ITK_NOEXCEPT
439  {
440  it.m_InternalPixelPointer += n;
441  return it;
442  }
444 
446  friend QualifiedIterator &
447  operator-=(QualifiedIterator & it, const difference_type n) ITK_NOEXCEPT
448  {
449  it += (-n);
450  return it;
451  }
453 
455  friend difference_type
456  operator-(const QualifiedIterator & lhs, const QualifiedIterator & rhs) ITK_NOEXCEPT
457  {
458  return lhs.m_InternalPixelPointer - rhs.m_InternalPixelPointer;
459  }
460 
461 
463  friend QualifiedIterator
464  operator+(QualifiedIterator it, const difference_type n) ITK_NOEXCEPT
465  {
466  return it += n;
467  }
468 
469 
471  friend QualifiedIterator
472  operator+(const difference_type n, QualifiedIterator it) ITK_NOEXCEPT
473  {
474  return it += n;
475  }
476 
477 
479  friend QualifiedIterator
480  operator-(QualifiedIterator it, const difference_type n) ITK_NOEXCEPT
481  {
482  return it += (-n);
483  }
484 
485 
487  reference operator[](const difference_type n) const ITK_NOEXCEPT { return *(*this + n); }
488 
489 
492  operator=(const QualifiedIterator &) ITK_NOEXCEPT = default;
493  };
494 
495  static constexpr bool IsImageTypeConst = std::is_const<TImage>::value;
496 
498  typename std::conditional<IsImageTypeConst, const InternalPixelType, InternalPixelType>::type;
499 
501  {
502  private:
504 
505  public:
506  explicit AccessorFunctorInitializer(ImageType & image) ITK_NOEXCEPT : m_Image(image) {}
507 
508  operator EmptyAccessorFunctor() const ITK_NOEXCEPT { return {}; }
509 
510  operator AccessorFunctorType() const ITK_NOEXCEPT
511  {
512  AccessorFunctorType result = {};
513  result.SetPixelAccessor(m_Image.GetPixelAccessor());
514  result.SetBegin(m_Image.ImageType::GetBufferPointer());
515  return result;
516  }
517  };
518 
519 
520  // Helper class for begin() and end(), to ease proper initialization of an
521  // ImageBufferRange iterator (either a 'QualifiedIterator' or a raw pixel pointer).
523  {
524  private:
527 
528  public:
529  explicit IteratorInitializer(OptionalAccessorFunctorType optionalAccessorFunctor,
530  QualifiedInternalPixelType * internalPixelPointer) ITK_NOEXCEPT
531  : m_OptionalAccessorFunctor(optionalAccessorFunctor)
532  , m_InternalPixelPointer(internalPixelPointer)
533  {}
534 
535  // Converts to a 'QualifiedIterator' object.
536  template <bool VIsConst>
537  operator QualifiedIterator<VIsConst>() const ITK_NOEXCEPT
538  {
540  }
541 
542  // Converts to a raw pixel pointer.
543  operator QualifiedInternalPixelType *() const ITK_NOEXCEPT { return m_InternalPixelPointer; }
544  };
545 
546 
547  // ImageBufferRange data members (strictly private):
548 
549  // The accessor functor of the image.
551 
552  // Pointer to the buffer of the image.
554 
555  // Image size.
557 
558 public:
559  using const_iterator =
560  typename std::conditional<UsingPointerAsIterator, const InternalPixelType *, QualifiedIterator<true>>::type;
561  using iterator = typename std::
562  conditional<UsingPointerAsIterator, QualifiedInternalPixelType *, QualifiedIterator<IsImageTypeConst>>::type;
563  using reverse_iterator = std::reverse_iterator<iterator>;
564  using const_reverse_iterator = std::reverse_iterator<const_iterator>;
565 
566 
572  ImageBufferRange() = default;
573 
574 
577  explicit ImageBufferRange(ImageType & image)
578  : // Note: Use parentheses instead of curly braces to initialize data members,
579  // to avoid AppleClang 6.0.0.6000056 compile errors, "no viable conversion..."
581  , m_ImageBufferPointer{ image.ImageType::GetBufferPointer() }
582  , m_NumberOfPixels{ image.ImageType::GetBufferedRegion().GetNumberOfPixels() }
583  {}
585 
586 
588  iterator
589  begin() const ITK_NOEXCEPT
590  {
592  }
593 
595  iterator
596  end() const ITK_NOEXCEPT
597  {
598  return IteratorInitializer{
601  };
602  }
603 
607  cbegin() const ITK_NOEXCEPT
608  {
609  return this->begin();
610  }
611 
614  cend() const ITK_NOEXCEPT
615  {
616  return this->end();
617  }
618 
621  rbegin() const ITK_NOEXCEPT
622  {
623  return reverse_iterator(this->end());
624  }
625 
628  rend() const ITK_NOEXCEPT
629  {
630  return reverse_iterator(this->begin());
631  }
632 
635  crbegin() const ITK_NOEXCEPT
636  {
637  return this->rbegin();
638  }
639 
642  crend() const ITK_NOEXCEPT
643  {
644  return this->rend();
645  }
646 
647 
649  std::size_t
650  size() const ITK_NOEXCEPT
651  {
652  return m_NumberOfPixels;
653  }
654 
655 
657  bool
658  empty() const ITK_NOEXCEPT
659  {
660  return m_NumberOfPixels == 0;
661  }
662 
663 
668  typename QualifiedIterator<false>::reference operator[](const std::size_t n) const ITK_NOEXCEPT
669  {
670  assert(n < this->size());
671  assert(n <= static_cast<std::size_t>(std::numeric_limits<std::ptrdiff_t>::max()));
673 
674  return this->begin()[static_cast<std::ptrdiff_t>(n)];
675  }
676 };
677 
682 template <typename TImage>
683 ImageBufferRange<TImage>
684 MakeImageBufferRange(TImage * const image)
685 {
686  if (image == nullptr)
687  {
688  return {};
689  }
690  else
691  {
692  return ImageBufferRange<TImage>{ *image };
693  }
694 }
696 
697 
698 } // namespace itk
699 #endif
itk::ImageBufferRange::empty
bool empty() const noexcept
Definition: itkImageBufferRange.h:658
itk::ImageBufferRange::PixelProxy< true, TDummy >::PixelProxy
PixelProxy(const InternalPixelType &internalPixel, const AccessorFunctorType &accessorFunctor) noexcept
Definition: itkImageBufferRange.h:133
itk::ImageBufferRange::QualifiedIterator::QualifiedIterator
QualifiedIterator()=default
itk::ImageBufferRange::PixelProxy< false, TDummy >::m_InternalPixel
InternalPixelType & m_InternalPixel
Definition: itkImageBufferRange.h:160
itk::ImageBufferRange::m_ImageBufferPointer
QualifiedInternalPixelType * m_ImageBufferPointer
Definition: itkImageBufferRange.h:553
itk::ImageBufferRange::QualifiedIterator::operator>
friend bool operator>(const QualifiedIterator &lhs, const QualifiedIterator &rhs) noexcept
Definition: itkImageBufferRange.h:411
itk::ImageBufferRange::IteratorInitializer
Definition: itkImageBufferRange.h:522
itk::ImageBufferRange::IteratorInitializer::IteratorInitializer
IteratorInitializer(OptionalAccessorFunctorType optionalAccessorFunctor, QualifiedInternalPixelType *internalPixelPointer) noexcept
Definition: itkImageBufferRange.h:529
itk::ImageBufferRange::QualifiedIterator
Definition: itkImageBufferRange.h:228
itk::ImageBufferRange::rend
reverse_iterator rend() const noexcept
Definition: itkImageBufferRange.h:628
itk::ImageBufferRange::size
std::vcl_size_t size() const noexcept
Definition: itkImageBufferRange.h:650
itk::ImageBufferRange::InternalPixelType
typename TImage::InternalPixelType InternalPixelType
Definition: itkImageBufferRange.h:78
itk::ImageBufferRange::QualifiedIterator::QualifiedIterator
QualifiedIterator(const QualifiedIterator< false > &arg) noexcept
Definition: itkImageBufferRange.h:315
itk::ImageBufferRange::IteratorInitializer::m_OptionalAccessorFunctor
OptionalAccessorFunctorType m_OptionalAccessorFunctor
Definition: itkImageBufferRange.h:525
itk::ImageBufferRange::QualifiedIterator::operator>=
friend bool operator>=(const QualifiedIterator &lhs, const QualifiedIterator &rhs) noexcept
Definition: itkImageBufferRange.h:429
itk::ImageBufferRange::crend
const_reverse_iterator crend() const noexcept
Definition: itkImageBufferRange.h:642
itk::ImageBufferRange::QualifiedIterator::operator[]
reference operator[](const difference_type n) const noexcept
Definition: itkImageBufferRange.h:487
itk::ImageBufferRange::QualifiedIterator::operator=
QualifiedIterator & operator=(const QualifiedIterator &) noexcept=default
itk::ImageBufferRange::QualifiedIterator::operator+
friend QualifiedIterator operator+(QualifiedIterator it, const difference_type n) noexcept
Definition: itkImageBufferRange.h:464
itk::ImageBufferRange::m_NumberOfPixels
SizeValueType m_NumberOfPixels
Definition: itkImageBufferRange.h:556
itk::ImageBufferRange::const_iterator
typename std::conditional< UsingPointerAsIterator, const InternalPixelType *, QualifiedIterator< true > >::type const_iterator
Definition: itkImageBufferRange.h:560
itk::ImageBufferRange::IteratorInitializer::m_InternalPixelPointer
QualifiedInternalPixelType * m_InternalPixelPointer
Definition: itkImageBufferRange.h:526
itk::ImageBufferRange::PixelProxy< true, TDummy >::PixelProxy
PixelProxy(const PixelProxy< false > &pixelProxy) noexcept
Definition: itkImageBufferRange.h:139
itk::ImageBufferRange::QualifiedIterator::QualifiedIterator
QualifiedIterator(const OptionalAccessorFunctorType &accessorFunctor, QualifiedInternalPixelType *const internalPixelPointer) noexcept
Definition: itkImageBufferRange.h:282
itk::ImageBufferRange::QualifiedIterator::QualifiedImageType
typename std::conditional< VIsConst, const ImageType, ImageType >::type QualifiedImageType
Definition: itkImageBufferRange.h:240
itk::ImageBufferRange::QualifiedIterator::operator--
QualifiedIterator & operator--() noexcept
Definition: itkImageBufferRange.h:361
itk::ImageBufferRange::PixelProxy< false, TDummy >::swap
friend void swap(PixelProxy lhs, PixelProxy rhs) noexcept
Definition: itkImageBufferRange.h:203
itk::ImageBufferRange::QualifiedIterator::operator-
friend QualifiedIterator operator-(QualifiedIterator it, const difference_type n) noexcept
Definition: itkImageBufferRange.h:480
itk::ImageBufferRange::PixelType
typename TImage::PixelType PixelType
Definition: itkImageBufferRange.h:77
itkImageRegion.h
itk::ImageBufferRange::QualifiedIterator::QualifiedPixelType
typename std::conditional< IsImageTypeConst, const PixelType, PixelType >::type QualifiedPixelType
Definition: itkImageBufferRange.h:248
itk::ImageBufferRange::PixelProxy< false, TDummy >::m_AccessorFunctor
const AccessorFunctorType m_AccessorFunctor
Definition: itkImageBufferRange.h:163
itk::ImageBufferRange::IsImageTypeConst
static constexpr bool IsImageTypeConst
Definition: itkImageBufferRange.h:495
itk::ImageBufferRange::end
iterator end() const noexcept
Definition: itkImageBufferRange.h:596
itkDefaultPixelAccessor.h
itk::ImageBufferRange::PixelProxy< false, TDummy >::operator=
PixelProxy & operator=(const PixelProxy &pixelProxy) noexcept
Definition: itkImageBufferRange.h:192
itk::ImageBufferRange::QualifiedIterator::operator+=
friend QualifiedIterator & operator+=(QualifiedIterator &it, const difference_type n) noexcept
Definition: itkImageBufferRange.h:438
itk::ImageBufferRange::QualifiedIterator::m_OptionalAccessorFunctor
OptionalAccessorFunctorType m_OptionalAccessorFunctor
Definition: itkImageBufferRange.h:275
itk::MakeImageBufferRange
ImageBufferRange< TImage > MakeImageBufferRange(TImage *const image)
Definition: itkImageBufferRange.h:684
itk::ImageBufferRange::QualifiedIterator::operator++
QualifiedIterator operator++(int) noexcept
Definition: itkImageBufferRange.h:350
itk::ImageBufferRange::const_reverse_iterator
std::reverse_iterator< const_iterator > const_reverse_iterator
Definition: itkImageBufferRange.h:564
itk::ImageBufferRange::QualifiedIterator::difference_type
std::ptrdiff_t difference_type
Definition: itkImageBufferRange.h:293
itkMacro.h
itk::ImageBufferRange::QualifiedIterator::value_type
PixelType value_type
Definition: itkImageBufferRange.h:294
itk::ImageBufferRange::QualifiedInternalPixelType
typename std::conditional< IsImageTypeConst, const InternalPixelType, InternalPixelType >::type QualifiedInternalPixelType
Definition: itkImageBufferRange.h:498
itk::ImageBufferRange::QualifiedIterator::operator<=
friend bool operator<=(const QualifiedIterator &lhs, const QualifiedIterator &rhs) noexcept
Definition: itkImageBufferRange.h:420
itk::ImageBufferRange::UsingPointerAsIterator
constexpr static bool UsingPointerAsIterator
Definition: itkImageBufferRange.h:91
itk::ImageBufferRange
Definition: itkImageBufferRange.h:73
itk::ImageBufferRange::EmptyAccessorFunctor
Definition: itkImageBufferRange.h:93
itk::ImageBufferRange::begin
iterator begin() const noexcept
Definition: itkImageBufferRange.h:589
itk::ImageBufferRange::reverse_iterator
std::reverse_iterator< iterator > reverse_iterator
Definition: itkImageBufferRange.h:563
itk::ImageBufferRange::ImageBufferRange
ImageBufferRange()=default
itkDefaultVectorPixelAccessor.h
itk::ImageBufferRange::QualifiedIterator::m_InternalPixelPointer
QualifiedInternalPixelType * m_InternalPixelPointer
Definition: itkImageBufferRange.h:278
itk::ImageBufferRange::iterator
typename std::conditional< UsingPointerAsIterator, QualifiedInternalPixelType *, QualifiedIterator< IsImageTypeConst > >::type iterator
Definition: itkImageBufferRange.h:562
itk::ImageBufferRange::QualifiedIterator::operator-=
friend QualifiedIterator & operator-=(QualifiedIterator &it, const difference_type n) noexcept
Definition: itkImageBufferRange.h:447
itk::ImageBufferRange::QualifiedIterator::pointer
QualifiedPixelType * pointer
Definition: itkImageBufferRange.h:297
itk::ImageBufferRange::PixelProxy< false, TDummy >::PixelProxy
PixelProxy(InternalPixelType &internalPixel, const AccessorFunctorType &accessorFunctor) noexcept
Definition: itkImageBufferRange.h:174
itk::ImageBufferRange::QualifiedIterator::operator<
friend bool operator<(const QualifiedIterator &lhs, const QualifiedIterator &rhs) noexcept
Definition: itkImageBufferRange.h:403
itk::ImageBufferRange::PixelProxy< true, TDummy >::m_AccessorFunctor
const AccessorFunctorType m_AccessorFunctor
Definition: itkImageBufferRange.h:120
itk::ImageBufferRange::QualifiedIterator::operator-
friend difference_type operator-(const QualifiedIterator &lhs, const QualifiedIterator &rhs) noexcept
Definition: itkImageBufferRange.h:456
itk::ImageBufferRange::ImageType
TImage ImageType
Definition: itkImageBufferRange.h:76
itkDefaultVectorPixelAccessorFunctor.h
itk::ImageBufferRange::QualifiedIterator::operator--
QualifiedIterator operator--(int) noexcept
Definition: itkImageBufferRange.h:373
itk::ImageBufferRange::QualifiedIterator::QualifiedInternalPixelType
typename std::conditional< IsImageTypeConst, const InternalPixelType, InternalPixelType >::type QualifiedInternalPixelType
Definition: itkImageBufferRange.h:245
itk::ImageBufferRange::QualifiedIterator::IsImageTypeConst
static constexpr bool IsImageTypeConst
Definition: itkImageBufferRange.h:242
itk::ImageBufferRange::QualifiedIterator::operator==
friend bool operator==(const QualifiedIterator &lhs, const QualifiedIterator &rhs) noexcept
Definition: itkImageBufferRange.h:386
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::ImageBufferRange::OptionalAccessorFunctorType
typename std::conditional< SupportsDirectPixelAccess, EmptyAccessorFunctor, AccessorFunctorType >::type OptionalAccessorFunctorType
Definition: itkImageBufferRange.h:97
itk::ImageBufferRange::AccessorFunctorInitializer::m_Image
ImageType & m_Image
Definition: itkImageBufferRange.h:503
itk::ImageBufferRange::QualifiedIterator::reference
typename std::conditional< SupportsDirectPixelAccess, QualifiedPixelType &, PixelProxy< IsImageTypeConst > >::type reference
Definition: itkImageBufferRange.h:296
itk::ImageBufferRange::cend
const_iterator cend() const noexcept
Definition: itkImageBufferRange.h:614
itk::ImageBufferRange::PixelProxy< true, TDummy >::m_InternalPixel
const InternalPixelType & m_InternalPixel
Definition: itkImageBufferRange.h:117
itk::ImageBufferRange::rbegin
reverse_iterator rbegin() const noexcept
Definition: itkImageBufferRange.h:621
itk::ImageBufferRange::AccessorFunctorInitializer::AccessorFunctorInitializer
AccessorFunctorInitializer(ImageType &image) noexcept
Definition: itkImageBufferRange.h:506
itk::ImageBufferRange::QualifiedIterator::operator++
QualifiedIterator & operator++() noexcept
Definition: itkImageBufferRange.h:338
itkDefaultPixelAccessorFunctor.h
itk::ImageBufferRange::SupportsDirectPixelAccess
constexpr static bool SupportsDirectPixelAccess
Definition: itkImageBufferRange.h:85
itk::ImageBufferRange::QualifiedIterator::operator*
reference operator*() const noexcept
Definition: itkImageBufferRange.h:326
itk::ImageBufferRange::AccessorFunctorInitializer
Definition: itkImageBufferRange.h:500
itk::ImageBufferRange::QualifiedIterator::iterator_category
std::random_access_iterator_tag iterator_category
Definition: itkImageBufferRange.h:298
itk::ImageBufferRange::QualifiedIterator::PixelReferenceWrapper::PixelReferenceWrapper
PixelReferenceWrapper(QualifiedPixelType &pixel, EmptyAccessorFunctor) noexcept
Definition: itkImageBufferRange.h:263
itk::ImageBufferRange::PixelProxy< false, TDummy >::operator=
PixelProxy & operator=(const PixelType &pixelValue) noexcept
Definition: itkImageBufferRange.h:184
itk::ImageBufferRange::AccessorFunctorType
typename TImage::AccessorFunctorType AccessorFunctorType
Definition: itkImageBufferRange.h:79
itk::ImageBufferRange::QualifiedIterator::PixelReferenceWrapper
Definition: itkImageBufferRange.h:252
itk::ImageBufferRange::crbegin
const_reverse_iterator crbegin() const noexcept
Definition: itkImageBufferRange.h:635
itk::ImageBufferRange::cbegin
const_iterator cbegin() const noexcept
Definition: itkImageBufferRange.h:607
itk::ImageBufferRange::QualifiedIterator::operator!=
friend bool operator!=(const QualifiedIterator &lhs, const QualifiedIterator &rhs) noexcept
Definition: itkImageBufferRange.h:394
itk::ImageBufferRange::PixelProxy
Definition: itkImageBufferRange.h:107
itk::ImageBufferRange::QualifiedIterator::PixelReferenceWrapper::m_Pixel
QualifiedPixelType & m_Pixel
Definition: itkImageBufferRange.h:255
itk::ImageBufferRange::ImageBufferRange
ImageBufferRange(ImageType &image)
Definition: itkImageBufferRange.h:577
itk::SizeValueType
unsigned long SizeValueType
Definition: itkIntTypes.h:83
itk::ImageBufferRange::QualifiedIterator::operator+
friend QualifiedIterator operator+(const difference_type n, QualifiedIterator it) noexcept
Definition: itkImageBufferRange.h:472
itk::ImageBufferRange::operator[]
QualifiedIterator< false >::reference operator[](const std::vcl_size_t n) const noexcept
Definition: itkImageBufferRange.h:668
itk::ImageBufferRange::m_OptionalAccessorFunctor
OptionalAccessorFunctorType m_OptionalAccessorFunctor
Definition: itkImageBufferRange.h:550