1595d5899Sopenharmony_ci/* 2595d5899Sopenharmony_ci * Copyright (c) 2023-2023 Huawei Device Co., Ltd. 3595d5899Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 4595d5899Sopenharmony_ci * you may not use this file except in compliance with the License. 5595d5899Sopenharmony_ci * You may obtain a copy of the License at 6595d5899Sopenharmony_ci * 7595d5899Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 8595d5899Sopenharmony_ci * 9595d5899Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software 10595d5899Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 11595d5899Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12595d5899Sopenharmony_ci * See the License for the specific language governing permissions and 13595d5899Sopenharmony_ci * limitations under the License. 14595d5899Sopenharmony_ci */ 15595d5899Sopenharmony_ci 16595d5899Sopenharmony_ci#ifndef CALCULATION_CONFIG_PARSER_H 17595d5899Sopenharmony_ci#define CALCULATION_CONFIG_PARSER_H 18595d5899Sopenharmony_ci 19595d5899Sopenharmony_ci#include <vector> 20595d5899Sopenharmony_ci 21595d5899Sopenharmony_cinamespace OHOS { 22595d5899Sopenharmony_cinamespace DisplayPowerMgr { 23595d5899Sopenharmony_cistruct PointXy { 24595d5899Sopenharmony_ci float x{-1.0f}; 25595d5899Sopenharmony_ci float y{-1.0f}; 26595d5899Sopenharmony_ci}; 27595d5899Sopenharmony_cistruct PointXyz { 28595d5899Sopenharmony_ci float x{-1.0f}; 29595d5899Sopenharmony_ci float y{-1.0f}; 30595d5899Sopenharmony_ci float z{-1.0f}; 31595d5899Sopenharmony_ci}; 32595d5899Sopenharmony_cinamespace CalculationConfig { 33595d5899Sopenharmony_cistruct Data { 34595d5899Sopenharmony_ci // default value 35595d5899Sopenharmony_ci float defaultBrightness{35.0f}; 36595d5899Sopenharmony_ci std::vector<PointXy> defaultPoints{ 37595d5899Sopenharmony_ci { 0.0f, 5.0f }, { 5.0f, 17.0f }, { 20.0f, 30.0f }, 38595d5899Sopenharmony_ci { 50.0f, 36.0f }, { 200.0f, 45.0f }, { 400.0f, 54.0f }, 39595d5899Sopenharmony_ci { 1000.0f, 81.0f }, { 2000.0f, 123.0f }, { 7000.0f, 255.0f } 40595d5899Sopenharmony_ci }; 41595d5899Sopenharmony_ci}; 42595d5899Sopenharmony_ci} 43595d5899Sopenharmony_ciclass CalculationConfigParser { 44595d5899Sopenharmony_cipublic: 45595d5899Sopenharmony_ci CalculationConfigParser() = default; 46595d5899Sopenharmony_ci virtual ~CalculationConfigParser() = default; 47595d5899Sopenharmony_ci CalculationConfigParser(const CalculationConfigParser&) = delete; 48595d5899Sopenharmony_ci CalculationConfigParser& operator=(const CalculationConfigParser&) = delete; 49595d5899Sopenharmony_ci CalculationConfigParser(CalculationConfigParser&&) = delete; 50595d5899Sopenharmony_ci CalculationConfigParser& operator=(CalculationConfigParser&&) = delete; 51595d5899Sopenharmony_ci 52595d5899Sopenharmony_ci static bool ParseConfig(int displayId, CalculationConfig::Data& data); 53595d5899Sopenharmony_ci static void PrintConfig(int displayId, const CalculationConfig::Data& data); 54595d5899Sopenharmony_ci}; 55595d5899Sopenharmony_ci} // namespace DisplayPowerMgr 56595d5899Sopenharmony_ci} // namespace OHOS 57595d5899Sopenharmony_ci#endif // CALCULATION_CONFIG_PARSER_H 58