38 #include "boost/cstdint.hpp"
47 namespace mathDetail = lsst::afw::math::detail;
58 template <
typename OutImageT,
typename InImageT>
60 OutImageT
const &convolvedImage,
61 InImageT
const &inImage,
64 if (convolvedImage.getDimensions() != inImage.getDimensions()) {
65 std::ostringstream os;
66 os <<
"convolvedImage dimensions = ( "
67 << convolvedImage.getWidth() <<
", " << convolvedImage.getHeight()
68 <<
") != (" << inImage.getWidth() <<
", " << inImage.getHeight() <<
") = inImage dimensions";
69 throw LSST_EXCEPT(pexExcept::InvalidParameterError, os.str());
71 if (inImage.getWidth() < kernel.
getWidth() || inImage.getHeight() < kernel.
getHeight()) {
72 std::ostringstream os;
73 os <<
"inImage dimensions = ( "
74 << inImage.getWidth() <<
", " << inImage.getHeight()
76 <<
") = kernel dimensions in width and/or height";
77 throw LSST_EXCEPT(pexExcept::InvalidParameterError, os.str());
80 std::ostringstream os;
81 os <<
"kernel dimensions = ( "
83 <<
") smaller than (1, 1) in width and/or height";
84 throw LSST_EXCEPT(pexExcept::InvalidParameterError, os.str());
92 #define IMAGE(PIXTYPE) afwImage::Image<PIXTYPE>
93 #define MASKEDIMAGE(PIXTYPE) afwImage::MaskedImage<PIXTYPE, afwImage::MaskPixel, afwImage::VariancePixel>
96 #define INSTANTIATE_IM_OR_MI(IMGMACRO, OUTPIXTYPE, INPIXTYPE) \
97 template void mathDetail::assertDimensionsOK( \
98 IMGMACRO(OUTPIXTYPE) const &convolvedImage, \
99 IMGMACRO(INPIXTYPE) const &inImage, \
100 lsst::afw::math::Kernel const &kernel \
104 #define INSTANTIATE(OUTPIXTYPE, INPIXTYPE) \
105 INSTANTIATE_IM_OR_MI(IMAGE, OUTPIXTYPE, INPIXTYPE) \
106 INSTANTIATE_IM_OR_MI(MASKEDIMAGE, OUTPIXTYPE, INPIXTYPE)
Declare the Kernel class and subclasses.
int getWidth() const
Return the Kernel's width.
int getHeight() const
Return the Kernel's height.
CPU and GPU convolution shared code.
table::Key< table::Array< Kernel::Pixel > > image
#define LSST_EXCEPT(type,...)
void assertDimensionsOK(OutImageT const &convolvedImage, InImageT const &inImage, lsst::afw::math::Kernel const &kernel)
Implementation of the Class MaskedImage.
Kernels are used for convolution with MaskedImages and (eventually) Images.
Include files required for standard LSST Exception handling.