ITK
6.0.0
Insight Toolkit
|
#include <itkImageBufferRange.h>
Modern C++11 range to iterate over the pixels of an image. Designed to conform to Standard C++ Iterator requirements, so that it can be used in range-based for loop, and passed to Standard C++ algorithms.
The following example adds 42 to each pixel, using a range-based for loop:
The following example prints the values of the pixels:
Definition at line 73 of file itkImageBufferRange.h.
Classes | |
class | AccessorFunctorInitializer |
struct | EmptyAccessorFunctor |
class | IteratorInitializer |
class | PixelProxy |
class | PixelProxy< false, TDummy > |
class | PixelProxy< true, TDummy > |
class | QualifiedIterator |
Public Types | |
using | const_iterator = std::conditional_t< UsingPointerAsIterator, const InternalPixelType *, QualifiedIterator< true > > |
using | const_reverse_iterator = std::reverse_iterator< const_iterator > |
using | iterator = std::conditional_t< UsingPointerAsIterator, QualifiedInternalPixelType *, QualifiedIterator< IsImageTypeConst > > |
using | reverse_iterator = std::reverse_iterator< iterator > |
Public Member Functions | |
iterator | begin () const noexcept |
const_iterator | cbegin () const noexcept |
const_iterator | cend () const noexcept |
const_reverse_iterator | crbegin () const noexcept |
const_reverse_iterator | crend () const noexcept |
bool | empty () const noexcept |
iterator | end () const noexcept |
ImageBufferRange ()=default | |
reverse_iterator | rbegin () const noexcept |
reverse_iterator | rend () const noexcept |
vcl_size_t | size () const noexcept |
ImageBufferRange (TImage &image) | |
QualifiedIterator< false >::reference | operator[] (const vcl_size_t n) const noexcept |
Private Types | |
using | AccessorFunctorType = typename TImage::AccessorFunctorType |
using | InternalPixelType = typename TImage::InternalPixelType |
using | OptionalAccessorFunctorType = std::conditional_t< SupportsDirectPixelAccess, EmptyAccessorFunctor, AccessorFunctorType > |
using | PixelType = typename TImage::PixelType |
using | QualifiedInternalPixelType = std::conditional_t< IsImageTypeConst, const InternalPixelType, InternalPixelType > |
Private Attributes | |
QualifiedInternalPixelType * | m_ImageBufferPointer = nullptr |
SizeValueType | m_NumberOfPixels = 0 |
OptionalAccessorFunctorType | m_OptionalAccessorFunctor |
Static Private Attributes | |
static constexpr bool | IsImageTypeConst = std::is_const_v<TImage> |
static constexpr bool | SupportsDirectPixelAccess |
static constexpr bool | UsingPointerAsIterator = SupportsDirectPixelAccess |
|
private |
Definition at line 78 of file itkImageBufferRange.h.
using itk::ImageBufferRange< TImage >::const_iterator = std::conditional_t<UsingPointerAsIterator, const InternalPixelType *, QualifiedIterator<true> > |
Definition at line 556 of file itkImageBufferRange.h.
using itk::ImageBufferRange< TImage >::const_reverse_iterator = std::reverse_iterator<const_iterator> |
Definition at line 560 of file itkImageBufferRange.h.
|
private |
Definition at line 77 of file itkImageBufferRange.h.
using itk::ImageBufferRange< TImage >::iterator = std::conditional_t<UsingPointerAsIterator, QualifiedInternalPixelType *, QualifiedIterator<IsImageTypeConst> > |
Definition at line 558 of file itkImageBufferRange.h.
|
private |
Definition at line 96 of file itkImageBufferRange.h.
|
private |
Definition at line 76 of file itkImageBufferRange.h.
|
private |
Definition at line 493 of file itkImageBufferRange.h.
using itk::ImageBufferRange< TImage >::reverse_iterator = std::reverse_iterator<iterator> |
Definition at line 559 of file itkImageBufferRange.h.
|
default |
Explicitly-defaulted default-constructor. Constructs an empty range.
|
inlineexplicit |
Specifies a range of the pixels of an image.
Definition at line 574 of file itkImageBufferRange.h.
|
inlinenoexcept |
Returns an iterator to the first pixel.
Definition at line 586 of file itkImageBufferRange.h.
References itk::ImageBufferRange< TImage >::m_ImageBufferPointer, and itk::ImageBufferRange< TImage >::m_OptionalAccessorFunctor.
Referenced by itk::ImageBufferRange< TImage >::cbegin(), itk::ImageBufferRange< TImage >::operator[](), and itk::ImageBufferRange< TImage >::rend().
|
inlinenoexcept |
Returns a const iterator to the first pixel. Provides only read-only access to the pixel data.
Definition at line 604 of file itkImageBufferRange.h.
References itk::ImageBufferRange< TImage >::begin().
|
inlinenoexcept |
Returns a const 'end iterator' for this range.
Definition at line 611 of file itkImageBufferRange.h.
References itk::ImageBufferRange< TImage >::end().
|
inlinenoexcept |
Returns a const reverse 'begin iterator' for this range.
Definition at line 632 of file itkImageBufferRange.h.
References itk::ImageBufferRange< TImage >::rbegin().
|
inlinenoexcept |
Returns a const reverse 'end iterator' for this range.
Definition at line 639 of file itkImageBufferRange.h.
References itk::ImageBufferRange< TImage >::rend().
|
inlinenoexcept |
Tells whether the range is empty.
Definition at line 655 of file itkImageBufferRange.h.
References itk::ImageBufferRange< TImage >::m_NumberOfPixels.
|
inlinenoexcept |
Returns an 'end iterator' for this range.
Definition at line 593 of file itkImageBufferRange.h.
References itk::ImageBufferRange< TImage >::m_ImageBufferPointer, itk::ImageBufferRange< TImage >::m_NumberOfPixels, and itk::ImageBufferRange< TImage >::m_OptionalAccessorFunctor.
Referenced by itk::ImageBufferRange< TImage >::cend(), and itk::ImageBufferRange< TImage >::rbegin().
|
inlinenoexcept |
Subscript operator. Allows random access, to the nth pixel.
Definition at line 666 of file itkImageBufferRange.h.
References itk::ImageBufferRange< TImage >::begin(), and itk::ImageBufferRange< TImage >::size().
|
inlinenoexcept |
Returns a reverse 'begin iterator' for this range.
Definition at line 618 of file itkImageBufferRange.h.
References itk::ImageBufferRange< TImage >::end().
Referenced by itk::ImageBufferRange< TImage >::crbegin().
|
inlinenoexcept |
Returns a reverse 'end iterator' for this range.
Definition at line 625 of file itkImageBufferRange.h.
References itk::ImageBufferRange< TImage >::begin().
Referenced by itk::ImageBufferRange< TImage >::crend().
|
inlinenoexcept |
Returns the size of the range, that is the number of pixels.
Definition at line 647 of file itkImageBufferRange.h.
References itk::ImageBufferRange< TImage >::m_NumberOfPixels.
Referenced by itk::ImageBufferRange< TImage >::operator[]().
|
staticconstexprprivate |
Definition at line 491 of file itkImageBufferRange.h.
|
private |
Definition at line 550 of file itkImageBufferRange.h.
Referenced by itk::ImageBufferRange< TImage >::begin(), and itk::ImageBufferRange< TImage >::end().
|
private |
Definition at line 553 of file itkImageBufferRange.h.
Referenced by itk::ImageBufferRange< TImage >::empty(), itk::ImageBufferRange< TImage >::end(), and itk::ImageBufferRange< TImage >::size().
|
private |
Definition at line 547 of file itkImageBufferRange.h.
Referenced by itk::ImageBufferRange< TImage >::begin(), and itk::ImageBufferRange< TImage >::end().
|
staticconstexprprivate |
Definition at line 84 of file itkImageBufferRange.h.
|
staticconstexprprivate |
Definition at line 90 of file itkImageBufferRange.h.