2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://www.apache.org/licenses/LICENSE-2.0
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
18 * @file FCntImageMetadata.h
19 * @brief This is the header file for the %ImageMetadata class.
21 * This header file contains the declarations of the %ImageMetadata class.
24 #ifndef _FCNT_IMAGE_METADATA_H_
25 #define _FCNT_IMAGE_METADATA_H_
27 #include <FBaseObject.h>
28 #include <FCntTypes.h>
30 namespace Tizen { namespace Graphics
35 namespace Tizen { namespace Content
38 class _ImageMetadataImpl;
41 * @class ImageMetadata
42 * @brief This class provides methods to access the image metadata.
46 * The %ImageMetadata class provides methods to access the image metadata that contains the image content-specific attributes.
48 * The following example demonstrates how to use the %ImageMetadata class.
52 * MyClass::TestImageMetadata(void)
54 * result r = E_SUCCESS;
56 * Tizen::Base::String contentPath = Tizen::System::Environment::GetMediaPath() + L"Images/full_meta.jpg";
57 * ImageMetadata* pImgMeta = ContentManagerUtil::GetImageMetaN(contentPath);
58 * TryReturn(pImgMeta != null, GetLastResult(), "ContentManagerUtil::GetImageMetaN failed.");
61 * pImgMeta->GetWidth();
64 * pImgMeta->GetHeight();
67 * pImgMeta->GetCameraManufacturer();
70 * pImgMeta->GetCameraModel();
73 * pImgMeta->GetSoftware();
76 * pImgMeta->GetDateTime();
79 * Tizen::Media::Image image;
80 * r = image.Construct();
87 * Tizen::Graphics::Bitmap* pBitmap = pImgMeta->GetThumbnailN();
88 * if (pBitmap == null)
91 * return GetLastResult();
94 * Tizen::Base::String thumbnailPath = Tizen::System::Environment::GetMediaPath() + L"Images/image.bmp";
95 * r = image.EncodeToFile(*pBitmap, Tizen::Media::IMG_FORMAT_BMP, thumbnailPath, false);
110 class _OSP_EXPORT_ ImageMetadata
111 : virtual public Tizen::Base::Object
115 * This is the default constructor for this class.
122 * Copying of objects using this copy constructor is allowed.
126 * @param[in] rhs An instance of %ImageMetadata
128 ImageMetadata(const ImageMetadata& rhs);
131 * This destructor overrides Tizen::Base::Object::~Object().
135 virtual ~ImageMetadata(void);
138 * Gets the width of the image.
142 * @return The width of the image
144 int GetWidth(void) const;
147 * Gets the height of the image.
151 * @return The height of the image
153 int GetHeight(void) const;
156 * Gets the name of the camera's manufacturer.
160 * @return The name of the camera's manufacturer
162 Tizen::Base::String GetCameraManufacturer(void) const;
165 * Gets the model of the camera.
169 * @return The model of the camera
171 Tizen::Base::String GetCameraModel(void) const;
174 * Gets the version of either the software or the firmware of the camera or the image input device
175 * used to generate the image.
179 * @return The version of either the software or the firmware of the camera or the image input device
180 * used to generate the image
182 Tizen::Base::String GetSoftware(void) const;
185 * Gets the date and time of the created content.
189 * @return The date and time of the created content
191 Tizen::Base::String GetDateTime(void) const;
194 * Gets the latitude of the image.
198 * @return The latitude of the image
199 * @remarks If there is no latitude in the image, @c -200.0 is returned.
201 double GetLatitude(void) const;
204 * Gets the longitude of the image.
208 * @return The longitude of the image
209 * @remarks If there is no longitude in the image, @c -200.0 is returned.
211 double GetLongitude(void) const;
214 * Gets the orientation of the image.
218 * @return The orientation of the image
220 ImageOrientationType GetOrientation(void) const;
223 * Gets the white balance of the image.
227 * @return The white balance of the image
229 Tizen::Base::String GetWhiteBalance(void) const;
232 * Gets the thumbnail image.
236 * @return A pointer to the thumbnail image
237 * @exception E_SUCCESS The method is successful.
238 * @exception E_DATA_NOT_FOUND The thumbnail image does not exist.
239 * @exception E_OUT_OF_MEMORY The memory is insufficient.
240 * @remarks The specific error code can be accessed using the GetLastResult() method.
242 Tizen::Graphics::Bitmap* GetThumbnailN(void) const;
245 * Compares the equality of values between two %ImageMetadata objects by overriding the Tizen::Base::Object::Equals() method.
249 * @return @c true if all the fields in the objects are equal, @n
251 * @param[in] rhs The Tizen::Base::Object with which the comparison is done
252 * @remarks An instance of Tizen::Graphics::Bitmap is not taken into account in the comparisons.
254 virtual bool Equals(const Tizen::Base::Object& rhs) const;
257 * Gets the hash value of the current instance by overriding the Tizen::Base::Object::GetHashCode() method.
261 * @return The hash value of the current instance
263 virtual int GetHashCode(void) const;
266 * Copying of objects using this copy assignment operator is allowed.
270 * @return A reference to this instance
271 * @param[in] rhs An instance of %ImageMetadata
273 ImageMetadata& operator =(const ImageMetadata& rhs);
276 friend class _ImageMetadataImpl;
277 _ImageMetadataImpl* __pImpl;
279 }; // class ImageMetadata
283 #endif // _FCNT_IMAGE_METADATA_H_