This commit is contained in:
Your Name
2024-05-02 01:07:51 -05:00
parent 95a98a8fe8
commit c55a879968
83 changed files with 3570 additions and 69 deletions

View File

@@ -827,25 +827,25 @@ void AnnotatedCameraWidget::drawLaneLines(QPainter &painter, const UIState *s) {
// lanelines
for (int i = 0; i < std::size(scene.lane_line_vertices); ++i) {
if (currentHolidayTheme != 0) {
painter.setBrush(std::get<2>(holidayThemeConfiguration[currentHolidayTheme]).begin()->second);
} else if (customColors != 0) {
painter.setBrush(std::get<2>(themeConfiguration[customColors]).begin()->second);
} else {
// if (currentHolidayTheme != 0) {
// painter.setBrush(std::get<2>(holidayThemeConfiguration[currentHolidayTheme]).begin()->second);
// } else if (customColors != 0) {
// painter.setBrush(std::get<2>(themeConfiguration[customColors]).begin()->second);
// } else {
painter.setBrush(QColor::fromRgbF(1.0, 1.0, 1.0, std::clamp<float>(scene.lane_line_probs[i], 0.0, 0.7)));
}
// }
painter.drawPolygon(scene.lane_line_vertices[i]);
}
// road edges
for (int i = 0; i < std::size(scene.road_edge_vertices); ++i) {
if (currentHolidayTheme != 0) {
painter.setBrush(std::get<2>(holidayThemeConfiguration[currentHolidayTheme]).begin()->second);
} else if (customColors != 0) {
painter.setBrush(std::get<2>(themeConfiguration[customColors]).begin()->second);
} else {
// for (int i = 0; i < std::size(scene.road_edge_vertices); ++i) {
// if (currentHolidayTheme != 0) {
// painter.setBrush(std::get<2>(holidayThemeConfiguration[currentHolidayTheme]).begin()->second);
// } else if (customColors != 0) {
// painter.setBrush(std::get<2>(themeConfiguration[customColors]).begin()->second);
// } else {
painter.setBrush(QColor::fromRgbF(1.0, 0, 0, std::clamp<float>(1.0 - scene.road_edge_stds[i], 0.0, 1.0)));
}
// }
painter.drawPolygon(scene.road_edge_vertices[i]);
}
@@ -870,20 +870,21 @@ void AnnotatedCameraWidget::drawLaneLines(QPainter &painter, const UIState *s) {
// Flip so 0 is bottom of frame
float lin_grad_point = (height() - scene.track_vertices[i].y()) / height();
// If acceleration is between -0.25 and 0.25, resort to the theme color
if (std::abs(acceleration[i]) < 0.25 && (currentHolidayTheme != 0)) {
const auto &colorMap = std::get<2>(holidayThemeConfiguration[currentHolidayTheme]);
for (const auto &[position, brush] : colorMap) {
bg.setColorAt(position, brush.color());
}
// CLEARPILOT disabling custom theme colors
// // If acceleration is between -0.25 and 0.25, resort to the theme color
// if (std::abs(acceleration[i]) < 0.25 && (currentHolidayTheme != 0)) {
// const auto &colorMap = std::get<2>(holidayThemeConfiguration[currentHolidayTheme]);
// for (const auto &[position, brush] : colorMap) {
// bg.setColorAt(position, brush.color());
// }
} else if (std::abs(acceleration[i]) < 0.25 && (customColors != 0)) {
const auto &colorMap = std::get<2>(themeConfiguration[customColors]);
for (const auto &[position, brush] : colorMap) {
bg.setColorAt(position, brush.color());
}
// } else if (std::abs(acceleration[i]) < 0.25 && (customColors != 0)) {
// const auto &colorMap = std::get<2>(themeConfiguration[customColors]);
// for (const auto &[position, brush] : colorMap) {
// bg.setColorAt(position, brush.color());
// }
} else {
// } else {
// speed up: 120, slow down: 0
float path_hue = fmax(fmin(60 + acceleration[i] * 35, 120), 0);
// FIXME: painter.drawPolygon can be slow if hue is not rounded
@@ -896,20 +897,21 @@ void AnnotatedCameraWidget::drawLaneLines(QPainter &painter, const UIState *s) {
// Skip a point, unless next is last
i += (i + 2) < max_len ? 1 : 0;
}
// }
}
} else if (currentHolidayTheme != 0) {
const auto &colorMap = std::get<2>(holidayThemeConfiguration[currentHolidayTheme]);
for (const auto &[position, brush] : colorMap) {
bg.setColorAt(position, brush.color());
}
// CLEARPILOT disabling custom theme colors
// } else if (currentHolidayTheme != 0) {
// const auto &colorMap = std::get<2>(holidayThemeConfiguration[currentHolidayTheme]);
// for (const auto &[position, brush] : colorMap) {
// bg.setColorAt(position, brush.color());
// }
} else if (customColors != 0) {
const auto &colorMap = std::get<2>(themeConfiguration[customColors]);
for (const auto &[position, brush] : colorMap) {
bg.setColorAt(position, brush.color());
}
// } else if (customColors != 0) {
// const auto &colorMap = std::get<2>(themeConfiguration[customColors]);
// for (const auto &[position, brush] : colorMap) {
// bg.setColorAt(position, brush.color());
// }
} else {
bg.setColorAt(0.0, QColor::fromHslF(148 / 360., 0.94, 0.51, 0.4));
@@ -942,18 +944,18 @@ void AnnotatedCameraWidget::drawLaneLines(QPainter &painter, const UIState *s) {
pe.setColorAt(0.0, QColor::fromHslF(205 / 360., 0.85, 0.56, 1.0));
pe.setColorAt(0.5, QColor::fromHslF(205 / 360., 0.85, 0.56, 0.5));
pe.setColorAt(1.0, QColor::fromHslF(205 / 360., 0.85, 0.56, 0.1));
} else if (currentHolidayTheme != 0) {
const auto &colorMap = std::get<2>(holidayThemeConfiguration[currentHolidayTheme]);
for (const auto &[position, brush] : colorMap) {
QColor darkerColor = brush.color().darker(120);
pe.setColorAt(position, darkerColor);
}
} else if (customColors != 0) {
const auto &colorMap = std::get<2>(themeConfiguration[customColors]);
for (const auto &[position, brush] : colorMap) {
QColor darkerColor = brush.color().darker(120);
pe.setColorAt(position, darkerColor);
}
// } else if (currentHolidayTheme != 0) {
// const auto &colorMap = std::get<2>(holidayThemeConfiguration[currentHolidayTheme]);
// for (const auto &[position, brush] : colorMap) {
// QColor darkerColor = brush.color().darker(120);
// pe.setColorAt(position, darkerColor);
// }
// } else if (customColors != 0) {
// const auto &colorMap = std::get<2>(themeConfiguration[customColors]);
// for (const auto &[position, brush] : colorMap) {
// QColor darkerColor = brush.color().darker(120);
// pe.setColorAt(position, darkerColor);
// }
} else {
pe.setColorAt(0.0, QColor::fromHslF(148 / 360., 0.94, 0.51, 1.0));
pe.setColorAt(0.5, QColor::fromHslF(112 / 360., 1.00, 0.68, 0.5));
@@ -1093,13 +1095,14 @@ void AnnotatedCameraWidget::drawLead(QPainter &painter, const cereal::ModelDataV
// chevron
QPointF chevron[] = {{x + (sz * 1.25), y + sz}, {x, y}, {x - (sz * 1.25), y + sz}};
if (currentHolidayTheme != 0) {
painter.setBrush(std::get<2>(holidayThemeConfiguration[currentHolidayTheme]).begin()->second);
} else if (customColors != 0) {
painter.setBrush(std::get<2>(themeConfiguration[customColors]).begin()->second);
} else {
// CLEARPILOT disabling custom theme colors
// if (currentHolidayTheme != 0) {
// painter.setBrush(std::get<2>(holidayThemeConfiguration[currentHolidayTheme]).begin()->second);
// } else if (customColors != 0) {
// painter.setBrush(std::get<2>(themeConfiguration[customColors]).begin()->second);
// } else {
painter.setBrush(redColor(fillAlpha));
}
// }
painter.drawPolygon(chevron, std::size(chevron));
if (leadInfo) {

View File

@@ -131,18 +131,19 @@ enum PrimeType {
const QColor bg_colors [] = {
[STATUS_DISENGAGED] = QColor(0x17, 0x33, 0x49, 0xc8),
[STATUS_OVERRIDE] = QColor(0x91, 0x9b, 0x95, 0xf1),
[STATUS_ENGAGED] = QColor(0x17, 0x86, 0x44, 0xf1),
// [STATUS_ENGAGED] = QColor(0x17, 0x86, 0x44, 0xf1),
[STATUS_ENGAGED] = QColor(47, 158, 238, 0xf1), // CLEARPILOT changed to light blue
// FrogPilot colors
[STATUS_ALWAYS_ON_LATERAL_ACTIVE] = QColor(0x0a, 0xba, 0xb5, 0xf1),
[STATUS_ALWAYS_ON_LATERAL_ACTIVE] = QColor(4, 64, 11, 0xf1), // CLEARPILOT changed to dark blue
[STATUS_TRAFFIC_MODE_ACTIVE] = QColor(0xc9, 0x22, 0x31, 0xf1),
};
static std::map<cereal::ControlsState::AlertStatus, QColor> alert_colors = {
{cereal::ControlsState::AlertStatus::NORMAL, QColor(0x15, 0x15, 0x15, 0xf1)},
{cereal::ControlsState::AlertStatus::USER_PROMPT, QColor(0xDA, 0x6F, 0x25, 0xf1)},
{cereal::ControlsState::AlertStatus::USER_PROMPT, QColor(4, 64, 11, 0xf1)}, // CLEARPILOT changed to a shade of dark blue
{cereal::ControlsState::AlertStatus::CRITICAL, QColor(0xC9, 0x22, 0x31, 0xf1)},
{cereal::ControlsState::AlertStatus::FROGPILOT, QColor(0x17, 0x86, 0x44, 0xf1)},
{cereal::ControlsState::AlertStatus::FROGPILOT, QColor(47, 158, 238, 0xf1)}, // CLEARPILOT changed to light blue
};
typedef struct UIScene {