2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef __TIZEN_MEDIA_IMAGE_UTIL_H__
18 #define __TIZEN_MEDIA_IMAGE_UTIL_H__
20 #include <image_util_type.h>
29 * @brief This file contains the image util API.
33 * @addtogroup CAPI_MEDIA_IMAGE_UTIL_MODULE
38 * @brief Creates a handle to image util transform.
41 * @details This function creates a handle to image util transform.
43 * @remarks You must release the @a image util handle using image_util_transform_destroy().
45 * @param[out] handle A handle to image util transform
47 * @return @c 0 on success,
48 * otherwise a negative error value
50 * @retval #IMAGE_UTIL_ERROR_NONE Successful
51 * @retval #IMAGE_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
52 * @retval #IMAGE_UTIL_ERROR_OUT_OF_MEMORY Out of memory
53 * @retval #IMAGE_UTIL_ERROR_PERMISSION_DENIED The application does not have the privilege to call this funtion
55 * @see image_util_transform_destroy()
58 int image_util_transform_create(transformation_h *handle);
61 * @brief Sets the image util's accurate mode.
64 * @details This function set if you use hardware accerlation or not.
66 * @remarks The value returned will be IMAGE_UTIL_ERROR_NOT_SUPPORTED, if H/W acceleration doesn't support on the device.
68 * @param[in] handle The handle to image util
69 * @param [in] mode Set @c true, user can use the hardware acceleration\n
70 * otherwise set @c false if user can only software image processing
72 * @return @c 0 on success,
73 * otherwise a negative error value
75 * @retval #IMAGE_UTIL_ERROR_NONE Successful
76 * @retval #IMAGE_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
77 * @retval #IMAGE_UTIL_ERROR_INVALID_OPERATION Invalid operation
78 * @retval #IMAGE_UTIL_ERROR_PERMISSION_DENIED The application does not have the privilege to call this funtion
79 * @retval #IMAGE_UTIL_ERROR_NOT_SUPPORTED The application does not have the hardware acceleration
81 * @pre image_util_transform_create().
83 * @see image_util_transform_create()
84 * @see image_util_transform_destroy()
86 int image_util_transform_set_hardware_acceleration(transformation_h handle, bool mode);
89 * @brief Sets the information of the converting
92 * @param[in] handle The handle to image util transform
93 * @param[in] colorspace The colorspace of the image buffer
95 * @return @c 0 on success,
96 * otherwise a negative error value
98 * @retval #IMAGE_UTIL_ERROR_NONE Successful
99 * @retval #IMAGE_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
100 * @retval #IMAGE_UTIL_ERROR_INVALID_OPERATION Invalid operation
101 * @retval #IMAGE_UTIL_ERROR_PERMISSION_DENIED The application does not have the privilege to call this funtion
102 * @retval #IMAGE_UTIL_ERROR_NOT_SUPPORTED_FORMAT Not supported format
104 * @pre image_util_transform_create().
106 * @see image_util_transform_create()
107 * @see image_util_transform_run()
108 * @see image_util_transform_destroy()
110 int image_util_transform_set_colorspace(transformation_h handle, image_util_colorspace_e colorspace);
113 * @brief Sets the information of the resizing
116 * @remarks image_util_transform_set_resolution and image_util_transform_set_crop_area can't do that at the same time.
118 * @param[in] handle The handle to image util transform
119 * @param[in] width The width of image buffer
120 * @param[in] height The height of image buffer
122 * @return @c 0 on success,
123 * otherwise a negative error value
125 * @retval #IMAGE_UTIL_ERROR_NONE Successful
126 * @retval #IMAGE_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
127 * @retval #IMAGE_UTIL_ERROR_INVALID_OPERATION Invalid operation
128 * @retval #IMAGE_UTIL_ERROR_PERMISSION_DENIED The application does not have the privilege to call this funtion
130 * @pre image_util_transform_create().
132 * @see image_util_transform_create()
133 * @see image_util_transform_run()
134 * @see image_util_transform_destroy()
136 int image_util_transform_set_resolution(transformation_h handle, unsigned int width, unsigned int height);
139 * @brief Sets the information of the rotating
142 * @param[in] handle The handle to image util transform
143 * @param[in] rotation The rotation value of image buffer
145 * @return @c 0 on success,
146 * otherwise a negative error value
148 * @retval #IMAGE_UTIL_ERROR_NONE Successful
149 * @retval #IMAGE_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
150 * @retval #IMAGE_UTIL_ERROR_INVALID_OPERATION Invalid operation
151 * @retval #IMAGE_UTIL_ERROR_PERMISSION_DENIED The application does not have the privilege to call this funtion
153 * @pre image_util_transform_create().
155 * @see image_util_transform_create()
156 * @see image_util_transform_run()
157 * @see image_util_transform_destroy()
159 int image_util_transform_set_rotation(transformation_h handle, image_util_rotation_e rotation);
162 * @brief Sets the information of the cropping
165 * @remarks image_util_transform_set_resolution and image_util_transform_set_crop_area can't do that at the same time.
167 * @param[in] handle The handle to image util transform
168 * @param[in] start_x The start x position of cropped image buffer
169 * @param[in] start_y The start y position of cropped image buffer
170 * @param[in] end_x The end x position of cropped image buffer
171 * @param[in] end_y The end y position of cropped image buffer
173 * @return @c 0 on success,
174 * otherwise a negative error value
176 * @retval #IMAGE_UTIL_ERROR_NONE Successful
177 * @retval #IMAGE_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
178 * @retval #IMAGE_UTIL_ERROR_INVALID_OPERATION Invalid operation
179 * @retval #IMAGE_UTIL_ERROR_PERMISSION_DENIED The application does not have the privilege to call this funtion
181 * @pre image_util_transform_create().
183 * @see image_util_transform_create()
184 * @see image_util_transform_run()
185 * @see image_util_transform_destroy()
187 int image_util_transform_set_crop_area(transformation_h handle, unsigned int start_x, unsigned int start_y, unsigned int end_x, unsigned int end_y);
190 * @brief Gets the colorspace of the image buffer
193 * @param[in] handle The handle to image util transform
194 * @param[in, out] colorspace The colorspace of the image buffer
196 * @return @c 0 on success,
197 * otherwise a negative error value
199 * @retval #IMAGE_UTIL_ERROR_NONE Successful
200 * @retval #IMAGE_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
201 * @retval #IMAGE_UTIL_ERROR_INVALID_OPERATION Invalid operation
202 * @retval #IMAGE_UTIL_ERROR_NOT_SUPPORTED_FORMAT Not supported format
204 * @pre image_util_transform_create().\n
205 * image_util_transform_set_crop_area().
207 * @see image_util_transform_create()
208 * @see image_util_transform_destroy()
210 int image_util_transform_get_colorspace(transformation_h handle, image_util_colorspace_e *colorspace);
213 * @brief Gets the resolution of the image buffer
216 * @param[in] handle The handle to image util transform
217 * @param[in, out] width The width of source image buffer
218 * @param[in, out] height The height of source image buffer
220 * @return @c 0 on success,
221 * otherwise a negative error value
223 * @retval #IMAGE_UTIL_ERROR_NONE Successful
224 * @retval #IMAGE_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
225 * @retval #IMAGE_UTIL_ERROR_INVALID_OPERATION Invalid operation
226 * @retval #IMAGE_UTIL_ERROR_PERMISSION_DENIED The application does not have the privilege to call this funtion
228 * @pre image_util_transform_create().\n
229 * image_util_transform_set_resolution().
231 * @see image_util_transform_create()
232 * @see image_util_transform_destroy()
234 int image_util_transform_get_resolution(transformation_h handle, unsigned int *width, unsigned int *height);
237 * @brief Gets the information of the rotating
240 * @param[in] handle The handle to image util transform
241 * @param[in, out] rotation The rotation value of image buffer
243 * @return @c 0 on success,
244 * otherwise a negative error value
246 * @retval #IMAGE_UTIL_ERROR_NONE Successful
247 * @retval #IMAGE_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
248 * @retval #IMAGE_UTIL_ERROR_INVALID_OPERATION Invalid operation
249 * @retval #IMAGE_UTIL_ERROR_PERMISSION_DENIED The application does not have the privilege to call this funtion
251 * @pre image_util_transform_create().\n
252 * image_util_transform_set_rotation().
254 * @see image_util_transform_create()
255 * @see image_util_transform_destroy()
257 int image_util_transform_get_rotation(transformation_h handle, image_util_rotation_e *rotation);
260 * @brief Gets the information of the cropping
263 * @param[in] handle The handle to image util transform
264 * @param[in, out] start_x The start x position of cropped source image buffer
265 * @param[in, out] start_y The start y position of cropped source image buffer
266 * @param[in, out] end_x The end x position of cropped source image buffer
267 * @param[in, out] end_y The end y position of cropped source image buffer
269 * @return @c 0 on success,
270 * otherwise a negative error value
272 * @retval #IMAGE_UTIL_ERROR_NONE Successful
273 * @retval #IMAGE_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
274 * @retval #IMAGE_UTIL_ERROR_INVALID_OPERATION Invalid operation
275 * @retval #IMAGE_UTIL_ERROR_PERMISSION_DENIED The application does not have the privilege to call this funtion
277 * @pre image_util_transform_create().\n
278 * image_util_transform_set_crop_area().
280 * @see image_util_transform_create()
281 * @see image_util_transform_destroy()
283 int image_util_transform_get_crop_area(transformation_h handle, unsigned int *start_x, unsigned int *start_y, unsigned int *end_x, unsigned int *end_y);
286 * @brief Transform the image for given image util handle.
289 * @remarks If H/W acceleration is not set, transformation is done via S/W acceleration.
291 * @details The function execute asynchronously, which contains complete callback \n
292 * If you set more than two transforming, the order of running is crop or resolution, colorspace converting, rotaion. \n
294 * @param[in] handle The handle of transform
295 * @param[in] src The handle to image util transform
296 * @param[in] callback The callback function to be invoked
297 * @param[in] user_data The user data to be passed to the callback function
299 * @return @c 0 on success,
300 * otherwise a negative error value
302 * @retval #IMAGE_UTIL_ERROR_NONE Successful
303 * @retval #IMAGE_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
304 * @retval #IMAGE_UTIL_ERROR_INVALID_OPERATION Invalid operation
305 * @retval #IMAGE_UTIL_ERROR_PERMISSION_DENIED The application does not have the privilege to call this funtion
307 * @see image_util_transform_create()
308 * @see image_util_transform_set_hardware_acceleration
309 * @see image_util_transform_destroy()
311 int image_util_transform_run(transformation_h handle, media_packet_h src, image_util_transform_completed_cb callback, void *user_data);
314 * @brief Destroys a handle to image util.
317 * @details The function frees all resources related to the image util handle. The image util
318 * handle no longer can be used to perform any operation. A new image util handle
319 * has to be created before the next usage.
321 * @param[in] handle The handle to image util transform
323 * @return @c 0 on success,
324 * otherwise a negative error value
326 * @retval #IMAGE_UTIL_ERROR_NONE Successful
327 * @retval #IMAGE_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
328 * @retval #IMAGE_UTIL_ERROR_PERMISSION_DENIED The application does not have the privilege to call this funtion
330 * @see image_util_transform_create()
333 int image_util_transform_destroy(transformation_h handle);
336 * @brief Called once for each supported JPEG encode/decode colorspace.
339 * @param[in] colorspace The colorspace
340 * @param[in] user_data The user data passed from the foreach function
342 * @return @c true to continue with the next iteration of the loop, \n
343 * otherwise @c false to break out of the loop
345 * @pre image_util_foreach_supported_jpeg_colorspace() invokes this callback.
347 * @see image_util_foreach_supported_jpeg_colorspace()
348 * @see image_util_encode_jpeg()
349 * @see image_util_encode_jpeg_to_memory()
350 * @see image_util_decode_jpeg()
351 * @see image_util_decode_jpeg_from_memory()
353 typedef bool(*image_util_supported_jpeg_colorspace_cb)(image_util_colorspace_e colorspace, void *user_data);
356 * @brief Retrieves all supported JPEG encoding/decoding colorspace by invoking a callback function once for each one.
359 * @param[in] callback The callback function to invoke
360 * @param[in] user_data The user data to be passed to the callback function
361 * @return 0 on success,
362 * otherwise a negative error value
364 * @retval #IMAGE_UTIL_ERROR_NONE Successful
365 * @retval #IMAGE_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
366 * @retval #IMAGE_UTIL_ERROR_PERMISSION_DENIED The application does not have the privilege to call this funtion
367 * @post This function invokes image_util_supported_jpeg_colorspace_cb() repeatedly to retrieve each supported JPEG encoding/decoding colorspace.
369 * @see image_util_supported_jpeg_colorspace_cb()
370 * @see image_util_encode_jpeg()
371 * @see image_util_encode_jpeg_to_memory()
372 * @see image_util_decode_jpeg()
373 * @see image_util_decode_jpeg_from_memory()
375 int image_util_foreach_supported_jpeg_colorspace(image_util_supported_jpeg_colorspace_cb callback, void *user_data);
378 * @brief Calculates the size of the image buffer for the specified resolution and colorspace.
381 * @param[in] width The image width
382 * @param[in] height The image height
383 * @param[in] colorspace The image colorspace
384 * @param[out] size The Calculated buffer size
386 * @return @c 0 on success,
387 * otherwise a negative error value
389 * @retval #IMAGE_UTIL_ERROR_NONE Successful
390 * @retval #IMAGE_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
391 * @retval #IMAGE_UTIL_ERROR_PERMISSION_DENIED The application does not have the privilege to call this funtion
393 * @see image_util_transform_run()
394 * @see image_util_decode_jpeg()
395 * @see image_util_decode_jpeg_from_memory()
396 * @see image_util_encode_jpeg()
397 * @see image_util_encode_jpeg_to_memory()
399 int image_util_calculate_buffer_size(int width, int height, image_util_colorspace_e colorspace , unsigned int *size);
403 * @brief Converts the image's colorspace.
406 * @remarks You must get the @a dest buffer size using image_util_transform_calculate_buffer_size().
408 * @param[in, out] dest The image buffer for result \n
409 * Must be allocated by the user
410 * @param[in] dest_colorspace The colorspace to be converted
411 * @param[in] src The source image buffer
412 * @param[in] width The width of the source image
413 * @param[in] height The height of the source image
414 * @param[in] src_colorspace The colorspace of the source image buffer
416 * @return %c 0 on success
417 * otherwise a negative error value
419 * @retval #IMAGE_UTIL_ERROR_NONE Successful
420 * @retval #IMAGE_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
421 * @retval #IMAGE_UTIL_ERROR_INVALID_OPERATION Invalid operation
422 * @retval #IMAGE_UTIL_ERROR_PERMISSION_DENIED The application does not have the privilege to call this funtion
424 * @see image_util_transform_calculate_buffer_size()
425 * @see image_util_transform_create()
426 * @see image_util_transform_destroy()
428 int image_util_convert_colorspace(unsigned char *dest, image_util_colorspace_e dest_colorspace, const unsigned char *src, int width, int height, image_util_colorspace_e src_colorspace);
432 * @brief Resizes the image to the specified destination width and height.
435 * @remarks Because of YUV format padding, the destination image size can be adjusted.
437 * @param[in, out] dest The image buffer for result \n
438 * Must be allocated by the user.
439 * @param[in, out] dest_width The image width to resize, and resized width
440 * @param[in, out] dest_height The image height to resize, and resized height
441 * @param[in] src The image buffer for the original image
442 * @param[in] src_width The original image width
443 * @param[in] src_height The original image height
444 * @param[in] colorspace The image colorspace
447 * @return @c 0 on success,
448 * otherwise a negative error value
450 * @retval #IMAGE_UTIL_ERROR_NONE Successful
451 * @retval #IMAGE_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
452 * @retval #IMAGE_UTIL_ERROR_INVALID_OPERATION Invalid operation
453 * @retval #IMAGE_UTIL_ERROR_PERMISSION_DENIED The application does not have the privilege to call this funtion
455 * @see image_util_transform_calculate_buffer_size()
457 int image_util_resize(unsigned char *dest, int *dest_width, int *dest_height, const unsigned char *src, int src_width, int src_height, image_util_colorspace_e colorspace);
461 * @brief Rotates the image to the specified angle given in degrees.
464 * @remarks Because of YUV format padding, the destination image size can be adjusted.
465 * Rotations are supported only in these color spaces\n
466 * #IMAGE_UTIL_COLORSPACE_YV12\n
467 * #IMAGE_UTIL_COLORSPACE_I420\n
468 * #IMAGE_UTIL_COLORSPACE_NV12\n
469 * #IMAGE_UTIL_COLORSPACE_RGB888\n
470 * #IMAGE_UTIL_COLORSPACE_RGB565\n
471 * #IMAGE_UTIL_COLORSPACE_ARGB8888\n
472 * #IMAGE_UTIL_COLORSPACE_BGRA8888\n
473 * #IMAGE_UTIL_COLORSPACE_RGBA8888\n
474 * #IMAGE_UTIL_COLORSPACE_BGRX8888\n.
476 * @param[in, out] dest The image buffer for result \n
477 * Must be allocated by the user.
478 * @param[out] dest_width The rotated image width
479 * @param[out] dest_height The rotated image height
480 * @param[in] dest_rotation The angle to rotate
481 * @param[in] src The image buffer for the original image
482 * @param[in] src_width The original image width
483 * @param[in] src_height The original image height
484 * @param[in] colorspace The image colorspace
486 * @return @c 0 on success,
487 * otherwise a negative error value
489 * @retval #IMAGE_UTIL_ERROR_NONE Successful
490 * @retval #IMAGE_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
491 * @retval #IMAGE_UTIL_ERROR_INVALID_OPERATION Invalid operation
492 * @retval #IMAGE_UTIL_ERROR_PERMISSION_DENIED The application does not have the privilege to call this funtion
494 * @see image_util_transform_calculate_buffer_size()
496 int image_util_rotate(unsigned char *dest, int *dest_width, int *dest_height, image_util_rotation_e dest_rotation, const unsigned char *src, int src_width, int src_height, image_util_colorspace_e colorspace);
500 * @brief Crops the image to the specified point and dimension.
503 * @remarks Because of YUV format padding, the destination image size can be adjusted.
504 * Crop is supported only in these colorspaces\n
505 * #IMAGE_UTIL_COLORSPACE_YV12 \n
506 * #IMAGE_UTIL_COLORSPACE_I420 \n
507 * #IMAGE_UTIL_COLORSPACE_RGB888 \n
508 * #IMAGE_UTIL_COLORSPACE_RGB565 \n
509 * #IMAGE_UTIL_COLORSPACE_ARGB8888\n
510 * #IMAGE_UTIL_COLORSPACE_BGRA8888\n
511 * #IMAGE_UTIL_COLORSPACE_RGBA8888\n
512 * #IMAGE_UTIL_COLORSPACE_BGRX8888\n.
514 * @param[in, out] dest The image buffer for result. Must be allocated by you
515 * @param[in] x The starting x-axis of crop
516 * @param[in] y The starting y-axis of crop
517 * @param[in/out] width The image width to crop, and cropped width
518 * @param[in/out] height The image height to crop, and cropped height
519 * @param[in] src The image buffer for original image
520 * @param[in] src_width The original image width
521 * @param[in] src_height The original image height
522 * @param[in] colorspace The image colorspace
524 * @return @c 0 on success,
525 * otherwise a negative error value
527 * @retval #IMAGE_UTIL_ERROR_NONE Successful
528 * @retval #IMAGE_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
529 * @retval #IMAGE_UTIL_ERROR_INVALID_OPERATION Invalid operation
530 * @retval #IMAGE_UTIL_ERROR_PERMISSION_DENIED The application does not have the privilege to call this funtion
532 * @see image_util_transform_calculate_buffer_size()
534 int image_util_crop(unsigned char *dest, int x, int y, int *width, int *height, const unsigned char *src, int src_width, int src_height, image_util_colorspace_e colorspace);
540 * @brief Decodes the JPEG image to the buffer.
543 * @remarks You must release @a image_buffer using free().\n
544 * http://tizen.org/privilege/mediastorage is needed if input or output path are relevant to media storage.\n
545 * http://tizen.org/privilege/externalstorage is needed if input or output path are relevant to external storage.\n
546 * If you decode the JPEG image which has odd numbered width or height to YUV colorspace, \n
547 * the width or height of decoded data will be rounded down to even numbered width or height.
549 * @param[in] path The image file path
550 * @param[in] colorspace The decoded image colorspace
551 * @param[out] image_buffer The image buffer for the decoded image
552 * @param[out] width The image width
553 * @param[out] height The image height
554 * @param[out] size The image buffer size
556 * @return @c 0 on success,
557 * otherwise a negative error value
559 * @retval #IMAGE_UTIL_ERROR_NONE Successful
560 * @retval #IMAGE_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
561 * @retval #IMAGE_UTIL_ERROR_OUT_OF_MEMORY out of memory
562 * @retval #IMAGE_UTIL_ERROR_NOT_SUPPORTED_FORMAT Format not supported
563 * @retval #IMAGE_UTIL_ERROR_INVALID_OPERATION Invalid operation
564 * @retval #IMAGE_UTIL_ERROR_PERMISSION_DENIED The application does not have the privilege to call this funtion
566 * @see image_util_supported_jpeg_colorspace_cb()
567 * @see image_util_decode_jpeg_from_memory()
568 * @see image_util_foreach_supported_jpeg_colorspace()
570 int image_util_decode_jpeg(const char *path, image_util_colorspace_e colorspace, unsigned char **image_buffer, int *width, int *height, unsigned int *size);
573 * @brief Decodes the JPEG image(in memory) to the buffer.
576 * @remarks You must release @a image_buffer using free().\n
577 * If you decode the JPEG image which has odd numbered width or height to YUV colorspace, \n
578 * the width or height of decoded data will be rounded down to even numbered width or height.
580 * @param[in] jpeg_buffer The JPEG image buffer
581 * @param[in] jpeg_size The JPEG image buffer size
582 * @param[in] colorspace The decoded image colorspace
583 * @param[out] image_buffer The image buffer for the decoded image
584 * @param[out] width The image width
585 * @param[out] height The image height
586 * @param[out] size The image buffer size
588 * @return 0 on success,
589 * otherwise a negative error value
591 * @retval #IMAGE_UTIL_ERROR_NONE Successful
592 * @retval #IMAGE_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
593 * @retval #IMAGE_UTIL_ERROR_OUT_OF_MEMORY out of memory
594 * @retval #IMAGE_UTIL_ERROR_NOT_SUPPORTED_FORMAT Format not supported
595 * @retval #IMAGE_UTIL_ERROR_INVALID_OPERATION Invalid operation
596 * @retval #IMAGE_UTIL_ERROR_PERMISSION_DENIED The application does not have the privilege to call this funtion
598 * @see image_util_supported_jpeg_colorspace_cb()
599 * @see image_util_decode_jpeg()
600 * @see image_util_foreach_supported_jpeg_colorspace()
602 int image_util_decode_jpeg_from_memory(const unsigned char *jpeg_buffer, int jpeg_size, image_util_colorspace_e colorspace, unsigned char **image_buffer, int *width, int *height, unsigned int *size);
605 * @brief Decodes the JPEG image to the buffer with downscale decoding option.
608 * @remarks You must release @a image_buffer using free().\n
609 * http://tizen.org/privilege/mediastorage is needed if input or output path are relevant to media storage.\n
610 * http://tizen.org/privilege/externalstorage is needed if input or output path are relevant to external storage.\n
611 * If you decode the JPEG image which has odd numbered width or height to YUV colorspace, \n
612 * the width or height of decoded data will be rounded down to even numbered width or height.
614 * @param[in] path The image file path
615 * @param[in] colorspace The decoded image colorspace
616 * @param[in] downscale The downscale value
617 * @param[out] image_buffer The image buffer for the decoded image
618 * @param[out] width The image width
619 * @param[out] height The image height
620 * @param[out] size The image buffer size
622 * @return @c 0 on success,
623 * otherwise a negative error value
625 * @retval #IMAGE_UTIL_ERROR_NONE Successful
626 * @retval #IMAGE_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
627 * @retval #IMAGE_UTIL_ERROR_OUT_OF_MEMORY out of memory
628 * @retval #IMAGE_UTIL_ERROR_NOT_SUPPORTED_FORMAT Format not supported
629 * @retval #IMAGE_UTIL_ERROR_INVALID_OPERATION Invalid operation
630 * @retval #IMAGE_UTIL_ERROR_PERMISSION_DENIED The application does not have the privilege to call this funtion
632 * @see image_util_supported_jpeg_colorspace_cb()
633 * @see image_util_decode_jpeg_from_memory()
634 * @see image_util_foreach_supported_jpeg_colorspace()
636 int image_util_decode_jpeg_with_downscale(const char *path, image_util_colorspace_e colorspace, image_util_scale_e downscale, unsigned char **image_buffer, int *width, int *height, unsigned int *size);
639 * @brief Decodes the JPEG image(in memory) to the buffer with downscale decoding option.
642 * @remarks You must release @a image_buffer using free().\n
643 * If you decode the JPEG image which has odd numbered width or height to YUV colorspace, \n
644 * the width or height of decoded data will be rounded down to even numbered width or height.
646 * @param[in] jpeg_buffer The JPEG image buffer
647 * @param[in] jpeg_size The JPEG image buffer size
648 * @param[in] colorspace The decoded image colorspace
649 * @param[in] downscale The downscale value
650 * @param[out] image_buffer The image buffer for the decoded image
651 * @param[out] width The image width
652 * @param[out] height The image height
653 * @param[out] size The image buffer size
655 * @return @c 0 on success,
656 * otherwise a negative error value
658 * @retval #IMAGE_UTIL_ERROR_NONE Successful
659 * @retval #IMAGE_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
660 * @retval #IMAGE_UTIL_ERROR_OUT_OF_MEMORY out of memory
661 * @retval #IMAGE_UTIL_ERROR_NOT_SUPPORTED_FORMAT Format not supported
662 * @retval #IMAGE_UTIL_ERROR_INVALID_OPERATION Invalid operation
663 * @retval #IMAGE_UTIL_ERROR_PERMISSION_DENIED The application does not have the privilege to call this funtion
665 * @see image_util_supported_jpeg_colorspace_cb()
666 * @see image_util_decode_jpeg()
667 * @see image_util_foreach_supported_jpeg_colorspace()
669 int image_util_decode_jpeg_from_memory_with_downscale(const unsigned char *jpeg_buffer, int jpeg_size, image_util_colorspace_e colorspace, image_util_scale_e downscale, unsigned char **image_buffer, int *width, int *height, unsigned int *size);
672 * @brief Encodes the image to the JPEG image.
675 * @remarks http://tizen.org/privilege/mediastorage is needed if input or output path are relevant to media storage.\n
676 * http://tizen.org/privilege/externalstorage is needed if input or output path are relevant to external storage.
678 * @param[in] buffer The original image buffer
679 * @param[in] width The original image width
680 * @param[in] height The original image height
681 * @param[in] colorspace The original image colorspace
682 * @param[in] quality The quality for JPEG image encoding(1 ~ 100)
683 * @param[in] path The file path to be created
685 * @return 0 on success,
686 * otherwise a negative error value
688 * @retval #IMAGE_UTIL_ERROR_NONE Successful
689 * @retval #IMAGE_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
690 * @retval #IMAGE_UTIL_ERROR_NO_SUCH_FILE No such file
691 * @retval #IMAGE_UTIL_ERROR_NOT_SUPPORTED_FORMAT Format not supported
692 * @retval #IMAGE_UTIL_ERROR_INVALID_OPERATION Invalid operation
693 * @retval #IMAGE_UTIL_ERROR_PERMISSION_DENIED The application does not have the privilege to call this funtion
695 * @see image_util_supported_jpeg_colorspace_cb()
696 * @see image_util_foreach_supported_jpeg_colorspace()
697 * @see image_util_encode_jpeg_to_memory()
699 int image_util_encode_jpeg(const unsigned char *buffer, int width, int height, image_util_colorspace_e colorspace, int quality, const char *path);
702 * @brief Encodes the image to the JPEG image
705 * @remarks You must release @a jpeg_buffer using free().
707 * @param[in] image_buffer The original image buffer
708 * @param[in] width The image width
709 * @param[in] height The image height
710 * @param[in] colorspace The original image colorspace
711 * @param[in] quality The quality for JPEG image encoding(1 ~ 100)
712 * @param[out] jpeg_buffer The created JPEG image buffer \n
713 * The buffer is created by frameworks
714 * @param[out] jpeg_size The created jpeg image buffer size
716 * @return 0 on success,
717 * otherwise a negative error value
719 * @retval #IMAGE_UTIL_ERROR_NONE Successful
720 * @retval #IMAGE_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
721 * @retval #IMAGE_UTIL_ERROR_OUT_OF_MEMORY out of memory
722 * @retval #IMAGE_UTIL_ERROR_NOT_SUPPORTED_FORMAT Format not supported
723 * @retval #IMAGE_UTIL_ERROR_INVALID_OPERATION Invalid operation
724 * @retval #IMAGE_UTIL_ERROR_PERMISSION_DENIED The application does not have the privilege to call this funtion
726 * @see image_util_supported_jpeg_colorspace_cb()
727 * @see image_util_foreach_supported_jpeg_colorspace()
728 * @see image_util_encode_jpeg()
730 int image_util_encode_jpeg_to_memory(const unsigned char *image_buffer, int width, int height, image_util_colorspace_e colorspace, int quality, unsigned char **jpeg_buffer, unsigned int *jpeg_size);
733 * @brief Extracts representative color from an image buffer
735 * @remarks @a image_buffer should be RGB888 colorspace.
737 * @param[in] image_buffer The original image buffer
738 * @param[in] width The image width
739 * @param[in] height The image height
740 * @param[out] rgb_r The red color in RGB color space
741 * @param[out] rgb_g The green color in RGB color space
742 * @param[out] rgb_b The blue color in RGB color space
744 * @return 0 on success,
745 * otherwise a negative error value
747 * @retval #IMAGE_UTIL_ERROR_NONE Successful
748 * @retval #IMAGE_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
749 * @retval #IMAGE_UTIL_ERROR_INVALID_OPERATION Invalid operation
752 int image_util_extract_color_from_memory(const unsigned char *image_buffer, int width, int height, unsigned char *rgb_r, unsigned char *rgb_g, unsigned char *rgb_b);
755 * @brief Creates a handle to image util decoding.
758 * @details This function creates a handle to image util decoding.
760 * @remarks You must release the @a image util handle using image_util_decode_destroy().
762 * @param[in] image_type The type of image for which to create decode handle.
763 * @param[out] handle A handle to image util decoding
765 * @return @c 0 on success,
766 * otherwise a negative error value
768 * @retval #IMAGE_UTIL_ERROR_NONE Successful
769 * @retval #IMAGE_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
770 * @retval #IMAGE_UTIL_ERROR_OUT_OF_MEMORY Out of memory
772 * @see image_util_decode_destroy()
775 int image_util_decode_create(image_util_type_e image_type, image_util_decode_h *handle);
778 * @brief Sets the input file path from which to decode.
781 * @remarks One of image_util_decode_set_input_path() or image_util_decode_set_input_buffer() should be set.\n
782 * If both are set then the latest input set, is considered.\n
783 * http://tizen.org/privilege/mediastorage is needed if input or output path are relevant to media storage.\n
784 * http://tizen.org/privilege/externalstorage is needed if input or output path are relevant to external storage.
786 * @param[in] handle The handle to image util decoding
787 * @param[in] path The path to input image
789 * @return @c 0 on success,
790 * otherwise a negative error value
792 * @retval #IMAGE_UTIL_ERROR_NONE Successful
793 * @retval #IMAGE_UTIL_ERROR_NO_SUCH_FILE No such file
794 * @retval #IMAGE_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
795 * @retval #IMAGE_UTIL_ERROR_INVALID_OPERATION Invalid operation
796 * @retval #IMAGE_UTIL_ERROR_PERMISSION_DENIED The application does not have the privilege to call this funtion
798 * @pre image_util_decode_create()
800 * @post image_util_decode_run()/image_util_decode_run_async()
801 * @post image_util_decode_destroy()
803 * @see image_util_decode_create()
804 * @see image_util_decode_set_output_buffer()
805 * @see image_util_decode_run()
806 * @see image_util_decode_run_async()
807 * @see image_util_decode_destroy()
809 int image_util_decode_set_input_path(image_util_decode_h handle, const char *path);
812 * @brief Sets the input buffer from which to decode.
815 * @remarks One of image_util_decode_set_input_path() or image_util_decode_set_input_buffer() should be set.\n
816 * If both are set then the latest input set, is considered.
818 * @param[in] handle The handle to image util decoding
819 * @param[in] src_buffer The input image buffer
820 * @param[in] src_size The input image buffer size
822 * @return @c 0 on success,
823 * otherwise a negative error value
825 * @retval #IMAGE_UTIL_ERROR_NONE Successful
826 * @retval #IMAGE_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
827 * @retval #IMAGE_UTIL_ERROR_INVALID_OPERATION Invalid operation
829 * @pre image_util_decode_create()
831 * @post image_util_decode_run()/image_util_decode_run_async()
832 * @post image_util_decode_destroy()
834 * @see image_util_decode_create()
835 * @see image_util_decode_set_output_buffer()
836 * @see image_util_decode_run()
837 * @see image_util_decode_run_async()
838 * @see image_util_decode_destroy()
840 int image_util_decode_set_input_buffer(image_util_decode_h handle, const unsigned char *src_buffer, unsigned long long src_size);
843 * @brief Sets the output buffer to which the decoded buffer will be written to.
846 * @remarks Either image_util_decode_set_input_path() or image_util_decode_set_input_buffer() should be set.\n
847 * The decoded output buffer will be RGBA format.
849 * @param[in] handle The handle to image util decoding
850 * @param[in] dst_buffer The decoded output buffer
852 * @return @c 0 on success,
853 * otherwise a negative error value
855 * @retval #IMAGE_UTIL_ERROR_NONE Successful
856 * @retval #IMAGE_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
857 * @retval #IMAGE_UTIL_ERROR_INVALID_OPERATION Invalid operation
859 * @pre image_util_decode_create()
861 * @post image_util_decode_run()/image_util_decode_run_async()
862 * @post image_util_decode_destroy()
864 * @see image_util_decode_create()
865 * @see image_util_decode_set_input_path()
866 * @see image_util_decode_set_input_buffer()
867 * @see image_util_decode_run()
868 * @see image_util_decode_run_async()
869 * @see image_util_decode_destroy()
871 int image_util_decode_set_output_buffer(image_util_decode_h handle, unsigned char **dst_buffer);
874 * @brief Starts decoding of the image and fills the output buffer set using image_util_decode_set_output_buffer().
877 * @remarks The output will be stored in the pointer set using image_util_decode_set_output_buffer().
878 * The function executes synchronously.
880 * @param[in] handle The handle to image util decoding
881 * @param[out] width Width of the decoded image
882 * @param[out] height Height of the decoded image
883 * @param[out] size Size of the decoded image
885 * @return @c 0 on success,
886 * otherwise a negative error value
888 * @retval #IMAGE_UTIL_ERROR_NONE Successful
889 * @retval #IMAGE_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
890 * @retval #IMAGE_UTIL_ERROR_INVALID_OPERATION Invalid operation
892 * @pre image_util_decode_create()
893 * @pre image_util_decode_set_input_buffer()/image_util_decode_set_input_path().
894 * @pre image_util_decode_set_output_buffer()
896 * @post image_util_decode_destroy()
898 * @see image_util_decode_create()
899 * @see image_util_decode_set_input_path()
900 * @see image_util_decode_set_input_buffer()
901 * @see image_util_decode_set_output_buffer()
902 * @see image_util_decode_destroy()
904 int image_util_decode_run(image_util_decode_h handle, unsigned long *width, unsigned long *height, unsigned long long *size);
907 * @brief Starts decoding of the image and fills the output buffer set using image_util_decode_set_output_buffer().
910 * @remarks The output will be stored in the pointer set using image_util_decode_set_output_buffer().\n
911 * The function executes asynchronously, which contains complete callback.
913 * @param[in] handle The handle to image util decoding
914 * @param[in] callback The callback function to be invoked
915 * @param[in] user_data The user data to be passed to the callback function
917 * @return @c 0 on success,
918 * otherwise a negative error value
920 * @retval #IMAGE_UTIL_ERROR_NONE Successful
921 * @retval #IMAGE_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
922 * @retval #IMAGE_UTIL_ERROR_INVALID_OPERATION Invalid operation
924 * @pre image_util_decode_create()
925 * @pre image_util_decode_set_input_buffer()/image_util_decode_set_input_path().
926 * @pre image_util_decode_set_output_buffer()
928 * @post image_util_decode_destroy()
930 * @see image_util_decode_create()
931 * @see image_util_decode_set_input_path()
932 * @see image_util_decode_set_input_buffer()
933 * @see image_util_decode_set_output_buffer()
934 * @see image_util_decode_destroy()
936 int image_util_decode_run_async(image_util_decode_h handle, image_util_decode_completed_cb callback, void *user_data);
939 * @brief Destroys the image decoding handle.
942 * @remarks Any image handle created should be destroyed.
944 * @param[in] handle The handle to image util decoding
946 * @return @c 0 on success,
947 * otherwise a negative error value
949 * @retval #IMAGE_UTIL_ERROR_NONE Successful
950 * @retval #IMAGE_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
951 * @retval #IMAGE_UTIL_ERROR_INVALID_OPERATION Invalid operation
953 * @pre image_util_decode_create()
955 * @see image_util_decode_create()
957 int image_util_decode_destroy(image_util_decode_h handle);
960 * @brief Creates a handle to image util encoding.
963 * @details This function creates a handle to image util encoding.
965 * @remarks You must release the @a image util handle using image_util_encode_destroy().
967 * @param[in] image_type The type of image for which to create encode handle.
968 * @param[out] handle A handle to image util encoding
970 * @return @c 0 on success,
971 * otherwise a negative error value
973 * @retval #IMAGE_UTIL_ERROR_NONE Successful
974 * @retval #IMAGE_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
975 * @retval #IMAGE_UTIL_ERROR_OUT_OF_MEMORY Out of memory
977 * @see image_util_encode_destroy()
980 int image_util_encode_create(image_util_type_e image_type, image_util_encode_h *handle);
983 * @brief Sets the resolution of the encoded image.
986 * @remarks This should be called before calling image_util_encode_run().
988 * @param[in] handle The handle to image util encoding
989 * @param[in] width Width of the original image
990 * @param[in] height Height of the original image
992 * @return @c 0 on success,
993 * otherwise a negative error value
995 * @retval #IMAGE_UTIL_ERROR_NONE Successful
996 * @retval #IMAGE_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
997 * @retval #IMAGE_UTIL_ERROR_INVALID_OPERATION Invalid operation
999 * @pre image_util_encode_create()
1001 * @post image_util_encode_run()/image_util_encode_run_async()
1002 * @post image_util_encode_destroy()
1004 * @see image_util_encode_create()
1005 * @see image_util_encode_set_input_buffer()
1006 * @see image_util_encode_set_output_path()
1007 * @see image_util_encode_set_output_buffer()
1008 * @see image_util_encode_run()
1009 * @see image_util_encode_run_async()
1010 * @see image_util_encode_destroy()
1012 int image_util_encode_set_resolution(image_util_encode_h handle, unsigned long width, unsigned long height);
1015 * @brief Sets the compression value of png image encoding(0~9).
1018 * @remarks If application does not set this, then default compression of 6 is set.
1020 * @param[in] handle The handle to image util encoding
1021 * @param[in] compression The compression value valid from 0~9
1023 * @return @c 0 on success,
1024 * otherwise a negative error value
1026 * @retval #IMAGE_UTIL_ERROR_NONE Successful
1027 * @retval #IMAGE_UTIL_ERROR_NOT_SUPPORTED_FORMAT Format not supported
1028 * @retval #IMAGE_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
1029 * @retval #IMAGE_UTIL_ERROR_INVALID_OPERATION Invalid operation
1031 * @pre image_util_encode_create()
1033 * @post image_util_encode_run()/image_util_encode_run_async()
1034 * @post image_util_encode_destroy()
1036 * @see image_util_encode_create()
1037 * @see image_util_encode_set_resolution()
1038 * @see image_util_encode_set_input_buffer()
1039 * @see image_util_encode_set_output_path()
1040 * @see image_util_encode_set_output_buffer()
1041 * @see image_util_encode_run()
1042 * @see image_util_encode_run_async()
1043 * @see image_util_encode_destroy()
1045 int image_util_encode_set_png_compression(image_util_encode_h handle, image_util_png_compression_e compression);
1048 * @brief Sets the input buffer from which to encode.
1051 * @remarks Either image_util_encode_set_output_path() or image_util_encode_set_output_buffer() should be set.
1052 * The input buffer should be RGBA format.
1054 * @param[in] handle The handle to image util decoding
1055 * @param[in] src_buffer The input image buffer
1057 * @return @c 0 on success,
1058 * otherwise a negative error value
1060 * @retval #IMAGE_UTIL_ERROR_NONE Successful
1061 * @retval #IMAGE_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
1062 * @retval #IMAGE_UTIL_ERROR_INVALID_OPERATION Invalid operation
1064 * @pre image_util_encode_create()
1066 * @post image_util_encode_run()/image_util_encode_run_async()
1067 * @post image_util_encode_destroy()
1069 * @see image_util_encode_create()
1070 * @see image_util_encode_set_resolution()
1071 * @see image_util_encode_set_input_buffer()
1072 * @see image_util_encode_set_output_path()
1073 * @see image_util_encode_set_output_buffer()
1074 * @see image_util_encode_run()
1075 * @see image_util_encode_run_async()
1076 * @see image_util_encode_destroy()
1078 int image_util_encode_set_input_buffer(image_util_encode_h handle, const unsigned char *src_buffer);
1081 * @brief Sets the output path to which to encoded buffer will be written to.
1084 * @remarks One of image_util_encode_set_output_path() or image_util_encode_set_output_buffer() should be set.\n
1085 * If both are set then the latest output set is considered.\n
1086 * http://tizen.org/privilege/mediastorage is needed if input or output path are relevant to media storage.\n
1087 * http://tizen.org/privilege/externalstorage is needed if input or output path are relevant to external storage.
1089 * @param[in] handle The handle to image util encoding
1090 * @param[in] path The output file path
1092 * @return @c 0 on success,
1093 * otherwise a negative error value
1095 * @retval #IMAGE_UTIL_ERROR_NONE Successful
1096 * @retval #IMAGE_UTIL_ERROR_NO_SUCH_FILE No such file
1097 * @retval #IMAGE_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
1098 * @retval #IMAGE_UTIL_ERROR_INVALID_OPERATION Invalid operation
1099 * @retval #IMAGE_UTIL_ERROR_PERMISSION_DENIED The application does not have the privilege to call this funtion
1101 * @pre image_util_encode_create()
1103 * @post image_util_encode_run()/image_util_encode_run_async()
1104 * @post image_util_encode_destroy()
1106 * @see image_util_encode_create()
1107 * @see image_util_encode_set_resolution()
1108 * @see image_util_encode_set_input_buffer()
1109 * @see image_util_encode_run()
1110 * @see image_util_encode_run_async()
1111 * @see image_util_encode_destroy()
1113 int image_util_encode_set_output_path(image_util_encode_h handle, const char *path);
1116 * @brief Sets the output buffer to which to encoded buffer will be written to.
1119 * @remarks One of image_util_encode_set_output_path() or image_util_encode_set_output_buffer() should be set.\n
1120 * If both are set then the latest output set is considered.
1122 * @param[in] handle The handle to image util encoding
1123 * @param[in] dst_buffer The output image buffer
1125 * @return @c 0 on success,
1126 * otherwise a negative error value
1128 * @retval #IMAGE_UTIL_ERROR_NONE Successful
1129 * @retval #IMAGE_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
1130 * @retval #IMAGE_UTIL_ERROR_INVALID_OPERATION Invalid operation
1132 * @pre image_util_encode_create()
1134 * @post image_util_encode_run()/image_util_encode_run_async()
1135 * @post image_util_encode_destroy()
1137 * @see image_util_encode_create()
1138 * @see image_util_encode_set_resolution()
1139 * @see image_util_encode_set_input_buffer()
1140 * @see image_util_encode_run()
1141 * @see image_util_encode_run_async()
1142 * @see image_util_encode_destroy()
1144 int image_util_encode_set_output_buffer(image_util_encode_h handle, unsigned char **dst_buffer);
1147 * @brief Starts encoding of the image and fills the output buffer, set using image_util_encode_set_output_buffer() or image_util_encode_set_output_path().
1150 * @remarks The output will be stored in the pointer set to image_util_encode_set_output_buffer() or image_util_encode_set_output_path().
1151 * The function executes synchronously.
1153 * @param[in] handle The handle to image util encoding
1154 * @param[out] size Size of the encoded image
1156 * @return @c 0 on success,
1157 * otherwise a negative error value
1159 * @retval #IMAGE_UTIL_ERROR_NONE Successful
1160 * @retval #IMAGE_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
1161 * @retval #IMAGE_UTIL_ERROR_INVALID_OPERATION Invalid operation
1163 * @pre image_util_encode_create()
1164 * @pre image_util_encode_set_resolution()
1165 * @pre image_util_encode_set_input_buffer()
1166 * @pre image_util_encode_set_output_buffer()/image_util_encode_set_output_path()
1168 * @post image_util_encode_destroy()
1170 * @see image_util_encode_create()
1171 * @see image_util_encode_set_resolution()
1172 * @see image_util_encode_set_input_buffer()
1173 * @see image_util_encode_set_output_path()
1174 * @see image_util_encode_set_output_buffer()
1175 * @see image_util_encode_destroy()
1177 int image_util_encode_run(image_util_encode_h handle, unsigned long long *size);
1180 * @brief Starts encoding of the image and fills the output buffer, set using image_util_encode_set_output_buffer() or image_util_encode_set_output_path().
1183 * @remarks The output will be stored in the pointer set to image_util_encode_set_output_buffer() or image_util_encode_set_output_path().\n
1184 * The function executes asynchronously, which contains complete callback.
1186 * @param[in] handle The handle to image util encoding
1187 * @param[in] callback The callback function to be invoked
1188 * @param[in] user_data The user data to be passed to the callback function
1190 * @return @c 0 on success,
1191 * otherwise a negative error value
1193 * @retval #IMAGE_UTIL_ERROR_NONE Successful
1194 * @retval #IMAGE_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
1195 * @retval #IMAGE_UTIL_ERROR_INVALID_OPERATION Invalid operation
1197 * @pre image_util_encode_create()
1198 * @pre image_util_encode_set_resolution()
1199 * @pre image_util_encode_set_input_buffer()
1200 * @pre image_util_encode_set_output_buffer()/image_util_encode_set_output_path()
1202 * @post image_util_encode_destroy()
1204 * @see image_util_encode_create()
1205 * @see image_util_encode_set_resolution()
1206 * @see image_util_encode_set_input_buffer()
1207 * @see image_util_encode_set_output_path()
1208 * @see image_util_encode_set_output_buffer()
1209 * @see image_util_encode_destroy()
1211 int image_util_encode_run_async(image_util_encode_h handle, image_util_encode_completed_cb callback, void *user_data);
1214 * @brief Destroys the image encoding handle.
1217 * @remarks Any image handle created should be destroyed.
1219 * @param[in] handle The handle to image util encoding
1221 * @return @c 0 on success,
1222 * otherwise a negative error value
1224 * @retval #IMAGE_UTIL_ERROR_NONE Successful
1225 * @retval #IMAGE_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
1226 * @retval #IMAGE_UTIL_ERROR_INVALID_OPERATION Invalid operation
1228 * @pre image_util_encode_create()
1230 * @see image_util_encode_create()
1232 int image_util_encode_destroy(image_util_encode_h handle);
1242 #endif /* __TIZEN_MEDIA_IMAGE_UTIL_H__ */