From 06aff4e7b0be6e358c53fe80249a518d60c57f91 Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov Date: Wed, 13 Mar 2013 09:02:15 -0700 Subject: [PATCH] Initial Windows RT support commit. GPU module turned off; TIFF support turned off; Windows Managment and Video IO (VFW) turned off. --- CMakeLists.txt | 4 +++- modules/highgui/CMakeLists.txt | 8 ++++---- modules/highgui/src/cap.cpp | 7 ++++--- modules/highgui/src/cap_ffmpeg.cpp | 16 ++++++++-------- modules/highgui/src/precomp.hpp | 6 +++--- modules/highgui/src/window.cpp | 16 ++++++++-------- platforms/winrt/scripts/cmake_winrt.cmd | 8 ++++++++ 7 files changed, 38 insertions(+), 27 deletions(-) create mode 100644 platforms/winrt/scripts/cmake_winrt.cmd diff --git a/CMakeLists.txt b/CMakeLists.txt index 579312d40a..e5868cf430 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -60,6 +60,8 @@ endif() project(OpenCV CXX C) +add_definitions(-D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE) + include(cmake/OpenCVUtils.cmake) # ---------------------------------------------------------------------------- @@ -608,7 +610,7 @@ else() status(" QT 4.x:" NO) endif() if(WIN32) - status(" Win32 UI:" YES) + status(" Win32 UI:" NO) else() if(APPLE) if(WITH_CARBON) diff --git a/modules/highgui/CMakeLists.txt b/modules/highgui/CMakeLists.txt index 7e5fae39bd..12cf2cbcd1 100644 --- a/modules/highgui/CMakeLists.txt +++ b/modules/highgui/CMakeLists.txt @@ -90,7 +90,7 @@ if(HAVE_QT) set_source_files_properties(${_RCC_OUTFILES} PROPERTIES COMPILE_FLAGS -Wno-missing-declarations) endif() elseif(WIN32) - list(APPEND highgui_srcs src/window_w32.cpp) + #list(APPEND highgui_srcs src/window_w32.cpp) elseif(HAVE_GTK) list(APPEND highgui_srcs src/window_gtk.cpp) elseif(APPLE) @@ -105,9 +105,9 @@ elseif(APPLE) endif() endif() -if(WIN32) - list(APPEND highgui_srcs src/cap_vfw.cpp src/cap_cmu.cpp src/cap_dshow.cpp) -endif(WIN32) +#if(WIN32) +# list(APPEND highgui_srcs src/cap_vfw.cpp src/cap_cmu.cpp src/cap_dshow.cpp) +#endif(WIN32) if(HAVE_XINE) list(APPEND highgui_srcs src/cap_xine.cpp) diff --git a/modules/highgui/src/cap.cpp b/modules/highgui/src/cap.cpp index 13475f2633..237e3156ea 100644 --- a/modules/highgui/src/cap.cpp +++ b/modules/highgui/src/cap.cpp @@ -197,9 +197,10 @@ CV_IMPL CvCapture * cvCreateCameraCapture (int index) { #ifdef HAVE_VIDEOINPUT case CV_CAP_DSHOW: - capture = cvCreateCameraCapture_DShow (index); - if (capture) - return capture; + // capture = cvCreateCameraCapture_DShow (index); + // if (capture) + // return capture; + return NULL; break; #endif diff --git a/modules/highgui/src/cap_ffmpeg.cpp b/modules/highgui/src/cap_ffmpeg.cpp index 657502acf4..640fc2da63 100644 --- a/modules/highgui/src/cap_ffmpeg.cpp +++ b/modules/highgui/src/cap_ffmpeg.cpp @@ -209,11 +209,11 @@ CvCapture* cvCreateFileCapture_FFMPEG_proxy(const char * filename) if( result->open( filename )) return result; delete result; -#if defined WIN32 || defined _WIN32 - return cvCreateFileCapture_VFW(filename); -#else +//#if defined WIN32 || defined _WIN32 +// return cvCreateFileCapture_VFW(filename); +//#else return 0; -#endif +//#endif } class CvVideoWriter_FFMPEG_proxy : @@ -263,9 +263,9 @@ CvVideoWriter* cvCreateVideoWriter_FFMPEG_proxy( const char* filename, int fourc if( result->open( filename, fourcc, fps, frameSize, isColor != 0 )) return result; delete result; -#if defined WIN32 || defined _WIN32 - return cvCreateVideoWriter_VFW(filename, fourcc, fps, frameSize, isColor); -#else +// #if defined WIN32 || defined _WIN32 +// return cvCreateVideoWriter_VFW(filename, fourcc, fps, frameSize, isColor); +// #else return 0; -#endif +//#endif } diff --git a/modules/highgui/src/precomp.hpp b/modules/highgui/src/precomp.hpp index 9572e30100..5790bf67ad 100644 --- a/modules/highgui/src/precomp.hpp +++ b/modules/highgui/src/precomp.hpp @@ -103,12 +103,12 @@ struct CvVideoWriter virtual bool writeFrame(const IplImage*) { return false; } }; -#if defined WIN32 || defined _WIN32 -#define HAVE_VFW 1 +//#if defined WIN32 || defined _WIN32 +//#define HAVE_VFW 1 /* uncomment to enable CMUCamera1394 fireware camera module */ //#define HAVE_CMU1394 1 -#endif +//#endif CvCapture * cvCreateCameraCapture_V4L( int index ); diff --git a/modules/highgui/src/window.cpp b/modules/highgui/src/window.cpp index b6086076c3..a26bc447a2 100644 --- a/modules/highgui/src/window.cpp +++ b/modules/highgui/src/window.cpp @@ -57,7 +57,7 @@ CV_IMPL void cvSetWindowProperty(const char* name, int prop_id, double prop_valu #if defined (HAVE_QT) cvSetModeWindow_QT(name,prop_value); - #elif defined WIN32 || defined _WIN32 + #elif defined (HAVE_WIN32_UI) cvSetModeWindow_W32(name,prop_value); #elif defined (HAVE_GTK) cvSetModeWindow_GTK(name,prop_value); @@ -96,7 +96,7 @@ CV_IMPL double cvGetWindowProperty(const char* name, int prop_id) #if defined (HAVE_QT) return cvGetModeWindow_QT(name); - #elif defined WIN32 || defined _WIN32 + #elif defined (HAVE_WIN32_UI) return cvGetModeWindow_W32(name); #elif defined (HAVE_GTK) return cvGetModeWindow_GTK(name); @@ -113,7 +113,7 @@ CV_IMPL double cvGetWindowProperty(const char* name, int prop_id) #if defined (HAVE_QT) return cvGetPropWindow_QT(name); - #elif defined WIN32 || defined _WIN32 + #elif defined (HAVE_WIN32_UI) return cvGetPropWindowAutoSize_W32(name); #elif defined (HAVE_GTK) return cvGetPropWindowAutoSize_GTK(name); @@ -126,7 +126,7 @@ CV_IMPL double cvGetWindowProperty(const char* name, int prop_id) #if defined (HAVE_QT) return cvGetRatioWindow_QT(name); - #elif defined WIN32 || defined _WIN32 + #elif defined (HAVE_WIN32_UI) return cvGetRatioWindow_W32(name); #elif defined (HAVE_GTK) return cvGetRatioWindow_GTK(name); @@ -139,7 +139,7 @@ CV_IMPL double cvGetWindowProperty(const char* name, int prop_id) #if defined (HAVE_QT) return cvGetOpenGlProp_QT(name); - #elif defined WIN32 || defined _WIN32 + #elif defined (HAVE_WIN32_UI) return cvGetOpenGlProp_W32(name); #elif defined (HAVE_GTK) return cvGetOpenGlProp_GTK(name); @@ -450,11 +450,11 @@ int cv::createButton(const string&, ButtonCallback, void*, int , bool ) #endif -#if defined WIN32 || defined _WIN32 // see window_w32.cpp +#if defined (HAVE_WIN32_UI) // see window_w32.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_QT) //YV see window_QT.cpp +#elif defined (HAVE_QT) //YV see window_QT.cpp #else diff --git a/platforms/winrt/scripts/cmake_winrt.cmd b/platforms/winrt/scripts/cmake_winrt.cmd new file mode 100644 index 0000000000..18aafef026 --- /dev/null +++ b/platforms/winrt/scripts/cmake_winrt.cmd @@ -0,0 +1,8 @@ +mkdir build +cd build + +rem call "C:\Program Files\Microsoft Visual Studio 11.0\VC\bin\x86_arm\vcvarsx86_arm.bat" + +SET PATH=C:\Program Files\Ninja;%PATH% + +"C:\Program Files\CMake 2.8\bin\cmake.exe" -GNinja -DCMAKE_BUILD_TYPE=Release -DWITH_TIFF=OFF -DWITH_FFMPEG=OFF -DBUILD_opencv_gpu=OFF -DENABLE_SSE=OFF -DENABLE_SSE2=OFF ..\..\.. \ No newline at end of file