[global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint = "CSharp_Dali_delete_Extents")]
public static extern void delete_Extents(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+
+ //for PixelBuffer and ImageLoading
+ [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint = "CSharp_Dali_PixelBuffer_SWIGUpcast")]
+ public static extern global::System.IntPtr PixelBuffer_SWIGUpcast(global::System.IntPtr jarg1);
+
+ [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_PixelBuffer_New")]
+ public static extern global::System.IntPtr PixelBuffer_New(uint jarg1, uint jarg2, int jarg3);
+
+ [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_new_PixelBuffer__SWIG_0")]
+ public static extern global::System.IntPtr new_PixelBuffer__SWIG_0();
+
+ [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_delete_PixelBuffer")]
+ public static extern void delete_PixelBuffer(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+ [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_new_PixelBuffer__SWIG_1")]
+ public static extern global::System.IntPtr new_PixelBuffer__SWIG_1(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+ [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_PixelBuffer_Assign")]
+ public static extern global::System.IntPtr PixelBuffer_Assign(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
+
+ [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_PixelBuffer_Convert")]
+ public static extern global::System.IntPtr PixelBuffer_Convert(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+ [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_PixelBuffer_CreatePixelData")]
+ public static extern global::System.IntPtr PixelBuffer_CreatePixelData(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+ [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_PixelBuffer_GetBuffer")]
+ public static extern global::System.IntPtr PixelBuffer_GetBuffer(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+ [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_PixelBuffer_GetWidth")]
+ public static extern uint PixelBuffer_GetWidth(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+ [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_PixelBuffer_GetHeight")]
+ public static extern uint PixelBuffer_GetHeight(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+ [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_PixelBuffer_GetPixelFormat")]
+ public static extern int PixelBuffer_GetPixelFormat(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+ [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_PixelBuffer_ApplyMask__SWIG_0")]
+ public static extern void PixelBuffer_ApplyMask__SWIG_0(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, float jarg3, bool jarg4);
+
+ [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_PixelBuffer_ApplyMask__SWIG_1")]
+ public static extern void PixelBuffer_ApplyMask__SWIG_1(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, float jarg3);
+
+ [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_PixelBuffer_ApplyMask__SWIG_2")]
+ public static extern void PixelBuffer_ApplyMask__SWIG_2(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
+
+ [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_PixelBuffer_ApplyGaussianBlur")]
+ public static extern void PixelBuffer_ApplyGaussianBlur(global::System.Runtime.InteropServices.HandleRef jarg1, float jarg2);
+
+ [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_PixelBuffer_Crop")]
+ public static extern void PixelBuffer_Crop(global::System.Runtime.InteropServices.HandleRef jarg1, ushort jarg2, ushort jarg3, ushort jarg4, ushort jarg5);
+
+ [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_PixelBuffer_Resize")]
+ public static extern void PixelBuffer_Resize(global::System.Runtime.InteropServices.HandleRef jarg1, ushort jarg2, ushort jarg3);
+
+ [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_new_PixelBuffer__SWIG_2")]
+ public static extern global::System.IntPtr new_PixelBuffer__SWIG_2(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+ [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_LoadImageFromFile__SWIG_0")]
+ public static extern global::System.IntPtr LoadImageFromFile__SWIG_0(string jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, int jarg3, int jarg4, bool jarg5);
+
+ [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_LoadImageFromFile__SWIG_1")]
+ public static extern global::System.IntPtr LoadImageFromFile__SWIG_1(string jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, int jarg3, int jarg4);
+
+ [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_LoadImageFromFile__SWIG_2")]
+ public static extern global::System.IntPtr LoadImageFromFile__SWIG_2(string jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, int jarg3);
+
+ [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_LoadImageFromFile__SWIG_3")]
+ public static extern global::System.IntPtr LoadImageFromFile__SWIG_3(string jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
+
+ [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_LoadImageFromFile__SWIG_4")]
+ public static extern global::System.IntPtr LoadImageFromFile__SWIG_4(string jarg1);
+
+ [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_GetClosestImageSize__SWIG_0")]
+ public static extern global::System.IntPtr GetClosestImageSize__SWIG_0(string jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, int jarg3, int jarg4, bool jarg5);
+
+ [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_GetClosestImageSize__SWIG_1")]
+ public static extern global::System.IntPtr GetClosestImageSize__SWIG_1(string jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, int jarg3, int jarg4);
+
+ [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_GetClosestImageSize__SWIG_2")]
+ public static extern global::System.IntPtr GetClosestImageSize__SWIG_2(string jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, int jarg3);
+
+ [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_GetClosestImageSize__SWIG_3")]
+ public static extern global::System.IntPtr GetClosestImageSize__SWIG_3(string jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
+
+ [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_GetClosestImageSize__SWIG_4")]
+ public static extern global::System.IntPtr GetClosestImageSize__SWIG_4(string jarg1);
+
+ [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_DownloadImageSynchronously__SWIG_0")]
+ public static extern global::System.IntPtr DownloadImageSynchronously__SWIG_0(string jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, int jarg3, int jarg4, bool jarg5);
+
+ [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_DownloadImageSynchronously__SWIG_1")]
+ public static extern global::System.IntPtr DownloadImageSynchronously__SWIG_1(string jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, int jarg3, int jarg4);
+
+ [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_DownloadImageSynchronously__SWIG_2")]
+ public static extern global::System.IntPtr DownloadImageSynchronously__SWIG_2(string jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, int jarg3);
+
+ [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_DownloadImageSynchronously__SWIG_3")]
+ public static extern global::System.IntPtr DownloadImageSynchronously__SWIG_3(string jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
+
+ [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_DownloadImageSynchronously__SWIG_4")]
+ public static extern global::System.IntPtr DownloadImageSynchronously__SWIG_4(string jarg1);
+
+ [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_SetMaxTextureSize")]
+ public static extern void SetMaxTextureSize(uint jarg1);
+
+ [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_GetMaxTextureSize")]
+ public static extern uint GetMaxTextureSize();
+
}
}
--- /dev/null
+/*
+ * Copyright(c) 2017 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+using System.ComponentModel;
+
+namespace Tizen.NUI
+{
+
+ /// <summary>
+ /// Loading an image.
+ /// </summary>
+ /// <since_tizen> 5 </since_tizen>
+ /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public class ImageLoading
+ {
+ /// <summary>
+ /// Load an image synchronously from local file.
+ /// </summary>
+ /// <param name="url">The URL of the image file to load.</param>
+ /// <param name="size">The width and height to fit the loaded image to, 0.0 means whole image.</param>
+ /// <param name="fittingMode">The method used to fit the shape of the image before loading to the shape defined by the size parameter.</param>
+ /// <param name="samplingMode">The filtering method used when sampling pixels from the input image while fitting it to desired size.</param>
+ /// <param name="orientationCorrection">Reorient the image to respect any orientation metadata in its header.</param>
+ /// <returns>Handle to the loaded PixelBuffer object or an empty handle in case loading failed.</returns>
+ /// <since_tizen> 5 </since_tizen>
+ /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static PixelBuffer LoadImageFromFile(string url, Size2D size, FittingModeType fittingMode, SamplingModeType samplingMode, bool orientationCorrection)
+ {
+ var uSize = new Uint16Pair((uint)size.Width, (uint)size.Height);
+ PixelBuffer ret = new PixelBuffer(NDalicPINVOKE.LoadImageFromFile__SWIG_0(url, Uint16Pair.getCPtr(uSize), (int)fittingMode, (int)samplingMode, orientationCorrection), true);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
+ /// <summary>
+ /// Load an image synchronously from local file.
+ /// </summary>
+ /// <param name="url">The URL of the image file to load.</param>
+ /// <param name="size">The width and height to fit the loaded image to, 0.0 means whole image.</param>
+ /// <param name="fittingMode">The method used to fit the shape of the image before loading to the shape defined by the size parameter.</param>
+ /// <param name="samplingMode">The filtering method used when sampling pixels from the input image while fitting it to desired size.</param>
+ /// <returns>Handle to the loaded PixelBuffer object or an empty handle in case loading failed.</returns>
+ /// <since_tizen> 5 </since_tizen>
+ /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static PixelBuffer LoadImageFromFile(string url, Size2D size, FittingModeType fittingMode, SamplingModeType samplingMode)
+ {
+ var uSize = new Uint16Pair((uint)size.Width, (uint)size.Height);
+ PixelBuffer ret = new PixelBuffer(NDalicPINVOKE.LoadImageFromFile__SWIG_1(url, Uint16Pair.getCPtr(uSize), (int)fittingMode, (int)samplingMode), true);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
+ /// <summary>
+ /// Load an image synchronously from local file.
+ /// </summary>
+ /// <param name="url">The URL of the image file to load.</param>
+ /// <param name="size">The width and height to fit the loaded image to, 0.0 means whole image.</param>
+ /// <param name="fittingMode">The method used to fit the shape of the image before loading to the shape defined by the size parameter.</param>
+ /// <returns>Handle to the loaded PixelBuffer object or an empty handle in case loading failed.</returns>
+ /// <since_tizen> 5 </since_tizen>
+ /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static PixelBuffer LoadImageFromFile(string url, Size2D size, FittingModeType fittingMode)
+ {
+ var uSize = new Uint16Pair((uint)size.Width, (uint)size.Height);
+ PixelBuffer ret = new PixelBuffer(NDalicPINVOKE.LoadImageFromFile__SWIG_2(url, Uint16Pair.getCPtr(uSize), (int)fittingMode), true);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
+ /// <summary>
+ /// Load an image synchronously from local file.
+ /// </summary>
+ /// <param name="url">The URL of the image file to load.</param>
+ /// <param name="size">The width and height to fit the loaded image to, 0.0 means whole image.</param>
+ /// <returns>Handle to the loaded PixelBuffer object or an empty handle in case loading failed.</returns>
+ /// <since_tizen> 5 </since_tizen>
+ /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static PixelBuffer LoadImageFromFile(string url, Size2D size)
+ {
+ var uSize = new Uint16Pair((uint)size.Width, (uint)size.Height);
+ PixelBuffer ret = new PixelBuffer(NDalicPINVOKE.LoadImageFromFile__SWIG_3(url, Uint16Pair.getCPtr(uSize)), true);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
+ /// <summary>
+ /// Load an image synchronously from local file.
+ /// </summary>
+ /// <param name="url">The URL of the image file to load.</param>
+ /// <returns>Handle to the loaded PixelBuffer object or an empty handle in case loading failed.</returns>
+ /// <since_tizen> 5 </since_tizen>
+ /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static PixelBuffer LoadImageFromFile(string url)
+ {
+ PixelBuffer ret = new PixelBuffer(NDalicPINVOKE.LoadImageFromFile__SWIG_4(url), true);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
+ /// <summary>
+ /// Determine the size of an image that LoadImageFromFile will provide when given the same image loading parameters.
+ /// </summary>
+ /// <param name="filename">The name of the image.</param>
+ /// <param name="size">The requested size for the image</param>
+ /// <param name="fittingMode">The method to use to map the source image to the desired dimensions.</param>
+ /// <param name="samplingMode">The image filter to use if the image needs to be downsampled to the requested size.</param>
+ /// <param name="orientationCorrection">Whether to use image metadata to rotate or flip the image, e.g., from portrait to landscape.</param>
+ /// <returns>Dimensions that image will have if it is loaded with given parameters.</returns>
+ /// <since_tizen> 5 </since_tizen>
+ /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static Size2D GetClosestImageSize(string filename, Size2D size, FittingModeType fittingMode, SamplingModeType samplingMode, bool orientationCorrection)
+ {
+ var uSize = new Uint16Pair((uint)size.Width, (uint)size.Height);
+ var val = new Uint16Pair(NDalicPINVOKE.GetClosestImageSize__SWIG_0(filename, Uint16Pair.getCPtr(uSize), (int)fittingMode, (int)samplingMode, orientationCorrection), true);
+ Size2D ret = new Size2D(val.GetWidth(), val.GetHeight());
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
+ /// <summary>
+ /// Determine the size of an image that LoadImageFromFile will provide when given the same image loading parameters.
+ /// </summary>
+ /// <param name="filename">The name of the image.</param>
+ /// <param name="size">The requested size for the image</param>
+ /// <param name="fittingMode">The method to use to map the source image to the desired dimensions.</param>
+ /// <param name="samplingMode">The image filter to use if the image needs to be downsampled to the requested size.</param>
+ /// <returns>Dimensions that image will have if it is loaded with given parameters.</returns>
+ /// <since_tizen> 5 </since_tizen>
+ /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static Size2D GetClosestImageSize(string filename, Size2D size, FittingModeType fittingMode, SamplingModeType samplingMode)
+ {
+ var uSize = new Uint16Pair((uint)size.Width, (uint)size.Height);
+ var val = new Uint16Pair(NDalicPINVOKE.GetClosestImageSize__SWIG_1(filename, Uint16Pair.getCPtr(uSize), (int)fittingMode, (int)samplingMode), true);
+ Size2D ret = new Size2D(val.GetWidth(), val.GetHeight());
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
+ /// <summary>
+ /// Determine the size of an image that LoadImageFromFile will provide when given the same image loading parameters.
+ /// </summary>
+ /// <param name="filename">The name of the image.</param>
+ /// <param name="size">The requested size for the image</param>
+ /// <param name="fittingMode">The method to use to map the source image to the desired dimensions.</param>
+ /// <returns>Dimensions that image will have if it is loaded with given parameters.</returns>
+ /// <since_tizen> 5 </since_tizen>
+ /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static Size2D GetClosestImageSize(string filename, Size2D size, FittingModeType fittingMode)
+ {
+ var uSize = new Uint16Pair((uint)size.Width, (uint)size.Height);
+ var val = new Uint16Pair(NDalicPINVOKE.GetClosestImageSize__SWIG_2(filename, Uint16Pair.getCPtr(uSize), (int)fittingMode), true);
+ Size2D ret = new Size2D(val.GetWidth(), val.GetHeight());
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
+ /// <summary>
+ /// Determine the size of an image that LoadImageFromFile will provide when given the same image loading parameters.
+ /// </summary>
+ /// <param name="filename">The name of the image.</param>
+ /// <param name="size">The requested size for the image</param>
+ /// <returns>Dimensions that image will have if it is loaded with given parameters.</returns>
+ /// <since_tizen> 5 </since_tizen>
+ /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static Size2D GetClosestImageSize(string filename, Size2D size)
+ {
+ var uSize = new Uint16Pair((uint)size.Width, (uint)size.Height);
+ var val = new Uint16Pair(NDalicPINVOKE.GetClosestImageSize__SWIG_3(filename, Uint16Pair.getCPtr(uSize)), true);
+ Size2D ret = new Size2D(val.GetWidth(), val.GetHeight());
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
+ /// <summary>
+ /// Determine the size of an image that LoadImageFromFile will provide when given the same image loading parameters.
+ /// </summary>
+ /// <param name="filename">The name of the image.</param>
+ /// <returns>Dimensions that image will have if it is loaded with given parameters.</returns>
+ /// <since_tizen> 5 </since_tizen>
+ /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static Size2D GetClosestImageSize(string filename)
+ {
+ var val = new Uint16Pair(NDalicPINVOKE.GetClosestImageSize__SWIG_4(filename), true);
+ Size2D ret = new Size2D(val.GetWidth(), val.GetHeight());
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
+ /// <summary>
+ /// Load an image synchronously from a remote resource.
+ /// </summary>
+ /// <param name="url">The URL of the image file to load.</param>
+ /// <param name="size">The width and height to fit the loaded image to, 0.0 means whole image.</param>
+ /// <param name="fittingMode">The method used to fit the shape of the image before loading to the shape defined by the size parameter.</param>
+ /// <param name="samplingMode">The filtering method used when sampling pixels from the input image while fitting it to desired size.</param>
+ /// <param name="orientationCorrection">Reorient the image to respect any orientation metadata in its header.</param>
+ /// <returns>Handle to the loaded PixelBuffer object or an empty handle in case downloading or decoding failed.</returns>
+ /// <since_tizen> 5 </since_tizen>
+ /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static PixelBuffer DownloadImageSynchronously(string url, Size2D size, FittingModeType fittingMode, SamplingModeType samplingMode, bool orientationCorrection)
+ {
+ var uSize = new Uint16Pair((uint)size.Width, (uint)size.Height);
+ PixelBuffer ret = new PixelBuffer(NDalicPINVOKE.DownloadImageSynchronously__SWIG_0(url, Uint16Pair.getCPtr(uSize), (int)fittingMode, (int)samplingMode, orientationCorrection), true);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
+ /// <summary>
+ /// Load an image synchronously from a remote resource.
+ /// </summary>
+ /// <param name="url">The URL of the image file to load.</param>
+ /// <param name="size">The width and height to fit the loaded image to, 0.0 means whole image.</param>
+ /// <param name="fittingMode">The method used to fit the shape of the image before loading to the shape defined by the size parameter.</param>
+ /// <param name="samplingMode">The filtering method used when sampling pixels from the input image while fitting it to desired size.</param>
+ /// <returns>Handle to the loaded PixelBuffer object or an empty handle in case downloading or decoding failed.</returns>
+ /// <since_tizen> 5 </since_tizen>
+ /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static PixelBuffer DownloadImageSynchronously(string url, Size2D size, FittingModeType fittingMode, SamplingModeType samplingMode)
+ {
+ var uSize = new Uint16Pair((uint)size.Width, (uint)size.Height);
+ PixelBuffer ret = new PixelBuffer(NDalicPINVOKE.DownloadImageSynchronously__SWIG_1(url, Uint16Pair.getCPtr(uSize), (int)fittingMode, (int)samplingMode), true);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
+ /// <summary>
+ /// Load an image synchronously from a remote resource.
+ /// </summary>
+ /// <param name="url">The URL of the image file to load.</param>
+ /// <param name="size">The width and height to fit the loaded image to, 0.0 means whole image.</param>
+ /// <param name="fittingMode">The method used to fit the shape of the image before loading to the shape defined by the size parameter.</param>
+ /// <returns>Handle to the loaded PixelBuffer object or an empty handle in case downloading or decoding failed.</returns>
+ /// <since_tizen> 5 </since_tizen>
+ /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static PixelBuffer DownloadImageSynchronously(string url, Size2D size, FittingModeType fittingMode)
+ {
+ var uSize = new Uint16Pair((uint)size.Width, (uint)size.Height);
+ PixelBuffer ret = new PixelBuffer(NDalicPINVOKE.DownloadImageSynchronously__SWIG_2(url, Uint16Pair.getCPtr(uSize), (int)fittingMode), true);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
+ /// <summary>
+ /// Load an image synchronously from a remote resource.
+ /// </summary>
+ /// <param name="url">The URL of the image file to load.</param>
+ /// <param name="size">The width and height to fit the loaded image to, 0.0 means whole image.</param>
+ /// <returns>Handle to the loaded PixelBuffer object or an empty handle in case downloading or decoding failed.</returns>
+ /// <since_tizen> 5 </since_tizen>
+ /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static PixelBuffer DownloadImageSynchronously(string url, Size2D size)
+ {
+ var uSize = new Uint16Pair((uint)size.Width, (uint)size.Height);
+ PixelBuffer ret = new PixelBuffer(NDalicPINVOKE.DownloadImageSynchronously__SWIG_3(url, Uint16Pair.getCPtr(uSize)), true);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
+ /// <summary>
+ /// Load an image synchronously from a remote resource.
+ /// </summary>
+ /// <param name="url">The URL of the image file to load.</param>
+ /// <returns>Handle to the loaded PixelBuffer object or an empty handle in case downloading or decoding failed.</returns>
+ /// <since_tizen> 5 </since_tizen>
+ /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static PixelBuffer DownloadImageSynchronously(string url)
+ {
+ PixelBuffer ret = new PixelBuffer(NDalicPINVOKE.DownloadImageSynchronously__SWIG_4(url), true);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
+ /// <summary>
+ /// Set the maximum texture size. Then size can be kwown by GL_MAX_TEXTURE_SIZE.
+ /// </summary>
+ /// <param name="size">The maximum texture size to set.</param>
+ /// <since_tizen> 5 </since_tizen>
+ /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static void SetMaxTextureSize(uint size)
+ {
+ NDalicPINVOKE.SetMaxTextureSize(size);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+
+ /// <summary>
+ /// Get the maximum texture size.
+ /// </summary>
+ /// <returns>The maximum texture size.</returns>
+ /// <since_tizen> 5 </since_tizen>
+ /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static uint GetMaxTextureSize()
+ {
+ uint ret = NDalicPINVOKE.GetMaxTextureSize();
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+ }
+}
--- /dev/null
+/** Copyright (c) 2017 Samsung Electronics Co., Ltd.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/
+using System.ComponentModel;
+
+namespace Tizen.NUI
+{
+
+ /// <summary>
+ /// The PixelBuffer object holds a pixel buffer.
+ /// The PixelBuffer keeps ownership of it's initial buffer however, the
+ /// user is free to modify the pixel data, either directly, or via image operations.
+ ///
+ /// In order to upload the pixel data to texture memory, there are two
+ /// possibilities - either convert it back to a PixelData object, which
+ /// releases the PixelBuffer object, leaving the user with an empty handle
+ /// (ideal for one-time indirect image manipulation), or create a new
+ /// PixelData object from this object, leaving the buffer intact (ideal
+ /// for continuous manipulation)
+ /// </summary>
+ /// <since_tizen> 5 </since_tizen>
+ /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public class PixelBuffer : BaseHandle
+ {
+ private global::System.Runtime.InteropServices.HandleRef swigCPtr;
+
+ internal PixelBuffer(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.PixelBuffer_SWIGUpcast(cPtr), cMemoryOwn)
+ {
+ swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
+ }
+
+ internal static global::System.Runtime.InteropServices.HandleRef getCPtr(PixelBuffer obj)
+ {
+ return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
+ }
+
+ /// <summary>
+ /// Dispose.
+ /// </summary>
+ /// <since_tizen> 5 </since_tizen>
+ protected override void Dispose(DisposeTypes type)
+ {
+ if (disposed)
+ {
+ return;
+ }
+
+ if (type == DisposeTypes.Explicit)
+ {
+ //Called by User
+ //Release your own managed resources here.
+ //You should release all of your own disposable objects here.
+
+ }
+
+ //Release your own unmanaged resources here.
+ //You should not access any managed member here except static instance.
+ //because the execution order of Finalizes is non-deterministic.
+ if (swigCPtr.Handle != global::System.IntPtr.Zero)
+ {
+ if (swigCMemOwn)
+ {
+ swigCMemOwn = false;
+ NDalicPINVOKE.delete_PixelBuffer(swigCPtr);
+ }
+ swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
+ }
+
+ base.Dispose(type);
+ }
+
+ /// <summary>
+ /// Create a PixelBuffer with it's own data buffer.
+ /// </summary>
+ /// <param name="width">The pixel buffer width</param>
+ /// <param name="height">The pixel buffer height</param>
+ /// <param name="pixelFormat">The pixel format</param>
+ /// <since_tizen> 5 </since_tizen>
+ /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public PixelBuffer(uint width, uint height, PixelFormat pixelFormat) : this(NDalicPINVOKE.PixelBuffer_New(width, height, (int)pixelFormat), true)
+ {
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+
+ internal PixelBuffer(PixelBuffer handle) : this(NDalicPINVOKE.new_PixelBuffer__SWIG_1(PixelBuffer.getCPtr(handle)), true)
+ {
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+
+ internal PixelBuffer Assign(PixelBuffer rhs)
+ {
+ PixelBuffer ret = new PixelBuffer(NDalicPINVOKE.PixelBuffer_Assign(swigCPtr, PixelBuffer.getCPtr(rhs)), false);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
+ /// <summary>
+ /// Convert to a pixel data and release the pixelBuffer's object.
+ /// This handle is left empty.
+ /// Any other handles that keep a reference to this object
+ /// will be left with no buffer, trying to access it will return NULL.
+ /// </summary>
+ /// <param name="pixelBuffer">A pixel buffer</param>
+ /// <returns>A new PixelData which takes ownership of the PixelBuffer's buffer.</returns>
+ /// <since_tizen> 5 </since_tizen>
+ /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static PixelData Convert(PixelBuffer pixelBuffer)
+ {
+ PixelData ret = new PixelData(NDalicPINVOKE.PixelBuffer_Convert(PixelBuffer.getCPtr(pixelBuffer)), true);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
+ /// <summary>
+ /// Copy the data from this object into a new PixelData object, which could be
+ /// used for uploading to a texture.
+ /// </summary>
+ /// <returns>The pixel data.</returns>
+ /// <since_tizen> 5 </since_tizen>
+ /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public PixelData CreatePixelData()
+ {
+ PixelData ret = new PixelData(NDalicPINVOKE.PixelBuffer_CreatePixelData(swigCPtr), true);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
+ internal SWIGTYPE_p_unsigned_char GetBuffer()
+ {
+ global::System.IntPtr cPtr = NDalicPINVOKE.PixelBuffer_GetBuffer(swigCPtr);
+ SWIGTYPE_p_unsigned_char ret = (cPtr == global::System.IntPtr.Zero) ? null : new SWIGTYPE_p_unsigned_char(cPtr, false);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
+ /// <summary>
+ /// Gets the width of the buffer in pixels.
+ /// </summary>
+ /// <returns>The width of the buffer in pixels.</returns>
+ /// <since_tizen> 5 </since_tizen>
+ /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public uint GetWidth()
+ {
+ uint ret = NDalicPINVOKE.PixelBuffer_GetWidth(swigCPtr);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
+ /// <summary>
+ /// Gets the height of the buffer in pixels.
+ /// </summary>
+ /// <returns>The height of the buffer in pixels.</returns>
+ /// <since_tizen> 5 </since_tizen>
+ /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public uint GetHeight()
+ {
+ uint ret = NDalicPINVOKE.PixelBuffer_GetHeight(swigCPtr);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
+ /// <summary>
+ /// Gets the pixel format.
+ /// </summary>
+ /// <returns>The pixel format.</returns>
+ /// <since_tizen> 5 </since_tizen>
+ /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public PixelFormat GetPixelFormat()
+ {
+ PixelFormat ret = (PixelFormat)NDalicPINVOKE.PixelBuffer_GetPixelFormat(swigCPtr);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
+ /// <summary>
+ /// Apply the mask to this pixel data, and return a new pixel data containing
+ /// the masked image. If this PixelBuffer doesn't have an alpha channel, then
+ /// the resultant PixelBuffer will be converted to a format that supports at
+ /// least the width of the color channels and the alpha channel from the mask.
+ ///
+ /// If cropToMask is set to true, then the contentScale is applied first to
+ /// this buffer, and the target buffer is cropped to the size of the mask. If
+ /// it's set to false, then the mask is scaled to match this buffer's size
+ /// before the mask is applied.
+ /// </summary>
+ /// <param name="mask">The mask to apply.</param>
+ /// <param name="contentScale">The scaling factor to apply to the content.</param>
+ /// <param name="cropToMask">Whether to crop the output to the mask size (true) or scale the mask to the content size (false).</param>
+ /// <since_tizen> 5 </since_tizen>
+ /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public void ApplyMask(PixelBuffer mask, float contentScale, bool cropToMask)
+ {
+ NDalicPINVOKE.PixelBuffer_ApplyMask__SWIG_0(swigCPtr, PixelBuffer.getCPtr(mask), contentScale, cropToMask);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+
+ /// <summary>
+ /// Apply the mask to this pixel data, and return a new pixel data containing
+ /// the masked image. If this PixelBuffer doesn't have an alpha channel, then
+ /// the resultant PixelBuffer will be converted to a format that supports at
+ /// least the width of the color channels and the alpha channel from the mask.
+ ///
+ /// If cropToMask is set to true, then the contentScale is applied first to
+ /// this buffer, and the target buffer is cropped to the size of the mask. If
+ /// it's set to false, then the mask is scaled to match this buffer's size
+ /// before the mask is applied.
+ /// </summary>
+ /// <param name="mask">The mask to apply.</param>
+ /// <param name="contentScale">The scaling factor to apply to the content.</param>
+ /// <since_tizen> 5 </since_tizen>
+ /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public void ApplyMask(PixelBuffer mask, float contentScale)
+ {
+ NDalicPINVOKE.PixelBuffer_ApplyMask__SWIG_1(swigCPtr, PixelBuffer.getCPtr(mask), contentScale);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+
+ /// <summary>
+ /// Apply the mask to this pixel data, and return a new pixel data containing
+ /// the masked image. If this PixelBuffer doesn't have an alpha channel, then
+ /// the resultant PixelBuffer will be converted to a format that supports at
+ /// least the width of the color channels and the alpha channel from the mask.
+ ///
+ /// If cropToMask is set to true, then the contentScale is applied first to
+ /// this buffer, and the target buffer is cropped to the size of the mask. If
+ /// it's set to false, then the mask is scaled to match this buffer's size
+ /// before the mask is applied.
+ /// </summary>
+ /// <param name="mask">The mask to apply.</param>
+ /// <since_tizen> 5 </since_tizen>
+ /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public void ApplyMask(PixelBuffer mask)
+ {
+ NDalicPINVOKE.PixelBuffer_ApplyMask__SWIG_2(swigCPtr, PixelBuffer.getCPtr(mask));
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+
+ /// <summary>
+ /// Apply a Gaussian blur to this pixel data with the given radius.
+ /// A bigger radius will yield a blurrier image. Only works for pixel data in RGBA format.
+ /// </summary>
+ /// <param name="blurRadius">The radius for Gaussian blur. A value of 0 or negative value indicates no blur.</param>
+ /// <since_tizen> 5 </since_tizen>
+ /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public void ApplyGaussianBlur(float blurRadius)
+ {
+ NDalicPINVOKE.PixelBuffer_ApplyGaussianBlur(swigCPtr, blurRadius);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+
+ /// <summary>
+ /// Crops this buffer to the given crop rectangle.
+ /// </summary>
+ /// <param name="x">The top left corner's X.</param>
+ /// <param name="y">The top left corner's Y.</param>
+ /// <param name="width">The crop width.</param>
+ /// <param name="height">The crop height.</param>
+ /// <since_tizen> 5 </since_tizen>
+ /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public void Crop(ushort x, ushort y, ushort width, ushort height)
+ {
+ NDalicPINVOKE.PixelBuffer_Crop(swigCPtr, x, y, width, height);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+
+ /// <summary>
+ /// Resizes the buffer to the given dimensions.
+ /// </summary>
+ /// <param name="width">The new width.</param>
+ /// <param name="height">The new height.</param>
+ /// <since_tizen> 5 </since_tizen>
+ /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public void Resize(ushort width, ushort height)
+ {
+ NDalicPINVOKE.PixelBuffer_Resize(swigCPtr, width, height);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+
+ internal PixelBuffer(SWIGTYPE_p_unsigned_char pointer) : this(NDalicPINVOKE.new_PixelBuffer__SWIG_2(SWIGTYPE_p_unsigned_char.getCPtr(pointer)), true)
+ {
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+
+ }
+
+}