PCL
pcl::GenericImage< P >::const_sample_iterator Class Reference

Immutable pixel sample iterator. More...

#include <Image.h>

Inherited by pcl::GenericImage< P >::filter_sample_iterator_base< const GenericImage< P >, const_sample_iterator, const sample *, F >.

Public Types

using image_type = GenericImage< P >
 
using pixel_traits = typename image_type::pixel_traits
 
using sample = typename image_type::sample
 

Public Member Functions

 const_sample_iterator ()=default
 
 const_sample_iterator (const const_sample_iterator &)=default
 
 const_sample_iterator (const image_type &image, const sample *i, const sample *j)
 
 const_sample_iterator (const image_type &image, int channel=-1)
 
 const_sample_iterator (const sample_iterator &i)
 
const image_typeImage () const noexcept
 
bool IsValid () const noexcept
 
const_sample_iteratorMoveBy (int dx, int dy) noexcept
 
 operator bool () const noexcept
 
const sampleoperator* () const noexcept
 
const_sample_iteratoroperator++ () noexcept
 
const_sample_iterator operator++ (int) noexcept
 
const_sample_iteratoroperator+= (distance_type delta) noexcept
 
const_sample_iteratoroperator-- () noexcept
 
const_sample_iterator operator-- (int) noexcept
 
const_sample_iteratoroperator-= (distance_type delta) noexcept
 
const_sample_iteratoroperator= (const const_sample_iterator &)=default
 
const_sample_iteratoroperator= (const sample_iterator &i) noexcept
 
const samplePosition () const noexcept
 

Friends

const_sample_iterator operator+ (const const_sample_iterator &i, distance_type delta) noexcept
 
const_sample_iterator operator+ (distance_type delta, const const_sample_iterator &i) noexcept
 
distance_type operator- (const const_sample_iterator &i, const const_sample_iterator &j) noexcept
 
distance_type operator- (const const_sample_iterator &i, const sample *j) noexcept
 
const_sample_iterator operator- (const const_sample_iterator &i, distance_type delta) noexcept
 
distance_type operator- (const sample *i, const const_sample_iterator &j) noexcept
 
bool operator< (const const_sample_iterator &i, const const_sample_iterator &j) noexcept
 
bool operator< (const const_sample_iterator &i, const sample *j) noexcept
 
bool operator< (const sample *i, const const_sample_iterator &j) noexcept
 
bool operator== (const const_sample_iterator &i, const const_sample_iterator &j) noexcept
 
bool operator== (const const_sample_iterator &i, const sample *j) noexcept
 
bool operator== (const sample *i, const const_sample_iterator &j) noexcept
 

Detailed Description

template<class P>
class pcl::GenericImage< P >::const_sample_iterator

An immutable pixel sample iterator provides read-only, random access to pixel samples in a single channel of an image.

Definition at line 688 of file Image.h.

Member Typedef Documentation

◆ image_type

Represents the type of the iterated image.

Definition at line 695 of file Image.h.

◆ pixel_traits

Represents the pixel traits class used by the iterated image.

Definition at line 700 of file Image.h.

◆ sample

template<class P >
using pcl::GenericImage< P >::const_sample_iterator::sample = typename image_type::sample

Represents a pixel sample of the iterated image.

Definition at line 705 of file Image.h.

Constructor & Destructor Documentation

◆ const_sample_iterator() [1/5]

template<class P >
pcl::GenericImage< P >::const_sample_iterator::const_sample_iterator ( )
default

Default constructor. Initializes an invalid iterator.

◆ const_sample_iterator() [2/5]

template<class P >
pcl::GenericImage< P >::const_sample_iterator::const_sample_iterator ( const image_type image,
int  channel = -1 
)
inline

Constructs an immutable pixel sample iterator for one channel of an image.

Parameters
imageThe constant image to iterate.
channelChannel index. If this parameter is a negative integer, then this object will be initialized to iterate on the currently selected channel of the image. If an invalid (i.e., nonexistent) channel index is specified, then the resulting iterator will also be invalid, with an empty iteration range. The default value is -1.

Definition at line 725 of file Image.h.

◆ const_sample_iterator() [3/5]

template<class P >
pcl::GenericImage< P >::const_sample_iterator::const_sample_iterator ( const image_type image,
const sample i,
const sample j 
)
inline

Constructs an immutable pixel sample iterator for a range of contiguous pixel samples of an image.

