1 // Copyright 2020 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef CHROMECAST_UI_DISPLAY_SETTINGS_GAMMA_CONFIGURATOR_H_ 6 #define CHROMECAST_UI_DISPLAY_SETTINGS_GAMMA_CONFIGURATOR_H_ 7 8 #include <vector> 9 10 #include "ui/display/types/gamma_ramp_rgb_entry.h" 11 12 namespace chromecast { 13 14 class CastWindowManager; 15 16 namespace shell { 17 class CastDisplayConfigurator; 18 } // namespace shell 19 20 class GammaConfigurator { 21 public: 22 GammaConfigurator(CastWindowManager* window_manager, 23 shell::CastDisplayConfigurator* display_configurator); 24 GammaConfigurator(const GammaConfigurator&) = delete; 25 GammaConfigurator& operator=(const GammaConfigurator&) = delete; 26 ~GammaConfigurator(); 27 28 void OnCalibratedGammaLoaded( 29 const std::vector<display::GammaRampRGBEntry>& gamma); 30 31 void SetColorInversion(bool enable); 32 33 private: 34 void ApplyGammaLut(); 35 36 CastWindowManager* const window_manager_; 37 shell::CastDisplayConfigurator* display_configurator_; 38 39 bool is_initialized_ = false; 40 bool is_inverted_ = false; 41 std::vector<display::GammaRampRGBEntry> gamma_lut_; 42 }; 43 44 } // namespace chromecast 45 46 #endif // CHROMECAST_UI_DISPLAY_SETTINGS_GAMMA_CONFIGURATOR_H_ 47