mirror of
https://github.com/opencv/opencv.git
synced 2025-06-11 20:09:23 +08:00
build fixes for openvx-1.0.1 and c++03
* fixing 1.0.1 * fixing build without c++11
This commit is contained in:
parent
2c63d2bd72
commit
289d879d48
12
3rdparty/openvx/include/ivx.hpp
vendored
12
3rdparty/openvx/include/ivx.hpp
vendored
@ -532,7 +532,6 @@ public:
|
||||
operator vx_reference() const
|
||||
{ return castToReference(ref); }
|
||||
|
||||
#ifdef IVX_USE_CXX98
|
||||
/// Getting a context that is kept in each OpenVX 'object' (call get<Context>())
|
||||
template<typename C>
|
||||
C get() const
|
||||
@ -542,7 +541,8 @@ public:
|
||||
// vxGetContext doesn't increment ref count, let do it in wrapper c-tor
|
||||
return C(c, true);
|
||||
}
|
||||
#else
|
||||
|
||||
#ifndef IVX_USE_CXX98
|
||||
/// Getting a context that is kept in each OpenVX 'object'
|
||||
template<typename C = Context, typename = typename std::enable_if<std::is_same<C, Context>::value>::type>
|
||||
C getContext() const
|
||||
@ -871,9 +871,15 @@ public:
|
||||
static Image createVirtual(vx_graph graph, vx_uint32 width = 0, vx_uint32 height = 0, vx_df_image format = VX_DF_IMAGE_VIRT)
|
||||
{ return Image(vxCreateVirtualImage(graph, width, height, format)); }
|
||||
|
||||
#ifdef VX_VERSION_1_1
|
||||
/// vxCreateUniformImage() wrapper
|
||||
static Image createUniform(vx_context context, vx_uint32 width, vx_uint32 height, vx_df_image format, const vx_pixel_value_t& value)
|
||||
{ return Image(vxCreateUniformImage(context, width, height, format, &value)); }
|
||||
#else
|
||||
/// vxCreateUniformImage() wrapper
|
||||
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
|
||||
|
||||
/// Planes number for the specified image format (fourcc)
|
||||
/// \return 0 for unknown formats
|
||||
@ -962,7 +968,7 @@ public:
|
||||
static Image createFromHandle(vx_context context, vx_df_image format,const vx_imagepatch_addressing_t& addr, void* ptr)
|
||||
{
|
||||
if(planes(format) != 1) throw WrapperError(std::string(__func__)+"(): not a single plane format");
|
||||
return Image(vxCreateImageFromHandle(context, format, &addr, &ptr, VX_MEMORY_TYPE_HOST));
|
||||
return Image(vxCreateImageFromHandle(context, format, const_cast<vx_imagepatch_addressing_t*> (&addr), &ptr, VX_MEMORY_TYPE_HOST));
|
||||
}
|
||||
|
||||
#ifdef VX_VERSION_1_1
|
||||
|
@ -19,8 +19,7 @@ ivx::Graph createProcessingGraph(ivx::Image& inputImage, ivx::Image& outputImage
|
||||
{
|
||||
using namespace ivx;
|
||||
|
||||
Context context = inputImage.getContext();
|
||||
|
||||
Context context = inputImage.get<Context>();
|
||||
Graph graph = Graph::create(context);
|
||||
|
||||
vx_uint32 width = inputImage.width();
|
||||
|
@ -19,8 +19,7 @@ ivx::Graph createProcessingGraph(ivx::Image& inputImage, ivx::Image& outputImage
|
||||
{
|
||||
using namespace ivx;
|
||||
|
||||
Context context = inputImage.getContext();
|
||||
|
||||
Context context = inputImage.get<Context>();
|
||||
Graph graph = Graph::create(context);
|
||||
|
||||
vx_uint32 width = inputImage.width();
|
||||
|
Loading…
Reference in New Issue
Block a user