Deprecate Plane Distance setter + Implement OrthographicSize + Animatable AspectRatio
[platform/core/uifw/dali-core.git] / dali / devel-api / actors / camera-actor-devel.h
1 #ifndef DALI_CAMERA_ACTOR_DEVEL_H
2 #define DALI_CAMERA_ACTOR_DEVEL_H
3
4 /*
5  * Copyright (c) 2022 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 #include <dali/public-api/actors/camera-actor.h>
22
23 namespace Dali
24 {
25 namespace DevelCameraActor
26 {
27 /**
28  * @brief Enumeration for projection direction.
29  */
30 enum ProjectionDirection
31 {
32   VERTICAL,   ///< Field of view direction based on vertial.
33   HORIZONTAL, ///< Field of view direction based on horizontal.
34 };
35
36 namespace Property
37 {
38 enum
39 {
40   /**
41    * @brief Orthographic Size of this camera.
42    * If ProjectionDirection is Vertical, OrthographicSize is height/2 of viewing cube of Orthographic projection.
43    * If ProjectionDirection is Horizontal, OrthographicSize is width/2 of viewing cube of Orthographic projection.
44    * Remained Width or Height of viewing cube is internally computed by using aspect ratio.
45    *
46    * @details Name "orthographicSize", type Property::FLOAT, animatable, constraint-input
47    * @note Default is 400.0f
48    */
49   ORTHOGRAPHIC_SIZE = CameraActor::Property::INVERT_Y_AXIS + 1,
50
51   /**
52    * @brief Determine basic direction of projection relative properties.
53    * It will be used when we need to calculate some values relative with aspect ratio automatically.
54    *
55    * For example, if aspect ratio is 4:3 and set fieldOfView as 60 degree.
56    *  - ProjectionDirection::VERTICAL : basic direction is vertical. so, FoV of horizontal direction become ~75.2 degree
57    *  - ProjectionDirection::HORIZONTAL : basic direction is horizontal. so, FoV of vertical direction become ~46.8 degree
58    *
59    * Another example, if aspect ratio is 4:3 and set orthographicSize as 400.0f.
60    *  - ProjectionDirection::VERTICAL : basic direction is vertical. so, topPlaneDistance become 400.0f, rightPlaneDistance value become 533.3f.
61    *  - ProjectionDirection::HORIZONTAL : basic direction is horizontal. so, topPlaneDistance become 300.0f, rightPlaneDistance value become 400.0f.
62    *
63    * @details Type Property::INT
64    * @note This property doesn't change FieldOfView and OrthographicSize value automatically. So result scene might be changed.
65    * @note Default is ProjectionDirection::VERTICAL.
66    */
67   PROJECTION_DIRECTION,
68
69   /**
70    * @brief Defines reflection plane for the camera
71    * @details Type Property::VECTOR4
72    * @note Optional
73    */
74   REFLECTION_PLANE,
75 };
76
77 } // Namespace Property
78
79 /**
80  * @brief Request to rotate window after MVP matrix is multiplied.
81  * It is used in case that the target buffer orientation is different from the window orientation.
82  * @param [in] camera Dali::CameraActor that will be rotated.
83  * @param [in] rotationAngle The rotation angle (0, 90, 180, and 270. See Dali::WindowOrientation.)
84  */
85 DALI_CORE_API void RotateProjection(Dali::CameraActor camera, int32_t rotationAngle);
86
87 } // namespace DevelCameraActor
88 } // Namespace Dali
89
90 #endif // DALI_CAMERA_ACTOR_DEVEL_H