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 %Tizen::Media::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.
43 * The %Image class is used for handling images, including image decoding, encoding, conversion, and JPEG compression. @n
44 * @remarks The minimum dimension is 16x16 for JPEG encoding and 8x8 for PNG encoding.
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.
196 * @brief <i> [Compatibility] </i>
200 * @compatibility This method has compatibility issues with OSP compatible applications. @n
201 * For more information, see @ref CompIoPathPage "here".
204 * @return A decoded bitmap that is not resized
205 * @param[in] srcImagePath The local file path of the image file to open
206 * @param[in] pixelFormat The output pixel format defined by Tizen::Graphics::BitmapPixelFormat
207 * @exception E_SUCCESS The method is successful.
208 * @exception E_INVALID_ARG The specified pixel format is not supported.
209 * @exception E_INVALID_DATA The specified input instance has invalid data.
210 * @exception E_OVERFLOW The specified input instance has overflowed.
211 * @exception E_UNSUPPORTED_FORMAT The specified format is not supported.
212 * @exception E_OUT_OF_MEMORY The memory is insufficient.
213 * @exception E_FILE_NOT_FOUND The specified file cannot be found or accessed.
214 * @remarks This method retains the aspect ratio of the original image. @n
215 * @c E_OUT_OF_MEMORY can be returned if there is no available memory when decoding a large image. @n
216 * The specific error code can be accessed using the GetLastResult() method. @n
217 * This method returns auto-scaled bitmap, @n
218 * so the dimension can be different from the dimension of source image when the returned bitmap is locked.
220 Tizen::Graphics::Bitmap* DecodeN(const Tizen::Base::String& srcImagePath, Tizen::Graphics::BitmapPixelFormat pixelFormat) const;
223 * Decodes an image file into the decoded bitmap container after resizing it as per the specified width and height. @n
224 * The currently supported decoding formats are JPEG, GIF, PNG, BMP, TIFF, and WBMP.
227 * @brief <i> [Compatibility] </i>
231 * @compatibility This method has compatibility issues with OSP compatible applications. @n
232 * For more information, see @ref CompIoPathPage "here".
235 * @return A decoded bitmap data with the specified destination width and height
236 * @param[in] srcImagePath The local file path of the image file to open
237 * @param[in] pixelFormat The output pixel format defined by Tizen::Graphics::BitmapPixelFormat
238 * @param[in] destWidth The intended width of the image @n
239 * An exception is returned if the value is less than @c 0.
240 * @param[in] destHeight The intended height of the image @n
241 * An exception is returned if the value is less than @c 0.
242 * @exception E_SUCCESS The method is successful.
243 * @exception E_INVALID_ARG The specified pixel format is not supported.
244 * @exception E_INVALID_DATA The specified input instance has invalid data.
245 * @exception E_OVERFLOW The specified input instance has overflowed.
246 * @exception E_UNSUPPORTED_FORMAT The specified format is not supported.
247 * @exception E_OUT_OF_MEMORY The memory is insufficient.
248 * @exception E_FILE_NOT_FOUND The specified file cannot be found or accessed.
249 * @exception E_OUT_OF_RANGE The specified size is out of range.
250 * @remarks This method retains the aspect ratio of the original image. @n
251 * It supports only the downscaling of an image. @n
252 * The specific error code can be accessed using the GetLastResult() method. @n
253 * This method returns auto-scaled bitmap, @n
254 * so the dimension can be different from the requested dimension when the returned bitmap is locked.
256 Tizen::Graphics::Bitmap* DecodeN(const Tizen::Base::String& srcImagePath, Tizen::Graphics::BitmapPixelFormat pixelFormat, int destWidth, int destHeight) const;
259 * Decodes an image data into the decoded bitmap container after resizing it as per the specified width and height. @n
260 * The currently supported decoding formats are JPEG, GIF, PNG, BMP, TIFF, and WBMP. @n
261 * The %DecodeN() method retains the aspect ratio of the original image.
265 * @return A decoded bitmap data with the specified destination width and height.
266 * @param[in] srcImageBuf The data to decode
267 * @param[in] pixelFormat The output pixel format defined by Tizen::Graphics::BitmapPixelFormat
268 * @param[in] destWidth The intended width of the image.
269 * @param[in] destHeight The intended height of the image.
270 * @exception E_SUCCESS The method is successful.
271 * @exception E_INVALID_DATA The specified input instance has invalid data.
272 * @exception E_INVALID_ARG The specified pixel format is not supported.
273 * @exception E_UNSUPPORTED_FORMAT The specified format is not supported.
274 * @exception E_OBJ_NOT_FOUND The specified image buffer cannot be found.
275 * @exception E_OUT_OF_MEMORY The memory is insufficient.
276 * @remarks The specific error code can be accessed using the GetLastResult() method.
277 * @remarks This method retains the aspect ratio of the original image.
278 * @remarks It’s a high probability that the out-of-memory exception occurs. Check the exception as possible if it is E_OUT_OF_MEMORY.
279 * Refer to <a href="../org.tizen.native.appprogramming/html/basics_tizen_programming/exception_check.htm">Exception Check</a> and handle the out-of-memory.
280 * @remarks This method returns auto scaled bitmap to support logical coordinate system, so the actual dimension of the returned bitmap can be vary depending on the physical dimension of target device.
282 Tizen::Graphics::Bitmap* DecodeN(const Tizen::Base::ByteBuffer& srcImageBuf, Tizen::Graphics::BitmapPixelFormat pixelFormat, float destWidth, float destHeight) const;
285 * Decodes an image file into the decoded bitmap container after resizing it as per the specified width and height. @n
286 * The currently supported decoding formats are JPEG, GIF, PNG, BMP, TIFF, and WBMP. @n
287 * The %DecodeN() method retains the aspect ratio of the original image.
291 * @return A decoded bitmap data with the specified destination width and height.
292 * @param[in] srcImagePath The local file path of the image file to open
293 * @param[in] pixelFormat The output pixel format defined by Tizen::Graphics::BitmapPixelFormat
294 * @param[in] destWidth The intended width of the image.
295 * @param[in] destHeight The intended height of the image.
296 * @exception E_SUCCESS The method is successful.
297 * @exception E_INVALID_ARG The specified pixel format is not supported.
298 * @exception E_INVALID_DATA The specified input instance has invalid data.
299 * @exception E_UNSUPPORTED_FORMAT The specified format is not supported.
300 * @exception E_OUT_OF_MEMORY The memory is insufficient.
301 * @exception E_FILE_NOT_FOUND The specified file cannot be found or accessed.
302 * @remarks The specific error code can be accessed using the GetLastResult() method.
303 * @remarks This method retains the aspect ratio of the original image.
304 * @remarks It’s a high probability that the out-of-memory exception occurs. Check the exception as possible if it is E_OUT_OF_MEMORY.
305 * Refer to <a href="../org.tizen.native.appprogramming/html/basics_tizen_programming/exception_check.htm">Exception Check</a> and handle the out-of-memory.
306 * @remarks This method returns auto scaled bitmap to support logical coordinate system, so the actual dimension of the returned bitmap can be vary depending on the physical dimension of target device.
308 Tizen::Graphics::Bitmap* DecodeN(const Tizen::Base::String& srcImagePath, Tizen::Graphics::BitmapPixelFormat pixelFormat, float destWidth, float destHeight) const;
311 * Decodes an image data into the decoded bitmap as per the specified width and height. @n
312 * The currently supported decoding formats are JPEG, GIF, PNG, BMP, TIFF, and WBMP.
316 * @return An error code
317 * @param[in] srcImageUrl The URL of the remote image to decode
318 * @param[in] pixelFormat The output pixel format defined by Tizen::Graphics::BitmapPixelFormat
319 * @param[in] destWidth The intended width of the image @n
320 * An exception is returned if the value is less than @c 0.
321 * @param[in] destHeight The intended height of the image @n
322 * An exception is returned if the value is less than @c 0.
323 * @param[out] reqId The request ID
324 * @param[in] listener An instance of IImageDecodeUrlEventListener
325 * @param[in] timeout The timeout period in milliseconds @n
326 * Set to @c TIMEOUT_INFINITE to make the @c timeout period infinite.
327 * @exception E_SUCCESS The method is successful.
328 * @exception E_INVALID_DATA The specified input instance has invalid data.
329 * @exception E_INVALID_ARG The specified pixel format is not supported.
330 * @exception E_OUT_OF_RANGE The specified size is out of range.
331 * @exception E_OUT_OF_MEMORY The memory is insufficient.
332 * @exception E_NETWORK_FAILED The network is unavailable.
333 * @exception E_MAX_EXCEEDED The number of concurrent accesses to the URLs has reached the maximum limit.
334 * @remarks This method retains the aspect ratio of the original image. @n
335 * It supports only the downscaling of an image. @n
336 * The maximum limit for downscaling is 3. @n
337 * The supported protocol is HTTP.
339 result DecodeUrl(const Tizen::Base::Utility::Uri& srcImageUrl, Tizen::Graphics::BitmapPixelFormat pixelFormat, int destWidth, int destHeight, RequestId& reqId, const IImageDecodeUrlEventListener& listener, long timeout) const;
342 * Decodes an image data into the decoded bitmap container without resizing. @n
343 * The currently supported decoding formats are JPEG, GIF, PNG, BMP, TIFF, and WBMP. The %DecodeN() method retains the
344 * aspect ratio of the original image.
348 * @return A decoded bitmap data that has not been resized
349 * @param[in] srcImageBuf The data to decode
350 * @param[in] srcImageFormat The image format of the input file
351 * @param[in] pixelFormat The output pixel format defined by Tizen::Graphics::BitmapPixelFormat
352 * @exception E_SUCCESS The method is successful.
353 * @exception E_INVALID_DATA The specified input instance has invalid data.
354 * @exception E_INVALID_ARG The specified pixel format is not supported.
355 * @exception E_OVERFLOW The specified input instance has overflowed.
356 * @exception E_UNSUPPORTED_FORMAT The specified format is not supported.
357 * @exception E_OBJ_NOT_FOUND The specified image buffer cannot be found.
358 * @exception E_OUT_OF_MEMORY The memory is insufficient.
359 * @remarks This method retains the aspect ratio of the original image. @n
360 * @c E_OUT_OF_MEMORY is returned if the memory is not available when decoding a large image. @n
361 * The specific error code can be accessed using the GetLastResult() method. @n
362 * This method returns auto-scaled bitmap, @n
363 * so the dimension can be different from the dimension of source image when the returned bitmap is locked.
365 Tizen::Graphics::Bitmap* DecodeN(const Tizen::Base::ByteBuffer& srcImageBuf, ImageFormat srcImageFormat, Tizen::Graphics::BitmapPixelFormat pixelFormat) const;
368 * Decodes an image data into the decoded bitmap container after resizing it as per the specified width and height. @n
369 * The currently supported decoding formats are JPEG, GIF, PNG, BMP, TIFF, and WBMP.
373 * @return A decoded bitmap data with the specified destination width and height
374 * @param[in] srcImageBuf The data to decode
375 * @param[in] srcImageFormat The image format of the input file
376 * @param[in] pixelFormat The output pixel format defined by Tizen::Graphics::BitmapPixelFormat
377 * @param[in] destWidth The intended width of the image @n
378 * An exception is returned if the value is less than @c 0.
379 * @param[in] destHeight The intended height of the image @n
380 * An exception is returned if the value is less than @c 0.
381 * @exception E_SUCCESS The method is successful.
382 * @exception E_INVALID_ARG The specified pixel format is not supported.
383 * @exception E_INVALID_DATA The specified input instance has invalid data.
384 * @exception E_OVERFLOW The specified input instance has overflowed.
385 * @exception E_UNSUPPORTED_FORMAT The specified format is not supported.
386 * @exception E_OUT_OF_MEMORY The memory is insufficient.
387 * @exception E_OBJ_NOT_FOUND The specified image buffer cannot be found.
388 * @exception E_OUT_OF_RANGE The specified size is out of range.
389 * @remarks This method retains the aspect ratio of the original image. @n
390 * It supports only the downscaling of an image. @n
391 * The specific error code can be accessed using the GetLastResult() method. @n
392 * This method returns auto-scaled bitmap, @n
393 * so the dimension can be different from the requested dimension when the returned bitmap is locked.
395 Tizen::Graphics::Bitmap* DecodeN(const Tizen::Base::ByteBuffer& srcImageBuf, ImageFormat srcImageFormat, Tizen::Graphics::BitmapPixelFormat pixelFormat, int destWidth, int destHeight) const;
398 * Encodes the specified bitmap data into a byte buffer. @n
399 * The currently supported encoding formats are JPEG, BMP, and PNG.
403 * @return A byte buffer containing encoded image data
404 * @param[in] srcBitmap The bitmap data to encode
405 * @param[in] destImageFormat The intended image format
406 * @exception E_SUCCESS The method is successful.
407 * @exception E_OVERFLOW The specified input instance has overflowed.
408 * @exception E_UNSUPPORTED_FORMAT The specified format is not supported.
409 * @exception E_OUT_OF_MEMORY The memory is insufficient.
410 * @exception E_OBJ_NOT_FOUND The specified bitmap data cannot be found.
411 * @remarks The specific error code can be accessed using the GetLastResult() method. @n
412 * This method uses raw RGB data from locked bitmap, @n
413 * so the dimension of encoded data can be different from the dimension of source bitmap if the bitmap is auto-scaled.
415 Tizen::Base::ByteBuffer* EncodeToBufferN(const Tizen::Graphics::Bitmap& srcBitmap, ImageFormat destImageFormat) const;
418 * Encodes the specified bitmap data into a file. @n
419 * The currently supported encoding formats are JPEG, BMP, and PNG.
422 * @brief <i> [Compatibility] </i>
426 * @compatibility This method has compatibility issues with OSP compatible applications. @n
427 * For more information, see @ref CompIoPathPage "here".
430 * @return An error code
431 * @param[in] srcBitmap The bitmap data to encode
432 * @param[in] destImageFormat The intended image format
433 * @param[in] destImagePath The intended name of encoded image file @n
434 * The available paths start with prefixes retrieved from the functions such as: @n
435 * Tizen::App::App::GetInstance()->GetAppRootPath() @n
436 * Tizen::System::Environment::GetMediaPath() @n
437 * Tizen::System::Environment::GetExternalStoragePath()
438 * @param[in] overwrite Set to @c true to overwrite the file, @n
440 * @exception E_SUCCESS The method is successful.
441 * @exception E_OVERFLOW The specified input instance has overflowed.
442 * @exception E_UNSUPPORTED_FORMAT The specified format is not supported.
443 * @exception E_OUT_OF_MEMORY The memory is insufficient.
444 * @exception E_FILE_NOT_FOUND The specified file cannot be found or accessed.
445 * @exception E_OBJ_NOT_FOUND The specified bitmap data cannot be found.
446 * @exception E_FILE_ALREADY_EXIST The specified file already exists.
447 * @exception E_SYSTEM A system error has occurred.
448 * @exception E_STORAGE_FULL The storage is full.
449 * @remarks The specific error code can be accessed using the GetLastResult() method. @n
450 * The application should use Tizen::Content::ContentManager::CreateContent() to register the created file into the Contents database. @n
451 * This method uses raw RGB data from locked bitmap, @n
452 * so the dimension of encoded data can be different from the dimension of source bitmap if the bitmap is auto-scaled.
454 result EncodeToFile(const Tizen::Graphics::Bitmap& srcBitmap, ImageFormat destImageFormat, const Tizen::Base::String& destImagePath, bool overwrite) const;
457 * Converts the image file to the specified image format. @n
458 * This is a synchronous method. The converting formats currently supported are JPEG, BMP, and PNG.
461 * @brief <i> [Compatibility] </i>
465 * @compatibility This method has compatibility issues with OSP compatible applications. @n
466 * For more information, see @ref CompIoPathPage "here".
469 * @return The byte buffer containing image data
470 * @param[in] srcImagePath The local file path of the image file to open
471 * @param[in] destImageFormat The intended image format
472 * @exception E_SUCCESS The method is successful.
473 * @exception E_INVALID_DATA The specified input instance has invalid data.
474 * @exception E_OVERFLOW The specified input instance has overflowed.
475 * @exception E_UNSUPPORTED_FORMAT The specified format is not supported.
476 * @exception E_OUT_OF_MEMORY The memory is insufficient.
477 * @exception E_FILE_NOT_FOUND The specified file cannot be found or accessed.
478 * @remarks The specific error code can be accessed using the GetLastResult() method.
480 Tizen::Base::ByteBuffer* ConvertN(const Tizen::Base::String& srcImagePath, ImageFormat destImageFormat) const;
485 * Compresses an encoded image file to reduce its size as per the specified limit. @n
486 * The only supported compression format is JPEG.
489 * @brief <i> [Deprecated] [Compatibility] </i>
491 * @deprecated This method is deprecated.
494 * @compatibility This method has compatibility issues with OSP compatible applications. @n
495 * For more information, see @ref CompIoPathPage "here".
498 * @return An error code
499 * @param[in] srcImagePath The local file path of the image file to open
500 * @param[in] destImagePath The destination file path @n
501 * If the file already exists, it is overwritten. @n
502 * The available paths start with prefix such as: @n
503 * Tizen::App::App::GetInstance()->GetAppRootPath() @n
504 * Tizen::System::Environment::GetMediaPath() @n
505 * Tizen::System::Environment::GetExternalStoragePath()
506 * @param[in] limitSize The maximum compressed data size in bytes @n
507 * If the data size is too small, the width and height of the original
508 * image can be reduced. @n The size must be less than the original size
509 * and greater than @c 1024 byte.
510 * @exception E_SUCCESS The method is successful.
511 * @exception E_OVERFLOW The specified input instance has overflowed.
512 * @exception E_OUT_OF_MEMORY The memory is insufficient.
513 * @exception E_FILE_NOT_FOUND The specified file cannot be found or accessed.
514 * @exception E_UNSUPPORTED_FORMAT The specified format is not supported.
515 * @exception E_SYSTEM A system error has occurred.
516 * @exception E_STORAGE_FULL The file cannot be created because the file has reached its size limit.
517 * @exception E_OUT_OF_RANGE The specified size is out of range.
521 result CompressJpeg(const Tizen::Base::String& srcImagePath, const Tizen::Base::String& destImagePath, int limitSize) const;
525 * Compresses an encoded image data to the byte buffer to reduce its data size as per the specified limit. @n
526 * The only supported compression format is JPEG.
528 * @brief <i> [Deprecated] </i>
529 * @deprecated This method is deprecated.
532 * @return A byte buffer containing the compressed image data as per the specified size
533 * @param[in] srcImageBuf The encoded image source in the byte buffer
534 * @param[in] limitSize The limit size to compress in bytes @n
535 * The size must be less than the original size and greater than @c 1024 bytes.
536 * @exception E_SUCCESS The method is successful.
537 * @exception E_OVERFLOW The specified input instance has overflowed.
538 * @exception E_OUT_OF_MEMORY The memory is insufficient.
539 * @exception E_UNSUPPORTED_FORMAT The specified format is not supported.
540 * @exception E_OBJ_NOT_FOUND The specified image buffer cannot be found.
541 * @exception E_SYSTEM A system error has occurred.
542 * @exception E_OUT_OF_RANGE The specified size is out of range.
543 * @remarks The specific error code can be accessed using the GetLastResult() method.
546 Tizen::Base::ByteBuffer* CompressJpegN(const Tizen::Base::ByteBuffer& srcImageBuf, int limitSize) const;
549 * Decodes an image data into the decoded byte buffer container without resizing. @n
550 * The currently supported decoding formats are JPEG, GIF, PNG, BMP, TIFF, and WBMP.
554 * @return A decoded byte data that is not resized, @n
555 * else @c null if an exception occurs
556 * @param[in] srcImageBuf The data to decode
557 * @param[in] srcImageFormat The image format of the input data
558 * @param[in] pixelFormat The output pixel format defined by Tizen::Graphics::BitmapPixelFormat
559 * @param[out] imageWidth The original width of the image @n
560 * An exception is returned if the value is less than @c 0.
561 * @param[out] imageHeight The original height of the image @n
562 * An exception is returned if the value is less than @c 0.
563 * @exception E_SUCCESS The method is successful.
564 * @exception E_INVALID_ARG The specified color format is not supported.
565 * @exception E_INVALID_DATA The specified input instance has invalid data.
566 * @exception E_OVERFLOW The specified input instance has overflowed.
567 * @exception E_UNSUPPORTED_FORMAT The specified format is not supported.
568 * @exception E_OUT_OF_MEMORY The memory is insufficient.
569 * @exception E_OBJ_NOT_FOUND The specified media buffer cannot be found.
570 * @remarks The specific error code can be accessed using the GetLastResult() method.
572 Tizen::Base::ByteBuffer* DecodeToBufferN(const Tizen::Base::ByteBuffer& srcImageBuf, ImageFormat srcImageFormat, Tizen::Graphics::BitmapPixelFormat pixelFormat, int& imageWidth, int& imageHeight) const;
575 * Decodes an image file into the decoded byte buffer container without resizing. @n
576 * The currently supported decoding formats are JPEG, GIF, PNG, BMP, TIFF, and WBMP.
579 * @brief <i> [Compatibility] </i>
583 * @compatibility This method has compatibility issues with OSP compatible applications. @n
584 * For more information, see @ref CompIoPathPage "here".
587 * @return A decoded byte data that is not resized, @n
588 * else @c null if an exception occurs
589 * @param[in] srcImagePath The local file path of the image file to decode
590 * @param[in] pixelFormat The output pixel format defined by Tizen::Graphics::BitmapPixelFormat
591 * @param[out] imageWidth The original width of the image @n
592 * An exception is returned if the value is less than @c 0.
593 * @param[out] imageHeight The original height of the image @n
594 * An exception is returned if the value is less than @c 0.
595 * @exception E_SUCCESS The method is successful.
596 * @exception E_INVALID_ARG The specified color format is not supported.
597 * @exception E_INVALID_DATA The specified input instance has invalid data.
598 * @exception E_OVERFLOW The specified input instance has overflowed.
599 * @exception E_UNSUPPORTED_FORMAT The specified format is not supported.
600 * @exception E_FILE_NOT_FOUND The specified file cannot be found or accessed.
601 * @exception E_OUT_OF_MEMORY The memory is insufficient.
602 * @remarks The specific error code can be accessed using the GetLastResult() method.
604 Tizen::Base::ByteBuffer* DecodeToBufferN(const Tizen::Base::String& srcImagePath, Tizen::Graphics::BitmapPixelFormat pixelFormat, int& imageWidth, int& imageHeight) const;
607 * Sets the timeout interval to infinity.
611 static const int TIMEOUT_INFINITE = 0;
615 * Gets the format of the image in the specified file.
618 * @brief <i> [Compatibility] </i>
622 * @compatibility This method has compatibility issues with OSP compatible applications. @n
623 * For more information, see @ref CompIoPathPage "here".
626 * @return The format of the image
627 * @param[in] srcImagePath The local path of the image file
628 * @exception E_SUCCESS The method is successful.
629 * @exception E_UNSUPPORTED_FORMAT The specified format is not supported.
630 * @exception E_SYSTEM A system error has occurred.
631 * @exception E_FILE_NOT_FOUND The specified file cannot be found or accessed.
632 * @remarks The specific error code can be accessed using the GetLastResult() method.
634 Tizen::Media::ImageFormat GetImageFormat(const Tizen::Base::String& srcImagePath) const;
637 * Gets the image format from an image buffer.
641 * @return The format of the image
642 * @param[in] srcImageBuf The Tizen::Base::ByteBuffer containing the image data
643 * @exception E_SUCCESS The method is successful.
644 * @exception E_UNSUPPORTED_FORMAT The specified format is not supported.
645 * @exception E_OBJ_NOT_FOUND The specified image buffer cannot be found.
646 * @exception E_SYSTEM A system error has occurred.
647 * @remarks The specific error code can be accessed using the GetLastResult() method.
649 Tizen::Media::ImageFormat GetImageFormat(const Tizen::Base::ByteBuffer& srcImageBuf) const;
652 * Checks whether the specified image file has alpha channels. @n
653 * Currently, only 32-bit PNG images are supported.
656 * @brief <i> [Compatibility] </i>
660 * @compatibility This method has compatibility issues with OSP compatible applications. @n
661 * For more information, see @ref CompIoPathPage "here".
664 * @return @c true if the image has alpha channels, @n
666 * @param[in] srcImagePath The local file path of the image file
667 * @exception E_SUCCESS The method is successful.
668 * @exception E_UNSUPPORTED_FORMAT The specified format is not supported.
669 * @exception E_FILE_NOT_FOUND The specified image file cannot be found.
670 * @exception E_SYSTEM A system error has occurred.
671 * @exception E_OUT_OF_MEMORY The memory is insufficient.
672 * @remarks The specific error code can be accessed using the GetLastResult() method.
674 bool HasAlphaChannels(const Tizen::Base::String& srcImagePath) const;
677 * Checks whether the specified image buffer has alpha channels. @n
678 * Currently only 32-bit PNG images are supported.
682 * @return @c true if the image has alpha channels, @n
684 * @param[in] srcImageBuf The Tizen::Base::ByteBuffer containing the image data
685 * @exception E_SUCCESS The method is successful.
686 * @exception E_UNSUPPORTED_FORMAT The specified format is not supported.
687 * @exception E_OBJ_NOT_FOUND The specified image buffer cannot be found.
688 * @exception E_SYSTEM A system error has occurred.
689 * @exception E_OUT_OF_MEMORY The memory is insufficient.
690 * @remarks The specific error code can be accessed using the GetLastResult() method.
692 bool HasAlphaChannels(const Tizen::Base::ByteBuffer& srcImageBuf) const;
697 * The implementation of this copy constructor is intentionally blank
698 * and declared as private to prohibit copying of objects.
700 Image(const Image& image);
703 * The implementation of this copy assignment operator is intentionally blank
704 * and declared as private to prohibit copying of objects.
706 Image& operator =(const Image& image);
709 class _ImageImpl* __pImageImpl;
710 friend class _ImageImpl;