1 /*
2  * Copyright (c) 2024 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 #ifndef SCENEPLUGIN_COMPATIBILITY_H
17 #define SCENEPLUGIN_COMPATIBILITY_H
18 
19 #include <base/math/mathf.h>
20 #include <base/math/matrix_util.h>
21 #include <base/math/quaternion_util.h>
22 #include <base/math/vector.h>
23 #include <base/util/color.h>
24 
25 #include <meta/base/meta_types.h>
26 
27 #include "scene_plugin/namespace.h"
28 
29 SCENE_BEGIN_NAMESPACE()
30 
31 using Color = Base::Color;
32 
33 static const Color BLACK_COLOR = BASE_NS::MakeColorFromLinear(0xFF000000);
34 static const Color WHITE_COLOR = BASE_NS::MakeColorFromLinear(0xFFFFFFFF);
35 static const Color BLUE_COLOR = BASE_NS::MakeColorFromLinear(0xFF0000FF);
36 static const Color GREEN_COLOR = BASE_NS::MakeColorFromLinear(0xFF00FF00);
37 static const Color RED_COLOR = BASE_NS::MakeColorFromLinear(0xFFFF0000);
38 static const Color TRANSPARENT_COLOR = BASE_NS::MakeColorFromLinear(0x00000000);
39 
40 namespace Colors {
41 #undef TRANSPARENT
42 static constexpr Color TRANSPARENT { 0.f, 0.f, 0.f, 0.f };
43 static constexpr Color BLACK { 0.f, 0.f, 0.f, 1.f };
44 static constexpr Color GRAY { .5f, .5f, .5f, 1.f };
45 static constexpr Color WHITE { 1.f, 1.f, 1.f, 1.f };
46 static constexpr Color RED { 1.f, 0.f, 0.f, 1.f };
47 static constexpr Color GREEN { 0.f, 1.f, 0.f, 1.f };
48 static constexpr Color BLUE { 0.f, 0.f, 1.f, 1.f };
49 static constexpr Color YELLOW { 1.f, 1.f, 0.f, 1.f };
50 } // namespace Colors
51 
52 SCENE_END_NAMESPACE()
53 
54 
55 #endif // SCENEPLUGIN_COMPATIBILITY_H
56