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

Mutable 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

 filter_pixel_iterator ()=default
 
 filter_pixel_iterator (const filter_pixel_iterator &)=default
 
 filter_pixel_iterator (const pixel_iterator &i, const F &filter)
 
 filter_pixel_iterator (image_type &image, const F &filter)
 
const filter_typeFilter () const noexcept
 
filter_typeFilter () noexcept
 
image_typeImage () const noexcept
 
bool IsValid () const noexcept
 
filter_pixel_iteratorMoveBy (int dx, int dy) noexcept
 
 operator bool () const noexcept
 
filter_pixel_iteratoroperator++ () noexcept
 
filter_pixel_iterator operator++ (int) noexcept
 
filter_pixel_iteratoroperator+= (distance_type delta) noexcept
 
filter_pixel_iteratoroperator-- () noexcept
 
filter_pixel_iterator operator-- (int) noexcept
 
filter_pixel_iteratoroperator-= (distance_type delta) noexcept
 
filter_pixel_iteratoroperator= (const filter_pixel_iterator &)=default
 
filter_pixel_iteratoroperator= (const pixel_iterator &i) noexcept
 
sampleoperator[] (int channel) const noexcept
 
samplePosition (int channel) const noexcept
 

Friends

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

Detailed Description

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

A mutable pixel iterator provides read/write, 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 a mutable filter pixel iterator, the class template argument F must provide a function call operator of the form:

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

Each component of the passed vector f is a pointer to a 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 4689 of file Image.h.

Member Typedef Documentation

◆ filter_type

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

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

Definition at line 4713 of file Image.h.

◆ image_type

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

Represents the type of the iterated image.

Definition at line 4697 of file Image.h.

◆ pixel_traits

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

Represents the pixel traits class used by the iterated image.

Definition at line 4702 of file Image.h.

◆ sample

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

Represents a pixel sample of the iterated image.

Definition at line 4707 of file Image.h.

Constructor & Destructor Documentation

◆ filter_pixel_iterator() [1/4]

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

Default constructor. Initializes an invalid iterator.

◆ filter_pixel_iterator() [2/4]

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

Constructs a mutable filter pixel iterator.

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

Definition at line 4730 of file Image.h.

◆ filter_pixel_iterator() [3/4]

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

Constructs a mutable filter pixel iterator from a mutable pixel iterator and the specified filter.

Definition at line 4739 of file Image.h.

◆ filter_pixel_iterator() [4/4]

template<class P >
template<class F >
pcl::GenericImage< P >::filter_pixel_iterator< F >::filter_pixel_iterator ( 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 >::filter_pixel_iterator< F >::Filter ( ) const
inlinenoexcept

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

Definition at line 4785 of file Image.h.

◆ Filter() [2/2]

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

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

Definition at line 4794 of file Image.h.

◆ Image()

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

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

Definition at line 4776 of file Image.h.

◆ IsValid()

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

◆ MoveBy()

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

◆ operator bool()

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

◆ operator++() [1/2]

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

◆ operator++() [2/2]

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

◆ operator+=()

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

◆ operator--() [1/2]

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

◆ operator--() [2/2]

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

◆ operator-=()

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

◆ operator=() [1/2]

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

Copy assignment operator. Returns a reference to this iterator.

◆ operator=() [2/2]

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

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

Definition at line 4758 of file Image.h.

◆ operator[]()

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

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

Definition at line 4822 of file Image.h.

◆ Position()

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

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

Definition at line 4803 of file Image.h.

Friends And Related Function Documentation

◆ operator+ [1/2]

template<class P >
template<class F >
filter_pixel_iterator operator+ ( 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 4934 of file Image.h.

◆ operator+ [2/2]

template<class P >
template<class F >
filter_pixel_iterator operator+ ( distance_type  delta,
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 4945 of file Image.h.

◆ operator-

template<class P >
template<class F >
filter_pixel_iterator operator- ( 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 4956 of file Image.h.

◆ operator<

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

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

Definition at line 4976 of file Image.h.

◆ operator==

template<class P >
template<class F >
bool operator== ( const filter_pixel_iterator< F > &  i,
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 4967 of file Image.h.


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