[NUI] Integration from dalihub (DALi 1.4.34) (#999)
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / internal / Camera.cs
1 /*
2  * Copyright(c) 2017 Samsung Electronics Co., Ltd.
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  *
16  */
17
18 namespace Tizen.NUI
19 {
20     internal class Camera : Animatable
21     {
22         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
23
24         internal Camera(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.CameraActor.CameraActor_SWIGUpcast(cPtr), cMemoryOwn)
25         {
26             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
27         }
28
29         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Camera obj)
30         {
31             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
32         }
33
34         protected override void Dispose(DisposeTypes type)
35         {
36             if (disposed)
37             {
38                 return;
39             }
40
41             //Release your own unmanaged resources here.
42             //You should not access any managed member here except static instance.
43             //because the execution order of Finalizes is non-deterministic.
44
45             if (swigCPtr.Handle != global::System.IntPtr.Zero)
46             {
47                 if (swigCMemOwn)
48                 {
49                     swigCMemOwn = false;
50                     Interop.CameraActor.delete_CameraActor(swigCPtr);
51                 }
52                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
53             }
54
55             base.Dispose(type);
56         }
57
58         internal class Property
59         {
60             internal static readonly int TYPE = Interop.CameraActor.CameraActor_Property_TYPE_get();
61             internal static readonly int PROJECTION_MODE = Interop.CameraActor.CameraActor_Property_PROJECTION_MODE_get();
62             internal static readonly int FIELD_OF_VIEW = Interop.CameraActor.CameraActor_Property_FIELD_OF_VIEW_get();
63             internal static readonly int ASPECT_RATIO = Interop.CameraActor.CameraActor_Property_ASPECT_RATIO_get();
64             internal static readonly int NEAR_PLANE_DISTANCE = Interop.CameraActor.CameraActor_Property_NEAR_PLANE_DISTANCE_get();
65             internal static readonly int FAR_PLANE_DISTANCE = Interop.CameraActor.CameraActor_Property_FAR_PLANE_DISTANCE_get();
66             internal static readonly int LEFT_PLANE_DISTANCE = Interop.CameraActor.CameraActor_Property_LEFT_PLANE_DISTANCE_get();
67             internal static readonly int RIGHT_PLANE_DISTANCE = Interop.CameraActor.CameraActor_Property_RIGHT_PLANE_DISTANCE_get();
68             internal static readonly int TOP_PLANE_DISTANCE = Interop.CameraActor.CameraActor_Property_TOP_PLANE_DISTANCE_get();
69             internal static readonly int BOTTOM_PLANE_DISTANCE = Interop.CameraActor.CameraActor_Property_BOTTOM_PLANE_DISTANCE_get();
70             internal static readonly int TARGET_POSITION = Interop.CameraActor.CameraActor_Property_TARGET_POSITION_get();
71             internal static readonly int PROJECTION_MATRIX = Interop.CameraActor.CameraActor_Property_PROJECTION_MATRIX_get();
72             internal static readonly int VIEW_MATRIX = Interop.CameraActor.CameraActor_Property_VIEW_MATRIX_get();
73             internal static readonly int INVERT_Y_AXIS = Interop.CameraActor.CameraActor_Property_INVERT_Y_AXIS_get();
74         }
75
76         public Camera() : this(Interop.CameraActor.CameraActor_New__SWIG_0(), true)
77         {
78             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
79         }
80
81         public Camera(Vector2 size) : this(Interop.CameraActor.CameraActor_New__SWIG_1(Vector2.getCPtr(size)), true)
82         {
83             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
84         }
85
86         public static Camera DownCast(BaseHandle handle)
87         {
88             Camera ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as Camera;
89             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
90             return ret;
91         }
92
93         public Camera(Camera copy) : this(Interop.CameraActor.new_CameraActor__SWIG_1(Camera.getCPtr(copy)), true)
94         {
95             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
96         }
97
98         public Camera Assign(Camera rhs)
99         {
100             Camera ret = new Camera(Interop.CameraActor.CameraActor_Assign(swigCPtr, Camera.getCPtr(rhs)), false);
101             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
102             return ret;
103         }
104
105         public void SetType(CameraType type)
106         {
107             Interop.CameraActor.CameraActor_SetType(swigCPtr, (int)type);
108             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
109         }
110
111         public new CameraType GetType()
112         {
113             CameraType ret = (CameraType)Interop.CameraActor.CameraActor_GetType(swigCPtr);
114             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
115             return ret;
116         }
117
118         public void SetProjectionMode(ProjectionMode mode)
119         {
120             Interop.CameraActor.CameraActor_SetProjectionMode(swigCPtr, (int)mode);
121             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
122         }
123
124         public ProjectionMode GetProjectionMode()
125         {
126             ProjectionMode ret = (ProjectionMode)Interop.CameraActor.CameraActor_GetProjectionMode(swigCPtr);
127             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
128             return ret;
129         }
130
131         public void SetFieldOfView(float fieldOfView)
132         {
133             Interop.CameraActor.CameraActor_SetFieldOfView(swigCPtr, fieldOfView);
134             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
135         }
136
137         public float GetFieldOfView()
138         {
139             float ret = Interop.CameraActor.CameraActor_GetFieldOfView(swigCPtr);
140             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
141             return ret;
142         }
143
144         public void SetAspectRatio(float aspectRatio)
145         {
146             Interop.CameraActor.CameraActor_SetAspectRatio(swigCPtr, aspectRatio);
147             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
148         }
149
150         public float GetAspectRatio()
151         {
152             float ret = Interop.CameraActor.CameraActor_GetAspectRatio(swigCPtr);
153             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
154             return ret;
155         }
156
157         public void SetNearClippingPlane(float nearClippingPlane)
158         {
159             Interop.CameraActor.CameraActor_SetNearClippingPlane(swigCPtr, nearClippingPlane);
160             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
161         }
162
163         public float GetNearClippingPlane()
164         {
165             float ret = Interop.CameraActor.CameraActor_GetNearClippingPlane(swigCPtr);
166             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
167             return ret;
168         }
169
170         public void SetFarClippingPlane(float farClippingPlane)
171         {
172             Interop.CameraActor.CameraActor_SetFarClippingPlane(swigCPtr, farClippingPlane);
173             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
174         }
175
176         public float GetFarClippingPlane()
177         {
178             float ret = Interop.CameraActor.CameraActor_GetFarClippingPlane(swigCPtr);
179             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
180             return ret;
181         }
182
183         public void SetTargetPosition(Vector3 targetPosition)
184         {
185             Interop.CameraActor.CameraActor_SetTargetPosition(swigCPtr, Vector3.getCPtr(targetPosition));
186             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
187         }
188
189         public Vector3 GetTargetPosition()
190         {
191             Vector3 ret = new Vector3(Interop.CameraActor.CameraActor_GetTargetPosition(swigCPtr), true);
192             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
193             return ret;
194         }
195
196         public void SetInvertYAxis(bool invertYAxis)
197         {
198             Interop.CameraActor.CameraActor_SetInvertYAxis(swigCPtr, invertYAxis);
199             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
200         }
201
202         public bool GetInvertYAxis()
203         {
204             bool ret = Interop.CameraActor.CameraActor_GetInvertYAxis(swigCPtr);
205             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
206             return ret;
207         }
208
209         public void SetPerspectiveProjection(Vector2 size)
210         {
211             Interop.CameraActor.CameraActor_SetPerspectiveProjection(swigCPtr, Vector2.getCPtr(size));
212             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
213         }
214
215         public void SetOrthographicProjection(Vector2 size)
216         {
217             Interop.CameraActor.CameraActor_SetOrthographicProjection__SWIG_0(swigCPtr, Vector2.getCPtr(size));
218             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
219         }
220
221         public void SetOrthographicProjection(float left, float right, float top, float bottom, float near, float far)
222         {
223             Interop.CameraActor.CameraActor_SetOrthographicProjection__SWIG_1(swigCPtr, left, right, top, bottom, near, far);
224             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
225         }
226
227         public string Type
228         {
229             get
230             {
231                 string temp;
232                 GetProperty(Camera.Property.TYPE).Get(out temp);
233                 return temp;
234             }
235             set
236             {
237                 SetProperty(Camera.Property.TYPE, new Tizen.NUI.PropertyValue(value));
238             }
239         }
240         public string ProjectionMode
241         {
242             get
243             {
244                 string temp;
245                 GetProperty(Camera.Property.PROJECTION_MODE).Get(out temp);
246                 return temp;
247             }
248             set
249             {
250                 SetProperty(Camera.Property.PROJECTION_MODE, new Tizen.NUI.PropertyValue(value));
251             }
252         }
253         public float FieldOfView
254         {
255             get
256             {
257                 float temp = 0.0f;
258                 GetProperty(Camera.Property.FIELD_OF_VIEW).Get(out temp);
259                 return temp;
260             }
261             set
262             {
263                 SetProperty(Camera.Property.FIELD_OF_VIEW, new Tizen.NUI.PropertyValue(value));
264             }
265         }
266         public float AspectRatio
267         {
268             get
269             {
270                 float temp = 0.0f;
271                 GetProperty(Camera.Property.ASPECT_RATIO).Get(out temp);
272                 return temp;
273             }
274             set
275             {
276                 SetProperty(Camera.Property.ASPECT_RATIO, new Tizen.NUI.PropertyValue(value));
277             }
278         }
279         public float NearPlaneDistance
280         {
281             get
282             {
283                 float temp = 0.0f;
284                 GetProperty(Camera.Property.NEAR_PLANE_DISTANCE).Get(out temp);
285                 return temp;
286             }
287             set
288             {
289                 SetProperty(Camera.Property.NEAR_PLANE_DISTANCE, new Tizen.NUI.PropertyValue(value));
290             }
291         }
292         public float FarPlaneDistance
293         {
294             get
295             {
296                 float temp = 0.0f;
297                 GetProperty(Camera.Property.FAR_PLANE_DISTANCE).Get(out temp);
298                 return temp;
299             }
300             set
301             {
302                 SetProperty(Camera.Property.FAR_PLANE_DISTANCE, new Tizen.NUI.PropertyValue(value));
303             }
304         }
305         public float LeftPlaneDistance
306         {
307             get
308             {
309                 float temp = 0.0f;
310                 GetProperty(Camera.Property.LEFT_PLANE_DISTANCE).Get(out temp);
311                 return temp;
312             }
313             set
314             {
315                 SetProperty(Camera.Property.LEFT_PLANE_DISTANCE, new Tizen.NUI.PropertyValue(value));
316             }
317         }
318         public float RightPlaneDistance
319         {
320             get
321             {
322                 float temp = 0.0f;
323                 GetProperty(Camera.Property.RIGHT_PLANE_DISTANCE).Get(out temp);
324                 return temp;
325             }
326             set
327             {
328                 SetProperty(Camera.Property.RIGHT_PLANE_DISTANCE, new Tizen.NUI.PropertyValue(value));
329             }
330         }
331         public float TopPlaneDistance
332         {
333             get
334             {
335                 float temp = 0.0f;
336                 GetProperty(Camera.Property.TOP_PLANE_DISTANCE).Get(out temp);
337                 return temp;
338             }
339             set
340             {
341                 SetProperty(Camera.Property.TOP_PLANE_DISTANCE, new Tizen.NUI.PropertyValue(value));
342             }
343         }
344         public float BottomPlaneDistance
345         {
346             get
347             {
348                 float temp = 0.0f;
349                 GetProperty(Camera.Property.BOTTOM_PLANE_DISTANCE).Get(out temp);
350                 return temp;
351             }
352             set
353             {
354                 SetProperty(Camera.Property.BOTTOM_PLANE_DISTANCE, new Tizen.NUI.PropertyValue(value));
355             }
356         }
357         public Vector3 TargetPosition
358         {
359             get
360             {
361                 Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f);
362                 GetProperty(Camera.Property.TARGET_POSITION).Get(temp);
363                 return temp;
364             }
365             set
366             {
367                 SetProperty(Camera.Property.TARGET_POSITION, new Tizen.NUI.PropertyValue(value));
368             }
369         }
370         internal Matrix ProjectionMatrix
371         {
372             get
373             {
374                 Matrix temp = new Matrix();
375                 GetProperty(Camera.Property.PROJECTION_MATRIX).Get(temp);
376                 return temp;
377             }
378         }
379         internal Matrix ViewMatrix
380         {
381             get
382             {
383                 Matrix temp = new Matrix();
384                 GetProperty(Camera.Property.VIEW_MATRIX).Get(temp);
385                 return temp;
386             }
387         }
388         public bool InvertYAxis
389         {
390             get
391             {
392                 bool temp = false;
393                 GetProperty(Camera.Property.INVERT_Y_AXIS).Get(out temp);
394                 return temp;
395             }
396             set
397             {
398                 SetProperty(Camera.Property.INVERT_Y_AXIS, new Tizen.NUI.PropertyValue(value));
399             }
400         }
401     }
402 }