28 #ifndef LSST_AFW_IMAGE_IMAGE_ALGORITHM_H 29 #define LSST_AFW_IMAGE_IMAGE_ALGORITHM_H 37 #include "boost/mpl/bool.hpp" 52 template <
typename ValT>
61 template <
typename ValT>
70 template <
typename ValT>
73 virtual ValT
operator()(
int x,
int y, ValT lhs)
const = 0;
79 template <
typename LhsT,
typename RhsT>
82 virtual LhsT
operator()(LhsT lhs, RhsT rhs)
const = 0;
88 template <
typename LhsT,
typename RhsT>
91 virtual LhsT
operator()(
int x,
int y, LhsT lhs, RhsT rhs)
const = 0;
97 template <
typename LhsT>
103 lhsPtr != lhsEnd; ++lhsPtr) {
112 template <
typename LhsT>
118 lhsPtr != lhsEnd; ++lhsPtr) {
119 *lhsPtr = func(*lhsPtr);
129 template <
typename LhsT>
136 lhsPtr != lhsEnd; ++lhsPtr, ++
x) {
137 *lhsPtr = func(x,
y + lhs.
getY0(), *lhsPtr);
145 template <
typename LhsT,
typename RhsT>
161 lhsPtr != lhsEnd; ++rhsPtr, ++lhsPtr) {
162 *lhsPtr = func(*rhsPtr);
170 template <
typename LhsT,
typename RhsT>
186 lhsPtr != lhsEnd; ++rhsPtr, ++lhsPtr) {
187 *lhsPtr = func(*lhsPtr, *rhsPtr);
196 template <
typename LhsT,
typename RhsT>
212 lhsPtr != lhsEnd; ++rhsPtr, ++lhsPtr, ++
x) {
213 *lhsPtr = func(x,
y + lhs.
getY0(), *lhsPtr, *rhsPtr);
A functor class equivalent to std::function<LhsT (LhsT, RhsT)>, but with a virtual operator() ...
A functor class equivalent to std::function<ValT (int, int, ValT)>, but with a virtual operator() ...
int getHeight() const
Return the number of rows in the image.
Reports attempts to exceed implementation-defined length limits for some classes. ...
_const_view_t::x_iterator const_x_iterator
A const iterator for traversing the pixels in a row.
_view_t::x_iterator x_iterator
An iterator for traversing the pixels in a row.
void for_each_pixel(Image< LhsT > &lhs, pixelOp0< LhsT > const &func)
Set each pixel in an Image<LhsT> to func()
int getX0() const
Return the image's column-origin.
x_iterator row_begin(int y) const
Return an x_iterator to the start of the y'th row.
A base class for image defects.
A functor class equivalent to std::function<LhsT (int, int, LhsT, RhsT)>, but with a virtual operator...
def format(config, name=None, writeSourceLine=True, prefix="", verbose=False)
A functor class equivalent to std::function<ValT ()>, but with a virtual operator() ...
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
int getY0() const
Return the image's row-origin.
int getWidth() const
Return the number of columns in the image.
x_iterator row_end(int y) const
Return an x_iterator to the end of the y'th row.
A functor class equivalent to std::function<ValT (ValT)>, but with a virtual operator() ...
lsst::geom::Extent2I getDimensions() const
Return the image's size; useful for passing to constructors.
Backwards-compatibility support for depersisting the old Calib (FluxMag0/FluxMag0Err) objects...
virtual ValT operator()() const =0
A class to represent a 2-dimensional array of pixels.