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