SourceXtractorPlusPlus 0.21
SourceXtractor++, the next generation SExtractor
Loading...
Searching...
No Matches
VignetArray.h
Go to the documentation of this file.
1
18#ifndef _SEIMPLEMENTATION_PLUGIN_VIGNETARRAY_H_
19#define _SEIMPLEMENTATION_PLUGIN_VIGNETARRAY_H_
20
21#include <NdArray/NdArray.h>
22#include <AlexandriaKernel/memory_tools.h>
26
27namespace SourceXtractor {
28
29class VignetArray: public Property {
30public:
32 const auto& representative = vignets.front().get().getVignet();
33
34 if (vignets.size() > 1) {
36 }
37 else {
39 }
40 }
41
45
46private:
49 static_cast<size_t>(representative.getWidth()), static_cast<size_t>(representative.getHeight())
50 };
51 m_vignets = Euclid::make_unique<Euclid::NdArray::NdArray<DetectionImage::PixelType>>(shape);
52
53 for (int x = 0; x < representative.getWidth(); ++x) {
54 for (int y = 0; y < representative.getHeight(); ++y) {
55 m_vignets->at(x, y) = representative.getValue(x, y);
56 }
57 }
58 }
59
63 vignets.size(), static_cast<size_t>(representative.getWidth()), static_cast<size_t>(representative.getHeight())
64 };
65 m_vignets = Euclid::make_unique<Euclid::NdArray::NdArray<DetectionImage::PixelType>>(shape);
66
67 for (size_t v = 0; v < vignets.size(); ++v) {
68 const auto& img = vignets[v].get().getVignet();
69 assert (img.getWidth() == representative.getWidth());
70 assert (img.getHeight() == representative.getHeight());
71 for (int x = 0; x < img.getWidth(); ++x) {
72 for (int y = 0; y < img.getHeight(); ++y) {
73 m_vignets->at(v, x, y) = img.getValue(x, y);
74 }
75 }
76 }
77 }
78
80};
81
82} // end of namespace SourceXtractor
83
84#endif /* _SEIMPLEMENTATION_PLUGIN_VIGNETARRAY_H_ */
std::shared_ptr< DependentParameter< std::shared_ptr< EngineParameter > > > x
std::shared_ptr< DependentParameter< std::shared_ptr< EngineParameter > > > y
Base class for all Properties. (has no actual content)
Definition Property.h:33
void initMultiple(const std::vector< std::reference_wrapper< const Vignet > > &vignets, const VectorImage< DetectionImage::PixelType > &representative)
Definition VignetArray.h:60
std::unique_ptr< Euclid::NdArray::NdArray< DetectionImage::PixelType > > m_vignets
Definition VignetArray.h:79
void initSingle(const VectorImage< DetectionImage::PixelType > &representative)
Definition VignetArray.h:47
VignetArray(const std::vector< std::reference_wrapper< const Vignet > > &vignets)
Definition VignetArray.h:31
const Euclid::NdArray::NdArray< DetectionImage::PixelType > & getVignets() const
Definition VignetArray.h:42