2 * Copyright (c) 2020 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 #include <dali/public-api/actors/camera-actor.h>
22 #include <dali/internal/event/actors/camera-actor-impl.h>
26 CameraActor CameraActor::New()
28 Internal::CameraActorPtr internal = Internal::CameraActor::New(Size::ZERO);
30 return CameraActor(internal.Get());
33 CameraActor CameraActor::New(const Size& size)
35 Internal::CameraActorPtr internal = Internal::CameraActor::New(size);
37 return CameraActor(internal.Get());
40 CameraActor::CameraActor(Internal::CameraActor* internal)
45 CameraActor CameraActor::DownCast(BaseHandle handle)
47 return CameraActor(dynamic_cast<Dali::Internal::CameraActor*>(handle.GetObjectPtr()));
50 CameraActor::CameraActor() = default;
52 CameraActor::~CameraActor() = default;
54 CameraActor::CameraActor(const CameraActor& copy) = default;
56 CameraActor& CameraActor::operator=(const CameraActor& rhs)
58 BaseHandle::operator=(rhs);
62 void CameraActor::SetType(Dali::Camera::Type type)
64 GetImplementation(*this).SetType(type);
67 Dali::Camera::Type CameraActor::GetType() const
69 return GetImplementation(*this).GetType();
72 void CameraActor::SetProjectionMode(Dali::Camera::ProjectionMode mode)
74 GetImplementation(*this).SetProjectionMode(mode);
77 Dali::Camera::ProjectionMode CameraActor::GetProjectionMode() const
79 return GetImplementation(*this).GetProjectionMode();
82 void CameraActor::SetFieldOfView(float fieldOfView)
84 GetImplementation(*this).SetFieldOfView(fieldOfView);
87 float CameraActor::GetFieldOfView()
89 return GetImplementation(*this).GetFieldOfView();
92 void CameraActor::SetAspectRatio(float aspectRatio)
94 GetImplementation(*this).SetAspectRatio(aspectRatio);
97 float CameraActor::GetAspectRatio()
99 return GetImplementation(*this).GetAspectRatio();
102 void CameraActor::SetNearClippingPlane(float nearClippingPlane)
104 GetImplementation(*this).SetNearClippingPlane(nearClippingPlane);
107 float CameraActor::GetNearClippingPlane()
109 return GetImplementation(*this).GetNearClippingPlane();
112 void CameraActor::SetFarClippingPlane(float farClippingPlane)
114 GetImplementation(*this).SetFarClippingPlane(farClippingPlane);
117 float CameraActor::GetFarClippingPlane()
119 return GetImplementation(*this).GetFarClippingPlane();
122 void CameraActor::SetTargetPosition(const Vector3& targetPosition)
124 GetImplementation(*this).SetTarget(targetPosition);
127 Vector3 CameraActor::GetTargetPosition() const
129 return GetImplementation(*this).GetTarget();
132 void CameraActor::SetInvertYAxis(bool invertYAxis)
134 GetImplementation(*this).SetInvertYAxis(invertYAxis);
137 bool CameraActor::GetInvertYAxis()
139 return GetImplementation(*this).GetInvertYAxis();
142 void CameraActor::SetPerspectiveProjection(const Size& size)
144 GetImplementation(*this).SetPerspectiveProjection(size);
147 void CameraActor::SetOrthographicProjection(const Vector2& size)
149 GetImplementation(*this).SetOrthographicProjection(size);
152 void CameraActor::SetOrthographicProjection(float left, float right, float top, float bottom, float near, float far)
154 GetImplementation(*this).SetOrthographicProjection(left, right, top, bottom, near, far);