[MediaContent] Deprecate unused APIs (#5473)
[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     /// <since_tizen> 4 </since_tizen>
26     public class ImageInfo : MediaInfo
27     {
28         internal ImageInfo(Interop.MediaInfoHandle handle) : base(handle)
29         {
30             IntPtr imageHandle = IntPtr.Zero;
31
32             try
33             {
34                 Interop.MediaInfo.GetImage(handle, out imageHandle).ThrowIfError("Failed to retrieve data");
35
36                 Debug.Assert(imageHandle != IntPtr.Zero);
37
38                 Width = InteropHelper.GetValue<int>(imageHandle, Interop.ImageInfo.GetWidth);
39                 Height = InteropHelper.GetValue<int>(imageHandle, Interop.ImageInfo.GetHeight);
40
41                 Orientation = InteropHelper.GetValue<Orientation>(imageHandle, Interop.ImageInfo.GetOrientation);
42
43                 DateTaken = InteropHelper.GetString(imageHandle, Interop.ImageInfo.GetDateTaken);
44                 ExposureTime = InteropHelper.GetString(imageHandle, Interop.ImageInfo.GetExposureTime);
45
46                 FNumber = InteropHelper.GetValue<double>(imageHandle, Interop.ImageInfo.GetFNumber);
47                 Iso = InteropHelper.GetValue<int>(imageHandle, Interop.ImageInfo.GetISO);
48
49                 Model = InteropHelper.GetString(imageHandle, Interop.ImageInfo.GetModel);
50
51             }
52             finally
53             {
54                 Interop.ImageInfo.Destroy(imageHandle);
55             }
56         }
57
58         /// <summary>
59         /// Gets the image width in pixels.
60         /// </summary>
61         /// <value>The image width in pixels.</value>
62         /// <since_tizen> 4 </since_tizen>
63         public int Width { get; }
64
65         /// <summary>
66         /// Gets the image height in pixels.
67         /// </summary>
68         /// <value>The image height in pixels.</value>
69         /// <since_tizen> 4 </since_tizen>
70         public int Height { get; }
71
72         /// <summary>
73         /// Gets the orientation of image.
74         /// </summary>
75         /// <value>The orientation of image.</value>
76         /// <since_tizen> 4 </since_tizen>
77         public Orientation Orientation { get; }
78
79         /// <summary>
80         /// Gets the date of the creation time as a formatted string.
81         /// </summary>
82         /// <value>The date of the creation time as a formatted string.</value>
83         /// <since_tizen> 4 </since_tizen>
84         public string DateTaken { get; }
85
86         /// <summary>
87         /// Gets the exposure time from EXIF.
88         /// </summary>
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; }
93
94         /// <summary>
95         /// Gets the FNumber from EXIF.
96         /// </summary>
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; }
101
102         /// <summary>
103         /// Gets the ISO from EXIF.
104         /// </summary>
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; }
109
110         /// <summary>
111         /// Gets the model from EXIF.
112         /// </summary>
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; }
117     }
118 }