merge commits of 2.2.1 to public
[platform/framework/native/image.git] / inc / FMediaImageBuffer.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 //
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
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0
10 //
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.
16 //
17
18 /**
19  * @file   FMediaImageBuffer.h
20  * @brief  This is the header file for the %ImageBuffer class.
21  *
22  * This header file contains the declarations of the %ImageBuffer class.
23  */
24
25 #ifndef _FMEDIA_IMAGEBUFFER_H_
26 #define _FMEDIA_IMAGEBUFFER_H_
27
28 #include <FMediaImage.h>
29
30 namespace Tizen { namespace Media
31 {
32 /**
33  * @class  ImageBuffer
34  * @brief  This class is used for handling decoded image data.
35  *
36  * @since 2.0
37  * @remarks The minimum dimension for JPEG encoding is 16x16 and for PNG encoding is 8x8.
38  *
39  * The %ImageBuffer class is used for handling decoded image data, including image decoding and encoding.
40  *
41  * The following example demonstrates how to use the %ImageBuffer class to decode and encode images.
42  *
43  * @code
44 #include <FMedia.h>
45 #include <FApp.h>
46
47 using namespace Tizen::Base;
48 using namespace Tizen::Media;
49
50 result
51 TestImageBuffer(void)
52 {
53         result r = E_SUCCESS;
54         ImageBuffer img;
55
56         // Constructs an image buffer instance with an image file
57         r = img.Construct(Tizen::App::App::GetInstance()->GetAppRootPath() + L"data/test.bmp");
58         if (IsFailed(r))
59         {
60                 return r;
61         }
62         // Encodes the image buffer into compressed data
63         r = img.EncodeToFile(Tizen::App::App::GetInstance()->GetAppRootPath()+L"data/test.jpg", IMG_FORMAT_JPG, true, 70);
64
65         return r;
66 }
67  * @endcode
68  */
69
70 class _OSP_EXPORT_ ImageBuffer
71         : public Tizen::Base::Object
72 {
73 public:
74         /**
75         * This is the default constructor for this class. @n
76         * The object is not fully constructed after this constructor is called.
77         * For full construction, the Construct() method must be called right after
78         * calling this constructor.
79         *
80         * @since 2.0
81         *
82         * @see    Construct()
83         */
84         ImageBuffer(void);
85
86         /**
87         * This is the destructor for this class. @n
88         * This destructor overrides Tizen::Base::Object::~Object().
89         *
90         * @since 2.0
91         *
92         * @see    Construct()
93         */
94         virtual ~ImageBuffer(void);
95
96         /**
97         * Initializes this instance of %ImageBuffer with the specified parameters.
98         *
99         * @since 2.0
100         *
101         * @return     An error code
102         * @param[in]  width                 The width of the image
103         * @param[in]  height                The height of the image
104         * @param[in]  pixelFormat           The pixel format of the image should be one of the values returned by the GetSupportedPixelFormatListN() method
105         * @param[in]  pData                 The raw pixel data of the image @n 
106         *                                                                       If this value is not @c null, it is copied into the internal buffer of this instance, and the size of the data must be specified, @n
107         *                                                                       else the default color data is filled.
108         * @param[in]  length                The size of the data @n
109         *                                                                       This value must be set if @c pData is not @c null.
110         * @exception  E_SUCCESS             The method is successful.
111         * @exception  E_INVALID_ARG         A specified input parameter is invalid.
112         * @exception  E_UNSUPPORTED_FORMAT  The specified @c pixelFormat is not supported.
113         * @exception  E_OUT_OF_MEMORY       The memory is insufficient.
114         * @remarks    There is a high probability for an occurrence of an out-of-memory exception. If possible, check whether the exception is @c E_OUT_OF_MEMORY or not.
115         *             For more information on how to handle the out-of-memory exception, refer <a href="../org.tizen.native.appprogramming/html/basics_tizen_programming/exception_check.htm">here</a>.
116         * @see GetSupportedPixelFormatListN()
117         */
118         result Construct(int width, int height, MediaPixelFormat pixelFormat, const byte* pData = null, int length = 0);
119
120         /**
121         * Initializes this instance of %ImageBuffer with the decoded data of the given image path.
122         *
123         * @since 2.0
124         *
125         * @return     An error code
126         * @param[in]  srcImagePath          The source image path
127         * @param[in]  pDecodingRegion       The region that is decoded @n 
128         *                                                                       If @c pDecodingRegion is @c null, then the whole image is decoded.
129         * @param[in]  autoRotate            If @c true then the image is rotated automatically before decoding based on the EXIF orientation tag @n
130         *                                   If @c false then the image is decoded without rotation.
131         * @exception  E_SUCCESS             The method is successful.
132         * @exception  E_INVALID_ARG         A specified input parameter is invalid.
133         * @exception  E_UNSUPPORTED_FORMAT  The specified format is not supported.
134         * @exception  E_OVERFLOW            The specified input instance exceeds the maximum supported file size or dimension.
135         * @exception  E_OUT_OF_MEMORY       The memory is insufficient.
136         * @exception  E_FILE_NOT_FOUND      The specified file cannot be found or accessed.
137         * @remarks    There is a high probability for an occurrence of an out-of-memory exception. If possible, check whether the exception is @c E_OUT_OF_MEMORY or not.
138         *             For more information on how to handle the out-of-memory exception, refer <a href="../org.tizen.native.appprogramming/html/basics_tizen_programming/exception_check.htm">here</a>.
139         */
140         result Construct(const Tizen::Base::String &srcImagePath, const Tizen::Graphics::Rectangle *pDecodingRegion = null, bool autoRotate = true);
141
142         /**
143         * Initializes this instance of %ImageBuffer with the decoded data of the given image buffer.
144         *
145         * @since 2.0
146         *
147         * @return     An error code
148         * @param[in]  srcImageBuf           The buffer that contains the compressed image data
149         * @param[in]  pDecodingRegion       The region that is decoded @n
150         *                                                                       If @c pDecodingRegion is @c null, then the whole image is decoded.
151         * @param[in]  autoRotate            If @c true then the image is rotated automatically before decoding based on the EXIF orientation tag @n
152         *                                   If @c false the image is decoded without rotation.
153         * @exception  E_SUCCESS             The method is successful.
154         * @exception  E_INVALID_ARG         A specified input parameter is invalid.
155         * @exception  E_UNSUPPORTED_FORMAT  The specified format is not supported.
156         * @exception  E_OVERFLOW            The specified input instance exceeds the maximum supported file size or dimension.
157         * @exception  E_OUT_OF_MEMORY       The memory is insufficient.
158         * @remarks    There is a high probability for an occurrence of an out-of-memory exception. If possible, check whether the exception is @c E_OUT_OF_MEMORY or not.
159         *             For more information on how to handle the out-of-memory exception, refer <a href="../org.tizen.native.appprogramming/html/basics_tizen_programming/exception_check.htm">here</a>.
160         */
161         result Construct(const Tizen::Base::ByteBuffer &srcImageBuf, const Tizen::Graphics::Rectangle *pDecodingRegion = null, bool autoRotate = true);
162
163         /**
164         * Initializes this instance of %ImageBuffer with the given bitmap data. @n
165         * The %Construct() method copies the raw RGB data from the @c srcBitmap,
166         * so the dimension of this instance can be different from that of @c srcBitmap, if @c srcBitmap is an auto-scaled bitmap.
167         *
168         * @since 2.0
169         *
170         * @return     An error code
171         * @param[in]  srcBitmap             The source bitmap data
172         * @exception  E_SUCCESS             The method is successful.
173         * @exception  E_INVALID_ARG         The specified input parameter is invalid.
174         * @exception  E_OVERFLOW            The specified input instance exceeds the maximum supported file size or dimension.
175         * @exception  E_OUT_OF_MEMORY       The memory is insufficient.
176         */
177         result Construct(const Tizen::Graphics::Bitmap &srcBitmap);
178
179         /**
180         * Initializes this instance of %ImageBuffer that is decoded using the given image path data, with the specified parameters.
181         *
182         * @since 2.1
183         *
184         * @return     An error code
185         * @param[in]  srcImagePath          The source image path
186         * @param[in]  destWidth             The intended width of the image
187         * @param[in]  destHeight            The intended height of the image
188         * @param[in]  scalingMethod         The scaling method
189         * @exception  E_SUCCESS             The method is successful.
190         * @exception  E_INVALID_ARG         A specified input parameter is invalid.
191         * @exception  E_UNSUPPORTED_FORMAT  The specified format is not supported.
192         * @exception  E_OUT_OF_MEMORY       The memory is insufficient.
193         * @exception  E_FILE_NOT_FOUND      The specified file cannot be found or accessed.
194         * @remarks
195         *           - There is a high probability for an occurrence of an out-of-memory exception. If possible, check whether the exception is @c E_OUT_OF_MEMORY or not.
196         *             For more information on how to handle the out-of-memory exception, refer <a href="../org.tizen.native.appprogramming/html/basics_tizen_programming/exception_check.htm">here</a>.
197         *           - This method does not retain the aspect ratio of the original image.
198         */
199         result Construct(const Tizen::Base::String &srcImagePath, int destWidth, int destHeight, ImageScalingMethod scalingMethod);
200
201         /**
202         * Initializes this instance of %ImageBuffer that is decoded using the given image buffer data, with the specified parameters.
203         *
204         * @since 2.1
205         *
206         * @return     An error code
207         * @param[in]  srcImageBuf           The buffer that contains the compressed image data
208         * @param[in]  destWidth             The intended width of the image
209         * @param[in]  destHeight            The intended height of the image
210         * @param[in]  scalingMethod         The scaling method
211         * @exception  E_SUCCESS             The method is successful.
212         * @exception  E_INVALID_ARG         A specified input parameter is invalid.
213         * @exception  E_UNSUPPORTED_FORMAT  The specified format is not supported.
214         * @exception  E_OUT_OF_MEMORY       The memory is insufficient.
215         * @remarks
216         *           - There is a high probability for an occurrence of an out-of-memory exception. If possible, check whether the exception is @c E_OUT_OF_MEMORY or not.
217         *             For more information on how to handle the out-of-memory exception, refer <a href="../org.tizen.native.appprogramming/html/basics_tizen_programming/exception_check.htm">here</a>.
218         *           - This method does not retain the aspect ratio of the original image.
219         */
220         result Construct(const Tizen::Base::ByteBuffer &srcImageBuf, int destWidth, int destHeight, ImageScalingMethod scalingMethod);
221
222         /**
223         * Gets the current exif orientation of the image data. @n
224         * If automatic rotation is enabled during the Construct() method then the orientation is reset to the default value.
225         *
226         * @since 2.1
227         *
228         * @return The orientation information of the current image data
229         */
230         ExifOrientation GetExifOrientation(void) const;
231
232
233         /**
234         * Compares the specified Tizen::Base::Object instance with the current %ImageBuffer instance.
235         *
236         * @since 2.0
237         *
238         * @return     @c true if the value of @c rhs matches the value of the current %ImageBuffer instance, @n
239         *             else @c false
240         * @param[in]  rhs   A reference to the Tizen::Base::Object instance that is compared with the current %ImageBuffer instance
241         * @see        Tizen::Base::Object::Equals()
242         */
243         virtual bool Equals(const Object& rhs) const;
244
245         /**
246         * Gets the hash value of the current instance by overriding the %GetHashCode() method in the Tizen::Base::Object class.
247         *
248         * @since 2.0
249         *
250         * @return  The hash value of the current instance
251         */
252         virtual int GetHashCode(void) const;
253
254         /**
255         * Gets the height of the image buffer.
256         *
257         * @since 2.0
258         *
259         * @return  The height of the image buffer
260         */
261         int GetHeight(void) const;
262
263         /**
264         * Gets the width of the image buffer.
265         *
266         * @since 2.0
267         *
268         * @return  The width of the image buffer
269         */
270         int GetWidth(void) const;
271
272         /**
273         * Gets the current pixel format.
274         *
275         * @since 2.0
276         *
277         * @return  The pixel format of the media
278         */
279         MediaPixelFormat GetPixelFormat(void) const;
280
281         /**
282         * Encodes the data of this instance into the byte buffer. @n
283         * The supported encoding formats are JPEG, BMP, and PNG.
284         *
285         * @since 2.0
286         *
287         * @return     A pointer to the Tizen::Base::ByteBuffer instance that contains the encoded image data
288         * @param[in]  destImageFormat       The intended image format
289         * @param[in]  quality               The encoding quality @n
290         *                                   The valid range for this parameter is @c 1 to @c 100.
291         * @exception  E_SUCCESS             The method is successful.
292         * @exception  E_OUT_OF_RANGE        A specified input parameter is out of the valid range.
293         * @exception  E_UNSUPPORTED_FORMAT  The specified format is not supported.
294         * @exception  E_OUT_OF_MEMORY       The memory is insufficient.
295         * @remarks    The specific error code can be accessed using the GetLastResult() method.
296         */
297         Tizen::Base::ByteBuffer* EncodeToBufferN(ImageFormat destImageFormat, int quality = 90) const;
298
299         /**
300         * Encodes the data of this instance into the file. @n
301         * The supported encoding formats are JPEG, BMP, and PNG.
302         *
303         * @since 2.0
304         *
305         * @return     An error code
306         * @param[in]  destImagePath         The intended name of the encoded image file
307         * @param[in]  destImageFormat       The intended image format
308         * @param[in]  overwrite             Set to @c true to overwrite the file, @n
309         *                                   else @c false
310         * @param[in]  quality               The encoding quality @n
311         *                                   The valid range for this parameter is @c 1 to @c 100.
312         * @exception  E_SUCCESS             The method is successful.
313         * @exception  E_UNSUPPORTED_FORMAT  The specified format is not supported.
314         * @exception  E_OUT_OF_MEMORY       The memory is insufficient.
315         * @exception  E_ILLEGAL_ACCESS      The specified file cannot be found or accessed.
316         * @exception  E_FILE_ALREADY_EXIST  The specified file already exists and the value of @c overwrite is @c false.
317         * @exception  E_OUT_OF_RANGE        A specified input parameter is out of the valid range.
318         * @remarks    The application should use the Tizen::Content::ContentManager::CreateContent() method to register the created file into the Contents database.
319         */
320         result EncodeToFile(const Tizen::Base::String &destImagePath, ImageFormat destImageFormat, bool overwrite, int quality = 90) const;
321
322         /**
323         * Gets an instance of Tizen::Graphics::Bitmap with the data of this instance.
324         *
325         * @since 2.0
326         *
327         * @return     A pointer to the Tizen::Graphics::Bitmap instance
328         * @param[in]  pixelFormat           The bitmap pixel format
329         * @param[in]  bufferScaling         The buffer scaling type
330         * @exception  E_SUCCESS             The method is successful.
331         * @exception  E_INVALID_ARG         A specified input parameter is invalid.
332         * @exception  E_UNSUPPORTED_FORMAT  The specified format is not supported.
333         * @exception  E_OUT_OF_MEMORY       The memory is insufficient.
334         * @remarks    The specific error code can be accessed using the GetLastResult() method.
335         */
336         Tizen::Graphics::Bitmap* GetBitmapN(Tizen::Graphics::BitmapPixelFormat pixelFormat, Tizen::Graphics::BufferScaling bufferScaling) const;
337
338         /**
339         * Gets an instance of Tizen::Graphics::Bitmap with the data of this instance after resizing it as per the specified width and height.
340         *
341         * @since 2.1
342         *
343         * @return     A pointer to the Tizen::Graphics::Bitmap instance with the specified destination width and height
344         * @param[in]  pixelFormat           The bitmap pixel format
345         * @param[in]  destWidth             The intended width of the image
346         * @param[in]  destHeight            The intended height of the image
347         * @exception  E_SUCCESS             The method is successful.
348         * @exception  E_INVALID_ARG         A specified input parameter is invalid.
349         * @exception  E_UNSUPPORTED_FORMAT  The specified format is not supported.
350         * @exception  E_OUT_OF_MEMORY       The memory is insufficient.
351         * @remarks
352         *           - The specific error code can be accessed using the GetLastResult() method.
353         *           - This method returns an auto-scaled bitmap to support the logical coordinate system,
354         *             so the actual dimension of the returned bitmap can vary depending on the physical dimension of the target device.
355         */
356         Tizen::Graphics::Bitmap* GetBitmapN(Tizen::Graphics::BitmapPixelFormat pixelFormat, float destWidth, float destHeight) const;
357
358         /**
359         * Gets an instance of Tizen::Base::ByteBuffer with the data of this instance.
360         *
361         * @since 2.0
362         *
363         * @return     A pointer to the Tizen::Base::ByteBuffer instance
364         * @param[in]  pixelFormat           The pixel format
365         * @exception  E_SUCCESS             The method is successful.
366         * @exception  E_INVALID_ARG         The specified input parameter is invalid.
367         * @exception  E_UNSUPPORTED_FORMAT  The specified format is not supported.
368         * @exception  E_OUT_OF_MEMORY       The memory is insufficient.
369         * @remarks    The specific error code can be accessed using the GetLastResult() method.
370         * @see GetSupportedPixelFormatListN()
371         */
372         Tizen::Base::ByteBuffer* GetByteBufferN(MediaPixelFormat pixelFormat) const;
373
374         /**
375         * Creates and returns a copy of the %ImageBuffer instance.
376         *
377         * @since 2.0
378         *
379         * @return     A copy of the %ImageBuffer instance
380         * @exception  E_SUCCESS             The method is successful.
381         * @exception  E_OUT_OF_MEMORY       The memory is insufficient.
382         * @remarks    The specific error code can be accessed using the GetLastResult() method.
383         */
384         virtual ImageBuffer* CloneN(void) const;
385
386         /**
387         * Gets a new %ImageBuffer with the converted pixel format of the current image data.
388         *
389         * @since 2.0
390         *
391         * @return     A pointer to the %ImageBuffer instance that contains the %ImageBuffer which is converted to the specified MediaPixelFormat
392         * @param[in]  pixelFormat           The pixel format for the returned %ImageBuffer
393         * @exception  E_SUCCESS             The method is successful.
394         * @exception  E_UNSUPPORTED_FORMAT  The specified format is not supported.
395         * @exception  E_INVALID_DATA        The current data is invalid for this operation. @n
396         *                                   This happens when the @c width or @c height is not an even value,
397         *                                   and the requested pixel format is a sub-sampled pixel format like @c MEDIA_PIXEL_FORMAT_YUV420P.
398         * @remarks
399         *           - The specific error code can be accessed using the GetLastResult() method.
400         *           - There is a high probability for an occurrence of an out-of-memory exception. If possible, check whether the exception is @c E_OUT_OF_MEMORY or not.
401         *             For more information on how to handle the out-of-memory exception, refer <a href="../org.tizen.native.appprogramming/html/basics_tizen_programming/exception_check.htm">here</a>.
402         */
403         ImageBuffer* ConvertPixelFormatN(MediaPixelFormat pixelFormat) const;
404
405         /**
406         * Gets the resized %ImageBuffer with the current image data. @n
407         * The aspect ratio of the data is not preserved.
408         *
409         * @since 2.0
410         *
411         * @return     A pointer to the %ImageBuffer instance that contains the resized image data
412         * @param[in]  width                 The width of the destination image
413         * @param[in]  height                The height of the destination image
414         * @exception  E_SUCCESS             The method is successful.
415         * @exception  E_OUT_OF_RANGE        A specified input parameter is out of the valid range.
416         * @exception  E_OUT_OF_MEMORY       The memory is insufficient.
417         * @exception  E_INVALID_DATA        The current data is invalid for this operation. @n
418         *                                   This happens when the current pixel format is a sub-sampled pixel format like @c MEDIA_PIXEL_FORMAT_YUV420P,
419         *                                   and the requested @c width or @c height is not an even value.
420         * @remarks
421         *           - The specific error code can be accessed using the GetLastResult() method.
422         *           - There is a high probability for an occurrence of an out-of-memory exception. If possible, check whether the exception is @c E_OUT_OF_MEMORY or not.
423         *             For more information on how to handle the out-of-memory exception, refer <a href="../org.tizen.native.appprogramming/html/basics_tizen_programming/exception_check.htm">here</a>.
424         */
425         ImageBuffer* ResizeN(int width, int height) const;
426
427         /**
428         * Gets a horizontally or vertically flipped image from the current instance.
429         *
430         * @since 2.0
431         *
432         * @return     A pointer to the %ImageBuffer instance that contains the flipped image data
433         * @param[in]  flipType              The flip type
434         * @exception  E_SUCCESS             The method is successful.
435         * @exception  E_INVALID_ARG         The specified input parameter is invalid.
436         * @exception  E_OUT_OF_MEMORY       The memory is insufficient.
437         * @remarks
438         *           - The specific error code can be accessed using the GetLastResult() method.
439         *           - There is a high probability for an occurrence of an out-of-memory exception. If possible, check whether the exception is @c E_OUT_OF_MEMORY or not.
440         *             For more information on how to handle the out-of-memory exception, refer <a href="../org.tizen.native.appprogramming/html/basics_tizen_programming/exception_check.htm">here</a>.
441         */
442         ImageBuffer* FlipN(ImageFlipType flipType) const;
443
444         /**
445         * Rotates the image in the clockwise direction.
446         *
447         * @since 2.0
448         *
449         * @return     A pointer to the %ImageBuffer instance that contains the rotated image data
450         * @param[in]  rotateType            The rotation type
451         * @exception  E_SUCCESS             The method is successful.
452         * @exception  E_INVALID_ARG         The specified input parameter is invalid.
453         * @exception  E_INVALID_DATA        The current data is invalid for this operation. @n
454         *                                   This happens when the current pixel format is a sub-sampled pixel format like @c MEDIA_PIXEL_FORMAT_YUYV422,
455         *                                   the height is an odd value, and the requested rotation type is @c IMAGE_ROTATION_90 or @c IMAGE_ROTATION_270.
456         * @exception  E_OUT_OF_MEMORY           The memory is insufficient.
457         * @remarks
458         *           - The specific error code can be accessed using the GetLastResult() method.
459         *           - There is a high probability for an occurrence of an out-of-memory exception. If possible, check whether the exception is @c E_OUT_OF_MEMORY or not.
460         *             For more information on how to handle the out-of-memory exception, refer <a href="../org.tizen.native.appprogramming/html/basics_tizen_programming/exception_check.htm">here</a>.
461         */
462         ImageBuffer* RotateN(ImageRotationType rotateType) const;
463
464         /**
465         * Crops the region of the current %ImageBuffer instance.
466         *
467         * @since 2.0
468         *
469         * @return     A pointer to the %ImageBuffer instance that contains the cropped image data 
470         * @param[in]  x                     The x position
471         * @param[in]  y                     The y position
472         * @param[in]  width                 The width of the destination image
473         * @param[in]  height                The height of the destination image
474         * @exception  E_SUCCESS             The method is successful.
475         * @exception  E_OUT_OF_RANGE        A specified input parameter is out of the valid range.
476         * @exception  E_INVALID_DATA        The current data is invalid for this operation. @n
477         *                                   This happens when the current pixel format is a sub-sampled pixel format like @c MEDIA_PIXEL_FORMAT_YUV420P,
478         *                                   and the requested @c x, @c y, @c width, or @c height is not an even value.
479         * @remarks
480         *           - The specific error code can be accessed using the GetLastResult() method.
481         *           - There is a high probability for an occurrence of an out-of-memory exception. If possible, check whether the exception is @c E_OUT_OF_MEMORY or not.
482         *             For more information on how to handle the out-of-memory exception, refer <a href="../org.tizen.native.appprogramming/html/basics_tizen_programming/exception_check.htm">here</a>.
483         */
484         ImageBuffer* CropN(int x, int y, int width, int height) const;
485
486         /**
487         * Gets the image information.
488         *
489         * @since 2.0
490         *
491         * @return         An error code
492         * @param[in]  srcImagePath          The source image path
493         * @param[out] imageFormat           The format of the image
494         * @param[out] width                 The width of the image
495         * @param[out] height                The height of the image
496         * @exception  E_SUCCESS             The method is successful.
497         * @exception  E_UNSUPPORTED_FORMAT  The specified format is not supported.
498         * @exception  E_OUT_OF_MEMORY       The memory is insufficient.
499         * @exception  E_FILE_NOT_FOUND      The specified file cannot be found or accessed.
500         * @exception  E_SYSTEM              A system error has occurred.
501         */
502         static result GetImageInfo(const Tizen::Base::String& srcImagePath, ImageFormat &imageFormat, int &width, int &height);
503
504         /**
505         * Gets the image information.
506         *
507         * @since 2.0
508         *
509         * @return          An error code
510         * @param[in]   srcImageBuf           The buffer that contains the compressed image data
511         * @param[out]  imageFormat           The format of the image
512         * @param[out]  width                 The width of the image
513         * @param[out]  height                The height of the image
514         * @exception   E_SUCCESS             The method is successful.
515         * @exception   E_UNSUPPORTED_FORMAT  The specified format is not supported.
516         * @exception   E_OUT_OF_MEMORY       The memory is insufficient.
517         * @exception   E_SYSTEM              A system error has occurred.
518         */
519         static result GetImageInfo(const Tizen::Base::ByteBuffer& srcImageBuf, ImageFormat &imageFormat, int &width, int &height);
520
521         /**
522         * Gets the list of supported pixel formats.
523         *
524         * @since 2.0
525         *
526         * @return     The list of supported pixel formats, @n
527         *             else @c null if an exception occurs
528         * @exception  E_SUCCESS             The method is successful.
529         * @exception  E_OUT_OF_MEMORY       The memory is insufficient.
530         * @exception  E_SYSTEM              A system error has occurred.
531         * @remarks    The specific error code can be accessed using the GetLastResult() method.
532         * @see  Construct()
533         * @see  GetByteBufferN()
534         */
535         static Tizen::Base::Collection::IListT<MediaPixelFormat>* GetSupportedPixelFormatListN(void);
536
537 private:
538
539         /**
540         * The implementation of this copy constructor is intentionally blank
541         * and declared as private to prohibit copying of objects.
542         */
543         ImageBuffer(const ImageBuffer& rhs);
544
545         /**
546         * The implementation of this copy assignment operator is intentionally blank
547         * and declared as private to prohibit copying of objects.
548         * Use CloneN() to get an exact copy of this instance.
549         * Use Equals() to compare contents of one instance with the other.
550         */
551         ImageBuffer& operator =(const ImageBuffer& rhs);
552
553         friend class _ImageBufferImpl;
554         class _ImageBufferImpl* __pImpl;
555
556 };
557
558 }} // Tizen::Media
559 #endif // _FMEDIA_IMAGEBUFFER_H_