MT7687 API Reference  LinkIt SDK v4
hal_display_color.h
1 /* Copyright Statement:
2  *
3  * (C) 2005-2016 MediaTek Inc. All rights reserved.
4  *
5  * This software/firmware and related documentation ("MediaTek Software") are
6  * protected under relevant copyright laws. The information contained herein
7  * is confidential and proprietary to MediaTek Inc. ("MediaTek") and/or its licensors.
8  * Without the prior written permission of MediaTek and/or its licensors,
9  * any reproduction, modification, use or disclosure of MediaTek Software,
10  * and information contained herein, in whole or in part, shall be strictly prohibited.
11  * You may only use, reproduce, modify, or distribute (as applicable) MediaTek Software
12  * if you have agreed to and been bound by the applicable license agreement with
13  * MediaTek ("License Agreement") and been granted explicit permission to do so within
14  * the License Agreement ("Permitted User"). If you are not a Permitted User,
15  * please cease any access or use of MediaTek Software immediately.
16  * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
17  * THAT MEDIATEK SOFTWARE RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES
18  * ARE PROVIDED TO RECEIVER ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
19  * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
20  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
21  * NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
22  * SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
23  * SUPPLIED WITH MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH
24  * THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES
25  * THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES
26  * CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK
27  * SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
28  * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND
29  * CUMULATIVE LIABILITY WITH RESPECT TO MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
30  * AT MEDIATEK'S OPTION, TO REVISE OR REPLACE MEDIATEK SOFTWARE AT ISSUE,
31  * OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO
32  * MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
33  */
34 
35 #ifndef __HAL_DISPLAY_COLOR_H__
36 #define __HAL_DISPLAY_COLOR_H__
37 
38 #include "hal_platform.h"
39 
40 #ifdef HAL_DISPLAY_COLOR_MODULE_ENABLED
41 
109 #ifdef __cplusplus
110 extern "C" {
111 #endif
112 
118 typedef enum {
119  HAL_DISPLAY_COLOR_STATUS_INITIALIZATION_FAILED = -3,
120  HAL_DISPLAY_COLOR_STATUS_INVALID_PARAMETER = -2,
121  HAL_DISPLAY_COLOR_STATUS_POWER_FAILED = -1,
122  HAL_DISPLAY_COLOR_STATUS_OK = 0,
123 } hal_display_color_status_t;
124 
126 typedef enum {
127  HAL_DISPLAY_COLOR_MODE_DEFAULT = 0,
128  HAL_DISPLAY_COLOR_MODE_CAMERA,
129  HAL_DISPLAY_COLOR_MODE_NUM
130 } hal_display_color_mode_t;
131 
141 typedef struct {
142  uint8_t sharpness;
143  uint8_t contrast;
144  uint8_t saturation;
145 } hal_display_color_custom_table_t;
146 
148 typedef struct {
149  uint8_t gain;
150  uint8_t soft_ratio;
151  uint8_t limit;
152  uint8_t bound;
153 } hal_display_color_sharpness_t;
154 
156 typedef struct {
157  uint8_t point0;
158  uint8_t point1;
159  uint8_t gain0;
160  uint8_t gain1;
161  uint8_t gain2;
162 } hal_display_color_contrast_t;
163 
165 typedef struct {
166  uint16_t ctrl_point;
167  uint8_t coef_a;
168  uint8_t gain;
169 } hal_display_color_saturation_t;
170 
172 typedef struct {
173  hal_display_color_mode_t mode;
174  hal_display_color_sharpness_t sharpness;
175  hal_display_color_contrast_t contrast;
176  hal_display_color_saturation_t saturation;
177  bool bypass_config;
178 } hal_display_color_parameter_t;
179 
191 hal_display_color_status_t hal_display_color_init(void);
192 
202 hal_display_color_status_t hal_display_color_set_color_engine(bool enable);
203 
213 hal_display_color_status_t hal_display_color_get_color_engine(bool *enable);
214 
224 hal_display_color_status_t hal_display_color_set_sharpness(hal_display_color_sharpness_t *sharpness);
225 
235 hal_display_color_status_t hal_display_color_set_contrast(hal_display_color_contrast_t *contrast);
236 
246 hal_display_color_status_t hal_display_color_set_saturation(hal_display_color_saturation_t *saturation);
247 
257 hal_display_color_status_t hal_display_color_set_bypass(bool bypass);
258 
268 hal_display_color_status_t hal_display_color_set_mode(hal_display_color_mode_t mode);
269 
279 hal_display_color_status_t hal_display_color_apply_color(uint32_t src_width);
280 
281 #ifdef __cplusplus
282 }
283 #endif
284 
290 #endif /* HAL_DISPLAY_COLOR_MODULE_ENABLED */
291 #endif /* __HAL_DISPLAY_COLOR_H__ */