// SPDX-FileCopyrightText: 2026 Filip Leonarski, Paul Scherrer Institute // SPDX-License-Identifier: GPL-3.0-only #pragma once #include #include #include #include "../../reader/JFJochReaderDataset.h" class QComboBox; class QCheckBox; class QHBoxLayout; class QToolButton; class QScrollArea; class QResizeEvent; // A strip of thumbnails for a handful of representative images (evenly spaced, most spots, or // indexed), optionally overlaid with spots so a real pattern reads like a constellation. Clicking // a thumbnail opens that image. Thumbnails are rendered off-thread by the reading worker. class JFJochViewerImageStrip : public QWidget { Q_OBJECT public: explicit JFJochViewerImageStrip(QWidget *parent = nullptr); public slots: void datasetLoaded(std::shared_ptr dataset); void thumbnailReady(qint64 image_number, QImage thumb); void resetForNewFile(); // a new file/stream opened: rebuild once, then stay put on live updates signals: void requestThumbnails(QVector image_numbers, bool show_spots); void imageSelected(int64_t image_number, int64_t summation); protected: void resizeEvent(QResizeEvent *event) override; private: std::shared_ptr dataset_; QComboBox *mode_ = nullptr; QCheckBox *spots_ = nullptr; QScrollArea *scroll_ = nullptr; QHBoxLayout *strip_ = nullptr; QMap slots_; // image number -> its thumbnail button QVector ComputeRepresentatives() const; void Rebuild(); void UpdateThumbnailSize(); // scale thumbnails to the available dock height };