39 template<
typename DestImageT,
typename SrcImageT>
43 SrcImageT
const &srcImage,
45 typename DestImageT::SinglePixel padValue
68 typename DestImageT::x_iterator &destXIter,
77 if (srcIndFracX.second < 0) {
81 if (srcIndFracY.second < 0) {
89 int srcStartX = srcIndFracX.first -
_kernelCtr[0];
90 int srcStartY = srcIndFracY.first -
_kernelCtr[1];
93 double kSum =
_setFracIndex(srcIndFracX.second, srcIndFracY.second);
95 typename SrcImageT::const_xy_locator srcLoc =
_srcImage.xy_at(srcStartX, srcStartY);
97 *destXIter = lsst::afw::math::convolveAtAPoint<DestImageT, SrcImageT>(srcLoc,
_xList,
_yList);
98 *destXIter *= relativeArea/kSum;
114 typename DestImageT::x_iterator &destXIter,
123 if (srcIndFracX.second < 0) {
124 ++srcIndFracX.second;
127 if (srcIndFracY.second < 0) {
128 ++srcIndFracY.second;
135 int srcStartX = srcIndFracX.first -
_kernelCtr[0];
136 int srcStartY = srcIndFracY.first -
_kernelCtr[1];
139 double kSum =
_setFracIndex(srcIndFracX.second, srcIndFracY.second);
141 typename SrcImageT::const_xy_locator srcLoc =
_srcImage.xy_at(srcStartX, srcStartY);
143 *destXIter = lsst::afw::math::convolveAtAPoint<DestImageT, SrcImageT>(srcLoc,
_xList,
_yList);
144 *destXIter *= relativeArea/kSum;
151 typename SrcImageT::Mask::const_xy_locator srcMaskLoc =
\
152 _srcImage.getMask()->xy_at(maskStartX, maskStartY);
154 typedef typename std::vector<lsst::afw::math::Kernel::Pixel>::const_iterator k_iter;
156 typename DestImageT::Mask::SinglePixel destMaskValue = 0;
158 kernelYIter != yEnd; ++kernelYIter) {
160 typename DestImageT::Mask::SinglePixel destMaskValueY = 0;
162 kernelXIter != xEnd; ++kernelXIter, ++srcMaskLoc.x()) {
165 destMaskValueY |= *srcMaskLoc;
169 double const kValY = *kernelYIter;
171 destMaskValue |= destMaskValueY;
174 srcMaskLoc += lsst::afw::image::detail::difference_type(-
_maskXList.size(), 1);
177 destXIter.mask() = (destXIter.mask() &
_growFullMask) | destMaskValue;
194 std::pair<double, double> srcFracInd(xFrac, yFrac);
DestImageT::SinglePixel _padValue
boost::uint16_t MaskPixel
Declare the Kernel class and subclasses.
A coordinate class intended to represent absolute positions.
std::vector< double > _xList
A kernel described by a pair of functions: func(x, y) = colFunc(x) * rowFunc(y)
lsst::afw::image::MaskPixel _growFullMask
std::vector< double > _yList
A functor that computes one warped pixel.
Parameters to control convolution.
double _setFracIndex(double xFrac, double yFrac)
std::vector< double > _maskYList
table::Key< table::Array< Kernel::Pixel > > image
bool operator()(typename DestImageT::x_iterator &destXIter, lsst::afw::geom::Point2D const &srcPos, double relativeArea, lsst::afw::image::detail::MaskedImage_tag)
boost::shared_ptr< lsst::afw::math::SeparableKernel > _maskKernelPtr
A traits class for MaskedImage.
bool operator()(typename DestImageT::x_iterator &destXIter, lsst::afw::geom::Point2D const &srcPos, double relativeArea, lsst::afw::image::detail::Image_tag)
lsst::afw::geom::Point2I _maskKernelCtr
bool contains(Point2I const &point) const
Return true if the box contains the point.
std::vector< double > _maskXList
lsst::afw::geom::Box2I const _srcGoodBBox
boost::shared_ptr< lsst::afw::math::SeparableKernel > _kernelPtr
Implementation of the Class MaskedImage.
lsst::afw::geom::Point2I _kernelCtr
WarpAtOnePoint(SrcImageT const &srcImage, WarpingControl const &control, typename DestImageT::SinglePixel padValue)