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 \
bool isEmpty() const noexcept
Return true if the box contains no points.
int copyGoodPixels(lsst::afw::image::Image< ImagePixelT > &destImage, lsst::afw::image::Image< ImagePixelT > const &srcImage)
copy good pixels from one image to another
ImageT::SinglePixel badPixel(typename ImageT::Pixel bad=0)
Return a value indicating a bad pixel for the given Image type.
A class to manipulate images, masks, and variance as a single object.
void clip(Box2I const &other) noexcept
Shrink this to ensure that other.contains(*this).
Backwards-compatibility support for depersisting the old Calib (FluxMag0/FluxMag0Err) objects...
float VariancePixel
default type for MaskedImage variance images
An integer coordinate rectangle.
A class to represent a 2-dimensional array of pixels.
#define INSTANTIATE(FROMSYS, TOSYS)