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.
18 using System.ComponentModel;
26 /// <since_tizen> 5 </since_tizen>
27 /// This will be released at Tizen.NET API Level 5. Therefore, currently this would be used as an in-house API.
28 [EditorBrowsable(EditorBrowsableState.Never)]
29 public static class ImageLoading
32 /// Load an image synchronously from local file.
34 /// <param name="url">The URL of the image file to load.</param>
35 /// <param name="size">The width and height to fit the loaded image to, 0.0 means whole image.</param>
36 /// <param name="fittingMode">The method used to fit the shape of the image before loading to the shape defined by the size parameter.</param>
37 /// <param name="samplingMode">The filtering method used when sampling pixels from the input image while fitting it to desired size.</param>
38 /// <param name="orientationCorrection">Reorient the image to respect any orientation metadata in its header.</param>
39 /// <returns>Handle to the loaded PixelBuffer object or an empty handle in case loading failed.</returns>
40 /// <exception cref="ArgumentNullException"> Thrown when size is null. </exception>
41 /// <since_tizen> 5 </since_tizen>
42 /// This will be released at Tizen.NET API Level 5. Therefore, currently this would be used as an in-house API.
43 [EditorBrowsable(EditorBrowsableState.Never)]
44 public static PixelBuffer LoadImageFromFile(string url, Size2D size, FittingModeType fittingMode, SamplingModeType samplingMode, bool orientationCorrection)
48 throw new ArgumentNullException(nameof(size));
50 var uSize = new Uint16Pair((uint)size.Width, (uint)size.Height);
51 PixelBuffer ret = new PixelBuffer(Interop.ImageLoading.LoadImageFromFile(url, Uint16Pair.getCPtr(uSize), (int)fittingMode, (int)samplingMode, orientationCorrection), true);
53 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
58 /// Hidden API (Inhouse API).
59 /// Using Uri class to provide safe sevice and secure API.
60 /// Load an image synchronously from local file.
62 /// <param name="uri">The URI of the image file to load.</param>
63 /// <param name="size">The width and height to fit the loaded image to, 0.0 means whole image.</param>
64 /// <param name="fittingMode">The method used to fit the shape of the image before loading to the shape defined by the size parameter.</param>
65 /// <param name="samplingMode">The filtering method used when sampling pixels from the input image while fitting it to desired size.</param>
66 /// <param name="orientationCorrection">Reorient the image to respect any orientation metadata in its header.</param>
67 /// <returns>Handle to the loaded PixelBuffer object or an empty handle in case loading failed.</returns>
68 /// <exception cref="ArgumentNullException">Thrown when size is null.</exception>
69 /// <exception cref="ArgumentNullException">Thrown when uri is null.</exception>
70 [EditorBrowsable(EditorBrowsableState.Never)]
71 public static PixelBuffer LoadImageFromFile(Uri uri, Size2D size, FittingModeType fittingMode, SamplingModeType samplingMode, bool orientationCorrection)
75 throw new ArgumentNullException(nameof(size));
79 throw new ArgumentNullException(nameof(uri));
83 using (var uSize = new Uint16Pair((uint)size.Width, (uint)size.Height))
85 ret = new PixelBuffer(Interop.ImageLoading.LoadImageFromFile(uri.AbsoluteUri, Uint16Pair.getCPtr(uSize), (int)fittingMode, (int)samplingMode, orientationCorrection), true);
87 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
92 /// Load an image synchronously from local file.
94 /// <param name="url">The URL of the image file to load.</param>
95 /// <param name="size">The width and height to fit the loaded image to, 0.0 means whole image.</param>
96 /// <param name="fittingMode">The method used to fit the shape of the image before loading to the shape defined by the size parameter.</param>
97 /// <param name="samplingMode">The filtering method used when sampling pixels from the input image while fitting it to desired size.</param>
98 /// <returns>Handle to the loaded PixelBuffer object or an empty handle in case loading failed.</returns>
99 /// <exception cref="ArgumentNullException"> Thrown when size is null. </exception>
100 /// <since_tizen> 5 </since_tizen>
101 /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
102 [EditorBrowsable(EditorBrowsableState.Never)]
103 public static PixelBuffer LoadImageFromFile(string url, Size2D size, FittingModeType fittingMode, SamplingModeType samplingMode)
107 throw new ArgumentNullException(nameof(size));
109 var uSize = new Uint16Pair((uint)size.Width, (uint)size.Height);
110 PixelBuffer ret = new PixelBuffer(Interop.ImageLoading.LoadImageFromFile(url, Uint16Pair.getCPtr(uSize), (int)fittingMode, (int)samplingMode), true);
112 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
117 /// Hidden API (Inhouse API).
118 /// Using Uri class to provide safe sevice and secure API.
119 /// Load an image synchronously from local file.
121 /// <param name="uri">The URI of the image file to load.</param>
122 /// <param name="size">The width and height to fit the loaded image to, 0.0 means whole image.</param>
123 /// <param name="fittingMode">The method used to fit the shape of the image before loading to the shape defined by the size parameter.</param>
124 /// <param name="samplingMode">The filtering method used when sampling pixels from the input image while fitting it to desired size.</param>
125 /// <returns>Handle to the loaded PixelBuffer object or an empty handle in case loading failed.</returns>
126 /// <exception cref="ArgumentNullException"> Thrown when size is null. </exception>
127 /// <exception cref="ArgumentNullException">Thrown when uri is null.</exception>
128 [EditorBrowsable(EditorBrowsableState.Never)]
129 public static PixelBuffer LoadImageFromFile(Uri uri, Size2D size, FittingModeType fittingMode, SamplingModeType samplingMode)
133 throw new ArgumentNullException(nameof(size));
137 throw new ArgumentNullException(nameof(uri));
140 var uSize = new Uint16Pair((uint)size.Width, (uint)size.Height);
141 PixelBuffer ret = new PixelBuffer(Interop.ImageLoading.LoadImageFromFile(uri.AbsoluteUri, Uint16Pair.getCPtr(uSize), (int)fittingMode, (int)samplingMode), true);
142 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
149 /// Load an image synchronously from local file.
151 /// <param name="url">The URL of the image file to load.</param>
152 /// <param name="size">The width and height to fit the loaded image to, 0.0 means whole image.</param>
153 /// <param name="fittingMode">The method used to fit the shape of the image before loading to the shape defined by the size parameter.</param>
154 /// <returns>Handle to the loaded PixelBuffer object or an empty handle in case loading failed.</returns>
155 /// <exception cref="ArgumentNullException"> Thrown when size is null. </exception>
156 /// <since_tizen> 5 </since_tizen>
157 /// This will be released at Tizen.NET API Level 5. Therefore, currently this would be used as an in-house API.
158 [EditorBrowsable(EditorBrowsableState.Never)]
159 public static PixelBuffer LoadImageFromFile(string url, Size2D size, FittingModeType fittingMode)
163 throw new ArgumentNullException(nameof(size));
165 var uSize = new Uint16Pair((uint)size.Width, (uint)size.Height);
166 PixelBuffer ret = new PixelBuffer(Interop.ImageLoading.LoadImageFromFile(url, Uint16Pair.getCPtr(uSize), (int)fittingMode), true);
168 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
173 /// Hidden API (Inhouse API).
174 /// Using Uri class to provide safe sevice and secure API.
175 /// Load an image synchronously from local file.
177 /// <param name="uri">The URI of the image file to load.</param>
178 /// <param name="size">The width and height to fit the loaded image to, 0.0 means whole image.</param>
179 /// <param name="fittingMode">The method used to fit the shape of the image before loading to the shape defined by the size parameter.</param>
180 /// <returns>Handle to the loaded PixelBuffer object or an empty handle in case loading failed.</returns>
181 /// <exception cref="ArgumentNullException"> Thrown when size is null. </exception>
182 /// <exception cref="ArgumentNullException">Thrown when uri is null.</exception>
183 [EditorBrowsable(EditorBrowsableState.Never)]
184 public static PixelBuffer LoadImageFromFile(Uri uri, Size2D size, FittingModeType fittingMode)
188 throw new ArgumentNullException(nameof(size));
192 throw new ArgumentNullException(nameof(uri));
195 var uSize = new Uint16Pair((uint)size.Width, (uint)size.Height);
196 PixelBuffer ret = new PixelBuffer(Interop.ImageLoading.LoadImageFromFile(uri.AbsoluteUri, Uint16Pair.getCPtr(uSize), (int)fittingMode), true);
198 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
203 /// Load an image synchronously from local file.
205 /// <param name="url">The URL of the image file to load.</param>
206 /// <param name="size">The width and height to fit the loaded image to, 0.0 means whole image.</param>
207 /// <returns>Handle to the loaded PixelBuffer object or an empty handle in case loading failed.</returns>
208 /// <exception cref="ArgumentNullException"> Thrown when size is null. </exception>
209 /// <since_tizen> 5 </since_tizen>
210 /// This will be released at Tizen.NET API Level 5. Therefore, currently this would be used as an in-house API.
211 [EditorBrowsable(EditorBrowsableState.Never)]
212 public static PixelBuffer LoadImageFromFile(string url, Size2D size)
216 throw new ArgumentNullException(nameof(size));
218 var uSize = new Uint16Pair((uint)size.Width, (uint)size.Height);
219 PixelBuffer ret = new PixelBuffer(Interop.ImageLoading.LoadImageFromFile(url, Uint16Pair.getCPtr(uSize)), true);
221 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
226 /// Hidden API (Inhouse API).
227 /// Using Uri class to provide safe sevice and secure API.
228 /// Load an image synchronously from local file.
230 /// <param name="uri">The URI of the image file to load.</param>
231 /// <param name="size">The width and height to fit the loaded image to, 0.0 means whole image.</param>
232 /// <returns>Handle to the loaded PixelBuffer object or an empty handle in case loading failed.</returns>
233 /// <exception cref="ArgumentNullException"> Thrown when size is null. </exception>
234 /// <exception cref="ArgumentNullException">Thrown when uri is null.</exception>
235 [EditorBrowsable(EditorBrowsableState.Never)]
236 public static PixelBuffer LoadImageFromFile(Uri uri, Size2D size)
240 throw new ArgumentNullException(nameof(size));
244 throw new ArgumentNullException(nameof(uri));
247 var uSize = new Uint16Pair((uint)size.Width, (uint)size.Height);
248 PixelBuffer ret = new PixelBuffer(Interop.ImageLoading.LoadImageFromFile(uri.AbsoluteUri, Uint16Pair.getCPtr(uSize)), true);
250 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
255 /// Load an image synchronously from local file.
257 /// <param name="url">The URL of the image file to load.</param>
258 /// <returns>Handle to the loaded PixelBuffer object or an empty handle in case loading failed.</returns>
259 /// <since_tizen> 5 </since_tizen>
260 /// This will be released at Tizen.NET API Level 5. Therefore, currently this would be used as an in-house API.
261 [EditorBrowsable(EditorBrowsableState.Never)]
262 public static PixelBuffer LoadImageFromFile(string url)
264 PixelBuffer ret = new PixelBuffer(Interop.ImageLoading.LoadImageFromFile(url), true);
265 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
270 /// Hidden API (Inhouse API).
271 /// Using Uri class to provide safe sevice and secure API.
272 /// Load an image synchronously from local file.
274 /// <param name="uri">The URI of the image file to load.</param>
275 /// <returns>Handle to the loaded PixelBuffer object or an empty handle in case loading failed.</returns>
276 /// <exception cref="ArgumentNullException">Thrown when uri is null.</exception>
277 [EditorBrowsable(EditorBrowsableState.Never)]
278 public static PixelBuffer LoadImageFromFile(Uri uri)
282 throw new ArgumentNullException(nameof(uri));
285 PixelBuffer ret = new PixelBuffer(Interop.ImageLoading.LoadImageFromFile(uri.AbsoluteUri), true);
286 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
291 /// Determine the size of an image that LoadImageFromFile will provide when given the same image loading parameters.
293 /// <param name="filename">The name of the image.</param>
294 /// <param name="size">The requested size for the image.</param>
295 /// <param name="fittingMode">The method to use to map the source image to the desired dimensions.</param>
296 /// <param name="samplingMode">The image filter to use if the image needs to be downsampled to the requested size.</param>
297 /// <param name="orientationCorrection">Whether to use image metadata to rotate or flip the image, for example, from portrait to landscape.</param>
298 /// <returns>Dimensions that image will have if it is loaded with given parameters.</returns>
299 /// <exception cref="ArgumentNullException"> Thrown when size is null. </exception>
300 /// <since_tizen> 5 </since_tizen>
301 /// This will be released at Tizen.NET API Level 5. Therefore, currently this would be used as an in-house API.
302 [EditorBrowsable(EditorBrowsableState.Never)]
303 public static Size2D GetClosestImageSize(string filename, Size2D size, FittingModeType fittingMode, SamplingModeType samplingMode, bool orientationCorrection)
307 throw new ArgumentNullException(nameof(size));
309 var uSize = new Uint16Pair((uint)size.Width, (uint)size.Height);
310 var val = new Uint16Pair(Interop.ImageLoading.GetClosestImageSize(filename, Uint16Pair.getCPtr(uSize), (int)fittingMode, (int)samplingMode, orientationCorrection), true);
311 Size2D ret = new Size2D(val.GetWidth(), val.GetHeight());
314 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
319 /// Determine the size of an image that LoadImageFromFile will provide when given the same image loading parameters.
321 /// <param name="filename">The name of the image.</param>
322 /// <param name="size">The requested size for the image</param>
323 /// <param name="fittingMode">The method to use to map the source image to the desired dimensions.</param>
324 /// <param name="samplingMode">The image filter to use if the image needs to be downsampled to the requested size.</param>
325 /// <returns>Dimensions that image will have if it is loaded with given parameters.</returns>
326 /// <exception cref="ArgumentNullException"> Thrown when size is null. </exception>
327 /// <since_tizen> 5 </since_tizen>
328 /// This will be released at Tizen.NET API Level 5. Therefore, currently this would be used as an in-house API.
329 [EditorBrowsable(EditorBrowsableState.Never)]
330 public static Size2D GetClosestImageSize(string filename, Size2D size, FittingModeType fittingMode, SamplingModeType samplingMode)
334 throw new ArgumentNullException(nameof(size));
336 var uSize = new Uint16Pair((uint)size.Width, (uint)size.Height);
337 var val = new Uint16Pair(Interop.ImageLoading.GetClosestImageSize(filename, Uint16Pair.getCPtr(uSize), (int)fittingMode, (int)samplingMode), true);
338 Size2D ret = new Size2D(val.GetWidth(), val.GetHeight());
341 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
346 /// Determine the size of an image that LoadImageFromFile will provide when given the same image loading parameters.
348 /// <param name="filename">The name of the image.</param>
349 /// <param name="size">The requested size for the image</param>
350 /// <param name="fittingMode">The method to use to map the source image to the desired dimensions.</param>
351 /// <returns>Dimensions that image will have if it is loaded with given parameters.</returns>
352 /// <exception cref="ArgumentNullException"> Thrown when size is null. </exception>
353 /// <since_tizen> 5 </since_tizen>
354 /// This will be released at Tizen.NET API Level 5. Therefore, currently this would be used as an in-house API.
355 [EditorBrowsable(EditorBrowsableState.Never)]
356 public static Size2D GetClosestImageSize(string filename, Size2D size, FittingModeType fittingMode)
360 throw new ArgumentNullException(nameof(size));
362 var uSize = new Uint16Pair((uint)size.Width, (uint)size.Height);
363 var val = new Uint16Pair(Interop.ImageLoading.GetClosestImageSize(filename, Uint16Pair.getCPtr(uSize), (int)fittingMode), true);
364 Size2D ret = new Size2D(val.GetWidth(), val.GetHeight());
367 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
372 /// Determine the size of an image that LoadImageFromFile will provide when given the same image loading parameters.
374 /// <param name="filename">The name of the image.</param>
375 /// <param name="size">The requested size for the image</param>
376 /// <returns>Dimensions that image will have if it is loaded with given parameters.</returns>
377 /// <exception cref="ArgumentNullException"> Thrown when size is null. </exception>
378 /// <since_tizen> 5 </since_tizen>
379 /// This will be released at Tizen.NET API Level 5. Therefore, currently this would be used as an in-house API.
380 [EditorBrowsable(EditorBrowsableState.Never)]
381 public static Size2D GetClosestImageSize(string filename, Size2D size)
385 throw new ArgumentNullException(nameof(size));
387 var uSize = new Uint16Pair((uint)size.Width, (uint)size.Height);
388 var val = new Uint16Pair(Interop.ImageLoading.GetClosestImageSize(filename, Uint16Pair.getCPtr(uSize)), true);
389 Size2D ret = new Size2D(val.GetWidth(), val.GetHeight());
392 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
397 /// Determine the size of an image that LoadImageFromFile will provide when given the same image loading parameters.
399 /// <param name="filename">The name of the image.</param>
400 /// <returns>Dimensions that image will have if it is loaded with given parameters.</returns>
401 /// <since_tizen> 5 </since_tizen>
402 /// This will be released at Tizen.NET API Level 5. Therefore, currently this would be used as an in-house API.
403 [EditorBrowsable(EditorBrowsableState.Never)]
404 public static Size2D GetClosestImageSize(string filename)
406 var val = new Uint16Pair(Interop.ImageLoading.GetClosestImageSize(filename), true);
407 Size2D ret = new Size2D(val.GetWidth(), val.GetHeight());
409 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
414 /// Get the size of an original image
416 /// <param name="filename">The name of the image.</param>
417 /// <returns>Dimension of the original image.</returns>
418 /// <since_tizen> 5 </since_tizen>
419 /// This will be released at Tizen.NET API Level 5. Therefore, currently this would be used as an in-house API.
420 [EditorBrowsable(EditorBrowsableState.Never)]
421 public static Size2D GetOriginalImageSize(string filename)
423 var val = new Uint16Pair(Interop.ImageLoading.GetOriginalImageSize(filename), true);
424 Size2D ret = new Size2D(val.GetWidth(), val.GetHeight());
426 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
431 /// Load an image synchronously from a remote resource.
433 /// <param name="url">The URL of the image file to load.</param>
434 /// <param name="size">The width and height to fit the loaded image to, 0.0 means whole image.</param>
435 /// <param name="fittingMode">The method used to fit the shape of the image before loading to the shape defined by the size parameter.</param>
436 /// <param name="samplingMode">The filtering method used when sampling pixels from the input image while fitting it to desired size.</param>
437 /// <param name="orientationCorrection">Reorient the image to respect any orientation metadata in its header.</param>
438 /// <returns>Handle to the loaded PixelBuffer object or an empty handle in case downloading or decoding failed.</returns>
439 /// <exception cref="ArgumentNullException"> Thrown when size is null. </exception>
440 /// <since_tizen> 5 </since_tizen>
441 /// This will be released at Tizen.NET API Level 5. Therefore, currently this would be used as an in-house API.
442 [EditorBrowsable(EditorBrowsableState.Never)]
443 public static PixelBuffer DownloadImageSynchronously(string url, Size2D size, FittingModeType fittingMode, SamplingModeType samplingMode, bool orientationCorrection)
447 throw new ArgumentNullException(nameof(size));
449 var uSize = new Uint16Pair((uint)size.Width, (uint)size.Height);
450 PixelBuffer ret = new PixelBuffer(Interop.ImageLoading.DownloadImageSynchronously(url, Uint16Pair.getCPtr(uSize), (int)fittingMode, (int)samplingMode, orientationCorrection), true);
452 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
457 /// Hidden API (Inhouse API).
458 /// Using Uri class to provide safe sevice and secure API.
459 /// Load an image synchronously from a remote resource.
461 /// <param name="uri">The URI of the image file to load.</param>
462 /// <param name="size">The width and height to fit the loaded image to, 0.0 means whole image.</param>
463 /// <param name="fittingMode">The method used to fit the shape of the image before loading to the shape defined by the size parameter.</param>
464 /// <param name="samplingMode">The filtering method used when sampling pixels from the input image while fitting it to desired size.</param>
465 /// <param name="orientationCorrection">Reorient the image to respect any orientation metadata in its header.</param>
466 /// <returns>Handle to the loaded PixelBuffer object or an empty handle in case downloading or decoding failed.</returns>
467 /// <exception cref="ArgumentNullException"> Thrown when size is null. </exception>
468 /// <exception cref="ArgumentNullException">Thrown when uri is null.</exception>
469 [EditorBrowsable(EditorBrowsableState.Never)]
470 public static PixelBuffer DownloadImageSynchronously(Uri uri, Size2D size, FittingModeType fittingMode, SamplingModeType samplingMode, bool orientationCorrection)
474 throw new ArgumentNullException(nameof(size));
478 throw new ArgumentNullException(nameof(uri));
481 var uSize = new Uint16Pair((uint)size.Width, (uint)size.Height);
482 PixelBuffer ret = new PixelBuffer(Interop.ImageLoading.DownloadImageSynchronously(uri.AbsoluteUri, Uint16Pair.getCPtr(uSize), (int)fittingMode, (int)samplingMode, orientationCorrection), true);
483 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
490 /// Load an image synchronously from a remote resource.
492 /// <param name="url">The URL of the image file to load.</param>
493 /// <param name="size">The width and height to fit the loaded image to, 0.0 means whole image.</param>
494 /// <param name="fittingMode">The method used to fit the shape of the image before loading to the shape defined by the size parameter.</param>
495 /// <param name="samplingMode">The filtering method used when sampling pixels from the input image while fitting it to desired size.</param>
496 /// <returns>Handle to the loaded PixelBuffer object or an empty handle in case downloading or decoding failed.</returns>
497 /// <exception cref="ArgumentNullException"> Thrown when size is null. </exception>
498 /// <since_tizen> 5 </since_tizen>
499 /// This will be released at Tizen.NET API Level 5. Therefore, currently this would be used as an in-house API.
500 [EditorBrowsable(EditorBrowsableState.Never)]
501 public static PixelBuffer DownloadImageSynchronously(string url, Size2D size, FittingModeType fittingMode, SamplingModeType samplingMode)
505 throw new ArgumentNullException(nameof(size));
507 var uSize = new Uint16Pair((uint)size.Width, (uint)size.Height);
508 PixelBuffer ret = new PixelBuffer(Interop.ImageLoading.DownloadImageSynchronously(url, Uint16Pair.getCPtr(uSize), (int)fittingMode, (int)samplingMode), true);
510 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
515 /// Hidden API (Inhouse API).
516 /// Using Uri class to provide safe sevice and secure API.
517 /// Load an image synchronously from a remote resource.
519 /// <param name="uri">The URI of the image file to load.</param>
520 /// <param name="size">The width and height to fit the loaded image to, 0.0 means whole image.</param>
521 /// <param name="fittingMode">The method used to fit the shape of the image before loading to the shape defined by the size parameter.</param>
522 /// <param name="samplingMode">The filtering method used when sampling pixels from the input image while fitting it to desired size.</param>
523 /// <returns>Handle to the loaded PixelBuffer object or an empty handle in case downloading or decoding failed.</returns>
524 /// <exception cref="ArgumentNullException"> Thrown when size is null. </exception>
525 /// <exception cref="ArgumentNullException">Thrown when uri is null.</exception>
526 [EditorBrowsable(EditorBrowsableState.Never)]
527 public static PixelBuffer DownloadImageSynchronously(Uri uri, Size2D size, FittingModeType fittingMode, SamplingModeType samplingMode)
531 throw new ArgumentNullException(nameof(size));
535 throw new ArgumentNullException(nameof(uri));
538 var uSize = new Uint16Pair((uint)size.Width, (uint)size.Height);
539 PixelBuffer ret = new PixelBuffer(Interop.ImageLoading.DownloadImageSynchronously(uri.AbsoluteUri, Uint16Pair.getCPtr(uSize), (int)fittingMode, (int)samplingMode), true);
541 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
546 /// Load an image synchronously from a remote resource.
548 /// <param name="url">The URL of the image file to load.</param>
549 /// <param name="size">The width and height to fit the loaded image to, 0.0 means whole image.</param>
550 /// <param name="fittingMode">The method used to fit the shape of the image before loading to the shape defined by the size parameter.</param>
551 /// <returns>Handle to the loaded PixelBuffer object or an empty handle in case downloading or decoding failed.</returns>
552 /// <exception cref="ArgumentNullException"> Thrown when size is null. </exception>
553 /// <since_tizen> 5 </since_tizen>
554 /// This will be released at Tizen.NET API Level 5. Therefore, currently this would be used as an in-house API.
555 [EditorBrowsable(EditorBrowsableState.Never)]
556 public static PixelBuffer DownloadImageSynchronously(string url, Size2D size, FittingModeType fittingMode)
560 throw new ArgumentNullException(nameof(size));
562 var uSize = new Uint16Pair((uint)size.Width, (uint)size.Height);
563 PixelBuffer ret = new PixelBuffer(Interop.ImageLoading.DownloadImageSynchronously(url, Uint16Pair.getCPtr(uSize), (int)fittingMode), true);
565 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
570 /// Hidden API (Inhouse API).
571 /// Using Uri class to provide safe sevice and secure API.
572 /// Load an image synchronously from a remote resource.
574 /// <param name="uri">The URI of the image file to load.</param>
575 /// <param name="size">The width and height to fit the loaded image to, 0.0 means whole image.</param>
576 /// <param name="fittingMode">The method used to fit the shape of the image before loading to the shape defined by the size parameter.</param>
577 /// <returns>Handle to the loaded PixelBuffer object or an empty handle in case downloading or decoding failed.</returns>
578 /// <exception cref="ArgumentNullException"> Thrown when size is null. </exception>
579 /// <exception cref="ArgumentNullException">Thrown when uri is null.</exception>
580 [EditorBrowsable(EditorBrowsableState.Never)]
581 public static PixelBuffer DownloadImageSynchronously(Uri uri, Size2D size, FittingModeType fittingMode)
585 throw new ArgumentNullException(nameof(size));
589 throw new ArgumentNullException(nameof(uri));
592 var uSize = new Uint16Pair((uint)size.Width, (uint)size.Height);
593 PixelBuffer ret = new PixelBuffer(Interop.ImageLoading.DownloadImageSynchronously(uri.AbsoluteUri, Uint16Pair.getCPtr(uSize), (int)fittingMode), true);
595 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
600 /// Load an image synchronously from a remote resource.
602 /// <param name="url">The URL of the image file to load.</param>
603 /// <param name="size">The width and height to fit the loaded image to, 0.0 means whole image.</param>
604 /// <returns>Handle to the loaded PixelBuffer object or an empty handle in case downloading or decoding failed.</returns>
605 /// <exception cref="ArgumentNullException"> Thrown when size is null. </exception>
606 /// <since_tizen> 5 </since_tizen>
607 /// This will be released at Tizen.NET API Level 5. Therefore, currently this would be used as an in-house API.
608 [EditorBrowsable(EditorBrowsableState.Never)]
609 public static PixelBuffer DownloadImageSynchronously(string url, Size2D size)
613 throw new ArgumentNullException(nameof(size));
615 var uSize = new Uint16Pair((uint)size.Width, (uint)size.Height);
616 PixelBuffer ret = new PixelBuffer(Interop.ImageLoading.DownloadImageSynchronously(url, Uint16Pair.getCPtr(uSize)), true);
618 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
623 /// Hidden API (Inhouse API).
624 /// Using Uri class to provide safe sevice and secure API.
625 /// Load an image synchronously from a remote resource.
627 /// <param name="uri">The URI of the image file to load.</param>
628 /// <param name="size">The width and height to fit the loaded image to, 0.0 means whole image.</param>
629 /// <returns>Handle to the loaded PixelBuffer object or an empty handle in case downloading or decoding failed.</returns>
630 /// <exception cref="ArgumentNullException"> Thrown when size is null. </exception>
631 /// <exception cref="ArgumentNullException">Thrown when uri is null.</exception>
632 [EditorBrowsable(EditorBrowsableState.Never)]
633 public static PixelBuffer DownloadImageSynchronously(Uri uri, Size2D size)
637 throw new ArgumentNullException(nameof(size));
641 throw new ArgumentNullException(nameof(uri));
644 var uSize = new Uint16Pair((uint)size.Width, (uint)size.Height);
645 PixelBuffer ret = new PixelBuffer(Interop.ImageLoading.DownloadImageSynchronously(uri.AbsoluteUri, Uint16Pair.getCPtr(uSize)), true);
647 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
652 /// Load an image synchronously from a remote resource.
654 /// <param name="url">The URL of the image file to load.</param>
655 /// <returns>Handle to the loaded PixelBuffer object or an empty handle in case downloading or decoding failed.</returns>
656 /// <since_tizen> 5 </since_tizen>
657 /// This will be released at Tizen.NET API Level 5. Therefore, currently this would be used as an in-house API.
658 [EditorBrowsable(EditorBrowsableState.Never)]
659 public static PixelBuffer DownloadImageSynchronously(string url)
661 PixelBuffer ret = new PixelBuffer(Interop.ImageLoading.DownloadImageSynchronously(url), true);
662 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
667 /// Hidden API (Inhouse API).
668 /// Using Uri class to provide safe sevice and secure API.
669 /// Load an image synchronously from a remote resource.
671 /// <param name="uri">The URI of the image file to load.</param>
672 /// <returns>Handle to the loaded PixelBuffer object or an empty handle in case downloading or decoding failed.</returns>
673 /// <exception cref="ArgumentNullException">Thrown when uri is null.</exception>
674 [EditorBrowsable(EditorBrowsableState.Never)]
675 public static PixelBuffer DownloadImageSynchronously(Uri uri)
679 throw new ArgumentNullException(nameof(uri));
682 PixelBuffer ret = new PixelBuffer(Interop.ImageLoading.DownloadImageSynchronously(uri.AbsoluteUri), true);
683 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();