#define WRONG_PATH ""
-#define INVALID_IMAGE_TYPE sizeof(image_util_type_e) + 1 /* +1 margin due to new type */
-#define LAST_IMAGE_TYPE IMAGE_UTIL_WEBP
+#define DECODE_IMAGE_TYPE_N IMAGE_UTIL_WEBP
+#define ENCODE_IMAGE_TYPE_N IMAGE_UTIL_WEBP
+#define INVALID_IMAGE_TYPE ((DECODE_IMAGE_TYPE_N > ENCODE_IMAGE_TYPE_N) ? DECODE_IMAGE_TYPE_N * 2 : ENCODE_IMAGE_TYPE_N * 2)
typedef struct {
+ bool support_decode;
char *source;
+ bool support_encode;
char *output;
-} utc_filename_t;
-
-static const utc_filename_t FILENAME[] = {
- [IMAGE_UTIL_JPEG] = { "sample.jpg", "test_output.jpg" },
- [IMAGE_UTIL_PNG] = { "sample.png", "test_output.png" },
- [IMAGE_UTIL_GIF] = { "sample.gif", "test_output.gif" },
- [IMAGE_UTIL_BMP] = { "sample.bmp", "test_output.bmp" },
- [IMAGE_UTIL_WEBP] = { "sample.webp", "test_output.webp" },
+} utc_config_t;
+
+static const utc_config_t UTC_CONFIG[] = {
+ [IMAGE_UTIL_JPEG] = { true, "sample.jpg", true, "test_output.jpg" },
+ [IMAGE_UTIL_PNG] = { true, "sample.png", true, "test_output.png" },
+ [IMAGE_UTIL_GIF] = { true, "sample.gif", true, "test_output.gif" },
+ [IMAGE_UTIL_BMP] = { true, "sample.bmp", true, "test_output.bmp" },
+ [IMAGE_UTIL_WEBP] = { true, "sample.webp", true, "test_output.webp" },
};
typedef struct {
{
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= DECODE_IMAGE_TYPE_N; type++) {
IMAGEUTIL_SAFE_G_FREE(utc_decode[type].result.buffer);
utc_decode[type].result.size = 0;
IMAGEUTIL_SAFE_G_FREE(utc_decode[type].source);
{
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
IMAGEUTIL_SAFE_G_FREE(utc_encode[type].result.buffer);
utc_encode[type].result.size = 0;
utc_encode[type].result.buffer_size = 0;
{
PRINT_UTC_LOG("[Line : %d][%s] 'DEVICE_SUITE_TARGET_30' Values Received = %s\\n", __LINE__, API_NAMESPACE, pszValue);
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
- utc_decode[type].source = _utc_get_test_path(pszValue, FILENAME[type].source);
- utc_encode[type].output = _utc_get_test_path(pszValue, FILENAME[type].output);
- FPRINTF("[%d:%s] PATH [Type: %d] [Decode: %s], [Encode: %s] \\n", __LINE__, __FUNCTION__, type,
- utc_decode[type].source, utc_encode[type].output);
+ for (type = 0; type <= DECODE_IMAGE_TYPE_N; type++) {
+ if (!UTC_CONFIG[type].support_decode) {
+ FPRINTF("[%d:%s] PATH [Type: %d] [Decode: not support] \\n", __LINE__, __FUNCTION__, type);
+ continue;
+ }
- if (!utc_decode[type].source || !utc_encode[type].output)
+ utc_decode[type].source = _utc_get_test_path(pszValue, UTC_CONFIG[type].source);
+ FPRINTF("[%d:%s] PATH [Type: %d] [Decode: %s] \\n", __LINE__, __FUNCTION__, type, utc_decode[type].source);
+
+ if (!utc_decode[type].source)
+ FPRINTF("[%d:%s] Get UTC Path error! \\n", __LINE__, __FUNCTION__);
+ }
+
+ for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
+ if (!UTC_CONFIG[type].support_encode) {
+ FPRINTF("[%d:%s] PATH [Type: %d] [Encode: not support] \\n", __LINE__, __FUNCTION__, type);
+ continue;
+ }
+
+ utc_encode[type].output = _utc_get_test_path(pszValue, UTC_CONFIG[type].output);
+ FPRINTF("[%d:%s] PATH [Type: %d] [Decode: %s], [Encode: %s] \\n", __LINE__, __FUNCTION__, type, utc_encode[type].output);
+
+ if (!utc_encode[type].output)
FPRINTF("[%d:%s] Get UTC Path error! \\n", __LINE__, __FUNCTION__);
}
}
PRINT_UTC_LOG("[Line : %d][%s] GetValueForTCTSetting returned error for 'DEVICE_SUITE_TARGET_30'\\n", __LINE__, API_NAMESPACE);
}
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= DECODE_IMAGE_TYPE_N; type++) {
ret = image_util_decode_create(&utc_decode[type].handle);
if (IMAGE_UTIL_ERROR_NONE != ret)
PRINT_UTC_LOG("[Line : %d][%s] image_util_decode_create is failed(%d).\n", __LINE__, API_NAMESPACE, ret);
int ret = IMAGE_UTIL_ERROR_NONE;
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= DECODE_IMAGE_TYPE_N; type++) {
ret = image_util_decode_destroy(utc_decode[type].handle);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
utc_decode[type].handle = NULL;
int ret = IMAGE_UTIL_ERROR_NONE;
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= DECODE_IMAGE_TYPE_N; type++) {
ret = image_util_decode_set_input_path(NULL, utc_decode[type].source);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
}
int ret = IMAGE_UTIL_ERROR_NONE;
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= DECODE_IMAGE_TYPE_N; type++) {
ret = image_util_decode_set_input_path(utc_encode[type].handle, utc_decode[type].source);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
}
int ret = IMAGE_UTIL_ERROR_NONE;
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= DECODE_IMAGE_TYPE_N; type++) {
ret = image_util_decode_set_input_path(utc_decode[type].handle, WRONG_PATH);
assert_eq(ret, IMAGE_UTIL_ERROR_NO_SUCH_FILE);
}
int ret = IMAGE_UTIL_ERROR_NONE;
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= DECODE_IMAGE_TYPE_N; type++) {
ret = image_util_decode_set_input_path(utc_decode[type].handle, NULL);
assert_eq(ret, IMAGE_UTIL_ERROR_NO_SUCH_FILE);
}
int ret = IMAGE_UTIL_ERROR_NONE;
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= DECODE_IMAGE_TYPE_N; type++) {
ret = image_util_decode_set_input_path(utc_decode[type].handle, utc_decode[type].source);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
}
int ret = IMAGE_UTIL_ERROR_NONE;
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= DECODE_IMAGE_TYPE_N; type++) {
ret = __fill_test_buffer(type);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
int ret = IMAGE_UTIL_ERROR_NONE;
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= DECODE_IMAGE_TYPE_N; type++) {
ret = __fill_test_buffer(type);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
int ret = IMAGE_UTIL_ERROR_NONE;
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= DECODE_IMAGE_TYPE_N; type++) {
ret = __fill_test_buffer(type);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
int ret = IMAGE_UTIL_ERROR_NONE;
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= DECODE_IMAGE_TYPE_N; type++) {
ret = __fill_test_buffer(type);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
int ret = IMAGE_UTIL_ERROR_NONE;
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= DECODE_IMAGE_TYPE_N; type++) {
ret = __fill_test_buffer(type);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
unsigned char *data = NULL;
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= DECODE_IMAGE_TYPE_N; type++) {
ret = image_util_decode_set_output_buffer(utc_encode[type].handle, &data);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
}
int ret = IMAGE_UTIL_ERROR_NONE;
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= DECODE_IMAGE_TYPE_N; type++) {
ret = image_util_decode_set_output_buffer(utc_decode[type].handle, NULL);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
}
unsigned char *data = NULL;
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= DECODE_IMAGE_TYPE_N; type++) {
ret = image_util_decode_set_output_buffer(utc_decode[type].handle, &data);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
}
int ret = IMAGE_UTIL_ERROR_NONE;
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= DECODE_IMAGE_TYPE_N; type++) {
ret = image_util_decode_set_colorspace(utc_decode[type].handle, IMAGE_UTIL_COLORSPACE_RGBA8888);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
}
int ret = IMAGE_UTIL_ERROR_NONE;
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= DECODE_IMAGE_TYPE_N; type++) {
ret = image_util_decode_set_input_path(utc_decode[type].handle, utc_decode[type].source);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
unsigned long long image_size = 0;
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= DECODE_IMAGE_TYPE_N; type++) {
ret = image_util_decode_run(utc_encode[type].handle, &image_width, &image_height, &image_size);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
}
unsigned long long image_size = 0;
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= DECODE_IMAGE_TYPE_N; type++) {
ret = image_util_decode_set_output_buffer(utc_decode[type].handle, &data);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
unsigned long long image_size = 0;
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= DECODE_IMAGE_TYPE_N; type++) {
ret = image_util_decode_set_input_path(utc_decode[type].handle, utc_decode[type].source);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
unsigned long long image_size = 0;
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= DECODE_IMAGE_TYPE_N; type++) {
ret = __fill_test_buffer(type);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
unsigned long long image_size = 0;
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= DECODE_IMAGE_TYPE_N; type++) {
ret = image_util_decode_set_input_path(utc_decode[type].handle, utc_decode[type].source);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
unsigned long long image_size = 0;
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= DECODE_IMAGE_TYPE_N; type++) {
ret = __fill_test_buffer(type);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
image_util_image_h decoded_image = NULL;
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= DECODE_IMAGE_TYPE_N; type++) {
ret = image_util_decode_run2(utc_decode[type].handle, &decoded_image);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
image_util_image_h decoded_image = NULL;
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= DECODE_IMAGE_TYPE_N; type++) {
ret = image_util_decode_set_input_path(utc_decode[type].handle, utc_decode[type].source);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
image_util_image_h decoded_image = NULL;
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= DECODE_IMAGE_TYPE_N; type++) {
ret = __fill_test_buffer(type);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
int ret = IMAGE_UTIL_ERROR_NONE;
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= DECODE_IMAGE_TYPE_N; type++) {
ret = image_util_decode_run_async(utc_encode[type].handle, (image_util_decode_completed_cb) utc_decode_completed_cb, NULL);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
}
unsigned char *data = NULL;
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= DECODE_IMAGE_TYPE_N; type++) {
ret = image_util_decode_set_output_buffer(utc_decode[type].handle, &data);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
int ret = IMAGE_UTIL_ERROR_NONE;
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= DECODE_IMAGE_TYPE_N; type++) {
ret = image_util_decode_set_input_path(utc_decode[type].handle, utc_decode[type].source);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
int ret = IMAGE_UTIL_ERROR_NONE;
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= DECODE_IMAGE_TYPE_N; type++) {
ret = __fill_test_buffer(type);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
unsigned char *data = NULL;
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= DECODE_IMAGE_TYPE_N; type++) {
ret = image_util_decode_set_input_path(utc_decode[type].handle, utc_decode[type].source);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
unsigned char *data = NULL;
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= DECODE_IMAGE_TYPE_N; type++) {
ret = image_util_decode_set_input_path(utc_decode[type].handle, utc_decode[type].source);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
unsigned char *data = NULL;
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= DECODE_IMAGE_TYPE_N; type++) {
ret = __fill_test_buffer(type);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
int ret = IMAGE_UTIL_ERROR_NONE;
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= DECODE_IMAGE_TYPE_N; type++) {
ret = image_util_decode_run_async2(utc_decode[type].handle, utc_decode_completed2_cb, NULL);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
int ret = IMAGE_UTIL_ERROR_NONE;
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= DECODE_IMAGE_TYPE_N; type++) {
callback_error = -1;
ret = image_util_decode_set_input_path(utc_decode[type].handle, utc_decode[type].source);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
int ret = IMAGE_UTIL_ERROR_NONE;
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= DECODE_IMAGE_TYPE_N; type++) {
callback_error = -1;
ret = __fill_test_buffer(type);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
int ret = IMAGE_UTIL_ERROR_NONE;
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= DECODE_IMAGE_TYPE_N; type++) {
ret = image_util_decode_destroy(utc_encode[type].handle);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
}
int ret = IMAGE_UTIL_ERROR_NONE;
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= DECODE_IMAGE_TYPE_N; type++) {
ret = image_util_decode_destroy(utc_decode[type].handle);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
utc_decode[type].handle = NULL;
{
PRINT_UTC_LOG("[Line : %d][%s] 'DEVICE_SUITE_TARGET_30' Values Received = %s\\n", __LINE__, API_NAMESPACE, pszValue);
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
- utc_decode[type].source = _utc_get_test_path(pszValue, FILENAME[type].source);
- utc_encode[type].output = _utc_get_test_path(pszValue, FILENAME[type].output);
- FPRINTF("[%d:%s] PATH [Type: %d] [Decode: %s], [Encode: %s] \\n", __LINE__, __FUNCTION__, type,
- utc_decode[type].source, utc_encode[type].output);
+ for (type = 0; type <= DECODE_IMAGE_TYPE_N; type++) {
+ if (!UTC_CONFIG[type].support_decode) {
+ FPRINTF("[%d:%s] PATH [Type: %d] [Decode: not support] \\n", __LINE__, __FUNCTION__, type);
+ continue;
+ }
+
+ utc_decode[type].source = _utc_get_test_path(pszValue, UTC_CONFIG[type].source);
+ FPRINTF("[%d:%s] PATH [Type: %d] [Decode: %s] \\n", __LINE__, __FUNCTION__, type, utc_decode[type].source);
+
+ if (!utc_decode[type].source)
+ FPRINTF("[%d:%s] Get UTC Path error! \\n", __LINE__, __FUNCTION__);
+ }
+
+ for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
+ if (!UTC_CONFIG[type].support_encode) {
+ FPRINTF("[%d:%s] PATH [Type: %d] [Encode: not support] \\n", __LINE__, __FUNCTION__, type);
+ continue;
+ }
+
+ utc_encode[type].output = _utc_get_test_path(pszValue, UTC_CONFIG[type].output);
+ FPRINTF("[%d:%s] PATH [Type: %d] [Decode: %s], [Encode: %s] \\n", __LINE__, __FUNCTION__, type, utc_encode[type].output);
- if (!utc_decode[type].source || !utc_encode[type].output)
+ if (!utc_encode[type].output)
FPRINTF("[%d:%s] Get UTC Path error! \\n", __LINE__, __FUNCTION__);
}
}
PRINT_UTC_LOG("[Line : %d][%s] GetValueForTCTSetting returned error for 'DEVICE_SUITE_TARGET_30'\\n", __LINE__, API_NAMESPACE);
}
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
ret = image_util_encode_create(type, &utc_encode[type].handle);
if (IMAGE_UTIL_ERROR_NONE != ret)
PRINT_UTC_LOG("[Line : %d][%s] image_util_encode_create is failed(%d).\n", __LINE__, API_NAMESPACE, ret);
int ret = IMAGE_UTIL_ERROR_NONE;
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
ret = image_util_encode_destroy(utc_encode[type].handle);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
utc_encode[type].handle = NULL;
int ret = IMAGE_UTIL_ERROR_NONE;
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
ret = image_util_encode_destroy(utc_encode[type].handle);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
utc_encode[type].handle = NULL;
int ret = IMAGE_UTIL_ERROR_NONE;
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
ret = image_util_encode_set_resolution(utc_decode[type].handle, 320, 240);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
}
int ret = IMAGE_UTIL_ERROR_NONE;
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
ret = image_util_encode_set_resolution(utc_encode[type].handle, 0, 240);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
int ret = IMAGE_UTIL_ERROR_NONE;
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
ret = image_util_encode_set_resolution(utc_encode[type].handle, 320, 240);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
}
int ret = IMAGE_UTIL_ERROR_NONE;
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
ret = image_util_encode_set_quality(utc_encode[type].handle, 1);
if (type != IMAGE_UTIL_JPEG)
assert_eq(ret, IMAGE_UTIL_ERROR_NOT_SUPPORTED_FORMAT);
int ret = IMAGE_UTIL_ERROR_NONE;
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
ret = image_util_encode_set_png_compression(utc_encode[type].handle, IMAGE_UTIL_PNG_COMPRESSION_0);
if (type != IMAGE_UTIL_PNG)
assert_eq(ret, IMAGE_UTIL_ERROR_NOT_SUPPORTED_FORMAT);
int ret = IMAGE_UTIL_ERROR_NONE;
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
ret = image_util_encode_set_gif_frame_delay_time(utc_encode[type].handle, 100);
if (type != IMAGE_UTIL_GIF)
assert_eq(ret, IMAGE_UTIL_ERROR_NOT_SUPPORTED_FORMAT);
int ret = IMAGE_UTIL_ERROR_NONE;
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
ret = image_util_encode_set_webp_lossless(utc_encode[type].handle, true);
if (type != IMAGE_UTIL_WEBP)
assert_eq(ret, IMAGE_UTIL_ERROR_NOT_SUPPORTED_FORMAT);
int ret = IMAGE_UTIL_ERROR_NONE;
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
ret = __fill_test_buffer(type);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
int ret = IMAGE_UTIL_ERROR_NONE;
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
ret = __fill_test_buffer(type);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
int ret = IMAGE_UTIL_ERROR_NONE;
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
ret = image_util_encode_set_input_buffer(utc_encode[type].handle, NULL);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
}
int ret = IMAGE_UTIL_ERROR_NONE;
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
ret = __fill_test_buffer(type);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
int ret = IMAGE_UTIL_ERROR_NONE;
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
ret = image_util_encode_set_output_path(NULL, utc_encode[type].output);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
}
int ret = IMAGE_UTIL_ERROR_NONE;
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
ret = image_util_encode_set_output_path(utc_decode[type].handle, utc_encode[type].output);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
}
int ret = IMAGE_UTIL_ERROR_NONE;
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
ret = image_util_encode_set_output_path(utc_encode[type].handle, WRONG_PATH);
assert_eq(ret, IMAGE_UTIL_ERROR_NO_SUCH_FILE);
}
int ret = IMAGE_UTIL_ERROR_NONE;
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
ret = image_util_encode_set_output_path(utc_encode[type].handle, NULL);
assert_eq(ret, IMAGE_UTIL_ERROR_NO_SUCH_FILE);
}
int ret = IMAGE_UTIL_ERROR_NONE;
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
ret = image_util_encode_set_output_path(utc_encode[type].handle, utc_encode[type].output);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
}
unsigned char *data = NULL;
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
ret = image_util_encode_set_output_buffer(utc_decode[type].handle, &data);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
}
int ret = IMAGE_UTIL_ERROR_NONE;
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
ret = image_util_encode_set_output_buffer(utc_encode[type].handle, NULL);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
}
unsigned char *data = NULL;
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
ret = image_util_encode_set_output_buffer(utc_encode[type].handle, &data);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
}
unsigned long long image_size = 0;
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
ret = image_util_encode_run(utc_decode[type].handle, &image_size);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
}
unsigned long long image_size = 0;
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
ret = image_util_encode_run(utc_encode[type].handle, &image_size);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
}
unsigned long long image_size = 0;
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
ret = __fill_test_buffer(type);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
unsigned long long image_size = 0;
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
ret = image_util_encode_set_output_path(utc_encode[type].handle, utc_encode[type].output);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
unsigned long long image_size = 0;
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
ret = image_util_encode_set_output_buffer(utc_encode[type].handle, &data);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
unsigned long long image_size = 0;
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
ret = __fill_test_buffer(type);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
unsigned long long image_size = 0;
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
ret = __fill_test_buffer(type);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
unsigned long long image_size = 0;
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
ret = __fill_test_buffer(type);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
unsigned long long size = 0;
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
ret = __fill_test_buffer(type);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
int ret = IMAGE_UTIL_ERROR_NONE;
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
ret = image_util_encode_run_async(utc_decode[type].handle, (image_util_encode_completed_cb) utc_encode_completed_cb, NULL);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
}
int ret = IMAGE_UTIL_ERROR_NONE;
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
ret = image_util_encode_run_async(utc_encode[type].handle, (image_util_encode_completed_cb) utc_encode_completed_cb, NULL);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
}
int ret = IMAGE_UTIL_ERROR_NONE;
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
ret = __fill_test_buffer(type);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
int ret = IMAGE_UTIL_ERROR_NONE;
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
ret = image_util_encode_set_output_path(utc_encode[type].handle, utc_encode[type].output);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
unsigned char *data = NULL;
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
ret = image_util_encode_set_output_buffer(utc_encode[type].handle, &data);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
int ret = IMAGE_UTIL_ERROR_NONE;
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
ret = __fill_test_buffer(type);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
int ret = IMAGE_UTIL_ERROR_NONE;
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
ret = __fill_test_buffer(type);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
int ret = IMAGE_UTIL_ERROR_NONE;
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
ret = __fill_test_buffer(type);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
unsigned char *data = NULL;
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
ret = __fill_test_buffer(type);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
int ret = IMAGE_UTIL_ERROR_NONE;
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
ret = _utc_decode_from_file(utc_decode[type].source, &utc_decode[type].decoded);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
int ret = IMAGE_UTIL_ERROR_NONE;
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
ret = _utc_decode_from_file(utc_decode[type].source, &utc_decode[type].decoded);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
int ret = IMAGE_UTIL_ERROR_NONE;
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
ret = _utc_decode_from_file(utc_decode[type].source, &utc_decode[type].decoded);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
int ret = IMAGE_UTIL_ERROR_NONE;
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
ret = _utc_decode_from_file(utc_decode[type].source, &utc_decode[type].decoded);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
int ret = IMAGE_UTIL_ERROR_NONE;
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
ret = _utc_decode_from_file(utc_decode[type].source, &utc_decode[type].decoded);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
int ret = IMAGE_UTIL_ERROR_NONE;
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
ret = _utc_decode_from_file(utc_decode[type].source, &utc_decode[type].decoded);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
int ret = IMAGE_UTIL_ERROR_NONE;
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
ret = _utc_decode_from_file(utc_decode[type].source, &utc_decode[type].decoded);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
int ret = IMAGE_UTIL_ERROR_NONE;
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
ret = _utc_decode_from_file(utc_decode[type].source, &utc_decode[type].decoded);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
int ret = IMAGE_UTIL_ERROR_NONE;
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
ret = image_util_encode_destroy(utc_decode[type].handle);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
}
int ret = IMAGE_UTIL_ERROR_NONE;
image_util_type_e type = 0;
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
ret = image_util_encode_destroy(utc_encode[type].handle);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
utc_encode[type].handle = NULL;