Commit 795a513a authored by Andrey Kamaev's avatar Andrey Kamaev Committed by OpenCV Buildbot

Merge pull request #716 from asmorkalov:winrt

parents a2d89ace a2561ee0
...@@ -122,15 +122,32 @@ file(GLOB lib_srcs "${tbb_src_dir}/src/tbb/*.cpp") ...@@ -122,15 +122,32 @@ file(GLOB lib_srcs "${tbb_src_dir}/src/tbb/*.cpp")
file(GLOB lib_hdrs "${tbb_src_dir}/src/tbb/*.h") file(GLOB lib_hdrs "${tbb_src_dir}/src/tbb/*.h")
list(APPEND lib_srcs "${tbb_src_dir}/src/rml/client/rml_tbb.cpp") list(APPEND lib_srcs "${tbb_src_dir}/src/rml/client/rml_tbb.cpp")
add_definitions(-D__TBB_DYNAMIC_LOAD_ENABLED=0 #required if (WIN32)
-D__TBB_BUILD=1 #required add_definitions(-D__TBB_DYNAMIC_LOAD_ENABLED=0
-D__TBB_SURVIVE_THREAD_SWITCH=0 #no cilk support -D__TBB_BUILD=1
-DUSE_PTHREAD #required for Unix -D_UNICODE
-DTBB_USE_GCC_BUILTINS=1 #required for ARM GCC -DUNICODE
-DTBB_USE_DEBUG=0 #just to be sure -DWINAPI_FAMILY=WINAPI_FAMILY_APP
-DTBB_NO_LEGACY=1 #don't need backward compatibility -DDO_ITT_NOTIFY=0
-DDO_ITT_NOTIFY=0 #it seems that we don't need these notifications ) # defines were copied from windows.cl.inc
) set(CMAKE_LINKER_FLAGS "${CMAKE_LINKER_FLAGS} /APPCONTAINER")
else()
add_definitions(-D__TBB_DYNAMIC_LOAD_ENABLED=0 #required
-D__TBB_BUILD=1 #required
-D__TBB_SURVIVE_THREAD_SWITCH=0 #no cilk support
-DTBB_USE_DEBUG=0 #just to be sure
-DTBB_NO_LEGACY=1 #don't need backward compatibility
-DDO_ITT_NOTIFY=0 #it seems that we don't need these notifications
)
endif()
if (HAVE_LIBPTHREAD)
add_definitions(-DUSE_PTHREAD) #required for Unix
endif()
if (CMAKE_COMPILER_IS_GNUCXX)
add_definitions(-DTBB_USE_GCC_BUILTINS=1) #required for ARM GCC
endif()
if(ANDROID_COMPILER_IS_CLANG) if(ANDROID_COMPILER_IS_CLANG)
add_definitions(-D__TBB_GCC_BUILTIN_ATOMICS_PRESENT=1) add_definitions(-D__TBB_GCC_BUILTIN_ATOMICS_PRESENT=1)
...@@ -145,7 +162,7 @@ endif() ...@@ -145,7 +162,7 @@ endif()
set(TBB_SOURCE_FILES ${lib_srcs} ${lib_hdrs}) set(TBB_SOURCE_FILES ${lib_srcs} ${lib_hdrs})
if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm") if (ARM AND NOT WIN32)
if (NOT ANDROID) if (NOT ANDROID)
set(TBB_SOURCE_FILES ${TBB_SOURCE_FILES} "${CMAKE_CURRENT_SOURCE_DIR}/arm_linux_stub.cpp") set(TBB_SOURCE_FILES ${TBB_SOURCE_FILES} "${CMAKE_CURRENT_SOURCE_DIR}/arm_linux_stub.cpp")
endif() endif()
......
...@@ -118,6 +118,7 @@ OCV_OPTION(WITH_CUFFT "Include NVidia Cuda Fast Fourier Transform (FFT) ...@@ -118,6 +118,7 @@ OCV_OPTION(WITH_CUFFT "Include NVidia Cuda Fast Fourier Transform (FFT)
OCV_OPTION(WITH_CUBLAS "Include NVidia Cuda Basic Linear Algebra Subprograms (BLAS) library support" OFF IF (CMAKE_VERSION VERSION_GREATER "2.8" AND NOT ANDROID AND NOT IOS) ) OCV_OPTION(WITH_CUBLAS "Include NVidia Cuda Basic Linear Algebra Subprograms (BLAS) library support" OFF IF (CMAKE_VERSION VERSION_GREATER "2.8" AND NOT ANDROID AND NOT IOS) )
OCV_OPTION(WITH_NVCUVID "Include NVidia Video Decoding library support" OFF IF (CMAKE_VERSION VERSION_GREATER "2.8" AND NOT ANDROID AND NOT IOS AND NOT APPLE) ) OCV_OPTION(WITH_NVCUVID "Include NVidia Video Decoding library support" OFF IF (CMAKE_VERSION VERSION_GREATER "2.8" AND NOT ANDROID AND NOT IOS AND NOT APPLE) )
OCV_OPTION(WITH_EIGEN "Include Eigen2/Eigen3 support" ON) OCV_OPTION(WITH_EIGEN "Include Eigen2/Eigen3 support" ON)
OCV_OPTION(WITH_VFW "Include Video for Windows support" ON IF (WIN32))
OCV_OPTION(WITH_FFMPEG "Include FFMPEG support" ON IF (NOT ANDROID AND NOT IOS)) OCV_OPTION(WITH_FFMPEG "Include FFMPEG support" ON IF (NOT ANDROID AND NOT IOS))
OCV_OPTION(WITH_GSTREAMER "Include Gstreamer support" ON IF (UNIX AND NOT APPLE AND NOT ANDROID) ) OCV_OPTION(WITH_GSTREAMER "Include Gstreamer support" ON IF (UNIX AND NOT APPLE AND NOT ANDROID) )
OCV_OPTION(WITH_GTK "Include GTK support" ON IF (UNIX AND NOT APPLE AND NOT ANDROID) ) OCV_OPTION(WITH_GTK "Include GTK support" ON IF (UNIX AND NOT APPLE AND NOT ANDROID) )
...@@ -132,13 +133,15 @@ OCV_OPTION(WITH_PNG "Include PNG support" ON) ...@@ -132,13 +133,15 @@ OCV_OPTION(WITH_PNG "Include PNG support" ON)
OCV_OPTION(WITH_PVAPI "Include Prosilica GigE support" ON IF (NOT ANDROID AND NOT IOS) ) OCV_OPTION(WITH_PVAPI "Include Prosilica GigE support" ON IF (NOT ANDROID AND NOT IOS) )
OCV_OPTION(WITH_GIGEAPI "Include Smartek GigE support" ON IF (NOT ANDROID AND NOT IOS) ) OCV_OPTION(WITH_GIGEAPI "Include Smartek GigE support" ON IF (NOT ANDROID AND NOT IOS) )
OCV_OPTION(WITH_QT "Build with Qt Backend support" OFF IF (NOT ANDROID AND NOT IOS) ) OCV_OPTION(WITH_QT "Build with Qt Backend support" OFF IF (NOT ANDROID AND NOT IOS) )
OCV_OPTION(WITH_WIN32UI "Build with Win32 UI Backend support" ON IF (WIN32) )
OCV_OPTION(WITH_QUICKTIME "Use QuickTime for Video I/O insted of QTKit" OFF IF APPLE ) OCV_OPTION(WITH_QUICKTIME "Use QuickTime for Video I/O insted of QTKit" OFF IF APPLE )
OCV_OPTION(WITH_TBB "Include Intel TBB support" OFF IF (NOT IOS) ) OCV_OPTION(WITH_TBB "Include Intel TBB support" OFF IF (NOT IOS) )
OCV_OPTION(WITH_CSTRIPES "Include C= support" OFF IF WIN32 ) OCV_OPTION(WITH_CSTRIPES "Include C= support" OFF IF WIN32 )
OCV_OPTION(WITH_TIFF "Include TIFF support" ON IF (NOT IOS) ) OCV_OPTION(WITH_TIFF "Include TIFF support" ON IF (NOT IOS) )
OCV_OPTION(WITH_UNICAP "Include Unicap support (GPL)" OFF IF (UNIX AND NOT APPLE AND NOT ANDROID) ) OCV_OPTION(WITH_UNICAP "Include Unicap support (GPL)" OFF IF (UNIX AND NOT APPLE AND NOT ANDROID) )
OCV_OPTION(WITH_V4L "Include Video 4 Linux support" ON IF (UNIX AND NOT ANDROID) ) OCV_OPTION(WITH_V4L "Include Video 4 Linux support" ON IF (UNIX AND NOT ANDROID) )
OCV_OPTION(WITH_VIDEOINPUT "Build HighGUI with DirectShow support" ON IF WIN32 ) OCV_OPTION(WITH_DSHOW "Build HighGUI with DirectShow support" ON IF (WIN32 AND NOT ARM) )
OCV_OPTION(WITH_MSMF "Build HighGUI with Media Foundation support" OFF IF WIN32 )
OCV_OPTION(WITH_XIMEA "Include XIMEA cameras support" OFF IF (NOT ANDROID AND NOT APPLE) ) OCV_OPTION(WITH_XIMEA "Include XIMEA cameras support" OFF IF (NOT ANDROID AND NOT APPLE) )
OCV_OPTION(WITH_XINE "Include Xine support (GPL)" OFF IF (UNIX AND NOT APPLE AND NOT ANDROID) ) OCV_OPTION(WITH_XINE "Include Xine support (GPL)" OFF IF (UNIX AND NOT APPLE AND NOT ANDROID) )
OCV_OPTION(WITH_OPENCL "Include OpenCL Runtime support" ON IF (NOT ANDROID AND NOT IOS) ) OCV_OPTION(WITH_OPENCL "Include OpenCL Runtime support" ON IF (NOT ANDROID AND NOT IOS) )
...@@ -169,7 +172,7 @@ OCV_OPTION(BUILD_JASPER "Build libjasper from source" WIN32 O ...@@ -169,7 +172,7 @@ OCV_OPTION(BUILD_JASPER "Build libjasper from source" WIN32 O
OCV_OPTION(BUILD_JPEG "Build libjpeg from source" WIN32 OR ANDROID OR APPLE ) OCV_OPTION(BUILD_JPEG "Build libjpeg from source" WIN32 OR ANDROID OR APPLE )
OCV_OPTION(BUILD_PNG "Build libpng from source" WIN32 OR ANDROID OR APPLE ) OCV_OPTION(BUILD_PNG "Build libpng from source" WIN32 OR ANDROID OR APPLE )
OCV_OPTION(BUILD_OPENEXR "Build openexr from source" WIN32 OR ANDROID OR APPLE ) OCV_OPTION(BUILD_OPENEXR "Build openexr from source" WIN32 OR ANDROID OR APPLE )
OCV_OPTION(BUILD_TBB "Download and build TBB from source" ANDROID IF CMAKE_COMPILER_IS_GNUCXX ) OCV_OPTION(BUILD_TBB "Download and build TBB from source" ANDROID )
# OpenCV installation options # OpenCV installation options
# =================================================== # ===================================================
...@@ -598,8 +601,8 @@ else() ...@@ -598,8 +601,8 @@ else()
if(DEFINED WITH_QT) if(DEFINED WITH_QT)
status(" QT 4.x:" NO) status(" QT 4.x:" NO)
endif() endif()
if(WIN32) if(DEFINED WITH_WIN32UI)
status(" Win32 UI:" YES) status(" Win32 UI:" HAVE_WIN32UI THEN YES ELSE NO)
else() else()
if(APPLE) if(APPLE)
if(WITH_CARBON) if(WITH_CARBON)
...@@ -656,6 +659,10 @@ endif() ...@@ -656,6 +659,10 @@ endif()
status("") status("")
status(" Video I/O:") status(" Video I/O:")
if (DEFINED WITH_VFW)
status(" Video for Windows:" HAVE_VFW THEN YES ELSE NO)
endif(DEFINED WITH_VFW)
if(DEFINED WITH_1394) if(DEFINED WITH_1394)
status(" DC1394 1.x:" HAVE_DC1394 THEN "YES (ver ${ALIASOF_libdc1394_VERSION})" ELSE NO) status(" DC1394 1.x:" HAVE_DC1394 THEN "YES (ver ${ALIASOF_libdc1394_VERSION})" ELSE NO)
status(" DC1394 2.x:" HAVE_DC1394_2 THEN "YES (ver ${ALIASOF_libdc1394-2_VERSION})" ELSE NO) status(" DC1394 2.x:" HAVE_DC1394_2 THEN "YES (ver ${ALIASOF_libdc1394-2_VERSION})" ELSE NO)
...@@ -738,9 +745,13 @@ if(DEFINED WITH_V4L) ...@@ -738,9 +745,13 @@ if(DEFINED WITH_V4L)
ELSE "${HAVE_CAMV4L_STR}/${HAVE_CAMV4L2_STR}") ELSE "${HAVE_CAMV4L_STR}/${HAVE_CAMV4L2_STR}")
endif(DEFINED WITH_V4L) endif(DEFINED WITH_V4L)
if(DEFINED WITH_VIDEOINPUT) if(DEFINED WITH_DSHOW)
status(" DirectShow:" HAVE_VIDEOINPUT THEN YES ELSE NO) status(" DirectShow:" HAVE_DSHOW THEN YES ELSE NO)
endif(DEFINED WITH_VIDEOINPUT) endif(DEFINED WITH_DSHOW)
if(DEFINED WITH_MSMF)
status(" Media Foundation:" HAVE_MSMF THEN YES ELSE NO)
endif(DEFINED WITH_MSMF)
if(DEFINED WITH_XIMEA) if(DEFINED WITH_XIMEA)
status(" XIMEA:" HAVE_XIMEA THEN YES ELSE NO) status(" XIMEA:" HAVE_XIMEA THEN YES ELSE NO)
......
...@@ -57,7 +57,7 @@ if(CUDA_FOUND) ...@@ -57,7 +57,7 @@ if(CUDA_FOUND)
elseif(CUDA_GENERATION STREQUAL "Kepler") elseif(CUDA_GENERATION STREQUAL "Kepler")
set(__cuda_arch_bin "3.0") set(__cuda_arch_bin "3.0")
elseif(CUDA_GENERATION STREQUAL "Auto") elseif(CUDA_GENERATION STREQUAL "Auto")
execute_process( COMMAND "${CUDA_NVCC_EXECUTABLE}" "${OpenCV_SOURCE_DIR}/cmake/OpenCVDetectCudaArch.cu" "--run" execute_process( COMMAND "${CUDA_NVCC_EXECUTABLE}" "${OpenCV_SOURCE_DIR}/cmake/checks/OpenCVDetectCudaArch.cu" "--run"
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/" WORKING_DIRECTORY "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/"
RESULT_VARIABLE _nvcc_res OUTPUT_VARIABLE _nvcc_out RESULT_VARIABLE _nvcc_res OUTPUT_VARIABLE _nvcc_out
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE) ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
......
...@@ -103,4 +103,6 @@ if(CMAKE_SYSTEM_PROCESSOR MATCHES "amd64.*|x86_64.*|AMD64.*" OR CMAKE_GENERATOR ...@@ -103,4 +103,6 @@ if(CMAKE_SYSTEM_PROCESSOR MATCHES "amd64.*|x86_64.*|AMD64.*" OR CMAKE_GENERATOR
set(X86_64 1) set(X86_64 1)
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "i686.*|i386.*|x86.*|amd64.*|AMD64.*") elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "i686.*|i386.*|x86.*|amd64.*|AMD64.*")
set(X86 1) set(X86 1)
elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "arm.*|ARM.*")
set(ARM 1)
endif() endif()
...@@ -2,6 +2,16 @@ ...@@ -2,6 +2,16 @@
# Detect 3rd-party GUI libraries # Detect 3rd-party GUI libraries
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
#--- Win32 UI ---
ocv_clear_vars(HAVE_WIN32UI)
if(WITH_WIN32UI)
TRY_COMPILE(HAVE_WIN32UI
"${OPENCV_BINARY_DIR}/CMakeFiles/CMakeTmp"
"${OpenCV_SOURCE_DIR}/cmake/checks/win32uitest.cpp"
CMAKE_FLAGS "\"user32.lib\" \"gdi32.lib\""
OUTPUT_VARIABLE OUTPUT)
endif(WITH_WIN32UI)
# --- QT4 --- # --- QT4 ---
ocv_clear_vars(HAVE_QT) ocv_clear_vars(HAVE_QT)
if(WITH_QT) if(WITH_QT)
......
...@@ -2,6 +2,15 @@ ...@@ -2,6 +2,15 @@
# Detect 3rd-party video IO libraries # Detect 3rd-party video IO libraries
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
ocv_clear_vars(HAVE_VFW)
if (WITH_VFW)
TRY_COMPILE(HAVE_VFW
"${OPENCV_BINARY_DIR}/CMakeFiles/CMakeTmp"
"${OpenCV_SOURCE_DIR}/cmake/checks/vfwtest.cpp"
CMAKE_FLAGS "-DLINK_LIBRARIES:STRING=vfw32"
OUTPUT_VARIABLE OUTPUT)
endif(WITH_VFW)
# --- GStreamer --- # --- GStreamer ---
ocv_clear_vars(HAVE_GSTREAMER) ocv_clear_vars(HAVE_GSTREAMER)
if(WITH_GSTREAMER) if(WITH_GSTREAMER)
...@@ -37,7 +46,7 @@ if(WITH_PVAPI) ...@@ -37,7 +46,7 @@ if(WITH_PVAPI)
set(PVAPI_SDK_SUBDIR x86) set(PVAPI_SDK_SUBDIR x86)
elseif(X86_64) elseif(X86_64)
set(PVAPI_SDK_SUBDIR x64) set(PVAPI_SDK_SUBDIR x64)
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES arm) elseif(ARM)
set(PVAPI_SDK_SUBDIR arm) set(PVAPI_SDK_SUBDIR arm)
endif() endif()
...@@ -111,7 +120,7 @@ endif(WITH_XIMEA) ...@@ -111,7 +120,7 @@ endif(WITH_XIMEA)
# --- FFMPEG --- # --- FFMPEG ---
ocv_clear_vars(HAVE_FFMPEG HAVE_FFMPEG_CODEC HAVE_FFMPEG_FORMAT HAVE_FFMPEG_UTIL HAVE_FFMPEG_SWSCALE HAVE_GENTOO_FFMPEG HAVE_FFMPEG_FFMPEG) ocv_clear_vars(HAVE_FFMPEG HAVE_FFMPEG_CODEC HAVE_FFMPEG_FORMAT HAVE_FFMPEG_UTIL HAVE_FFMPEG_SWSCALE HAVE_GENTOO_FFMPEG HAVE_FFMPEG_FFMPEG)
if(WITH_FFMPEG) if(WITH_FFMPEG)
if(WIN32) if(WIN32 AND NOT ARM)
include("${OpenCV_SOURCE_DIR}/3rdparty/ffmpeg/ffmpeg_version.cmake") include("${OpenCV_SOURCE_DIR}/3rdparty/ffmpeg/ffmpeg_version.cmake")
elseif(UNIX) elseif(UNIX)
CHECK_MODULE(libavcodec HAVE_FFMPEG_CODEC) CHECK_MODULE(libavcodec HAVE_FFMPEG_CODEC)
...@@ -175,11 +184,16 @@ if(WITH_FFMPEG) ...@@ -175,11 +184,16 @@ if(WITH_FFMPEG)
endif(APPLE) endif(APPLE)
endif(WITH_FFMPEG) endif(WITH_FFMPEG)
# --- VideoInput --- # --- VideoInput/DirectShow ---
if(WITH_VIDEOINPUT) if(WITH_DSHOW)
# always have VideoInput on Windows # always have VideoInput on Windows
set(HAVE_VIDEOINPUT 1) set(HAVE_DSHOW 1)
endif(WITH_VIDEOINPUT) endif(WITH_DSHOW)
# --- VideoInput/Microsoft Media Foundation ---
if(WITH_MSMF)
check_include_file(Mfapi.h HAVE_MSMF)
endif(WITH_MSMF)
# --- Extra HighGUI libs on Windows --- # --- Extra HighGUI libs on Windows ---
if(WIN32) if(WIN32)
......
...@@ -12,6 +12,7 @@ endmacro() ...@@ -12,6 +12,7 @@ endmacro()
ocv_legacy_option(BUILD_NEW_PYTHON_SUPPORT BUILD_opencv_python) ocv_legacy_option(BUILD_NEW_PYTHON_SUPPORT BUILD_opencv_python)
ocv_legacy_option(BUILD_JAVA_SUPPORT BUILD_opencv_java) ocv_legacy_option(BUILD_JAVA_SUPPORT BUILD_opencv_java)
ocv_legacy_option(WITH_ANDROID_CAMERA BUILD_opencv_androidcamera) ocv_legacy_option(WITH_ANDROID_CAMERA BUILD_opencv_androidcamera)
ocv_legacy_option(WITH_VIDEOINPUT WITH_DSHOW)
if(DEFINED OPENCV_BUILD_3RDPARTY_LIBS) if(DEFINED OPENCV_BUILD_3RDPARTY_LIBS)
set(BUILD_ZLIB ${OPENCV_BUILD_3RDPARTY_LIBS} CACHE BOOL "Set via depricated OPENCV_BUILD_3RDPARTY_LIBS" FORCE) set(BUILD_ZLIB ${OPENCV_BUILD_3RDPARTY_LIBS} CACHE BOOL "Set via depricated OPENCV_BUILD_3RDPARTY_LIBS" FORCE)
......
#include <windows.h>
#include <vfw.h>
int main()
{
AVIFileInit();
AVIFileExit();
return 0;
}
\ No newline at end of file
#include <windows.h>
int main(int argc, char** argv)
{
CreateWindow(NULL /*lpClassName*/, NULL /*lpWindowName*/, 0 /*dwStyle*/, 0 /*x*/,
0 /*y*/, 0 /*nWidth*/, 0 /*nHeight*/, NULL /*hWndParent*/, NULL /*hMenu*/,
NULL /*hInstance*/, NULL /*lpParam*/);
DeleteDC(NULL);
return 0;
}
...@@ -13,6 +13,9 @@ ...@@ -13,6 +13,9 @@
*/ */
#cmakedefine HAVE_ALLOCA_H 1 #cmakedefine HAVE_ALLOCA_H 1
/* Video for Windows support */
#cmakedefine HAVE_VFW
/* V4L capturing support */ /* V4L capturing support */
#cmakedefine HAVE_CAMV4L #cmakedefine HAVE_CAMV4L
...@@ -55,6 +58,9 @@ ...@@ -55,6 +58,9 @@
/* GTK+ 2.0 Thread support */ /* GTK+ 2.0 Thread support */
#cmakedefine HAVE_GTHREAD #cmakedefine HAVE_GTHREAD
/* Win32 UI */
#cmakedefine HAVE_WIN32UI
/* GTK+ 2.x toolkit */ /* GTK+ 2.x toolkit */
#cmakedefine HAVE_GTK #cmakedefine HAVE_GTK
...@@ -208,8 +214,11 @@ ...@@ -208,8 +214,11 @@
/* AMD's Basic Linear Algebra Subprograms Library*/ /* AMD's Basic Linear Algebra Subprograms Library*/
#cmakedefine HAVE_CLAMDBLAS #cmakedefine HAVE_CLAMDBLAS
/* VideoInput library */ /* DirectShow Video Capture library */
#cmakedefine HAVE_VIDEOINPUT #cmakedefine HAVE_DSHOW
/* Microsoft Media Foundation Capture library */
#cmakedefine HAVE_MSMF
/* XIMEA camera support */ /* XIMEA camera support */
#cmakedefine HAVE_XIMEA #cmakedefine HAVE_XIMEA
......
...@@ -322,8 +322,12 @@ CV_INLINE int cvRound( double value ) ...@@ -322,8 +322,12 @@ CV_INLINE int cvRound( double value )
return (int)lrint(value); return (int)lrint(value);
# endif # endif
#else #else
// while this is not IEEE754-compliant rounding, it's usually a good enough approximation double intpart, fractpart;
return (int)(value + (value >= 0 ? 0.5 : -0.5)); fractpart = modf(value, &intpart);
if ((abs(fractpart) != 0.5) || ((((int)intpart) % 2) != 0))
return (int)(value + (value >= 0 ? 0.5 : -0.5));
else
return (int)intpart;
#endif #endif
} }
......
...@@ -999,25 +999,22 @@ static int normHamming(const uchar* a, int n) ...@@ -999,25 +999,22 @@ static int normHamming(const uchar* a, int n)
{ {
int i = 0, result = 0; int i = 0, result = 0;
#if CV_NEON #if CV_NEON
if (CPU_HAS_NEON_FEATURE) uint32x4_t bits = vmovq_n_u32(0);
{ for (; i <= n - 16; i += 16) {
uint32x4_t bits = vmovq_n_u32(0); uint8x16_t A_vec = vld1q_u8 (a + i);
for (; i <= n - 16; i += 16) { uint8x16_t bitsSet = vcntq_u8 (A_vec);
uint8x16_t A_vec = vld1q_u8 (a + i); uint16x8_t bitSet8 = vpaddlq_u8 (bitsSet);
uint8x16_t bitsSet = vcntq_u8 (A_vec); uint32x4_t bitSet4 = vpaddlq_u16 (bitSet8);
uint16x8_t bitSet8 = vpaddlq_u8 (bitsSet); bits = vaddq_u32(bits, bitSet4);
uint32x4_t bitSet4 = vpaddlq_u16 (bitSet8); }
bits = vaddq_u32(bits, bitSet4); uint64x2_t bitSet2 = vpaddlq_u32 (bits);
} result = vgetq_lane_s32 (vreinterpretq_s32_u64(bitSet2),0);
uint64x2_t bitSet2 = vpaddlq_u32 (bits); result += vgetq_lane_s32 (vreinterpretq_s32_u64(bitSet2),2);
result = vgetq_lane_s32 (vreinterpretq_s32_u64(bitSet2),0); #else
result += vgetq_lane_s32 (vreinterpretq_s32_u64(bitSet2),2); for( ; i <= n - 4; i += 4 )
}
else
#endif
for( ; i <= n - 4; i += 4 )
result += popCountTable[a[i]] + popCountTable[a[i+1]] + result += popCountTable[a[i]] + popCountTable[a[i+1]] +
popCountTable[a[i+2]] + popCountTable[a[i+3]]; popCountTable[a[i+2]] + popCountTable[a[i+3]];
#endif
for( ; i < n; i++ ) for( ; i < n; i++ )
result += popCountTable[a[i]]; result += popCountTable[a[i]];
return result; return result;
...@@ -1027,27 +1024,24 @@ int normHamming(const uchar* a, const uchar* b, int n) ...@@ -1027,27 +1024,24 @@ int normHamming(const uchar* a, const uchar* b, int n)
{ {
int i = 0, result = 0; int i = 0, result = 0;
#if CV_NEON #if CV_NEON
if (CPU_HAS_NEON_FEATURE) uint32x4_t bits = vmovq_n_u32(0);
{ for (; i <= n - 16; i += 16) {
uint32x4_t bits = vmovq_n_u32(0); uint8x16_t A_vec = vld1q_u8 (a + i);
for (; i <= n - 16; i += 16) { uint8x16_t B_vec = vld1q_u8 (b + i);
uint8x16_t A_vec = vld1q_u8 (a + i); uint8x16_t AxorB = veorq_u8 (A_vec, B_vec);
uint8x16_t B_vec = vld1q_u8 (b + i); uint8x16_t bitsSet = vcntq_u8 (AxorB);
uint8x16_t AxorB = veorq_u8 (A_vec, B_vec); uint16x8_t bitSet8 = vpaddlq_u8 (bitsSet);
uint8x16_t bitsSet = vcntq_u8 (AxorB); uint32x4_t bitSet4 = vpaddlq_u16 (bitSet8);
uint16x8_t bitSet8 = vpaddlq_u8 (bitsSet); bits = vaddq_u32(bits, bitSet4);
uint32x4_t bitSet4 = vpaddlq_u16 (bitSet8); }
bits = vaddq_u32(bits, bitSet4); uint64x2_t bitSet2 = vpaddlq_u32 (bits);
} result = vgetq_lane_s32 (vreinterpretq_s32_u64(bitSet2),0);
uint64x2_t bitSet2 = vpaddlq_u32 (bits); result += vgetq_lane_s32 (vreinterpretq_s32_u64(bitSet2),2);
result = vgetq_lane_s32 (vreinterpretq_s32_u64(bitSet2),0); #else
result += vgetq_lane_s32 (vreinterpretq_s32_u64(bitSet2),2); for( ; i <= n - 4; i += 4 )
} result += popCountTable[a[i] ^ b[i]] + popCountTable[a[i+1] ^ b[i+1]] +
else popCountTable[a[i+2] ^ b[i+2]] + popCountTable[a[i+3] ^ b[i+3]];
#endif #endif
for( ; i <= n - 4; i += 4 )
result += popCountTable[a[i] ^ b[i]] + popCountTable[a[i+1] ^ b[i+1]] +
popCountTable[a[i+2] ^ b[i+2]] + popCountTable[a[i+3] ^ b[i+3]];
for( ; i < n; i++ ) for( ; i < n; i++ )
result += popCountTable[a[i] ^ b[i]]; result += popCountTable[a[i] ^ b[i]];
return result; return result;
......
...@@ -1551,3 +1551,16 @@ TEST(Core_Add, AddToColumnWhen4Rows) ...@@ -1551,3 +1551,16 @@ TEST(Core_Add, AddToColumnWhen4Rows)
ASSERT_EQ(0, countNonZero(m1 - m2)); ASSERT_EQ(0, countNonZero(m1 - m2));
} }
TEST(Core_round, CvRound)
{
ASSERT_EQ(2, cvRound(2.0));
ASSERT_EQ(2, cvRound(2.1));
ASSERT_EQ(-2, cvRound(-2.1));
ASSERT_EQ(3, cvRound(2.8));
ASSERT_EQ(-3, cvRound(-2.8));
ASSERT_EQ(2, cvRound(2.5));
ASSERT_EQ(4, cvRound(3.5));
ASSERT_EQ(-2, cvRound(-2.5));
ASSERT_EQ(-4, cvRound(-3.5));
}
\ No newline at end of file
...@@ -456,7 +456,6 @@ struct Hamming ...@@ -456,7 +456,6 @@ struct Hamming
ResultType operator()(Iterator1 a, Iterator2 b, size_t size, ResultType /*worst_dist*/ = -1) const ResultType operator()(Iterator1 a, Iterator2 b, size_t size, ResultType /*worst_dist*/ = -1) const
{ {
ResultType result = 0; ResultType result = 0;
#ifdef __GNUC__
#ifdef __ARM_NEON__ #ifdef __ARM_NEON__
{ {
uint32x4_t bits = vmovq_n_u32(0); uint32x4_t bits = vmovq_n_u32(0);
...@@ -473,7 +472,7 @@ struct Hamming ...@@ -473,7 +472,7 @@ struct Hamming
result = vgetq_lane_s32 (vreinterpretq_s32_u64(bitSet2),0); result = vgetq_lane_s32 (vreinterpretq_s32_u64(bitSet2),0);
result += vgetq_lane_s32 (vreinterpretq_s32_u64(bitSet2),2); result += vgetq_lane_s32 (vreinterpretq_s32_u64(bitSet2),2);
} }
#else #elif __GNUC__
{ {
//for portability just use unsigned long -- and use the __builtin_popcountll (see docs for __builtin_popcountll) //for portability just use unsigned long -- and use the __builtin_popcountll (see docs for __builtin_popcountll)
typedef unsigned long long pop_t; typedef unsigned long long pop_t;
...@@ -493,8 +492,8 @@ struct Hamming ...@@ -493,8 +492,8 @@ struct Hamming
result += __builtin_popcountll(a_final ^ b_final); result += __builtin_popcountll(a_final ^ b_final);
} }
} }
#endif //NEON #else // NO NEON and NOT GNUC
#else typedef unsigned long long pop_t;
HammingLUT lut; HammingLUT lut;
result = lut(reinterpret_cast<const unsigned char*> (a), result = lut(reinterpret_cast<const unsigned char*> (a),
reinterpret_cast<const unsigned char*> (b), size * sizeof(pop_t)); reinterpret_cast<const unsigned char*> (b), size * sizeof(pop_t));
......
...@@ -89,7 +89,7 @@ if(HAVE_QT) ...@@ -89,7 +89,7 @@ if(HAVE_QT)
if(${_have_flag}) if(${_have_flag})
set_source_files_properties(${_RCC_OUTFILES} PROPERTIES COMPILE_FLAGS -Wno-missing-declarations) set_source_files_properties(${_RCC_OUTFILES} PROPERTIES COMPILE_FLAGS -Wno-missing-declarations)
endif() endif()
elseif(WIN32) elseif(HAVE_WIN32UI)
list(APPEND highgui_srcs src/window_w32.cpp) list(APPEND highgui_srcs src/window_w32.cpp)
elseif(HAVE_GTK) elseif(HAVE_GTK)
list(APPEND highgui_srcs src/window_gtk.cpp) list(APPEND highgui_srcs src/window_gtk.cpp)
...@@ -105,9 +105,21 @@ elseif(APPLE) ...@@ -105,9 +105,21 @@ elseif(APPLE)
endif() endif()
endif() endif()
if(WIN32) if(WIN32 AND NOT ARM)
list(APPEND highgui_srcs src/cap_vfw.cpp src/cap_cmu.cpp src/cap_dshow.cpp) list(APPEND highgui_srcs src/cap_cmu.cpp)
endif(WIN32) endif()
if (WIN32 AND HAVE_DSHOW)
list(APPEND highgui_srcs src/cap_dshow.cpp)
endif()
if (WIN32 AND HAVE_MSMF)
list(APPEND highgui_srcs src/cap_msmf.cpp)
endif()
if (WIN32 AND HAVE_VFW)
list(APPEND highgui_srcs src/cap_vfw.cpp)
endif()
if(HAVE_XINE) if(HAVE_XINE)
list(APPEND highgui_srcs src/cap_xine.cpp) list(APPEND highgui_srcs src/cap_xine.cpp)
......
...@@ -297,6 +297,7 @@ enum ...@@ -297,6 +297,7 @@ enum
CV_CAP_UNICAP =600, // Unicap drivers CV_CAP_UNICAP =600, // Unicap drivers
CV_CAP_DSHOW =700, // DirectShow (via videoInput) CV_CAP_DSHOW =700, // DirectShow (via videoInput)
CV_CAP_MSMF =1400, // Microsoft Media Foundation (via videoInput)
CV_CAP_PVAPI =800, // PvAPI, Prosilica GigE SDK CV_CAP_PVAPI =800, // PvAPI, Prosilica GigE SDK
......
...@@ -20,9 +20,9 @@ ...@@ -20,9 +20,9 @@
defined(HAVE_GSTREAMER) || \ defined(HAVE_GSTREAMER) || \
defined(HAVE_QUICKTIME) || \ defined(HAVE_QUICKTIME) || \
defined(HAVE_AVFOUNDATION) || \ defined(HAVE_AVFOUNDATION) || \
/*defined(HAVE_OPENNI) || too specialized */ \
defined(HAVE_FFMPEG) || \ defined(HAVE_FFMPEG) || \
defined(WIN32) /* assume that we have ffmpeg */ defined(HAVE_VFW)
/*defined(HAVE_OPENNI) too specialized */ \
# define BUILD_WITH_VIDEO_INPUT_SUPPORT 1 # define BUILD_WITH_VIDEO_INPUT_SUPPORT 1
#else #else
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
defined(HAVE_QUICKTIME) || \ defined(HAVE_QUICKTIME) || \
defined(HAVE_AVFOUNDATION) || \ defined(HAVE_AVFOUNDATION) || \
defined(HAVE_FFMPEG) || \ defined(HAVE_FFMPEG) || \
defined(WIN32) /* assume that we have ffmpeg */ defined(HAVE_VFW)
# define BUILD_WITH_VIDEO_OUTPUT_SUPPORT 1 # define BUILD_WITH_VIDEO_OUTPUT_SUPPORT 1
#else #else
# define BUILD_WITH_VIDEO_OUTPUT_SUPPORT 0 # define BUILD_WITH_VIDEO_OUTPUT_SUPPORT 0
......
...@@ -114,7 +114,7 @@ CV_IMPL CvCapture * cvCreateCameraCapture (int index) ...@@ -114,7 +114,7 @@ CV_IMPL CvCapture * cvCreateCameraCapture (int index)
{ {
int domains[] = int domains[] =
{ {
#ifdef HAVE_VIDEOINPUT #ifdef HAVE_DSHOW
CV_CAP_DSHOW, CV_CAP_DSHOW,
#endif #endif
#if 1 #if 1
...@@ -168,7 +168,8 @@ CV_IMPL CvCapture * cvCreateCameraCapture (int index) ...@@ -168,7 +168,8 @@ CV_IMPL CvCapture * cvCreateCameraCapture (int index)
// try every possibly installed camera API // try every possibly installed camera API
for (int i = 0; domains[i] >= 0; i++) for (int i = 0; domains[i] >= 0; i++)
{ {
#if defined(HAVE_VIDEOINPUT) || \ #if defined(HAVE_DSHOW) || \
defined(HAVE_MSMF) || \
defined(HAVE_TYZX) || \ defined(HAVE_TYZX) || \
defined(HAVE_VFW) || \ defined(HAVE_VFW) || \
defined(HAVE_LIBV4L) || \ defined(HAVE_LIBV4L) || \
...@@ -195,11 +196,18 @@ CV_IMPL CvCapture * cvCreateCameraCapture (int index) ...@@ -195,11 +196,18 @@ CV_IMPL CvCapture * cvCreateCameraCapture (int index)
switch (domains[i]) switch (domains[i])
{ {
#ifdef HAVE_VIDEOINPUT #ifdef HAVE_MSMF
case CV_CAP_MSMF:
capture = cvCreateCameraCapture_MSMF (index);
if (capture)
return capture;
break;
#endif
#ifdef HAVE_DSHOW
case CV_CAP_DSHOW: case CV_CAP_DSHOW:
capture = cvCreateCameraCapture_DShow (index); capture = cvCreateCameraCapture_DShow (index);
if (capture) if (capture)
return capture; return capture;
break; break;
#endif #endif
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
#include "precomp.hpp" #include "precomp.hpp"
#if (defined WIN32 || defined _WIN32) && defined HAVE_VIDEOINPUT #if (defined WIN32 || defined _WIN32) && defined HAVE_DSHOW
/* /*
DirectShow-based Video Capturing module is based on DirectShow-based Video Capturing module is based on
...@@ -3100,6 +3100,7 @@ HRESULT videoInput::routeCrossbar(ICaptureGraphBuilder2 **ppBuild, IBaseFilter * ...@@ -3100,6 +3100,7 @@ HRESULT videoInput::routeCrossbar(ICaptureGraphBuilder2 **ppBuild, IBaseFilter *
return hr; return hr;
} }
/********************* Capturing video from camera via DirectShow *********************/ /********************* Capturing video from camera via DirectShow *********************/
class CvCaptureCAM_DShow : public CvCapture class CvCaptureCAM_DShow : public CvCapture
......
...@@ -209,7 +209,7 @@ CvCapture* cvCreateFileCapture_FFMPEG_proxy(const char * filename) ...@@ -209,7 +209,7 @@ CvCapture* cvCreateFileCapture_FFMPEG_proxy(const char * filename)
if( result->open( filename )) if( result->open( filename ))
return result; return result;
delete result; delete result;
#if defined WIN32 || defined _WIN32 #ifdef HAVE_VFW
return cvCreateFileCapture_VFW(filename); return cvCreateFileCapture_VFW(filename);
#else #else
return 0; return 0;
...@@ -263,9 +263,9 @@ CvVideoWriter* cvCreateVideoWriter_FFMPEG_proxy( const char* filename, int fourc ...@@ -263,9 +263,9 @@ CvVideoWriter* cvCreateVideoWriter_FFMPEG_proxy( const char* filename, int fourc
if( result->open( filename, fourcc, fps, frameSize, isColor != 0 )) if( result->open( filename, fourcc, fps, frameSize, isColor != 0 ))
return result; return result;
delete result; delete result;
#if defined WIN32 || defined _WIN32 #ifdef HAVE_VFW
return cvCreateVideoWriter_VFW(filename, fourcc, fps, frameSize, isColor); return cvCreateVideoWriter_VFW(filename, fourcc, fps, frameSize, isColor);
#else #else
return 0; return 0;
#endif #endif
} }
This diff is collapsed.
...@@ -103,14 +103,6 @@ struct CvVideoWriter ...@@ -103,14 +103,6 @@ struct CvVideoWriter
virtual bool writeFrame(const IplImage*) { return false; } virtual bool writeFrame(const IplImage*) { return false; }
}; };
#if defined WIN32 || defined _WIN32
#define HAVE_VFW 1
/* uncomment to enable CMUCamera1394 fireware camera module */
//#define HAVE_CMU1394 1
#endif
CvCapture * cvCreateCameraCapture_V4L( int index ); CvCapture * cvCreateCameraCapture_V4L( int index );
CvCapture * cvCreateCameraCapture_DC1394( int index ); CvCapture * cvCreateCameraCapture_DC1394( int index );
CvCapture * cvCreateCameraCapture_DC1394_2( int index ); CvCapture * cvCreateCameraCapture_DC1394_2( int index );
...@@ -126,6 +118,7 @@ CvVideoWriter* cvCreateVideoWriter_Win32( const char* filename, int fourcc, ...@@ -126,6 +118,7 @@ CvVideoWriter* cvCreateVideoWriter_Win32( const char* filename, int fourcc,
CvVideoWriter* cvCreateVideoWriter_VFW( const char* filename, int fourcc, CvVideoWriter* cvCreateVideoWriter_VFW( const char* filename, int fourcc,
double fps, CvSize frameSize, int is_color ); double fps, CvSize frameSize, int is_color );
CvCapture* cvCreateCameraCapture_DShow( int index ); CvCapture* cvCreateCameraCapture_DShow( int index );
CvCapture* cvCreateCameraCapture_MSMF( int index );
CvCapture* cvCreateCameraCapture_OpenNI( int index ); CvCapture* cvCreateCameraCapture_OpenNI( int index );
CvCapture* cvCreateFileCapture_OpenNI( const char* filename ); CvCapture* cvCreateFileCapture_OpenNI( const char* filename );
CvCapture* cvCreateCameraCapture_Android( int index ); CvCapture* cvCreateCameraCapture_Android( int index );
......
...@@ -57,7 +57,7 @@ CV_IMPL void cvSetWindowProperty(const char* name, int prop_id, double prop_valu ...@@ -57,7 +57,7 @@ CV_IMPL void cvSetWindowProperty(const char* name, int prop_id, double prop_valu
#if defined (HAVE_QT) #if defined (HAVE_QT)
cvSetModeWindow_QT(name,prop_value); cvSetModeWindow_QT(name,prop_value);
#elif defined WIN32 || defined _WIN32 #elif defined(HAVE_WIN32UI)
cvSetModeWindow_W32(name,prop_value); cvSetModeWindow_W32(name,prop_value);
#elif defined (HAVE_GTK) #elif defined (HAVE_GTK)
cvSetModeWindow_GTK(name,prop_value); cvSetModeWindow_GTK(name,prop_value);
...@@ -96,7 +96,7 @@ CV_IMPL double cvGetWindowProperty(const char* name, int prop_id) ...@@ -96,7 +96,7 @@ CV_IMPL double cvGetWindowProperty(const char* name, int prop_id)
#if defined (HAVE_QT) #if defined (HAVE_QT)
return cvGetModeWindow_QT(name); return cvGetModeWindow_QT(name);
#elif defined WIN32 || defined _WIN32 #elif defined(HAVE_WIN32UI)
return cvGetModeWindow_W32(name); return cvGetModeWindow_W32(name);
#elif defined (HAVE_GTK) #elif defined (HAVE_GTK)
return cvGetModeWindow_GTK(name); return cvGetModeWindow_GTK(name);
...@@ -113,7 +113,7 @@ CV_IMPL double cvGetWindowProperty(const char* name, int prop_id) ...@@ -113,7 +113,7 @@ CV_IMPL double cvGetWindowProperty(const char* name, int prop_id)
#if defined (HAVE_QT) #if defined (HAVE_QT)
return cvGetPropWindow_QT(name); return cvGetPropWindow_QT(name);
#elif defined WIN32 || defined _WIN32 #elif defined(HAVE_WIN32UI)
return cvGetPropWindowAutoSize_W32(name); return cvGetPropWindowAutoSize_W32(name);
#elif defined (HAVE_GTK) #elif defined (HAVE_GTK)
return cvGetPropWindowAutoSize_GTK(name); return cvGetPropWindowAutoSize_GTK(name);
...@@ -126,7 +126,7 @@ CV_IMPL double cvGetWindowProperty(const char* name, int prop_id) ...@@ -126,7 +126,7 @@ CV_IMPL double cvGetWindowProperty(const char* name, int prop_id)
#if defined (HAVE_QT) #if defined (HAVE_QT)
return cvGetRatioWindow_QT(name); return cvGetRatioWindow_QT(name);
#elif defined WIN32 || defined _WIN32 #elif defined(HAVE_WIN32UI)
return cvGetRatioWindow_W32(name); return cvGetRatioWindow_W32(name);
#elif defined (HAVE_GTK) #elif defined (HAVE_GTK)
return cvGetRatioWindow_GTK(name); return cvGetRatioWindow_GTK(name);
...@@ -139,7 +139,7 @@ CV_IMPL double cvGetWindowProperty(const char* name, int prop_id) ...@@ -139,7 +139,7 @@ CV_IMPL double cvGetWindowProperty(const char* name, int prop_id)
#if defined (HAVE_QT) #if defined (HAVE_QT)
return cvGetOpenGlProp_QT(name); return cvGetOpenGlProp_QT(name);
#elif defined WIN32 || defined _WIN32 #elif defined(HAVE_WIN32UI)
return cvGetOpenGlProp_W32(name); return cvGetOpenGlProp_W32(name);
#elif defined (HAVE_GTK) #elif defined (HAVE_GTK)
return cvGetOpenGlProp_GTK(name); return cvGetOpenGlProp_GTK(name);
...@@ -450,11 +450,11 @@ int cv::createButton(const string&, ButtonCallback, void*, int , bool ) ...@@ -450,11 +450,11 @@ int cv::createButton(const string&, ButtonCallback, void*, int , bool )
#endif #endif
#if defined WIN32 || defined _WIN32 // see window_w32.cpp #if defined(HAVE_WIN32UI) // see window_w32.cpp
#elif defined (HAVE_GTK) // see window_gtk.cpp #elif defined (HAVE_GTK) // see window_gtk.cpp
#elif defined (HAVE_COCOA) // see window_carbon.cpp #elif defined (HAVE_COCOA) // see window_carbon.cpp
#elif defined (HAVE_CARBON) #elif defined (HAVE_CARBON)
#elif defined (HAVE_QT) //YV see window_QT.cpp #elif defined (HAVE_QT) //YV see window_QT.cpp
#else #else
......
...@@ -176,7 +176,7 @@ TEST(Highgui_Video, ffmpeg_image) { CV_FFmpegReadImageTest test; test.safe_run() ...@@ -176,7 +176,7 @@ TEST(Highgui_Video, ffmpeg_image) { CV_FFmpegReadImageTest test; test.safe_run()
#endif #endif
#if defined(HAVE_FFMPEG) || defined(WIN32) || defined(_WIN32) #if defined(HAVE_FFMPEG)
//////////////////////////////// Parallel VideoWriters and VideoCaptures //////////////////////////////////// //////////////////////////////// Parallel VideoWriters and VideoCaptures ////////////////////////////////////
......
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
#include "test_precomp.hpp" #include "test_precomp.hpp"
#include "opencv2/highgui/highgui.hpp" #include "opencv2/highgui/highgui.hpp"
#if defined HAVE_GTK || defined HAVE_QT || defined WIN32 || defined _WIN32 || defined HAVE_CARBON || defined HAVE_COCOA #if defined HAVE_GTK || defined HAVE_QT || defined HAVE_WIN32UI || defined HAVE_CARBON || defined HAVE_COCOA
using namespace cv; using namespace cv;
using namespace std; using namespace std;
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
#include "opencv2/imgproc/imgproc_c.h" #include "opencv2/imgproc/imgproc_c.h"
#include <iostream> #include <iostream>
#if defined(HAVE_VIDEOINPUT) || \ #if defined(HAVE_DSHOW) || \
defined(HAVE_TYZX) || \ defined(HAVE_TYZX) || \
defined(HAVE_VFW) || \ defined(HAVE_VFW) || \
defined(HAVE_LIBV4L) || \ defined(HAVE_LIBV4L) || \
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
defined(HAVE_OPENNI) || \ defined(HAVE_OPENNI) || \
defined(HAVE_XIMEA) || \ defined(HAVE_XIMEA) || \
defined(HAVE_AVFOUNDATION) || \ defined(HAVE_AVFOUNDATION) || \
defined(HAVE_GIGE_API) || \ defined(HAVE_GIGE_API) || \
(0) (0)
//defined(HAVE_ANDROID_NATIVE_CAMERA) || - enable after #1193 //defined(HAVE_ANDROID_NATIVE_CAMERA) || - enable after #1193
# define BUILD_WITH_CAMERA_SUPPORT 1 # define BUILD_WITH_CAMERA_SUPPORT 1
...@@ -47,9 +47,7 @@ ...@@ -47,9 +47,7 @@
defined(HAVE_QUICKTIME) || \ defined(HAVE_QUICKTIME) || \
defined(HAVE_AVFOUNDATION) || \ defined(HAVE_AVFOUNDATION) || \
/*defined(HAVE_OPENNI) || too specialized */ \ /*defined(HAVE_OPENNI) || too specialized */ \
defined(HAVE_FFMPEG) || \ defined(HAVE_FFMPEG)
defined(WIN32) /* assume that we have ffmpeg */
# define BUILD_WITH_VIDEO_INPUT_SUPPORT 1 # define BUILD_WITH_VIDEO_INPUT_SUPPORT 1
#else #else
# define BUILD_WITH_VIDEO_INPUT_SUPPORT 0 # define BUILD_WITH_VIDEO_INPUT_SUPPORT 0
...@@ -59,8 +57,7 @@ ...@@ -59,8 +57,7 @@
defined(HAVE_GSTREAMER) || \ defined(HAVE_GSTREAMER) || \
defined(HAVE_QUICKTIME) || \ defined(HAVE_QUICKTIME) || \
defined(HAVE_AVFOUNDATION) || \ defined(HAVE_AVFOUNDATION) || \
defined(HAVE_FFMPEG) || \ defined(HAVE_FFMPEG)
defined(WIN32) /* assume that we have ffmpeg */
# define BUILD_WITH_VIDEO_OUTPUT_SUPPORT 1 # define BUILD_WITH_VIDEO_OUTPUT_SUPPORT 1
#else #else
# define BUILD_WITH_VIDEO_OUTPUT_SUPPORT 0 # define BUILD_WITH_VIDEO_OUTPUT_SUPPORT 0
......
...@@ -460,7 +460,7 @@ struct SphericalPortraitProjector : ProjectorBase ...@@ -460,7 +460,7 @@ struct SphericalPortraitProjector : ProjectorBase
// Projects image onto unit sphere with origin at (0, 0, 0). // Projects image onto unit sphere with origin at (0, 0, 0).
// Poles are located NOT at (0, -1, 0) and (0, 1, 0) points, BUT at (1, 0, 0) and (-1, 0, 0) points. // Poles are located NOT at (0, -1, 0) and (0, 1, 0) points, BUT at (1, 0, 0) and (-1, 0, 0) points.
class SphericalPortraitWarper : public RotationWarperBase<SphericalPortraitProjector> class CV_EXPORTS SphericalPortraitWarper : public RotationWarperBase<SphericalPortraitProjector>
{ {
public: public:
SphericalPortraitWarper(float scale) { projector_.scale = scale; } SphericalPortraitWarper(float scale) { projector_.scale = scale; }
...@@ -476,7 +476,7 @@ struct CylindricalPortraitProjector : ProjectorBase ...@@ -476,7 +476,7 @@ struct CylindricalPortraitProjector : ProjectorBase
}; };
class CylindricalPortraitWarper : public RotationWarperBase<CylindricalPortraitProjector> class CV_EXPORTS CylindricalPortraitWarper : public RotationWarperBase<CylindricalPortraitProjector>
{ {
public: public:
CylindricalPortraitWarper(float scale) { projector_.scale = scale; } CylindricalPortraitWarper(float scale) { projector_.scale = scale; }
...@@ -495,7 +495,7 @@ struct PlanePortraitProjector : ProjectorBase ...@@ -495,7 +495,7 @@ struct PlanePortraitProjector : ProjectorBase
}; };
class PlanePortraitWarper : public RotationWarperBase<PlanePortraitProjector> class CV_EXPORTS PlanePortraitWarper : public RotationWarperBase<PlanePortraitProjector>
{ {
public: public:
PlanePortraitWarper(float scale) { projector_.scale = scale; } PlanePortraitWarper(float scale) { projector_.scale = scale; }
......
set(CMAKE_SYSTEM_NAME Windows)
set(CMAKE_SYSTEM_PROCESSOR "arm-v7a")
set(CMAKE_FIND_ROOT_PATH "${CMAKE_SOURCE_DIR}/platforms/winrt")
set(CMAKE_REQUIRED_DEFINITIONS -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE)
add_definitions(-D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE)
\ No newline at end of file
mkdir build
cd build
rem call "C:\Program Files\Microsoft Visual Studio 11.0\VC\bin\x86_arm\vcvarsx86_arm.bat"
cmake.exe -GNinja -DCMAKE_BUILD_TYPE=Release -DWITH_FFMPEG=OFF -DBUILD_opencv_gpu=OFF -DBUILD_opencv_python=OFF -DCMAKE_TOOLCHAIN_FILE=..\..\winrt\arm.winrt.toolchain.cmake ..\..\..
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