SourceXtractorPlusPlus  0.10
Please provide a description of the project.
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 
44 namespace ModelFitting {
45 
46 // Interpolation types
49 
54 
55 template <>
57 
59 
62  }
63 
64  static std::size_t width(const ImageInterfaceTypePtr& image) {
65  return image->getWidth();
66  }
67 
68  static std::size_t height(const ImageInterfaceTypePtr& image) {
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 
94 namespace SourceXtractor {
95 
96 // Make those types available to the SExtractor namespace for convenience
101 
102 // Interpolation types
105 
106 float 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_ */
ModelFitting::ImageTraits< ImageInterfaceTypePtr >::factory
static ImageInterfaceTypePtr factory(std::size_t width, std::size_t height)
Definition: ImageInterfaceTraits.h:60
ModelFitting::interpenum
interpenum
Definition: ImageInterfaceTraits.h:47
ModelFitting::WriteableInterfaceTypePtr
std::shared_ptr< WriteableInterfaceType > WriteableInterfaceTypePtr
Definition: ImageInterfaceTraits.h:53
std::shared_ptr
STL class.
interpenum
interpenum
Definition: OpenCvMatImageTraits.h:37
ModelFitting::INTERP_LANCZOS4
@ INTERP_LANCZOS4
Definition: ImageInterfaceTraits.h:48
SourceXtractor::Image::PixelType
T PixelType
Definition: Image.h:47
ModelFitting::ImageTraits< ImageInterfaceTypePtr >::at
static ImageInterfaceType::PixelType & at(ImageInterfaceTypePtr &image, std::size_t x, std::size_t y)
Definition: ImageInterfaceTraits.h:72
ModelFitting::ImageTraits< ImageInterfaceTypePtr >::at
static ImageInterfaceType::PixelType at(const ImageInterfaceTypePtr &image, std::size_t x, std::size_t y)
Definition: ImageInterfaceTraits.h:76
std::vector
STL class.
ModelFitting::WriteableInterfaceType
SourceXtractor::WriteableImage< SourceXtractor::SeFloat > WriteableInterfaceType
Definition: ImageInterfaceTraits.h:52
SourceXtractor::INTERP_LANCZOS2
@ INTERP_LANCZOS2
Definition: ImageInterfaceTraits.h:103
ModelFitting::INTERP_BILINEAR
@ INTERP_BILINEAR
Definition: ImageInterfaceTraits.h:47
VectorImage.h
SourceXtractor::INTERP_NEARESTNEIGHBOUR
@ INTERP_NEARESTNEIGHBOUR
Definition: ImageInterfaceTraits.h:103
ModelFitting::ImageTraits
Definition: ImageTraits.h:29
SourceXtractor
Definition: Aperture.h:30
ModelFitting::ImageTraits< ImageInterfaceTypePtr >::iterator
std::vector< ImageInterfaceType::PixelType >::iterator iterator
Definition: ImageInterfaceTraits.h:58
SourceXtractor::INTERP_LANCZOS4
@ INTERP_LANCZOS4
Definition: ImageInterfaceTraits.h:104
SourceXtractor::WriteableImage
Definition: WriteableImage.h:32
SourceXtractor::VectorImage::create
static std::shared_ptr< VectorImage< T > > create(Args &&... args)
Definition: VectorImage.h:89
SourceXtractor::INTERP_LANCZOS3
@ INTERP_LANCZOS3
Definition: ImageInterfaceTraits.h:104
ImageTraits.h
SourceXtractor::INTERP_BILINEAR
@ INTERP_BILINEAR
Definition: ImageInterfaceTraits.h:103
Image.h
ModelFitting::ImageTraits::addImageToImage
static void addImageToImage(ImageType &image1, const ImageType &image2, double scale, double x, double y)
ModelFitting::INTERP_LANCZOS2
@ INTERP_LANCZOS2
Definition: ImageInterfaceTraits.h:47
ModelFitting::ImageTraits< ImageInterfaceTypePtr >::begin
static iterator begin(const ImageInterfaceTypePtr &image)
Definition: ImageInterfaceTraits.h:80
ModelFitting::ImageTraits< ImageInterfaceTypePtr >::width
static std::size_t width(const ImageInterfaceTypePtr &image)
Definition: ImageInterfaceTraits.h:64
x
std::shared_ptr< DependentParameter< std::shared_ptr< EngineParameter > > > x
Definition: MoffatModelFittingTask.cpp:93
SourceXtractor::VectorImage
Image implementation which keeps the pixel values in memory.
Definition: VectorImage.h:53
ModelFitting::ImageTraits::height
static std::size_t height(ImageType &image)
ModelFitting::ImageTraits< ImageInterfaceTypePtr >::end
static iterator end(const ImageInterfaceTypePtr &image)
Definition: ImageInterfaceTraits.h:84
ModelFitting::ImageInterfaceTypePtr
std::shared_ptr< ImageInterfaceType > ImageInterfaceTypePtr
Definition: ImageInterfaceTraits.h:51
ModelFitting::INTERP_NEARESTNEIGHBOUR
@ INTERP_NEARESTNEIGHBOUR
Definition: ImageInterfaceTraits.h:47
std::size_t
ModelFitting::ImageTraits::width
static std::size_t width(ImageType &image)
y
std::shared_ptr< DependentParameter< std::shared_ptr< EngineParameter > > > y
Definition: MoffatModelFittingTask.cpp:93
ModelFitting::ImageTraits< ImageInterfaceTypePtr >::height
static std::size_t height(const ImageInterfaceTypePtr &image)
Definition: ImageInterfaceTraits.h:68
ModelFitting::INTERP_LANCZOS3
@ INTERP_LANCZOS3
Definition: ImageInterfaceTraits.h:48
ModelFitting
Definition: AsinhChiSquareComparator.h:30
ModelFitting::ImageInterfaceType
SourceXtractor::VectorImage< SourceXtractor::SeFloat > ImageInterfaceType
Definition: ImageInterfaceTraits.h:50
SourceXtractor::interpenum
interpenum
Definition: ImageInterfaceTraits.h:103
SourceXtractor::interpolate_pix
float interpolate_pix(float *pix, float x, float y, int xsize, int ysize, interpenum interptype)
Definition: ImageInterfaceTraits.cpp:124