25 #ifndef LSST_AFW_MATH_BoundedField_h_INCLUDED
26 #define LSST_AFW_MATH_BoundedField_h_INCLUDED
30 #include "lsst/base.h"
87 ndarray::Array<double, 1, 1>
evaluate(ndarray::Array<double const, 1>
const&
x,
88 ndarray::Array<double const, 1>
const& y)
const;
102 virtual double mean()
const;
124 template <
typename T>
138 template <
typename T>
151 template <
typename T>
164 template <
typename T>
172 virtual std::shared_ptr<BoundedField>
operator*(
double const scale)
const = 0;
183 {
return os << bf.toString() <<
" on " << bf.
getBBox(); }
192 virtual std::string toString()
const = 0;
195 std::shared_ptr<BoundedField>
operator*(
double const scale, std::shared_ptr<BoundedField const> bf);
200 #endif // !LSST_AFW_MATH_BoundedField_h_INCLUDED
bool operator!=(BoundedField const &rhs) const
BoundedFields (of the same sublcass) are equal if their bounding boxes and parameters are equal...
void multiplyImage(image::Image< T > &image, bool overlapOnly=false) const
Multiply an image by the field in-place.
virtual double evaluate(geom::Point2D const &position) const =0
Evaluate the field at the given point.
virtual double integrate() const
Compute the integral of this function over its bounding-box.
virtual std::shared_ptr< BoundedField > operator*(double const scale) const =0
Return a scaled BoundedField.
virtual double mean() const
Compute the mean of this function over its bounding-box.
std::shared_ptr< BoundedField > operator/(double scale) const
geom::Box2I getBBox() const
Return the bounding box that defines the region where the field is valid.
An integer coordinate rectangle.
A base class for objects that can be persisted via afw::table::io Archive classes.
void divideImage(image::Image< T > &image, bool overlapOnly=false) const
Divide an image by the field in-place.
BoundedField(geom::Box2I const &bbox)
void fillImage(image::Image< T > &image, bool overlapOnly=false) const
Assign the field to an image, overwriting values already present.
double evaluate(double x, double y) const
Evaluate the field at the given point.
virtual bool operator==(BoundedField const &rhs) const =0
BoundedFields (of the same sublcass) are equal if their bounding boxes and parameters are equal...
std::shared_ptr< BoundedField > operator*(double const scale, std::shared_ptr< BoundedField const > bf)
friend std::ostream & operator<<(std::ostream &os, BoundedField const &bf)
An abstract base class for 2-d functions defined on an integer bounding boxes.
A CRTP facade class for subclasses of Persistable.
A class to represent a 2-dimensional array of pixels.
void addToImage(image::Image< T > &image, double scaleBy=1.0, bool overlapOnly=false) const
Add the field or a constant multiple of it to an image in-place.