1 //------------------------------------------------------------------------------
4 // This file was automatically generated by SWIG (http://www.swig.org).
7 // Do not make changes to this file unless you know what you are doing--modify
8 // the SWIG interface file instead.
9 //------------------------------------------------------------------------------
14 using System.Runtime.InteropServices;
17 public class Image : BaseHandle {
18 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
20 internal Image(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Image_SWIGUpcast(cPtr), cMemoryOwn) {
21 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
24 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Image obj) {
25 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
29 DisposeQueue.Instance.Add(this);
32 public override void Dispose() {
33 if (!Window.IsInstalled()) {
34 DisposeQueue.Instance.Add(this);
39 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
42 NDalicPINVOKE.delete_Image(swigCPtr);
44 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
46 global::System.GC.SuppressFinalize(this);
55 * @brief Event arguments that passed via Uploaded signal
58 public class UploadedEventArgs : EventArgs
62 * @brief Image - is the image data that gets uploaded to GL.
78 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
79 private delegate void UploadedEventCallbackDelegate(IntPtr image);
80 private DaliEventHandler<object,UploadedEventArgs> _imageUploadedEventHandler;
81 private UploadedEventCallbackDelegate _imageUploadedEventCallbackDelegate;
84 * @brief Event for Uploaded signal which can be used to subscribe/unsubscribe the event handler
85 * (in the type of UploadedEventHandler-DaliEventHandler<object,UploadedEventArgs>)
86 * provided by the user. Uploaded signal is emitted when the image data gets uploaded to GL.
88 public event DaliEventHandler<object,UploadedEventArgs> Uploaded
94 // Restricted to only one listener
95 if (_imageUploadedEventHandler == null)
97 _imageUploadedEventHandler += value;
99 _imageUploadedEventCallbackDelegate = new UploadedEventCallbackDelegate(OnUploaded);
100 this.UploadedSignal().Connect(_imageUploadedEventCallbackDelegate);
109 if (_imageUploadedEventHandler != null)
111 this.UploadedSignal().Disconnect(_imageUploadedEventCallbackDelegate);
114 _imageUploadedEventHandler -= value;
119 // Callback for Image UploadedSignal
120 private void OnUploaded(IntPtr data)
122 UploadedEventArgs e = new UploadedEventArgs();
124 // Populate all members of "e" (UploadedEventArgs) with real data
125 e.Image = Image.GetImageFromPtr(data);
127 if (_imageUploadedEventHandler != null)
129 //here we send all data to user event handlers
130 _imageUploadedEventHandler(this, e);
135 public static Image GetImageFromPtr(global::System.IntPtr cPtr) {
136 Image ret = new Image(cPtr, false);
137 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
142 public Image() : this(NDalicPINVOKE.new_Image__SWIG_0(), true) {
143 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
146 public Image(Image handle) : this(NDalicPINVOKE.new_Image__SWIG_1(Image.getCPtr(handle)), true) {
147 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
150 public Image Assign(Image rhs) {
151 Image ret = new Image(NDalicPINVOKE.Image_Assign(swigCPtr, Image.getCPtr(rhs)), false);
152 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
156 public static Image DownCast(BaseHandle handle) {
157 Image ret = new Image(NDalicPINVOKE.Image_DownCast(BaseHandle.getCPtr(handle)), true);
158 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
162 public uint GetWidth() {
163 uint ret = NDalicPINVOKE.Image_GetWidth(swigCPtr);
164 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
168 public uint GetHeight() {
169 uint ret = NDalicPINVOKE.Image_GetHeight(swigCPtr);
170 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
174 public ImageSignal UploadedSignal() {
175 ImageSignal ret = new ImageSignal(NDalicPINVOKE.Image_UploadedSignal(swigCPtr), false);
176 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();