Merge "Add tag and document to Tizen.NUI."
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / Sampler.cs
1 /** Copyright (c) 2017 Samsung Electronics Co., Ltd.
2 *
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 *
15 */
16
17 namespace Tizen.NUI
18 {
19     /// <summary>
20     /// Sampler is a handle to an object that can be used to provide the sampling parameters to sample textures.
21     /// </summary>
22     public class Sampler : BaseHandle
23     {
24         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
25
26         internal Sampler(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Sampler_SWIGUpcast(cPtr), cMemoryOwn)
27         {
28             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
29         }
30
31         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Sampler obj)
32         {
33             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
34         }
35
36         protected override void Dispose(DisposeTypes type)
37         {
38             if (disposed)
39             {
40                 return;
41             }
42
43             if (type == DisposeTypes.Explicit)
44             {
45                 //Called by User
46                 //Release your own managed resources here.
47                 //You should release all of your own disposable objects here.
48
49             }
50
51             //Release your own unmanaged resources here.
52             //You should not access any managed member here except static instance.
53             //because the execution order of Finalizes is non-deterministic.
54
55
56             if (swigCPtr.Handle != global::System.IntPtr.Zero)
57             {
58                 if (swigCMemOwn)
59                 {
60                     swigCMemOwn = false;
61                     NDalicPINVOKE.delete_Sampler(swigCPtr);
62                 }
63                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
64             }
65
66             base.Dispose(type);
67         }
68
69         /// <summary>
70         /// Create an instance of Sampler.
71         /// </summary>
72         /// <since_tizen> 3 </since_tizen>
73         public Sampler() : this(NDalicPINVOKE.Sampler_New(), true)
74         {
75             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
76
77         }
78
79         /// <summary>
80         /// Sets the filter modes for this sampler.
81         /// </summary>
82         /// <param name="minFilter">The minification filter that will be used.</param>
83         /// <param name="magFilter">The magnification filter that will be used.</param>
84         /// <since_tizen> 3 </since_tizen>
85         public void SetFilterMode(FilterModeType minFilter, FilterModeType magFilter)
86         {
87             NDalicPINVOKE.Sampler_SetFilterMode(swigCPtr, (int)minFilter, (int)magFilter);
88             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
89         }
90
91         /// <summary>
92         /// Sets the wrap modes for this sampler.
93         /// </summary>
94         /// <param name="uWrap">Wrap mode for u coordinates.</param>
95         /// <param name="vWrap">Wrap mode for v coordinates.</param>
96         /// <since_tizen> 3 </since_tizen>
97         public void SetWrapMode(WrapModeType uWrap, WrapModeType vWrap)
98         {
99             NDalicPINVOKE.Sampler_SetWrapMode__SWIG_0(swigCPtr, (int)uWrap, (int)vWrap);
100             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
101         }
102
103         /// <summary>
104         /// Sets the wrap modes for this sampler.
105         /// </summary>
106         /// <param name="rWrap">Wrap mode for the x direction.</param>
107         /// <param name="sWrap">Wrap mode for the y direction.</param>
108         /// <param name="tWrap">Wrap mode for the z direction.</param>
109         /// <since_tizen> 3 </since_tizen>
110         public void SetWrapMode(WrapModeType rWrap, WrapModeType sWrap, WrapModeType tWrap)
111         {
112             NDalicPINVOKE.Sampler_SetWrapMode__SWIG_1(swigCPtr, (int)rWrap, (int)sWrap, (int)tWrap);
113             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
114         }
115
116     }
117
118 }