ITK  5.3.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  * 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 
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  static constexpr 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<std::remove_const_t<TImage>>>::value;
89 
90  // Tells whether or not this range is using a pointer as iterator.
92 
94  {};
95 
97  std::conditional_t<SupportsDirectPixelAccess, EmptyAccessorFunctor, AccessorFunctorType>;
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 &) noexcept = default;
130  ~PixelProxy() = default;
131 
132  // Constructor, called directly by operator*() of the iterator class.
133  PixelProxy(const InternalPixelType & internalPixel, const AccessorFunctorType & accessorFunctor) 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) noexcept
140  : m_InternalPixel{ pixelProxy.m_InternalPixel }
141  , m_AccessorFunctor{ pixelProxy.m_AccessorFunctor }
142  {}
143 
144  // Conversion operator.
145  operator PixelType() const 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 &) noexcept = default;
172 
173  // Constructor, called directly by operator*() of the iterator class.
174  explicit PixelProxy(InternalPixelType & internalPixel, const AccessorFunctorType & accessorFunctor) noexcept
175  : m_InternalPixel{ internalPixel }
176  , m_AccessorFunctor(accessorFunctor)
177  {}
178 
179  // Conversion operator.
180  operator PixelType() const 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) 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) 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) 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 = std::conditional_t<VIsConst, const ImageType, ImageType>;
241 
242  static constexpr bool IsImageTypeConst = std::is_const<QualifiedImageType>::value;
243 
244  using QualifiedInternalPixelType = std::conditional_t<IsImageTypeConst, const InternalPixelType, InternalPixelType>;
245 
246  // Pixel type class that is either 'const' or non-const qualified, depending on QualifiedImageType.
247  using QualifiedPixelType = std::conditional_t<IsImageTypeConst, const PixelType, PixelType>;
248 
249 
250  // Wraps a reference to a pixel.
252  {
253  public:
255 
256  // Wraps the pixel reference that is specified by the first argument.
257  // Note: the second parameter is unused, but it is there just to support
258  // the use case of iterator::operator*(), which uses either
259  // PixelReferenceWrapper or PixelProxy, interchangeable, in a generic way.
260  // (PixelProxy has an explicit constructor for which the second parameter
261  // is its essential AccessorFunctor parameter!)
263  EmptyAccessorFunctor itkNotUsed(accessorFunctor)) noexcept
264  : m_Pixel(pixel)
265  {}
266 
267  // Converts implicitly to a reference to the pixel.
268  operator QualifiedPixelType &() const 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) noexcept
284  : // Note: Use parentheses instead of curly braces to initialize data members,
285  // to avoid AppleClang 6.0.0.6000056 compilation error, "no viable conversion..."
286  m_OptionalAccessorFunctor(accessorFunctor)
287  , m_InternalPixelPointer{ internalPixelPointer }
288  {}
289 
290  public:
291  // Types conforming the iterator requirements of the C++ standard library:
292  using difference_type = ptrdiff_t;
294  using reference = std::conditional_t<SupportsDirectPixelAccess, QualifiedPixelType &, PixelProxy<IsImageTypeConst>>;
296  using iterator_category = std::random_access_iterator_tag;
297 
298 
309  QualifiedIterator() = default;
310 
314  : // Note: Use parentheses instead of curly braces to initialize data members,
315  // to avoid AppleClang 6.0.0.6000056 compilation error, "no viable conversion..."
316  m_OptionalAccessorFunctor(arg.m_OptionalAccessorFunctor)
317  , m_InternalPixelPointer{ arg.m_InternalPixelPointer }
318  {}
323  reference operator*() const noexcept
324  {
325  assert(m_InternalPixelPointer != nullptr);
326 
327  using PixelWrapper = std::conditional_t<SupportsDirectPixelAccess, PixelReferenceWrapper, reference>;
328 
329  return PixelWrapper{ *m_InternalPixelPointer, m_OptionalAccessorFunctor };
330  }
331 
332 
335  operator++() noexcept
336  {
337  assert(m_InternalPixelPointer != nullptr);
339  return *this;
340  }
347  operator++(int) noexcept
348  {
349  auto result = *this;
350  ++(*this);
351  return result;
352  }
358  operator--() noexcept
359  {
360  assert(m_InternalPixelPointer != nullptr);
362  return *this;
363  }
370  operator--(int) noexcept
371  {
372  auto result = *this;
373  --(*this);
374  return result;
375  }
382  friend bool
383  operator==(const QualifiedIterator & lhs, const QualifiedIterator & rhs) noexcept
384  {
385  return lhs.m_InternalPixelPointer == rhs.m_InternalPixelPointer;
386  }
387 
388 
390  friend bool
391  operator!=(const QualifiedIterator & lhs, const QualifiedIterator & rhs) noexcept
392  {
393  // Implemented just like the corresponding std::rel_ops operator.
394  return !(lhs == rhs);
395  }
396 
397 
399  friend bool
400  operator<(const QualifiedIterator & lhs, const QualifiedIterator & rhs) noexcept
401  {
402  return lhs.m_InternalPixelPointer < rhs.m_InternalPixelPointer;
403  }
404 
405 
407  friend bool
408  operator>(const QualifiedIterator & lhs, const QualifiedIterator & rhs) noexcept
409  {
410  // Implemented just like the corresponding std::rel_ops operator.
411  return rhs < lhs;
412  }
413 
414 
416  friend bool
417  operator<=(const QualifiedIterator & lhs, const QualifiedIterator & rhs) noexcept
418  {
419  // Implemented just like the corresponding std::rel_ops operator.
420  return !(rhs < lhs);
421  }
422 
423 
425  friend bool
426  operator>=(const QualifiedIterator & lhs, const QualifiedIterator & rhs) noexcept
427  {
428  // Implemented just like the corresponding std::rel_ops operator.
429  return !(lhs < rhs);
430  }
431 
432 
434  friend QualifiedIterator &
436  {
437  it.m_InternalPixelPointer += n;
438  return it;
439  }
443  friend QualifiedIterator &
445  {
446  it += (-n);
447  return it;
448  }
452  friend difference_type
453  operator-(const QualifiedIterator & lhs, const QualifiedIterator & rhs) noexcept
454  {
455  return lhs.m_InternalPixelPointer - rhs.m_InternalPixelPointer;
456  }
457 
458 
460  friend QualifiedIterator
462  {
463  return it += n;
464  }
465 
466 
468  friend QualifiedIterator
470  {
471  return it += n;
472  }
473 
474 
476  friend QualifiedIterator
478  {
479  return it += (-n);
480  }
481 
482 
484  reference operator[](const difference_type n) const noexcept { return *(*this + n); }
485 
486 
489  operator=(const QualifiedIterator &) noexcept = default;
490  };
491 
492  static constexpr bool IsImageTypeConst = std::is_const<TImage>::value;
493 
494  using QualifiedInternalPixelType = std::conditional_t<IsImageTypeConst, const InternalPixelType, InternalPixelType>;
495 
497  {
498  private:
500 
501  public:
502  explicit AccessorFunctorInitializer(ImageType & image) noexcept
503  : m_Image(image)
504  {}
505 
506  operator EmptyAccessorFunctor() const noexcept { return {}; }
507 
508  operator AccessorFunctorType() const noexcept
509  {
510  AccessorFunctorType result = {};
511  result.SetPixelAccessor(m_Image.GetPixelAccessor());
512  result.SetBegin(m_Image.ImageType::GetBufferPointer());
513  return result;
514  }
515  };
516 
517 
518  // Helper class for begin() and end(), to ease proper initialization of an
519  // ImageBufferRange iterator (either a 'QualifiedIterator' or a raw pixel pointer).
521  {
522  private:
525 
526  public:
527  explicit IteratorInitializer(OptionalAccessorFunctorType optionalAccessorFunctor,
528  QualifiedInternalPixelType * internalPixelPointer) noexcept
529  : m_OptionalAccessorFunctor(optionalAccessorFunctor)
530  , m_InternalPixelPointer(internalPixelPointer)
531  {}
532 
533  // Converts to a 'QualifiedIterator' object.
534  template <bool VIsConst>
535  operator QualifiedIterator<VIsConst>() const noexcept
536  {
538  }
539 
540  // Converts to a raw pixel pointer.
541  operator QualifiedInternalPixelType *() const noexcept { return m_InternalPixelPointer; }
542  };
543 
544 
545  // ImageBufferRange data members (strictly private):
546 
547  // The accessor functor of the image.
549 
550  // Pointer to the buffer of the image.
552 
553  // Image size.
555 
556 public:
557  using const_iterator = std::conditional_t<UsingPointerAsIterator, const InternalPixelType *, QualifiedIterator<true>>;
558  using iterator =
559  std::conditional_t<UsingPointerAsIterator, QualifiedInternalPixelType *, QualifiedIterator<IsImageTypeConst>>;
560  using reverse_iterator = std::reverse_iterator<iterator>;
561  using const_reverse_iterator = std::reverse_iterator<const_iterator>;
562 
563 
569  ImageBufferRange() = default;
570 
571 
574  explicit ImageBufferRange(ImageType & image)
575  : // Note: Use parentheses instead of curly braces to initialize data members,
576  // to avoid AppleClang 6.0.0.6000056 compile errors, "no viable conversion..."
578  , m_ImageBufferPointer{ image.ImageType::GetBufferPointer() }
579  , m_NumberOfPixels{ image.ImageType::GetBufferedRegion().GetNumberOfPixels() }
580  {}
585  iterator
586  begin() const noexcept
587  {
589  }
590 
592  iterator
593  end() const noexcept
594  {
595  return IteratorInitializer{
598  };
599  }
600 
604  cbegin() const noexcept
605  {
606  return this->begin();
607  }
608 
611  cend() const noexcept
612  {
613  return this->end();
614  }
615 
618  rbegin() const noexcept
619  {
620  return reverse_iterator(this->end());
621  }
622 
625  rend() const noexcept
626  {
627  return reverse_iterator(this->begin());
628  }
629 
632  crbegin() const noexcept
633  {
634  return this->rbegin();
635  }
636 
639  crend() const noexcept
640  {
641  return this->rend();
642  }
643 
644 
646  size_t
647  size() const noexcept
648  {
649  return m_NumberOfPixels;
650  }
651 
652 
654  bool
655  empty() const noexcept
656  {
657  return m_NumberOfPixels == 0;
658  }
659 
660 
665  typename QualifiedIterator<false>::reference operator[](const size_t n) const noexcept
666  {
667  assert(n < this->size());
668  assert(n <= static_cast<size_t>(std::numeric_limits<ptrdiff_t>::max()));
671  return this->begin()[static_cast<ptrdiff_t>(n)];
672  }
673 };
674 
679 template <typename TImage>
680 ImageBufferRange<TImage>
681 MakeImageBufferRange(TImage * const image)
682 {
683  if (image == nullptr)
684  {
685  return {};
686  }
687  else
688  {
689  return ImageBufferRange<TImage>{ *image };
690  }
691 }
695 } // namespace itk
696 #endif
itk::ImageBufferRange::empty
bool empty() const noexcept
Definition: itkImageBufferRange.h:655
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::size
vcl_size_t size() const noexcept
Definition: itkImageBufferRange.h:647
itk::ImageBufferRange::PixelProxy< false, TDummy >::m_InternalPixel
InternalPixelType & m_InternalPixel
Definition: itkImageBufferRange.h:160
itk::ImageBufferRange::m_ImageBufferPointer
QualifiedInternalPixelType * m_ImageBufferPointer
Definition: itkImageBufferRange.h:551
itk::ImageBufferRange::QualifiedIterator::operator>
friend bool operator>(const QualifiedIterator &lhs, const QualifiedIterator &rhs) noexcept
Definition: itkImageBufferRange.h:408
itk::ImageBufferRange::IteratorInitializer
Definition: itkImageBufferRange.h:520
itk::ImageBufferRange::IteratorInitializer::IteratorInitializer
IteratorInitializer(OptionalAccessorFunctorType optionalAccessorFunctor, QualifiedInternalPixelType *internalPixelPointer) noexcept
Definition: itkImageBufferRange.h:527
itk::ImageBufferRange::QualifiedIterator
Definition: itkImageBufferRange.h:228
itk::ImageBufferRange::rend
reverse_iterator rend() const noexcept
Definition: itkImageBufferRange.h:625
itk::ImageBufferRange::InternalPixelType
typename TImage::InternalPixelType InternalPixelType
Definition: itkImageBufferRange.h:78
itk::ImageBufferRange::QualifiedIterator::QualifiedIterator
QualifiedIterator(const QualifiedIterator< false > &arg) noexcept
Definition: itkImageBufferRange.h:313
itk::ImageBufferRange::IteratorInitializer::m_OptionalAccessorFunctor
OptionalAccessorFunctorType m_OptionalAccessorFunctor
Definition: itkImageBufferRange.h:523
itk::ImageBufferRange::QualifiedIterator::operator>=
friend bool operator>=(const QualifiedIterator &lhs, const QualifiedIterator &rhs) noexcept
Definition: itkImageBufferRange.h:426
itk::ImageBufferRange::crend
const_reverse_iterator crend() const noexcept
Definition: itkImageBufferRange.h:639
itk::ImageBufferRange::QualifiedIterator::operator[]
reference operator[](const difference_type n) const noexcept
Definition: itkImageBufferRange.h:484
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:461
itk::ImageBufferRange::m_NumberOfPixels
SizeValueType m_NumberOfPixels
Definition: itkImageBufferRange.h:554
itk::ImageBufferRange::IteratorInitializer::m_InternalPixelPointer
QualifiedInternalPixelType * m_InternalPixelPointer
Definition: itkImageBufferRange.h:524
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::operator--
QualifiedIterator & operator--() noexcept
Definition: itkImageBufferRange.h:358
itk::ImageBufferRange::OptionalAccessorFunctorType
std::conditional_t< SupportsDirectPixelAccess, EmptyAccessorFunctor, AccessorFunctorType > OptionalAccessorFunctorType
Definition: itkImageBufferRange.h:97
itk::ImageBufferRange::PixelProxy< false, TDummy >::swap
friend void swap(PixelProxy lhs, PixelProxy rhs) noexcept
Definition: itkImageBufferRange.h:203
itk::ImageBufferRange::const_iterator
std::conditional_t< UsingPointerAsIterator, const InternalPixelType *, QualifiedIterator< true > > const_iterator
Definition: itkImageBufferRange.h:557
itk::ImageBufferRange::QualifiedIterator::operator-
friend QualifiedIterator operator-(QualifiedIterator it, const difference_type n) noexcept
Definition: itkImageBufferRange.h:477
itk::ImageBufferRange::PixelType
typename TImage::PixelType PixelType
Definition: itkImageBufferRange.h:77
itkImageRegion.h
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:492
itk::ImageBufferRange::end
iterator end() const noexcept
Definition: itkImageBufferRange.h:593
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:435
itk::ImageBufferRange::QualifiedIterator::m_OptionalAccessorFunctor
OptionalAccessorFunctorType m_OptionalAccessorFunctor
Definition: itkImageBufferRange.h:275
itk::MakeImageBufferRange
ImageBufferRange< TImage > MakeImageBufferRange(TImage *const image)
Definition: itkImageBufferRange.h:681
itk::ImageBufferRange::QualifiedIterator::operator++
QualifiedIterator operator++(int) noexcept
Definition: itkImageBufferRange.h:347
itk::ImageBufferRange::const_reverse_iterator
std::reverse_iterator< const_iterator > const_reverse_iterator
Definition: itkImageBufferRange.h:561
itk::ImageBufferRange::QualifiedIterator::difference_type
ptrdiff_t difference_type
Definition: itkImageBufferRange.h:292
itkMacro.h
itk::ImageBufferRange::operator[]
QualifiedIterator< false >::reference operator[](const vcl_size_t n) const noexcept
Definition: itkImageBufferRange.h:665
itk::ImageBufferRange::QualifiedIterator::value_type
PixelType value_type
Definition: itkImageBufferRange.h:293
itk::ImageBufferRange::QualifiedIterator::operator<=
friend bool operator<=(const QualifiedIterator &lhs, const QualifiedIterator &rhs) noexcept
Definition: itkImageBufferRange.h:417
itk::ImageBufferRange
Definition: itkImageBufferRange.h:73
itk::ImageBufferRange::EmptyAccessorFunctor
Definition: itkImageBufferRange.h:93
itk::ImageBufferRange::begin
iterator begin() const noexcept
Definition: itkImageBufferRange.h:586
itk::ImageBufferRange::reverse_iterator
std::reverse_iterator< iterator > reverse_iterator
Definition: itkImageBufferRange.h:560
itk::ImageBufferRange::ImageBufferRange
ImageBufferRange()=default
itkDefaultVectorPixelAccessor.h
itk::ImageBufferRange::QualifiedIterator::QualifiedInternalPixelType
std::conditional_t< IsImageTypeConst, const InternalPixelType, InternalPixelType > QualifiedInternalPixelType
Definition: itkImageBufferRange.h:244
itk::ImageBufferRange::QualifiedIterator::m_InternalPixelPointer
QualifiedInternalPixelType * m_InternalPixelPointer
Definition: itkImageBufferRange.h:278
itk::ImageBufferRange::QualifiedIterator::operator-=
friend QualifiedIterator & operator-=(QualifiedIterator &it, const difference_type n) noexcept
Definition: itkImageBufferRange.h:444
itk::ImageBufferRange::QualifiedIterator::pointer
QualifiedPixelType * pointer
Definition: itkImageBufferRange.h:295
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:400
itk::ImageBufferRange::SupportsDirectPixelAccess
static constexpr bool SupportsDirectPixelAccess
Definition: itkImageBufferRange.h:85
itk::ImageBufferRange::PixelProxy< true, TDummy >::m_AccessorFunctor
const AccessorFunctorType m_AccessorFunctor
Definition: itkImageBufferRange.h:120
itk::ImageBufferRange::QualifiedIterator::QualifiedPixelType
std::conditional_t< IsImageTypeConst, const PixelType, PixelType > QualifiedPixelType
Definition: itkImageBufferRange.h:247
itk::ImageBufferRange::QualifiedIterator::operator-
friend difference_type operator-(const QualifiedIterator &lhs, const QualifiedIterator &rhs) noexcept
Definition: itkImageBufferRange.h:453
itk::ImageBufferRange::ImageType
TImage ImageType
Definition: itkImageBufferRange.h:76
itkDefaultVectorPixelAccessorFunctor.h
itk::ImageBufferRange::QualifiedIterator::operator--
QualifiedIterator operator--(int) noexcept
Definition: itkImageBufferRange.h:370
itk::ImageBufferRange::QualifiedInternalPixelType
std::conditional_t< IsImageTypeConst, const InternalPixelType, InternalPixelType > QualifiedInternalPixelType
Definition: itkImageBufferRange.h:494
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:383
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::ImageBufferRange::AccessorFunctorInitializer::m_Image
ImageType & m_Image
Definition: itkImageBufferRange.h:499
itk::ImageBufferRange::cend
const_iterator cend() const noexcept
Definition: itkImageBufferRange.h:611
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:618
itk::ImageBufferRange::AccessorFunctorInitializer::AccessorFunctorInitializer
AccessorFunctorInitializer(ImageType &image) noexcept
Definition: itkImageBufferRange.h:502
itk::ImageBufferRange::QualifiedIterator::operator++
QualifiedIterator & operator++() noexcept
Definition: itkImageBufferRange.h:335
itkDefaultPixelAccessorFunctor.h
itk::ImageBufferRange::QualifiedIterator::reference
std::conditional_t< SupportsDirectPixelAccess, QualifiedPixelType &, PixelProxy< IsImageTypeConst > > reference
Definition: itkImageBufferRange.h:294
itk::ImageBufferRange::QualifiedIterator::operator*
reference operator*() const noexcept
Definition: itkImageBufferRange.h:323
itk::ImageBufferRange::AccessorFunctorInitializer
Definition: itkImageBufferRange.h:496
itk::ImageBufferRange::UsingPointerAsIterator
static constexpr bool UsingPointerAsIterator
Definition: itkImageBufferRange.h:91
itk::ImageBufferRange::QualifiedIterator::iterator_category
std::random_access_iterator_tag iterator_category
Definition: itkImageBufferRange.h:296
itk::ImageBufferRange::QualifiedIterator::PixelReferenceWrapper::PixelReferenceWrapper
PixelReferenceWrapper(QualifiedPixelType &pixel, EmptyAccessorFunctor) noexcept
Definition: itkImageBufferRange.h:262
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:251
itk::ImageBufferRange::QualifiedIterator::QualifiedImageType
std::conditional_t< VIsConst, const ImageType, ImageType > QualifiedImageType
Definition: itkImageBufferRange.h:240
itk::ImageBufferRange::crbegin
const_reverse_iterator crbegin() const noexcept
Definition: itkImageBufferRange.h:632
itk::ImageBufferRange::cbegin
const_iterator cbegin() const noexcept
Definition: itkImageBufferRange.h:604
itk::ImageBufferRange::QualifiedIterator::operator!=
friend bool operator!=(const QualifiedIterator &lhs, const QualifiedIterator &rhs) noexcept
Definition: itkImageBufferRange.h:391
itk::ImageBufferRange::PixelProxy
Definition: itkImageBufferRange.h:107
itk::ImageBufferRange::iterator
std::conditional_t< UsingPointerAsIterator, QualifiedInternalPixelType *, QualifiedIterator< IsImageTypeConst > > iterator
Definition: itkImageBufferRange.h:559
itk::ImageBufferRange::QualifiedIterator::PixelReferenceWrapper::m_Pixel
QualifiedPixelType & m_Pixel
Definition: itkImageBufferRange.h:254
itk::ImageBufferRange::ImageBufferRange
ImageBufferRange(ImageType &image)
Definition: itkImageBufferRange.h:574
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:469
itk::ImageBufferRange::m_OptionalAccessorFunctor
OptionalAccessorFunctorType m_OptionalAccessorFunctor
Definition: itkImageBufferRange.h:548