extern int utc_image_util_encode_set_gif_frame_delay_time_n2(void);
extern int utc_image_util_encode_set_gif_frame_delay_time_n3(void);
extern int utc_image_util_encode_set_gif_frame_delay_time_p(void);
+extern int utc_image_util_encode_set_webp_lossless_n1(void);
+extern int utc_image_util_encode_set_webp_lossless_n2(void);
+extern int utc_image_util_encode_set_webp_lossless_p(void);
extern int utc_image_util_encode_set_input_buffer_n1(void);
extern int utc_image_util_encode_set_input_buffer_n2(void);
extern int utc_image_util_encode_set_input_buffer_n3(void);
{"utc_image_util_encode_set_gif_frame_delay_time_n2",utc_image_util_encode_set_gif_frame_delay_time_n2,utc_image_util_encode_startup,utc_image_util_encode_cleanup},
{"utc_image_util_encode_set_gif_frame_delay_time_n3",utc_image_util_encode_set_gif_frame_delay_time_n3,utc_image_util_encode_startup,utc_image_util_encode_cleanup},
{"utc_image_util_encode_set_gif_frame_delay_time_p",utc_image_util_encode_set_gif_frame_delay_time_p,utc_image_util_encode_startup,utc_image_util_encode_cleanup},
+ {"utc_image_util_encode_set_webp_lossless_n1",utc_image_util_encode_set_webp_lossless_n1,utc_image_util_encode_startup,utc_image_util_encode_cleanup},
+ {"utc_image_util_encode_set_webp_lossless_n2",utc_image_util_encode_set_webp_lossless_n2,utc_image_util_encode_startup,utc_image_util_encode_cleanup},
+ {"utc_image_util_encode_set_webp_lossless_p",utc_image_util_encode_set_webp_lossless_p,utc_image_util_encode_startup,utc_image_util_encode_cleanup},
{"utc_image_util_encode_set_input_buffer_n1",utc_image_util_encode_set_input_buffer_n1,utc_image_util_encode_startup,utc_image_util_encode_cleanup},
{"utc_image_util_encode_set_input_buffer_n2",utc_image_util_encode_set_input_buffer_n2,utc_image_util_encode_startup,utc_image_util_encode_cleanup},
{"utc_image_util_encode_set_input_buffer_n3",utc_image_util_encode_set_input_buffer_n3,utc_image_util_encode_startup,utc_image_util_encode_cleanup},
extern int utc_image_util_encode_set_gif_frame_delay_time_n2(void);
extern int utc_image_util_encode_set_gif_frame_delay_time_n3(void);
extern int utc_image_util_encode_set_gif_frame_delay_time_p(void);
+extern int utc_image_util_encode_set_webp_lossless_n1(void);
+extern int utc_image_util_encode_set_webp_lossless_n2(void);
+extern int utc_image_util_encode_set_webp_lossless_p(void);
extern int utc_image_util_encode_set_input_buffer_n1(void);
extern int utc_image_util_encode_set_input_buffer_n2(void);
extern int utc_image_util_encode_set_input_buffer_n3(void);
{"utc_image_util_encode_set_gif_frame_delay_time_n2",utc_image_util_encode_set_gif_frame_delay_time_n2,utc_image_util_encode_startup,utc_image_util_encode_cleanup},
{"utc_image_util_encode_set_gif_frame_delay_time_n3",utc_image_util_encode_set_gif_frame_delay_time_n3,utc_image_util_encode_startup,utc_image_util_encode_cleanup},
{"utc_image_util_encode_set_gif_frame_delay_time_p",utc_image_util_encode_set_gif_frame_delay_time_p,utc_image_util_encode_startup,utc_image_util_encode_cleanup},
+ {"utc_image_util_encode_set_webp_lossless_n1",utc_image_util_encode_set_webp_lossless_n1,utc_image_util_encode_startup,utc_image_util_encode_cleanup},
+ {"utc_image_util_encode_set_webp_lossless_n2",utc_image_util_encode_set_webp_lossless_n2,utc_image_util_encode_startup,utc_image_util_encode_cleanup},
+ {"utc_image_util_encode_set_webp_lossless_p",utc_image_util_encode_set_webp_lossless_p,utc_image_util_encode_startup,utc_image_util_encode_cleanup},
{"utc_image_util_encode_set_input_buffer_n1",utc_image_util_encode_set_input_buffer_n1,utc_image_util_encode_startup,utc_image_util_encode_cleanup},
{"utc_image_util_encode_set_input_buffer_n2",utc_image_util_encode_set_input_buffer_n2,utc_image_util_encode_startup,utc_image_util_encode_cleanup},
{"utc_image_util_encode_set_input_buffer_n3",utc_image_util_encode_set_input_buffer_n3,utc_image_util_encode_startup,utc_image_util_encode_cleanup},
extern int utc_image_util_encode_set_gif_frame_delay_time_n2(void);
extern int utc_image_util_encode_set_gif_frame_delay_time_n3(void);
extern int utc_image_util_encode_set_gif_frame_delay_time_p(void);
+extern int utc_image_util_encode_set_webp_lossless_n1(void);
+extern int utc_image_util_encode_set_webp_lossless_n2(void);
+extern int utc_image_util_encode_set_webp_lossless_p(void);
extern int utc_image_util_encode_set_input_buffer_n1(void);
extern int utc_image_util_encode_set_input_buffer_n2(void);
extern int utc_image_util_encode_set_input_buffer_n3(void);
{"utc_image_util_encode_set_gif_frame_delay_time_n2",utc_image_util_encode_set_gif_frame_delay_time_n2,utc_image_util_encode_startup,utc_image_util_encode_cleanup},
{"utc_image_util_encode_set_gif_frame_delay_time_n3",utc_image_util_encode_set_gif_frame_delay_time_n3,utc_image_util_encode_startup,utc_image_util_encode_cleanup},
{"utc_image_util_encode_set_gif_frame_delay_time_p",utc_image_util_encode_set_gif_frame_delay_time_p,utc_image_util_encode_startup,utc_image_util_encode_cleanup},
+ {"utc_image_util_encode_set_webp_lossless_n1",utc_image_util_encode_set_webp_lossless_n1,utc_image_util_encode_startup,utc_image_util_encode_cleanup},
+ {"utc_image_util_encode_set_webp_lossless_n2",utc_image_util_encode_set_webp_lossless_n2,utc_image_util_encode_startup,utc_image_util_encode_cleanup},
+ {"utc_image_util_encode_set_webp_lossless_p",utc_image_util_encode_set_webp_lossless_p,utc_image_util_encode_startup,utc_image_util_encode_cleanup},
{"utc_image_util_encode_set_input_buffer_n1",utc_image_util_encode_set_input_buffer_n1,utc_image_util_encode_startup,utc_image_util_encode_cleanup},
{"utc_image_util_encode_set_input_buffer_n2",utc_image_util_encode_set_input_buffer_n2,utc_image_util_encode_startup,utc_image_util_encode_cleanup},
{"utc_image_util_encode_set_input_buffer_n3",utc_image_util_encode_set_input_buffer_n3,utc_image_util_encode_startup,utc_image_util_encode_cleanup},
#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_BMP
+#define LAST_IMAGE_TYPE IMAGE_UTIL_WEBP
typedef struct {
unsigned char *buffer;
[IMAGE_UTIL_PNG] = "sample.png",
[IMAGE_UTIL_GIF] = "sample.gif",
[IMAGE_UTIL_BMP] = "sample.bmp",
+ [IMAGE_UTIL_WEBP] = "sample.webp",
};
static const char *g_output_filename[] = {
[IMAGE_UTIL_PNG] = "test_output.png",
[IMAGE_UTIL_GIF] = "test_output.gif",
[IMAGE_UTIL_BMP] = "test_output.bmp",
+ [IMAGE_UTIL_WEBP] = "test_output.webp",
};
static char *g_source_path[] = {
[IMAGE_UTIL_PNG] = NULL,
[IMAGE_UTIL_GIF] = NULL,
[IMAGE_UTIL_BMP] = NULL,
+ [IMAGE_UTIL_WEBP] = NULL,
};
static char *g_output_path[] = {
[IMAGE_UTIL_PNG] = NULL,
[IMAGE_UTIL_GIF] = NULL,
[IMAGE_UTIL_BMP] = NULL,
+ [IMAGE_UTIL_WEBP] = NULL,
};
static image_util_decode_h g_decoder[] = {
[IMAGE_UTIL_PNG] = NULL,
[IMAGE_UTIL_GIF] = NULL,
[IMAGE_UTIL_BMP] = NULL,
+ [IMAGE_UTIL_WEBP] = NULL,
};
static image_util_encode_h g_encoder[] = {
[IMAGE_UTIL_PNG] = NULL,
[IMAGE_UTIL_GIF] = NULL,
[IMAGE_UTIL_BMP] = NULL,
+ [IMAGE_UTIL_WEBP] = NULL,
};
static decode_result_t g_decode_result[] = {
[IMAGE_UTIL_PNG] = { NULL, 0, 0, 0 },
[IMAGE_UTIL_GIF] = { NULL, 0, 0, 0 },
[IMAGE_UTIL_BMP] = { NULL, 0, 0, 0 },
+ [IMAGE_UTIL_WEBP] = { NULL, 0, 0, 0 },
};
static encode_result_t g_encode_result[] = {
[IMAGE_UTIL_PNG] = { NULL, 0, 0 },
[IMAGE_UTIL_GIF] = { NULL, 0, 0 },
[IMAGE_UTIL_BMP] = { NULL, 0, 0 },
+ [IMAGE_UTIL_WEBP] = { NULL, 0, 0 },
};
static image_util_image_h g_decoded_image[] = {
[IMAGE_UTIL_PNG] = NULL,
[IMAGE_UTIL_GIF] = NULL,
[IMAGE_UTIL_BMP] = NULL,
+ [IMAGE_UTIL_WEBP] = NULL,
};
static int callback_error = IMAGE_UTIL_ERROR_NONE;
for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
g_source_path[type] = _utc_get_test_path(pszValue, g_source_filename[type]);
g_output_path[type] = _utc_get_test_path(pszValue, g_output_filename[type]);
- FPRINTF("[%d:%s] PATH [Type: %d] [Decode: %s], [Encode: %s] \\n", __LINE__, __FUNCTION__, type,
+ FPRINTF("[%d:%s] PATH [Type: %d] [Decode: %s], [Encode: %s] \\n", __LINE__, __FUNCTION__, type,
g_source_path[type], g_output_path[type]);
if (!g_source_path[type] || !g_output_path[type])
{
/* end of TC */
image_util_type_e type = 0;
-
+
for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
IMAGEUTIL_SAFE_FREE(g_decode_result[type].buffer);
IMAGEUTIL_SAFE_FREE(g_encode_result[type].buffer);
for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
ret = image_util_encode_set_quality(g_encoder[type], 1);
- if (type == IMAGE_UTIL_JPEG)
- assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- else
+ if (type != IMAGE_UTIL_JPEG)
assert_eq(ret, IMAGE_UTIL_ERROR_NOT_SUPPORTED_FORMAT);
}
for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
ret = image_util_encode_set_png_compression(g_encoder[type], IMAGE_UTIL_PNG_COMPRESSION_0);
- if (type == IMAGE_UTIL_PNG)
- assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- else
+ if (type != IMAGE_UTIL_PNG)
assert_eq(ret, IMAGE_UTIL_ERROR_NOT_SUPPORTED_FORMAT);
}
for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
ret = image_util_encode_set_gif_frame_delay_time(g_encoder[type], 100);
- if (type == IMAGE_UTIL_GIF)
- assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- else
+ if (type != IMAGE_UTIL_GIF)
assert_eq(ret, IMAGE_UTIL_ERROR_NOT_SUPPORTED_FORMAT);
}
return 0;
}
+/**
+ * @testcase utc_image_util_encode_set_webp_lossless_n1
+ * @since_tizen 6.0
+ * @description Negative test case for image_util_encode_set_webp_lossless
+ */
+int utc_image_util_encode_set_webp_lossless_n1(void)
+{
+ int ret = IMAGE_UTIL_ERROR_NONE;
+ image_util_type_e type = 0;
+
+ ret = image_util_encode_set_webp_lossless(NULL, true);
+ assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
+
+ return 0;
+}
+
+/**
+ * @testcase utc_image_util_encode_set_webp_lossless_n2
+ * @since_tizen 6.0
+ * @description Negative test case for image_util_encode_set_webp_lossless
+ */
+int utc_image_util_encode_set_webp_lossless_n2(void)
+{
+ int ret = IMAGE_UTIL_ERROR_NONE;
+ image_util_type_e type = 0;
+
+ for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ ret = image_util_encode_set_webp_lossless(g_encoder[type], true);
+ if (type != IMAGE_UTIL_WEBP)
+ assert_eq(ret, IMAGE_UTIL_ERROR_NOT_SUPPORTED_FORMAT);
+ }
+
+ return 0;
+}
+
+/**
+ * @testcase utc_image_util_encode_set_webp_lossless_p
+ * @since_tizen 6.0
+ * @description Positive test case for image_util_encode_set_webp_lossless
+ */
+int utc_image_util_encode_set_webp_lossless_p(void)
+{
+ int ret = IMAGE_UTIL_ERROR_NONE;
+
+ ret = image_util_encode_set_webp_lossless(g_encoder[IMAGE_UTIL_WEBP], true);
+ assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
+
+ ret = image_util_encode_set_webp_lossless(g_encoder[IMAGE_UTIL_WEBP], false);
+ assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
+
+ return 0;
+}
+
/**
* @testcase utc_image_util_encode_set_input_buffer_n1
* @since_tizen 3.0