build fixes for openvx-1.0.1 and c++03
authorAndrey Pavlenko <apavlenko@users.noreply.github.com>
Fri, 18 Nov 2016 12:11:17 +0000 (15:11 +0300)
committerRostislav Vasilikhin <rostislav.vasilikhin@intel.com>
Tue, 22 Nov 2016 13:49:46 +0000 (16:49 +0300)
* fixing 1.0.1
* fixing build without c++11

3rdparty/openvx/include/ivx.hpp
samples/openvx/wrappers.cpp
samples/openvx/wrappers_video.cpp

index abf266e..5162adf 100644 (file)
@@ -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
index da75857..32a1442 100644 (file)
@@ -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();
index d08a845..35caa28 100644 (file)
@@ -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();