30 namespace SourceXtractor {
34 : m_down_scaling(down_scaling) {
35 if (image !=
nullptr) {
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()) {
60 m_psf = std::make_shared<ImagePsf>(pixel_scale / down_scaling, new_image);
70 if (
m_psf !=
nullptr) {
71 return m_psf->getPixelScale();
78 if (
m_psf !=
nullptr) {
79 return m_psf->getWidth();
86 if (
m_psf !=
nullptr) {
87 return m_psf->getScaledKernel(scale);
94 if (
m_psf !=
nullptr) {
95 m_psf->convolve(image);
101 if (
m_psf !=
nullptr) {
102 return m_psf->prepare(model_ptr);
110 if (
m_psf !=
nullptr) {
111 m_psf->convolve(image, context);
static ImageInterfaceTypePtr factory(std::size_t width, std::size_t height)
static void addImageToImage(ImageInterfaceTypePtr &target_image, const ImageInterfaceTypePtr &source_image, double scale_factor, double x, double y)