PCL
pcl::GenericImage< P >::const_filter_pixel_iterator< F > Class Template Reference

Immutable filter pixel iterator. More...

#include <Image.h>

Inherits pcl::GenericImage< P >::filter_pixel_iterator_base< image_type, iterator_base, sample_pointer, filter_type >.

Public Types

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

Public Member Functions

 const_filter_pixel_iterator ()=default
 
 const_filter_pixel_iterator (const const_filter_pixel_iterator &)=default
 
 const_filter_pixel_iterator (const const_pixel_iterator &i, const F &filter)
 
 const_filter_pixel_iterator (const image_type &image, const F &filter)
 
const filter_typeFilter () const noexcept
 
filter_typeFilter () noexcept
 
const image_typeImage () const noexcept
 
bool IsValid () const noexcept
 
const_filter_pixel_iteratorMoveBy (int dx, int dy) noexcept
 
 operator bool () const noexcept
 
const_filter_pixel_iteratoroperator++ () noexcept
 
const_filter_pixel_iterator operator++ (int) noexcept
 
const_filter_pixel_iteratoroperator+= (distance_type delta) noexcept
 
const_filter_pixel_iteratoroperator-- () noexcept
 
const_filter_pixel_iterator operator-- (int) noexcept
 
const_filter_pixel_iteratoroperator-= (distance_type delta) noexcept
 
const_filter_pixel_iteratoroperator= (const const_filter_pixel_iterator &)=default
 
const_filter_pixel_iteratoroperator= (const const_pixel_iterator &i) noexcept
 
const sampleoperator[] (int channel) const noexcept
 
const samplePosition (int channel) const noexcept
 

Friends

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

Detailed Description

template<class P>
template<class F>
class pcl::GenericImage< P >::const_filter_pixel_iterator< F >

An immutable pixel iterator provides read-only, random access to all pixels in an image. A filter pixel iterator uses a predicate object to filter pixels within its iteration range.

Filter Predicates

For an immutable filter pixel iterator, the class template argument F must provide a function call operator of the form:

bool F::operator()( const GenericVector\<const sample*\>& f ) const

Each component of the passed vector f is a pointer to a constant pixel sample in the corresponding channel of the iterated image. The function call operator must return true if the pointed pixel is valid in the context of the filter iterator. The filter iterator stores a private instance of F to validate pixels, so the F class must provide also copy constructor semantics, either explicitly or implicitly.

Filter Iterators

Each time a filter iterator is constructed, incremented, decremented, or moved forward or backward, the filter predicate is called to validate the pixel or pixel sample pointed to by the iterator. If the pointed item is not valid, the iterator is incremented or decremented (depending on the operation performed initially) until it finds a valid one, or until it reaches the end of the iteration range, whichever happens first. In this way a filter iterator gives access only to valid items in a completely automatic and transparent fashion.

Definition at line 5020 of file Image.h.

Member Typedef Documentation

◆ filter_type

template<class P >
template<class F >
using pcl::GenericImage< P >::const_filter_pixel_iterator< F >::filter_type = F

Represents the type of the unary predicate used by this filter iterator.

Definition at line 5044 of file Image.h.

◆ image_type

template<class P >
template<class F >
using pcl::GenericImage< P >::const_filter_pixel_iterator< F >::image_type = GenericImage<P>

Represents the type of the iterated image.

Definition at line 5028 of file Image.h.

◆ pixel_traits

template<class P >
template<class F >
using pcl::GenericImage< P >::const_filter_pixel_iterator< F >::pixel_traits = typename image_type::pixel_traits

Represents the pixel traits class used by the iterated image.

Definition at line 5033 of file Image.h.

◆ sample

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

Represents a pixel sample of the iterated image.

Definition at line 5038 of file Image.h.

Constructor & Destructor Documentation

◆ const_filter_pixel_iterator() [1/4]

template<class P >
template<class F >
pcl::GenericImage< P >::const_filter_pixel_iterator< F >::const_filter_pixel_iterator ( )
default

Default constructor. Initializes an invalid iterator.

◆ const_filter_pixel_iterator() [2/4]

template<class P >
template<class F >
pcl::GenericImage< P >::const_filter_pixel_iterator< F >::const_filter_pixel_iterator ( const image_type image,
const F &  filter 
)
inline

Constructs an immutable filter pixel iterator.

Parameters
imageThe constant image to iterate.
filterReference to a predicate object that will be used to filter pixels.

Definition at line 5061 of file Image.h.

◆ const_filter_pixel_iterator() [3/4]

template<class P >
template<class F >
pcl::GenericImage< P >::const_filter_pixel_iterator< F >::const_filter_pixel_iterator ( const const_pixel_iterator i,
const F &  filter 
)
inline

