• 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 comliance with the License.
5  * You may obtian 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 #ifndef DDGR_TEST_DTK_DTK_CONSTANTS_H
17 #define DDGR_TEST_DTK_DTK_CONSTANTS_H
18 
19 #include "dtk_test_ext.h"
20 #include <array>
21 
22 namespace OHOS {
23 namespace Rosen {
24 
25     // 循环坐标计算常量
26     constexpr int LEFT = 200; // 200 is the positions to draw rect
27     constexpr int RIGHT = 350; // 350 is the positions to draw rect
28     constexpr int VARIATION = 5; // 5 is variables at fixed intervals
29 
30     // 数组常量
31     // blendModes array
32     constexpr std::array<Drawing::BlendMode, 29> blendModes = {Drawing::BlendMode::CLEAR,
33         Drawing::BlendMode::SRC, Drawing::BlendMode::DST, Drawing::BlendMode::SRC_OVER,
34         Drawing::BlendMode::DST_OVER, Drawing::BlendMode::SRC_IN, Drawing::BlendMode::DST_IN,
35         Drawing::BlendMode::SRC_OUT, Drawing::BlendMode::DST_OUT, Drawing::BlendMode::SRC_ATOP,
36         Drawing::BlendMode::DST_ATOP, Drawing::BlendMode::XOR, Drawing::BlendMode::PLUS,
37         Drawing::BlendMode::MODULATE, Drawing::BlendMode::SCREEN, Drawing::BlendMode::OVERLAY,
38         Drawing::BlendMode::DARKEN, Drawing::BlendMode::LIGHTEN, Drawing::BlendMode::COLOR_DODGE,
39         Drawing::BlendMode::COLOR_BURN, Drawing::BlendMode::HARD_LIGHT, Drawing::BlendMode::SOFT_LIGHT,
40         Drawing::BlendMode::DIFFERENCE, Drawing::BlendMode::EXCLUSION, Drawing::BlendMode::MULTIPLY,
41         Drawing::BlendMode::HUE, Drawing::BlendMode::STATURATION, Drawing::BlendMode::COLOR_MODE,
42         Drawing::BlendMode::LUMINOSITY
43     };
44 
45     // blurTypes array
46     constexpr std::array<Drawing::BlurType, 4> blurTypes = {
47         Drawing::BlurType::NORMAL,
48         Drawing::BlurType::SOLID,
49         Drawing::BlurType::OUTER,
50         Drawing::BlurType::INNER
51     };
52 
53     constexpr Drawing::CMSMatrix3x3 SRGBMatrix{{
54             {0.436065674f, 0.385147095f, 0.143066406f},
55             {0.222488403f, 0.716873169f, 0.060607910f},
56             {0.013916016f, 0.097076416f, 0.714096069f}
57         }
58     };
59 
60     constexpr Drawing::CMSTransferFunction PQ = {
61         -2.0f, -107 / 128.0f, 32 / 2523.0f, 2413 / 128.0f, -2392 / 128.0f, 8192 / 1305.0f
62     };
63 
64     constexpr float ARR[] = {
65         1.0f, 1.0f, 0.0f, 0.0f, 0.0f,
66         0.0f, 0.0f, 0.0f, 0.0f, 0.0f,
67         0.0f, 0.0f, 0.0f, 0.0f, 0.0f,
68         0.0f, 0.0f, 0.0f, 1.0f, 0.0f,
69     };
70 }
71 }
72 #endif