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

Mutable pixel iterator. More...

#include <Image.h>

Inherited by pcl::GenericImage< P >::filter_pixel_iterator_base< GenericImage< P >, pixel_iterator, 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

 pixel_iterator ()=default
 
 pixel_iterator (const pixel_iterator &)=default
 
 pixel_iterator (image_type &image)
 
image_typeImage () const noexcept
 
bool IsValid () const noexcept
 
pixel_iteratorMoveBy (int dx, int dy) noexcept
 
 operator bool () const noexcept
 
pixel_iteratoroperator++ () noexcept
 
pixel_iterator operator++ (int) noexcept
 
pixel_iteratoroperator+= (distance_type delta) noexcept
 
pixel_iteratoroperator-- () noexcept
 
pixel_iterator operator-- (int) noexcept
 
pixel_iteratoroperator-= (distance_type delta) noexcept
 
pixel_iteratoroperator= (const pixel_iterator &)=default
 
sampleoperator[] (int channel) const noexcept
 
samplePosition (int channel) const noexcept
 

Friends

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

Detailed Description

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

A mutable pixel iterator provides read/write, random access to all pixels of an image.

Definition at line 3483 of file Image.h.

Member Typedef Documentation

◆ image_type

template<class P >
using pcl::GenericImage< P >::pixel_iterator::image_type = GenericImage<P>

Represents the type of the iterated image.

Definition at line 3490 of file Image.h.

◆ pixel_traits

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

Represents the pixel traits class used by the iterated image.

Definition at line 3495 of file Image.h.

◆ sample

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

Represents a pixel sample of the iterated image.

Definition at line 3500 of file Image.h.

Constructor & Destructor Documentation

◆ pixel_iterator() [1/3]

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

Default constructor. Initializes an invalid iterator.

◆ pixel_iterator() [2/3]

template<class P >
pcl::GenericImage< P >::pixel_iterator::pixel_iterator ( image_type image)
inline

Constructs a mutable pixel iterator for the specified image.

Definition at line 3512 of file Image.h.

◆ pixel_iterator() [3/3]

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

Copy constructor.

Member Function Documentation

◆ Image()

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

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

Definition at line 3547 of file Image.h.

◆ IsValid()

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

◆ MoveBy()

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

◆ operator bool()

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

◆ operator++() [1/2]

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

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

Definition at line 3584 of file Image.h.

◆ operator++() [2/2]

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

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

Definition at line 3596 of file Image.h.

◆ operator+=()

template<class P >
pixel_iterator& pcl::GenericImage< P >::pixel_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 pixels. Negative increments move this iterator backward by delta pixels. Returns a reference to this iterator.

Definition at line 3635 of file Image.h.

◆ operator--() [1/2]

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

Pre-decrement operator. Causes this iterator to point to the previous pixel in the iterated image. Returns a reference to this iterator.

Definition at line 3608 of file Image.h.

◆ operator--() [2/2]

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

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

Definition at line 3620 of file Image.h.

◆ operator-=()

template<class P >
pixel_iterator& pcl::GenericImage< P >::pixel_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 pixels. Negative increments move this iterator forward by delta pixels. Returns a reference to this iterator.

Definition at line 3649 of file Image.h.

◆ operator=()

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

Copy assignment operator. Returns a reference to this iterator.

◆ operator[]()

template<class P >
sample& pcl::GenericImage< P >::pixel_iterator::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 3575 of file Image.h.

◆ Position()

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

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

Definition at line 3556 of file Image.h.

Friends And Related Function Documentation

◆ operator+ [1/2]

template<class P >
pixel_iterator operator+ ( const pixel_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 3672 of file Image.h.

◆ operator+ [2/2]

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

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

Definition at line 3683 of file Image.h.

◆ operator- [1/2]

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

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

Definition at line 3705 of file Image.h.

◆ operator- [2/2]

template<class P >
pixel_iterator operator- ( const pixel_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 3694 of file Image.h.

◆ operator<

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

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

Definition at line 3723 of file Image.h.

◆ operator==

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

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

Definition at line 3714 of file Image.h.


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