OpenVX HAL updated to use generic OpenVX wrappers #7802

merged 6 commits into from Dec 21, 2016


None yet

3 participants

terfendail commented Dec 6, 2016 edited

This pullrequest changes

Update OpenVX HAL to use the same generic wrappers as elsewhere in the code

@apavlenko apavlenko was assigned by alalek Dec 16, 2016
-template<> struct TypeToEnum<vx_uint16> { static const vx_enum value = VX_TYPE_UINT16; };
-template<> struct TypeToEnum<vx_int32> { static const vx_enum value = VX_TYPE_INT32; };
-template<> struct TypeToEnum<vx_uint32> { static const vx_enum value = VX_TYPE_UINT32; };
+template<> struct TypeToEnum<vx_uint8> { static const vx_enum value = VX_TYPE_UINT8, imgValue = VX_DF_IMAGE_U8; };
apavlenko Dec 19, 2016 Member

IMHO imgValue is not the best name...
what about imageType?

@@ -1376,6 +1389,25 @@ class Image : public RefWrapper<vx_image>
static Image createUniform(vx_context context, vx_uint32 width, vx_uint32 height, vx_df_image format, const void* value)
{ return Image(vxCreateUniformImage(context, width, height, format, value)); }
+ template <typename T>
+ static Image createUniform(vx_context context, vx_uint32 width, vx_uint32 height, const T value)
apavlenko Dec 19, 2016 Member

IMHO, guessing image format from the value type is not convenient and fragile idea!
I suggest adding vx_df_image format argument.
BTW, this method is implemented by me as well in the PR I haven't yet submitted :)

terfendail Dec 20, 2016 Contributor

I've added 'format' parameter, but doesn't add type consistency checks. I think it doesn't make much sense to update it if the function is already implemented but it would be useful to ensure the same declaration. Could you please provide the declaration of your implementation?




I suggest we merge this PR!

@alalek alalek merged commit be7d060 into opencv:master Dec 21, 2016

1 check passed

default Required builds passed
@terfendail terfendail deleted the terfendail:ovxhal_wrappers_migration branch Dec 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment