Rajesh Yadav | 6e8521b | 2017-10-31 18:13:26 +0530 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2015-2018, The Linux Foundation. All rights reserved. |
| 3 | * |
| 4 | * Redistribution and use in source and binary forms, with or without |
| 5 | * modification, are permitted provided that the following conditions are |
| 6 | * met: |
| 7 | * * Redistributions of source code must retain the above copyright |
| 8 | * notice, this list of conditions and the following disclaimer. |
| 9 | * * Redistributions in binary form must reproduce the above |
| 10 | * copyright notice, this list of conditions and the following |
| 11 | * disclaimer in the documentation and/or other materials provided |
| 12 | * with the distribution. |
| 13 | * * Neither the name of The Linux Foundation nor the names of its |
| 14 | * contributors may be used to endorse or promote products derived |
| 15 | * from this software without specific prior written permission. |
| 16 | |
| 17 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED |
| 18 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
| 19 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT |
| 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS |
| 21 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
| 22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
| 23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR |
| 24 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
| 25 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE |
| 26 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN |
| 27 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 28 | */ |
| 29 | |
| 30 | #ifndef __DISP_COLOR_PROCESSING_H__ |
| 31 | #define __DISP_COLOR_PROCESSING_H__ |
| 32 | |
| 33 | #ifdef __cplusplus |
| 34 | extern "C" { |
| 35 | #endif |
| 36 | |
| 37 | #define LUT3D_ENTRIES_SIZE (17 * 17 * 17) |
| 38 | |
| 39 | struct rgb { |
| 40 | uint32_t r; |
| 41 | uint32_t g; |
| 42 | uint32_t b; |
| 43 | }; |
| 44 | |
| 45 | struct rgb_entry { |
| 46 | struct rgb in; |
| 47 | struct rgb out; |
| 48 | }; |
| 49 | |
| 50 | /* |
| 51 | struct lut3d_info |
| 52 | flags -- Reserved |
| 53 | lut3d_id -- Unique ID used to distinguish individual 3D Lut tables |
| 54 | uniform -- Identifies if coefficients are uniform (1) or non-uniform (0) |
| 55 | num_entries-- Identifies the number of lut values in the table |
| 56 | entries -- Table buffer holding the lut values. |
| 57 | |
| 58 | All coefficients are expected to be tightly packed in the |
| 59 | structure, any unused buffer space shall exist at the end |
| 60 | of the buffer. |
| 61 | */ |
| 62 | struct lut3d_info { |
| 63 | uint32_t flags; |
| 64 | uint32_t lut3d_id; |
| 65 | uint32_t uniform; |
| 66 | uint32_t num_entries; |
| 67 | struct rgb_entry entries[LUT3D_ENTRIES_SIZE]; |
| 68 | }; |
| 69 | |
| 70 | /* |
| 71 | struct lut1d_info |
| 72 | flags -- Reserved |
| 73 | bit_width -- Bit width of each entry |
| 74 | num_entries -- Identifies the number of lut values in the table |
| 75 | entries -- Table buffer holding the lut values |
| 76 | */ |
| 77 | #define LUT1D_ENTRIES_SIZE (256) |
| 78 | struct lut1d_info { |
| 79 | uint32_t flags; |
| 80 | uint32_t bit_width; |
| 81 | uint32_t strength; |
| 82 | uint32_t num_entries; |
| 83 | struct rgb entries[LUT1D_ENTRIES_SIZE]; |
| 84 | }; |
| 85 | |
| 86 | #ifdef __cplusplus |
| 87 | } |
| 88 | #endif |
| 89 | #endif // __DISP_COLOR_PROCESSING_H__ |