SourceXtractorPlusPlus 1.0.3
SourceXtractor++, the next generation SExtractor
Loading...
Searching...
No Matches
ImageInterfaceTraits.h
Go to the documentation of this file.
1
17/*
18 * ImageInterfaceTraits.h
19 *
20 * Created on: May 3, 2017
21 * Author: mschefer
22 */
23
24#ifndef _SEIMPLEMENTATION_IMAGE_IMAGEINTERFACETRAITS_H_
25#define _SEIMPLEMENTATION_IMAGE_IMAGEINTERFACETRAITS_H_
26
27#define INTERP_MAXKERNELWIDTH 8 // Max. range of kernel (pixels)
28
29#include <boost/math/constants/constants.hpp>
30#include <cmath>
31#include <algorithm>
32#include <memory>
33#include <utility>
34#include <vector>
35
39
40#ifdef __APPLE__
41#define sincosf __sincosf
42#endif
43
44namespace ModelFitting {
45
46// Interpolation types
49
54
55template <>
57
58 using iterator = std::vector<ImageInterfaceType::PixelType>::iterator;
59
63
65 return image->getWidth();
66 }
67
69 return image->getHeight();
70 }
71
73 return image->at(x, y);
74 }
75
77 return image->at(x, y);
78 }
79
80 static iterator begin(const ImageInterfaceTypePtr& image) {
81 return image->getData().begin();
82 }
83
84 static iterator end(const ImageInterfaceTypePtr& image) {
85 return image->getData().end();
86 }
87
88 static void addImageToImage(ImageInterfaceTypePtr& target_image, const ImageInterfaceTypePtr& source_image,
89 double scale_factor, double x, double y);
90}; // end of class ImageTraits<ImageInterfaceTypePtr>
91
92} // end of namespace ModelFitting
93
94namespace SourceXtractor {
95
96// Make those types available to the SExtractor namespace for convenience
101
102// Interpolation types
105
106float interpolate_pix(float *pix, float x, float y,
107 int xsize, int ysize, interpenum interptype);
108
109} // end of namespace SExtractor
110
111#endif /* _SEIMPLEMENTATION_IMAGE_IMAGEINTERFACETRAITS_H_ */
Image implementation which keeps the pixel values in memory.
Definition VectorImage.h:52
static std::shared_ptr< VectorImage< T > > create(Args &&... args)
std::shared_ptr< ImageInterfaceType > ImageInterfaceTypePtr
std::shared_ptr< WriteableInterfaceType > WriteableInterfaceTypePtr
SourceXtractor::VectorImage< SourceXtractor::SeFloat > ImageInterfaceType
SourceXtractor::WriteableImage< SourceXtractor::SeFloat > WriteableInterfaceType
float interpolate_pix(float *pix, float x, float y, int xsize, int ysize, interpenum interptype)
static std::size_t height(const ImageInterfaceTypePtr &image)
static iterator end(const ImageInterfaceTypePtr &image)
std::vector< ImageInterfaceType::PixelType >::iterator iterator
static ImageInterfaceType::PixelType & at(ImageInterfaceTypePtr &image, std::size_t x, std::size_t y)
static std::size_t width(const ImageInterfaceTypePtr &image)
static ImageInterfaceTypePtr factory(std::size_t width, std::size_t height)
static ImageInterfaceType::PixelType at(const ImageInterfaceTypePtr &image, std::size_t x, std::size_t y)
static iterator begin(const ImageInterfaceTypePtr &image)
static void addImageToImage(ImageType &image1, const ImageType &image2, double scale, double x, double y)