From: hj kim Date: Wed, 21 Feb 2018 08:59:31 +0000 (+0900) Subject: Apply new mm_util_convert_colorspace() X-Git-Tag: submit/tizen/20180223.061228~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c80ba4fb9585ec4f896a53de895bb3b40669d799;p=platform%2Fcore%2Fapi%2Fimage-util.git Apply new mm_util_convert_colorspace() Change-Id: I6bd59d3d77f64ddb7fe020df17904da5b3cf83eb --- diff --git a/src/image_util_internal.c b/src/image_util_internal.c index cfd75da..536f40f 100755 --- a/src/image_util_internal.c +++ b/src/image_util_internal.c @@ -24,13 +24,19 @@ 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) { int err = MM_UTIL_ERROR_NONE; + unsigned int res_w = 0; + unsigned int res_h = 0; + unsigned char *res_buffer = NULL; + size_t res_buffer_size = 0; image_util_retvm_if((dest == NULL), IMAGE_UTIL_ERROR_INVALID_PARAMETER, "dest is null"); image_util_retvm_if((src == NULL), IMAGE_UTIL_ERROR_INVALID_PARAMETER, "src is null"); image_util_retvm_if((is_valid_colorspace(dest_colorspace) == FALSE), IMAGE_UTIL_ERROR_INVALID_PARAMETER, "Invalid dst_colorspace"); image_util_retvm_if((is_valid_colorspace(src_colorspace) == FALSE), IMAGE_UTIL_ERROR_INVALID_PARAMETER, "Invalid src_colorspace"); - err = mm_util_convert_colorspace(src, width, height, TYPECAST_COLOR(src_colorspace), dest, TYPECAST_COLOR(dest_colorspace)); + err = mm_util_convert_colorspace(src, width, height, TYPECAST_COLOR(src_colorspace), TYPECAST_COLOR(dest_colorspace), &res_buffer, &res_w, &res_h, &res_buffer_size); + if (err == MM_UTIL_ERROR_NONE) + memcpy(dest, res_buffer, res_buffer_size); return _image_error_capi(ERR_TYPE_TRANSFORM, err); }