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;
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< 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.