Commit 289d879d authored by Andrey Pavlenko's avatar Andrey Pavlenko Committed by Rostislav Vasilikhin

build fixes for openvx-1.0.1 and c++03

* fixing 1.0.1
* fixing build without c++11
parent 2c63d2bd
...@@ -532,7 +532,6 @@ public: ...@@ -532,7 +532,6 @@ public:
operator vx_reference() const operator vx_reference() const
{ return castToReference(ref); } { return castToReference(ref); }
#ifdef IVX_USE_CXX98
/// Getting a context that is kept in each OpenVX 'object' (call get<Context>()) /// Getting a context that is kept in each OpenVX 'object' (call get<Context>())
template<typename C> template<typename C>
C get() const C get() const
...@@ -542,7 +541,8 @@ public: ...@@ -542,7 +541,8 @@ public:
// vxGetContext doesn't increment ref count, let do it in wrapper c-tor // vxGetContext doesn't increment ref count, let do it in wrapper c-tor
return C(c, true); return C(c, true);
} }
#else
#ifndef IVX_USE_CXX98
/// Getting a context that is kept in each OpenVX 'object' /// 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> template<typename C = Context, typename = typename std::enable_if<std::is_same<C, Context>::value>::type>
C getContext() const C getContext() const
...@@ -871,9 +871,15 @@ public: ...@@ -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) 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)); } { return Image(vxCreateVirtualImage(graph, width, height, format)); }
#ifdef VX_VERSION_1_1
/// vxCreateUniformImage() wrapper /// vxCreateUniformImage() wrapper
static Image createUniform(vx_context context, vx_uint32 width, vx_uint32 height, vx_df_image format, const vx_pixel_value_t& value) 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)); } { 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) /// Planes number for the specified image format (fourcc)
/// \return 0 for unknown formats /// \return 0 for unknown formats
...@@ -962,7 +968,7 @@ public: ...@@ -962,7 +968,7 @@ public:
static Image createFromHandle(vx_context context, vx_df_image format,const vx_imagepatch_addressing_t& addr, void* ptr) 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"); 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 #ifdef VX_VERSION_1_1
......
...@@ -19,8 +19,7 @@ ivx::Graph createProcessingGraph(ivx::Image& inputImage, ivx::Image& outputImage ...@@ -19,8 +19,7 @@ ivx::Graph createProcessingGraph(ivx::Image& inputImage, ivx::Image& outputImage
{ {
using namespace ivx; using namespace ivx;
Context context = inputImage.getContext(); Context context = inputImage.get<Context>();
Graph graph = Graph::create(context); Graph graph = Graph::create(context);
vx_uint32 width = inputImage.width(); vx_uint32 width = inputImage.width();
......
...@@ -19,8 +19,7 @@ ivx::Graph createProcessingGraph(ivx::Image& inputImage, ivx::Image& outputImage ...@@ -19,8 +19,7 @@ ivx::Graph createProcessingGraph(ivx::Image& inputImage, ivx::Image& outputImage
{ {
using namespace ivx; using namespace ivx;
Context context = inputImage.getContext(); Context context = inputImage.get<Context>();
Graph graph = Graph::create(context); Graph graph = Graph::create(context);
vx_uint32 width = inputImage.width(); vx_uint32 width = inputImage.width();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment