File indexing completed on 2024-03-24 15:17:04
0001 /* 0002 SPDX-FileCopyrightText: 2021 Jasem Mutlaq 0003 0004 Static version of the HIPS Renderer for a single point in the sky. 0005 0006 SPDX-License-Identifier: GPL-2.0-or-later 0007 */ 0008 0009 #pragma once 0010 0011 #include "healpix.h" 0012 #include "hipsmanager.h" 0013 #include "scanrender.h" 0014 0015 #include <memory> 0016 0017 class Projector; 0018 0019 class HIPSFinder 0020 { 0021 public: 0022 static HIPSFinder *Instance(); 0023 0024 /** 0025 * @brief render Renders an image at the specified center with the specific level and zoom. 0026 * @param center Sky point of image center. 0027 * @param level HiPS level. Minimum 2 and Maximum 20 0028 * @param zoom Projector zoom factor 0029 * @param destinationImage Pointer to an already initialized QImage 0030 * @param fov_w output image horizontal field of view in arcminutes. 0031 * @param fov_h output image vertical field of view in arcminutes. 0032 * @param projector projection system to be used to map image --> screen projection transformation. 0033 * @return True if successful, false otherwise. 0034 */ 0035 bool render(SkyPoint *center, uint8_t level, double zoom, QImage *destinationImage, double &fov_w, double &fov_h); 0036 0037 /** 0038 * @brief render Renders an image at the specified center with the specific FOV and rotation. It is an improved version of render() above. 0039 * @param center Sky point of image center. 0040 * @param fov_radius Field of View radius in degrees. 0041 * @param rotation orientation in the sky map 0042 * @param destinationImage Pointer to an already initialized QImage 0043 * @return True if successful, false otherwise. 0044 */ 0045 bool renderFOV(SkyPoint *center, double fov_radius, double rotation, QImage *destinationImage); 0046 void renderRec(uint8_t level, int pix, QImage *destinationImage); 0047 bool renderPix(int level, int pix, QImage *destinationImage); 0048 0049 private: 0050 explicit HIPSFinder(); 0051 static HIPSFinder *m_Instance; 0052 0053 QSet<int> m_RenderedMap; 0054 QScopedPointer<HEALPix> m_HEALpix; 0055 QScopedPointer<ScanRender> m_ScanRender; 0056 QScopedPointer<Projector> m_Projector; 0057 };