SourceXtractorPlusPlus 0.21
SourceXtractor++, the next generation SExtractor
Loading...
Searching...
No Matches
TransformedAperture.cpp
Go to the documentation of this file.
1
17/*
18 * TransformedAperture.cpp
19 *
20 * Created on: Oct 08, 2018
21 * Author: Alejandro Alvarez
22 */
23
25#include <algorithm>
26
27namespace SourceXtractor {
28
45
47 return {
48 x * t[0] + y * t[2],
49 x * t[1] + y * t[3]
50 };
51}
52
54 auto min = m_decorated->getMinPixel(0, 0);
55 auto max = m_decorated->getMaxPixel(0, 0);
56
57 auto a = transform(min.m_x, min.m_y, m_transform);
58 auto b = transform(max.m_x, min.m_y, m_transform);
59 auto c = transform(min.m_x, max.m_y, m_transform);
60 auto d = transform(max.m_x, max.m_y, m_transform);
61
62 auto min_x = std::min({a.first, b.first, c.first, d.first});
63 auto min_y = std::min({a.second, b.second, c.second, d.second});
64
65 return PixelCoordinate(x + min_x, y + min_y);
66}
67
69 auto min = m_decorated->getMinPixel(0, 0);
70 auto max = m_decorated->getMaxPixel(0, 0);
71
72 auto a = transform(min.m_x, min.m_y, m_transform);
73 auto b = transform(max.m_x, min.m_y, m_transform);
74 auto c = transform(min.m_x, max.m_y, m_transform);
75 auto d = transform(max.m_x, max.m_y, m_transform);
76
77 auto min_x = std::max({a.first, b.first, c.first, d.first});
78 auto min_y = std::max({a.second, b.second, c.second, d.second});
79
80 return PixelCoordinate(x + min_x, y + min_y);
81}
82
92
102
112
113} // end SourceXtractor
std::shared_ptr< DependentParameter< std::shared_ptr< EngineParameter > > > x
std::shared_ptr< DependentParameter< std::shared_ptr< EngineParameter > > > y
PixelCoordinate getMinPixel(SeFloat centroid_x, SeFloat centroid_y) const override
std::shared_ptr< Aperture > m_decorated
SeFloat drawArea(SeFloat center_x, SeFloat center_y, SeFloat pixel_x, SeFloat pixel_y) const override
SeFloat getRadiusSquared(SeFloat center_x, SeFloat center_y, SeFloat pixel_x, SeFloat pixel_y) const override
TransformedAperture(std::shared_ptr< Aperture > decorated, const std::tuple< double, double, double, double > &jacobian)
PixelCoordinate getMaxPixel(SeFloat centroid_x, SeFloat centroid_y) const override
SeFloat getArea(SeFloat center_x, SeFloat center_y, SeFloat pixel_x, SeFloat pixel_y) const override
T max(T... args)
T min(T... args)
SeFloat32 SeFloat
Definition Types.h:32
A pixel coordinate made of two integers m_x and m_y.
T transform(T... args)