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.
20 * @brief This is the header file for the %Image class.
22 * This header file contains the declarations of the %Image class.
25 #ifndef _FMEDIA_IMAGE_H_
26 #define _FMEDIA_IMAGE_H_
30 #include <FGraphics.h>
31 #include <FMediaImageTypes.h>
32 #include <FMediaIImageEventListener.h>
34 namespace Tizen { namespace Media
39 * @brief This class is used for handling images.
42 * @remarks The minimum dimension is 16x16 for JPEG encoding and 8x8 for PNG encoding.
44 * The %Image class is used for handling images, including image decoding, encoding, conversion, and JPEG compression. @n
46 * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/media/viewing_processing_still_images.htm">Viewing and Processing Still Images</a>. @n
47 * The following example demonstrates how to use the %Image class for image decoding and encoding.
53 #include <FGraphics.h>
57 using namespace Tizen::Base;
58 using namespace Tizen::Io;
59 using namespace Tizen::Graphics;
60 using namespace Tizen::Ui::Controls;
61 using namespace Tizen::Media;
64 : public Tizen::Ui::Controls::Form
67 result TestDecoding(void);
68 result TestEncoding(void);
72 ImageSample::TestDecoding(void)
76 Bitmap* pBitmap = null;
77 Canvas *pCanvas = null;
78 String filePath = Tizen::App::App::GetInstance()->GetAppRootPath() + L"data/test.jpg";
83 pBitmap = img.DecodeN(filePath, BITMAP_PIXEL_FORMAT_RGB565);
89 // Gets a Canvas instance
90 pCanvas = GetCanvasN();
96 pCanvas->DrawBitmap(Point(0,0), *pBitmap);
115 ImageSample::TestEncoding(void)
117 result r = E_SUCCESS;
119 Bitmap* pBitmap = null;
120 String filePath = Tizen::App::App::GetInstance()->GetAppRootPath() + L"data/test.jpg";
121 String dstPath = Tizen::App::App::GetInstance()->GetAppRootPath() + L"data/test_out.jpg";
125 pBitmap = img.DecodeN(filePath, BITMAP_PIXEL_FORMAT_RGB565);
131 r = img.EncodeToFile(*pBitmap, IMG_FORMAT_JPG, dstPath, true);
151 class _OSP_EXPORT_ Image
152 : public Tizen::Base::Object
157 * This is the default constructor for this class. @n
158 * The object is not fully constructed after this constructor is called.
159 * For full construction, the Construct() method must be called right after
160 * calling this constructor.
169 * This is the destructor for this class. @n
170 * This destructor overrides Tizen::Base::Object::~Object().
176 virtual ~Image(void);
180 * Initializes this instance of %Image.
184 * @return An error code
185 * @exception E_SUCCESS The method is successful.
186 * @exception E_OUT_OF_MEMORY The memory is insufficient.
187 * @exception E_SYSTEM A system error has occurred.
189 result Construct(void);
192 * Decodes an image file into the decoded bitmap container. @n
193 * The currently supported decoding formats are JPEG, GIF, PNG, BMP, TIFF, and WBMP. @n
194 * The %DecodeN() method retains the aspect ratio of the original image.
197 * @brief <i> [Compatibility] </i>
201 * @compatibility This method has compatibility issues with OSP compatible applications. @n
202 * For more information, see @ref CompIoPathPage "here".
205 * @return A decoded bitmap that is not resized
206 * @param[in] srcImagePath The local file path of the image file to open
207 * @param[in] pixelFormat The output pixel format defined by Tizen::Graphics::BitmapPixelFormat
208 * @exception E_SUCCESS The method is successful.
209 * @exception E_INVALID_ARG The specified pixel format is not supported.
210 * @exception E_INVALID_DATA The specified input instance has invalid data.
211 * @exception E_OVERFLOW The specified input instance has overflowed.
212 * @exception E_UNSUPPORTED_FORMAT The specified format is not supported.
213 * @exception E_OUT_OF_MEMORY The memory is insufficient.
214 * @exception E_FILE_NOT_FOUND The specified file cannot be found or accessed.
216 * - @c E_OUT_OF_MEMORY can be returned if there is no available memory when decoding a large image.
217 * - The specific error code can be accessed using the GetLastResult() method.
218 * - This method returns an auto-scaled bitmap, @n
219 * so the dimension can be different from the dimension of source image if the returned bitmap is locked.
221 Tizen::Graphics::Bitmap* DecodeN(const Tizen::Base::String& srcImagePath, Tizen::Graphics::BitmapPixelFormat pixelFormat) const;
224 * Decodes an image file into the decoded bitmap container after resizing it as per the specified width and height. @n
225 * The currently supported decoding formats are JPEG, GIF, PNG, BMP, TIFF, and WBMP. @n
226 * The %DecodeN() method retains the aspect ratio of the original image. @n
227 * It supports only the downscaling of an image.
230 * @brief <i> [Compatibility] </i>
234 * @compatibility This method has compatibility issues with OSP compatible applications. @n
235 * For more information, see @ref CompIoPathPage "here".
238 * @return A decoded bitmap data with the specified destination width and height
239 * @param[in] srcImagePath The local file path of the image file to open
240 * @param[in] pixelFormat The output pixel format defined by Tizen::Graphics::BitmapPixelFormat
241 * @param[in] destWidth The intended width of the image @n
242 * An exception is returned if the value is less than @c 0.
243 * @param[in] destHeight The intended height of the image @n
244 * An exception is returned if the value is less than @c 0.
245 * @exception E_SUCCESS The method is successful.
246 * @exception E_INVALID_ARG The specified pixel format is not supported.
247 * @exception E_INVALID_DATA The specified input instance has invalid data.
248 * @exception E_OVERFLOW The specified input instance has overflowed.
249 * @exception E_UNSUPPORTED_FORMAT The specified format is not supported.
250 * @exception E_OUT_OF_MEMORY The memory is insufficient.
251 * @exception E_FILE_NOT_FOUND The specified file cannot be found or accessed.
252 * @exception E_OUT_OF_RANGE The specified size is out of range.
254 * - The specific error code can be accessed using the GetLastResult() method.
255 * - This method returns an auto-scaled bitmap, @n
256 * so the dimension can be different from the requested dimension if the returned bitmap is locked.
258 Tizen::Graphics::Bitmap* DecodeN(const Tizen::Base::String& srcImagePath, Tizen::Graphics::BitmapPixelFormat pixelFormat, int destWidth, int destHeight) const;
261 * Decodes an image data into the decoded bitmap container after resizing it as per a specified width and height. @n
262 * The currently supported decoding formats are JPEG, GIF, PNG, BMP, TIFF, and WBMP. @n
263 * The %DecodeN() method retains the aspect ratio of the original image.
267 * @return A decoded bitmap data with the specified destination width and height
268 * @param[in] srcImageBuf The data to decode
269 * @param[in] pixelFormat The output pixel format defined by Tizen::Graphics::BitmapPixelFormat
270 * @param[in] destWidth The intended width of the image
271 * @param[in] destHeight The intended height of the image
272 * @exception E_SUCCESS The method is successful.
273 * @exception E_INVALID_DATA The specified input instance has invalid data.
274 * @exception E_INVALID_ARG The specified pixel format is not supported.
275 * @exception E_UNSUPPORTED_FORMAT The specified format is not supported.
276 * @exception E_OBJ_NOT_FOUND The specified image buffer cannot be found.
277 * @exception E_OUT_OF_MEMORY The memory is insufficient.
279 * - The specific error code can be accessed using the GetLastResult() method.
280 * - 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.
281 * 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>.
282 * - This method returns an auto-scaled bitmap to support logical coordinate system, so the actual dimension of the returned bitmap can vary depending on the physical dimension of the target device.
284 Tizen::Graphics::Bitmap* DecodeN(const Tizen::Base::ByteBuffer& srcImageBuf, Tizen::Graphics::BitmapPixelFormat pixelFormat, float destWidth, float destHeight) const;
287 * Decodes an image file into the decoded bitmap container after resizing it as per a specified width and height. @n
288 * The currently supported decoding formats are JPEG, GIF, PNG, BMP, TIFF, and WBMP. @n
289 * The %DecodeN() method retains the aspect ratio of the original image.
293 * @return A decoded bitmap data with the specified destination width and height
294 * @param[in] srcImagePath The local file path of the image file to open
295 * @param[in] pixelFormat The output pixel format defined by Tizen::Graphics::BitmapPixelFormat
296 * @param[in] destWidth The intended width of the image
297 * @param[in] destHeight The intended height of the image
298 * @exception E_SUCCESS The method is successful.
299 * @exception E_INVALID_ARG The specified pixel format is not supported.
300 * @exception E_INVALID_DATA The specified input instance has invalid data.
301 * @exception E_UNSUPPORTED_FORMAT The specified format is not supported.
302 * @exception E_OUT_OF_MEMORY The memory is insufficient.
303 * @exception E_FILE_NOT_FOUND The specified file cannot be found or accessed.
305 * - The specific error code can be accessed using the GetLastResult() method.
306 * - 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.
307 * 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>.
308 * - This method returns an auto-scaled bitmap to support logical coordinate system, so the actual dimension of the returned bitmap can vary depending on the physical dimension of the target device.
310 Tizen::Graphics::Bitmap* DecodeN(const Tizen::Base::String& srcImagePath, Tizen::Graphics::BitmapPixelFormat pixelFormat, float destWidth, float destHeight) const;
313 * Decodes an image data into the decoded bitmap as per the specified width and height. @n
314 * The currently supported decoding formats are JPEG, GIF, PNG, BMP, TIFF, and WBMP. @n
315 * The %DecodeUrl() method retains the aspect ratio of the original image. @n
316 * It supports only the downscaling of an image.
320 * @return An error code
321 * @param[in] srcImageUrl The URL of the remote image to decode
322 * @param[in] pixelFormat The output pixel format defined by Tizen::Graphics::BitmapPixelFormat
323 * @param[in] destWidth The intended width of the image @n
324 * An exception is returned if the value is less than @c 0.
325 * @param[in] destHeight The intended height of the image @n
326 * An exception is returned if the value is less than @c 0.
327 * @param[out] reqId The request ID
328 * @param[in] listener An instance of IImageDecodeUrlEventListener
329 * @param[in] timeout The timeout period in milliseconds @n
330 * Set to @c TIMEOUT_INFINITE to make the @c timeout period infinite.
331 * @exception E_SUCCESS The method is successful.
332 * @exception E_INVALID_DATA The specified input instance has invalid data.
333 * @exception E_INVALID_ARG The specified pixel format is not supported.
334 * @exception E_OUT_OF_RANGE The specified size is out of range.
335 * @exception E_OUT_OF_MEMORY The memory is insufficient.
336 * @exception E_NETWORK_FAILED The network is unavailable.
337 * @exception E_MAX_EXCEEDED The number of concurrent accesses to the URLs has reached the maximum limit.
339 * - The maximum limit for downloading is @c 3.
340 * - The supported protocol is HTTP.
342 result DecodeUrl(const Tizen::Base::Utility::Uri& srcImageUrl, Tizen::Graphics::BitmapPixelFormat pixelFormat, int destWidth, int destHeight, RequestId& reqId, const IImageDecodeUrlEventListener& listener, long timeout) const;
345 * Decodes an image data into the decoded bitmap container without resizing. @n
346 * The currently supported decoding formats are JPEG, GIF, PNG, BMP, TIFF, and WBMP. @n
347 * The %DecodeN() method retains the aspect ratio of the original image.
351 * @return A decoded bitmap data that has not been resized
352 * @param[in] srcImageBuf The data to decode
353 * @param[in] srcImageFormat The image format of the input file
354 * @param[in] pixelFormat The output pixel format defined by Tizen::Graphics::BitmapPixelFormat
355 * @exception E_SUCCESS The method is successful.
356 * @exception E_INVALID_DATA The specified input instance has invalid data.
357 * @exception E_INVALID_ARG The specified pixel format is not supported.
358 * @exception E_OVERFLOW The specified input instance has overflowed.
359 * @exception E_UNSUPPORTED_FORMAT The specified format is not supported.
360 * @exception E_OBJ_NOT_FOUND The specified image buffer cannot be found.
361 * @exception E_OUT_OF_MEMORY The memory is insufficient.
363 * - @c E_OUT_OF_MEMORY is returned if the memory is not available when decoding a large image.
364 * - The specific error code can be accessed using the GetLastResult() method.
365 * - This method returns an auto-scaled bitmap, @n
366 * so the dimension can be different from the dimension of source image if the returned bitmap is locked.
368 Tizen::Graphics::Bitmap* DecodeN(const Tizen::Base::ByteBuffer& srcImageBuf, ImageFormat srcImageFormat, Tizen::Graphics::BitmapPixelFormat pixelFormat) const;
371 * Decodes an image data into the decoded bitmap container after resizing it as per the specified width and height. @n
372 * The currently supported decoding formats are JPEG, GIF, PNG, BMP, TIFF, and WBMP. @n
373 * The %DecodeN() method retains the aspect ratio of the original image. @n
374 * It supports only the downscaling of an image.
378 * @return A decoded bitmap data with the specified destination width and height
379 * @param[in] srcImageBuf The data to decode
380 * @param[in] srcImageFormat The image format of the input file
381 * @param[in] pixelFormat The output pixel format defined by Tizen::Graphics::BitmapPixelFormat
382 * @param[in] destWidth The intended width of the image @n
383 * An exception is returned if the value is less than @c 0.
384 * @param[in] destHeight The intended height of the image @n
385 * An exception is returned if the value is less than @c 0.
386 * @exception E_SUCCESS The method is successful.
387 * @exception E_INVALID_ARG The specified pixel format is not supported.
388 * @exception E_INVALID_DATA The specified input instance has invalid data.
389 * @exception E_OVERFLOW The specified input instance has overflowed.
390 * @exception E_UNSUPPORTED_FORMAT The specified format is not supported.
391 * @exception E_OUT_OF_MEMORY The memory is insufficient.
392 * @exception E_OBJ_NOT_FOUND The specified image buffer cannot be found.
393 * @exception E_OUT_OF_RANGE The specified size is out of range.
395 * - The specific error code can be accessed using the GetLastResult() method.
396 * - This method returns an auto-scaled bitmap, @n
397 * so the dimension can be different from the requested dimension if the returned bitmap is locked.
399 Tizen::Graphics::Bitmap* DecodeN(const Tizen::Base::ByteBuffer& srcImageBuf, ImageFormat srcImageFormat, Tizen::Graphics::BitmapPixelFormat pixelFormat, int destWidth, int destHeight) const;
402 * Encodes the specified bitmap data into a byte buffer. @n
403 * The currently supported encoding formats are JPEG, BMP, and PNG.
407 * @return A byte buffer containing encoded image data
408 * @param[in] srcBitmap The bitmap data to encode
409 * @param[in] destImageFormat The intended image format
410 * @exception E_SUCCESS The method is successful.
411 * @exception E_OVERFLOW The specified input instance has overflowed.
412 * @exception E_UNSUPPORTED_FORMAT The specified format is not supported.
413 * @exception E_OUT_OF_MEMORY The memory is insufficient.
414 * @exception E_OBJ_NOT_FOUND The specified bitmap data cannot be found.
416 * - The specific error code can be accessed using the GetLastResult() method.
417 * - This method uses raw RGB data from locked bitmap, @n
418 * so the dimension of encoded data can be different from the dimension of source bitmap if the bitmap is auto-scaled.
420 Tizen::Base::ByteBuffer* EncodeToBufferN(const Tizen::Graphics::Bitmap& srcBitmap, ImageFormat destImageFormat) const;
423 * Encodes the specified bitmap data into a file. @n
424 * The currently supported encoding formats are JPEG, BMP, and PNG.
427 * @brief <i> [Compatibility] </i>
431 * @compatibility This method has compatibility issues with OSP compatible applications. @n
432 * For more information, see @ref CompIoPathPage "here".
435 * @return An error code
436 * @param[in] srcBitmap The bitmap data to encode
437 * @param[in] destImageFormat The intended image format
438 * @param[in] destImagePath The intended name of encoded image file @n
439 * The available paths start with prefixes retrieved from the functions such as: @n
440 * Tizen::App::App::GetInstance()->GetAppRootPath() @n
441 * Tizen::System::Environment::GetMediaPath() @n
442 * Tizen::System::Environment::GetExternalStoragePath()
443 * @param[in] overwrite Set to @c true to overwrite the file, @n
445 * @exception E_SUCCESS The method is successful.
446 * @exception E_OVERFLOW The specified input instance has overflowed.
447 * @exception E_UNSUPPORTED_FORMAT The specified format is not supported.
448 * @exception E_OUT_OF_MEMORY The memory is insufficient.
449 * @exception E_FILE_NOT_FOUND The specified file cannot be found or accessed.
450 * @exception E_OBJ_NOT_FOUND The specified bitmap data cannot be found.
451 * @exception E_FILE_ALREADY_EXIST The specified file already exists.
452 * @exception E_SYSTEM A system error has occurred.
453 * @exception E_STORAGE_FULL The storage is full.
455 * - The specific error code can be accessed using the GetLastResult() method.
456 * - The application should use Tizen::Content::ContentManager::CreateContent() to register the created file into the Contents database.
457 * - This method uses raw RGB data from locked bitmap, @n
458 * so the dimension of encoded data can be different from the dimension of source bitmap if the bitmap is auto-scaled.
460 result EncodeToFile(const Tizen::Graphics::Bitmap& srcBitmap, ImageFormat destImageFormat, const Tizen::Base::String& destImagePath, bool overwrite) const;
463 * Converts the image file to the specified image format. @n
464 * This is a synchronous method. The converting formats currently supported are JPEG, BMP, and PNG.
467 * @brief <i> [Compatibility] </i>
471 * @compatibility This method has compatibility issues with OSP compatible applications. @n
472 * For more information, see @ref CompIoPathPage "here".
475 * @return The byte buffer containing image data
476 * @param[in] srcImagePath The local file path of the image file to open
477 * @param[in] destImageFormat The intended image format
478 * @exception E_SUCCESS The method is successful.
479 * @exception E_INVALID_DATA The specified input instance has invalid data.
480 * @exception E_OVERFLOW The specified input instance has overflowed.
481 * @exception E_UNSUPPORTED_FORMAT The specified format is not supported.
482 * @exception E_OUT_OF_MEMORY The memory is insufficient.
483 * @exception E_FILE_NOT_FOUND The specified file cannot be found or accessed.
484 * @remarks The specific error code can be accessed using the GetLastResult() method.
486 Tizen::Base::ByteBuffer* ConvertN(const Tizen::Base::String& srcImagePath, ImageFormat destImageFormat) const;
491 * Compresses an encoded image file to reduce its size as per the specified limit. @n
492 * The only supported compression format is JPEG.
495 * @brief <i> [Deprecated] [Compatibility] </i>
496 * @deprecated This method is deprecated.
500 * @compatibility This method has compatibility issues with OSP compatible applications. @n
501 * For more information, see @ref CompIoPathPage "here".
504 * @return An error code
505 * @param[in] srcImagePath The local file path of the image file to open
506 * @param[in] destImagePath The destination file path @n
507 * If the file already exists, it is overwritten. @n
508 * The available paths start with prefix such as: @n
509 * Tizen::App::App::GetInstance()->GetAppRootPath() @n
510 * Tizen::System::Environment::GetMediaPath() @n
511 * Tizen::System::Environment::GetExternalStoragePath()
512 * @param[in] limitSize The maximum compressed data size in bytes @n
513 * If the data size is too small, the width and height of the original
514 * image can be reduced. @n The size must be less than the original size
515 * and greater than @c 1024 byte.
516 * @exception E_SUCCESS The method is successful.
517 * @exception E_OVERFLOW The specified input instance has overflowed.
518 * @exception E_OUT_OF_MEMORY The memory is insufficient.
519 * @exception E_FILE_NOT_FOUND The specified file cannot be found or accessed.
520 * @exception E_UNSUPPORTED_FORMAT The specified format is not supported.
521 * @exception E_SYSTEM A system error has occurred.
522 * @exception E_STORAGE_FULL The file cannot be created because the file has reached its size limit.
523 * @exception E_OUT_OF_RANGE The specified size is out of range.
527 result CompressJpeg(const Tizen::Base::String& srcImagePath, const Tizen::Base::String& destImagePath, int limitSize) const;
531 * Compresses an encoded image data to the byte buffer to reduce its data size as per the specified limit. @n
532 * The only supported compression format is JPEG.
534 * @brief <i> [Deprecated] </i>
535 * @deprecated This method is deprecated.
538 * @return A byte buffer containing the compressed image data as per the specified size
539 * @param[in] srcImageBuf The encoded image source in the byte buffer
540 * @param[in] limitSize The limit size to compress in bytes @n
541 * The size must be less than the original size and greater than @c 1024 bytes.
542 * @exception E_SUCCESS The method is successful.
543 * @exception E_OVERFLOW The specified input instance has overflowed.
544 * @exception E_OUT_OF_MEMORY The memory is insufficient.
545 * @exception E_UNSUPPORTED_FORMAT The specified format is not supported.
546 * @exception E_OBJ_NOT_FOUND The specified image buffer cannot be found.
547 * @exception E_SYSTEM A system error has occurred.
548 * @exception E_OUT_OF_RANGE The specified size is out of range.
549 * @remarks The specific error code can be accessed using the GetLastResult() method.
552 Tizen::Base::ByteBuffer* CompressJpegN(const Tizen::Base::ByteBuffer& srcImageBuf, int limitSize) const;
555 * Decodes an image data into the decoded byte buffer container without resizing. @n
556 * The currently supported decoding formats are JPEG, GIF, PNG, BMP, TIFF, and WBMP.
560 * @return A decoded byte data that is not resized, @n
561 * else @c null if an exception occurs
562 * @param[in] srcImageBuf The data to decode
563 * @param[in] srcImageFormat The image format of the input data
564 * @param[in] pixelFormat The output pixel format defined by Tizen::Graphics::BitmapPixelFormat
565 * @param[out] imageWidth The original width of the image @n
566 * An exception is returned if the value is less than @c 0.
567 * @param[out] imageHeight The original height of the image @n
568 * An exception is returned if the value is less than @c 0.
569 * @exception E_SUCCESS The method is successful.
570 * @exception E_INVALID_ARG The specified color format is not supported.
571 * @exception E_INVALID_DATA The specified input instance has invalid data.
572 * @exception E_OVERFLOW The specified input instance has overflowed.
573 * @exception E_UNSUPPORTED_FORMAT The specified format is not supported.
574 * @exception E_OUT_OF_MEMORY The memory is insufficient.
575 * @exception E_OBJ_NOT_FOUND The specified media buffer cannot be found.
576 * @remarks The specific error code can be accessed using the GetLastResult() method.
578 Tizen::Base::ByteBuffer* DecodeToBufferN(const Tizen::Base::ByteBuffer& srcImageBuf, ImageFormat srcImageFormat, Tizen::Graphics::BitmapPixelFormat pixelFormat, int& imageWidth, int& imageHeight) const;
581 * Decodes an image file into the decoded byte buffer container without resizing. @n
582 * The currently supported decoding formats are JPEG, GIF, PNG, BMP, TIFF, and WBMP.
585 * @brief <i> [Compatibility] </i>
589 * @compatibility This method has compatibility issues with OSP compatible applications. @n
590 * For more information, see @ref CompIoPathPage "here".
593 * @return A decoded byte data that is not resized, @n
594 * else @c null if an exception occurs
595 * @param[in] srcImagePath The local file path of the image file to decode
596 * @param[in] pixelFormat The output pixel format defined by Tizen::Graphics::BitmapPixelFormat
597 * @param[out] imageWidth The original width of the image @n
598 * An exception is returned if the value is less than @c 0.
599 * @param[out] imageHeight The original height of the image @n
600 * An exception is returned if the value is less than @c 0.
601 * @exception E_SUCCESS The method is successful.
602 * @exception E_INVALID_ARG The specified color format is not supported.
603 * @exception E_INVALID_DATA The specified input instance has invalid data.
604 * @exception E_OVERFLOW The specified input instance has overflowed.
605 * @exception E_UNSUPPORTED_FORMAT The specified format is not supported.
606 * @exception E_FILE_NOT_FOUND The specified file cannot be found or accessed.
607 * @exception E_OUT_OF_MEMORY The memory is insufficient.
608 * @remarks The specific error code can be accessed using the GetLastResult() method.
610 Tizen::Base::ByteBuffer* DecodeToBufferN(const Tizen::Base::String& srcImagePath, Tizen::Graphics::BitmapPixelFormat pixelFormat, int& imageWidth, int& imageHeight) const;
613 * Sets the timeout interval to infinity.
617 static const int TIMEOUT_INFINITE = 0;
621 * Gets the format of the image in the specified file.
624 * @brief <i> [Compatibility] </i>
628 * @compatibility This method has compatibility issues with OSP compatible applications. @n
629 * For more information, see @ref CompIoPathPage "here".
632 * @return The format of the image
633 * @param[in] srcImagePath The local path of the image file
634 * @exception E_SUCCESS The method is successful.
635 * @exception E_UNSUPPORTED_FORMAT The specified format is not supported.
636 * @exception E_SYSTEM A system error has occurred.
637 * @exception E_FILE_NOT_FOUND The specified file cannot be found or accessed.
638 * @remarks The specific error code can be accessed using the GetLastResult() method.
640 Tizen::Media::ImageFormat GetImageFormat(const Tizen::Base::String& srcImagePath) const;
643 * Gets the image format from an image buffer.
647 * @return The format of the image
648 * @param[in] srcImageBuf The Tizen::Base::ByteBuffer containing the image data
649 * @exception E_SUCCESS The method is successful.
650 * @exception E_UNSUPPORTED_FORMAT The specified format is not supported.
651 * @exception E_OBJ_NOT_FOUND The specified image buffer cannot be found.
652 * @exception E_SYSTEM A system error has occurred.
653 * @remarks The specific error code can be accessed using the GetLastResult() method.
655 Tizen::Media::ImageFormat GetImageFormat(const Tizen::Base::ByteBuffer& srcImageBuf) const;
658 * Checks whether the specified image file has alpha channels. @n
659 * Currently only 32-bit PNG images are supported.
662 * @brief <i> [Compatibility] </i>
666 * @compatibility This method has compatibility issues with OSP compatible applications. @n
667 * For more information, see @ref CompIoPathPage "here".
670 * @return @c true if the image has alpha channels, @n
672 * @param[in] srcImagePath The local file path of the image file
673 * @exception E_SUCCESS The method is successful.
674 * @exception E_UNSUPPORTED_FORMAT The specified format is not supported.
675 * @exception E_FILE_NOT_FOUND The specified image file cannot be found.
676 * @exception E_SYSTEM A system error has occurred.
677 * @exception E_OUT_OF_MEMORY The memory is insufficient.
678 * @remarks The specific error code can be accessed using the GetLastResult() method.
680 bool HasAlphaChannels(const Tizen::Base::String& srcImagePath) const;
683 * Checks whether the specified image buffer has alpha channels. @n
684 * Currently only 32-bit PNG images are supported.
688 * @return @c true if the image has alpha channels, @n
690 * @param[in] srcImageBuf The Tizen::Base::ByteBuffer containing the image data
691 * @exception E_SUCCESS The method is successful.
692 * @exception E_UNSUPPORTED_FORMAT The specified format is not supported.
693 * @exception E_OBJ_NOT_FOUND The specified image buffer cannot be found.
694 * @exception E_SYSTEM A system error has occurred.
695 * @exception E_OUT_OF_MEMORY The memory is insufficient.
696 * @remarks The specific error code can be accessed using the GetLastResult() method.
698 bool HasAlphaChannels(const Tizen::Base::ByteBuffer& srcImageBuf) const;
703 * The implementation of this copy constructor is intentionally blank
704 * and declared as private to prohibit copying of objects.
706 Image(const Image& image);
709 * The implementation of this copy assignment operator is intentionally blank
710 * and declared as private to prohibit copying of objects.
712 Image& operator =(const Image& image);
715 class _ImageImpl* __pImageImpl;
716 friend class _ImageImpl;