[MediaContent] Removed BurstShort related apis
[platform/core/csapi/tizenfx.git] / src / Tizen.Content.MediaContent / Tizen.Content.MediaContent / ImageInfo.cs
1 /*
2  * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16
17 using System;
18 using System.Diagnostics;
19
20 namespace Tizen.Content.MediaContent
21 {
22     /// <summary>
23     /// Represents the image media stored in the device.
24     /// </summary>
25     public class ImageInfo : MediaInfo
26     {
27         internal ImageInfo(Interop.MediaInfoHandle handle) : base(handle)
28         {
29             IntPtr imageHandle = IntPtr.Zero;
30
31             try
32             {
33                 Interop.MediaInfo.GetImage(handle, out imageHandle).ThrowIfError("Failed to retrieve data");
34
35                 Debug.Assert(imageHandle != IntPtr.Zero);
36
37                 Width = InteropHelper.GetValue<int>(imageHandle, Interop.ImageInfo.GetWidth);
38                 Height = InteropHelper.GetValue<int>(imageHandle, Interop.ImageInfo.GetHeight);
39
40                 Orientation = InteropHelper.GetValue<Orientation>(imageHandle, Interop.ImageInfo.GetOrientation);
41
42                 DateTaken = InteropHelper.GetString(imageHandle, Interop.ImageInfo.GetDateTaken);
43                 ExposureTime = InteropHelper.GetString(imageHandle, Interop.ImageInfo.GetExposureTime);
44
45                 FNumber = InteropHelper.GetValue<double>(imageHandle, Interop.ImageInfo.GetFNumber);
46                 Iso = InteropHelper.GetValue<int>(imageHandle, Interop.ImageInfo.GetISO);
47
48                 Model = InteropHelper.GetString(imageHandle, Interop.ImageInfo.GetModel);
49
50             }
51             finally
52             {
53                 Interop.ImageInfo.Destroy(imageHandle);
54             }
55         }
56
57         /// <summary>
58         /// Gets the image width in pixels.
59         /// </summary>
60         /// <value>The image width in pixels.</value>
61         public int Width { get; }
62
63         /// <summary>
64         /// Gets the image height in pixels.
65         /// </summary>
66         /// <value>The image height in pixels.</value>
67         public int Height { get; }
68
69         /// <summary>
70         /// Gets the orientation of image.
71         /// </summary>
72         /// <value>The orientation of image.</value>
73         public Orientation Orientation { get; }
74
75         /// <summary>
76         /// Gets the date of the creation time as a formatted string.
77         /// </summary>
78         /// <value>The date of the creation time as a formatted string.</value>
79         public string DateTaken { get; }
80
81         /// <summary>
82         /// Gets the exposure time from EXIF.
83         /// </summary>
84         /// <value>The exposure time from EXIF.</value>
85         public string ExposureTime { get; }
86
87         /// <summary>
88         /// Gets the FNumber from EXIF.
89         /// </summary>
90         /// <value>The FNumber from EXIF.</value>
91         public double FNumber { get; }
92
93         /// <summary>
94         /// Gets the ISO from EXIF.
95         /// </summary>
96         /// <value>The iso from EXIF.</value>
97         public int Iso { get; }
98
99         /// <summary>
100         /// Gets the model from EXIF.
101         /// </summary>
102         /// <value>The model from EXIF.</value>
103         public string Model { get; }
104     }
105 }