wip
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user