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

Immutable region-of-interest pixel iterator. More...

#include <Image.h>

Inherits pcl::GenericImage< P >::roi_pixel_iterator_base< image_type, sample_pointer >.

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_roi_pixel_iterator ()=default
 
 const_roi_pixel_iterator (const const_roi_pixel_iterator &)=default
 
 const_roi_pixel_iterator (const image_type &image, const Rect &rect=Rect(0))
 
const image_typeImage () const noexcept
 
bool IsValid () const noexcept
 
const_roi_pixel_iteratorMoveBy (int dx, int dy) noexcept
 
 operator bool () const noexcept
 
const_roi_pixel_iteratoroperator++ () noexcept
 
const_roi_pixel_iterator operator++ (int) noexcept
 
const_roi_pixel_iteratoroperator+= (distance_type delta) noexcept
 
const_roi_pixel_iteratoroperator-- () noexcept
 
const_roi_pixel_iterator operator-- (int) noexcept
 
const_roi_pixel_iteratoroperator-= (distance_type delta) noexcept
 
const_roi_pixel_iteratoroperator= (const const_roi_pixel_iterator &)=default
 
const sampleoperator[] (int channel) const noexcept
 
const samplePosition (int channel) const noexcept
 

Friends

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

Detailed Description

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

An immutable, region-of-interest (ROI) pixel iterator provides read-only, random access to pixels within a rectangular subset of an image.

Definition at line 4352 of file Image.h.

Member Typedef Documentation

◆ image_type

Represents the type of the iterated image.

Definition at line 4359 of file Image.h.

◆ pixel_traits

Represents the pixel traits class used by the iterated image.

Definition at line 4364 of file Image.h.

◆ sample

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

Represents a pixel sample of the iterated image.

Definition at line 4369 of file Image.h.

Constructor & Destructor Documentation

◆ const_roi_pixel_iterator() [1/3]

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

Default constructor. Initializes an invalid iterator.

◆ const_roi_pixel_iterator() [2/3]

template<class P >
pcl::GenericImage< P >::const_roi_pixel_iterator::const_roi_pixel_iterator ( const image_type image,
const Rect rect = Rect( 0 ) 
)
inline

Constructs an immutable, region-of-interest (ROI) pixel iterator.

Parameters
imageThe constant image to iterate.
rectRegion of interest. If an empty rectangle is specified, the current rectangular selection in the image will be used. If the specified rectangle is not empty and extends beyond image boundaries, only the intersection with the image will be used. If that intersection does not exist, then the resulting iterator will be invalid, with an empty iteration range. The default value is an empty rectangle.

Definition at line 4392 of file Image.h.

◆ const_roi_pixel_iterator() [3/3]

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

Copy constructor.

Member Function Documentation

◆ Image()

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

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

Definition at line 4420 of file Image.h.

◆ IsValid()

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

◆ MoveBy()

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

Moves this iterator within its rectangular region of interest 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 4540 of file Image.h.

◆ operator bool()

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

Boolean type conversion operator. Returns true if this iterator is active. A ROI pixel iterator is active if it has not reached (or surpassed) its iteration limit, i.e. the bottom right corner of its iterated region of interest.

Definition at line 4440 of file Image.h.

◆ operator++() [1/2]

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

Pre-increment operator. Causes this iterator to point to the next pixel in the iterated region of interest, then returns a reference to this iterator.

Definition at line 4459 of file Image.h.

◆ operator++() [2/2]

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

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

Definition at line 4470 of file Image.h.

◆ operator+=()

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

Scalar assignment/addition operator. Increments this iterator by a distance delta from its current position, within the rectangular region of interest being iterated. Positive increments cause this iterator to move forward (rightwards and downwards) by delta pixel samples. Negative increments move this iterator backward (leftwards and upwards) by delta pixel samples. Returns a reference to this iterator.

Definition at line 4509 of file Image.h.

◆ operator--() [1/2]

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

Pre-decrement operator. Causes this iterator to point to the previous pixel in the iterated region of interest, then returns a reference to this iterator.

Definition at line 4482 of file Image.h.

◆ operator--() [2/2]

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

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

Definition at line 4493 of file Image.h.

◆ operator-=()

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

Scalar assignment/subtraction operator. Decrements this iterator by a distance delta from its current position, within the rectangular region of interest being iterated. Positive increments cause this iterator to move backward (leftwards and upwards) by delta pixel samples. Negative increments move this iterator forward (rightwards and downwards) by delta pixel samples. Returns a reference to this iterator.

Definition at line 4525 of file Image.h.

◆ operator=()

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

Copy assignment operator. Returns a reference to this object.

◆ operator[]()

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

◆ Position()

template<class P >
const sample* pcl::GenericImage< P >::const_roi_pixel_iterator::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 4429 of file Image.h.

Friends And Related Function Documentation

◆ operator+ [1/2]

template<class P >
const_roi_pixel_iterator operator+ ( const const_roi_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 4550 of file Image.h.

◆ operator+ [2/2]

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

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

Definition at line 4561 of file Image.h.

◆ operator-

template<class P >
const_roi_pixel_iterator operator- ( const const_roi_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 4572 of file Image.h.

◆ operator<

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

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

Definition at line 4592 of file Image.h.

◆ operator==

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

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

Definition at line 4583 of file Image.h.


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