Parameters
imageThe constant image to iterate.
iPointer to the first constant pixel sample in the iteration range. The iterator will be initialized to access this pixel sample just after construction.
jEnd of the iteration range. The iterator will be invalid when it reaches (or surpasses) this point.
Note
Both iteration limits i and j must be pointers to constant pixel samples in the same channel of the specified image.

Definition at line 751 of file Image.h.

◆ const_sample_iterator() [4/5]

template<class P >
pcl::GenericImage< P >::const_sample_iterator::const_sample_iterator ( const sample_iterator i)
inline

Constructs an immutable iterator from a mutable iterator.

Note
Don't confuse this constructor with the copy constructor for the const_sample_iterator class. Note that the argument to this function is a reference to an object of a different class.

Definition at line 765 of file Image.h.

◆ const_sample_iterator() [5/5]

template<class P >
pcl::GenericImage< P >::const_sample_iterator::const_sample_iterator ( const const_sample_iterator )
default

Copy constructor.

Member Function Documentation

◆ Image()

template<class P >
const image_type& pcl::GenericImage< P >::const_sample_iterator::Image ( ) const
inlinenoexcept

Returns a reference to the constant image being iterated by this object.

Definition at line 807 of file Image.h.

◆ IsValid()

template<class P >
bool pcl::GenericImage< P >::const_sample_iterator::IsValid ( ) const
inlinenoexcept

Returns true only if this iterator is valid. A valid iterator defines a valid iterated image and a non-null position.

Definition at line 798 of file Image.h.

◆ MoveBy()

template<class P >
const_sample_iterator& pcl::GenericImage< P >::const_sample_iterator::MoveBy ( int  dx,
int  dy 
)
inlinenoexcept

Moves this iterator on the iterated image channel by the specified horizontal and vertical increments in pixels, dx and dy respectively, relative to its current position. Positive (negative) dx increments move the iterator rightwards (leftwards). Positive (negative) dy increments move the iterator downwards (upwards).

Definition at line 917 of file Image.h.

◆ operator bool()

template<class P >
pcl::GenericImage< P >::const_sample_iterator::operator bool ( ) const
inlinenoexcept

Boolean type conversion operator. Returns true if this iterator is active. A pixel sample iterator is active if it has not reached (or surpassed) its iteration limit: either the end of the iterated image channel, or the end of the iteration range, depending on how the iterator has been constructed.

Definition at line 828 of file Image.h.

◆ operator*()

template<class P >
const sample& pcl::GenericImage< P >::const_sample_iterator::operator* ( ) const
inlinenoexcept

Indirection operator. Returns a reference to the constant pixel sample pointed to by this iterator.

Definition at line 837 of file Image.h.

◆ operator++() [1/2]

template<class P >
const_sample_iterator& pcl::GenericImage< P >::const_sample_iterator::operator++ ( )
inlinenoexcept

Pre-increment operator. Causes this iterator to point to the next pixel sample in the iterated image channel, then returns a reference to this iterator.

Definition at line 847 of file Image.h.

◆ operator++() [2/2]

template<class P >
const_sample_iterator pcl::GenericImage< P >::const_sample_iterator::operator++ ( int  )
inlinenoexcept

Post-increment operator. Causes this iterator to point to the next pixel sample in the iterated image channel. Returns a copy of the iterator as it was before incrementing it.

Definition at line 858 of file Image.h.

◆ operator+=()

template<class P >
const_sample_iterator& pcl::GenericImage< P >::const_sample_iterator::operator+= ( distance_type  delta)
inlinenoexcept

Scalar assignment/addition operator. Increments this iterator by a distance delta from its current position. Positive increments cause this iterator to move forward by delta pixel samples. Negative increments move this iterator backward by delta pixel samples. Returns a reference to this iterator.

Definition at line 891 of file Image.h.

◆ operator--() [1/2]

template<class P >
const_sample_iterator& pcl::GenericImage< P >::const_sample_iterator::operator-- ( )
inlinenoexcept

Pre-decrement operator. Causes this iterator to point to the previous pixel sample in the iterated image channel, then returns a reference to this iterator.

Definition at line 868 of file Image.h.

◆ operator--() [2/2]

template<class P >
const_sample_iterator pcl::GenericImage< P >::const_sample_iterator::operator-- ( int  )
inlinenoexcept

Post-decrement operator. Causes this iterator to point to the previous pixel sample in the iterated image channel. Returns a copy of the iterator as it was before decrementing it.

