[NUI] Revert "Sync with dalihub & API5 branch (#631)" (#635)
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / Sampler.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     /// <summary>
21     /// Sampler is a handle to an object that can be used to provide the sampling parameters to sample textures.
22     /// </summary>
23     /// <since_tizen> 3 </since_tizen>
24     public class Sampler : BaseHandle
25     {
26         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
27
28         internal Sampler(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Sampler_SWIGUpcast(cPtr), cMemoryOwn)
29         {
30             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
31         }
32
33         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Sampler obj)
34         {
35             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
36         }
37
38         /// <summary>
39         /// Dispose.
40         /// </summary>
41         /// <since_tizen> 3 </since_tizen>
42         protected override void Dispose(DisposeTypes type)
43         {
44             if (disposed)
45             {
46                 return;
47             }
48
49             if (type == DisposeTypes.Explicit)
50             {
51                 //Called by User
52                 //Release your own managed resources here.
53                 //You should release all of your own disposable objects here.
54
55             }
56
57             //Release your own unmanaged resources here.
58             //You should not access any managed member here except static instance.
59             //because the execution order of Finalizes is non-deterministic.
60
61
62             if (swigCPtr.Handle != global::System.IntPtr.Zero)
63             {
64                 if (swigCMemOwn)
65                 {
66                     swigCMemOwn = false;
67                     NDalicPINVOKE.delete_Sampler(swigCPtr);
68                 }
69                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
70             }
71
72             base.Dispose(type);
73         }
74
75         /// <summary>
76         /// Create an instance of Sampler.
77         /// </summary>
78         /// <since_tizen> 3 </since_tizen>
79         public Sampler() : this(NDalicPINVOKE.Sampler_New(), true)
80         {
81             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
82
83         }
84
85         /// <summary>
86         /// Sets the filter modes for this sampler.
87         /// </summary>
88         /// <param name="minFilter">The minification filter that will be used.</param>
89         /// <param name="magFilter">The magnification filter that will be used.</param>
90         /// <since_tizen> 3 </since_tizen>
91         public void SetFilterMode(FilterModeType minFilter, FilterModeType magFilter)
92         {
93             NDalicPINVOKE.Sampler_SetFilterMode(swigCPtr, (int)minFilter, (int)magFilter);
94             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
95         }
96
97         /// <summary>
98         /// Sets the wrap modes for this sampler.
99         /// </summary>
100         /// <param name="uWrap">Wrap mode for u coordinates.</param>
101         /// <param name="vWrap">Wrap mode for v coordinates.</param>
102         /// <since_tizen> 3 </since_tizen>
103         public void SetWrapMode(WrapModeType uWrap, WrapModeType vWrap)
104         {
105             NDalicPINVOKE.Sampler_SetWrapMode__SWIG_0(swigCPtr, (int)uWrap, (int)vWrap);
106             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
107         }
108
109         /// <summary>
110         /// Sets the wrap modes for this sampler.
111         /// </summary>
112         /// <param name="rWrap">Wrap mode for the x direction.</param>
113         /// <param name="sWrap">Wrap mode for the y direction.</param>
114         /// <param name="tWrap">Wrap mode for the z direction.</param>
115         /// <since_tizen> 3 </since_tizen>
116         public void SetWrapMode(WrapModeType rWrap, WrapModeType sWrap, WrapModeType tWrap)
117         {
118             NDalicPINVOKE.Sampler_SetWrapMode__SWIG_1(swigCPtr, (int)rWrap, (int)sWrap, (int)tWrap);
119             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
120         }
121
122     }
123
124 }