2 * Copyright (c) 2023 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::New3DCamera()
42 Internal::CameraActorPtr internal = Internal::CameraActor::New(Size::ZERO, true);
44 return CameraActor(internal.Get());
47 CameraActor::CameraActor(Internal::CameraActor* internal)
52 CameraActor CameraActor::DownCast(BaseHandle handle)
54 return CameraActor(dynamic_cast<Dali::Internal::CameraActor*>(handle.GetObjectPtr()));
57 CameraActor::CameraActor() = default;
59 CameraActor::~CameraActor() = default;
61 CameraActor::CameraActor(const CameraActor& copy) = default;
63 CameraActor& CameraActor::operator=(const CameraActor& rhs) = default;
65 CameraActor::CameraActor(CameraActor&& rhs) noexcept = default;
67 CameraActor& CameraActor::operator=(CameraActor&& rhs) noexcept = default;
69 void CameraActor::SetType(Dali::Camera::Type type)
71 GetImplementation(*this).SetType(type);
74 Dali::Camera::Type CameraActor::GetType() const
76 return GetImplementation(*this).GetType();
79 void CameraActor::SetProjectionMode(Dali::Camera::ProjectionMode mode)
81 GetImplementation(*this).SetProjectionMode(mode);
84 Dali::Camera::ProjectionMode CameraActor::GetProjectionMode() const
86 return GetImplementation(*this).GetProjectionMode();
89 void CameraActor::SetFieldOfView(float fieldOfView)
91 GetImplementation(*this).SetFieldOfView(fieldOfView);
94 float CameraActor::GetFieldOfView()
96 return GetImplementation(*this).GetFieldOfView();
99 void CameraActor::SetAspectRatio(float aspectRatio)
101 GetImplementation(*this).SetAspectRatio(aspectRatio);
104 float CameraActor::GetAspectRatio()
106 return GetImplementation(*this).GetAspectRatio();
109 void CameraActor::SetNearClippingPlane(float nearClippingPlane)
111 GetImplementation(*this).SetNearClippingPlane(nearClippingPlane);
114 float CameraActor::GetNearClippingPlane()
116 return GetImplementation(*this).GetNearClippingPlane();
119 void CameraActor::SetFarClippingPlane(float farClippingPlane)
121 GetImplementation(*this).SetFarClippingPlane(farClippingPlane);
124 float CameraActor::GetFarClippingPlane()
126 return GetImplementation(*this).GetFarClippingPlane();
129 void CameraActor::SetTargetPosition(const Vector3& targetPosition)
131 GetImplementation(*this).SetTarget(targetPosition);
134 Vector3 CameraActor::GetTargetPosition() const
136 return GetImplementation(*this).GetTarget();
139 void CameraActor::SetInvertYAxis(bool invertYAxis)
141 GetImplementation(*this).SetInvertYAxis(invertYAxis);
144 bool CameraActor::GetInvertYAxis()
146 return GetImplementation(*this).GetInvertYAxis();
149 void CameraActor::SetPerspectiveProjection(const Size& size)
151 GetImplementation(*this).SetPerspectiveProjection(size);
154 void CameraActor::SetOrthographicProjection(const Size& size)
156 GetImplementation(*this).SetOrthographicProjection(size);