40template <
typename ImageT>
42 std::string const& algorithmName,
unsigned int buffer
54 buffImage->assign(inImage, box);
56 buffImage = std::make_shared<ImageT>(inImage);
59 if (offsetKernel->getWidth() > buffImage->getWidth() ||
60 offsetKernel->getHeight() > buffImage->getHeight()) {
62 (boost::format(
"Image of size %dx%d is too small to offset using a %s kernel"
64 buffImage->getWidth() % buffImage->getHeight() % algorithmName %
65 offsetKernel->getWidth() % offsetKernel->getHeight())
75 if (dx > -1 && dx < 1 && dy > -1 && dy < 1) {
81 dOrigX =
static_cast<int>(
std::floor(dx + 0.5));
82 dOrigY =
static_cast<int>(
std::floor(dy + 0.5));
88 double dKerX = -fracX;
89 double dKerY = -fracY;
108 convolve(*convImage, *buffImage, *offsetKernel, convolutionControl);
116 outImage = convImage;
129#define INSTANTIATE(TYPE) \
130 template std::shared_ptr<afwImage::Image<TYPE>> offsetImage(afwImage::Image<TYPE> const&, float, float, \
131 std::string const&, unsigned int); \
132 template std::shared_ptr<afwImage::MaskedImage<TYPE>> offsetImage( \
133 afwImage::MaskedImage<TYPE> const&, float, float, std::string const&, unsigned int);
#define INSTANTIATE(FROMSYS, TOSYS)
#define LSST_EXCEPT(type,...)
Parameters to control convolution.
void setDoCopyEdge(bool doCopyEdge)
void setDoNormalize(bool doNormalize)
void convolve(OutImageT &convolvedImage, InImageT const &inImage, KernelT const &kernel, ConvolutionControl const &convolutionControl=ConvolutionControl())
Convolve an Image or MaskedImage with a Kernel, setting pixels of an existing output image.
std::shared_ptr< SeparableKernel > makeWarpingKernel(std::string name)
Return a warping kernel given its name.
std::shared_ptr< ImageT > offsetImage(ImageT const &image, float dx, float dy, std::string const &algorithmName="lanczos5", unsigned int buffer=0)
Return an image offset by (dx, dy) using the specified algorithm.
Extent< int, 2 > Extent2I