• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2025 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 /**
17  * @addtogroup InnerApiDemo
18  * @{
19  *
20  * @brief A brief module description.
21  *
22  * The module Detailed description.
23  */
24 
25 /**
26  * @file inner_api_demo.h
27  *
28  * @brief A brief file description.
29  *
30  * The file Detailed description.
31  */
32 #ifndef INNER_API_DEMO_H
33 #define INNER_API_DEMO_H
34 
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38 
39 /**
40  * @brief Defines a colorspace manager.
41  */
42 typedef struct OH_InnerApiDemoMgr OH_InnerApiDemoMgr;
43 
44 /**
45  * @brief Enumerates color space types.
46  */
47 typedef enum {
48     /** Indicates an unknown color space. */
49     NONE = 0,
50     /** Indicates the color space based on Adobe RGB. */
51     ADOBE_RGB = 1,
52     /** Indicates the color space based on SMPTE RP 431-2-2007 and IEC 61966-2.1:1999. */
53     DCI_P3 = 2,
54     /** Indicates the color space based on SMPTE RP 431-2-2007 and IEC 61966-2.1:1999. */
55     DISPLAY_P3 = 3,
56     /** Indicates the standard red green blue (SRGB) color space based on IEC 61966-2.1:1999. */
57     SRGB = 4,
58     /** Indicates a customized color space. */
59     CUSTOM = 5,
60 } Enum1;
61 
62 /**
63  * @brief Describes the primary colors red, green, blue and white point coordinated as (x, y)
64  * in color space, in terms of real world chromaticities.
65  */
66 typedef struct {
67     /** Coordinate value x of red color */
68     float rX;
69     /** Coordinate value y of red color */
70     float rY;
71     /** Coordinate value x of green color */
72     float gX;
73     /** Coordinate value y of green color */
74     float gY;
75     /** Coordinate value x of blue color */
76     float bX;
77     /** Coordinate value y of blue color */
78     float bY;
79     /** Coordinate value x of white point */
80     float wX;
81     /** Coordinate value y of white point */
82     float wY;
83 } SpacePrimaries;
84 
85 /**
86  * @brief Indicates white point coordinated as (x, y) return array.
87  */
88 typedef struct {
89     /** Indicates white point return array */
90     float arr[2];
91 } WhitePointArray;
92 
93 /**
94  * @brief Creates a <b>InnerApiDemoMgr</b> instance by Enum1.
95  * A new <b>InnerApiDemoMgr</b> instance is created each time this function is called.
96  *
97  * @param Enum1 Indicates the NativeColorSpace connection name.
98  * @return Returns the pointer to the <b>InnerApiDemoMgr</b> instance created.
99  * Creation failed, cause memory shortage.
100  */
101 OH_InnerApiDemoMgr* CreateFromName(Enum1 enum);
102 
103 /**
104  * @brief Creates a <b>InnerApiDemoMgr</b> instance by primaries and gamma.
105  * A new <b>InnerApiDemoMgr</b> instance is created each time this function is called.
106  *
107  * @param primaries Indicates the NativeColorSpace connection primaries.
108  * @param gamma Indicates the NativeColorSpace connection gamma.
109  * @return Returns the pointer to the <b>InnerApiDemoMgr</b> instance created.
110  * Creation failed, cause memory shortage.
111  */
112 OH_InnerApiDemoMgr* CreateFromPrimariesAndGamma(SpacePrimaries primaries, float gamma);
113 
114 /**
115  * @brief Delete the InnerApiDemoMgr instance.
116  *
117  * @param mgr Indicates the pointer to a <b>InnerApiDemoMgr</b> instance.
118  */
119 void Destroy(OH_InnerApiDemoMgr* mgr);
120 
121 /**
122  * @brief Get colorSpace name.
123  *
124  * @param mgr Indicates the pointer to a <b>InnerApiDemoMgr</b> instance.
125  * @return Returns value, return value > 0 && value <= 25, success, return value == 0 , failed.
126  */
127 int GetEnum1(OH_InnerApiDemoMgr* mgr);
128 
129 /**
130  * @brief Get white point.
131  *
132  * @param mgr Indicates the pointer to a <b>InnerApiDemoMgr</b> instance.
133  * @return Returns float array, return array = <0.f, 0.f>, failed, otherwise, true.
134  */
135 WhitePointArray GetWhitePoint(OH_InnerApiDemoMgr* mgr);
136 
137 /**
138  * @brief Get gamma.
139  *
140  * @param mgr Indicates the pointer to a <b>InnerApiDemoMgr</b> instance.
141  * @return Returns float, return value == 0.f, failed, otherwise, true.
142  */
143 float GetGamma(OH_InnerApiDemoMgr* mgr);
144 
145 #ifdef __cplusplus
146 }
147 #endif
148 /** @} */
149 #endif