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 ExposureTime = InteropHelper.GetString(imageHandle, Interop.ImageInfo.GetExposureTime);
45 FNumber = InteropHelper.GetValue<double>(imageHandle, Interop.ImageInfo.GetFNumber);
46 Iso = InteropHelper.GetValue<int>(imageHandle, Interop.ImageInfo.GetISO);
48 Model = InteropHelper.GetString(imageHandle, Interop.ImageInfo.GetModel);
53 Interop.ImageInfo.Destroy(imageHandle);
58 /// Gets the image width in pixels.
60 /// <value>The image width in pixels.</value>
61 public int Width { get; }
64 /// Gets the image height in pixels.
66 /// <value>The image height in pixels.</value>
67 public int Height { get; }
70 /// Gets the orientation of image.
72 /// <value>The orientation of image.</value>
73 public Orientation Orientation { get; }
76 /// Gets the date of the creation time as a formatted string.
78 /// <value>The date of the creation time as a formatted string.</value>
79 public string DateTaken { get; }
82 /// Gets the exposure time from EXIF.
84 /// <value>The exposure time from EXIF.</value>
85 public string ExposureTime { get; }
88 /// Gets the FNumber from EXIF.
90 /// <value>The FNumber from EXIF.</value>
91 public double FNumber { get; }
94 /// Gets the ISO from EXIF.
96 /// <value>The iso from EXIF.</value>
97 public int Iso { get; }
100 /// Gets the model from EXIF.
102 /// <value>The model from EXIF.</value>
103 public string Model { get; }