File indexing completed on 2024-03-24 15:16:57

0001 /*
0002     SPDX-FileCopyrightText: 2004 Jasem Mutlaq
0003     SPDX-FileCopyrightText: 2020 Eric Dejouhanet <eric.dejouhanet@gmail.com>
0004 
0005     SPDX-License-Identifier: GPL-2.0-or-later
0006 
0007     Some code fragments were adapted from Peter Kirchgessner's FITS plugin
0008     SPDX-FileCopyrightText: Peter Kirchgessner <http://members.aol.com/pkirchg>
0009 */
0010 
0011 #ifndef FITSTHRESHOLDDETECTOR_H
0012 #define FITSTHRESHOLDDETECTOR_H
0013 
0014 #include "fitsstardetector.h"
0015 
0016 class FITSThresholdDetector: public FITSStarDetector
0017 {
0018         Q_OBJECT
0019 
0020     public:
0021         explicit FITSThresholdDetector(FITSData * data): FITSStarDetector(data) {};
0022 
0023     public:
0024         /** @brief Find sources in the parent FITS data file.
0025          * @see FITSStarDetector::findSources().
0026          */
0027         QFuture<bool> findSources(QRect const &boundary = QRect()) override;
0028 
0029         /** @brief Configure the detection method.
0030          * @see FITSStarDetector::configure().
0031          * @note Parameter "threshold" defaults to THRESHOLD_PERCENTAGE of the mean pixel value of the frame.
0032          * @todo Provide parameters for detection configuration.
0033          */
0034         //void configure(const QString &setting, const QVariant &value) override;
0035 
0036     public:
0037         /** @group Detection parameters.
0038          * @{ */
0039         //int THRESHOLD_PERCENTAGE { 120 };
0040         /** @} */
0041 
0042     protected:
0043         /** @internal Find sources in the parent FITS data file, dependent of the pixel depth.
0044          * @see FITSGradientDetector::findSources.
0045          */
0046         template <typename T>
0047         bool findOneStar(const QRect &boundary) const;
0048 };
0049 
0050 #endif // FITSTHRESHOLDDETECTOR_H