Wavelength
Privacy-focused, cross-platform, and open-source communication application
Loading...
Searching...
No Matches
retina_scan_layer.h
Go to the documentation of this file.
1#ifndef RETINA_SCAN_LAYER_H
2#define RETINA_SCAN_LAYER_H
3
4#include "../security_layer.h"
5
6class QProgressBar;
7class QLabel;
8
17class RetinaScanLayer final : public SecurityLayer {
18 Q_OBJECT
19
20public:
28 explicit RetinaScanLayer(QWidget *parent = nullptr);
29
34 ~RetinaScanLayer() override;
35
41 void Initialize() override;
42
48 void Reset() override;
49
50private slots:
56 void UpdateScan();
57
63 void FinishScan();
64
65private:
70 void GenerateEyeImage();
71
75 void StartScanAnimation() const;
76
78 QLabel *eye_image_;
80 QProgressBar *scan_progress_;
82 QTimer *scan_timer_;
87
90};
91
92#endif // RETINA_SCAN_LAYER_H
~RetinaScanLayer() override
Destructor. Stops and deletes the timers.
Definition retina_scan_layer.cpp:93
QProgressBar * scan_progress_
Progress bar indicating the scan progress.
Definition retina_scan_layer.h:80
void StartScanAnimation() const
Starts the scan animation timers (scan_timer_ and complete_timer_).
Definition retina_scan_layer.cpp:226
void Reset() override
Resets the layer to its initial state. Stops timers, resets the scanline position and progress bar,...
Definition retina_scan_layer.cpp:118
void UpdateScan()
Slot called periodically by scan_timer_ to update the scan animation. Increments the progress bar,...
Definition retina_scan_layer.cpp:155
int scanline_
Current vertical position of the scanline (0 to 200).
Definition retina_scan_layer.h:86
void GenerateEyeImage()
Generates a random eye image (iris color, patterns, reflections) and draws it onto base_eye_image_....
Definition retina_scan_layer.cpp:231
void FinishScan()
Slot called when the scan completes (either by timer or scanline finishing). Changes the UI element s...
Definition retina_scan_layer.cpp:187
RetinaScanLayer(QWidget *parent=nullptr)
Constructs a RetinaScanLayer. Initializes the UI elements (title, eye image container,...
Definition retina_scan_layer.cpp:13
QLabel * eye_image_
Label displaying the eye image with the animated scanline.
Definition retina_scan_layer.h:78
QTimer * complete_timer_
Timer defining the total duration of the scan process.
Definition retina_scan_layer.h:84
QImage base_eye_image_
Stores the generated eye image without the scanline overlay.
Definition retina_scan_layer.h:89
QTimer * scan_timer_
Timer controlling the scanline movement and progress bar update.
Definition retina_scan_layer.h:82
void Initialize() override
Initializes the layer for display. Resets the layer state, generates a new random eye image,...
Definition retina_scan_layer.cpp:107
SecurityLayer(QWidget *parent=nullptr)
Constructs a SecurityLayer.
Definition security_layer.h:20