#define BYTES_PER_PIXEL 4
-#define BMP_SAFE_FREE(src) { if(src != NULL) {free(src); src = NULL;} }
+#define BMP_SAFE_FREE(src) { if (src != NULL) {free(src); src = NULL; } }
void *__bitmap_create(int width, int height, unsigned int state);
unsigned char *__bitmap_get_buffer(void *bitmap);
/**
* format for gif
*/
-typedef enum
-{
+typedef enum {
MM_UTIL_GIF_FMT_RGBA8888, /**< RGBA8888 format */
} mm_util_gif_format;
/**
* Disposal mode for gif encoding
*/
-typedef enum
-{
+typedef enum {
MM_UTIL_GIF_DISPOSAL_UNSPECIFIED = 0, /**< No disposal specified. */
MM_UTIL_GIF_DISPOSAL_DO_NOT = 1, /**< Leave image in place. */
MM_UTIL_GIF_DISPOSAL_BACKGROUND = 2, /**< Set area too background color. */
typedef struct {
unsigned long long delay_time; /**< Pre-display delay in 0.01sec units */
- unsigned long width; /**< Width */
- unsigned long height; /**< Height */
- unsigned long x; /**< X position */
- unsigned long y; /**< Y position */
+ unsigned long width; /**< Width */
+ unsigned long height; /**< Height */
+ unsigned long x; /**< X position */
+ unsigned long y; /**< Y position */
bool is_transparent; /**< Is frame transparency set */
- GifColorType transparent_color; /**< Transparency color */
+ GifColorType transparent_color; /**< Transparency color */
mm_util_gif_disposal disposal_mode; /**< Disposal mode */
- void *data; /**< Data */
+ void *data; /**< Data */
} mm_util_gif_frame_data;
#ifdef GIF_ENCODER_V2
}
extension[0] = frame->disposal_mode << 2;
- if(frame->is_transparent) {
+ if (frame->is_transparent) {
extension[0] |= 1;
extension[3] = transparent_index;
} else {
mm_util_retvm_if(gif_image == NULL, MM_UTIL_ERROR_INVALID_PARAMETER, "Invalid parameter");
- unsigned long num_of_pixels = gif_image->image_desc.Width* gif_image->image_desc.Height;
+ unsigned long num_of_pixels = gif_image->image_desc.Width * gif_image->image_desc.Height;
/* make colormap and quantization for the color table of gif */
ret = __gif_extract_rgb(gif_image, num_of_pixels, &red, &green, &blue);
gif_image->graphic_control_block.TransparentColor = -1;
for (i = 0; i < gif_image->image_desc.ColorMap->ColorCount; i++) {
- if(gif_image->image_desc.ColorMap->Colors[i].Red == gif_image->transparent_color.Red &&
+ if (gif_image->image_desc.ColorMap->Colors[i].Red == gif_image->transparent_color.Red &&
gif_image->image_desc.ColorMap->Colors[i].Green == gif_image->transparent_color.Green &&
gif_image->image_desc.ColorMap->Colors[i].Blue == gif_image->transparent_color.Blue) {
gif_image->graphic_control_block.TransparentColor = i;
int _gif_encode_move_to_mem(const unsigned char *src, unsigned long src_size, void **dst, unsigned long *dst_size)
{
unsigned char *buffer = NULL;
- mm_util_retvm_if(src == NULL || dst == NULL || dst_size == NULL, MM_UTIL_ERROR_INVALID_PARAMETER, "Invalid parameter");
+ mm_util_retvm_if(src == NULL || dst == NULL || dst_size == NULL, MM_UTIL_ERROR_INVALID_PARAMETER, "Invalid parameter");
mm_util_retvm_if(src_size == 0, MM_UTIL_ERROR_INVALID_PARAMETER, "Invalid parameter");
mm_util_debug("src_size: %lu", src_size);
buffer = (unsigned char *)calloc(1, src_size);
mm_util_retvm_if(buffer == NULL, MM_UTIL_ERROR_OUT_OF_MEMORY, "memory allocation failed");
- memcpy(buffer, src, src_size);
+ memcpy(buffer, src, src_size);
*dst = buffer;
*dst_size = src_size;
mm_util_info("repeat = %d, count = %d", repeat_mode, repeat_count);
gif_file->is_repeat = repeat_mode;
- gif_file->repeat_count = repeat_count;
+ gif_file->repeat_count = repeat_count;
return MM_UTIL_ERROR_NONE;
}
mm_util_retvm_if(ret != MM_UTIL_ERROR_NONE, ret, "_gif_encode_close_file failed");
if (gif_file->filename != NULL) {
- ret= _gif_encode_move_to_file(gif_file->filename);
+ ret = _gif_encode_move_to_file(gif_file->filename);
mm_util_retvm_if(ret != MM_UTIL_ERROR_NONE, ret, "__move_tmp_to_origin failed");
} else if (gif_file->write_data_ptr.mem != NULL) {
ret = _gif_encode_move_to_mem(gif_file->buffer, gif_file->write_data_ptr.size,
mm_util_retvm_if(gif_image_h == NULL, MM_UTIL_ERROR_INVALID_PARAMETER, "Invalid parameter");
mm_util_retvm_if(gif_file->is_started, MM_UTIL_ERROR_INVALID_OPERATION, "Encoding has already started");
- if (index < gif_file->saved_image_count) {
+ if (index < gif_file->saved_image_count)
*gif_image_h = (mm_gif_image_h)gif_file->saved_image[index];
- } else {
+ else
*gif_image_h = NULL;
- }
return MM_UTIL_ERROR_NONE;
}
}
#ifdef GIF_ENCODER_V2
else if (!strcmp("encode-agif", argv[1]) || !strcmp("encode-mem-agif", argv[1])) {
- if (!strcmp("encode-mem-agif", argv[1])) {
+ if (!strcmp("encode-mem-agif", argv[1]))
g_encode_mem = TRUE;
- }
+
fprintf(stderr, "\tencode-agif %s\n", argv[1]);
struct dirent *dp = NULL;
DIR *fd = opendir(argv[2]);
if (g_encode_mem) {
ret = mm_util_gif_encode_set_mem(gif_file, (void **)&encoded_gif_mem, &encoded_gif_size);
fprintf(stderr, "\t mm_util_gif_encode_set_mem [%d]\n", ret);
- }
- else {
+ } else {
ret = mm_util_gif_encode_set_file(gif_file, ENCODED_FILEPATH);
fprintf(stderr, "\t mm_util_gif_enc_set_file [%d]\n", ret);
}
fprintf(stderr, "\t mm_util_gif_image_set_image [%d]\n", ret);
ret = mm_util_gif_image_set_delay_time(gif_image, 20);
fprintf(stderr, "\t mm_util_gif_image_set_delay_time [%d]\n", ret);
- ret = mm_util_gif_image_set_position(gif_image,0, 0,files[i].decoded.width, files[i].decoded.height);
+ ret = mm_util_gif_image_set_position(gif_image, 0, 0, files[i].decoded.width, files[i].decoded.height);
fprintf(stderr, "\t mm_util_gif_image_set_position [%d]\n", ret);
ret = mm_util_gif_image_set_disposal_mode(gif_image, MM_UTIL_GIF_DISPOSAL_UNSPECIFIED);
fprintf(stderr, "\t mm_util_gif_image_set_disposal_mode [%d]\n", ret);
#include <opencv/cv.h>
#include <opencv2/imgproc/imgproc_c.h>
-typedef struct _mm_util_imgcv_s
-{
+typedef struct _mm_util_imgcv_s {
IplImage *inImg;
int hBins; /**< Number of bins of Hue channle */
-/*\r
- * libmm-utility\r
- *\r
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.\r
- *\r
- * Contact: YoungHun Kim <yh8004.kim@samsung.com>\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- *\r
- */\r
-#ifndef __MM_UTILITY_DEBUG_H__\r
-#define __MM_UTILITY_DEBUG_H__\r
-\r
-#include <dlog.h>\r
-\r
-#ifdef __cplusplus\r
-extern "C"\r
-{\r
-#endif\r
-\r
-#ifdef LOG_TAG\r
-#undef LOG_TAG\r
-#endif\r
-\r
-#define LOG_TAG "MM_UTIL"\r
-\r
-#define FONT_COLOR_RESET "\033[0m"\r
-#define FONT_COLOR_RED "\033[31m"\r
-\r
-#define mm_util_debug(fmt, arg...) do { \\r
- LOGD(FONT_COLOR_RESET""fmt"", ##arg); \\r
- } while (0)\r
-\r
-#define mm_util_info(fmt, arg...) do { \\r
- LOGI(FONT_COLOR_RESET""fmt"", ##arg); \\r
- } while (0)\r
-\r
-#define mm_util_warn(fmt, arg...) do { \\r
- LOGW(FONT_COLOR_RESET""fmt"", ##arg); \\r
- } while (0)\r
-\r
-#define mm_util_error(fmt, arg...) do { \\r
- LOGE(FONT_COLOR_RED""fmt""FONT_COLOR_RESET, ##arg); \\r
- } while (0)\r
-\r
-#define mm_util_fenter() do { \\r
- LOGD(FONT_COLOR_RESET"<Enter>"); \\r
- } while (0)\r
-\r
-#define mm_util_fleave() do { \\r
- LOGD(FONT_COLOR_RESET"<Leave>"); \\r
- } while (0)\r
-\r
-#define mm_util_retm_if(expr, fmt, arg...) do { \\r
- if(expr) { \\r
- LOGE(FONT_COLOR_RED""fmt""FONT_COLOR_RESET, ##arg); \\r
- return; \\r
- } \\r
- } while (0)\r
-\r
-#define mm_util_retvm_if(expr, val, fmt, arg...) do { \\r
- if(expr) { \\r
- LOGE(FONT_COLOR_RED""fmt""FONT_COLOR_RESET, ##arg); \\r
- return (val); \\r
- } \\r
- } while (0)\r
-\r
-#define MMUTIL_SAFE_FREE(x) { if (x) { free(x); x = NULL; } }\r
-/**\r
-* @}\r
-*/\r
-\r
-#ifdef __cplusplus\r
-}\r
-#endif\r
-\r
-#endif /*__MM_UTILITY_DEBUG_H__*/\r
+/*
+ * libmm-utility
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: YoungHun Kim <yh8004.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+#ifndef __MM_UTILITY_DEBUG_H__
+#define __MM_UTILITY_DEBUG_H__
+
+#include <dlog.h>
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+#ifdef LOG_TAG
+#undef LOG_TAG
+#endif
+
+#define LOG_TAG "MM_UTIL"
+
+#define FONT_COLOR_RESET "\033[0m"
+#define FONT_COLOR_RED "\033[31m"
+
+#define mm_util_debug(fmt, arg...) do { \
+ LOGD(FONT_COLOR_RESET""fmt"", ##arg); \
+ } while (0)
+
+#define mm_util_info(fmt, arg...) do { \
+ LOGI(FONT_COLOR_RESET""fmt"", ##arg); \
+ } while (0)
+
+#define mm_util_warn(fmt, arg...) do { \
+ LOGW(FONT_COLOR_RESET""fmt"", ##arg); \
+ } while (0)
+
+#define mm_util_error(fmt, arg...) do { \
+ LOGE(FONT_COLOR_RED""fmt""FONT_COLOR_RESET, ##arg); \
+ } while (0)
+
+#define mm_util_fenter() do { \
+ LOGD(FONT_COLOR_RESET"<Enter>"); \
+ } while (0)
+
+#define mm_util_fleave() do { \
+ LOGD(FONT_COLOR_RESET"<Leave>"); \
+ } while (0)
+
+#define mm_util_retm_if(expr, fmt, arg...) do { \
+ if (expr) { \
+ LOGE(FONT_COLOR_RED""fmt""FONT_COLOR_RESET, ##arg); \
+ return; \
+ } \
+ } while (0)
+
+#define mm_util_retvm_if(expr, val, fmt, arg...) do { \
+ if (expr) { \
+ LOGE(FONT_COLOR_RED""fmt""FONT_COLOR_RESET, ##arg); \
+ return (val); \
+ } \
+ } while (0)
+
+#define MMUTIL_SAFE_FREE(x) { if (x) { free(x); x = NULL; } }
+/**
+* @}
+*/
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*__MM_UTILITY_DEBUG_H__*/
/**
* error type
*/
-typedef enum
-{
+typedef enum {
MM_UTIL_ERROR_NONE = 0, /**< Successful */
MM_UTIL_ERROR_INVALID_PARAMETER = -1, /**< Invalid parameter */
MM_UTIL_ERROR_OUT_OF_MEMORY = -2, /**< Out of memory */
/**
* Image formats
*/
-typedef enum
-{
+typedef enum {
/* YUV planar format */
MM_UTIL_IMG_FMT_YUV420 = 0x00, /**< YUV420 format - planer YV12*/
MM_UTIL_IMG_FMT_YUV422, /**< YUV422 format - planer */
/**
* Image rotation types
*/
-typedef enum
-{
+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 */
/**
*
- * @remark Transform Handle Creation
+ * @remark Transform Handle Creation
*
* @param imgp_handle [in] image_util_imgp_h
- * @return This function returns transform processor result value
+ * @return This function returns transform processor result value
* if the result is 0, then handle creation succeed
* else if the result is -1, then handle creation failed
*/
/**
*
- * @remark Transform Handle Creation
+ * @remark Transform Handle Creation
*
* @param imgp_handle [in] image_util_imgp_h
* @param mode [in] User can use the accelerated image processing
- * @return This function returns transform processor result value
+ * @return This function returns transform processor result value
* if the result is 0, then handle creation succeed
* else if the result is -1, then handle creation failed
*/
/**
*
- * @remark Transform Handle Creation
+ * @remark Transform Handle Creation
*
* @param imgp_handle [in] image_util_imgp_h
* @param colorspace [in] colorspace The colorspace of the destination image buffer
- * @return This function returns transform processor result value
+ * @return This function returns transform processor result value
* if the result is 0, then handle creation succeed
* else if the result is -1, then handle creation failed
*/
/**
*
- * @remark Transform Handle Creation
+ * @remark Transform Handle Creation
*
* @param imgp_handle [in] image_util_imgp_h
* @param width [in] width The width of destination image buffer
* @param height [in] height The height of destination image buffer
- * @return This function returns transform processor result value
+ * @return This function returns transform processor result value
* if the result is 0, then handle creation succeed
* else if the result is -1, then handle creation failed
*/
/**
*
- * @remark Transform Handle Creation
+ * @remark Transform Handle Creation
*
* @param imgp_handle [in] image_util_imgp_h
* @param rotation [in] dest_rotation The rotation value of destination image buffer
- * @return This function returns transform processor result value
+ * @return This function returns transform processor result value
* if the result is 0, then handle creation succeed
* else if the result is -1, then handle creation failed
*/
/**
*
- * @remark Transform Handle Creation
+ * @remark Transform Handle Creation
*
* @param imgp_handle [in] image_util_imgp_h
* @param start_x [in] The start x position of cropped image buffer
* @param end_x [in] The start x position of cropped image buffer
* @param end_y [in] The start y position of cropped image buffer
- * @return This function returns transform processor result value
+ * @return This function returns transform processor result value
* if the result is 0, then handle creation succeed
* else if the result is -1, then handle creation failed
*/
/**
*
- * @remark Transform Handle Creation
+ * @remark Transform Handle Creation
*
* @param imgp_handle [in] image_util_imgp_h
* @param is_completed [in/out] Users can obtain the value of the conversion about whether to complete
- * @return This function returns transform processor result value
+ * @return This function returns transform processor result value
* if the result is 0, then handle creation succeed
* else if the result is -1, then handle creation failed
*/
/**
*
- * @remark Image Transform Pipeline
+ * @remark Image Transform Pipeline
*
* @param imgp_handle [in] image_util_imgp_h
* @param completed_callback [in] Completed_callback
* @param user_param [in] User parameter which is received from user when callback function was set
- * @return This function returns transform processor result value
+ * @return This function returns transform processor result value
* if the result is 0, then you can use output_Filename pointer(char** value)
* else if the result is -1, then do not execute when the colopsapce converter is not supported
*/
/**
*
- * @remark Transform Handle Destory
+ * @remark Transform Handle Destory
*
* @param imgp_handle [in] image_util_imgp_h
- * @return This function returns transform processor result value
+ * @return This function returns transform processor result value
* if the result is 0, then handle destory succeed
* else if the result is -1, then handle destory failed
*/
* @see mm_util_img_format
* @since R1, 1.0
*/
-int mm_util_convert_colorspace(const unsigned char *src, unsigned int src_width, unsigned int src_height, mm_util_img_format src_format,
- unsigned char *dst, mm_util_img_format dst_format);
+int mm_util_convert_colorspace(const unsigned char *src, unsigned int src_width, unsigned int src_height, mm_util_img_format src_format, unsigned char *dst, mm_util_img_format dst_format);
/**
* This function resizes the source image.
* @see mm_util_img_format
* @since R1, 1.0
*/
-int mm_util_resize_image(const unsigned char *src, unsigned int src_width, unsigned int src_height, mm_util_img_format src_format,
- unsigned char *dst, unsigned int *dst_width, unsigned int *dst_height);
+int mm_util_resize_image(const unsigned char *src, unsigned int src_width, unsigned int src_height, mm_util_img_format src_format, unsigned char *dst, unsigned int *dst_width, unsigned int *dst_height);
/**
* This function rotates the source image.
* @see mm_util_img_format, mm_util_img_rotate_type
* @since R1, 1.0
*/
-int mm_util_rotate_image(const unsigned char *src, unsigned int src_width, unsigned int src_height, mm_util_img_format src_format,
- unsigned char *dst, unsigned int *dst_width, unsigned int *dst_height, mm_util_img_rotate_type angle);
+int mm_util_rotate_image(const unsigned char *src, unsigned int src_width, unsigned int src_height, mm_util_img_format src_format, unsigned char *dst, unsigned int *dst_width, unsigned int *dst_height, mm_util_img_rotate_type angle);
/**
* This function crop the source image.
* @since R1, 1.0
*/
int mm_util_crop_image(const unsigned char *src, unsigned int src_width, unsigned int src_height, mm_util_img_format src_format,
- unsigned int crop_start_x, unsigned int crop_start_y, unsigned int *crop_dest_width, unsigned int *crop_dest_height, unsigned char *dst);
+ unsigned int crop_start_x, unsigned int crop_start_y, unsigned int *crop_dest_width, unsigned int *crop_dest_height, unsigned char *dst);
#ifdef __cplusplus
}
#define PATH_NEON_LIB LIBPREFIX "/libmmutil_imgp_neon.so"
#define PATH_GSTCS_LIB LIBPREFIX "/libmmutil_imgp_gstcs.so"
-#define IMGP_FUNC_NAME "mm_imgp"
-#define IMGP_FREE(src) { if(src != NULL) {g_free(src); src = NULL;} }
+#define IMGP_FUNC_NAME "mm_imgp"
+#define IMGP_FREE(src) { if (src != NULL) {g_free(src); src = NULL; } }
#define SCMN_IMGB_MAX_PLANE (4)
#define MAX_SRC_BUF_NUM 12 /* Max number of upstream src plugins's buffer */
#define MAX_DST_BUF_NUM 12
/**
* Image Process Info for dlopen
*/
-typedef struct _imgp_info_s
-{
+typedef struct _imgp_info_s {
char *input_format_label;
mm_util_img_format src_format;
unsigned int src_width;
} imgp_info_s;
/* Enumerations */
-typedef enum
-{
+typedef enum {
IMGP_CSC = 0,
IMGP_RSZ,
IMGP_ROT,
} imgp_type_e;
/* Enumerations */
-typedef enum
-{
+typedef enum {
IMGP_NEON = 0,
IMGP_GSTCS,
} imgp_plugin_type_e;
-typedef enum
-{
- MM_UTIL_ROTATION_NONE = 0, /**< None */
- MM_UTIL_ROTATION_90 = 1, /**< Rotation 90 degree */
- MM_UTIL_ROTATION_180, /**< Rotation 180 degree */
- MM_UTIL_ROTATION_270, /**< Rotation 270 degree */
- MM_UTIL_ROTATION_FLIP_HORZ, /**< Flip horizontal */
- MM_UTIL_ROTATION_FLIP_VERT, /**< Flip vertical */
+typedef enum {
+ MM_UTIL_ROTATION_NONE = 0, /**< None */
+ MM_UTIL_ROTATION_90 = 1, /**< Rotation 90 degree */
+ MM_UTIL_ROTATION_180, /**< Rotation 180 degree */
+ MM_UTIL_ROTATION_270, /**< Rotation 270 degree */
+ MM_UTIL_ROTATION_FLIP_HORZ, /**< Flip horizontal */
+ MM_UTIL_ROTATION_FLIP_VERT, /**< Flip vertical */
} mm_util_rotation_e;
-typedef struct
-{
+typedef struct {
void *user_data;
mm_util_completed_callback completed_cb;
} mm_util_cb_s;
MM_UTIL_IPP_CTRL_START = 1,
} ConvertIppCtrl;
-typedef struct
-{
+typedef struct {
gint drm_fd;
media_packet_h src_packet;
void *src;
#ifdef __cplusplus
}
-#endif
\ No newline at end of file
+#endif
/**
* YUV format for jpeg
*/
-typedef enum
-{
+typedef enum {
/* YUV planar format */
MM_UTIL_JPEG_FMT_YUV420 = 0x00, /**< YUV420 format - planer I420 */
MM_UTIL_JPEG_FMT_YUV422, /**< YUV422 format - planer */
/**
* downscale decoding for jpeg
*/
-typedef enum
-{
+typedef enum {
MM_UTIL_JPEG_DECODE_DOWNSCALE_1_1 = 1, /** 1/1 downscale decode */
MM_UTIL_JPEG_DECODE_DOWNSCALE_1_2 = 2, /** 1/2 downscale decode */
MM_UTIL_JPEG_DECODE_DOWNSCALE_1_4 = 4, /** 1/4 downscale decode */
/**
* YUV data
*/
-typedef struct
-{
+typedef struct {
mm_util_jpeg_yuv_format format; /**< pixel format*/
int width; /**< width */
int height; /**< heigt */
* @see mm_util_jpeg_yuv_format
* @since R1, 1.0
*/
-int mm_util_jpeg_encode_to_file (const char *filename, void *src, int width, int height, mm_util_jpeg_yuv_format fmt, int quality);
+int mm_util_jpeg_encode_to_file(const char *filename, void *src, int width, int height, mm_util_jpeg_yuv_format fmt, int quality);
/**
* This function encodes raw file to jpeg into memory.
*
- * @param mem [out] pointer of output stream pointer, that is, pointer of encoded jpeg stream pointer.
- After using it, please free the allocated memory.
+ * @param mem [out] pointer of output stream pointer, that is, pointer of encoded jpeg stream pointer. After using it, please free the allocated memory.
* @param size [in] output stream size, that is, encoded stream size
* @param src [in] pointer of input stream pointer (raw data)
* @param width [in] width of src data
* @see mm_util_jpeg_yuv_format
* @since R1, 1.0
*/
-int mm_util_jpeg_encode_to_memory (void **mem, unsigned int *size, void *src, int width, int height, mm_util_jpeg_yuv_format fmt, int quality);
+int mm_util_jpeg_encode_to_memory(void **mem, unsigned int *size, void *src, int width, int height, mm_util_jpeg_yuv_format fmt, int quality);
/**
* This function extracts yuv data from jpeg file
*
- * @param decoded [out] pointer of output stream pointer, that is, pointer of encoded jpeg stream pointer.
- After using it, please free the allocated memory.
+ * @param decoded [out] pointer of output stream pointer, that is, pointer of encoded jpeg stream pointer. After using it, please free the allocated memory.
* @param filename [in] input file name, encoded stream file
* @param fmt [in] color format
* @return This function returns zero on success, or negative value with error code.
/**
* This function extracts yuv data from jpeg buffer
*
- * @param decoded [out] pointer of output stream pointer, that is, pointer of encoded jpeg stream pointer.
- After using it, please free the allocated memory.
+ * @param decoded [out] pointer of output stream pointer, that is, pointer of encoded jpeg stream pointer. After using it, please free the allocated memory.
* @param src [in] input stream pointer(pointer of encoded jpeg stream data)
* @param size [in] size of input stream(size of pointer of encoded jpeg stream data)
* @param fmt [in] color format
* @see mm_util_jpeg_yuv_data, mm_util_jpeg_yuv_format
* @since R1, 1.0
*/
-int mm_util_decode_from_jpeg_memory (mm_util_jpeg_yuv_data *decoded, void *src, unsigned int size, mm_util_jpeg_yuv_format fmt);
+int mm_util_decode_from_jpeg_memory(mm_util_jpeg_yuv_data *decoded, void *src, unsigned int size, mm_util_jpeg_yuv_format fmt);
/**
* This function extracts yuv data from jpeg file with downscale decode option
*
- * @param decoded [out] pointer of output stream pointer, that is, pointer of encoded jpeg stream pointer.
- After using it, please free the allocated memory.
+ * @param decoded [out] pointer of output stream pointer, that is, pointer of encoded jpeg stream pointer. After using it, please free the allocated memory.
* @param filename [in] input file name, encoded stream file
* @param fmt [in] color format
* @param downscale [in] downscale value
/**
* This function extracts yuv data from jpeg buffer with downscale decode option
*
- * @param decoded [out] pointer of output stream pointer, that is, pointer of encoded jpeg stream pointer.
- After using it, please free the allocated memory.
+ * @param decoded [out] pointer of output stream pointer, that is, pointer of encoded jpeg stream pointer. After using it, please free the allocated memory.
* @param src [in] input stream pointer(pointer of encoded jpeg stream data)
* @param size [in] size of input stream(size of pointer of encoded jpeg stream data)
* @param fmt [in] color format
* @see mm_util_jpeg_yuv_data, mm_util_jpeg_yuv_format
* @since R1, 1.0
*/
-int mm_util_decode_from_jpeg_memory_with_downscale (mm_util_jpeg_yuv_data *decoded, void *src, unsigned int size, mm_util_jpeg_yuv_format fmt, mm_util_jpeg_decode_downscale downscale);
+int mm_util_decode_from_jpeg_memory_with_downscale(mm_util_jpeg_yuv_data *decoded, void *src, unsigned int size, mm_util_jpeg_yuv_format fmt, mm_util_jpeg_decode_downscale downscale);
#ifdef __cplusplus
row_pointers = png_malloc(png_ptr, sizeof(png_bytep) * encoded->height);
- for (row_index = 0; row_index < encoded->height; row_index++) {
+ for (row_index = 0; row_index < encoded->height; row_index++)
row_pointers[row_index] = (*data) + (row_index * encoded->png.rowbytes);
- }
png_write_info(png_ptr, info_ptr);
png_write_image(png_ptr, row_pointers);