2 * Copyright(c) 2019 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.
18 using System.Runtime.InteropServices;
19 using Tizen.NUI.BaseComponents;
23 internal class GaussianBlurView : View
25 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
27 internal GaussianBlurView(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.GaussianBlurView.GaussianBlurView_SWIGUpcast(cPtr), cMemoryOwn)
29 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
32 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(GaussianBlurView obj)
34 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
37 protected override void Dispose(DisposeTypes type)
44 //Release your own unmanaged resources here.
45 //You should not access any managed member here except static instance.
46 //because the execution order of Finalizes is non-deterministic.
48 if (swigCPtr.Handle != global::System.IntPtr.Zero)
53 Interop.GaussianBlurView.delete_GaussianBlurView(swigCPtr);
55 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
61 /// <since_tizen> 3 </since_tizen>
62 public class FinishedEventArgs : EventArgs
64 private GaussianBlurView _gaussianBlurView;
66 /// <since_tizen> 3 </since_tizen>
67 public GaussianBlurView GaussianBlurView
71 return _gaussianBlurView;
75 _gaussianBlurView = value;
80 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
81 private delegate void FinishedEventCallbackDelegate(IntPtr application);
82 private DaliEventHandler<object, FinishedEventArgs> _gaussianFinishedEventHandler;
83 private FinishedEventCallbackDelegate _gaussianFinishedEventCallbackDelegate;
85 public event DaliEventHandler<object, FinishedEventArgs> Finished
91 // Restricted to only one listener
92 if (_gaussianFinishedEventHandler == null)
94 _gaussianFinishedEventHandler += value;
96 _gaussianFinishedEventCallbackDelegate = new FinishedEventCallbackDelegate(OnFinished);
97 this.FinishedSignal().Connect(_gaussianFinishedEventCallbackDelegate);
106 if (_gaussianFinishedEventHandler != null)
108 this.FinishedSignal().Disconnect(_gaussianFinishedEventCallbackDelegate);
111 _gaussianFinishedEventHandler -= value;
116 // Callback for GaussianBlurView FinishedSignal
117 private void OnFinished(IntPtr data)
119 FinishedEventArgs e = new FinishedEventArgs();
121 // Populate all members of "e" (FinishedEventArgs) with real data
122 e.GaussianBlurView = Registry.GetManagedBaseHandleFromNativePtr(data) as GaussianBlurView;
124 if (_gaussianFinishedEventHandler != null)
126 //here we send all data to user event handlers
127 _gaussianFinishedEventHandler(this, e);
131 public GaussianBlurView() : this(Interop.GaussianBlurView.GaussianBlurView_New__SWIG_0(), true)
133 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
136 public GaussianBlurView(uint numSamples, float blurBellCurveWidth, PixelFormat renderTargetPixelFormat, float downsampleWidthScale, float downsampleHeightScale, bool blurUserImage) : this(Interop.GaussianBlurView.GaussianBlurView_New__SWIG_1(numSamples, blurBellCurveWidth, (int)renderTargetPixelFormat, downsampleWidthScale, downsampleHeightScale, blurUserImage), true)
138 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
141 public GaussianBlurView(uint numSamples, float blurBellCurveWidth, PixelFormat renderTargetPixelFormat, float downsampleWidthScale, float downsampleHeightScale) : this(Interop.GaussianBlurView.GaussianBlurView_New__SWIG_2(numSamples, blurBellCurveWidth, (int)renderTargetPixelFormat, downsampleWidthScale, downsampleHeightScale), true)
143 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
146 public GaussianBlurView(GaussianBlurView handle) : this(Interop.GaussianBlurView.new_GaussianBlurView__SWIG_1(GaussianBlurView.getCPtr(handle)), true)
148 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
151 public GaussianBlurView Assign(GaussianBlurView ZoomView)
153 GaussianBlurView ret = new GaussianBlurView(Interop.GaussianBlurView.GaussianBlurView_Assign(swigCPtr, GaussianBlurView.getCPtr(ZoomView)), false);
154 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
158 public static GaussianBlurView DownCast(BaseHandle handle)
160 GaussianBlurView ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as GaussianBlurView;
161 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
165 public new void Add(View child)
167 Interop.GaussianBlurView.GaussianBlurView_Add(swigCPtr, View.getCPtr(child));
168 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
171 public new void Remove(View child)
173 Interop.GaussianBlurView.GaussianBlurView_Remove(swigCPtr, View.getCPtr(child));
174 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
177 public void Activate()
179 Interop.GaussianBlurView.GaussianBlurView_Activate(swigCPtr);
180 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
183 public void ActivateOnce()
185 Interop.GaussianBlurView.GaussianBlurView_ActivateOnce(swigCPtr);
186 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
189 public void Deactivate()
191 Interop.GaussianBlurView.GaussianBlurView_Deactivate(swigCPtr);
192 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
195 public void SetUserImageAndOutputRenderTarget(Texture inputTexture, FrameBuffer outputRenderTarget)
197 Interop.GaussianBlurView.GaussianBlurView_SetUserImageAndOutputRenderTarget(swigCPtr, Texture.getCPtr(inputTexture), FrameBuffer.getCPtr(outputRenderTarget));
198 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
201 public int GetBlurStrengthPropertyIndex()
203 int ret = Interop.GaussianBlurView.GaussianBlurView_GetBlurStrengthPropertyIndex(swigCPtr);
204 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
208 public FrameBufferImage GetBlurredRenderTarget()
210 FrameBufferImage ret = new FrameBufferImage(Interop.GaussianBlurView.GaussianBlurView_GetBlurredRenderTarget(swigCPtr), true);
211 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
215 public void SetBackgroundColor(Vector4 color)
217 Interop.GaussianBlurView.GaussianBlurView_SetBackgroundColor(swigCPtr, Vector4.getCPtr(color));
218 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
221 public Vector4 GetBackgroundColor()
223 Vector4 ret = new Vector4(Interop.GaussianBlurView.GaussianBlurView_GetBackgroundColor(swigCPtr), true);
224 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
228 public GaussianBlurViewSignal FinishedSignal()
230 GaussianBlurViewSignal ret = new GaussianBlurViewSignal(Interop.GaussianBlurView.GaussianBlurView_FinishedSignal(swigCPtr), false);
231 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();