// SPDX-FileCopyrightText: 2026 Filip Leonarski, Paul Scherrer Institute // SPDX-License-Identifier: GPL-3.0-only #pragma once #include #include #include "JFJochHelperWindow.h" #include class JFJochFollowerImage; class QImage; // ADXV-style magnifier: a small window showing a high-zoom close-up of the main image that // follows the cursor. It displays the frame the main view has already rendered, so it does no // conversion or colouring of its own and always agrees with the main view on colour map, // contrast and HDR mode. class JFJochMagnifierWindow : public JFJochHelperWindow { Q_OBJECT JFJochFollowerImage *m_image; // Where the cursor last was. Hover positions arriving while the window is hidden are remembered // rather than dropped, so re-opening shows the region the cursor is over now and not the one it // was over when the window was closed. std::optional m_last_scene_pos; public: explicit JFJochMagnifierWindow(QWidget *parent = nullptr); // Raw counts for the per-pixel labels. This only stores the pointer - the pixels are // displayed from the frame the main view rendered, nothing is converted here. void imageLoaded(std::shared_ptr image) override; protected: void showEvent(QShowEvent *event) override; public slots: void setFrame(std::shared_ptr frame); void centerAt(QPointF scenePos); };