// SPDX-FileCopyrightText: 2025 Filip Leonarski, Paul Scherrer Institute // SPDX-License-Identifier: GPL-3.0-only #ifndef JFJOCH_QUICKINTEGRATE_H #define JFJOCH_QUICKINTEGRATE_H #include #include "../common/DiffractionExperiment.h" #include "../common/CrystalLattice.h" #include "../common/Reflection.h" struct QuickIntegrateResult { std::vector reflections; std::optional b_factor; }; class QuickIntegrate { const DiffractionExperiment &experiment; int32_t max_value = 30; const float ewald_sphere_angle_cutoff = 0.2; float r_1 = 4; float r_2 = 5; float r_3 = 8; float r_1_sq = r_1 * r_1; float r_2_sq = r_2 * r_2; float r_3_sq = r_3 * r_3; template QuickIntegrateResult IntegrateInternal(const CompressedImage &image, const CrystalLattice &latt, int64_t special_value, int64_t saturation, float high_res_A); template bool IntegrateInternal(Reflection &r, const T* image, size_t xpixel, size_t ypixel, int64_t special_value, int64_t saturation); public: QuickIntegrate(const DiffractionExperiment &experiment); QuickIntegrateResult Integrate(const CompressedImage &image, const CrystalLattice &latt, float high_res_A); }; #endif //JFJOCH_QUICKINTEGRATE_H