4 * Copyright (c) 2018 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: YoungHun Kim <yh8004.kim@samsung.com>
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
22 #ifndef __MM_UTILITY_MAGICK_H__
23 #define __MM_UTILITY_MAGICK_H__
29 #include "mm_util_type.h"
31 typedef void *mm_util_image_h;
34 * Image rotation types
37 MM_UTIL_ROTATE_0 = 0, /**< Rotation 0 degree - no effect */
38 MM_UTIL_ROTATE_90 = 90, /**< Rotation 90 degree */
39 MM_UTIL_ROTATE_180 = 180, /**< Rotation 180 degree */
40 MM_UTIL_ROTATE_270 = 270, /**< Rotation 270 degree */
41 MM_UTIL_ROTATE_FLIP_HORZ, /**< Flip horizontal */
42 MM_UTIL_ROTATE_FLIP_VERT, /**< Flip vertial */
43 MM_UTIL_ROTATE_NUM /**< Number of rotation types */
44 } mm_util_magick_rotate_type;
52 IMG_CODEC_UNKNOWN_TYPE,
53 } mm_util_img_codec_type;
55 int mm_util_create_handle(mm_util_image_h *handle, const unsigned char *buffer, unsigned int width, unsigned int height, size_t size, mm_util_color_format_e format);
57 /*You must release buffer using free().*/
58 int mm_util_get_image(mm_util_image_h handle, unsigned char **buffer, unsigned int *width, unsigned int *height, size_t *size, mm_util_color_format_e *format);
59 int mm_util_destroy_handle(mm_util_image_h handle);
61 int mm_util_rotate_B_B(mm_util_image_h src_handle, mm_util_magick_rotate_type angle, mm_util_image_h *dst_handle);
62 int mm_util_rotate_B_P(mm_util_image_h src_handle, mm_util_magick_rotate_type angle, const char *dst_path);
63 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);
64 int mm_util_rotate_P_P(const char *src_path, mm_util_magick_rotate_type angle, const char *dst_path);
66 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);
67 int mm_util_resize_B_P(mm_util_image_h src_handle, unsigned int req_width, unsigned int req_height, const char *dst_path);
68 int mm_util_resize_P_B(const char *src_path, unsigned int req_width, unsigned int req_height, mm_util_color_format_e req_format, mm_util_image_h *dst_handle);
69 int mm_util_resize_P_P(const char *src_path, unsigned int req_width, unsigned int req_height, const char *dst_path);
71 int mm_util_convert_B_B(mm_util_image_h src_handle, mm_util_color_format_e req_format, mm_util_image_h *dst_handle);
73 int mm_util_extract_image_info(const char *path, mm_util_img_codec_type *type, unsigned int *width, unsigned int *height);
79 #endif /*__MM_UTILITY_MAGICK_H__*/