PCL
pcl::PointGridInterpolation Class Reference

Discretized vector surface interpolation/approximation in two dimensions. More...

#include <GridInterpolation.h>

+ Inheritance diagram for pcl::PointGridInterpolation:

Public Member Functions

 PointGridInterpolation ()=default
 
 PointGridInterpolation (const PointGridInterpolation &)=default
 
 PointGridInterpolation (PointGridInterpolation &&)=default
 
void Clear ()
 
int Delta () const
 
template<class PSI >
void Initialize (const Rect &rect, int delta, const PSI &PS, bool verbose=true)
 
template<class SI >
void Initialize (const Rect &rect, int delta, const SI &Sx, const SI &Sy, bool verbose=true)
 
void Initialize (const Rect &rect, int delta, const DMatrix &Gx, const DMatrix &Gy)
 
bool IsValid () const
 
template<typename T >
DPoint operator() (T x, T y) const
 
template<typename T >
DPoint operator() (const GenericPoint< T > &p) const
 
PointGridInterpolationoperator= (const PointGridInterpolation &)=default
 
PointGridInterpolationoperator= (PointGridInterpolation &&)=default
 
const RectReferenceRect () const
 
const DMatrixXInterpolationMatrix () const
 
const DMatrixYInterpolationMatrix () const
 
- Public Member Functions inherited from pcl::ParallelProcess
 ParallelProcess ()=default
 
 ParallelProcess (const ParallelProcess &)=default
 
void DisableParallelProcessing (bool disable=true)
 
void EnableParallelProcessing (bool enable=true, int maxProcessors=0)
 
bool IsParallelProcessingEnabled () const
 
int MaxProcessors () const
 
ParallelProcessoperator= (const ParallelProcess &)=default
 
void SetMaxProcessors (int maxProcessors)
 
void Swap (ParallelProcess &process)
 

Detailed Description

This class performs the same tasks as a point surface interpolation device, such as PointSurfaceSpline or PointShepardInterpolation, but allows for much faster interpolation with negligible accuracy loss in most applications.

Interpolation from discrete grids can be orders of magnitude faster than direct evaluation of surface interpolation/approximation devices, depending on the number of input data points.

Definition at line 390 of file GridInterpolation.h.

Constructor & Destructor Documentation

◆ PointGridInterpolation() [1/3]

pcl::PointGridInterpolation::PointGridInterpolation ( )
default

Default constructor. Yields an empty instance that cannot be used without initialization.

◆ PointGridInterpolation() [2/3]

pcl::PointGridInterpolation::PointGridInterpolation ( const PointGridInterpolation )
default

Copy constructor.

◆ PointGridInterpolation() [3/3]

pcl::PointGridInterpolation::PointGridInterpolation ( PointGridInterpolation &&  )
default

Move constructor.

Member Function Documentation

◆ Clear()

void pcl::PointGridInterpolation::Clear ( )
inline

Deallocates internal structures, yielding an empty object that cannot be used before a new call to Initialize().

Definition at line 697 of file GridInterpolation.h.

◆ Delta()

int pcl::PointGridInterpolation::Delta ( ) const
inline

Returns the current grid distance for calculation of discrete function values. See Initialize() for more information.

Definition at line 720 of file GridInterpolation.h.

◆ Initialize() [1/3]

template<class PSI >
void pcl::PointGridInterpolation::Initialize ( const Rect rect,
int  delta,
const PSI &  PS,
bool  verbose = true 
)
inline

Initializes a PointGridInterpolation object with a point surface interpolation/approximation.

Parameters
rectReference rectangle. Interpolation will be initialized within the boundaries of this rectangle at discrete delta coordinate intervals.
deltaGrid distance for calculation of discrete function values. Must be > 0.
PSReference to a point surface interpolation/approximation object that will be used to evaluate function values at discrete coordinate intervals. This object must have been previously initialized and must be valid.
verboseIf true, this function will write information to the standard PixInsight console to provide some feedback to the user during the (potentially long) initialization process. If false, no feedback will be provided.

The template parameter PSI must provide a member function of the form:

DPoint PSI::operator ()( int x, int y ) const

or an equivalent operator member function whose return value can be statically casted to DPoint, with two by-value parameters that can be statically casted from the int type. This function will be called multiple times to evaluate the approximated surface at discrete grid coordinate pairs {x,y}. The implementation of this member function must be thread-safe if parallel processing has been enabled and allowed for this object.

If parallel processing is allowed, this function executes the initialization process using multiple concurrent threads. See EnableParallelProcessing() for additional information.

Definition at line 458 of file GridInterpolation.h.

◆ Initialize() [2/3]

template<class SI >
void pcl::PointGridInterpolation::Initialize ( const Rect rect,
int  delta,
const SI &  Sx,
const SI &  Sy,
bool  verbose = true 
)
inline

