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;
32 public override void Dispose() {
34 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
37 NDalicPINVOKE.delete_Image(swigCPtr);
39 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
41 global::System.GC.SuppressFinalize(this);
49 * @brief Event arguments that passed via Uploaded signal
52 public class UploadedEventArgs : EventArgs
56 * @brief Image - is the image data that gets uploaded to GL.
72 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
73 private delegate void UploadedEventCallbackDelegate(IntPtr image);
74 private DaliEventHandler<object,UploadedEventArgs> _imageUploadedEventHandler;
75 private UploadedEventCallbackDelegate _imageUploadedEventCallbackDelegate;
78 * @brief Event for Uploaded signal which can be used to subscribe/unsubscribe the event handler
79 * (in the type of UploadedEventHandler-DaliEventHandler<object,UploadedEventArgs>)
80 * provided by the user. Uploaded signal is emitted when the image data gets uploaded to GL.
82 public event DaliEventHandler<object,UploadedEventArgs> Uploaded
88 // Restricted to only one listener
89 if (_imageUploadedEventHandler == null)
91 _imageUploadedEventHandler += value;
93 _imageUploadedEventCallbackDelegate = new UploadedEventCallbackDelegate(OnUploaded);
94 this.UploadedSignal().Connect(_imageUploadedEventCallbackDelegate);
103 if (_imageUploadedEventHandler != null)
105 this.UploadedSignal().Disconnect(_imageUploadedEventCallbackDelegate);
108 _imageUploadedEventHandler -= value;
113 // Callback for Image UploadedSignal
114 private void OnUploaded(IntPtr data)
116 UploadedEventArgs e = new UploadedEventArgs();
118 // Populate all members of "e" (UploadedEventArgs) with real data
119 e.Image = Image.GetImageFromPtr(data);
121 if (_imageUploadedEventHandler != null)
123 //here we send all data to user event handlers
124 _imageUploadedEventHandler(this, e);
129 public static Image GetImageFromPtr(global::System.IntPtr cPtr) {
130 Image ret = new Image(cPtr, false);
131 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
136 public Image() : this(NDalicPINVOKE.new_Image__SWIG_0(), true) {
137 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
140 public Image(Image handle) : this(NDalicPINVOKE.new_Image__SWIG_1(Image.getCPtr(handle)), true) {
141 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
144 public Image Assign(Image rhs) {
145 Image ret = new Image(NDalicPINVOKE.Image_Assign(swigCPtr, Image.getCPtr(rhs)), false);
146 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
150 public static Image DownCast(BaseHandle handle) {
151 Image ret = new Image(NDalicPINVOKE.Image_DownCast(BaseHandle.getCPtr(handle)), true);
152 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
156 public uint GetWidth() {
157 uint ret = NDalicPINVOKE.Image_GetWidth(swigCPtr);
158 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
162 public uint GetHeight() {
163 uint ret = NDalicPINVOKE.Image_GetHeight(swigCPtr);
164 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
168 public ImageSignal UploadedSignal() {
169 ImageSignal ret = new ImageSignal(NDalicPINVOKE.Image_UploadedSignal(swigCPtr), false);
170 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();