OpenVX HAL updated to use generic OpenVX wrappers #7802

Merged
merged 6 commits into from Dec 21, 2016

Projects

None yet

3 participants

@terfendail
Contributor
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
3rdparty/openvx/include/ivx.hpp
-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
apavlenko Dec 19, 2016 Member

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

3rdparty/openvx/include/ivx.hpp
@@ -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)); }
#endif
+ template <typename T>
+ static Image createUniform(vx_context context, vx_uint32 width, vx_uint32 height, const T value)
@apavlenko
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
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?

@apavlenko
Member

👍

@apavlenko
Member

I suggest we merge this PR!

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

1 check passed

default Required builds passed
Details
@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