PCL
pcl::ImageGeometry Class Reference

Implements geometric properties of two-dimensional images. More...

#include <ImageGeometry.h>

+ Inheritance diagram for pcl::ImageGeometry:

Public Member Functions

Rect Bounds () const noexcept
 
template<typename T >
bool Clip (pcl::GenericPoint< T > &p) const noexcept
 
template<typename T >
bool Clip (pcl::GenericRectangle< T > &r) const noexcept
 
template<typename T >
bool Clip (T &x, T &y) const noexcept
 
template<typename T >
bool Clip (T &x0, T &y0, T &x1, T &y1) const noexcept
 
int Height () const noexcept
 
template<typename T >
bool Includes (const GenericPoint< T > &p) const noexcept
 
template<typename T >
bool Includes (const GenericRectangle< T > &r) const noexcept
 
template<typename T >
bool Includes (T x, T y) const noexcept
 
template<typename T >
bool Includes (T x0, T y0, T x1, T y1) const noexcept
 
template<typename T >
bool Intersects (const pcl::GenericRectangle< T > &r) const noexcept
 
template<typename T >
bool Intersects (T x0, T y0, T x1, T y1) const noexcept
 
bool IsEmpty () const noexcept
 
bool IsValidChannelIndex (int c) const noexcept
 
int LastChannel () const noexcept
 
int NumberOfChannels () const noexcept
 
size_type NumberOfPixels () const noexcept
 
size_type NumberOfSamples () const noexcept
 
distance_type PixelOffset (int x, int y) const noexcept
 
distance_type RowOffset (int y) const noexcept
 
int Width () const noexcept
 

Detailed Description

ImageGeometry defines the dimensions in pixels and the channel count of a two-dimensional image.

See also
ImageColor, Abstractmage, GenericImage

Definition at line 83 of file ImageGeometry.h.

Member Function Documentation

◆ Bounds()

Rect pcl::ImageGeometry::Bounds ( ) const
inlinenoexcept

Returns the bounding rectangle of this image. The upper left corner of the returned rectangle (x0, y0) is always (0,0). The lower right corner coordinates (x1, y1) correspond to the width and height of the image.

Definition at line 145 of file ImageGeometry.h.

Referenced by pcl::GenericMatrix< T >::FromImage().

◆ Clip() [1/4]

template<typename T >
bool pcl::ImageGeometry::Clip ( pcl::GenericPoint< T > &  p) const
inlinenoexcept

Constrains a point p to stay within the boundaries of this image. Returns true iff the original point location is included in this image.

Definition at line 226 of file ImageGeometry.h.

◆ Clip() [2/4]

template<typename T >
bool pcl::ImageGeometry::Clip ( pcl::GenericRectangle< T > &  r) const
inlinenoexcept

Constrains a rectangular region r in image coordinates to fit into the boundaries of this image. Also ensures coherence of clipped rectangular coordinates such that r.x0 <= r.x1 and r.y0 <= r.y1.

Returns true iff the original rectangle intersects this image.

Definition at line 264 of file ImageGeometry.h.

◆ Clip() [3/4]

template<typename T >
bool pcl::ImageGeometry::Clip ( T &  x,
T &  y 
) const
inlinenoexcept

Constrains two point coordinates x and y to stay within the boundaries of this image.

Parameters
[out]xHorizontal coordinate of the clipped point.
[out]yVertical coordinate of the clipped point.

Returns true iff the original point location is included in this image.

Definition at line 241 of file ImageGeometry.h.

◆ Clip() [4/4]

template<typename T >
bool pcl::ImageGeometry::Clip ( T &  x0,
T &  y0,
T &  x1,
T &  y1 
) const
inlinenoexcept

Constrains a rectangular region, given by its separate image coordinates, to fit into the boundaries of this image. Also ensures coherence of rectangular coordinates, such that x0 <= x1 and y0 <= y1.

Parameters
[out]x0,y0Upper left corner coordinates (horizontal, vertical) of the rectangle that will be clipped.
[out]x1,y1Lower right corner coordinates (horizontal, vertical) of the rectangle that will be clipped.

Returns true iff the original rectangle intersects the image.

Definition at line 283 of file ImageGeometry.h.

◆ Height()

int pcl::ImageGeometry::Height ( ) const
inlinenoexcept

Returns the height of this image in pixels.

Definition at line 98 of file ImageGeometry.h.

◆ Includes() [1/4]

