33 #include "boost/format.hpp"
52 bool operator()(T
val)
const {
53 return ((
val.mask() & _badPixel) == 0) ? true :
false;
62 struct CheckKnownValue {
66 bool operator()(T
val)
const {
81 template <
typename ImageT,
typename isVal
idPixel>
82 int copyGoodPixelsImpl(
84 ImageT
const &srcImage,
88 overlapBBox.
clip(srcImage.getBBox());
96 isValidPixel
const isValid(badPixelMask);
98 for (
int y = 0, endY = srcView.getHeight();
y != endY; ++
y) {
99 typename ImageT::const_x_iterator srcIter = srcView.row_begin(
y);
100 typename ImageT::const_x_iterator
const srcEndIter = srcView.row_end(
y);
101 typename ImageT::x_iterator destIter = destView.row_begin(
y);
102 for (; srcIter != srcEndIter; ++srcIter, ++destIter) {
104 *destIter = *srcIter;
115 template <
typename ImagePixelT>
122 return copyGoodPixelsImpl<Image, CheckKnownValue>(destImage, srcImage, 0x0);
125 template <
typename ImagePixelT>
135 return copyGoodPixelsImpl<Image, CheckMask>(destImage, srcImage, badPixelMask);
141 #define MASKEDIMAGE(IMAGEPIXEL) afwImage::MaskedImage<IMAGEPIXEL, \
142 afwImage::MaskPixel, afwImage::VariancePixel>
143 #define INSTANTIATE(IMAGEPIXEL) \
144 template int coaddUtils::copyGoodPixels<IMAGEPIXEL>( \
145 afwImage::Image<IMAGEPIXEL> &destImage, \
146 afwImage::Image<IMAGEPIXEL> const &srcImage \
149 template int coaddUtils::copyGoodPixels<IMAGEPIXEL>( \
150 MASKEDIMAGE(IMAGEPIXEL) &destImage, \
151 MASKEDIMAGE(IMAGEPIXEL) const &srcImage, \
152 afwImage::MaskPixel const badPixelMask \