From 01b5388672ea4e5449a15d0c546372730b863beb Mon Sep 17 00:00:00 2001 From: "jiyong.min" Date: Wed, 29 Apr 2020 12:59:22 +0900 Subject: [PATCH] Unify rotate type enum - 'mm_util_img_rotate_type' and 'mm_util_magick_rotate_type' had duplicated enum type. So we unified the type to 'mm_util_rotate_type_e'. Change-Id: I48bf39b0b2e8731d4fa4ad3846c181a19712be99 --- common/include/mm_util_type.h | 13 +++++ imgp/include/mm_util_imgp.h | 12 +---- imgp/include/mm_util_imgp_internal.h | 2 +- imgp/mm_util_imgp.c | 4 +- magick/include/mm_util_magick.h | 21 ++------ magick/mm_util_magick.c | 91 ++++++++++++++++++++-------------- magick/test/mm_util_magick_testsuite.c | 48 +++++++++--------- packaging/libmm-utility.spec | 2 +- 8 files changed, 101 insertions(+), 92 deletions(-) diff --git a/common/include/mm_util_type.h b/common/include/mm_util_type.h index 00b8541..fa04c6a 100755 --- a/common/include/mm_util_type.h +++ b/common/include/mm_util_type.h @@ -74,6 +74,19 @@ typedef enum { MM_UTIL_COLOR_NUM, /**< Number of image formats */ } mm_util_color_format_e; +/** + * Image rotation types + */ +typedef enum { + MM_UTIL_ROTATE_0, /**< Rotation 0 degree - no effect */ + MM_UTIL_ROTATE_90, /**< Rotation 90 degree */ + MM_UTIL_ROTATE_180, /**< Rotation 180 degree */ + MM_UTIL_ROTATE_270, /**< Rotation 270 degree */ + MM_UTIL_ROTATE_FLIP_HORZ, /**< Flip horizontal */ + MM_UTIL_ROTATE_FLIP_VERT, /**< Flip vertial */ + MM_UTIL_ROTATE_NUM /**< Number of rotation types */ +} mm_util_rotate_type_e; + typedef struct { unsigned int width; unsigned int height; diff --git a/imgp/include/mm_util_imgp.h b/imgp/include/mm_util_imgp.h index 0df3692..12c9aa3 100644 --- a/imgp/include/mm_util_imgp.h +++ b/imgp/include/mm_util_imgp.h @@ -31,20 +31,10 @@ extern "C" { #include "mm_util_type.h" -typedef enum { - MM_UTIL_ROTATE_0, /**< Rotation 0 degree - no effect */ - MM_UTIL_ROTATE_90, /**< Rotation 90 degree */ - MM_UTIL_ROTATE_180, /**< Rotation 180 degree */ - MM_UTIL_ROTATE_270, /**< Rotation 270 degree */ - MM_UTIL_ROTATE_FLIP_HORZ, /**< Flip horizontal */ - MM_UTIL_ROTATE_FLIP_VERT, /**< Flip vertial */ - MM_UTIL_ROTATE_NUM /**< Number of rotation types */ -} mm_util_img_rotate_type; - int mm_util_get_image_size(mm_util_color_format_e format, unsigned int width, unsigned int height, size_t *imgsize); int mm_util_convert_colorspace(mm_util_image_h src, mm_util_color_format_e color, mm_util_image_h *dst); int mm_util_resize_image(mm_util_image_h src, unsigned int width, unsigned int height, mm_util_image_h *dst); -int mm_util_rotate_image(mm_util_image_h src, mm_util_img_rotate_type angle, mm_util_image_h *dst); +int mm_util_rotate_image(mm_util_image_h src, mm_util_rotate_type_e angle, mm_util_image_h *dst); int mm_util_crop_image(mm_util_image_h src, unsigned int start_x, unsigned int start_y, unsigned int width, unsigned int height, mm_util_image_h *dst); diff --git a/imgp/include/mm_util_imgp_internal.h b/imgp/include/mm_util_imgp_internal.h index a167f6e..1f181dc 100644 --- a/imgp/include/mm_util_imgp_internal.h +++ b/imgp/include/mm_util_imgp_internal.h @@ -52,7 +52,7 @@ typedef struct _imgp_info_s { unsigned int output_stride; unsigned int output_elevation; size_t buffer_size; - mm_util_img_rotate_type angle; + mm_util_rotate_type_e angle; } imgp_info_s; /* Enumerations */ diff --git a/imgp/mm_util_imgp.c b/imgp/mm_util_imgp.c index 3049f2f..1109c37 100644 --- a/imgp/mm_util_imgp.c +++ b/imgp/mm_util_imgp.c @@ -274,7 +274,7 @@ static int __mm_util_get_crop_image_size(mm_util_color_format_e format, unsigned return MM_UTIL_ERROR_NONE; } -static int __mm_set_imgp_info_s(imgp_info_s *_imgp_info_s, mm_util_color_format_e src_format, unsigned int src_width, unsigned int src_height, mm_util_color_format_e dst_format, unsigned int dst_width, unsigned int dst_height, mm_util_img_rotate_type angle) +static int __mm_set_imgp_info_s(imgp_info_s *_imgp_info_s, mm_util_color_format_e src_format, unsigned int src_width, unsigned int src_height, mm_util_color_format_e dst_format, unsigned int dst_width, unsigned int dst_height, mm_util_rotate_type_e angle) { int ret = MM_UTIL_ERROR_NONE; @@ -615,7 +615,7 @@ ERROR: return ret; } -int mm_util_rotate_image(mm_util_image_h src, mm_util_img_rotate_type angle, mm_util_image_h *dst) +int mm_util_rotate_image(mm_util_image_h src, mm_util_rotate_type_e angle, mm_util_image_h *dst) { int ret = MM_UTIL_ERROR_NONE; IMGPInfoFunc _mm_util_imgp_func = NULL; diff --git a/magick/include/mm_util_magick.h b/magick/include/mm_util_magick.h index 8c6fa7a..110a9f1 100644 --- a/magick/include/mm_util_magick.h +++ b/magick/include/mm_util_magick.h @@ -29,19 +29,6 @@ extern "C" { #include "mm_util_type.h" #include "mm_util_image.h" -/** - * Image rotation types - */ -typedef enum { - MM_UTIL_ROTATE_0 = 0, /**< Rotation 0 degree - no effect */ - MM_UTIL_ROTATE_90 = 90, /**< Rotation 90 degree */ - MM_UTIL_ROTATE_180 = 180, /**< Rotation 180 degree */ - MM_UTIL_ROTATE_270 = 270, /**< Rotation 270 degree */ - MM_UTIL_ROTATE_FLIP_HORZ, /**< Flip horizontal */ - MM_UTIL_ROTATE_FLIP_VERT, /**< Flip vertial */ - MM_UTIL_ROTATE_NUM /**< Number of rotation types */ -} mm_util_magick_rotate_type; - typedef enum { IMG_CODEC_GIF = 0, IMG_CODEC_PNG, @@ -51,10 +38,10 @@ typedef enum { IMG_CODEC_UNKNOWN_TYPE, } mm_util_img_codec_type; -int mm_util_rotate_B_B(mm_util_image_h src_handle, mm_util_magick_rotate_type angle, mm_util_image_h *dst_handle); -int mm_util_rotate_B_P(mm_util_image_h src_handle, mm_util_magick_rotate_type angle, const char *dst_path); -int mm_util_rotate_P_B(const char *src_path, mm_util_magick_rotate_type angle, mm_util_color_format_e req_format, mm_util_image_h *dst_handle); -int mm_util_rotate_P_P(const char *src_path, mm_util_magick_rotate_type angle, const char *dst_path); +int mm_util_rotate_B_B(mm_util_image_h src_handle, mm_util_rotate_type_e rotation, mm_util_image_h *dst_handle); +int mm_util_rotate_B_P(mm_util_image_h src_handle, mm_util_rotate_type_e rotation, const char *dst_path); +int mm_util_rotate_P_B(const char *src_path, mm_util_rotate_type_e rotation, mm_util_color_format_e req_format, mm_util_image_h *dst_handle); +int mm_util_rotate_P_P(const char *src_path, mm_util_rotate_type_e rotation, const char *dst_path); int mm_util_resize_B_B(mm_util_image_h src_handle, unsigned int req_width, unsigned int req_height, mm_util_image_h *dst_handle); int mm_util_resize_B_P(mm_util_image_h src_handle, unsigned int req_width, unsigned int req_height, const char *dst_path); diff --git a/magick/mm_util_magick.c b/magick/mm_util_magick.c index f163c95..3141ca9 100644 --- a/magick/mm_util_magick.c +++ b/magick/mm_util_magick.c @@ -29,7 +29,7 @@ #include "mm_util_private.h" #include "mm_util_magick.h" -static bool __mm_util_check_angle(mm_util_magick_rotate_type angle); +static bool __mm_util_check_rotation(mm_util_rotate_type_e rotation); static void __mm_util_magick_log_method(const ExceptionType excep, const char *message) { @@ -144,7 +144,7 @@ static Image * __mm_util_constitute_image(mm_util_image_h handle, const char *ma return _image; } -static Image * __mm_util_rotate_image(Image *image, mm_util_magick_rotate_type angle) +static Image * __mm_util_rotate_image(Image *image, mm_util_rotate_type_e rotation) { Image *_processed_image = NULL; ExceptionInfo exception; @@ -155,14 +155,27 @@ static Image * __mm_util_rotate_image(Image *image, mm_util_magick_rotate_type a GetExceptionInfo(&exception); - if (angle <= MM_UTIL_ROTATE_270) { - _processed_image = RotateImage(image, angle, &exception); - } else if (angle == MM_UTIL_ROTATE_FLIP_HORZ) { + switch (rotation) { + case MM_UTIL_ROTATE_0: + case MM_UTIL_ROTATE_90: + case MM_UTIL_ROTATE_180: + case MM_UTIL_ROTATE_270: + /* + RotateImage(const Image *image,const double degrees, ExceptionInfo *exception) + degrees: Specifies the number of degrees to rotate the image. + degrees is rotation multiplied by 90. + */ + _processed_image = RotateImage(image, (rotation * 90), &exception); + break; + case MM_UTIL_ROTATE_FLIP_HORZ: _processed_image = FlopImage(image, &exception); - } else if (angle == MM_UTIL_ROTATE_FLIP_VERT) { + break; + case MM_UTIL_ROTATE_FLIP_VERT: _processed_image = FlipImage(image, &exception); - } else { - mm_util_error("Invalid angle. [%d]", angle); + break; + default: + mm_util_error("Invalid rotation. [%d]", rotation); + break; } if (_processed_image == NULL) { @@ -375,13 +388,19 @@ ERROR: return pixels; } -static bool __mm_util_check_angle(mm_util_magick_rotate_type angle) +static bool __mm_util_check_rotation(mm_util_rotate_type_e rotation) { - if ((angle == MM_UTIL_ROTATE_0) || (angle == MM_UTIL_ROTATE_90) || (angle == MM_UTIL_ROTATE_180) || (angle == MM_UTIL_ROTATE_270) || - (angle == MM_UTIL_ROTATE_FLIP_HORZ) || (angle == MM_UTIL_ROTATE_FLIP_VERT)) - return TRUE; - else - return FALSE; + switch (rotation) { + case MM_UTIL_ROTATE_0: + case MM_UTIL_ROTATE_90: + case MM_UTIL_ROTATE_180: + case MM_UTIL_ROTATE_270: + case MM_UTIL_ROTATE_FLIP_HORZ: + case MM_UTIL_ROTATE_FLIP_VERT: + return true; + default: + return false; + } } static int __mm_util_make_tmp_file(mm_util_img_codec_type type, char **path) @@ -475,7 +494,7 @@ ERROR: return ret; } -int mm_util_rotate_B_B(mm_util_image_h src_handle, mm_util_magick_rotate_type angle, mm_util_image_h *dst_handle) +int mm_util_rotate_B_B(mm_util_image_h src_handle, mm_util_rotate_type_e rotation, mm_util_image_h *dst_handle) { int ret = MM_UTIL_ERROR_NONE; mm_image_info_s *_src_handle = (mm_image_info_s*)src_handle; @@ -487,10 +506,10 @@ int mm_util_rotate_B_B(mm_util_image_h src_handle, mm_util_magick_rotate_type an void *pixels = 0; mm_util_retvm_if(src_handle == NULL, MM_UTIL_ERROR_INVALID_PARAMETER, "invalid handle"); - mm_util_retvm_if(!__mm_util_check_angle(angle), MM_UTIL_ERROR_INVALID_PARAMETER, "invalid angle [%d]", angle); + mm_util_retvm_if(!__mm_util_check_rotation(rotation), MM_UTIL_ERROR_INVALID_PARAMETER, "invalid rotation [%d]", rotation); mm_util_retvm_if(dst_handle == NULL, MM_UTIL_ERROR_INVALID_PARAMETER, "invalid dst_handle"); - mm_util_debug("angle [%d]", angle); + mm_util_debug("rotation [%d]", rotation); ret = __mm_util_get_map(_src_handle->color, &map); mm_util_retvm_if(ret != MM_UTIL_ERROR_NONE, ret, "fail to get map"); @@ -504,7 +523,7 @@ int mm_util_rotate_B_B(mm_util_image_h src_handle, mm_util_magick_rotate_type an goto ERROR; } - _processed_image = __mm_util_rotate_image(_image, angle); + _processed_image = __mm_util_rotate_image(_image, rotation); if (_processed_image == NULL) { mm_util_error("Error: __mm_util_rotate_image failed."); ret = MM_UTIL_ERROR_INVALID_OPERATION; @@ -535,7 +554,7 @@ ERROR: return ret; } -int mm_util_rotate_B_P(mm_util_image_h src_handle, mm_util_magick_rotate_type angle, const char *dst_path) +int mm_util_rotate_B_P(mm_util_image_h src_handle, mm_util_rotate_type_e rotation, const char *dst_path) { int ret = MM_UTIL_ERROR_NONE; mm_image_info_s *_src_handle = (mm_image_info_s*)src_handle; @@ -545,10 +564,10 @@ int mm_util_rotate_B_P(mm_util_image_h src_handle, mm_util_magick_rotate_type an ExceptionInfo exception; mm_util_retvm_if(src_handle == NULL, MM_UTIL_ERROR_INVALID_PARAMETER, "invalid handle"); - mm_util_retvm_if(!__mm_util_check_angle(angle), MM_UTIL_ERROR_INVALID_PARAMETER, "invalid angle [%d]", angle); + mm_util_retvm_if(!__mm_util_check_rotation(rotation), MM_UTIL_ERROR_INVALID_PARAMETER, "invalid rotation [%d]", rotation); mm_util_retvm_if(!MMUTIL_STRING_VALID(dst_path), MM_UTIL_ERROR_INVALID_PARAMETER, "invalid dst_path"); - mm_util_sec_debug("angle [%d] dst_path [%s]", angle, dst_path); + mm_util_sec_debug("rotation [%d] dst_path [%s]", rotation, dst_path); ret = __mm_util_get_map(_src_handle->color, &map); mm_util_retvm_if(ret != MM_UTIL_ERROR_NONE, ret, "fail to get map"); @@ -562,7 +581,7 @@ int mm_util_rotate_B_P(mm_util_image_h src_handle, mm_util_magick_rotate_type an goto ERROR; } - _processed_image = __mm_util_rotate_image(_image, angle); + _processed_image = __mm_util_rotate_image(_image, rotation); if (_processed_image == NULL) { mm_util_error("Error: __mm_util_rotate_image failed."); ret = MM_UTIL_ERROR_INVALID_OPERATION; @@ -582,7 +601,7 @@ ERROR: return ret; } -int mm_util_rotate_P_B(const char *src_path, mm_util_magick_rotate_type angle, mm_util_color_format_e req_format, mm_util_image_h *dst_handle) +int mm_util_rotate_P_B(const char *src_path, mm_util_rotate_type_e rotation, mm_util_color_format_e req_format, mm_util_image_h *dst_handle) { int ret = MM_UTIL_ERROR_NONE; char *map = NULL; @@ -593,10 +612,10 @@ int mm_util_rotate_P_B(const char *src_path, mm_util_magick_rotate_type angle, m void *pixels = 0; mm_util_retvm_if(!MMUTIL_STRING_VALID(src_path), MM_UTIL_ERROR_INVALID_PARAMETER, "invalid src_path"); - mm_util_retvm_if(!__mm_util_check_angle(angle), MM_UTIL_ERROR_INVALID_PARAMETER, "invalid angle [%d]", angle); + mm_util_retvm_if(!__mm_util_check_rotation(rotation), MM_UTIL_ERROR_INVALID_PARAMETER, "invalid rotation [%d]", rotation); mm_util_retvm_if(dst_handle == NULL, MM_UTIL_ERROR_INVALID_PARAMETER, "invalid dst_handle"); - mm_util_sec_debug("src_path [%s] angle [%d] req_format [%d]", src_path, angle, req_format); + mm_util_sec_debug("src_path [%s] rotation [%d] req_format [%d]", src_path, rotation, req_format); ret = __mm_util_get_map(req_format, &map); mm_util_retvm_if(ret != MM_UTIL_ERROR_NONE, ret, "fail to get map"); @@ -610,7 +629,7 @@ int mm_util_rotate_P_B(const char *src_path, mm_util_magick_rotate_type angle, m goto ERROR; } - _processed_image = __mm_util_rotate_image(_image, angle); + _processed_image = __mm_util_rotate_image(_image, rotation); if (_processed_image == NULL) { mm_util_error("Error: __mm_util_rotate_image failed."); ret = MM_UTIL_ERROR_INVALID_OPERATION; @@ -642,7 +661,7 @@ ERROR: } -int mm_util_rotate_P_P(const char *src_path, mm_util_magick_rotate_type angle, const char *dst_path) +int mm_util_rotate_P_P(const char *src_path, mm_util_rotate_type_e rotation, const char *dst_path) { int ret = MM_UTIL_ERROR_NONE; Image *_image = NULL; @@ -650,10 +669,10 @@ int mm_util_rotate_P_P(const char *src_path, mm_util_magick_rotate_type angle, c ExceptionInfo exception; mm_util_retvm_if(!MMUTIL_STRING_VALID(src_path), MM_UTIL_ERROR_INVALID_PARAMETER, "invalid src_path"); - mm_util_retvm_if(!__mm_util_check_angle(angle), MM_UTIL_ERROR_INVALID_PARAMETER, "invalid angle [%d]", angle); + mm_util_retvm_if(!__mm_util_check_rotation(rotation), MM_UTIL_ERROR_INVALID_PARAMETER, "invalid rotation [%d]", rotation); mm_util_retvm_if(!MMUTIL_STRING_VALID(dst_path), MM_UTIL_ERROR_INVALID_PARAMETER, "invalid dst_path"); - mm_util_sec_debug("src_path [%s] angle [%d] dst_path [%s]", src_path, angle, dst_path); + mm_util_sec_debug("src_path [%s] rotation [%d] dst_path [%s]", src_path, rotation, dst_path); __mm_util_init(&exception); @@ -664,7 +683,7 @@ int mm_util_rotate_P_P(const char *src_path, mm_util_magick_rotate_type angle, c goto ERROR; } - _processed_image = __mm_util_rotate_image(_image, angle); + _processed_image = __mm_util_rotate_image(_image, rotation); if (_processed_image == NULL) { mm_util_error("Error: __mm_util_rotate_image failed."); ret = MM_UTIL_ERROR_INVALID_OPERATION; @@ -1176,7 +1195,7 @@ int mm_util_resize_and_rotate_P_P(const char *src_path, unsigned int req_width, Image *_resized_image = NULL; Image *_rotated_image = NULL; ExceptionInfo exception; - mm_util_magick_rotate_type angle = MM_UTIL_ROTATE_0; + mm_util_rotate_type_e rotation = MM_UTIL_ROTATE_0; mm_util_retvm_if(!MMUTIL_STRING_VALID(src_path), MM_UTIL_ERROR_INVALID_PARAMETER, "invalid src_path"); mm_util_retvm_if((req_width == 0) || (req_height == 0), MM_UTIL_ERROR_INVALID_PARAMETER, "invalid size W[%d] H[%d]", req_width, req_height); @@ -1209,15 +1228,15 @@ int mm_util_resize_and_rotate_P_P(const char *src_path, unsigned int req_width, switch(_resized_image->orientation) { case TopRightOrientation: case RightTopOrientation: - angle = MM_UTIL_ROTATE_90; + rotation = MM_UTIL_ROTATE_90; break; case BottomRightOrientation: case RightBottomOrientation: - angle = MM_UTIL_ROTATE_180; + rotation = MM_UTIL_ROTATE_180; break; case BottomLeftOrientation: case LeftBottomOrientation: - angle = MM_UTIL_ROTATE_270; + rotation = MM_UTIL_ROTATE_270; break; case TopLeftOrientation: case LeftTopOrientation: @@ -1227,8 +1246,8 @@ int mm_util_resize_and_rotate_P_P(const char *src_path, unsigned int req_width, break; } - if (angle != MM_UTIL_ROTATE_0) { - _rotated_image = __mm_util_rotate_image(_resized_image, angle); + if (rotation != MM_UTIL_ROTATE_0) { + _rotated_image = __mm_util_rotate_image(_resized_image, rotation); if (_rotated_image == NULL) { mm_util_error("Error: __mm_util_resize_image failed."); ret = MM_UTIL_ERROR_INVALID_OPERATION; diff --git a/magick/test/mm_util_magick_testsuite.c b/magick/test/mm_util_magick_testsuite.c index 9999ff7..7ac1753 100644 --- a/magick/test/mm_util_magick_testsuite.c +++ b/magick/test/mm_util_magick_testsuite.c @@ -31,10 +31,10 @@ typedef enum { #define MM_UTIL_SAFE_FREE(src) { if (src) { free(src); src = NULL; } } -static int _magick_rotate_P_P_test(mm_util_magick_rotate_type angle); -static int _magick_rotate_P_B_test(mm_util_magick_rotate_type angle, mm_util_color_format_e req_format); -static int _magick_rotate_B_P_test(mm_util_magick_rotate_type angle, mm_util_color_format_e req_format); -static int _magick_rotate_B_B_test(mm_util_magick_rotate_type angle, mm_util_color_format_e req_format); +static int _magick_rotate_P_P_test(mm_util_rotate_type_e rotation); +static int _magick_rotate_P_B_test(mm_util_rotate_type_e rotation, mm_util_color_format_e req_format); +static int _magick_rotate_B_P_test(mm_util_rotate_type_e rotation, mm_util_color_format_e req_format); +static int _magick_rotate_B_B_test(mm_util_rotate_type_e rotation, mm_util_color_format_e req_format); static int _magick_resize_P_P_test(unsigned int req_width, unsigned int req_height); static int _magick_resize_P_B_test(unsigned int req_width, unsigned int req_height, mm_util_color_format_e req_format); static int _magick_resize_B_P_test(unsigned int req_width, unsigned int req_height, mm_util_color_format_e req_format); @@ -42,9 +42,9 @@ static int _magick_resize_B_B_test(unsigned int req_width, unsigned int req_heig static int _magick_convert_B_B_test(mm_util_color_format_e in_format, mm_util_color_format_e out_format); static int _magick_resize_and_rotate_P_P_test(unsigned int req_width, unsigned int req_height); -static char *__get_dst_path(mm_util_magick_rotate_type angle) +static char *__get_dst_path(mm_util_rotate_type_e rotation) { - switch (angle) { + switch (rotation) { case MM_UTIL_ROTATE_0: return "/opt/usr/home/owner/dst_0.jpg"; case MM_UTIL_ROTATE_90: @@ -58,16 +58,16 @@ static char *__get_dst_path(mm_util_magick_rotate_type angle) case MM_UTIL_ROTATE_FLIP_VERT: return "/opt/usr/home/owner/dst_V.jpg"; default: - printf("Invalid angle\n"); + printf("Invalid rotation\n"); return "/opt/usr/home/owner/dst_default.jpg"; } return NULL; } -static char *__get_dst_raw_path(mm_util_magick_rotate_type angle) +static char *__get_dst_raw_path(mm_util_rotate_type_e rotation) { - switch (angle) { + switch (rotation) { case MM_UTIL_ROTATE_0: return "/opt/usr/home/owner/dst_0.raw"; case MM_UTIL_ROTATE_90: @@ -81,7 +81,7 @@ static char *__get_dst_raw_path(mm_util_magick_rotate_type angle) case MM_UTIL_ROTATE_FLIP_VERT: return "/opt/usr/home/owner/dst_V.raw"; default: - printf("Invalid angle\n"); + printf("Invalid rotation\n"); return "/opt/usr/home/owner/dst_default.raw"; } @@ -153,14 +153,14 @@ static int __get_buffer_for_test(mm_util_color_format_e req_format, unsigned cha return ret; } -static int _magick_rotate_P_P_test(mm_util_magick_rotate_type angle) +static int _magick_rotate_P_P_test(mm_util_rotate_type_e rotation) { int ret = MM_UTIL_ERROR_NONE; char * src_path = "/opt/usr/home/owner/origin.jpg"; - printf("* Rotate P P Test * angle = [%d]* \n", angle); + printf("* Rotate P P Test * rotation = [%d]* \n", rotation); - ret = mm_util_rotate_P_P(src_path, angle, __get_dst_path(angle)); + ret = mm_util_rotate_P_P(src_path, rotation, __get_dst_path(rotation)); if (ret != MM_UTIL_ERROR_NONE) printf("Fail mm_util_rotate_P_P [%d]\n", ret); @@ -185,21 +185,21 @@ static int _magick_resize_P_P_test(unsigned int req_width, unsigned int req_heig return ret; } -static int _magick_rotate_P_B_test(mm_util_magick_rotate_type angle, mm_util_color_format_e req_format) +static int _magick_rotate_P_B_test(mm_util_rotate_type_e rotation, mm_util_color_format_e req_format) { int ret = MM_UTIL_ERROR_NONE; mm_util_image_h dst_handle = NULL; char * src_path = "/opt/usr/home/owner/origin.jpg"; - printf("* Rotate P B Test * angle = [%d] foramt = [%d] \n", angle, req_format); + printf("* Rotate P B Test * rotation = [%d] foramt = [%d] \n", rotation, req_format); - ret = mm_util_rotate_P_B(src_path, angle, req_format, &dst_handle); + ret = mm_util_rotate_P_B(src_path, rotation, req_format, &dst_handle); if (ret != MM_UTIL_ERROR_NONE) { printf("Fail mm_util_rotate_P_B [%d]\n", ret); return ret; } - __save_to_file(dst_handle, __get_dst_raw_path(angle)); + __save_to_file(dst_handle, __get_dst_raw_path(rotation)); mm_image_destroy_image(dst_handle); @@ -230,7 +230,7 @@ static int _magick_resize_P_B_test(unsigned int req_width, unsigned int req_heig return ret; } -static int _magick_rotate_B_P_test(mm_util_magick_rotate_type angle, mm_util_color_format_e req_format) +static int _magick_rotate_B_P_test(mm_util_rotate_type_e rotation, mm_util_color_format_e req_format) { int ret = MM_UTIL_ERROR_NONE; mm_util_image_h src_handle = NULL; @@ -240,7 +240,7 @@ static int _magick_rotate_B_P_test(mm_util_magick_rotate_type angle, mm_util_col size_t size = 0; mm_util_color_format_e format = MM_UTIL_COLOR_NUM; - printf("* Rotate B P Test * angle = [%d] \n", angle); + printf("* Rotate B P Test * rotation = [%d] \n", rotation); ret = __get_buffer_for_test(req_format, &buffer, &width, &height, &size, &format); if (ret != MM_UTIL_ERROR_NONE) { @@ -255,7 +255,7 @@ static int _magick_rotate_B_P_test(mm_util_magick_rotate_type angle, mm_util_col return ret; } - ret = mm_util_rotate_B_P(src_handle, angle, __get_dst_path(angle)); + ret = mm_util_rotate_B_P(src_handle, rotation, __get_dst_path(rotation)); if (ret != MM_UTIL_ERROR_NONE) printf("Fail mm_util_rotate_B_P [%d]\n", ret); @@ -305,7 +305,7 @@ static int _magick_resize_B_P_test(unsigned int req_width, unsigned int req_heig return ret; } -static int _magick_rotate_B_B_test(mm_util_magick_rotate_type angle, mm_util_color_format_e req_format) +static int _magick_rotate_B_B_test(mm_util_rotate_type_e rotation, mm_util_color_format_e req_format) { int ret = MM_UTIL_ERROR_NONE; mm_util_image_h src_handle = NULL; @@ -316,7 +316,7 @@ static int _magick_rotate_B_B_test(mm_util_magick_rotate_type angle, mm_util_col size_t size = 0; mm_util_color_format_e format = MM_UTIL_COLOR_NUM; - printf("* Rotate B B Test * angle = [%d] \n", angle); + printf("* Rotate B B Test * rotation = [%d] \n", rotation); ret = __get_buffer_for_test(req_format, &buffer, &width, &height, &size, &format); if (ret != MM_UTIL_ERROR_NONE) { @@ -331,13 +331,13 @@ static int _magick_rotate_B_B_test(mm_util_magick_rotate_type angle, mm_util_col return ret; } - ret = mm_util_rotate_B_B(src_handle, angle, &dst_handle); + ret = mm_util_rotate_B_B(src_handle, rotation, &dst_handle); if (ret != MM_UTIL_ERROR_NONE) printf("Fail mm_util_rotate_B_B [%d]\n", ret); MM_UTIL_SAFE_FREE(buffer); - __save_to_file(dst_handle, __get_dst_raw_path(angle)); + __save_to_file(dst_handle, __get_dst_raw_path(rotation)); mm_image_destroy_image(src_handle); mm_image_destroy_image(dst_handle); diff --git a/packaging/libmm-utility.spec b/packaging/libmm-utility.spec index 63bc55c..0e93c0a 100644 --- a/packaging/libmm-utility.spec +++ b/packaging/libmm-utility.spec @@ -1,6 +1,6 @@ Name: libmm-utility Summary: Multimedia Framework Utility Library -Version: 0.1.41 +Version: 0.1.42 Release: 0 Group: System/Libraries License: Apache-2.0 -- 2.7.4