34 : m_down_scaling(down_scaling) {
38 if (image->getWidth() != image->getHeight()) {
40 << image->getWidth() <<
" x " << image->getHeight();
42 if (image->getWidth() % 2 == 0) {
47 if (down_scaling != 1.0) {
48 int new_size = image->getWidth() * down_scaling;
49 new_size += (new_size % 2 == 0) ? 1 : 0;
55 auto psf_sum =
std::accumulate(new_image->getData().begin(), new_image->getData().end(), 0.);
56 for (
auto& pixel : new_image->getData()) {
67 return m_psf->getPixelScale();
71 return m_psf->getWidth();
75 return m_psf->getScaledKernel(scale);
79 m_psf->convolve(image);
84 return m_psf->prepare(model_ptr);
89 m_psf->convolve(image, context);
static void addImageToImage(ImageInterfaceTypePtr &target_image, const ImageInterfaceTypePtr &source_image, double scale_factor, double x, double y)
static ImageInterfaceTypePtr factory(std::size_t width, std::size_t height)