Definition at line 879 of file Image.h.

◆ operator-=()

template<class P >
const_sample_iterator& pcl::GenericImage< P >::const_sample_iterator::operator-= ( distance_type  delta)
inlinenoexcept

Scalar assignment/subtraction operator. Decrements this iterator by a distance delta from its current position. Positive increments cause this iterator to move backward by delta pixel samples. Negative increments move this iterator forward by delta pixel samples. Returns a reference to this iterator.

Definition at line 904 of file Image.h.

◆ operator=() [1/2]

template<class P >
const_sample_iterator& pcl::GenericImage< P >::const_sample_iterator::operator= ( const const_sample_iterator )
default

Copy assignment operator. Returns a reference to this object.

◆ operator=() [2/2]

template<class P >
const_sample_iterator& pcl::GenericImage< P >::const_sample_iterator::operator= ( const sample_iterator i)
inlinenoexcept

Assigns a mutable iterator to this object. Returns a reference to this iterator.

Definition at line 781 of file Image.h.

◆ Position()

template<class P >
const sample* pcl::GenericImage< P >::const_sample_iterator::Position ( ) const
inlinenoexcept

Returns a pointer to the constant pixel sample pointed to by this iterator.

Definition at line 816 of file Image.h.

Friends And Related Function Documentation

◆ operator+ [1/2]

template<class P >
const_sample_iterator operator+ ( const const_sample_iterator i,
distance_type  delta 
)
friend

Scalar-to-iterator addition operator. Returns an iterator equivalent to the specified iterator i incremented by a distance delta.

Definition at line 927 of file Image.h.

◆ operator+ [2/2]

template<class P >
const_sample_iterator operator+ ( distance_type  delta,
const const_sample_iterator i 
)
friend

Iterator-to-scalar addition operator. This operator implements the commutative property of scalar-to-iterator addition.

Definition at line 936 of file Image.h.

◆ operator- [1/4]

template<class P >
distance_type operator- ( const const_sample_iterator i,
const const_sample_iterator j 
)
friend

Iterator subtraction operator. Returns the distance in pixels between the specified iterators i and j.

Definition at line 954 of file Image.h.

◆ operator- [2/4]

template<class P >
distance_type operator- ( const const_sample_iterator i,
const sample j 
)
friend

Returns the distance in pixels between an iterator i and a sample pointer j.

Definition at line 963 of file Image.h.

◆ operator- [3/4]

template<class P >
const_sample_iterator operator- ( const const_sample_iterator i,
distance_type  delta 
)
friend

Scalar-to-iterator subtraction operator. Returns an iterator equal to the specified iterator i decremented by a distance delta.

Definition at line 945 of file Image.h.

◆ operator- [4/4]

template<class P >
distance_type operator- ( const sample i,
const const_sample_iterator j 
)
friend

Returns the distance in pixels between a sample pointer i and an iterator j.

Definition at line 972 of file Image.h.

◆ operator< [1/3]

template<class P >
bool operator< ( const const_sample_iterator i,
const const_sample_iterator j 
)
friend

Less than operator. Returns true if the specified iterator i precedes another iterator j.

Definition at line 1008 of file Image.h.

◆ operator< [2/3]

template<class P >
bool operator< ( const const_sample_iterator i,
const sample j 
)
friend

Returns true iff an iterator i precedes a sample pointer j.

Definition at line 1016 of file Image.h.

◆ operator< [3/3]

template<class P >
bool operator< ( const sample i,
const const_sample_iterator j 
)
friend

Returns true iff a sample pointer i precedes an iterator j.

Definition at line 1024 of file Image.h.

◆ operator== [1/3]

template<class P >
bool operator== ( const const_sample_iterator i,
const const_sample_iterator j 
)
friend

Equality operator. Returns true if two iterators i and j point to the same pixel sample.

Definition at line 981 of file Image.h.

◆ operator== [2/3]

template<class P >
bool operator== ( const const_sample_iterator i,
const sample j 
)
friend

Returns true iff an iterator i and a sample pointer j point to the same pixel sample.

Definition at line 990 of file Image.h.

◆ operator== [3/3]

template<class P >
bool operator== ( const sample i,
const const_sample_iterator j 
)
friend

Returns true iff a sample pointer i and an iterator j point to the same pixel sample.

Definition at line 999 of file Image.h.


The documentation for this class was generated from the following file: