Joe Verbout
/
main
opencv on mbed
Embed:
(wiki syntax)
Show/hide line numbers
va_intel.hpp
00001 // This file is part of OpenCV project. 00002 // It is subject to the license terms in the LICENSE file found in the top-level directory 00003 // of this distribution and at http://opencv.org/license.html. 00004 00005 // Copyright (C) 2015, Itseez, Inc., all rights reserved. 00006 // Third party copyrights are property of their respective owners. 00007 00008 #ifndef __OPENCV_CORE_VA_INTEL_HPP__ 00009 #define __OPENCV_CORE_VA_INTEL_HPP__ 00010 00011 #ifndef __cplusplus 00012 # error va_intel.hpp header must be compiled as C++ 00013 #endif 00014 00015 #include "opencv2/core.hpp" 00016 #include "ocl.hpp" 00017 00018 #if defined(HAVE_VA) 00019 # include "va/va.h" 00020 #else // HAVE_VA 00021 # if !defined(_VA_H_) 00022 typedef void* VADisplay; 00023 typedef unsigned int VASurfaceID; 00024 # endif // !_VA_H_ 00025 #endif // HAVE_VA 00026 00027 namespace cv { namespace va_intel { 00028 00029 /** @addtogroup core_va_intel 00030 This section describes Intel VA-API/OpenCL (CL-VA) interoperability. 00031 00032 To enable CL-VA interoperability support, configure OpenCV using CMake with WITH_VA_INTEL=ON . Currently VA-API is 00033 supported on Linux only. You should also install Intel Media Server Studio (MSS) to use this feature. You may 00034 have to specify the path(s) to MSS components for cmake in environment variables: VA_INTEL_MSDK_ROOT for Media SDK 00035 (default is "/opt/intel/mediasdk"), and VA_INTEL_IOCL_ROOT for Intel OpenCL (default is "/opt/intel/opencl"). 00036 00037 To use CL-VA interoperability you should first create VADisplay (libva), and then call initializeContextFromVA() 00038 function to create OpenCL context and set up interoperability. 00039 */ 00040 //! @{ 00041 00042 /////////////////// CL-VA Interoperability Functions /////////////////// 00043 00044 namespace ocl { 00045 using namespace cv::ocl; 00046 00047 // TODO static functions in the Context class 00048 /** @brief Creates OpenCL context from VA. 00049 @param display - VADisplay for which CL interop should be established. 00050 @param tryInterop - try to set up for interoperability, if true; set up for use slow copy if false. 00051 @return Returns reference to OpenCL Context 00052 */ 00053 CV_EXPORTS Context& initializeContextFromVA(VADisplay display, bool tryInterop = true); 00054 00055 } // namespace cv::va_intel::ocl 00056 00057 /** @brief Converts InputArray to VASurfaceID object. 00058 @param display - VADisplay object. 00059 @param src - source InputArray. 00060 @param surface - destination VASurfaceID object. 00061 @param size - size of image represented by VASurfaceID object. 00062 */ 00063 CV_EXPORTS void convertToVASurface(VADisplay display, InputArray src, VASurfaceID surface, Size size); 00064 00065 /** @brief Converts VASurfaceID object to OutputArray. 00066 @param display - VADisplay object. 00067 @param surface - source VASurfaceID object. 00068 @param size - size of image represented by VASurfaceID object. 00069 @param dst - destination OutputArray. 00070 */ 00071 CV_EXPORTS void convertFromVASurface(VADisplay display, VASurfaceID surface, Size size, OutputArray dst); 00072 00073 //! @} 00074 00075 }} // namespace cv::va_intel 00076 00077 #endif /* __OPENCV_CORE_VA_INTEL_HPP__ */ 00078
Generated on Tue Jul 12 2022 16:42:40 by 1.7.2