40 template <
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;
97 offsetKernel->setCtrX(offsetKernel->getCtrX() + 1);
100 offsetKernel->setCtrY(offsetKernel->getCtrY() + 1);
105 convolve(*convImage, *buffImage, *offsetKernel,
true,
true);
113 outImage = convImage;
126 #define INSTANTIATE(TYPE) \ 127 template std::shared_ptr<afwImage::Image<TYPE>> offsetImage(afwImage::Image<TYPE> const&, float, float, \ 128 std::string const&, unsigned int); \ 129 template std::shared_ptr<afwImage::MaskedImage<TYPE>> offsetImage( \ 130 afwImage::MaskedImage<TYPE> const&, float, float, std::string const&, unsigned int);
Reports attempts to exceed implementation-defined length limits for some classes. ...
std::shared_ptr< SeparableKernel > makeWarpingKernel(std::string name)
Return a warping kernel given its name.
A base class for image defects.
def format(config, name=None, writeSourceLine=True, prefix="", verbose=False)
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...
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
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.
Backwards-compatibility support for depersisting the old Calib (FluxMag0/FluxMag0Err) objects...
An integer coordinate rectangle.
#define INSTANTIATE(FROMSYS, TOSYS)