carrot/selfdrive/ui/qt/onroad/annotated_camera.h

43 lines
1.1 KiB
C
Raw Normal View History

#pragma once
#include <QVBoxLayout>
#include <memory>
#include "selfdrive/ui/qt/onroad/hud.h"
#include "selfdrive/ui/qt/onroad/buttons.h"
#include "selfdrive/ui/qt/onroad/driver_monitoring.h"
#include "selfdrive/ui/qt/onroad/model.h"
#include "selfdrive/ui/qt/widgets/cameraview.h"
2024-09-03 16:09:00 +09:00
#include "selfdrive/ui/qt/screenrecorder/screenrecorder.h"
class AnnotatedCameraWidget : public CameraWidget {
Q_OBJECT
public:
explicit AnnotatedCameraWidget(VisionStreamType type, QWidget* parent = 0);
void updateState(const UIState &s);
private:
QVBoxLayout *main_layout;
ExperimentalButton *experimental_btn;
DriverMonitorRenderer dmon;
HudRenderer hud;
ModelRenderer model;
std::unique_ptr<PubMaster> pm;
int skip_frame_count = 0;
bool wide_cam_requested = false;
protected:
void paintGL() override;
void initializeGL() override;
void showEvent(QShowEvent *event) override;
mat4 calcFrameMatrix() override;
double prev_draw_t = 0;
FirstOrderFilter fps_filter;
2024-09-03 16:09:00 +09:00
void paintEvent(QPaintEvent *event) override;
private:
ScreenRecoder* recorder;
std::shared_ptr<QTimer> record_timer;
};