Files
Jungfraujoch/viewer/image_viewer/JFJochDiffractionImage.h
Filip Leonarski 224cc8b89c
All checks were successful
Build Packages / build:rpm (rocky8_nocuda) (push) Successful in 7m46s
Build Packages / build:rpm (rocky9_nocuda) (push) Successful in 8m45s
Build Packages / build:rpm (ubuntu2204_nocuda) (push) Successful in 6m56s
Build Packages / build:rpm (ubuntu2404_nocuda) (push) Successful in 5m58s
Build Packages / build:rpm (rocky8_sls9) (push) Successful in 6m59s
Build Packages / build:rpm (rocky8) (push) Successful in 7m33s
Build Packages / Generate python client (push) Successful in 19s
Build Packages / Build documentation (push) Successful in 41s
Build Packages / Create release (push) Has been skipped
Build Packages / build:rpm (rocky9) (push) Successful in 8m45s
Build Packages / build:rpm (ubuntu2204) (push) Successful in 7m51s
Build Packages / build:rpm (ubuntu2404) (push) Successful in 7m12s
Build Packages / Unit tests (push) Successful in 1h8m51s
v1.0.0-rc.110 (#16)
This is an UNSTABLE release.

* jfjoch_broker: Add auto-contrast option for preview images
* Frontend: Add logo image
* jfjoch_viewer: Add logo image
* jfjoch_viewer: For image chart allow to set min value to zero
* jfjoch_viewer: For resolution estimation plots, visualization uses 1/d^2 as measure
* jfjoch_viewer: Add 3D unit cell visualization (experimental/WIP/not really there)
* Documentation: Add logo image

Reviewed-on: #16
Co-authored-by: Filip Leonarski <filip.leonarski@psi.ch>
Co-committed-by: Filip Leonarski <filip.leonarski@psi.ch>
2025-11-28 12:47:35 +01:00

72 lines
1.8 KiB
C++

// SPDX-FileCopyrightText: 2025 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
// SPDX-License-Identifier: GPL-3.0-only
#pragma once
#include "JFJochImage.h"
#include "../../reader/JFJochReaderImage.h"
class JFJochDiffractionImage : public JFJochImage {
Q_OBJECT
QColor spot_color = Qt::green;
QColor prediction_color = Qt::darkRed;
QColor ice_ring_color = Qt::cyan;
public:
enum class RingMode {Auto, Estimation, Manual, None, IceRings};
Q_ENUM(RingMode)
JFJochDiffractionImage(QWidget *parent = nullptr);
private:
void addCustomOverlay() override;
void LoadImageInternal();
void DrawResolutionRings();
void DrawSpots();
void DrawPredictions();
void DrawBeamCenter();
void DrawTopPixels();
void DrawSaturation();
void DrawCross(float x, float y, float size, float width, float z = 1);
std::shared_ptr<const JFJochReaderImage> image;
int32_t show_highest_pixels = 0;
QVector<float> res_ring = {};
RingMode ring_mode = RingMode::Estimation;
bool show_spots = false;
bool show_predictions = false;
bool highlight_ice_rings = true;
float ice_ring_width_Q_recipA = 0.01;
void mouseHover(QMouseEvent* event) override;
signals:
void autoForegroundChanged(bool input);
public slots:
void loadImage(std::shared_ptr<const JFJochReaderImage> image);
void setAutoForeground(bool input);
void setResolutionRing(QVector<float> v);
void setResolutionRingMode(RingMode mode);
void showSpots(bool input);
void showPredictions(bool input);
void setSpotColor(QColor input);
void setPredictionColor(QColor input);
void showHighestPixels(int32_t v);
void showSaturation(bool input);
void highlightIceRings(bool input);
void changeForeground(float val) override;
};