32 #include "boost/format.hpp"
38 namespace pexExcept = lsst::pex::exceptions;
39 namespace afwGeom = lsst::afw::geom;
41 namespace coaddUtils = lsst::coadd::utils;
51 bool operator()(T
val)
const {
52 return ((val.mask() & _badPixel) == 0) ?
true :
false;
61 struct CheckKnownValue {
65 bool operator()(T val)
const {
80 template <
typename ImageT,
typename isVal
idPixel>
81 int copyGoodPixelsImpl(
83 ImageT
const &srcImage,
87 overlapBBox.
clip(srcImage.getBBox());
95 isValidPixel
const isValid(badPixelMask);
97 for (
int y = 0, endY = srcView.getHeight();
y != endY; ++
y) {
98 typename ImageT::const_x_iterator srcIter = srcView.row_begin(
y);
99 typename ImageT::const_x_iterator
const srcEndIter = srcView.row_end(
y);
100 typename ImageT::x_iterator destIter = destView.row_begin(
y);
101 for (; srcIter != srcEndIter; ++srcIter, ++destIter) {
102 if (isValid(srcIter)) {
103 *destIter = *srcIter;
114 template <
typename ImagePixelT>
121 return copyGoodPixelsImpl<Image, CheckKnownValue>(destImage, srcImage, 0x0);
124 template <
typename ImagePixelT>
134 return copyGoodPixelsImpl<Image, CheckMask>(destImage, srcImage, badPixelMask);
140 #define MASKEDIMAGE(IMAGEPIXEL) afwImage::MaskedImage<IMAGEPIXEL, \
141 afwImage::MaskPixel, afwImage::VariancePixel>
142 #define INSTANTIATE(IMAGEPIXEL) \
143 template int coaddUtils::copyGoodPixels<IMAGEPIXEL>( \
144 afwImage::Image<IMAGEPIXEL> &destImage, \
145 afwImage::Image<IMAGEPIXEL> const &srcImage \
148 template int coaddUtils::copyGoodPixels<IMAGEPIXEL>( \
149 MASKEDIMAGE(IMAGEPIXEL) &destImage, \
150 MASKEDIMAGE(IMAGEPIXEL) const &srcImage, \
151 afwImage::MaskPixel const badPixelMask \
boost::uint16_t MaskPixel
An include file to include the header files for lsst::afw::geom.
void clip(Box2I const &other)
Shrink this to ensure that other.contains(*this).
int copyGoodPixels(lsst::afw::image::Image< ImagePixelT > &destImage, lsst::afw::image::Image< ImagePixelT > const &srcImage)
copy good pixels from one image to another
An integer coordinate rectangle.
table::Key< table::Array< Kernel::Pixel > > image
A class to manipulate images, masks, and variance as a single object.
float VariancePixel
! default type for Masks and MaskedImage Masks
bool isEmpty() const
Return true if the box contains no points.
Include files required for standard LSST Exception handling.