1 /** Copyright (c) 2017 Samsung Electronics Co., Ltd.
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
7 * http://www.apache.org/licenses/LICENSE-2.0
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.
16 // This File has been auto-generated by SWIG and then modified using DALi Ruby Scripts
17 //------------------------------------------------------------------------------
20 // This file was automatically generated by SWIG (http://www.swig.org).
23 // Do not make changes to this file unless you know what you are doing--modify
24 // the SWIG interface file instead.
25 //------------------------------------------------------------------------------
30 using System.Runtime.InteropServices;
33 internal class GaussianBlurView : View {
34 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
36 internal GaussianBlurView(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.GaussianBlurView_SWIGUpcast(cPtr), cMemoryOwn) {
37 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
40 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(GaussianBlurView obj) {
41 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
45 DisposeQueue.Instance.Add(this);
48 public override void Dispose() {
49 if (!Window.IsInstalled()) {
50 DisposeQueue.Instance.Add(this);
55 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
58 NDalicPINVOKE.delete_GaussianBlurView(swigCPtr);
60 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
62 global::System.GC.SuppressFinalize(this);
70 public class FinishedEventArgs : EventArgs
72 private GaussianBlurView _gaussianBlurView;
74 public GaussianBlurView GaussianBlurView
78 return _gaussianBlurView;
82 _gaussianBlurView = value;
87 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
88 private delegate void FinishedEventCallbackDelegate(IntPtr application);
89 private DaliEventHandler<object,FinishedEventArgs> _gaussianFinishedEventHandler;
90 private FinishedEventCallbackDelegate _gaussianFinishedEventCallbackDelegate;
92 public event DaliEventHandler<object,FinishedEventArgs> Finished
98 // Restricted to only one listener
99 if (_gaussianFinishedEventHandler == null)
101 _gaussianFinishedEventHandler += value;
103 _gaussianFinishedEventCallbackDelegate = new FinishedEventCallbackDelegate(OnFinished);
104 this.FinishedSignal().Connect(_gaussianFinishedEventCallbackDelegate);
113 if (_gaussianFinishedEventHandler != null)
115 this.FinishedSignal().Disconnect(_gaussianFinishedEventCallbackDelegate);
118 _gaussianFinishedEventHandler -= value;
123 // Callback for GaussianBlurView FinishedSignal
124 private void OnFinished(IntPtr data)
126 FinishedEventArgs e = new FinishedEventArgs();
128 // Populate all members of "e" (FinishedEventArgs) with real data
129 e.GaussianBlurView = GaussianBlurView.GetGaussianBlurViewFromPtr(data);
131 if (_gaussianFinishedEventHandler != null)
133 //here we send all data to user event handlers
134 _gaussianFinishedEventHandler(this, e);
138 public static GaussianBlurView GetGaussianBlurViewFromPtr(global::System.IntPtr cPtr) {
139 GaussianBlurView ret = new GaussianBlurView(cPtr, false);
140 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
145 public GaussianBlurView () : this (NDalicPINVOKE.GaussianBlurView_New__SWIG_0(), true) {
146 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
149 public GaussianBlurView (uint numSamples, float blurBellCurveWidth, PixelFormat renderTargetPixelFormat, float downsampleWidthScale, float downsampleHeightScale, bool blurUserImage) : this (NDalicPINVOKE.GaussianBlurView_New__SWIG_1(numSamples, blurBellCurveWidth, (int)renderTargetPixelFormat, downsampleWidthScale, downsampleHeightScale, blurUserImage), true) {
150 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
153 public GaussianBlurView (uint numSamples, float blurBellCurveWidth, PixelFormat renderTargetPixelFormat, float downsampleWidthScale, float downsampleHeightScale) : this (NDalicPINVOKE.GaussianBlurView_New__SWIG_2(numSamples, blurBellCurveWidth, (int)renderTargetPixelFormat, downsampleWidthScale, downsampleHeightScale), true) {
154 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
157 public GaussianBlurView(GaussianBlurView handle) : this(NDalicPINVOKE.new_GaussianBlurView__SWIG_1(GaussianBlurView.getCPtr(handle)), true) {
158 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
161 public GaussianBlurView Assign(GaussianBlurView ZoomView) {
162 GaussianBlurView ret = new GaussianBlurView(NDalicPINVOKE.GaussianBlurView_Assign(swigCPtr, GaussianBlurView.getCPtr(ZoomView)), false);
163 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
167 public new static GaussianBlurView DownCast(BaseHandle handle) {
168 GaussianBlurView ret = new GaussianBlurView(NDalicPINVOKE.GaussianBlurView_DownCast(BaseHandle.getCPtr(handle)), true);
169 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
173 public new void Add(View child) {
174 NDalicPINVOKE.GaussianBlurView_Add(swigCPtr, View.getCPtr(child));
175 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
178 public new void Remove(View child) {
179 NDalicPINVOKE.GaussianBlurView_Remove(swigCPtr, View.getCPtr(child));
180 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
183 public void Activate() {
184 NDalicPINVOKE.GaussianBlurView_Activate(swigCPtr);
185 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
188 public void ActivateOnce() {
189 NDalicPINVOKE.GaussianBlurView_ActivateOnce(swigCPtr);
190 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
193 public void Deactivate() {
194 NDalicPINVOKE.GaussianBlurView_Deactivate(swigCPtr);
195 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
198 public void SetUserImageAndOutputRenderTarget(Image inputImage, FrameBufferImage outputRenderTarget) {
199 NDalicPINVOKE.GaussianBlurView_SetUserImageAndOutputRenderTarget(swigCPtr, Image.getCPtr(inputImage), FrameBufferImage.getCPtr(outputRenderTarget));
200 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
203 public int GetBlurStrengthPropertyIndex() {
204 int ret = NDalicPINVOKE.GaussianBlurView_GetBlurStrengthPropertyIndex(swigCPtr);
205 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
209 public FrameBufferImage GetBlurredRenderTarget() {
210 FrameBufferImage ret = new FrameBufferImage(NDalicPINVOKE.GaussianBlurView_GetBlurredRenderTarget(swigCPtr), true);
211 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
215 public new void SetBackgroundColor(Vector4 color) {
216 NDalicPINVOKE.GaussianBlurView_SetBackgroundColor(swigCPtr, Vector4.getCPtr(color));
217 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
220 public new Vector4 GetBackgroundColor() {
221 Vector4 ret = new Vector4(NDalicPINVOKE.GaussianBlurView_GetBackgroundColor(swigCPtr), true);
222 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
226 public GaussianBlurViewSignal FinishedSignal() {
227 GaussianBlurViewSignal ret = new GaussianBlurViewSignal(NDalicPINVOKE.GaussianBlurView_FinishedSignal(swigCPtr), false);
228 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();