Remove unused code 50/190850/2
authorhj kim <backto.kim@samsung.com>
Mon, 8 Oct 2018 03:39:45 +0000 (12:39 +0900)
committerJiyong Min <jiyong.min@samsung.com>
Mon, 8 Oct 2018 04:26:45 +0000 (04:26 +0000)
Change-Id: I5d12039bfd353b945744d9fb2bbd04ed3569feaf

common/include/mm_util_color_image.h
common/mm_util_color_image.c
imgp/mm_util_imgp.c

index 6849f96..1687420 100755 (executable)
@@ -34,17 +34,6 @@ gboolean mm_util_is_valid_color_format(mm_util_color_format_e color);
 
 /**
  *
- * @remark     Creates the handle of empty color image
- *
- * @param      image           [in/out]                The handle of the color image
- * @return     This function returns created color image handle
- *             if the result is 0, then handle creation succeed
- *             else if the result is -1, then handle creation failed
- */
-int mm_util_create_empty_color_image(mm_util_color_image_h *image);
-
-/**
- *
  * @remark     Creates the handle of color image with data
  *
  * @param      image           [in/out]                The handle of the color image
@@ -61,22 +50,6 @@ int mm_util_create_color_image(mm_util_color_image_h *image, unsigned long width
 
 /**
  *
- * @remark     Sets the data of color image to handle
- *
- * @param      image           [in]                    The handle of the color image
- * @param      width           [in]                    The width of color image
- * @param      height          [in]                    The height of color image
- * @param      color           [in]                    The color format of color image
- * @param      data            [in]                    The data of color image
- * @param      size            [in]                    The data-size of color image
- * @return     This function returns the result of setting the data in handle
- *             if the result is 0, then setting the data has succeed
- *             else if the result is -1, then setting the data has failed
- */
-int mm_util_set_color_image(mm_util_color_image_h image, unsigned long width, unsigned long height, mm_util_color_format_e color, void *data, size_t size);
-
-/**
- *
  * @remark     Gets the data of color image from handle
  *
  * @param      image           [in]                    The handle of the color image
index 7a1afcc..5d6b18f 100755 (executable)
@@ -30,64 +30,36 @@ gboolean mm_util_is_valid_color_format(mm_util_color_format_e color)
        return TRUE;
 }
 
-int mm_util_create_empty_color_image(mm_util_color_image_h *image)
-{
-       int ret = MM_UTIL_ERROR_NONE;
-       mm_image_info_s *_color_image = NULL;
-
-       mm_util_retvm_if((image == NULL), MM_UTIL_ERROR_INVALID_PARAMETER, "Invalid handle");
-
-       _color_image = (mm_image_info_s *)calloc(1, sizeof(mm_image_info_s));
-       mm_util_retvm_if((_color_image == NULL), MM_UTIL_ERROR_OUT_OF_MEMORY, "Memory allocation failed");
-
-       *image = (mm_util_color_image_h)_color_image;
-
-       return ret;
-}
-
 int mm_util_create_color_image(mm_util_color_image_h *image, unsigned long width, unsigned long height, mm_util_color_format_e color, void *data, size_t size)
 {
        int ret = MM_UTIL_ERROR_NONE;
        mm_image_info_s *_color_image = NULL;
 
        mm_util_retvm_if((image == NULL), MM_UTIL_ERROR_INVALID_PARAMETER, "Invalid handle");
+       mm_util_retvm_if((color >= MM_UTIL_COLOR_NUM), MM_UTIL_ERROR_INVALID_PARAMETER, "Invalid color");
+       mm_util_retvm_if((data == NULL || size == 0), MM_UTIL_ERROR_INVALID_PARAMETER, "Invalid data");
 
        _color_image = (mm_image_info_s *)calloc(1, sizeof(mm_image_info_s));
        mm_util_retvm_if((_color_image == NULL), MM_UTIL_ERROR_OUT_OF_MEMORY, "Memory allocation failed");
 
-       ret = mm_util_set_color_image(_color_image, width, height, color, data, size);
-       if (ret != MM_UTIL_ERROR_NONE) {
-               mm_util_error("mm_util_set_color_image failed(%d)", ret);
+       _color_image->data = calloc(1, size);
+       if (_color_image->data == NULL) {
+               mm_util_error("Memory allocation failed");
                mm_util_destroy_color_image(_color_image);
                *image = NULL;
-               return ret;
+               return MM_UTIL_ERROR_OUT_OF_MEMORY;
        }
 
-       *image = (mm_util_color_image_h)_color_image;
-
-       return ret;
-}
-
-int mm_util_set_color_image(mm_util_color_image_h image, unsigned long width, unsigned long height, mm_util_color_format_e color, void *data, size_t size)
-{
-       int ret = MM_UTIL_ERROR_NONE;
-       mm_image_info_s *_color_image = (mm_image_info_s *)image;
-
-       mm_util_retvm_if((_color_image == NULL), MM_UTIL_ERROR_INVALID_PARAMETER, "Invalid handle");
-       mm_util_retvm_if((color >= MM_UTIL_COLOR_NUM), MM_UTIL_ERROR_INVALID_PARAMETER, "Invalid color");
-       mm_util_retvm_if((data == NULL || size == 0), MM_UTIL_ERROR_INVALID_PARAMETER, "Invalid data");
-
-       _color_image->data = calloc(1, size);
-       mm_util_retvm_if((_color_image->data == NULL), MM_UTIL_ERROR_OUT_OF_MEMORY, "Memory allocation failed");
-
        memcpy(_color_image->data, data, size);
+
        _color_image->size = size;
        _color_image->width = width;
        _color_image->height = height;
        _color_image->color = color;
 
-       mm_util_sec_debug("w: %lu, h: %lu, color: %u, size: %zu, data: %p", _color_image->width, _color_image->height,
-               _color_image->color, _color_image->size, _color_image->data);
+       mm_util_sec_debug("w [%lu], h [%lu], color [%u], size [%zu], data [%p]", _color_image->width, _color_image->height, _color_image->color, _color_image->size, _color_image->data);
+
+       *image = (mm_util_color_image_h)_color_image;
 
        return ret;
 }
index aff5403..031c3da 100755 (executable)
@@ -612,7 +612,7 @@ static int __mm_util_processing(mm_util_s *handle)
        if (dst_buf[dst_index] != NULL && res_buffer_size != 0) {
                ret = mm_util_create_color_image((mm_util_color_image_h *)&(handle->dst), (unsigned long)src_width, (unsigned long)src_height, src_format, (void *)dst_buf[dst_index], res_buffer_size);
                if (ret != MM_UTIL_ERROR_NONE)
-                       mm_util_error("mm_util_set_color_image failed");
+                       mm_util_error("mm_util_create_color_image failed");
        } else {
                mm_util_error("invalid result %p %zu", dst_buf[dst_index], res_buffer_size);
                ret = MM_UTIL_ERROR_INVALID_OPERATION;