[3.0] Update doxygen comments
[platform/core/uifw/dali-core.git] / dali / public-api / common / constants.h
1 #ifndef __DALI_CONSTANTS_H__
2 #define __DALI_CONSTANTS_H__
3
4 /*
5  * Copyright (c) 2015 Samsung Electronics Co., Ltd.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  */
20
21 // EXTERNAL INCLUDES
22 #include <math.h> // M_PI
23
24 // INTERNAL INCLUDES
25 #include <dali/public-api/math/vector3.h>
26 #include <dali/public-api/math/vector4.h>
27
28 namespace Dali
29 {
30 /**
31  * @addtogroup dali_core_common
32  * @{
33  */
34
35 /**
36  * @brief ParentOrigin constants.
37  *
38  * Note that for 2D layouting, the typical Z position is 0.5f (not 0.0f).
39  * @SINCE_1_0.0
40  */
41 namespace ParentOrigin
42 {
43 extern const Vector3 DEFAULT; ///< TOP_LEFT
44 static const float TOP = 0.0f;
45 static const float BOTTOM = 1.0f;
46 static const float LEFT = 0.0f;
47 static const float RIGHT = 1.0f;
48 static const float MIDDLE = 0.5f;
49
50 DALI_IMPORT_API extern const Vector3 TOP_LEFT;           ///< 0.0f, 0.0f, 0.5f
51 DALI_IMPORT_API extern const Vector3 TOP_CENTER;         ///< 0.5f, 0.0f, 0.5f
52 DALI_IMPORT_API extern const Vector3 TOP_RIGHT;          ///< 1.0f, 0.0f, 0.5f
53 DALI_IMPORT_API extern const Vector3 CENTER_LEFT;        ///< 0.0f, 0.5f, 0.5f
54 DALI_IMPORT_API extern const Vector3 CENTER;             ///< 0.5f, 0.5f, 0.5f
55 DALI_IMPORT_API extern const Vector3 CENTER_RIGHT;       ///< 1.0f, 0.5f, 0.5f
56 DALI_IMPORT_API extern const Vector3 BOTTOM_LEFT;        ///< 0.0f, 1.0f, 0.5f
57 DALI_IMPORT_API extern const Vector3 BOTTOM_CENTER;      ///< 0.5f, 1.0f, 0.5f
58 DALI_IMPORT_API extern const Vector3 BOTTOM_RIGHT;       ///< 1.0f, 1.0f, 0.5f
59
60 }
61
62 /**
63  * @brief AnchorPoint constants.
64  *
65  * Note that for 2D layouting, the typical Z position is 0.5f (not 0.0f).
66  * @SINCE_1_0.0
67  */
68 namespace AnchorPoint
69 {
70 static const float TOP = 0.0f;
71 static const float BOTTOM = 1.0f;
72 static const float LEFT = 0.0f;
73 static const float RIGHT = 1.0f;
74 static const float MIDDLE = 0.5f;
75
76 extern const Vector3 DEFAULT; ///< CENTER
77 DALI_IMPORT_API extern const Vector3 TOP_LEFT;           ///< 0.0f, 0.0f, 0.5f
78 DALI_IMPORT_API extern const Vector3 TOP_CENTER;         ///< 0.5f, 0.0f, 0.5f
79 DALI_IMPORT_API extern const Vector3 TOP_RIGHT;          ///< 1.0f, 0.0f, 0.5f
80 DALI_IMPORT_API extern const Vector3 CENTER_LEFT;        ///< 0.0f, 0.5f, 0.5f
81 DALI_IMPORT_API extern const Vector3 CENTER;             ///< 0.5f, 0.5f, 0.5f
82 DALI_IMPORT_API extern const Vector3 CENTER_RIGHT;       ///< 1.0f, 0.5f, 0.5f
83 DALI_IMPORT_API extern const Vector3 BOTTOM_LEFT;        ///< 0.0f, 1.0f, 0.5f
84 DALI_IMPORT_API extern const Vector3 BOTTOM_CENTER;      ///< 0.5f, 1.0f, 0.5f
85 DALI_IMPORT_API extern const Vector3 BOTTOM_RIGHT;       ///< 1.0f, 1.0f, 0.5f
86
87 }
88
89
90 /**
91  * @brief Color Constants.
92  *
93  * Color is represented by the Vector4 class (see vector4.h).
94  * @SINCE_1_0.0
95  */
96 namespace Color
97 {
98 DALI_IMPORT_API extern const Vector4 BLACK;       ///< Pure black (0.0f, 0.0f, 0.0f, 1.0f);
99 DALI_IMPORT_API extern const Vector4 WHITE;       ///< Pure white (1.0f, 1.0f, 1.0f, 1.0f);
100
101 DALI_IMPORT_API extern const Vector4 RED;         ///< Pure red   (1.0f, 0.0f, 0.0f, 1.0f);
102 DALI_IMPORT_API extern const Vector4 GREEN;       ///< Pure green (0.0f, 1.0f, 0.0f, 1.0f);
103 DALI_IMPORT_API extern const Vector4 BLUE;        ///< Pure blue  (0.0f, 0.0f, 1.0f, 1.0f);
104
105 DALI_IMPORT_API extern const Vector4 YELLOW;      ///< Pure yellow  (1.0f, 1.0f, 0.0f, 1.0f);
106 DALI_IMPORT_API extern const Vector4 MAGENTA;     ///< Pure magenta (1.0f, 0.0f, 1.0f, 1.0f);
107 DALI_IMPORT_API extern const Vector4 CYAN;        ///< Pure cyan    (0.0f, 1.0f, 1.0f, 1.0f);
108
109 DALI_IMPORT_API extern const Vector4 TRANSPARENT; ///< Black transparent (0.0f, 0.0f, 0.0f, 0.0f);
110
111 } // namespace Color
112
113 /**
114  * @brief Math constants.
115  * @SINCE_1_0.0
116  */
117 namespace Math
118 {
119 DALI_IMPORT_API extern const float MACHINE_EPSILON_0;      ///< Epsilon for values near zero
120 DALI_IMPORT_API extern const float MACHINE_EPSILON_1;      ///< Epsilon for values near 1
121 DALI_IMPORT_API extern const float MACHINE_EPSILON_10;     ///< Epsilon for values near 10
122 DALI_IMPORT_API extern const float MACHINE_EPSILON_100;    ///< Epsilon for values near 100
123 DALI_IMPORT_API extern const float MACHINE_EPSILON_1000;   ///< Epsilon for values near 1000
124 DALI_IMPORT_API extern const float MACHINE_EPSILON_10000;  ///< Epsilon for values near 10000
125
126 // float is preferred to double for performance on ARM targets
127 static const float PI   = static_cast<float>(M_PI);       ///< Constant representing PI
128 static const float PI_2 = static_cast<float>(M_PI_2);     ///< Constant representing PI/2
129 static const float PI_4 = static_cast<float>(M_PI_4);     ///< Constant representing PI/4
130 static const float PI_OVER_180 = Dali::Math::PI/180.0f;   ///< Constant used to convert degree to radian
131 static const float ONE80_OVER_PI = 180.0f/Dali::Math::PI; ///< Constant used to convert radian to degree
132
133 } // namespace Math
134
135 /**
136  * @}
137  */
138 } // namespace Dali
139
140 #endif // __DALI_CONSTANTS_H__