CLInterpolator2D.h

Classes

CLInterpolator2D -- Abstract base class for interpolator used by CurvedLattice2D. (full description)

class CLInterpolator2D

Interface

Public Members
CLInterpolator2D() : itsLatticePtr(0)
virtual ~CLInterpolator2D()
virtual CLInterpolator2D<T>* clone() const = 0
void set (MaskedLattice<T>* lattice, const AxesMapping& axesMap, uInt axis1, uInt axis2, uInt curveAxis)
virtual void getData (Array<T>& buffer, const Vector<Float>& x, const Vector<Float>& y, const Vector& section) = 0
virtual void getMask (Array<Bool>& buffer, const Vector<Float>& x, const Vector<Float>& y, const Slicer& section) = 0
Protected Members
CLInterpolator2D (const CLInterpolator2D<T>&)
CLInterpolator2D& operator= (const CLInterpolator2D<T>&)
virtual void preset()

Description

Review Status

Programs:
Tests:

Prerequisite

Etymology

The CL in CLInterpolator2D means CurvedLattice. The 2D means that interpolation in 2 dimensions needs to be done.

Synopsis

CurvedLattice2D needs lattice data which are not on exact grid points. Therefore some interpolation scheme is needed. The abstract base class CLInterpolation2D makes it possible for CurvedLattice2D to use any interpolation scheme. Currently the only derived class is CLIPNearest2D
Apart from interpolating and returning data, a derived class also has to return a mask. For instance, in a possible derived class using 4-point interpolation, the interpolation scheme has to take the image mask into account, and make a mask for its output data (say that the output point is masked off if its 4 input points are masked off).

This base class has some data members defining the lattice and the lattice axes to be interpolated. When these data members are set, the virtual function preset is called. A derived class can implement this function to do some precalculations, etc..

Motivation

This class makes it possible to hide the interpolation to be used from the CurvedLattice2D class.

Member Description

CLInterpolator2D() : itsLatticePtr(0)

virtual ~CLInterpolator2D()

virtual CLInterpolator2D<T>* clone() const = 0

Let a derived class make a copy of itself.

void set (MaskedLattice<T>* lattice, const AxesMapping& axesMap, uInt axis1, uInt axis2, uInt curveAxis)

Set the internals to the values of the CurvedLattice using it. Note that only a copy of the lattice pointer is made. Thereafter the virtual function preset() is called to give a derived class the opportunity to do some initial work.

virtual void getData (Array<T>& buffer, const Vector<Float>& x, const Vector<Float>& y, const Vector& section) = 0

Get the data for the given pixel points (on axis1 and axis2) and the chunk in the other axes as given by the section. The Slicer is fixed and the buffer has the correct shape.

virtual void getMask (Array<Bool>& buffer, const Vector<Float>& x, const Vector<Float>& y, const Slicer& section) = 0

Get the mask for the given pixel points (on axis1 and axis2) and the chunk in the other axes as given by the section. The Slicer is fixed and the buffer has the correct shape.

CLInterpolator2D (const CLInterpolator2D<T>&)

Copy constructor can only be used by derived classes.

CLInterpolator2D& operator= (const CLInterpolator2D<T>&)

Assignment can only be used by derived classes.

virtual void preset()

Let a derived class do some initial work after set is called. The default implementation does nothing.