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 public class ImageInfo : MediaInfo
27 internal ImageInfo(Interop.MediaInfoHandle handle) : base(handle)
29 IntPtr imageHandle = IntPtr.Zero;
33 Interop.MediaInfo.GetImage(handle, out imageHandle).ThrowIfError("Failed to retrieve data");
35 Debug.Assert(imageHandle != IntPtr.Zero);
37 Width = InteropHelper.GetValue<int>(imageHandle, Interop.ImageInfo.GetWidth);
38 Height = InteropHelper.GetValue<int>(imageHandle, Interop.ImageInfo.GetHeight);
40 Orientation = InteropHelper.GetValue<Orientation>(imageHandle, Interop.ImageInfo.GetOrientation);
42 DateTaken = InteropHelper.GetString(imageHandle, Interop.ImageInfo.GetDateTaken);
43 BurstId = InteropHelper.GetString(imageHandle, Interop.ImageInfo.GetBurstId);
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);
51 IsBurstShot = InteropHelper.GetValue<bool>(imageHandle, Interop.ImageInfo.IsBurstShot);
56 Interop.ImageInfo.Destroy(imageHandle);
61 /// Gets the image width in pixels.
63 /// <value>The image width in pixels.</value>
64 public int Width { get; }
67 /// Gets the image height in pixels.
69 /// <value>The image height in pixels.</value>
70 public int Height { get; }
73 /// Gets the orientation of image.
75 /// <value>The orientation of image.</value>
76 public Orientation Orientation { get; }
79 /// Gets the date of the creation time as a formatted string.
81 /// <value>The date of the creation time as a formatted string.</value>
82 public string DateTaken { get; }
85 /// Gets the burst shot ID.
87 /// <value>The burst shot ID if it is a burst shot, otherwise an empty string.</value>
88 /// <seealso cref="IsBurstShot"/>
89 public string BurstId { get; }
92 /// Gets the exposure time from EXIF.
94 /// <value>The exposure time from EXIF.</value>
95 public string ExposureTime { get; }
98 /// Gets the FNumber from EXIF.
100 /// <value>The FNumber from exif.</value>
101 public double FNumber { get; }
104 /// Gets the ISO from EXIF.
106 /// <value>The iso from EXIF.</value>
107 public int Iso { get; }
110 /// Gets the model from EXIF.
112 /// <value>The model from EXIF.</value>
113 public string Model { get; }
116 /// Gets the value indicating whether the media is a burst shot image.
118 /// <value>true if the media is a burst shot image, otherwise false.</value>
119 public bool IsBurstShot { get; }