2 #if !defined(LSST_AFW_MATH_APPROXIMATE_H)
3 #define LSST_AFW_MATH_APPROXIMATE_H
26 #include "lsst/base.h"
34 template <
typename PixelT>
36 template <
typename PixelT,
typename U,
typename V>
78 void setOrderY(
int const orderY) { _orderY = orderY; }
82 void setWeighting(
bool const weighting) { _weighting = weighting; }
100 template <
typename PixelT>
101 std::shared_ptr<Approximate<PixelT>>
makeApproximate(std::vector<double>
const&
x,
102 std::vector<double>
const& y,
104 geom::Box2I const& bbox, ApproximateControl
const& ctrl);
109 template <
typename PixelT>
114 friend std::shared_ptr<Approximate<PixelT>> makeApproximate<>(std::vector<double>
const&
x,
115 std::vector<double>
const& y,
122 std::shared_ptr<image::Image<OutPixelT>>
getImage(
int orderX = -1,
int orderY = -1)
const {
123 return doGetImage(
orderX, orderY);
127 return doGetMaskedImage(
orderX, orderY);
135 std::vector<double>
const& y,
148 virtual std::shared_ptr<image::Image<OutPixelT>> doGetImage(
int orderX,
int orderY)
const = 0;
149 virtual std::shared_ptr<image::MaskedImage<OutPixelT>> doGetMaskedImage(
int orderX,
int orderY)
const = 0;
155 #endif // LSST_AFW_MATH_APPROXIMATE_H
geom::Box2I const _bbox
Domain for approximation.
std::vector< double > const _yVec
the y-values of points
Approximate(std::vector< double > const &x, std::vector< double > const &y, geom::Box2I const &bbox, ApproximateControl const &ctrl)
Base class ctor.
virtual ~Approximate()
dtor
Use a 2-D Chebyshev polynomial.
void setOrderX(int const orderX)
Set the order of approximation to use in the x-direction.
float OutPixelT
The pixel type of returned images.
int getOrderY() const
Return the order of approximation to use in the y-direction.
std::shared_ptr< Approximate< PixelT > > makeApproximate(std::vector< double > const &x, std::vector< double > const &y, image::MaskedImage< PixelT > const &im, geom::Box2I const &bbox, ApproximateControl const &ctrl)
Construct a new Approximate object, inferring the type from the type of the given MaskedImage...
std::vector< double > const _xVec
the x-values of points
void setWeighting(bool const weighting)
Set whether inverse variance weighting will be used in calculation.
Approximate values for a MaskedImage.
An integer coordinate rectangle.
std::shared_ptr< image::Image< OutPixelT > > getImage(int orderX=-1, int orderY=-1) const
Return the approximate image as a Image.
Control how to make an approximation.
Style getStyle() const
Return the Style.
std::shared_ptr< image::MaskedImage< OutPixelT > > getMaskedImage(int orderX=-1, int orderY=-1) const
Return the approximate image as a MaskedImage.
void setStyle(Style const style)
Set the Style.
A class to manipulate images, masks, and variance as a single object.
Style
Choose the type of approximation to use.
ApproximateControl const _ctrl
desired approximation algorithm
ApproximateControl(Style style, int orderX, int orderY=-1, bool weighting=true)
ctor
void setOrderY(int const orderY)
Set the order of approximation to use in the y-direction.
int getOrderX() const
Return the order of approximation to use in the x-direction.
bool getWeighting() const
Return whether inverse variance weighting will be used in calculation.