2 * Copyright(c) 2017 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.
17 using System.ComponentModel;
25 /// <since_tizen> 5 </since_tizen>
26 /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
27 [EditorBrowsable(EditorBrowsableState.Never)]
28 public class ImageLoading
31 /// Load an image synchronously from local file.
33 /// <param name="url">The URL of the image file to load.</param>
34 /// <param name="size">The width and height to fit the loaded image to, 0.0 means whole image.</param>
35 /// <param name="fittingMode">The method used to fit the shape of the image before loading to the shape defined by the size parameter.</param>
36 /// <param name="samplingMode">The filtering method used when sampling pixels from the input image while fitting it to desired size.</param>
37 /// <param name="orientationCorrection">Reorient the image to respect any orientation metadata in its header.</param>
38 /// <returns>Handle to the loaded PixelBuffer object or an empty handle in case loading failed.</returns>
39 /// <since_tizen> 5 </since_tizen>
40 /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
41 [EditorBrowsable(EditorBrowsableState.Never)]
42 public static PixelBuffer LoadImageFromFile(string url, Size2D size, FittingModeType fittingMode, SamplingModeType samplingMode, bool orientationCorrection)
44 var uSize = new Uint16Pair((uint)size.Width, (uint)size.Height);
45 PixelBuffer ret = new PixelBuffer(NDalicPINVOKE.LoadImageFromFile__SWIG_0(url, Uint16Pair.getCPtr(uSize), (int)fittingMode, (int)samplingMode, orientationCorrection), true);
46 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
51 /// Load an image synchronously from local file.
53 /// <param name="url">The URL of the image file to load.</param>
54 /// <param name="size">The width and height to fit the loaded image to, 0.0 means whole image.</param>
55 /// <param name="fittingMode">The method used to fit the shape of the image before loading to the shape defined by the size parameter.</param>
56 /// <param name="samplingMode">The filtering method used when sampling pixels from the input image while fitting it to desired size.</param>
57 /// <returns>Handle to the loaded PixelBuffer object or an empty handle in case loading failed.</returns>
58 /// <since_tizen> 5 </since_tizen>
59 /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
60 [EditorBrowsable(EditorBrowsableState.Never)]
61 public static PixelBuffer LoadImageFromFile(string url, Size2D size, FittingModeType fittingMode, SamplingModeType samplingMode)
63 var uSize = new Uint16Pair((uint)size.Width, (uint)size.Height);
64 PixelBuffer ret = new PixelBuffer(NDalicPINVOKE.LoadImageFromFile__SWIG_1(url, Uint16Pair.getCPtr(uSize), (int)fittingMode, (int)samplingMode), true);
65 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
70 /// Load an image synchronously from local file.
72 /// <param name="url">The URL of the image file to load.</param>
73 /// <param name="size">The width and height to fit the loaded image to, 0.0 means whole image.</param>
74 /// <param name="fittingMode">The method used to fit the shape of the image before loading to the shape defined by the size parameter.</param>
75 /// <returns>Handle to the loaded PixelBuffer object or an empty handle in case loading failed.</returns>
76 /// <since_tizen> 5 </since_tizen>
77 /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
78 [EditorBrowsable(EditorBrowsableState.Never)]
79 public static PixelBuffer LoadImageFromFile(string url, Size2D size, FittingModeType fittingMode)
81 var uSize = new Uint16Pair((uint)size.Width, (uint)size.Height);
82 PixelBuffer ret = new PixelBuffer(NDalicPINVOKE.LoadImageFromFile__SWIG_2(url, Uint16Pair.getCPtr(uSize), (int)fittingMode), true);
83 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
88 /// Load an image synchronously from local file.
90 /// <param name="url">The URL of the image file to load.</param>
91 /// <param name="size">The width and height to fit the loaded image to, 0.0 means whole image.</param>
92 /// <returns>Handle to the loaded PixelBuffer object or an empty handle in case loading failed.</returns>
93 /// <since_tizen> 5 </since_tizen>
94 /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
95 [EditorBrowsable(EditorBrowsableState.Never)]
96 public static PixelBuffer LoadImageFromFile(string url, Size2D size)
98 var uSize = new Uint16Pair((uint)size.Width, (uint)size.Height);
99 PixelBuffer ret = new PixelBuffer(NDalicPINVOKE.LoadImageFromFile__SWIG_3(url, Uint16Pair.getCPtr(uSize)), true);
100 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
105 /// Load an image synchronously from local file.
107 /// <param name="url">The URL of the image file to load.</param>
108 /// <returns>Handle to the loaded PixelBuffer object or an empty handle in case loading failed.</returns>
109 /// <since_tizen> 5 </since_tizen>
110 /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
111 [EditorBrowsable(EditorBrowsableState.Never)]
112 public static PixelBuffer LoadImageFromFile(string url)
114 PixelBuffer ret = new PixelBuffer(NDalicPINVOKE.LoadImageFromFile__SWIG_4(url), true);
115 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
120 /// Determine the size of an image that LoadImageFromFile will provide when given the same image loading parameters.
122 /// <param name="filename">The name of the image.</param>
123 /// <param name="size">The requested size for the image</param>
124 /// <param name="fittingMode">The method to use to map the source image to the desired dimensions.</param>
125 /// <param name="samplingMode">The image filter to use if the image needs to be downsampled to the requested size.</param>
126 /// <param name="orientationCorrection">Whether to use image metadata to rotate or flip the image, e.g., from portrait to landscape.</param>
127 /// <returns>Dimensions that image will have if it is loaded with given parameters.</returns>
128 /// <since_tizen> 5 </since_tizen>
129 /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
130 [EditorBrowsable(EditorBrowsableState.Never)]
131 public static Size2D GetClosestImageSize(string filename, Size2D size, FittingModeType fittingMode, SamplingModeType samplingMode, bool orientationCorrection)
133 var uSize = new Uint16Pair((uint)size.Width, (uint)size.Height);
134 var val = new Uint16Pair(NDalicPINVOKE.GetClosestImageSize__SWIG_0(filename, Uint16Pair.getCPtr(uSize), (int)fittingMode, (int)samplingMode, orientationCorrection), true);
135 Size2D ret = new Size2D(val.GetWidth(), val.GetHeight());
136 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
141 /// Determine the size of an image that LoadImageFromFile will provide when given the same image loading parameters.
143 /// <param name="filename">The name of the image.</param>
144 /// <param name="size">The requested size for the image</param>
145 /// <param name="fittingMode">The method to use to map the source image to the desired dimensions.</param>
146 /// <param name="samplingMode">The image filter to use if the image needs to be downsampled to the requested size.</param>
147 /// <returns>Dimensions that image will have if it is loaded with given parameters.</returns>
148 /// <since_tizen> 5 </since_tizen>
149 /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
150 [EditorBrowsable(EditorBrowsableState.Never)]
151 public static Size2D GetClosestImageSize(string filename, Size2D size, FittingModeType fittingMode, SamplingModeType samplingMode)
153 var uSize = new Uint16Pair((uint)size.Width, (uint)size.Height);
154 var val = new Uint16Pair(NDalicPINVOKE.GetClosestImageSize__SWIG_1(filename, Uint16Pair.getCPtr(uSize), (int)fittingMode, (int)samplingMode), true);
155 Size2D ret = new Size2D(val.GetWidth(), val.GetHeight());
156 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
161 /// Determine the size of an image that LoadImageFromFile will provide when given the same image loading parameters.
163 /// <param name="filename">The name of the image.</param>
164 /// <param name="size">The requested size for the image</param>
165 /// <param name="fittingMode">The method to use to map the source image to the desired dimensions.</param>
166 /// <returns>Dimensions that image will have if it is loaded with given parameters.</returns>
167 /// <since_tizen> 5 </since_tizen>
168 /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
169 [EditorBrowsable(EditorBrowsableState.Never)]
170 public static Size2D GetClosestImageSize(string filename, Size2D size, FittingModeType fittingMode)
172 var uSize = new Uint16Pair((uint)size.Width, (uint)size.Height);
173 var val = new Uint16Pair(NDalicPINVOKE.GetClosestImageSize__SWIG_2(filename, Uint16Pair.getCPtr(uSize), (int)fittingMode), true);
174 Size2D ret = new Size2D(val.GetWidth(), val.GetHeight());
175 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
180 /// Determine the size of an image that LoadImageFromFile will provide when given the same image loading parameters.
182 /// <param name="filename">The name of the image.</param>
183 /// <param name="size">The requested size for the image</param>
184 /// <returns>Dimensions that image will have if it is loaded with given parameters.</returns>
185 /// <since_tizen> 5 </since_tizen>
186 /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
187 [EditorBrowsable(EditorBrowsableState.Never)]
188 public static Size2D GetClosestImageSize(string filename, Size2D size)
190 var uSize = new Uint16Pair((uint)size.Width, (uint)size.Height);
191 var val = new Uint16Pair(NDalicPINVOKE.GetClosestImageSize__SWIG_3(filename, Uint16Pair.getCPtr(uSize)), true);
192 Size2D ret = new Size2D(val.GetWidth(), val.GetHeight());
193 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
198 /// Determine the size of an image that LoadImageFromFile will provide when given the same image loading parameters.
200 /// <param name="filename">The name of the image.</param>
201 /// <returns>Dimensions that image will have if it is loaded with given parameters.</returns>
202 /// <since_tizen> 5 </since_tizen>
203 /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
204 [EditorBrowsable(EditorBrowsableState.Never)]
205 public static Size2D GetClosestImageSize(string filename)
207 var val = new Uint16Pair(NDalicPINVOKE.GetClosestImageSize__SWIG_4(filename), true);
208 Size2D ret = new Size2D(val.GetWidth(), val.GetHeight());
209 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
214 /// Load an image synchronously from a remote resource.
216 /// <param name="url">The URL of the image file to load.</param>
217 /// <param name="size">The width and height to fit the loaded image to, 0.0 means whole image.</param>
218 /// <param name="fittingMode">The method used to fit the shape of the image before loading to the shape defined by the size parameter.</param>
219 /// <param name="samplingMode">The filtering method used when sampling pixels from the input image while fitting it to desired size.</param>
220 /// <param name="orientationCorrection">Reorient the image to respect any orientation metadata in its header.</param>
221 /// <returns>Handle to the loaded PixelBuffer object or an empty handle in case downloading or decoding failed.</returns>
222 /// <since_tizen> 5 </since_tizen>
223 /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
224 [EditorBrowsable(EditorBrowsableState.Never)]
225 public static PixelBuffer DownloadImageSynchronously(string url, Size2D size, FittingModeType fittingMode, SamplingModeType samplingMode, bool orientationCorrection)
227 var uSize = new Uint16Pair((uint)size.Width, (uint)size.Height);
228 PixelBuffer ret = new PixelBuffer(NDalicPINVOKE.DownloadImageSynchronously__SWIG_0(url, Uint16Pair.getCPtr(uSize), (int)fittingMode, (int)samplingMode, orientationCorrection), true);
229 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
234 /// Load an image synchronously from a remote resource.
236 /// <param name="url">The URL of the image file to load.</param>
237 /// <param name="size">The width and height to fit the loaded image to, 0.0 means whole image.</param>
238 /// <param name="fittingMode">The method used to fit the shape of the image before loading to the shape defined by the size parameter.</param>
239 /// <param name="samplingMode">The filtering method used when sampling pixels from the input image while fitting it to desired size.</param>
240 /// <returns>Handle to the loaded PixelBuffer object or an empty handle in case downloading or decoding failed.</returns>
241 /// <since_tizen> 5 </since_tizen>
242 /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
243 [EditorBrowsable(EditorBrowsableState.Never)]
244 public static PixelBuffer DownloadImageSynchronously(string url, Size2D size, FittingModeType fittingMode, SamplingModeType samplingMode)
246 var uSize = new Uint16Pair((uint)size.Width, (uint)size.Height);
247 PixelBuffer ret = new PixelBuffer(NDalicPINVOKE.DownloadImageSynchronously__SWIG_1(url, Uint16Pair.getCPtr(uSize), (int)fittingMode, (int)samplingMode), true);
248 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
253 /// Load an image synchronously from a remote resource.
255 /// <param name="url">The URL of the image file to load.</param>
256 /// <param name="size">The width and height to fit the loaded image to, 0.0 means whole image.</param>
257 /// <param name="fittingMode">The method used to fit the shape of the image before loading to the shape defined by the size parameter.</param>
258 /// <returns>Handle to the loaded PixelBuffer object or an empty handle in case downloading or decoding failed.</returns>
259 /// <since_tizen> 5 </since_tizen>
260 /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
261 [EditorBrowsable(EditorBrowsableState.Never)]
262 public static PixelBuffer DownloadImageSynchronously(string url, Size2D size, FittingModeType fittingMode)
264 var uSize = new Uint16Pair((uint)size.Width, (uint)size.Height);
265 PixelBuffer ret = new PixelBuffer(NDalicPINVOKE.DownloadImageSynchronously__SWIG_2(url, Uint16Pair.getCPtr(uSize), (int)fittingMode), true);
266 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
271 /// Load an image synchronously from a remote resource.
273 /// <param name="url">The URL of the image file to load.</param>
274 /// <param name="size">The width and height to fit the loaded image to, 0.0 means whole image.</param>
275 /// <returns>Handle to the loaded PixelBuffer object or an empty handle in case downloading or decoding failed.</returns>
276 /// <since_tizen> 5 </since_tizen>
277 /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
278 [EditorBrowsable(EditorBrowsableState.Never)]
279 public static PixelBuffer DownloadImageSynchronously(string url, Size2D size)
281 var uSize = new Uint16Pair((uint)size.Width, (uint)size.Height);
282 PixelBuffer ret = new PixelBuffer(NDalicPINVOKE.DownloadImageSynchronously__SWIG_3(url, Uint16Pair.getCPtr(uSize)), true);
283 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
288 /// Load an image synchronously from a remote resource.
290 /// <param name="url">The URL of the image file to load.</param>
291 /// <returns>Handle to the loaded PixelBuffer object or an empty handle in case downloading or decoding failed.</returns>
292 /// <since_tizen> 5 </since_tizen>
293 /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
294 [EditorBrowsable(EditorBrowsableState.Never)]
295 public static PixelBuffer DownloadImageSynchronously(string url)
297 PixelBuffer ret = new PixelBuffer(NDalicPINVOKE.DownloadImageSynchronously__SWIG_4(url), true);
298 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
303 /// Set the maximum texture size. Then size can be kwown by GL_MAX_TEXTURE_SIZE.
305 /// <param name="size">The maximum texture size to set.</param>
306 /// <since_tizen> 5 </since_tizen>
307 /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
308 [EditorBrowsable(EditorBrowsableState.Never)]
309 public static void SetMaxTextureSize(uint size)
311 NDalicPINVOKE.SetMaxTextureSize(size);
312 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
316 /// Get the maximum texture size.
318 /// <returns>The maximum texture size.</returns>
319 /// <since_tizen> 5 </since_tizen>
320 /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
321 [EditorBrowsable(EditorBrowsableState.Never)]
322 public static uint GetMaxTextureSize()
324 uint ret = NDalicPINVOKE.GetMaxTextureSize();
325 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();