2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
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.
17 * @file FCntImageMetadata.h
18 * @brief This is the header file for the %ImageMetadata class.
20 * This header file contains the declarations of the %ImageMetadata class.
23 #ifndef _FCNT_IMAGE_METADATA_H_
24 #define _FCNT_IMAGE_METADATA_H_
26 #include <FBaseObject.h>
27 #include <FCntTypes.h>
29 namespace Tizen { namespace Graphics
34 namespace Tizen { namespace Content
37 class _ImageMetadataImpl;
40 * @class ImageMetadata
41 * @brief This class provides methods to access the image metadata.
45 * The %ImageMetadata class provides methods to access the image metadata that contains the image content-specific attributes.
47 * The following example demonstrates how to use the %ImageMetadata class.
51 * MyClass::TestImageMetadata(void)
53 * result r = E_SUCCESS;
55 * Tizen::Base::String contentPath = Tizen::System::Environment::GetMediaPath() + L"Images/full_meta.jpg";
56 * ImageMetadata* pImgMeta = ContentManagerUtil::GetImageMetaN(contentPath);
57 * TryReturn(pImgMeta != null, GetLastResult(), "ContentManagerUtil::GetImageMetaN failed.");
60 * pImgMeta->GetWidth();
63 * pImgMeta->GetHeight();
66 * pImgMeta->GetCameraManufacturer();
69 * pImgMeta->GetCameraModel();
72 * pImgMeta->GetSoftware();
75 * pImgMeta->GetDateTime();
78 * Tizen::Media::Image image;
79 * r = image.Construct();
86 * Tizen::Graphics::Bitmap* pBitmap = pImgMeta->GetThumbnailN();
87 * if (pBitmap == null)
90 * return GetLastResult();
93 * Tizen::Base::String thumbnailPath = Tizen::System::Environment::GetMediaPath() + L"Images/image.bmp";
94 * r = image.EncodeToFile(*pBitmap, Tizen::Media::IMG_FORMAT_BMP, thumbnailPath, false);
109 class _OSP_EXPORT_ ImageMetadata
110 : virtual public Tizen::Base::Object
114 * This is the default constructor for this class.
121 * Copying of objects using this copy constructor is allowed.
125 * @param[in] rhs An instance of %ImageMetadata
127 ImageMetadata(const ImageMetadata& rhs);
130 * This destructor overrides Tizen::Base::Object::~Object().
134 virtual ~ImageMetadata(void);
137 * Gets the width of the image.
141 * @return The width of the image
143 int GetWidth(void) const;
146 * Gets the height of the image.
150 * @return The height of the image
152 int GetHeight(void) const;
155 * Gets the name of the camera's manufacturer.
159 * @return The name of the camera's manufacturer
161 Tizen::Base::String GetCameraManufacturer(void) const;
164 * Gets the model of the camera.
168 * @return The model of the camera
170 Tizen::Base::String GetCameraModel(void) const;
173 * Gets the version of either the software or the firmware of the camera or the image input device
174 * used to generate the image.
178 * @return The version of either the software or the firmware of the camera or the image input device
179 * used to generate the image
181 Tizen::Base::String GetSoftware(void) const;
184 * Gets the date and time of the created content.
188 * @return The date and time of the created content
190 Tizen::Base::String GetDateTime(void) const;
193 * Gets the latitude of the image.
197 * @return The latitude of the image
198 * @remarks If there is no latitude in the image, @c -200.0 is returned.
200 double GetLatitude(void) const;
203 * Gets the longitude of the image.
207 * @return The longitude of the image
208 * @remarks If there is no longitude in the image, @c -200.0 is returned.
210 double GetLongitude(void) const;
213 * Gets the orientation of the image.
217 * @return The orientation of the image
219 ImageOrientationType GetOrientation(void) const;
222 * Gets the white balance of the image.
226 * @return The white balance of the image
228 Tizen::Base::String GetWhiteBalance(void) const;
231 * Gets the thumbnail image.
235 * @return A pointer to the thumbnail image
236 * @exception E_SUCCESS The method is successful.
237 * @exception E_DATA_NOT_FOUND The thumbnail image does not exist.
238 * @exception E_OUT_OF_MEMORY The memory is insufficient.
239 * @remarks The specific error code can be accessed using the GetLastResult() method.
241 Tizen::Graphics::Bitmap* GetThumbnailN(void) const;
244 * Compares the equality of values between two %ImageMetadata objects by overriding the Tizen::Base::Object::Equals() method.
248 * @return @c true if all the fields in the objects are equal, @n
250 * @param[in] rhs The Tizen::Base::Object with which the comparison is done
251 * @remarks An instance of Tizen::Graphics::Bitmap is not taken into account in the comparisons.
253 virtual bool Equals(const Tizen::Base::Object& rhs) const;
256 * Gets the hash value of the current instance by overriding the Tizen::Base::Object::GetHashCode() method.
260 * @return The hash value of the current instance
262 virtual int GetHashCode(void) const;
265 * Copying of objects using this copy assignment operator is allowed.
269 * @return A reference to this instance
270 * @param[in] rhs An instance of %ImageMetadata
272 ImageMetadata& operator =(const ImageMetadata& rhs);
275 friend class _ImageMetadataImpl;
276 _ImageMetadataImpl* __pImpl;
278 }; // class ImageMetadata
282 #endif // _FCNT_IMAGE_METADATA_H_