CHECK_HANDLE(dstHandle,"image_util_decode_create");
nRet = image_util_decode_set_input_path(dstHandle, pPath);
- PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_set_input_buffer", ImageUtilGetError(nRet), image_util_decode_destroy(dstHandle));
+ PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_set_input_path", ImageUtilGetError(nRet), image_util_decode_destroy(dstHandle));
nRet = image_util_decode_set_colorspace(dstHandle, IMAGE_UTIL_COLORSPACE_RGB888);
PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_set_colorspace", ImageUtilGetError(nRet), image_util_decode_destroy(dstHandle));
START_TEST;
image_util_decode_h stHandle = NULL;
- int nRet = image_util_decode_create(&stHandle);
- PRINT_RESULT(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_create", ImageUtilGetError(nRet));
- CHECK_HANDLE(stHandle,"image_util_decode_create");
-
- char pPath[PATH_LEN] = {0,};
- if ( false == ImageUtilAppendToAppDataPath(SAMPLE_FILE_PATH, pPath) )
+ char *eImageUtilType[5] = {
+ "Image_01.jpg",
+ "sample.png",
+ "sample.gif",
+ "sample.bmp",
+ "sample.heic"
+ };
+ int enum_size = 5;
+ int enum_counter = 0;
+ for(enum_counter = 0;enum_counter<enum_size;enum_counter++)
{
- FPRINTF("[Line : %d][%s] unable to get the app data path\\n", __LINE__, API_NAMESPACE);
- return 1;
- }
- //target api
- nRet = image_util_decode_set_input_path(stHandle, pPath);
- PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_set_input_buffer", ImageUtilGetError(nRet), image_util_decode_destroy(stHandle));
+ int nRet = image_util_decode_create(&stHandle);
+ PRINT_RESULT(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_create", ImageUtilGetError(nRet));
+ CHECK_HANDLE(stHandle,"image_util_decode_create");
- nRet = image_util_decode_destroy(stHandle);
- PRINT_RESULT_NORETURN(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_destroy", ImageUtilGetError(nRet));
+ char pPath[PATH_LEN] = {0,};
+ if ( false == ImageUtilAppendToAppDataPath(eImageUtilType[enum_counter], pPath) )
+ {
+ FPRINTF("[Line : %d][%s] unable to get the app data path of file %s\\n", __LINE__, API_NAMESPACE,eImageUtilType[enum_counter]);
+ image_util_decode_destroy(stHandle);
+ return 1;
+ }
+ //target api
+ nRet = image_util_decode_set_input_path(stHandle, pPath);
+ PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_set_input_path", ImageUtilGetError(nRet), image_util_decode_destroy(stHandle));
+ nRet = image_util_decode_destroy(stHandle);
+ PRINT_RESULT_NORETURN(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_destroy", ImageUtilGetError(nRet));
+ }
return 0;
}
//& purpose: To create a handle to image util decoding.
IMAGE_UTIL_GIF, /**< Image format GIF */
IMAGE_UTIL_JPEG,
IMAGE_UTIL_BMP, /**< Image format BMP */
- IMAGE_UTIL_WEBP /**< Image format WEBP */
+ IMAGE_UTIL_WEBP, /**< Image format WEBP */
};
int enum_size = sizeof(eImageUtilType) / sizeof(eImageUtilType[0]);
int enum_counter = 0;
}
nRet = image_util_decode_set_input_path(dstHandle, pPath);
- PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_set_input_buffer", ImageUtilGetError(nRet), image_util_decode_destroy(dstHandle));
+ PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_set_input_path", ImageUtilGetError(nRet), image_util_decode_destroy(dstHandle));
//target api
nRet = image_util_decode_run2(dstHandle, &stDecodedImage);
return 1;
}
nRet = image_util_decode_set_input_path(dstHandle, pPath);
- PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_set_input_buffer", ImageUtilGetError(nRet), image_util_decode_destroy(dstHandle));
+ PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_set_input_path", ImageUtilGetError(nRet), image_util_decode_destroy(dstHandle));
nRet = image_util_decode_run2(dstHandle, &stDecodedImage);
PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_run2", ImageUtilGetError(nRet), image_util_decode_destroy(dstHandle));
}
nRet = image_util_decode_set_input_path(stHandle, pPath);
- PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_set_input_buffer", ImageUtilGetError(nRet), image_util_decode_destroy(stHandle));
+ PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_set_input_path", ImageUtilGetError(nRet), image_util_decode_destroy(stHandle));
for (int nColorSpace = IMAGE_UTIL_COLORSPACE_YV12; nColorSpace <= IMAGE_UTIL_COLORSPACE_NV61; nColorSpace++)
{
}
nRet = image_util_decode_set_input_path(stHandle, pPath);
- PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_set_input_buffer", ImageUtilGetError(nRet), image_util_decode_destroy(stHandle));
+ PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_set_input_path", ImageUtilGetError(nRet), image_util_decode_destroy(stHandle));
for (int nColorSpace = IMAGE_UTIL_COLORSPACE_YV12; nColorSpace <= IMAGE_UTIL_COLORSPACE_NV61; nColorSpace++)
{
}
nRet = image_util_decode_set_input_path(stHandle, pPath);
- PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_set_input_buffer", ImageUtilGetError(nRet), image_util_decode_destroy(stHandle));
+ PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_set_input_path", ImageUtilGetError(nRet), image_util_decode_destroy(stHandle));
for (int nColorSpace = IMAGE_UTIL_COLORSPACE_YV12; nColorSpace <= IMAGE_UTIL_COLORSPACE_NV61; nColorSpace++)
{
}
nRet = image_util_decode_set_input_path(stHandle, pPath);
- PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_set_input_buffer", ImageUtilGetError(nRet), image_util_decode_destroy(stHandle));
+ PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_set_input_path", ImageUtilGetError(nRet), image_util_decode_destroy(stHandle));
+
+ for (int nColorSpace = IMAGE_UTIL_COLORSPACE_YV12; nColorSpace <= IMAGE_UTIL_COLORSPACE_NV61; nColorSpace++)
+ {
+ if (BmpColorspace[nColorSpace] == IMAGE_UTIL_ERROR_NONE)
+ {
+ nRet = image_util_decode_set_colorspace(stHandle,nColorSpace);
+ PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_set_colorspace", ImageUtilGetError(nRet), image_util_decode_destroy(stHandle));
+ }
+ }
+ }
+
+ nRet = image_util_decode_destroy(stHandle);
+ PRINT_RESULT_NORETURN(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_destroy", ImageUtilGetError(nRet));
+
+ return 0;
+}
+
+//& purpose: Sets the decoded image for HEIF colorspace format
+//& type: auto
+/**
+* @testcase ITc_image_util_decode_set_colorspace_heif_p
+* @since_tizen 6.5
+* @author SRID(nibha.sharma)
+* @reviewer SRID(shobhit.v)
+* @type auto
+* @description Sets the decoded image for HEIF colorspace format
+* @scenario
+* @apicovered image_util_decode_set_colorspace
+* @passcase When image_util_decode_set_colorspace is successful.
+* @failcase If target API image_util_decode_set_colorspace fails or any precondition API fails.
+* @precondition NA
+* @postcondition NA
+*/
+int ITc_image_util_decode_set_colorspace_heif_p(void)
+{
+ START_TEST;
+ image_util_decode_h stHandle = NULL;
+ g_bImageUtilForeachSupporedColorspace = false;
+
+ int nRet = image_util_decode_create(&stHandle);
+ PRINT_RESULT(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_create", ImageUtilGetError(nRet));
+ CHECK_HANDLE(stHandle,"image_util_decode_create");
+
+ nRet = image_util_foreach_supported_colorspace(IMAGE_UTIL_HEIF,(image_util_supported_colorspace_cb)Image_util_supported_colorspace_CallBack , NULL);
+ PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_foreach_supported_colorspace", ImageUtilGetError(nRet), image_util_decode_destroy(stHandle));
+ if ( !g_bImageUtilForeachSupporedColorspace )
+ {
+ FPRINTF("[Line : %d][%s] image_util_foreach_supported_colorspace failed, error returned = callback not invoked\\n", __LINE__, API_NAMESPACE);
+ nRet = image_util_decode_destroy(stHandle);
+ PRINT_RESULT_NORETURN(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_destroy", ImageUtilGetError(nRet));
+ return 1;
+ }
+ else
+ {
+ char pPath[PATH_LEN] = {0,};
+ if ( false == ImageUtilAppendToAppDataPath(SAMPLE_HEIF_FILE_PATH, pPath) )
+ {
+ FPRINTF("[Line : %d][%s] unable to get the app data path\\n", __LINE__, API_NAMESPACE);
+ nRet = image_util_decode_destroy(stHandle);
+ PRINT_RESULT_NORETURN(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_destroy", ImageUtilGetError(nRet));
+ return 1;
+ }
+
+ nRet = image_util_decode_set_input_path(stHandle, pPath);
+ PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_set_input_path", ImageUtilGetError(nRet), image_util_decode_destroy(stHandle));
for (int nColorSpace = IMAGE_UTIL_COLORSPACE_YV12; nColorSpace <= IMAGE_UTIL_COLORSPACE_NV61; nColorSpace++)
{