mirror of
https://github.com/opencv/opencv.git
synced 2025-06-08 01:53:19 +08:00
Merge pull request #9237 from alalek:fix_winrt_build
This commit is contained in:
commit
402a77e7f7
2
3rdparty/openvx/hal/openvx_hal.cpp
vendored
2
3rdparty/openvx/hal/openvx_hal.cpp
vendored
@ -59,7 +59,7 @@ inline ivx::Context& getOpenVXHALContext()
|
|||||||
static thread_local ivx::Context instance = ivx::Context::create();
|
static thread_local ivx::Context instance = ivx::Context::create();
|
||||||
#else //__cplusplus >= 201103L || _MSC_VER >= 1800
|
#else //__cplusplus >= 201103L || _MSC_VER >= 1800
|
||||||
//CXX98
|
//CXX98
|
||||||
#ifdef WIN32
|
#ifdef _WIN32
|
||||||
static __declspec(thread) ivx::Context instance = ivx::Context::create();
|
static __declspec(thread) ivx::Context instance = ivx::Context::create();
|
||||||
#else
|
#else
|
||||||
static __thread ivx::Context instance = ivx::Context::create();
|
static __thread ivx::Context instance = ivx::Context::create();
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#if (defined WIN32 || defined _WIN32) && defined(_M_ARM)
|
#if defined _WIN32 && defined(_M_ARM)
|
||||||
# include <Intrin.h>
|
# include <Intrin.h>
|
||||||
# include <arm_neon.h>
|
# include <arm_neon.h>
|
||||||
# define CV_NEON 1
|
# define CV_NEON 1
|
||||||
|
@ -86,7 +86,7 @@
|
|||||||
# define CV_FMA3 1
|
# define CV_FMA3 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (defined WIN32 || defined _WIN32) && defined(_M_ARM)
|
#if defined _WIN32 && defined(_M_ARM)
|
||||||
# include <Intrin.h>
|
# include <Intrin.h>
|
||||||
# include <arm_neon.h>
|
# include <arm_neon.h>
|
||||||
# define CV_NEON 1
|
# define CV_NEON 1
|
||||||
@ -128,7 +128,7 @@ struct VZeroUpperGuard {
|
|||||||
# define CV_MMX 1
|
# define CV_MMX 1
|
||||||
# define CV_SSE 1
|
# define CV_SSE 1
|
||||||
# define CV_SSE2 1
|
# define CV_SSE2 1
|
||||||
#elif (defined WIN32 || defined _WIN32) && defined(_M_ARM)
|
#elif defined _WIN32 && defined(_M_ARM)
|
||||||
# include <Intrin.h>
|
# include <Intrin.h>
|
||||||
# include <arm_neon.h>
|
# include <arm_neon.h>
|
||||||
# define CV_NEON 1
|
# define CV_NEON 1
|
||||||
|
@ -244,7 +244,7 @@ Cv64suf;
|
|||||||
# define DISABLE_OPENCV_24_COMPATIBILITY
|
# define DISABLE_OPENCV_24_COMPATIBILITY
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (defined WIN32 || defined _WIN32 || defined WINCE || defined __CYGWIN__) && defined CVAPI_EXPORTS
|
#if (defined _WIN32 || defined WINCE || defined __CYGWIN__) && defined CVAPI_EXPORTS
|
||||||
# define CV_EXPORTS __declspec(dllexport)
|
# define CV_EXPORTS __declspec(dllexport)
|
||||||
#elif defined __GNUC__ && __GNUC__ >= 4
|
#elif defined __GNUC__ && __GNUC__ >= 4
|
||||||
# define CV_EXPORTS __attribute__ ((visibility ("default")))
|
# define CV_EXPORTS __attribute__ ((visibility ("default")))
|
||||||
|
@ -45,7 +45,7 @@
|
|||||||
#ifdef HAVE_CLAMDBLAS
|
#ifdef HAVE_CLAMDBLAS
|
||||||
|
|
||||||
#ifndef CL_RUNTIME_EXPORT
|
#ifndef CL_RUNTIME_EXPORT
|
||||||
#if (defined(BUILD_SHARED_LIBS) || defined(OPENCV_CORE_SHARED)) && (defined WIN32 || defined _WIN32 || defined WINCE)
|
#if (defined(BUILD_SHARED_LIBS) || defined(OPENCV_CORE_SHARED)) && (defined _WIN32 || defined WINCE)
|
||||||
#define CL_RUNTIME_EXPORT __declspec(dllimport)
|
#define CL_RUNTIME_EXPORT __declspec(dllimport)
|
||||||
#else
|
#else
|
||||||
#define CL_RUNTIME_EXPORT
|
#define CL_RUNTIME_EXPORT
|
||||||
|
@ -45,7 +45,7 @@
|
|||||||
#ifdef HAVE_CLAMDFFT
|
#ifdef HAVE_CLAMDFFT
|
||||||
|
|
||||||
#ifndef CL_RUNTIME_EXPORT
|
#ifndef CL_RUNTIME_EXPORT
|
||||||
#if (defined(BUILD_SHARED_LIBS) || defined(OPENCV_CORE_SHARED)) && (defined WIN32 || defined _WIN32 || defined WINCE)
|
#if (defined(BUILD_SHARED_LIBS) || defined(OPENCV_CORE_SHARED)) && (defined _WIN32 || defined WINCE)
|
||||||
#define CL_RUNTIME_EXPORT __declspec(dllimport)
|
#define CL_RUNTIME_EXPORT __declspec(dllimport)
|
||||||
#else
|
#else
|
||||||
#define CL_RUNTIME_EXPORT
|
#define CL_RUNTIME_EXPORT
|
||||||
|
@ -55,7 +55,7 @@
|
|||||||
#else // HAVE_OPENCL_STATIC
|
#else // HAVE_OPENCL_STATIC
|
||||||
|
|
||||||
#ifndef CL_RUNTIME_EXPORT
|
#ifndef CL_RUNTIME_EXPORT
|
||||||
#if (defined(BUILD_SHARED_LIBS) || defined(OPENCV_CORE_SHARED)) && (defined WIN32 || defined _WIN32 || defined WINCE)
|
#if (defined(BUILD_SHARED_LIBS) || defined(OPENCV_CORE_SHARED)) && (defined _WIN32 || defined WINCE)
|
||||||
#define CL_RUNTIME_EXPORT __declspec(dllimport)
|
#define CL_RUNTIME_EXPORT __declspec(dllimport)
|
||||||
#else
|
#else
|
||||||
#define CL_RUNTIME_EXPORT
|
#define CL_RUNTIME_EXPORT
|
||||||
|
@ -46,7 +46,7 @@
|
|||||||
|
|
||||||
#ifdef HAVE_IPL
|
#ifdef HAVE_IPL
|
||||||
# ifndef __IPL_H__
|
# ifndef __IPL_H__
|
||||||
# if defined WIN32 || defined _WIN32
|
# if defined _WIN32
|
||||||
# include <ipl.h>
|
# include <ipl.h>
|
||||||
# else
|
# else
|
||||||
# include <ipl/ipl.h>
|
# include <ipl/ipl.h>
|
||||||
@ -65,7 +65,7 @@
|
|||||||
#include <float.h>
|
#include <float.h>
|
||||||
#endif // SKIP_INCLUDES
|
#endif // SKIP_INCLUDES
|
||||||
|
|
||||||
#if defined WIN32 || defined _WIN32
|
#if defined _WIN32
|
||||||
# define CV_CDECL __cdecl
|
# define CV_CDECL __cdecl
|
||||||
# define CV_STDCALL __stdcall
|
# define CV_STDCALL __stdcall
|
||||||
#else
|
#else
|
||||||
|
@ -55,7 +55,7 @@ static void* OutOfMemoryError(size_t size)
|
|||||||
|
|
||||||
#if CV_USE_SYSTEM_MALLOC
|
#if CV_USE_SYSTEM_MALLOC
|
||||||
|
|
||||||
#if defined WIN32 || defined _WIN32
|
#if defined _WIN32
|
||||||
void deleteThreadAllocData() {}
|
void deleteThreadAllocData() {}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -93,7 +93,7 @@ void fastFree(void* ptr)
|
|||||||
|
|
||||||
#define STAT(stmt)
|
#define STAT(stmt)
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef _WIN32
|
||||||
#if (_WIN32_WINNT >= 0x0602)
|
#if (_WIN32_WINNT >= 0x0602)
|
||||||
#include <synchapi.h>
|
#include <synchapi.h>
|
||||||
#endif
|
#endif
|
||||||
@ -126,7 +126,7 @@ void SystemFree(void* ptr, size_t)
|
|||||||
{
|
{
|
||||||
free(ptr);
|
free(ptr);
|
||||||
}
|
}
|
||||||
#else //WIN32
|
#else //_WIN32
|
||||||
|
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
|
|
||||||
@ -155,7 +155,7 @@ void SystemFree(void* ptr, size_t size)
|
|||||||
{
|
{
|
||||||
munmap(ptr, size);
|
munmap(ptr, size);
|
||||||
}
|
}
|
||||||
#endif //WIN32
|
#endif //_WIN32
|
||||||
|
|
||||||
struct AutoLock
|
struct AutoLock
|
||||||
{
|
{
|
||||||
@ -399,7 +399,7 @@ struct ThreadData
|
|||||||
|
|
||||||
Block* bins[MAX_BIN+1][3];
|
Block* bins[MAX_BIN+1][3];
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef _WIN32
|
||||||
#ifdef WINCE
|
#ifdef WINCE
|
||||||
# define TLS_OUT_OF_INDEXES ((DWORD)0xFFFFFFFF)
|
# define TLS_OUT_OF_INDEXES ((DWORD)0xFFFFFFFF)
|
||||||
#endif //WINCE
|
#endif //WINCE
|
||||||
@ -418,7 +418,7 @@ struct ThreadData
|
|||||||
}
|
}
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
#else //WIN32
|
#else //_WIN32
|
||||||
static void deleteData(void* data)
|
static void deleteData(void* data)
|
||||||
{
|
{
|
||||||
delete (ThreadData*)data;
|
delete (ThreadData*)data;
|
||||||
@ -438,10 +438,10 @@ struct ThreadData
|
|||||||
}
|
}
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
#endif //WIN32
|
#endif //_WIN32
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef _WIN32
|
||||||
DWORD ThreadData::tlsKey = TLS_OUT_OF_INDEXES;
|
DWORD ThreadData::tlsKey = TLS_OUT_OF_INDEXES;
|
||||||
|
|
||||||
void deleteThreadAllocData()
|
void deleteThreadAllocData()
|
||||||
@ -450,9 +450,9 @@ void deleteThreadAllocData()
|
|||||||
delete (ThreadData*)TlsGetValue( ThreadData::tlsKey );
|
delete (ThreadData*)TlsGetValue( ThreadData::tlsKey );
|
||||||
}
|
}
|
||||||
|
|
||||||
#else //WIN32
|
#else //_WIN32
|
||||||
pthread_key_t ThreadData::tlsKey = 0;
|
pthread_key_t ThreadData::tlsKey = 0;
|
||||||
#endif //WIN32
|
#endif //_WIN32
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
static void checkList(ThreadData* tls, int idx)
|
static void checkList(ThreadData* tls, int idx)
|
||||||
|
@ -42,7 +42,7 @@
|
|||||||
|
|
||||||
#include "precomp.hpp"
|
#include "precomp.hpp"
|
||||||
|
|
||||||
#if defined WIN32 || defined _WIN32 || defined WINCE
|
#if defined _WIN32 || defined WINCE
|
||||||
# include <windows.h>
|
# include <windows.h>
|
||||||
const char dir_separators[] = "/\\";
|
const char dir_separators[] = "/\\";
|
||||||
const char native_separator = '\\';
|
const char native_separator = '\\';
|
||||||
@ -139,7 +139,7 @@ const char native_separator = '/';
|
|||||||
|
|
||||||
static bool isDir(const cv::String& path, DIR* dir)
|
static bool isDir(const cv::String& path, DIR* dir)
|
||||||
{
|
{
|
||||||
#if defined WIN32 || defined _WIN32 || defined WINCE
|
#if defined _WIN32 || defined WINCE
|
||||||
DWORD attributes;
|
DWORD attributes;
|
||||||
BOOL status = TRUE;
|
BOOL status = TRUE;
|
||||||
if (dir)
|
if (dir)
|
||||||
|
@ -578,7 +578,7 @@ static void* initOpenCLAndLoad(const char* funcname)
|
|||||||
return funcname && handle ? dlsym(handle, funcname) : 0;
|
return funcname && handle ? dlsym(handle, funcname) : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#elif (defined WIN32 || defined _WIN32) && defined(HAVE_OPENCL)
|
#elif defined _WIN32 && defined(HAVE_OPENCL)
|
||||||
|
|
||||||
#ifndef _WIN32_WINNT // This is needed for the declaration of TryEnterCriticalSection in winbase.h with Visual Studio 2005 (and older?)
|
#ifndef _WIN32_WINNT // This is needed for the declaration of TryEnterCriticalSection in winbase.h with Visual Studio 2005 (and older?)
|
||||||
#define _WIN32_WINNT 0x0400 // http://msdn.microsoft.com/en-us/library/ms686857(VS.85).aspx
|
#define _WIN32_WINNT 0x0400 // http://msdn.microsoft.com/en-us/library/ms686857(VS.85).aspx
|
||||||
|
@ -1655,7 +1655,7 @@ Context& initializeContextFromGL()
|
|||||||
|
|
||||||
cl_context_properties properties[] =
|
cl_context_properties properties[] =
|
||||||
{
|
{
|
||||||
#if defined(WIN32) || defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
CL_CONTEXT_PLATFORM, (cl_context_properties)platforms[i],
|
CL_CONTEXT_PLATFORM, (cl_context_properties)platforms[i],
|
||||||
CL_GL_CONTEXT_KHR, (cl_context_properties)wglGetCurrentContext(),
|
CL_GL_CONTEXT_KHR, (cl_context_properties)wglGetCurrentContext(),
|
||||||
CL_WGL_HDC_KHR, (cl_context_properties)wglGetCurrentDC(),
|
CL_WGL_HDC_KHR, (cl_context_properties)wglGetCurrentDC(),
|
||||||
|
@ -44,7 +44,7 @@
|
|||||||
|
|
||||||
#include <opencv2/core/utils/trace.private.hpp>
|
#include <opencv2/core/utils/trace.private.hpp>
|
||||||
|
|
||||||
#if defined WIN32 || defined WINCE
|
#if defined _WIN32 || defined WINCE
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#undef small
|
#undef small
|
||||||
#undef min
|
#undef min
|
||||||
@ -632,7 +632,7 @@ static inline int getNumberOfCPUsImpl()
|
|||||||
|
|
||||||
int cv::getNumberOfCPUs(void)
|
int cv::getNumberOfCPUs(void)
|
||||||
{
|
{
|
||||||
#if defined WIN32 || defined _WIN32
|
#if defined _WIN32
|
||||||
SYSTEM_INFO sysinfo;
|
SYSTEM_INFO sysinfo;
|
||||||
#if (defined(_M_ARM) || defined(_M_X64) || defined(WINRT)) && _WIN32_WINNT >= 0x501
|
#if (defined(_M_ARM) || defined(_M_X64) || defined(WINRT)) && _WIN32_WINNT >= 0x501
|
||||||
GetNativeSystemInfo( &sysinfo );
|
GetNativeSystemInfo( &sysinfo );
|
||||||
|
@ -148,7 +148,7 @@ BinaryFunc getCopyMaskFunc(size_t esz);
|
|||||||
/* maximal average node_count/hash_size ratio beyond which hash table is resized */
|
/* maximal average node_count/hash_size ratio beyond which hash table is resized */
|
||||||
#define CV_SPARSE_HASH_RATIO 3
|
#define CV_SPARSE_HASH_RATIO 3
|
||||||
|
|
||||||
#if defined WIN32 || defined _WIN32
|
#if defined _WIN32
|
||||||
void deleteThreadAllocData();
|
void deleteThreadAllocData();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -288,7 +288,7 @@ struct CoreTLSData
|
|||||||
TLSData<CoreTLSData>& getCoreTlsData();
|
TLSData<CoreTLSData>& getCoreTlsData();
|
||||||
|
|
||||||
#if defined(BUILD_SHARED_LIBS)
|
#if defined(BUILD_SHARED_LIBS)
|
||||||
#if defined WIN32 || defined _WIN32 || defined WINCE
|
#if defined _WIN32 || defined WINCE
|
||||||
#define CL_RUNTIME_EXPORT __declspec(dllexport)
|
#define CL_RUNTIME_EXPORT __declspec(dllexport)
|
||||||
#elif defined __GNUC__ && __GNUC__ >= 4
|
#elif defined __GNUC__ && __GNUC__ >= 4
|
||||||
#define CL_RUNTIME_EXPORT __attribute__ ((visibility ("default")))
|
#define CL_RUNTIME_EXPORT __attribute__ ((visibility ("default")))
|
||||||
|
@ -48,14 +48,12 @@
|
|||||||
|
|
||||||
#include "precomp.hpp"
|
#include "precomp.hpp"
|
||||||
|
|
||||||
#if defined WIN32 || defined WINCE
|
#if defined _WIN32 || defined WINCE
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#undef small
|
#undef small
|
||||||
#undef min
|
#undef min
|
||||||
#undef max
|
#undef max
|
||||||
#undef abs
|
#undef abs
|
||||||
#else
|
|
||||||
#include <pthread.h>
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined __SSE2__ || (defined _M_IX86_FP && 2 == _M_IX86_FP)
|
#if defined __SSE2__ || (defined _M_IX86_FP && 2 == _M_IX86_FP)
|
||||||
|
@ -79,7 +79,7 @@ Mutex* __initialization_mutex_initializer = &getInitializationMutex();
|
|||||||
# include <cpu-features.h>
|
# include <cpu-features.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined WIN32 || defined _WIN32 || defined WINCE
|
#if defined _WIN32 || defined WINCE
|
||||||
#ifndef _WIN32_WINNT // This is needed for the declaration of TryEnterCriticalSection in winbase.h with Visual Studio 2005 (and older?)
|
#ifndef _WIN32_WINNT // This is needed for the declaration of TryEnterCriticalSection in winbase.h with Visual Studio 2005 (and older?)
|
||||||
#define _WIN32_WINNT 0x0400 // http://msdn.microsoft.com/en-us/library/ms686857(VS.85).aspx
|
#define _WIN32_WINNT 0x0400 // http://msdn.microsoft.com/en-us/library/ms686857(VS.85).aspx
|
||||||
#endif
|
#endif
|
||||||
@ -655,7 +655,7 @@ bool useOptimized(void)
|
|||||||
|
|
||||||
int64 getTickCount(void)
|
int64 getTickCount(void)
|
||||||
{
|
{
|
||||||
#if defined WIN32 || defined _WIN32 || defined WINCE
|
#if defined _WIN32 || defined WINCE
|
||||||
LARGE_INTEGER counter;
|
LARGE_INTEGER counter;
|
||||||
QueryPerformanceCounter( &counter );
|
QueryPerformanceCounter( &counter );
|
||||||
return (int64)counter.QuadPart;
|
return (int64)counter.QuadPart;
|
||||||
@ -675,7 +675,7 @@ int64 getTickCount(void)
|
|||||||
|
|
||||||
double getTickFrequency(void)
|
double getTickFrequency(void)
|
||||||
{
|
{
|
||||||
#if defined WIN32 || defined _WIN32 || defined WINCE
|
#if defined _WIN32 || defined WINCE
|
||||||
LARGE_INTEGER freq;
|
LARGE_INTEGER freq;
|
||||||
QueryPerformanceFrequency(&freq);
|
QueryPerformanceFrequency(&freq);
|
||||||
return (double)freq.QuadPart;
|
return (double)freq.QuadPart;
|
||||||
@ -737,7 +737,7 @@ int64 getCPUTickCount(void)
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#elif defined _MSC_VER && defined WIN32 && defined _M_IX86
|
#elif defined _MSC_VER && defined _WIN32 && defined _M_IX86
|
||||||
|
|
||||||
int64 getCPUTickCount(void)
|
int64 getCPUTickCount(void)
|
||||||
{
|
{
|
||||||
@ -799,7 +799,7 @@ String tempfile( const char* suffix )
|
|||||||
const char *temp_dir = getenv("OPENCV_TEMP_PATH");
|
const char *temp_dir = getenv("OPENCV_TEMP_PATH");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined WIN32 || defined _WIN32
|
#if defined _WIN32
|
||||||
#ifdef WINRT
|
#ifdef WINRT
|
||||||
RoInitialize(RO_INIT_MULTITHREADED);
|
RoInitialize(RO_INIT_MULTITHREADED);
|
||||||
std::wstring temp_dir = GetTempPathWinRT();
|
std::wstring temp_dir = GetTempPathWinRT();
|
||||||
@ -1124,7 +1124,7 @@ bool __termination = false;
|
|||||||
namespace cv
|
namespace cv
|
||||||
{
|
{
|
||||||
|
|
||||||
#if defined WIN32 || defined _WIN32 || defined WINCE
|
#if defined _WIN32 || defined WINCE
|
||||||
|
|
||||||
struct Mutex::Impl
|
struct Mutex::Impl
|
||||||
{
|
{
|
||||||
@ -1210,7 +1210,7 @@ bool Mutex::trylock() { return impl->trylock(); }
|
|||||||
|
|
||||||
//////////////////////////////// thread-local storage ////////////////////////////////
|
//////////////////////////////// thread-local storage ////////////////////////////////
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef _WIN32
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#pragma warning(disable:4505) // unreferenced local function has been removed
|
#pragma warning(disable:4505) // unreferenced local function has been removed
|
||||||
#endif
|
#endif
|
||||||
@ -1229,16 +1229,16 @@ public:
|
|||||||
void SetData(void *pData);
|
void SetData(void *pData);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
#ifdef WIN32
|
#ifdef _WIN32
|
||||||
#ifndef WINRT
|
#ifndef WINRT
|
||||||
DWORD tlsKey;
|
DWORD tlsKey;
|
||||||
#endif
|
#endif
|
||||||
#else // WIN32
|
#else // _WIN32
|
||||||
pthread_key_t tlsKey;
|
pthread_key_t tlsKey;
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef _WIN32
|
||||||
#ifdef WINRT
|
#ifdef WINRT
|
||||||
static __declspec( thread ) void* tlsData = NULL; // using C++11 thread attribute for local thread data
|
static __declspec( thread ) void* tlsData = NULL; // using C++11 thread attribute for local thread data
|
||||||
TlsAbstraction::TlsAbstraction() {}
|
TlsAbstraction::TlsAbstraction() {}
|
||||||
@ -1270,7 +1270,7 @@ void TlsAbstraction::SetData(void *pData)
|
|||||||
CV_Assert(TlsSetValue(tlsKey, pData) == TRUE);
|
CV_Assert(TlsSetValue(tlsKey, pData) == TRUE);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#else // WIN32
|
#else // _WIN32
|
||||||
TlsAbstraction::TlsAbstraction()
|
TlsAbstraction::TlsAbstraction()
|
||||||
{
|
{
|
||||||
CV_Assert(pthread_key_create(&tlsKey, NULL) == 0);
|
CV_Assert(pthread_key_create(&tlsKey, NULL) == 0);
|
||||||
@ -1511,7 +1511,7 @@ TLSData<CoreTLSData>& getCoreTlsData()
|
|||||||
CV_SINGLETON_LAZY_INIT_REF(TLSData<CoreTLSData>, new TLSData<CoreTLSData>())
|
CV_SINGLETON_LAZY_INIT_REF(TLSData<CoreTLSData>, new TLSData<CoreTLSData>())
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined CVAPI_EXPORTS && defined WIN32 && !defined WINCE
|
#if defined CVAPI_EXPORTS && defined _WIN32 && !defined WINCE
|
||||||
#ifdef WINRT
|
#ifdef WINRT
|
||||||
#pragma warning(disable:4447) // Disable warning 'main' signature found without threading model
|
#pragma warning(disable:4447) // Disable warning 'main' signature found without threading model
|
||||||
#endif
|
#endif
|
||||||
|
@ -88,7 +88,7 @@ PERF_TEST_P(FileName, VideoReader, Values("gpu/video/768x576.avi", "gpu/video/19
|
|||||||
//////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////
|
||||||
// VideoWriter
|
// VideoWriter
|
||||||
|
|
||||||
#if defined(HAVE_NVCUVID) && defined(WIN32)
|
#if defined(HAVE_NVCUVID) && defined(_WIN32)
|
||||||
|
|
||||||
PERF_TEST_P(FileName, VideoWriter, Values("gpu/video/768x576.avi", "gpu/video/1920x1080.avi"))
|
PERF_TEST_P(FileName, VideoWriter, Values("gpu/video/768x576.avi", "gpu/video/1920x1080.avi"))
|
||||||
{
|
{
|
||||||
|
@ -61,7 +61,7 @@ namespace
|
|||||||
|
|
||||||
if (!initialized)
|
if (!initialized)
|
||||||
{
|
{
|
||||||
#if defined WIN32 || defined _WIN32
|
#if defined _WIN32
|
||||||
const char* module_name = "opencv_ffmpeg"
|
const char* module_name = "opencv_ffmpeg"
|
||||||
CVAUX_STR(CV_VERSION_MAJOR) CVAUX_STR(CV_VERSION_MINOR) CVAUX_STR(CV_VERSION_REVISION)
|
CVAUX_STR(CV_VERSION_MAJOR) CVAUX_STR(CV_VERSION_MINOR) CVAUX_STR(CV_VERSION_REVISION)
|
||||||
#if (defined _MSC_VER && defined _M_X64) || (defined __GNUC__ && defined __x86_64__)
|
#if (defined _MSC_VER && defined _M_X64) || (defined __GNUC__ && defined __x86_64__)
|
||||||
|
@ -58,7 +58,7 @@
|
|||||||
#ifdef HAVE_NVCUVID
|
#ifdef HAVE_NVCUVID
|
||||||
#include <nvcuvid.h>
|
#include <nvcuvid.h>
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef _WIN32
|
||||||
#define NOMINMAX
|
#define NOMINMAX
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#ifdef HAVE_NVCUVENC
|
#ifdef HAVE_NVCUVENC
|
||||||
|
@ -47,7 +47,7 @@
|
|||||||
|
|
||||||
using namespace cv::cudacodec::detail;
|
using namespace cv::cudacodec::detail;
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef _WIN32
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
@ -160,7 +160,7 @@ void cv::cudacodec::detail::Thread::wait()
|
|||||||
|
|
||||||
void cv::cudacodec::detail::Thread::sleep(int ms)
|
void cv::cudacodec::detail::Thread::sleep(int ms)
|
||||||
{
|
{
|
||||||
#ifdef WIN32
|
#ifdef _WIN32
|
||||||
::Sleep(ms);
|
::Sleep(ms);
|
||||||
#else
|
#else
|
||||||
::usleep(ms * 1000);
|
::usleep(ms * 1000);
|
||||||
|
@ -47,7 +47,7 @@ using namespace cv;
|
|||||||
using namespace cv::cuda;
|
using namespace cv::cuda;
|
||||||
using namespace cv::cudacodec;
|
using namespace cv::cudacodec;
|
||||||
|
|
||||||
#if !defined(HAVE_NVCUVENC) || !defined(WIN32)
|
#if !defined(HAVE_NVCUVENC) || !defined(_WIN32)
|
||||||
|
|
||||||
cv::cudacodec::EncoderParams::EncoderParams() { throw_no_cuda(); }
|
cv::cudacodec::EncoderParams::EncoderParams() { throw_no_cuda(); }
|
||||||
cv::cudacodec::EncoderParams::EncoderParams(const String&) { throw_no_cuda(); }
|
cv::cudacodec::EncoderParams::EncoderParams(const String&) { throw_no_cuda(); }
|
||||||
@ -60,7 +60,7 @@ Ptr<VideoWriter> cv::cudacodec::createVideoWriter(const String&, Size, double, c
|
|||||||
Ptr<VideoWriter> cv::cudacodec::createVideoWriter(const Ptr<EncoderCallBack>&, Size, double, SurfaceFormat) { throw_no_cuda(); return Ptr<VideoWriter>(); }
|
Ptr<VideoWriter> cv::cudacodec::createVideoWriter(const Ptr<EncoderCallBack>&, Size, double, SurfaceFormat) { throw_no_cuda(); return Ptr<VideoWriter>(); }
|
||||||
Ptr<VideoWriter> cv::cudacodec::createVideoWriter(const Ptr<EncoderCallBack>&, Size, double, const EncoderParams&, SurfaceFormat) { throw_no_cuda(); return Ptr<VideoWriter>(); }
|
Ptr<VideoWriter> cv::cudacodec::createVideoWriter(const Ptr<EncoderCallBack>&, Size, double, const EncoderParams&, SurfaceFormat) { throw_no_cuda(); return Ptr<VideoWriter>(); }
|
||||||
|
|
||||||
#else // !defined HAVE_NVCUVENC || !defined WIN32
|
#else // !defined HAVE_NVCUVENC || !defined _WIN32
|
||||||
|
|
||||||
void RGB_to_YV12(const GpuMat& src, GpuMat& dst);
|
void RGB_to_YV12(const GpuMat& src, GpuMat& dst);
|
||||||
|
|
||||||
@ -731,7 +731,7 @@ namespace
|
|||||||
|
|
||||||
if (!initialized)
|
if (!initialized)
|
||||||
{
|
{
|
||||||
#if defined(WIN32) || defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
const char* module_name = "opencv_ffmpeg"
|
const char* module_name = "opencv_ffmpeg"
|
||||||
CVAUX_STR(CV_VERSION_MAJOR) CVAUX_STR(CV_VERSION_MINOR) CVAUX_STR(CV_VERSION_REVISION)
|
CVAUX_STR(CV_VERSION_MAJOR) CVAUX_STR(CV_VERSION_MINOR) CVAUX_STR(CV_VERSION_REVISION)
|
||||||
#if (defined _MSC_VER && defined _M_X64) || (defined __GNUC__ && defined __x86_64__)
|
#if (defined _MSC_VER && defined _M_X64) || (defined __GNUC__ && defined __x86_64__)
|
||||||
@ -913,4 +913,4 @@ Ptr<VideoWriter> cv::cudacodec::createVideoWriter(const Ptr<EncoderCallBack>& en
|
|||||||
return makePtr<VideoWriterImpl>(encoderCallback, frameSize, fps, params, format);
|
return makePtr<VideoWriterImpl>(encoderCallback, frameSize, fps, params, format);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // !defined HAVE_NVCUVENC || !defined WIN32
|
#endif // !defined HAVE_NVCUVENC || !defined _WIN32
|
||||||
|
@ -71,7 +71,7 @@ CUDA_TEST_P(Video, Reader)
|
|||||||
//////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////
|
||||||
// VideoWriter
|
// VideoWriter
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef _WIN32
|
||||||
|
|
||||||
CUDA_TEST_P(Video, Writer)
|
CUDA_TEST_P(Video, Writer)
|
||||||
{
|
{
|
||||||
@ -116,7 +116,7 @@ CUDA_TEST_P(Video, Writer)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // WIN32
|
#endif // _WIN32
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(CUDA_Codec, Video, testing::Combine(
|
INSTANTIATE_TEST_CASE_P(CUDA_Codec, Video, testing::Combine(
|
||||||
ALL_DEVICES,
|
ALL_DEVICES,
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
#ifdef FLANN_EXPORT
|
#ifdef FLANN_EXPORT
|
||||||
#undef FLANN_EXPORT
|
#undef FLANN_EXPORT
|
||||||
#endif
|
#endif
|
||||||
#ifdef WIN32
|
#ifdef _WIN32
|
||||||
/* win32 dll export/import directives */
|
/* win32 dll export/import directives */
|
||||||
#ifdef FLANN_EXPORTS
|
#ifdef FLANN_EXPORTS
|
||||||
#define FLANN_EXPORT __declspec(dllexport)
|
#define FLANN_EXPORT __declspec(dllexport)
|
||||||
|
@ -43,7 +43,7 @@ typedef unsigned __int64 uint64_t;
|
|||||||
|
|
||||||
#include "defines.h"
|
#include "defines.h"
|
||||||
|
|
||||||
#if (defined WIN32 || defined _WIN32) && defined(_M_ARM)
|
#if defined _WIN32 && defined(_M_ARM)
|
||||||
# include <Intrin.h>
|
# include <Intrin.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
namespace cvflann
|
namespace cvflann
|
||||||
{
|
{
|
||||||
|
|
||||||
#if (defined WIN32 || defined _WIN32 || defined WINCE) && defined CVAPI_EXPORTS
|
#if (defined _WIN32 || defined WINCE) && defined CVAPI_EXPORTS
|
||||||
__declspec(dllexport)
|
__declspec(dllexport)
|
||||||
#endif
|
#endif
|
||||||
void dummyfunc();
|
void dummyfunc();
|
||||||
|
@ -239,7 +239,7 @@ CVAPI(void) cvUpdateWindow(const char* window_name);
|
|||||||
#define set_preprocess_func cvSetPreprocessFuncWin32
|
#define set_preprocess_func cvSetPreprocessFuncWin32
|
||||||
#define set_postprocess_func cvSetPostprocessFuncWin32
|
#define set_postprocess_func cvSetPostprocessFuncWin32
|
||||||
|
|
||||||
#if defined WIN32 || defined _WIN32
|
#if defined _WIN32
|
||||||
|
|
||||||
CVAPI(void) cvSetPreprocessFuncWin32_(const void* callback);
|
CVAPI(void) cvSetPreprocessFuncWin32_(const void* callback);
|
||||||
CVAPI(void) cvSetPostprocessFuncWin32_(const void* callback);
|
CVAPI(void) cvSetPostprocessFuncWin32_(const void* callback);
|
||||||
|
@ -60,7 +60,7 @@
|
|||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
#if defined WIN32 || defined WINCE
|
#if defined _WIN32 || defined WINCE
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#undef small
|
#undef small
|
||||||
#undef min
|
#undef min
|
||||||
|
@ -351,7 +351,7 @@ CV_IMPL int cvWaitKey(int delay)
|
|||||||
|
|
||||||
//to decrease CPU usage
|
//to decrease CPU usage
|
||||||
//sleep 1 millisecond
|
//sleep 1 millisecond
|
||||||
#if defined WIN32 || defined _WIN32 || defined WIN64 || defined _WIN64
|
#if defined _WIN32
|
||||||
Sleep(1);
|
Sleep(1);
|
||||||
#else
|
#else
|
||||||
usleep(1000);
|
usleep(1000);
|
||||||
|
@ -42,7 +42,7 @@
|
|||||||
#include "precomp.hpp"
|
#include "precomp.hpp"
|
||||||
#include "opencv2/imgproc.hpp"
|
#include "opencv2/imgproc.hpp"
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef _WIN32
|
||||||
|
|
||||||
#if defined (HAVE_GTK)
|
#if defined (HAVE_GTK)
|
||||||
|
|
||||||
@ -2097,6 +2097,6 @@ CV_IMPL int cvWaitKey( int delay )
|
|||||||
|
|
||||||
|
|
||||||
#endif // HAVE_GTK
|
#endif // HAVE_GTK
|
||||||
#endif // WIN32
|
#endif // _WIN32
|
||||||
|
|
||||||
/* End of file. */
|
/* End of file. */
|
||||||
|
@ -42,7 +42,7 @@
|
|||||||
#include "precomp.hpp"
|
#include "precomp.hpp"
|
||||||
#include <windowsx.h> // required for GET_X_LPARAM() and GET_Y_LPARAM() macros
|
#include <windowsx.h> // required for GET_X_LPARAM() and GET_Y_LPARAM() macros
|
||||||
|
|
||||||
#if defined WIN32 || defined _WIN32
|
#if defined _WIN32
|
||||||
|
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
# pragma GCC diagnostic ignored "-Wmissing-declarations"
|
# pragma GCC diagnostic ignored "-Wmissing-declarations"
|
||||||
@ -2426,4 +2426,4 @@ cvSetPostprocessFuncWin32_(const void* callback)
|
|||||||
hg_on_postprocess = (CvWin32WindowCallback)callback;
|
hg_on_postprocess = (CvWin32WindowCallback)callback;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif //WIN32
|
#endif //_WIN32
|
||||||
|
@ -57,14 +57,14 @@
|
|||||||
#define mingw_getsp(...) 0
|
#define mingw_getsp(...) 0
|
||||||
#define __builtin_frame_address(...) 0
|
#define __builtin_frame_address(...) 0
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef _WIN32
|
||||||
|
|
||||||
#define XMD_H // prevent redefinition of INT32
|
#define XMD_H // prevent redefinition of INT32
|
||||||
#undef FAR // prevent FAR redefinition
|
#undef FAR // prevent FAR redefinition
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined WIN32 && defined __GNUC__
|
#if defined _WIN32 && defined __GNUC__
|
||||||
typedef unsigned char boolean;
|
typedef unsigned char boolean;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@
|
|||||||
#include "grfmt_jpeg2000.hpp"
|
#include "grfmt_jpeg2000.hpp"
|
||||||
#include "opencv2/imgproc.hpp"
|
#include "opencv2/imgproc.hpp"
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef _WIN32
|
||||||
#define JAS_WIN_MSVC_BUILD 1
|
#define JAS_WIN_MSVC_BUILD 1
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
#define HAVE_STDINT_H 1
|
#define HAVE_STDINT_H 1
|
||||||
@ -160,7 +160,7 @@ bool Jpeg2KDecoder::readData( Mat& img )
|
|||||||
jas_stream_t* stream = (jas_stream_t*)m_stream;
|
jas_stream_t* stream = (jas_stream_t*)m_stream;
|
||||||
jas_image_t* image = (jas_image_t*)m_image;
|
jas_image_t* image = (jas_image_t*)m_image;
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef _WIN32
|
||||||
// At least on some Linux instances the
|
// At least on some Linux instances the
|
||||||
// system libjasper segfaults when
|
// system libjasper segfaults when
|
||||||
// converting color to grey.
|
// converting color to grey.
|
||||||
@ -272,7 +272,7 @@ bool Jpeg2KDecoder::readData( Mat& img )
|
|||||||
|
|
||||||
close();
|
close();
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef _WIN32
|
||||||
if (!clr.empty())
|
if (!clr.empty())
|
||||||
{
|
{
|
||||||
cv::cvtColor(clr, img, COLOR_BGR2GRAY);
|
cv::cvtColor(clr, img, COLOR_BGR2GRAY);
|
||||||
|
@ -732,7 +732,7 @@ bool TiffEncoder::write( const Mat& img, const std::vector<int>& /*params*/)
|
|||||||
if( m_buf )
|
if( m_buf )
|
||||||
m_buf->reserve( alignSize(stripCount*8 + fileStep*height + 256, 256) );
|
m_buf->reserve( alignSize(stripCount*8 + fileStep*height + 256, 256) );
|
||||||
|
|
||||||
/*#if defined _DEBUG || !defined WIN32
|
/*#if defined _DEBUG || !defined _WIN32
|
||||||
int uncompressedRowSize = rowsPerStrip * fileStep;
|
int uncompressedRowSize = rowsPerStrip * fileStep;
|
||||||
#endif*/
|
#endif*/
|
||||||
int directoryOffset = 0;
|
int directoryOffset = 0;
|
||||||
|
@ -58,7 +58,7 @@
|
|||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
#if defined WIN32 || defined WINCE
|
#if defined _WIN32 || defined WINCE
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#undef small
|
#undef small
|
||||||
#undef min
|
#undef min
|
||||||
|
@ -47,7 +47,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#if defined WIN32 || defined _WIN32 || defined WIN64 || defined _WIN64
|
#if defined _WIN32
|
||||||
#include <io.h>
|
#include <io.h>
|
||||||
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
@ -67,7 +67,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// isDirectory
|
// isDirectory
|
||||||
#if defined WIN32 || defined _WIN32 || defined WINCE
|
#if defined _WIN32 || defined WINCE
|
||||||
# include <windows.h>
|
# include <windows.h>
|
||||||
#else
|
#else
|
||||||
# include <dirent.h>
|
# include <dirent.h>
|
||||||
@ -100,7 +100,7 @@ static std::string path_join(const std::string& prefix, const std::string& subpa
|
|||||||
|
|
||||||
// a few platform-dependent declarations
|
// a few platform-dependent declarations
|
||||||
|
|
||||||
#if defined WIN32 || defined _WIN32 || defined WIN64 || defined _WIN64
|
#if defined _WIN32
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
static void SEHTranslator( unsigned int /*u*/, EXCEPTION_POINTERS* pExp )
|
static void SEHTranslator( unsigned int /*u*/, EXCEPTION_POINTERS* pExp )
|
||||||
{
|
{
|
||||||
@ -236,7 +236,7 @@ void BaseTest::safe_run( int start_from )
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
#if !defined WIN32 && !defined _WIN32
|
#if !defined _WIN32
|
||||||
int _code = setjmp( tsJmpMark );
|
int _code = setjmp( tsJmpMark );
|
||||||
if( !_code )
|
if( !_code )
|
||||||
run( start_from );
|
run( start_from );
|
||||||
@ -491,7 +491,7 @@ void TS::init( const string& modulename )
|
|||||||
|
|
||||||
if( ::testing::GTEST_FLAG(catch_exceptions) )
|
if( ::testing::GTEST_FLAG(catch_exceptions) )
|
||||||
{
|
{
|
||||||
#if defined WIN32 || defined _WIN32
|
#if defined _WIN32
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
_set_se_translator( SEHTranslator );
|
_set_se_translator( SEHTranslator );
|
||||||
#endif
|
#endif
|
||||||
@ -502,7 +502,7 @@ void TS::init( const string& modulename )
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#if defined WIN32 || defined _WIN32
|
#if defined _WIN32
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
_set_se_translator( 0 );
|
_set_se_translator( 0 );
|
||||||
#endif
|
#endif
|
||||||
@ -722,7 +722,7 @@ void parseCustomOptions(int argc, char **argv)
|
|||||||
|
|
||||||
static bool isDirectory(const std::string& path)
|
static bool isDirectory(const std::string& path)
|
||||||
{
|
{
|
||||||
#if defined WIN32 || defined _WIN32 || defined WINCE
|
#if defined _WIN32 || defined WINCE
|
||||||
WIN32_FILE_ATTRIBUTE_DATA all_attrs;
|
WIN32_FILE_ATTRIBUTE_DATA all_attrs;
|
||||||
#ifdef WINRT
|
#ifdef WINRT
|
||||||
wchar_t wpath[MAX_PATH];
|
wchar_t wpath[MAX_PATH];
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
|
||||||
#if defined WIN32 || defined _WIN32 || defined WIN64 || defined _WIN64
|
#if defined _WIN32
|
||||||
#ifndef NOMINMAX
|
#ifndef NOMINMAX
|
||||||
#define NOMINMAX
|
#define NOMINMAX
|
||||||
#endif
|
#endif
|
||||||
@ -1430,7 +1430,7 @@ bool TestBase::next()
|
|||||||
CV_TRACE_REGION("idle_delay");
|
CV_TRACE_REGION("idle_delay");
|
||||||
printf("Performance is unstable, it may be a result of overheat problems\n");
|
printf("Performance is unstable, it may be a result of overheat problems\n");
|
||||||
printf("Idle delay for %d ms... \n", perf_validation_idle_delay_ms);
|
printf("Idle delay for %d ms... \n", perf_validation_idle_delay_ms);
|
||||||
#if defined WIN32 || defined _WIN32 || defined WIN64 || defined _WIN64
|
#if defined _WIN32
|
||||||
#ifndef WINRT_8_0
|
#ifndef WINRT_8_0
|
||||||
Sleep(perf_validation_idle_delay_ms);
|
Sleep(perf_validation_idle_delay_ms);
|
||||||
#else
|
#else
|
||||||
|
@ -346,7 +346,7 @@ _exit_:
|
|||||||
|
|
||||||
if( code < 0 )
|
if( code < 0 )
|
||||||
{
|
{
|
||||||
#if 0 //defined _DEBUG && defined WIN32
|
#if 0 //defined _DEBUG && defined _WIN32
|
||||||
IplImage* dst = cvCreateImage( img_size, 8, 3 );
|
IplImage* dst = cvCreateImage( img_size, 8, 3 );
|
||||||
cvNamedWindow( "test", 1 );
|
cvNamedWindow( "test", 1 );
|
||||||
cvCmpS( img, 0, img, CV_CMP_GT );
|
cvCmpS( img, 0, img, CV_CMP_GT );
|
||||||
@ -485,7 +485,7 @@ _exit_:
|
|||||||
|
|
||||||
if( code < 0 )
|
if( code < 0 )
|
||||||
{
|
{
|
||||||
#if 0// defined _DEBUG && defined WIN32
|
#if 0// defined _DEBUG && defined _WIN32
|
||||||
IplImage* dst = cvCreateImage( img_size, 8, 3 );
|
IplImage* dst = cvCreateImage( img_size, 8, 3 );
|
||||||
cvNamedWindow( "test", 1 );
|
cvNamedWindow( "test", 1 );
|
||||||
cvCmpS( img, 0, img, CV_CMP_GT );
|
cvCmpS( img, 0, img, CV_CMP_GT );
|
||||||
|
@ -41,7 +41,7 @@
|
|||||||
|
|
||||||
#include "precomp.hpp"
|
#include "precomp.hpp"
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef _WIN32
|
||||||
|
|
||||||
/****************** Capturing video from camera via CMU lib *******************/
|
/****************** Capturing video from camera via CMU lib *******************/
|
||||||
|
|
||||||
@ -548,4 +548,4 @@ CvCapture * cvCreateCameraCapture_CMU (int index)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endif // CMU
|
#endif // CMU
|
||||||
#endif // WIN32
|
#endif // _WIN32
|
||||||
|
@ -97,7 +97,7 @@ Tested with 2.6.12 with libdc1394-1.0.0, libraw1394-0.10.1 using a Point Grey Fl
|
|||||||
|
|
||||||
#include "precomp.hpp"
|
#include "precomp.hpp"
|
||||||
|
|
||||||
#if !defined WIN32 && defined HAVE_DC1394
|
#if !defined _WIN32 && defined HAVE_DC1394
|
||||||
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
@ -45,7 +45,7 @@
|
|||||||
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#ifdef WIN32
|
#ifdef _WIN32
|
||||||
// On Windows, we have no sys/select.h, but we need to pick up
|
// On Windows, we have no sys/select.h, but we need to pick up
|
||||||
// select() which is in winsock2.
|
// select() which is in winsock2.
|
||||||
#ifndef __SYS_SELECT_H__
|
#ifndef __SYS_SELECT_H__
|
||||||
@ -54,7 +54,7 @@
|
|||||||
#endif
|
#endif
|
||||||
#else
|
#else
|
||||||
#include <sys/select.h>
|
#include <sys/select.h>
|
||||||
#endif /*WIN32*/
|
#endif /*_WIN32*/
|
||||||
#include <dc1394/dc1394.h>
|
#include <dc1394/dc1394.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
@ -41,7 +41,7 @@
|
|||||||
|
|
||||||
#include "precomp.hpp"
|
#include "precomp.hpp"
|
||||||
|
|
||||||
#if (defined WIN32 || defined _WIN32) && defined HAVE_DSHOW
|
#if defined _WIN32 && defined HAVE_DSHOW
|
||||||
#include "cap_dshow.hpp"
|
#include "cap_dshow.hpp"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -43,7 +43,7 @@
|
|||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#if defined HAVE_FFMPEG && !defined WIN32
|
#if defined HAVE_FFMPEG && !defined _WIN32
|
||||||
#include "cap_ffmpeg_impl.hpp"
|
#include "cap_ffmpeg_impl.hpp"
|
||||||
#else
|
#else
|
||||||
#include "cap_ffmpeg_api.hpp"
|
#include "cap_ffmpeg_api.hpp"
|
||||||
@ -61,7 +61,7 @@ static CvWriteFrame_Plugin icvWriteFrame_FFMPEG_p = 0;
|
|||||||
|
|
||||||
static cv::Mutex _icvInitFFMPEG_mutex;
|
static cv::Mutex _icvInitFFMPEG_mutex;
|
||||||
|
|
||||||
#if defined WIN32 || defined _WIN32
|
#if defined _WIN32
|
||||||
static const HMODULE cv_GetCurrentModule()
|
static const HMODULE cv_GetCurrentModule()
|
||||||
{
|
{
|
||||||
HMODULE h = 0;
|
HMODULE h = 0;
|
||||||
@ -84,7 +84,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
#if defined WIN32 || defined _WIN32
|
#if defined _WIN32
|
||||||
HMODULE icvFFOpenCV;
|
HMODULE icvFFOpenCV;
|
||||||
|
|
||||||
~icvInitFFMPEG()
|
~icvInitFFMPEG()
|
||||||
@ -99,7 +99,7 @@ private:
|
|||||||
|
|
||||||
icvInitFFMPEG()
|
icvInitFFMPEG()
|
||||||
{
|
{
|
||||||
#if defined WIN32 || defined _WIN32
|
#if defined _WIN32
|
||||||
const wchar_t* module_name_ = L"opencv_ffmpeg"
|
const wchar_t* module_name_ = L"opencv_ffmpeg"
|
||||||
CVAUX_STRW(CV_MAJOR_VERSION) CVAUX_STRW(CV_MINOR_VERSION) CVAUX_STRW(CV_SUBMINOR_VERSION)
|
CVAUX_STRW(CV_MAJOR_VERSION) CVAUX_STRW(CV_MINOR_VERSION) CVAUX_STRW(CV_SUBMINOR_VERSION)
|
||||||
#if (defined _MSC_VER && defined _M_X64) || (defined __GNUC__ && defined __x86_64__)
|
#if (defined _MSC_VER && defined _M_X64) || (defined __GNUC__ && defined __x86_64__)
|
||||||
|
@ -6,7 +6,7 @@ extern "C"
|
|||||||
{
|
{
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined WIN32 || defined _WIN32
|
#if defined _WIN32
|
||||||
# define OPENCV_FFMPEG_API __declspec(dllexport)
|
# define OPENCV_FFMPEG_API __declspec(dllexport)
|
||||||
#elif defined __GNUC__ && __GNUC__ >= 4
|
#elif defined __GNUC__ && __GNUC__ >= 4
|
||||||
# define OPENCV_FFMPEG_API __attribute__ ((visibility ("default")))
|
# define OPENCV_FFMPEG_API __attribute__ ((visibility ("default")))
|
||||||
|
@ -41,7 +41,7 @@
|
|||||||
//M*/
|
//M*/
|
||||||
|
|
||||||
#include "cap_ffmpeg_api.hpp"
|
#include "cap_ffmpeg_api.hpp"
|
||||||
#if !(defined(WIN32) || defined(_WIN32) || defined(WINCE))
|
#if !(defined(_WIN32) || defined(WINCE))
|
||||||
# include <pthread.h>
|
# include <pthread.h>
|
||||||
#endif
|
#endif
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
@ -92,7 +92,7 @@ extern "C" {
|
|||||||
#define CV_WARN(message) fprintf(stderr, "warning: %s (%s:%d)\n", message, __FILE__, __LINE__)
|
#define CV_WARN(message) fprintf(stderr, "warning: %s (%s:%d)\n", message, __FILE__, __LINE__)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined WIN32 || defined _WIN32
|
#if defined _WIN32
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#if defined _MSC_VER && _MSC_VER < 1900
|
#if defined _MSC_VER && _MSC_VER < 1900
|
||||||
struct timespec
|
struct timespec
|
||||||
@ -172,7 +172,7 @@ extern "C" {
|
|||||||
#define LIBAVFORMAT_INTERRUPT_OPEN_TIMEOUT_MS 30000
|
#define LIBAVFORMAT_INTERRUPT_OPEN_TIMEOUT_MS 30000
|
||||||
#define LIBAVFORMAT_INTERRUPT_READ_TIMEOUT_MS 30000
|
#define LIBAVFORMAT_INTERRUPT_READ_TIMEOUT_MS 30000
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef _WIN32
|
||||||
// http://stackoverflow.com/questions/5404277/porting-clock-gettime-to-windows
|
// http://stackoverflow.com/questions/5404277/porting-clock-gettime-to-windows
|
||||||
|
|
||||||
static
|
static
|
||||||
@ -289,7 +289,7 @@ static int get_number_of_cpus(void)
|
|||||||
{
|
{
|
||||||
#if LIBAVFORMAT_BUILD < CALC_FFMPEG_VERSION(52, 111, 0)
|
#if LIBAVFORMAT_BUILD < CALC_FFMPEG_VERSION(52, 111, 0)
|
||||||
return 1;
|
return 1;
|
||||||
#elif defined WIN32 || defined _WIN32
|
#elif defined _WIN32
|
||||||
SYSTEM_INFO sysinfo;
|
SYSTEM_INFO sysinfo;
|
||||||
GetSystemInfo( &sysinfo );
|
GetSystemInfo( &sysinfo );
|
||||||
|
|
||||||
@ -584,7 +584,7 @@ private:
|
|||||||
ImplMutex& operator = (const ImplMutex& m);
|
ImplMutex& operator = (const ImplMutex& m);
|
||||||
};
|
};
|
||||||
|
|
||||||
#if defined WIN32 || defined _WIN32 || defined WINCE
|
#if defined _WIN32 || defined WINCE
|
||||||
|
|
||||||
struct ImplMutex::Impl
|
struct ImplMutex::Impl
|
||||||
{
|
{
|
||||||
|
@ -48,7 +48,7 @@
|
|||||||
#include <GigEVisionSDK.h>
|
#include <GigEVisionSDK.h>
|
||||||
#include <GigEVisionSDK.cpp>
|
#include <GigEVisionSDK.cpp>
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef _WIN32
|
||||||
#include <io.h>
|
#include <io.h>
|
||||||
#else
|
#else
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
@ -1184,7 +1184,7 @@ void DigitalCameraCapture::message(MsgType msgType, const char * msg,
|
|||||||
msgsBuffer << out;
|
msgsBuffer << out;
|
||||||
}
|
}
|
||||||
#if !defined(NDEBUG)
|
#if !defined(NDEBUG)
|
||||||
#if defined(WIN32) || defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
::OutputDebugString(out.c_str());
|
::OutputDebugString(out.c_str());
|
||||||
#else
|
#else
|
||||||
fputs(out.c_str(), stderr);
|
fputs(out.c_str(), stderr);
|
||||||
|
@ -239,7 +239,7 @@ make & enjoy!
|
|||||||
|
|
||||||
#include "precomp.hpp"
|
#include "precomp.hpp"
|
||||||
|
|
||||||
#if !defined WIN32 && defined HAVE_LIBV4L
|
#if !defined _WIN32 && defined HAVE_LIBV4L
|
||||||
|
|
||||||
#define CLEAR(x) memset (&(x), 0, sizeof (x))
|
#define CLEAR(x) memset (&(x), 0, sizeof (x))
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
//
|
//
|
||||||
//M*/
|
//M*/
|
||||||
#include "precomp.hpp"
|
#include "precomp.hpp"
|
||||||
#if (defined WIN32 || defined _WIN32) && defined HAVE_MSMF
|
#if defined _WIN32 && defined HAVE_MSMF
|
||||||
/*
|
/*
|
||||||
Media Foundation-based Video Capturing module is based on
|
Media Foundation-based Video Capturing module is based on
|
||||||
videoInput library by Evgeny Pereguda:
|
videoInput library by Evgeny Pereguda:
|
||||||
|
@ -46,7 +46,7 @@
|
|||||||
#include "precomp.hpp"
|
#include "precomp.hpp"
|
||||||
|
|
||||||
#ifdef HAVE_PVAPI
|
#ifdef HAVE_PVAPI
|
||||||
#if !defined WIN32 && !defined _WIN32 && !defined _LINUX
|
#if !defined _WIN32 && !defined _LINUX
|
||||||
#define _LINUX
|
#define _LINUX
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -57,7 +57,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <PvApi.h>
|
#include <PvApi.h>
|
||||||
#ifdef WIN32
|
#ifdef _WIN32
|
||||||
# include <io.h>
|
# include <io.h>
|
||||||
#else
|
#else
|
||||||
# include <time.h>
|
# include <time.h>
|
||||||
@ -91,7 +91,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
#ifndef WIN32
|
#ifndef _WIN32
|
||||||
virtual void Sleep(unsigned int time);
|
virtual void Sleep(unsigned int time);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -118,7 +118,7 @@ CvCaptureCAM_PvAPI::CvCaptureCAM_PvAPI()
|
|||||||
memset(&this->Camera, 0, sizeof(this->Camera));
|
memset(&this->Camera, 0, sizeof(this->Camera));
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef _WIN32
|
||||||
void CvCaptureCAM_PvAPI::Sleep(unsigned int time)
|
void CvCaptureCAM_PvAPI::Sleep(unsigned int time)
|
||||||
{
|
{
|
||||||
struct timespec t,r;
|
struct timespec t,r;
|
||||||
|
@ -209,7 +209,7 @@ make & enjoy!
|
|||||||
|
|
||||||
#include "precomp.hpp"
|
#include "precomp.hpp"
|
||||||
|
|
||||||
#if !defined WIN32 && (defined HAVE_CAMV4L2 || defined HAVE_VIDEOIO)
|
#if !defined _WIN32 && (defined HAVE_CAMV4L2 || defined HAVE_VIDEOIO)
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
#include "precomp.hpp"
|
#include "precomp.hpp"
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef _WIN32
|
||||||
#include <xiApi.h>
|
#include <xiApi.h>
|
||||||
#else
|
#else
|
||||||
#include <m3api/xiApi.h>
|
#include <m3api/xiApi.h>
|
||||||
@ -55,7 +55,7 @@ CvCapture* cvCreateCameraCapture_XIMEA( int index )
|
|||||||
// Enumerate connected devices
|
// Enumerate connected devices
|
||||||
void CvCaptureCAM_XIMEA::init()
|
void CvCaptureCAM_XIMEA::init()
|
||||||
{
|
{
|
||||||
#if defined WIN32 || defined _WIN32
|
#if defined _WIN32
|
||||||
xiGetNumberDevices( &numDevices);
|
xiGetNumberDevices( &numDevices);
|
||||||
#else
|
#else
|
||||||
// try second re-enumeration if first one fails
|
// try second re-enumeration if first one fails
|
||||||
@ -84,7 +84,7 @@ bool CvCaptureCAM_XIMEA::open( int wIndex )
|
|||||||
|
|
||||||
if((mvret = xiOpenDevice( wIndex, &hmv)) != XI_OK)
|
if((mvret = xiOpenDevice( wIndex, &hmv)) != XI_OK)
|
||||||
{
|
{
|
||||||
#if defined WIN32 || defined _WIN32
|
#if defined _WIN32
|
||||||
errMsg("Open XI_DEVICE failed", mvret);
|
errMsg("Open XI_DEVICE failed", mvret);
|
||||||
return false;
|
return false;
|
||||||
#else
|
#else
|
||||||
@ -1751,7 +1751,7 @@ void CvCaptureCAM_XIMEA::errMsg(const char* msg, int errNum) const
|
|||||||
error_message = "Unknown error value";
|
error_message = "Unknown error value";
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined WIN32 || defined _WIN32
|
#if defined _WIN32
|
||||||
char buf[512]="";
|
char buf[512]="";
|
||||||
sprintf( buf, "%s : %d, %s\n", msg, errNum, error_message.c_str());
|
sprintf( buf, "%s : %d, %s\n", msg, errNum, error_message.c_str());
|
||||||
OutputDebugString(buf);
|
OutputDebugString(buf);
|
||||||
|
@ -44,7 +44,7 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(WIN32) || defined(__MINGW32__)
|
#if !defined(_WIN32) || defined(__MINGW32__)
|
||||||
// some versions of FFMPEG assume a C99 compiler, and don't define INT64_C
|
// some versions of FFMPEG assume a C99 compiler, and don't define INT64_C
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@
|
|||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
#if defined WIN32 || defined WINCE
|
#if defined _WIN32 || defined WINCE
|
||||||
#if !defined _WIN32_WINNT
|
#if !defined _WIN32_WINNT
|
||||||
#ifdef HAVE_MSMF
|
#ifdef HAVE_MSMF
|
||||||
#define _WIN32_WINNT 0x0600 // Windows Vista
|
#define _WIN32_WINNT 0x0600 // Windows Vista
|
||||||
|
@ -58,8 +58,8 @@ Param(
|
|||||||
[parameter(Mandatory=$False)]
|
[parameter(Mandatory=$False)]
|
||||||
[String]
|
[String]
|
||||||
[ValidateNotNull()]
|
[ValidateNotNull()]
|
||||||
[ValidateSet("Visual Studio 12 2013","Visual Studio 11 2012")]
|
[ValidateSet("Visual Studio 15 2017","Visual Studio 14 2015","Visual Studio 12 2013","Visual Studio 11 2012")]
|
||||||
$GENERATOR = "Visual Studio 12 2013",
|
$GENERATOR = "Visual Studio 15 2017",
|
||||||
|
|
||||||
[parameter(Mandatory=$False)]
|
[parameter(Mandatory=$False)]
|
||||||
[String]
|
[String]
|
||||||
@ -168,11 +168,11 @@ Function Execute() {
|
|||||||
$versions = New-Object System.Collections.ArrayList
|
$versions = New-Object System.Collections.ArrayList
|
||||||
$VERSIONS_IN.Split("," ,[System.StringSplitOptions]::RemoveEmptyEntries) | ForEach {
|
$VERSIONS_IN.Split("," ,[System.StringSplitOptions]::RemoveEmptyEntries) | ForEach {
|
||||||
$_ = $_.Trim()
|
$_ = $_.Trim()
|
||||||
if ("8.0","8.1" -Contains $_) {
|
if ("8.0","8.1","10.0" -Contains $_) {
|
||||||
[void]$versions.Add($_)
|
[void]$versions.Add($_)
|
||||||
D "$_ is valid"
|
D "$_ is valid"
|
||||||
} else {
|
} else {
|
||||||
Throw "$($_) is not valid! Please use 8.0, 8.1"
|
Throw "$($_) is not valid! Please use 8.0, 8.1, 10.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
D "Processed Versions: $versions"
|
D "Processed Versions: $versions"
|
||||||
@ -345,7 +345,7 @@ Function ShowHelp() {
|
|||||||
Write-Host " setup_winrt -b 'WP' 'x86,ARM' -test PERF "
|
Write-Host " setup_winrt -b 'WP' 'x86,ARM' -test PERF "
|
||||||
Write-Host " setup_winrt -architecture x86 -platform WP "
|
Write-Host " setup_winrt -architecture x86 -platform WP "
|
||||||
Write-Host " setup_winrt -arc x86 -plat 'WP,WS' "
|
Write-Host " setup_winrt -arc x86 -plat 'WP,WS' "
|
||||||
Write-Host " setup_winrt -a x86 -g 'Visual Studio 11 2012' -pl WP "
|
Write-Host " setup_winrt -a x86 -g 'Visual Studio 15 2017' -pl WP "
|
||||||
Write-Host " WHERE: "
|
Write-Host " WHERE: "
|
||||||
Write-Host " options - Options to call "
|
Write-Host " options - Options to call "
|
||||||
Write-Host " -h: diplays command line help "
|
Write-Host " -h: diplays command line help "
|
||||||
@ -358,7 +358,7 @@ Function ShowHelp() {
|
|||||||
Write-Host " version - Array of platform versions. "
|
Write-Host " version - Array of platform versions. "
|
||||||
Write-Host " Default: 8.1 "
|
Write-Host " Default: 8.1 "
|
||||||
Write-Host " Example: '8.0,8.1' "
|
Write-Host " Example: '8.0,8.1' "
|
||||||
Write-Host " Options: 8.0, 8.1. Available options may be limited depending on your local setup (e.g. SDK availability). "
|
Write-Host " Options: 8.0, 8.1, 10.0. Available options may be limited depending on your local setup (e.g. SDK availability). "
|
||||||
Write-Host " Note that you'll need to use quotes to specify more than one version. "
|
Write-Host " Note that you'll need to use quotes to specify more than one version. "
|
||||||
Write-Host " architecture - Array of target architectures to build for. "
|
Write-Host " architecture - Array of target architectures to build for. "
|
||||||
Write-Host " Default: x86 "
|
Write-Host " Default: x86 "
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
#include <map>
|
#include <map>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#ifdef HAVE_OPENGL
|
#ifdef HAVE_OPENGL
|
||||||
#ifdef WIN32
|
#ifdef _WIN32
|
||||||
#define WIN32_LEAN_AND_MEAN 1
|
#define WIN32_LEAN_AND_MEAN 1
|
||||||
#define NOMINMAX 1
|
#define NOMINMAX 1
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
@ -1,13 +1,10 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef _WIN32
|
||||||
#define WIN32_LEAN_AND_MEAN 1
|
#define WIN32_LEAN_AND_MEAN 1
|
||||||
#define NOMINMAX 1
|
#define NOMINMAX 1
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#endif
|
#endif
|
||||||
#if defined(_WIN64)
|
|
||||||
#include <windows.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(__APPLE__)
|
#if defined(__APPLE__)
|
||||||
#include <OpenGL/gl.h>
|
#include <OpenGL/gl.h>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// This sample demonstrates working on one piece of data using two GPUs.
|
// This sample demonstrates working on one piece of data using two GPUs.
|
||||||
// It splits input into two parts and processes them separately on different GPUs.
|
// It splits input into two parts and processes them separately on different GPUs.
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef _WIN32
|
||||||
#define NOMINMAX
|
#define NOMINMAX
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#else
|
#else
|
||||||
@ -25,7 +25,7 @@ using namespace cv::cuda;
|
|||||||
// Thread
|
// Thread
|
||||||
// OS-specific wrappers for multi-threading
|
// OS-specific wrappers for multi-threading
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef _WIN32
|
||||||
class Thread
|
class Thread
|
||||||
{
|
{
|
||||||
struct UserData
|
struct UserData
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
#include "opencv2/opencv_modules.hpp"
|
#include "opencv2/opencv_modules.hpp"
|
||||||
|
|
||||||
#if defined(HAVE_OPENCV_CUDACODEC) && defined(WIN32)
|
#if defined(HAVE_OPENCV_CUDACODEC) && defined(_WIN32)
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <numeric>
|
#include <numeric>
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
// and call cv::Blur function. The result is mapped back to OpenGL texture
|
// and call cv::Blur function. The result is mapped back to OpenGL texture
|
||||||
// and rendered through OpenGL API.
|
// and rendered through OpenGL API.
|
||||||
*/
|
*/
|
||||||
#if defined(WIN32) || defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
# define WIN32_LEAN_AND_MEAN
|
# define WIN32_LEAN_AND_MEAN
|
||||||
# include <windows.h>
|
# include <windows.h>
|
||||||
#elif defined(__linux__)
|
#elif defined(__linux__)
|
||||||
@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
#include "winapp.hpp"
|
#include "winapp.hpp"
|
||||||
|
|
||||||
#if defined(WIN32) || defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
# pragma comment(lib, "opengl32.lib")
|
# pragma comment(lib, "opengl32.lib")
|
||||||
# pragma comment(lib, "glu32.lib")
|
# pragma comment(lib, "glu32.lib")
|
||||||
#endif
|
#endif
|
||||||
@ -74,7 +74,7 @@ public:
|
|||||||
WinApp::cleanup();
|
WinApp::cleanup();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(WIN32) || defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
virtual LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
virtual LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
switch (message)
|
switch (message)
|
||||||
@ -169,7 +169,7 @@ public:
|
|||||||
|
|
||||||
int init()
|
int init()
|
||||||
{
|
{
|
||||||
#if defined(WIN32) || defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
m_hDC = GetDC(m_hWnd);
|
m_hDC = GetDC(m_hWnd);
|
||||||
|
|
||||||
if (setup_pixel_format() != 0)
|
if (setup_pixel_format() != 0)
|
||||||
@ -219,7 +219,7 @@ public:
|
|||||||
|
|
||||||
void print_info(MODE mode, float time, cv::String& oclDevName)
|
void print_info(MODE mode, float time, cv::String& oclDevName)
|
||||||
{
|
{
|
||||||
#if defined(WIN32) || defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
HDC hDC = m_hDC;
|
HDC hDC = m_hDC;
|
||||||
|
|
||||||
HFONT hFont = (HFONT)::GetStockObject(SYSTEM_FONT);
|
HFONT hFont = (HFONT)::GetStockObject(SYSTEM_FONT);
|
||||||
@ -323,7 +323,7 @@ public:
|
|||||||
glTexCoord2f(1.0f, 0.0f); glVertex3f(1.0f, 1.0f, 0.1f);
|
glTexCoord2f(1.0f, 0.0f); glVertex3f(1.0f, 1.0f, 0.1f);
|
||||||
glEnd();
|
glEnd();
|
||||||
|
|
||||||
#if defined(WIN32) || defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
SwapBuffers(m_hDC);
|
SwapBuffers(m_hDC);
|
||||||
#elif defined(__linux__)
|
#elif defined(__linux__)
|
||||||
glXSwapBuffers(m_display, m_window);
|
glXSwapBuffers(m_display, m_window);
|
||||||
@ -394,7 +394,7 @@ protected:
|
|||||||
m_timer.stop();
|
m_timer.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(WIN32) || defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
int setup_pixel_format()
|
int setup_pixel_format()
|
||||||
{
|
{
|
||||||
PIXELFORMATDESCRIPTOR pfd;
|
PIXELFORMATDESCRIPTOR pfd;
|
||||||
@ -459,7 +459,7 @@ private:
|
|||||||
bool m_demo_processing;
|
bool m_demo_processing;
|
||||||
MODE m_mode;
|
MODE m_mode;
|
||||||
cv::String m_modeStr[2];
|
cv::String m_modeStr[2];
|
||||||
#if defined(WIN32) || defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
HDC m_hDC;
|
HDC m_hDC;
|
||||||
HGLRC m_hRC;
|
HGLRC m_hRC;
|
||||||
#elif defined(__linux__)
|
#elif defined(__linux__)
|
||||||
@ -524,7 +524,7 @@ int main(int argc, char** argv)
|
|||||||
int width = (int)cap.get(CAP_PROP_FRAME_WIDTH);
|
int width = (int)cap.get(CAP_PROP_FRAME_WIDTH);
|
||||||
int height = (int)cap.get(CAP_PROP_FRAME_HEIGHT);
|
int height = (int)cap.get(CAP_PROP_FRAME_HEIGHT);
|
||||||
|
|
||||||
#if defined(WIN32) || defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
string wndname = "WGL Window";
|
string wndname = "WGL Window";
|
||||||
#elif defined(__linux__)
|
#elif defined(__linux__)
|
||||||
string wndname = "GLX Window";
|
string wndname = "GLX Window";
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#if defined(WIN32) || defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
# define WIN32_LEAN_AND_MEAN
|
# define WIN32_LEAN_AND_MEAN
|
||||||
# include <windows.h>
|
# include <windows.h>
|
||||||
#elif defined(__linux__)
|
#elif defined(__linux__)
|
||||||
@ -10,13 +10,13 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include <GL/gl.h>
|
#include <GL/gl.h>
|
||||||
#if defined(WIN32) || defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
# include <GL/glu.h>
|
# include <GL/glu.h>
|
||||||
#elif defined(__linux__)
|
#elif defined(__linux__)
|
||||||
# include <GL/glx.h>
|
# include <GL/glx.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(WIN32) || defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
# define WINCLASS "WinAppWnd"
|
# define WINCLASS "WinAppWnd"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -78,21 +78,21 @@ public:
|
|||||||
m_width = width;
|
m_width = width;
|
||||||
m_height = height;
|
m_height = height;
|
||||||
m_window_name = window_name;
|
m_window_name = window_name;
|
||||||
#if defined(WIN32) || defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
m_hInstance = ::GetModuleHandle(NULL);
|
m_hInstance = ::GetModuleHandle(NULL);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual ~WinApp()
|
virtual ~WinApp()
|
||||||
{
|
{
|
||||||
#if defined(WIN32) || defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
::UnregisterClass(WINCLASS, m_hInstance);
|
::UnregisterClass(WINCLASS, m_hInstance);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
int create()
|
int create()
|
||||||
{
|
{
|
||||||
#if defined(WIN32) || defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
WNDCLASSEX wcex;
|
WNDCLASSEX wcex;
|
||||||
|
|
||||||
wcex.cbSize = sizeof(WNDCLASSEX);
|
wcex.cbSize = sizeof(WNDCLASSEX);
|
||||||
@ -166,7 +166,7 @@ public:
|
|||||||
|
|
||||||
virtual void cleanup()
|
virtual void cleanup()
|
||||||
{
|
{
|
||||||
#if defined(WIN32) || defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
::DestroyWindow(m_hWnd);
|
::DestroyWindow(m_hWnd);
|
||||||
#elif defined(__linux__)
|
#elif defined(__linux__)
|
||||||
XDestroyWindow(m_display, m_window);
|
XDestroyWindow(m_display, m_window);
|
||||||
@ -174,13 +174,13 @@ public:
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(WIN32) || defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
virtual LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) = 0;
|
virtual LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int run()
|
int run()
|
||||||
{
|
{
|
||||||
#if defined(WIN32) || defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
MSG msg;
|
MSG msg;
|
||||||
|
|
||||||
::ZeroMemory(&msg, sizeof(msg));
|
::ZeroMemory(&msg, sizeof(msg));
|
||||||
@ -217,7 +217,7 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
#if defined(WIN32) || defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
static LRESULT CALLBACK StaticWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
static LRESULT CALLBACK StaticWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
WinApp* pWnd;
|
WinApp* pWnd;
|
||||||
@ -252,7 +252,7 @@ protected:
|
|||||||
|
|
||||||
virtual void idle() = 0;
|
virtual void idle() = 0;
|
||||||
|
|
||||||
#if defined(WIN32) || defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
HINSTANCE m_hInstance;
|
HINSTANCE m_hInstance;
|
||||||
HWND m_hWnd;
|
HWND m_hWnd;
|
||||||
#elif defined(__linux__)
|
#elif defined(__linux__)
|
||||||
|
Loading…
Reference in New Issue
Block a user