|
|
|
@ -205,6 +205,8 @@ static void update_state(UIState *s) { |
|
|
|
|
auto cam_state = sm["wideRoadCameraState"].getWideRoadCameraState(); |
|
|
|
|
float scale = (cam_state.getSensor() == cereal::FrameData::ImageSensor::AR0231) ? 6.0f : 1.0f; |
|
|
|
|
scene.light_sensor = std::max(100.0f - scale * cam_state.getExposureValPercent(), 0.0f); |
|
|
|
|
} else if (!sm.allAliveAndValid({"wideRoadCameraState"})) { |
|
|
|
|
scene.light_sensor = -1; |
|
|
|
|
} |
|
|
|
|
scene.started = sm["deviceState"].getDeviceState().getStarted() && scene.ignition; |
|
|
|
|
|
|
|
|
@ -320,7 +322,7 @@ void Device::resetInteractiveTimeout(int timeout) { |
|
|
|
|
|
|
|
|
|
void Device::updateBrightness(const UIState &s) { |
|
|
|
|
float clipped_brightness = offroad_brightness; |
|
|
|
|
if (s.scene.started) { |
|
|
|
|
if (s.scene.started && s.scene.light_sensor > 0) { |
|
|
|
|
clipped_brightness = s.scene.light_sensor; |
|
|
|
|
|
|
|
|
|
// CIE 1931 - https://www.photonstophotos.net/GeneralTopics/Exposure/Psychometric_Lightness_and_Gamma.htm
|
|
|
|
|