Initializes a PointGridInterpolation object with separate surface interpolations/approximations for the X and Y directions.

Parameters
rectReference rectangle. Interpolation will be initialized within the boundaries of this rectangle at discrete delta coordinate intervals.
deltaGrid distance for calculation of discrete function values. Must be > 0.
SxReference to a surface interpolation/approximation object that will be used to evaluate function values at discrete coordinate intervals on the X axis. This object must have been previously initialized and must be valid.
SyReference to a surface interpolation/approximation object that will be used to evaluate function values at discrete coordinate intervals on the Y axis. This object must have been previously initialized and must be valid.
verboseIf true, this function will write information to the standard PixInsight console to provide some feedback to the user during the (potentially long) initialization process. If false, no feedback will be provided.

The template parameter SI must provide a member function of the form:

double SI::operator ()( int x, int y ) const

or an equivalent operator member function whose return value can be statically casted to double, with two by-value parameters that can be statically casted from the int type. This function will be called multiple times for the Sx and Sy objects to evaluate the approximated surface at discrete grid coordinate pairs {x,y}, respectively on the X and Y plane directions. The implementation of this member function must be thread-safe if parallel processing has been enabled and allowed for this object.

If parallel processing is allowed, this function executes the initialization process using multiple concurrent threads. See EnableParallelProcessing() for additional information.

Definition at line 547 of file GridInterpolation.h.

◆ Initialize() [3/3]

void pcl::PointGridInterpolation::Initialize ( const Rect rect,
int  delta,
const DMatrix Gx,
const DMatrix Gy 
)
inline

Initializes this PointGridInterpolation object with prescribed interpolation matrices.

Parameters
rectReference rectangle. Interpolation will be initialized within the boundaries of this rectangle at discrete delta coordinate intervals.
deltaGrid distance for calculation of discrete function values. Must be > 0.
Gxinterpolation matrix in the X direction.
GyInterpolation matrix in the Y direction.

Both Gx and Gy matrices must have n rows and m columns, which are given by:

n = 1 + Ceil( rect.Height()/delta )
m = 1 + Ceil( rect.Width()/delta )

If one or both matrices have different dimensions, this function will throw an Error exception.

Matrix elements must be function values computed at discrete delta intervals within rect boundaries. For a given matrix row r and matrix column c, the corresponding matrix element must be a function value computed at coordinates {x,y} given by:

x = rect.x0 + c*delta
y = rect.y0 + r*delta

Definition at line 624 of file GridInterpolation.h.

◆ IsValid()

bool pcl::PointGridInterpolation::IsValid ( ) const
inline

Returns true iff this is a valid, initialized object ready for interpolation.

Definition at line 688 of file GridInterpolation.h.

◆ operator()() [1/2]

template<typename T >
DPoint pcl::PointGridInterpolation::operator() ( x,
y 
) const
inline

Returns an interpolated point at the specified coordinates.

Definition at line 753 of file GridInterpolation.h.

◆ operator()() [2/2]

template<typename T >
DPoint pcl::PointGridInterpolation::operator() ( const GenericPoint< T > &  p) const
inline

Returns an interpolated point at the given p.x and p.y coordinates.

Definition at line 765 of file GridInterpolation.h.

References pcl::GenericPoint< T >::x, and pcl::GenericPoint< T >::y.

◆ operator=() [1/2]

PointGridInterpolation& pcl::PointGridInterpolation::operator= ( const PointGridInterpolation )
default

Copy assignment operator. Returns a reference to this object.

◆ operator=() [2/2]

PointGridInterpolation& pcl::PointGridInterpolation::operator= ( PointGridInterpolation &&  )
default

Move assignment operator. Returns a reference to this object.

◆ ReferenceRect()

const Rect& pcl::PointGridInterpolation::ReferenceRect ( ) const
inline

Returns the current interpolation reference rectangle. See Initialize() for more information.

The returned rectangle is ordered (see pcl::IsOrderedRect()).

Definition at line 711 of file GridInterpolation.h.

◆ XInterpolationMatrix()

const DMatrix& pcl::PointGridInterpolation::XInterpolationMatrix ( ) const
inline

Returns a reference to the discrete matrix used for interpolation of function values in the X direction.

If this object has not been initialized, this member function returns a reference to an empty matrix.

Definition at line 732 of file GridInterpolation.h.

◆ YInterpolationMatrix()

const DMatrix& pcl::PointGridInterpolation::YInterpolationMatrix ( ) const
inline

Returns a reference to the discrete matrix used for interpolation of function values in the Y direction.

If this object has not been initialized, this member function returns a reference to an empty matrix.

Definition at line 744 of file GridInterpolation.h.


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