Files
StarPilot/selfdrive/ui/qt/onroad/annotated_camera.h
T
Dean Lee caa33c3193 ui: refactor hud updating and rendering into HudRenderer class (#33458)
refactor hud updating and rendering into DriverMonitorRenderer class
2024-09-23 13:48:24 -07:00

39 lines
1.1 KiB
C++

#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/widgets/cameraview.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;
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;
void drawLaneLines(QPainter &painter, const UIState *s);
void drawLead(QPainter &painter, const cereal::RadarState::LeadData::Reader &lead_data, const QPointF &vd);
inline QColor redColor(int alpha = 255) { return QColor(201, 34, 49, alpha); }
double prev_draw_t = 0;
FirstOrderFilter fps_filter;
};