template<typename T >
bool pcl::ImageGeometry::Includes ( const GenericPoint< T > &  p) const
inlinenoexcept

Returns true iff this image includes the specified point p in image coordinates.

Definition at line 155 of file ImageGeometry.h.

◆ Includes() [2/4]

template<typename T >
bool pcl::ImageGeometry::Includes ( const GenericRectangle< T > &  r) const
inlinenoexcept

Returns true iff this image includes the specified rectangle r in image coordinates.

Definition at line 165 of file ImageGeometry.h.

◆ Includes() [3/4]

template<typename T >
bool pcl::ImageGeometry::Includes ( x,
y 
) const
inlinenoexcept

Returns true iff this image includes a point given by its separate image coordinates.

Parameters
xHorizontal coordinate.
yVertical coordinate.

Definition at line 192 of file ImageGeometry.h.

◆ Includes() [4/4]

template<typename T >
bool pcl::ImageGeometry::Includes ( x0,
y0,
x1,
y1 
) const
inlinenoexcept

Returns true iff this image includes a rectangle given by its separate image coordinates.

Parameters
x0,y0Upper left corner coordinates (horizontal, vertical).
x1,y1Lower right corner coordinates (horizontal, vertical).

Definition at line 178 of file ImageGeometry.h.

◆ Intersects() [1/2]

template<typename T >
bool pcl::ImageGeometry::Intersects ( const pcl::GenericRectangle< T > &  r) const
inlinenoexcept

Returns true iff this image intersects with the specified rectangle r in image coordinates.

Definition at line 202 of file ImageGeometry.h.

◆ Intersects() [2/2]

template<typename T >
bool pcl::ImageGeometry::Intersects ( x0,
y0,
x1,
y1 
) const
inlinenoexcept

Returns true iff this image intersects with a rectangle given by its separate image coordinates.

Parameters
x0,y0Upper left corner coordinates (horizontal, vertical).
x1,y1Lower right corner coordinates (horizontal, vertical).

Definition at line 215 of file ImageGeometry.h.

◆ IsEmpty()

bool pcl::ImageGeometry::IsEmpty ( ) const
inlinenoexcept

Returns true iff this image is empty, i.e. if its area is zero.

Definition at line 135 of file ImageGeometry.h.

Referenced by pcl::StarDetector::SetDetectionMask().

◆ IsValidChannelIndex()

bool pcl::ImageGeometry::IsValidChannelIndex ( int  c) const
inlinenoexcept

Returns true iff the specified channel index c is valid. A valid channel index corresponds to an existing channel in this image.

Definition at line 127 of file ImageGeometry.h.

◆ LastChannel()

int pcl::ImageGeometry::LastChannel ( ) const
inlinenoexcept

Returns the index of the last existing channel in this image. This is the largest valid channel index that can be used with this image, corresponding to a nominal or alpha channel. If this image is empty, this function returns -1.

Definition at line 118 of file ImageGeometry.h.

◆ NumberOfChannels()

int pcl::ImageGeometry::NumberOfChannels ( ) const
inlinenoexcept

Returns the total number of channels in this image, including nominal and alpha channels.

Definition at line 107 of file ImageGeometry.h.

◆ NumberOfPixels()

size_type pcl::ImageGeometry::NumberOfPixels ( ) const
inlinenoexcept

Returns the number of pixels in this image, or its area in square pixels.

Definition at line 307 of file ImageGeometry.h.

◆ NumberOfSamples()

size_type pcl::ImageGeometry::NumberOfSamples ( ) const
inlinenoexcept

Returns the total number of samples in this image, or the area in square pixels multiplied by the number of channels, including alpha channels.

Definition at line 316 of file ImageGeometry.h.

◆ PixelOffset()

distance_type pcl::ImageGeometry::PixelOffset ( int  x,
int  y 
) const
inlinenoexcept

Returns the offset of a given pixel from the beginning of a channel's data block.

Parameters
xHorizontal pixel coordinate.
yVertical pixel coordinate.

Definition at line 337 of file ImageGeometry.h.

◆ RowOffset()

distance_type pcl::ImageGeometry::RowOffset ( int  y) const
inlinenoexcept

Returns the offset of a given pixel row y (also known as scan line) from the beginning of a channel's data block.

Definition at line 325 of file ImageGeometry.h.

◆ Width()

int pcl::ImageGeometry::Width ( ) const
inlinenoexcept

Returns the width of this image in pixels.

Definition at line 90 of file ImageGeometry.h.


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