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 * #include <FContent.h>
53 * #include <FSystem.h>
55 * using namespace Tizen::Content;
58 * MyClass::TestImageMetadata(void)
60 * Tizen::Base::String contentPath = Tizen::System::Environment::GetMediaPath() + L"Images/full_meta.jpg";
61 * ImageMetadata* pImgMeta = ContentManagerUtil::GetImageMetaN(contentPath);
62 * result r = GetLastResult();
64 * pImgMeta->GetWidth();
65 * pImgMeta->GetHeight();
66 * pImgMeta->GetCameraManufacturer();
67 * pImgMeta->GetCameraModel();
68 * pImgMeta->GetSoftware();
69 * pImgMeta->GetDateTime();
71 * Tizen::Media::Image image;
72 * r = image.Construct();
74 * Tizen::Graphics::Bitmap* pBitmap = pImgMeta->GetThumbnailN();
75 * r = GetLastResult();
77 * Tizen::Base::String thumbnailPath = Tizen::System::Environment::GetMediaPath() + L"Images/image.bmp";
78 * r = image.EncodeToFile(*pBitmap, Tizen::Media::IMG_FORMAT_BMP, thumbnailPath, false);
87 class _OSP_EXPORT_ ImageMetadata
88 : virtual public Tizen::Base::Object
92 * This is the default constructor for this class.
99 * Copying of objects using this copy constructor is allowed.
103 * @param[in] rhs An instance of %ImageMetadata to copy
105 ImageMetadata(const ImageMetadata& rhs);
108 * This destructor overrides Tizen::Base::Object::~Object().
112 virtual ~ImageMetadata(void);
115 * Gets the width of the image.
119 * @return The width of the image
121 int GetWidth(void) const;
124 * Gets the height of the image.
128 * @return The height of the image
130 int GetHeight(void) const;
133 * Gets the name of the camera's manufacturer.
137 * @return The name of the camera's manufacturer
139 Tizen::Base::String GetCameraManufacturer(void) const;
142 * Gets the model of the camera.
146 * @return The model of the camera
148 Tizen::Base::String GetCameraModel(void) const;
151 * Gets the version of either the software or the firmware of the camera or the image input device
152 * used to generate the image.
156 * @return The version of either the software or the firmware of the camera or the image input device
157 * used to generate the image
159 Tizen::Base::String GetSoftware(void) const;
162 * Gets the date and time of the created content.
166 * @return The date and time of the created content
168 Tizen::Base::String GetDateTime(void) const;
171 * Gets the latitude of the image.
175 * @return The latitude of the image
176 * @remarks If there is no latitude in the image, @c -200.0 is returned.
178 double GetLatitude(void) const;
181 * Gets the longitude of the image.
185 * @return The longitude of the image
186 * @remarks If there is no longitude in the image, @c -200.0 is returned.
188 double GetLongitude(void) const;
191 * Gets the orientation of the image.
195 * @return The orientation of the image
197 ImageOrientationType GetOrientation(void) const;
200 * Gets the white balance of the image.
204 * @return The white balance of the image
206 Tizen::Base::String GetWhiteBalance(void) const;
209 * Gets the thumbnail image.
213 * @return A pointer to the thumbnail image
214 * @exception E_SUCCESS The method is successful.
215 * @exception E_DATA_NOT_FOUND The thumbnail image does not exist.
216 * @exception E_OUT_OF_MEMORY The memory is insufficient.
217 * @remarks The specific error code can be accessed using the GetLastResult() method.
219 Tizen::Graphics::Bitmap* GetThumbnailN(void) const;
222 * Compares the equality of the values between the two %ImageMetadata objects by overriding the Tizen::Base::Object::Equals() method.
226 * @return @c true if all the fields in the objects are equal, @n
228 * @param[in] rhs The Tizen::Base::Object with which the comparison is done @n
229 * An instance of Tizen::Graphics::Bitmap is not taken into account in the comparisons.
231 virtual bool Equals(const Tizen::Base::Object& rhs) const;
234 * Gets the hash value of the current instance by overriding the Tizen::Base::Object::GetHashCode() method.
238 * @return The hash value of the current instance
240 virtual int GetHashCode(void) const;
243 * Copying of objects using this copy assignment operator is allowed.
247 * @return A reference to this instance
248 * @param[in] rhs An instance of %ImageMetadata to copy
250 ImageMetadata& operator =(const ImageMetadata& rhs);
253 friend class _ImageMetadataImpl;
254 _ImageMetadataImpl* __pImpl;
256 }; // class ImageMetadata
260 #endif // _FCNT_IMAGE_METADATA_H_