2 * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
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.Diagnostics;
20 namespace Tizen.Content.MediaContent
23 /// Represents the image media stored in the device.
25 /// <since_tizen> 4 </since_tizen>
26 public class ImageInfo : MediaInfo
28 internal ImageInfo(Interop.MediaInfoHandle handle) : base(handle)
30 IntPtr imageHandle = IntPtr.Zero;
34 Interop.MediaInfo.GetImage(handle, out imageHandle).ThrowIfError("Failed to retrieve data");
36 Debug.Assert(imageHandle != IntPtr.Zero);
38 Width = InteropHelper.GetValue<int>(imageHandle, Interop.ImageInfo.GetWidth);
39 Height = InteropHelper.GetValue<int>(imageHandle, Interop.ImageInfo.GetHeight);
41 Orientation = InteropHelper.GetValue<Orientation>(imageHandle, Interop.ImageInfo.GetOrientation);
43 DateTaken = InteropHelper.GetString(imageHandle, Interop.ImageInfo.GetDateTaken);
44 ExposureTime = InteropHelper.GetString(imageHandle, Interop.ImageInfo.GetExposureTime);
46 FNumber = InteropHelper.GetValue<double>(imageHandle, Interop.ImageInfo.GetFNumber);
47 Iso = InteropHelper.GetValue<int>(imageHandle, Interop.ImageInfo.GetISO);
49 Model = InteropHelper.GetString(imageHandle, Interop.ImageInfo.GetModel);
54 Interop.ImageInfo.Destroy(imageHandle);
59 /// Gets the image width in pixels.
61 /// <value>The image width in pixels.</value>
62 /// <since_tizen> 4 </since_tizen>
63 public int Width { get; }
66 /// Gets the image height in pixels.
68 /// <value>The image height in pixels.</value>
69 /// <since_tizen> 4 </since_tizen>
70 public int Height { get; }
73 /// Gets the orientation of image.
75 /// <value>The orientation of image.</value>
76 /// <since_tizen> 4 </since_tizen>
77 public Orientation Orientation { get; }
80 /// Gets the date of the creation time as a formatted string.
82 /// <value>The date of the creation time as a formatted string.</value>
83 /// <since_tizen> 4 </since_tizen>
84 public string DateTaken { get; }
87 /// Gets the exposure time from EXIF.
89 /// <value>The exposure time from EXIF.</value>
90 /// <since_tizen> 4 </since_tizen>
91 [Obsolete("Deprecated since API11. Will be removed in API13.")]
92 public string ExposureTime { get; }
95 /// Gets the FNumber from EXIF.
97 /// <value>The FNumber from EXIF.</value>
98 /// <since_tizen> 4 </since_tizen>
99 [Obsolete("Deprecated since API11. Will be removed in API13.")]
100 public double FNumber { get; }
103 /// Gets the ISO from EXIF.
105 /// <value>The iso from EXIF.</value>
106 /// <since_tizen> 4 </since_tizen>
107 [Obsolete("Deprecated since API11. Will be removed in API13.")]
108 public int Iso { get; }
111 /// Gets the model from EXIF.
113 /// <value>The model from EXIF.</value>
114 /// <since_tizen> 4 </since_tizen>
115 [Obsolete("Deprecated since API11. Will be removed in API13.")]
116 public string Model { get; }