Constructs an immutable filter pixel iterator from an immutable pixel iterator and the specified filter.

Definition at line 5070 of file Image.h.

◆ const_filter_pixel_iterator() [4/4]

template<class P >
template<class F >
pcl::GenericImage< P >::const_filter_pixel_iterator< F >::const_filter_pixel_iterator ( const const_filter_pixel_iterator< F > &  )
default

Copy constructor.

Member Function Documentation

◆ Filter() [1/2]

template<class P >
template<class F >
const filter_type& pcl::GenericImage< P >::const_filter_pixel_iterator< F >::Filter ( ) const
inlinenoexcept

Returns a reference to the immutable predicate object used by this filter iterator.

Definition at line 5117 of file Image.h.

◆ Filter() [2/2]

template<class P >
template<class F >
filter_type& pcl::GenericImage< P >::const_filter_pixel_iterator< F >::Filter ( )
inlinenoexcept

Returns a reference to the mutable predicate object used by this filter iterator.

Definition at line 5126 of file Image.h.

◆ Image()

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

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

Definition at line 5108 of file Image.h.

◆ IsValid()

template<class P >
template<class F >
bool pcl::GenericImage< P >::const_filter_pixel_iterator< F >::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 5099 of file Image.h.

◆ MoveBy()

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

Moves this iterator on the iterated image 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 5250 of file Image.h.

◆ operator bool()

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

Boolean type conversion operator. Returns true if this iterator is active. A pixel iterator is active if it has not reached (or surpassed) its iteration limit.

Definition at line 5145 of file Image.h.

◆ operator++() [1/2]

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

Pre-increment operator. Causes this iterator to point to the next valid pixel in the iterated image. Returns a reference to this iterator.

Definition at line 5164 of file Image.h.

◆ operator++() [2/2]

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

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

Definition at line 5177 of file Image.h.

◆ operator+=()

template<class P >
template<class F >
const_filter_pixel_iterator& pcl::GenericImage< P >::const_filter_pixel_iterator< F >::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 5220 of file Image.h.

◆ operator--() [1/2]

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

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

Definition at line 5191 of file Image.h.

◆ operator--() [2/2]

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

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

Definition at line 5204 of file Image.h.

◆ operator-=()

template<class P >
template<class F >
const_filter_pixel_iterator& pcl::GenericImage< P >::const_filter_pixel_iterator< F >::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 5235 of file Image.h.

◆ operator=() [1/2]

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

Copy assignment operator. Returns a reference to this iterator.

◆ operator=() [2/2]

template<class P >
template<class F >
const_filter_pixel_iterator& pcl::GenericImage< P >::const_filter_pixel_iterator< F >::operator= ( const const_pixel_iterator i)
inlinenoexcept

Assigns an immutable pixel iterator to this object. Returns a reference to this iterator.

Definition at line 5089 of file Image.h.

◆ operator[]()

template<class P >
template<class F >
const sample& pcl::GenericImage< P >::const_filter_pixel_iterator< F >::operator[] ( int  channel) const
inlinenoexcept

Array subscript operator. Returns a reference to the constant pixel sample pointed to by this iterator in the specified channel.

Definition at line 5154 of file Image.h.

◆ Position()

template<class P >
template<class F >
const sample* pcl::GenericImage< P >::const_filter_pixel_iterator< F >::Position ( int  channel) const
inlinenoexcept

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

Definition at line 5135 of file Image.h.

Friends And Related Function Documentation

◆ operator+ [1/2]

template<class P >
template<class F >
const_filter_pixel_iterator operator+ ( const const_filter_pixel_iterator< F > &  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 5266 of file Image.h.

◆ operator+ [2/2]

template<class P >
template<class F >
const_filter_pixel_iterator operator+ ( distance_type  delta,
const const_filter_pixel_iterator< F > &  i 
)
friend

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

Definition at line 5277 of file Image.h.

◆ operator-

template<class P >
template<class F >
const_filter_pixel_iterator operator- ( const const_filter_pixel_iterator< F > &  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 5288 of file Image.h.

◆ operator<

template<class P >
template<class F >
bool operator< ( const const_filter_pixel_iterator< F > &  i,
const const_filter_pixel_iterator< F > &  j 
)
friend

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

Definition at line 5308 of file Image.h.

◆ operator==

template<class P >
template<class F >
bool operator== ( const const_filter_pixel_iterator< F > &  i,
const const_filter_pixel_iterator< F > &  j 
)
friend

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

Definition at line 5299 of file Image.h.


The documentation for this class was generated from the following file:
pcl::GenericImage::const_filter_pixel_iterator::sample
typename image_type::sample sample
Definition: Image.h:5038