File indexing completed on 2024-05-05 15:55:12

0001 #include "focusfwhm.h"
0002 #include <ekos_focus_debug.h>
0003 
0004 namespace Ekos
0005 {
0006 
0007 FocusFWHM::FocusFWHM(Mathematics::RobustStatistics::ScaleCalculation scaleCalc)
0008 {
0009     m_ScaleCalc = scaleCalc;
0010 }
0011 
0012 FocusFWHM::~FocusFWHM()
0013 {
0014 }
0015 
0016 // Returns true if two rectangular boxes (b1, b2) overlap.
0017 bool FocusFWHM::boxOverlap(const QPair<int, int> b1Start, const QPair<int, int> b1End, const QPair<int, int> b2Start,
0018                            const QPair<int, int> b2End)
0019 {
0020     // Check the "x" coordinate held in the first element of the pair
0021     if (b1Start.first > b2End.first || b2Start.first > b1End.first)
0022         return false;
0023 
0024     // Check the "y" coordinate held in the second element of the pair
0025     if (b1Start.second > b2End.second || b2Start.second > b1End.second)
0026         return false;
0027 
0028     return true;
0029 }
0030 
0031 }  // namespace