From 9097ccf515b8a92ad39808d01d9ee55f5a4985d3 Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Sun, 9 Sep 2018 21:46:46 +0000 Subject: [PATCH] drop legacy headers --- apps/traincascade/boost.cpp | 1 - cmake/OpenCVGenConfig.cmake | 4 +- include/CMakeLists.txt | 4 - include/opencv/cv.h | 73 --- include/opencv/cv.hpp | 60 -- include/opencv/cvaux.h | 57 -- include/opencv/cvaux.hpp | 52 -- include/opencv/cvwimage.h | 46 -- include/opencv/cxcore.h | 52 -- include/opencv/cxcore.hpp | 53 -- include/opencv/cxeigen.hpp | 48 -- include/opencv/cxmisc.h | 8 - include/opencv/highgui.h | 48 -- include/opencv/ml.h | 47 -- .../core/include/opencv2/core/ippasync.hpp | 195 ------ modules/core/include/opencv2/core/wimage.hpp | 603 ------------------ 16 files changed, 2 insertions(+), 1349 deletions(-) delete mode 100644 include/opencv/cv.h delete mode 100644 include/opencv/cv.hpp delete mode 100644 include/opencv/cvaux.h delete mode 100644 include/opencv/cvaux.hpp delete mode 100644 include/opencv/cvwimage.h delete mode 100644 include/opencv/cxcore.h delete mode 100644 include/opencv/cxcore.hpp delete mode 100644 include/opencv/cxeigen.hpp delete mode 100644 include/opencv/cxmisc.h delete mode 100644 include/opencv/highgui.h delete mode 100644 include/opencv/ml.h delete mode 100644 modules/core/include/opencv2/core/ippasync.hpp delete mode 100644 modules/core/include/opencv2/core/wimage.hpp diff --git a/apps/traincascade/boost.cpp b/apps/traincascade/boost.cpp index f05229be5c..ee0486ec90 100644 --- a/apps/traincascade/boost.cpp +++ b/apps/traincascade/boost.cpp @@ -30,7 +30,6 @@ using cv::ParallelLoopBody; #include "boost.h" #include "cascadeclassifier.h" #include -#include "cxmisc.h" #include "cvconfig.h" diff --git a/cmake/OpenCVGenConfig.cmake b/cmake/OpenCVGenConfig.cmake index b2ca82bad0..d78f649839 100644 --- a/cmake/OpenCVGenConfig.cmake +++ b/cmake/OpenCVGenConfig.cmake @@ -33,7 +33,7 @@ endif() # ------------------------------------------------------------------------------------------- # Part 1/3: ${BIN_DIR}/OpenCVConfig.cmake -> For use *without* "make install" # ------------------------------------------------------------------------------------------- -set(OpenCV_INCLUDE_DIRS_CONFIGCMAKE "\"${OPENCV_CONFIG_FILE_INCLUDE_DIR}\" \"${OpenCV_SOURCE_DIR}/include\" \"${OpenCV_SOURCE_DIR}/include/opencv\"") +set(OpenCV_INCLUDE_DIRS_CONFIGCMAKE "\"${OPENCV_CONFIG_FILE_INCLUDE_DIR}\" \"${OpenCV_SOURCE_DIR}/include\"") foreach(m ${OPENCV_MODULES_BUILD}) if(EXISTS "${OPENCV_MODULE_${m}_LOCATION}/include") @@ -68,7 +68,7 @@ configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/OpenCVConfig-version.cmake. # Part 2/3: ${BIN_DIR}/unix-install/OpenCVConfig.cmake -> For use *with* "make install" # ------------------------------------------------------------------------------------------- file(RELATIVE_PATH OpenCV_INSTALL_PATH_RELATIVE_CONFIGCMAKE "${CMAKE_INSTALL_PREFIX}/${OPENCV_CONFIG_INSTALL_PATH}/" ${CMAKE_INSTALL_PREFIX}) -set(OpenCV_INCLUDE_DIRS_CONFIGCMAKE "\"\${OpenCV_INSTALL_PATH}/${OPENCV_INCLUDE_INSTALL_PATH}\" \"\${OpenCV_INSTALL_PATH}/${OPENCV_INCLUDE_INSTALL_PATH}/opencv\"") +set(OpenCV_INCLUDE_DIRS_CONFIGCMAKE "\"\${OpenCV_INSTALL_PATH}/${OPENCV_INCLUDE_INSTALL_PATH}\"") if(USE_IPPICV) file(RELATIVE_PATH IPPICV_INSTALL_PATH_RELATIVE_CONFIGCMAKE "${CMAKE_INSTALL_PREFIX}" "${IPPICV_INSTALL_PATH}") diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt index b4e48e6fa7..25aa8e5a1f 100644 --- a/include/CMakeLists.txt +++ b/include/CMakeLists.txt @@ -1,7 +1,3 @@ -file(GLOB old_hdrs "opencv/*.h*") -install(FILES ${old_hdrs} - DESTINATION ${OPENCV_INCLUDE_INSTALL_PATH}/opencv - COMPONENT dev) install(FILES "opencv2/opencv.hpp" DESTINATION ${OPENCV_INCLUDE_INSTALL_PATH}/opencv2 COMPONENT dev) diff --git a/include/opencv/cv.h b/include/opencv/cv.h deleted file mode 100644 index 19a74e297c..0000000000 --- a/include/opencv/cv.h +++ /dev/null @@ -1,73 +0,0 @@ -/*M/////////////////////////////////////////////////////////////////////////////////////// -// -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// -// By downloading, copying, installing or using the software you agree to this license. -// If you do not agree to this license, do not download, install, -// copy or use the software. -// -// -// License Agreement -// For Open Source Computer Vision Library -// -// Copyright (C) 2000-2008, Intel Corporation, all rights reserved. -// Copyright (C) 2009, Willow Garage Inc., all rights reserved. -// Third party copyrights are property of their respective owners. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistribution's of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution's in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * The name of the copyright holders may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// This software is provided by the copyright holders and contributors "as is" and -// any express or implied warranties, including, but not limited to, the implied -// warranties of merchantability and fitness for a particular purpose are disclaimed. -// In no event shall the Intel Corporation or contributors be liable for any direct, -// indirect, incidental, special, exemplary, or consequential damages -// (including, but not limited to, procurement of substitute goods or services; -// loss of use, data, or profits; or business interruption) however caused -// and on any theory of liability, whether in contract, strict liability, -// or tort (including negligence or otherwise) arising in any way out of -// the use of this software, even if advised of the possibility of such damage. -// -//M*/ - -#ifndef OPENCV_OLD_CV_H -#define OPENCV_OLD_CV_H - -#if defined(_MSC_VER) - #define CV_DO_PRAGMA(x) __pragma(x) - #define __CVSTR2__(x) #x - #define __CVSTR1__(x) __CVSTR2__(x) - #define __CVMSVCLOC__ __FILE__ "("__CVSTR1__(__LINE__)") : " - #define CV_MSG_PRAGMA(_msg) CV_DO_PRAGMA(message (__CVMSVCLOC__ _msg)) -#elif defined(__GNUC__) - #define CV_DO_PRAGMA(x) _Pragma (#x) - #define CV_MSG_PRAGMA(_msg) CV_DO_PRAGMA(message (_msg)) -#else - #define CV_DO_PRAGMA(x) - #define CV_MSG_PRAGMA(_msg) -#endif -#define CV_WARNING(x) CV_MSG_PRAGMA("Warning: " #x) - -//CV_WARNING("This is a deprecated opencv header provided for compatibility. Please include a header from a corresponding opencv module") - -#include "opencv2/core/core_c.h" -#include "opencv2/imgproc/imgproc_c.h" -#include "opencv2/photo/photo_c.h" -#include "opencv2/video/tracking_c.h" -#include "opencv2/objdetect/objdetect_c.h" - -#if !defined(CV_IMPL) -#define CV_IMPL extern "C" -#endif //CV_IMPL - -#endif // __OPENCV_OLD_CV_H_ diff --git a/include/opencv/cv.hpp b/include/opencv/cv.hpp deleted file mode 100644 index 867395644b..0000000000 --- a/include/opencv/cv.hpp +++ /dev/null @@ -1,60 +0,0 @@ -/*M/////////////////////////////////////////////////////////////////////////////////////// -// -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// -// By downloading, copying, installing or using the software you agree to this license. -// If you do not agree to this license, do not download, install, -// copy or use the software. -// -// -// License Agreement -// For Open Source Computer Vision Library -// -// Copyright (C) 2000-2008, Intel Corporation, all rights reserved. -// Copyright (C) 2009, Willow Garage Inc., all rights reserved. -// Third party copyrights are property of their respective owners. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistribution's of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution's in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * The name of the copyright holders may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// This software is provided by the copyright holders and contributors "as is" and -// any express or implied warranties, including, but not limited to, the implied -// warranties of merchantability and fitness for a particular purpose are disclaimed. -// In no event shall the Intel Corporation or contributors be liable for any direct, -// indirect, incidental, special, exemplary, or consequential damages -// (including, but not limited to, procurement of substitute goods or services; -// loss of use, data, or profits; or business interruption) however caused -// and on any theory of liability, whether in contract, strict liability, -// or tort (including negligence or otherwise) arising in any way out of -// the use of this software, even if advised of the possibility of such damage. -// -//M*/ - -#ifndef OPENCV_OLD_CV_HPP -#define OPENCV_OLD_CV_HPP - -//#if defined(__GNUC__) -//#warning "This is a deprecated opencv header provided for compatibility. Please include a header from a corresponding opencv module" -//#endif - -#include "cv.h" -#include "opencv2/core.hpp" -#include "opencv2/imgproc.hpp" -#include "opencv2/photo.hpp" -#include "opencv2/video.hpp" -#include "opencv2/highgui.hpp" -#include "opencv2/features2d.hpp" -#include "opencv2/calib3d.hpp" -#include "opencv2/objdetect.hpp" - -#endif diff --git a/include/opencv/cvaux.h b/include/opencv/cvaux.h deleted file mode 100644 index c0367cc25b..0000000000 --- a/include/opencv/cvaux.h +++ /dev/null @@ -1,57 +0,0 @@ -/*M/////////////////////////////////////////////////////////////////////////////////////// -// -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// -// By downloading, copying, installing or using the software you agree to this license. -// If you do not agree to this license, do not download, install, -// copy or use the software. -// -// -// Intel License Agreement -// For Open Source Computer Vision Library -// -// Copyright (C) 2000, Intel Corporation, all rights reserved. -// Third party copyrights are property of their respective owners. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistribution's of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution's in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * The name of Intel Corporation may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// This software is provided by the copyright holders and contributors "as is" and -// any express or implied warranties, including, but not limited to, the implied -// warranties of merchantability and fitness for a particular purpose are disclaimed. -// In no event shall the Intel Corporation or contributors be liable for any direct, -// indirect, incidental, special, exemplary, or consequential damages -// (including, but not limited to, procurement of substitute goods or services; -// loss of use, data, or profits; or business interruption) however caused -// and on any theory of liability, whether in contract, strict liability, -// or tort (including negligence or otherwise) arising in any way out of -// the use of this software, even if advised of the possibility of such damage. -// -//M*/ - -#ifndef OPENCV_OLD_AUX_H -#define OPENCV_OLD_AUX_H - -//#if defined(__GNUC__) -//#warning "This is a deprecated opencv header provided for compatibility. Please include a header from a corresponding opencv module" -//#endif - -#include "opencv2/core/core_c.h" -#include "opencv2/imgproc/imgproc_c.h" -#include "opencv2/photo/photo_c.h" -#include "opencv2/video/tracking_c.h" -#include "opencv2/objdetect/objdetect_c.h" - -#endif - -/* End of file. */ diff --git a/include/opencv/cvaux.hpp b/include/opencv/cvaux.hpp deleted file mode 100644 index 4888eef282..0000000000 --- a/include/opencv/cvaux.hpp +++ /dev/null @@ -1,52 +0,0 @@ -/*M/////////////////////////////////////////////////////////////////////////////////////// -// -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// -// By downloading, copying, installing or using the software you agree to this license. -// If you do not agree to this license, do not download, install, -// copy or use the software. -// -// -// Intel License Agreement -// For Open Source Computer Vision Library -// -// Copyright (C) 2000, Intel Corporation, all rights reserved. -// Third party copyrights are property of their respective owners. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistribution's of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution's in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * The name of Intel Corporation may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// This software is provided by the copyright holders and contributors "as is" and -// any express or implied warranties, including, but not limited to, the implied -// warranties of merchantability and fitness for a particular purpose are disclaimed. -// In no event shall the Intel Corporation or contributors be liable for any direct, -// indirect, incidental, special, exemplary, or consequential damages -// (including, but not limited to, procurement of substitute goods or services; -// loss of use, data, or profits; or business interruption) however caused -// and on any theory of liability, whether in contract, strict liability, -// or tort (including negligence or otherwise) arising in any way out of -// the use of this software, even if advised of the possibility of such damage. -// -//M*/ - -#ifndef OPENCV_OLD_AUX_HPP -#define OPENCV_OLD_AUX_HPP - -//#if defined(__GNUC__) -//#warning "This is a deprecated opencv header provided for compatibility. Please include a header from a corresponding opencv module" -//#endif - -#include "cvaux.h" -#include "opencv2/core/utility.hpp" - -#endif diff --git a/include/opencv/cvwimage.h b/include/opencv/cvwimage.h deleted file mode 100644 index ec0ab141d9..0000000000 --- a/include/opencv/cvwimage.h +++ /dev/null @@ -1,46 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// -// By downloading, copying, installing or using the software you agree to -// this license. If you do not agree to this license, do not download, -// install, copy or use the software. -// -// License Agreement -// For Open Source Computer Vision Library -// -// Copyright (C) 2008, Google, all rights reserved. -// Third party copyrights are property of their respective owners. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// * Redistribution's of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution's in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * The name of Intel Corporation or contributors may not be used to endorse -// or promote products derived from this software without specific -// prior written permission. -// -// This software is provided by the copyright holders and contributors "as is" -// and any express or implied warranties, including, but not limited to, the -// implied warranties of merchantability and fitness for a particular purpose -// are disclaimed. In no event shall the Intel Corporation or contributors be -// liable for any direct, indirect, incidental, special, exemplary, or -// consequential damages -// (including, but not limited to, procurement of substitute goods or services; -// loss of use, data, or profits; or business interruption) however caused -// and on any theory of liability, whether in contract, strict liability, -// or tort (including negligence or otherwise) arising in any way out of -// the use of this software, even if advised of the possibility of such damage. - - -#ifndef OPENCV_OLD_WIMAGE_HPP -#define OPENCV_OLD_WIMAGE_HPP - -#include "opencv2/core/wimage.hpp" - -#endif diff --git a/include/opencv/cxcore.h b/include/opencv/cxcore.h deleted file mode 100644 index dc070c77d2..0000000000 --- a/include/opencv/cxcore.h +++ /dev/null @@ -1,52 +0,0 @@ -/*M/////////////////////////////////////////////////////////////////////////////////////// -// -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// -// By downloading, copying, installing or using the software you agree to this license. -// If you do not agree to this license, do not download, install, -// copy or use the software. -// -// -// License Agreement -// For Open Source Computer Vision Library -// -// Copyright (C) 2000-2008, Intel Corporation, all rights reserved. -// Copyright (C) 2009, Willow Garage Inc., all rights reserved. -// Third party copyrights are property of their respective owners. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistribution's of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution's in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * The name of the copyright holders may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// This software is provided by the copyright holders and contributors "as is" and -// any express or implied warranties, including, but not limited to, the implied -// warranties of merchantability and fitness for a particular purpose are disclaimed. -// In no event shall the Intel Corporation or contributors be liable for any direct, -// indirect, incidental, special, exemplary, or consequential damages -// (including, but not limited to, procurement of substitute goods or services; -// loss of use, data, or profits; or business interruption) however caused -// and on any theory of liability, whether in contract, strict liability, -// or tort (including negligence or otherwise) arising in any way out of -// the use of this software, even if advised of the possibility of such damage. -// -//M*/ - -#ifndef OPENCV_OLD_CXCORE_H -#define OPENCV_OLD_CXCORE_H - -//#if defined(__GNUC__) -//#warning "This is a deprecated opencv header provided for compatibility. Please include a header from a corresponding opencv module" -//#endif - -#include "opencv2/core/core_c.h" - -#endif diff --git a/include/opencv/cxcore.hpp b/include/opencv/cxcore.hpp deleted file mode 100644 index c371677c93..0000000000 --- a/include/opencv/cxcore.hpp +++ /dev/null @@ -1,53 +0,0 @@ -/*M/////////////////////////////////////////////////////////////////////////////////////// -// -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// -// By downloading, copying, installing or using the software you agree to this license. -// If you do not agree to this license, do not download, install, -// copy or use the software. -// -// -// License Agreement -// For Open Source Computer Vision Library -// -// Copyright (C) 2000-2008, Intel Corporation, all rights reserved. -// Copyright (C) 2009, Willow Garage Inc., all rights reserved. -// Third party copyrights are property of their respective owners. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistribution's of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution's in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * The name of the copyright holders may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// This software is provided by the copyright holders and contributors "as is" and -// any express or implied warranties, including, but not limited to, the implied -// warranties of merchantability and fitness for a particular purpose are disclaimed. -// In no event shall the Intel Corporation or contributors be liable for any direct, -// indirect, incidental, special, exemplary, or consequential damages -// (including, but not limited to, procurement of substitute goods or services; -// loss of use, data, or profits; or business interruption) however caused -// and on any theory of liability, whether in contract, strict liability, -// or tort (including negligence or otherwise) arising in any way out of -// the use of this software, even if advised of the possibility of such damage. -// -//M*/ - -#ifndef OPENCV_OLD_CXCORE_HPP -#define OPENCV_OLD_CXCORE_HPP - -//#if defined(__GNUC__) -//#warning "This is a deprecated opencv header provided for compatibility. Please include a header from a corresponding opencv module" -//#endif - -#include "cxcore.h" -#include "opencv2/core.hpp" - -#endif diff --git a/include/opencv/cxeigen.hpp b/include/opencv/cxeigen.hpp deleted file mode 100644 index 1d3df914ac..0000000000 --- a/include/opencv/cxeigen.hpp +++ /dev/null @@ -1,48 +0,0 @@ -/*M/////////////////////////////////////////////////////////////////////////////////////// -// -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// -// By downloading, copying, installing or using the software you agree to this license. -// If you do not agree to this license, do not download, install, -// copy or use the software. -// -// -// License Agreement -// For Open Source Computer Vision Library -// -// Copyright (C) 2000-2008, Intel Corporation, all rights reserved. -// Copyright (C) 2009, Willow Garage Inc., all rights reserved. -// Third party copyrights are property of their respective owners. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistribution's of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution's in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * The name of the copyright holders may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// This software is provided by the copyright holders and contributors "as is" and -// any express or implied warranties, including, but not limited to, the implied -// warranties of merchantability and fitness for a particular purpose are disclaimed. -// In no event shall the Intel Corporation or contributors be liable for any direct, -// indirect, incidental, special, exemplary, or consequential damages -// (including, but not limited to, procurement of substitute goods or services; -// loss of use, data, or profits; or business interruption) however caused -// and on any theory of liability, whether in contract, strict liability, -// or tort (including negligence or otherwise) arising in any way out of -// the use of this software, even if advised of the possibility of such damage. -// -//M*/ - -#ifndef OPENCV_OLD_EIGEN_HPP -#define OPENCV_OLD_EIGEN_HPP - -#include "opencv2/core/eigen.hpp" - -#endif diff --git a/include/opencv/cxmisc.h b/include/opencv/cxmisc.h deleted file mode 100644 index 9b9bc8204b..0000000000 --- a/include/opencv/cxmisc.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef OPENCV_OLD_CXMISC_H -#define OPENCV_OLD_CXMISC_H - -#ifdef __cplusplus -# include "opencv2/core/utility.hpp" -#endif - -#endif diff --git a/include/opencv/highgui.h b/include/opencv/highgui.h deleted file mode 100644 index 69b394e08a..0000000000 --- a/include/opencv/highgui.h +++ /dev/null @@ -1,48 +0,0 @@ -/*M/////////////////////////////////////////////////////////////////////////////////////// -// -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// -// By downloading, copying, installing or using the software you agree to this license. -// If you do not agree to this license, do not download, install, -// copy or use the software. -// -// -// Intel License Agreement -// For Open Source Computer Vision Library -// -// Copyright (C) 2000, Intel Corporation, all rights reserved. -// Third party copyrights are property of their respective owners. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistribution's of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution's in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * The name of Intel Corporation may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// This software is provided by the copyright holders and contributors "as is" and -// any express or implied warranties, including, but not limited to, the implied -// warranties of merchantability and fitness for a particular purpose are disclaimed. -// In no event shall the Intel Corporation or contributors be liable for any direct, -// indirect, incidental, special, exemplary, or consequential damages -// (including, but not limited to, procurement of substitute goods or services; -// loss of use, data, or profits; or business interruption) however caused -// and on any theory of liability, whether in contract, strict liability, -// or tort (including negligence or otherwise) arising in any way out of -// the use of this software, even if advised of the possibility of such damage. -// -//M*/ - -#ifndef OPENCV_OLD_HIGHGUI_H -#define OPENCV_OLD_HIGHGUI_H - -#include "opencv2/core/core_c.h" -#include "opencv2/highgui/highgui_c.h" - -#endif diff --git a/include/opencv/ml.h b/include/opencv/ml.h deleted file mode 100644 index 0c376bacb9..0000000000 --- a/include/opencv/ml.h +++ /dev/null @@ -1,47 +0,0 @@ -/*M/////////////////////////////////////////////////////////////////////////////////////// -// -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// -// By downloading, copying, installing or using the software you agree to this license. -// If you do not agree to this license, do not download, install, -// copy or use the software. -// -// -// Intel License Agreement -// -// Copyright (C) 2000, Intel Corporation, all rights reserved. -// Third party copyrights are property of their respective owners. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistribution's of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution's in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * The name of Intel Corporation may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// This software is provided by the copyright holders and contributors "as is" and -// any express or implied warranties, including, but not limited to, the implied -// warranties of merchantability and fitness for a particular purpose are disclaimed. -// In no event shall the Intel Corporation or contributors be liable for any direct, -// indirect, incidental, special, exemplary, or consequential damages -// (including, but not limited to, procurement of substitute goods or services; -// loss of use, data, or profits; or business interruption) however caused -// and on any theory of liability, whether in contract, strict liability, -// or tort (including negligence or otherwise) arising in any way out of -// the use of this software, even if advised of the possibility of such damage. -// -//M*/ - -#ifndef OPENCV_OLD_ML_H -#define OPENCV_OLD_ML_H - -#include "opencv2/core/core_c.h" -#include "opencv2/ml.hpp" - -#endif diff --git a/modules/core/include/opencv2/core/ippasync.hpp b/modules/core/include/opencv2/core/ippasync.hpp deleted file mode 100644 index c35d8d81a1..0000000000 --- a/modules/core/include/opencv2/core/ippasync.hpp +++ /dev/null @@ -1,195 +0,0 @@ -/*M/////////////////////////////////////////////////////////////////////////////////////// -// -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// -// By downloading, copying, installing or using the software you agree to this license. -// If you do not agree to this license, do not download, install, -// copy or use the software. -// -// -// License Agreement -// For Open Source Computer Vision Library -// -// Copyright (C) 2000-2015, Intel Corporation, all rights reserved. -// Copyright (C) 2009, Willow Garage Inc., all rights reserved. -// Copyright (C) 2013, OpenCV Foundation, all rights reserved. -// Copyright (C) 2015, Itseez Inc., all rights reserved. -// Third party copyrights are property of their respective owners. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistribution's of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution's in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * The name of the copyright holders may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// This software is provided by the copyright holders and contributors "as is" and -// any express or implied warranties, including, but not limited to, the implied -// warranties of merchantability and fitness for a particular purpose are disclaimed. -// In no event shall the Intel Corporation or contributors be liable for any direct, -// indirect, incidental, special, exemplary, or consequential damages -// (including, but not limited to, procurement of substitute goods or services; -// loss of use, data, or profits; or business interruption) however caused -// and on any theory of liability, whether in contract, strict liability, -// or tort (including negligence or otherwise) arising in any way out of -// the use of this software, even if advised of the possibility of such damage. -// -//M*/ - -#ifndef OPENCV_CORE_IPPASYNC_HPP -#define OPENCV_CORE_IPPASYNC_HPP - -#ifdef HAVE_IPP_A // this file will be removed in OpenCV 4.0 - -#include "opencv2/core.hpp" -#include -#include - -namespace cv -{ - -namespace hpp -{ - -/** @addtogroup core_ipp -This section describes conversion between OpenCV and [Intel® IPP Asynchronous -C/C++](http://software.intel.com/en-us/intel-ipp-preview) library. [Getting Started -Guide](http://registrationcenter.intel.com/irc_nas/3727/ipp_async_get_started.htm) help you to -install the library, configure header and library build paths. - */ -//! @{ - - //! convert OpenCV data type to hppDataType - inline int toHppType(const int cvType) - { - int depth = CV_MAT_DEPTH(cvType); - int hppType = depth == CV_8U ? HPP_DATA_TYPE_8U : - depth == CV_16U ? HPP_DATA_TYPE_16U : - depth == CV_16S ? HPP_DATA_TYPE_16S : - depth == CV_32S ? HPP_DATA_TYPE_32S : - depth == CV_32F ? HPP_DATA_TYPE_32F : - depth == CV_64F ? HPP_DATA_TYPE_64F : -1; - CV_Assert( hppType >= 0 ); - return hppType; - } - - //! convert hppDataType to OpenCV data type - inline int toCvType(const int hppType) - { - int cvType = hppType == HPP_DATA_TYPE_8U ? CV_8U : - hppType == HPP_DATA_TYPE_16U ? CV_16U : - hppType == HPP_DATA_TYPE_16S ? CV_16S : - hppType == HPP_DATA_TYPE_32S ? CV_32S : - hppType == HPP_DATA_TYPE_32F ? CV_32F : - hppType == HPP_DATA_TYPE_64F ? CV_64F : -1; - CV_Assert( cvType >= 0 ); - return cvType; - } - - /** @brief Convert hppiMatrix to Mat. - - This function allocates and initializes new matrix (if needed) that has the same size and type as - input matrix. Supports CV_8U, CV_16U, CV_16S, CV_32S, CV_32F, CV_64F. - @param src input hppiMatrix. - @param dst output matrix. - @param accel accelerator instance (see hpp::getHpp for the list of acceleration framework types). - @param cn number of channels. - */ - inline void copyHppToMat(hppiMatrix* src, Mat& dst, hppAccel accel, int cn) - { - hppDataType type; - hpp32u width, height; - hppStatus sts; - - if (src == NULL) - return dst.release(); - - sts = hppiInquireMatrix(src, &type, &width, &height); - - CV_Assert( sts == HPP_STATUS_NO_ERROR); - - int matType = CV_MAKETYPE(toCvType(type), cn); - - CV_Assert(width%cn == 0); - - width /= cn; - - dst.create((int)height, (int)width, (int)matType); - - size_t newSize = (size_t)(height*(hpp32u)(dst.step)); - - sts = hppiGetMatrixData(accel,src,(hpp32u)(dst.step),dst.data,&newSize); - - CV_Assert( sts == HPP_STATUS_NO_ERROR); - } - - /** @brief Create Mat from hppiMatrix. - - This function allocates and initializes the Mat that has the same size and type as input matrix. - Supports CV_8U, CV_16U, CV_16S, CV_32S, CV_32F, CV_64F. - @param src input hppiMatrix. - @param accel accelerator instance (see hpp::getHpp for the list of acceleration framework types). - @param cn number of channels. - @sa howToUseIPPAconversion, hpp::copyHppToMat, hpp::getHpp. - */ - inline Mat getMat(hppiMatrix* src, hppAccel accel, int cn) - { - Mat dst; - copyHppToMat(src, dst, accel, cn); - return dst; - } - - /** @brief Create hppiMatrix from Mat. - - This function allocates and initializes the hppiMatrix that has the same size and type as input - matrix, returns the hppiMatrix*. - - If you want to use zero-copy for GPU you should to have 4KB aligned matrix data. See details - [hppiCreateSharedMatrix](http://software.intel.com/ru-ru/node/501697). - - Supports CV_8U, CV_16U, CV_16S, CV_32S, CV_32F, CV_64F. - - @note The hppiMatrix pointer to the image buffer in system memory refers to the src.data. Control - the lifetime of the matrix and don't change its data, if there is no special need. - @param src input matrix. - @param accel accelerator instance. Supports type: - - **HPP_ACCEL_TYPE_CPU** - accelerated by optimized CPU instructions. - - **HPP_ACCEL_TYPE_GPU** - accelerated by GPU programmable units or fixed-function - accelerators. - - **HPP_ACCEL_TYPE_ANY** - any acceleration or no acceleration available. - @sa howToUseIPPAconversion, hpp::getMat - */ - inline hppiMatrix* getHpp(const Mat& src, hppAccel accel) - { - int htype = toHppType(src.type()); - int cn = src.channels(); - - CV_Assert(src.data); - hppAccelType accelType = hppQueryAccelType(accel); - - if (accelType!=HPP_ACCEL_TYPE_CPU) - { - hpp32u pitch, size; - hppQueryMatrixAllocParams(accel, src.cols*cn, src.rows, htype, &pitch, &size); - if (pitch!=0 && size!=0) - if ((int)(src.data)%4096==0 && pitch==(hpp32u)(src.step)) - { - return hppiCreateSharedMatrix(htype, src.cols*cn, src.rows, src.data, pitch, size); - } - } - - return hppiCreateMatrix(htype, src.cols*cn, src.rows, src.data, (hpp32s)(src.step));; - } - -//! @} -}} - -#endif - -#endif diff --git a/modules/core/include/opencv2/core/wimage.hpp b/modules/core/include/opencv2/core/wimage.hpp deleted file mode 100644 index c7b6efa06a..0000000000 --- a/modules/core/include/opencv2/core/wimage.hpp +++ /dev/null @@ -1,603 +0,0 @@ -/*M////////////////////////////////////////////////////////////////////////////// -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// -// By downloading, copying, installing or using the software you agree to -// this license. If you do not agree to this license, do not download, -// install, copy or use the software. -// -// License Agreement -// For Open Source Computer Vision Library -// -// Copyright (C) 2008, Google, all rights reserved. -// Third party copyrights are property of their respective owners. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// * Redistribution's of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution's in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * The name of Intel Corporation or contributors may not be used to endorse -// or promote products derived from this software without specific -// prior written permission. -// -// This software is provided by the copyright holders and contributors "as is" -// and any express or implied warranties, including, but not limited to, the -// implied warranties of merchantability and fitness for a particular purpose -// are disclaimed. In no event shall the Intel Corporation or contributors be -// liable for any direct, indirect, incidental, special, exemplary, or -// consequential damages -// (including, but not limited to, procurement of substitute goods or services; -// loss of use, data, or profits; or business interruption) however caused -// and on any theory of liability, whether in contract, strict liability, -// or tort (including negligence or otherwise) arising in any way out of -// the use of this software, even if advised of the possibility of such damage. -///////////////////////////////////////////////////////////////////////////////// -//M*/ - -#ifndef OPENCV_CORE_WIMAGE_HPP -#define OPENCV_CORE_WIMAGE_HPP - -#include "opencv2/core/core_c.h" - -#ifdef __cplusplus - -namespace cv { - -//! @addtogroup core -//! @{ - -template class WImage; -template class WImageBuffer; -template class WImageView; - -template class WImageC; -template class WImageBufferC; -template class WImageViewC; - -// Commonly used typedefs. -typedef WImage WImage_b; -typedef WImageView WImageView_b; -typedef WImageBuffer WImageBuffer_b; - -typedef WImageC WImage1_b; -typedef WImageViewC WImageView1_b; -typedef WImageBufferC WImageBuffer1_b; - -typedef WImageC WImage3_b; -typedef WImageViewC WImageView3_b; -typedef WImageBufferC WImageBuffer3_b; - -typedef WImage WImage_f; -typedef WImageView WImageView_f; -typedef WImageBuffer WImageBuffer_f; - -typedef WImageC WImage1_f; -typedef WImageViewC WImageView1_f; -typedef WImageBufferC WImageBuffer1_f; - -typedef WImageC WImage3_f; -typedef WImageViewC WImageView3_f; -typedef WImageBufferC WImageBuffer3_f; - -// There isn't a standard for signed and unsigned short so be more -// explicit in the typename for these cases. -typedef WImage WImage_16s; -typedef WImageView WImageView_16s; -typedef WImageBuffer WImageBuffer_16s; - -typedef WImageC WImage1_16s; -typedef WImageViewC WImageView1_16s; -typedef WImageBufferC WImageBuffer1_16s; - -typedef WImageC WImage3_16s; -typedef WImageViewC WImageView3_16s; -typedef WImageBufferC WImageBuffer3_16s; - -typedef WImage WImage_16u; -typedef WImageView WImageView_16u; -typedef WImageBuffer WImageBuffer_16u; - -typedef WImageC WImage1_16u; -typedef WImageViewC WImageView1_16u; -typedef WImageBufferC WImageBuffer1_16u; - -typedef WImageC WImage3_16u; -typedef WImageViewC WImageView3_16u; -typedef WImageBufferC WImageBuffer3_16u; - -/** @brief Image class which provides a thin layer around an IplImage. - -The goals of the class design are: - - -# All the data has explicit ownership to avoid memory leaks - -# No hidden allocations or copies for performance. - -# Easy access to OpenCV methods (which will access IPP if available) - -# Can easily treat external data as an image - -# Easy to create images which are subsets of other images - -# Fast pixel access which can take advantage of number of channels if known at compile time. - -The WImage class is the image class which provides the data accessors. The 'W' comes from the fact -that it is also a wrapper around the popular but inconvenient IplImage class. A WImage can be -constructed either using a WImageBuffer class which allocates and frees the data, or using a -WImageView class which constructs a subimage or a view into external data. The view class does no -memory management. Each class actually has two versions, one when the number of channels is known -at compile time and one when it isn't. Using the one with the number of channels specified can -provide some compile time optimizations by using the fact that the number of channels is a -constant. - -We use the convention (c,r) to refer to column c and row r with (0,0) being the upper left corner. -This is similar to standard Euclidean coordinates with the first coordinate varying in the -horizontal direction and the second coordinate varying in the vertical direction. Thus (c,r) is -usually in the domain [0, width) X [0, height) - -Example usage: -@code -WImageBuffer3_b im(5,7); // Make a 5X7 3 channel image of type uchar -WImageView3_b sub_im(im, 2,2, 3,3); // 3X3 submatrix -vector vec(10, 3.0f); -WImageView1_f user_im(&vec[0], 2, 5); // 2X5 image w/ supplied data - -im.SetZero(); // same as cvSetZero(im.Ipl()) -*im(2, 3) = 15; // Modify the element at column 2, row 3 -MySetRand(&sub_im); - -// Copy the second row into the first. This can be done with no memory -// allocation and will use SSE if IPP is available. -int w = im.Width(); -im.View(0,0, w,1).CopyFrom(im.View(0,1, w,1)); - -// Doesn't care about source of data since using WImage -void MySetRand(WImage_b* im) { // Works with any number of channels -for (int r = 0; r < im->Height(); ++r) { - float* row = im->Row(r); - for (int c = 0; c < im->Width(); ++c) { - for (int ch = 0; ch < im->Channels(); ++ch, ++row) { - *row = uchar(rand() & 255); - } - } -} -} -@endcode - -Functions that are not part of the basic image allocation, viewing, and access should come from -OpenCV, except some useful functions that are not part of OpenCV can be found in wimage_util.h -*/ -template -class WImage -{ -public: - typedef T BaseType; - - // WImage is an abstract class with no other virtual methods so make the - // destructor virtual. - virtual ~WImage() = 0; - - // Accessors - IplImage* Ipl() {return image_; } - const IplImage* Ipl() const {return image_; } - T* ImageData() { return reinterpret_cast(image_->imageData); } - const T* ImageData() const { - return reinterpret_cast(image_->imageData); - } - - int Width() const {return image_->width; } - int Height() const {return image_->height; } - - // WidthStep is the number of bytes to go to the pixel with the next y coord - int WidthStep() const {return image_->widthStep; } - - int Channels() const {return image_->nChannels; } - int ChannelSize() const {return sizeof(T); } // number of bytes per channel - - // Number of bytes per pixel - int PixelSize() const {return Channels() * ChannelSize(); } - - // Return depth type (e.g. IPL_DEPTH_8U, IPL_DEPTH_32F) which is the number - // of bits per channel and with the signed bit set. - // This is known at compile time using specializations. - int Depth() const; - - inline const T* Row(int r) const { - return reinterpret_cast(image_->imageData + r*image_->widthStep); - } - - inline T* Row(int r) { - return reinterpret_cast(image_->imageData + r*image_->widthStep); - } - - // Pixel accessors which returns a pointer to the start of the channel - inline T* operator() (int c, int r) { - return reinterpret_cast(image_->imageData + r*image_->widthStep) + - c*Channels(); - } - - inline const T* operator() (int c, int r) const { - return reinterpret_cast(image_->imageData + r*image_->widthStep) + - c*Channels(); - } - - // Copy the contents from another image which is just a convenience to cvCopy - void CopyFrom(const WImage& src) { cvCopy(src.Ipl(), image_); } - - // Set contents to zero which is just a convenient to cvSetZero - void SetZero() { cvSetZero(image_); } - - // Construct a view into a region of this image - WImageView View(int c, int r, int width, int height); - -protected: - // Disallow copy and assignment - WImage(const WImage&); - void operator=(const WImage&); - - explicit WImage(IplImage* img) : image_(img) { - assert(!img || img->depth == Depth()); - } - - void SetIpl(IplImage* image) { - assert(!image || image->depth == Depth()); - image_ = image; - } - - IplImage* image_; -}; - - -/** Image class when both the pixel type and number of channels -are known at compile time. This wrapper will speed up some of the operations -like accessing individual pixels using the () operator. -*/ -template -class WImageC : public WImage -{ -public: - typedef typename WImage::BaseType BaseType; - enum { kChannels = C }; - - explicit WImageC(IplImage* img) : WImage(img) { - assert(!img || img->nChannels == Channels()); - } - - // Construct a view into a region of this image - WImageViewC View(int c, int r, int width, int height); - - // Copy the contents from another image which is just a convenience to cvCopy - void CopyFrom(const WImageC& src) { - cvCopy(src.Ipl(), WImage::image_); - } - - // WImageC is an abstract class with no other virtual methods so make the - // destructor virtual. - virtual ~WImageC() = 0; - - int Channels() const {return C; } - -protected: - // Disallow copy and assignment - WImageC(const WImageC&); - void operator=(const WImageC&); - - void SetIpl(IplImage* image) { - assert(!image || image->depth == WImage::Depth()); - WImage::SetIpl(image); - } -}; - -/** Image class which owns the data, so it can be allocated and is always -freed. It cannot be copied but can be explicitly cloned. -*/ -template -class WImageBuffer : public WImage -{ -public: - typedef typename WImage::BaseType BaseType; - - // Default constructor which creates an object that can be - WImageBuffer() : WImage(0) {} - - WImageBuffer(int width, int height, int nchannels) : WImage(0) { - Allocate(width, height, nchannels); - } - - // Constructor which takes ownership of a given IplImage so releases - // the image on destruction. - explicit WImageBuffer(IplImage* img) : WImage(img) {} - - // Allocate an image. Does nothing if current size is the same as - // the new size. - void Allocate(int width, int height, int nchannels); - - // Set the data to point to an image, releasing the old data - void SetIpl(IplImage* img) { - ReleaseImage(); - WImage::SetIpl(img); - } - - // Clone an image which reallocates the image if of a different dimension. - void CloneFrom(const WImage& src) { - Allocate(src.Width(), src.Height(), src.Channels()); - CopyFrom(src); - } - - ~WImageBuffer() { - ReleaseImage(); - } - - // Release the image if it isn't null. - void ReleaseImage() { - if (WImage::image_) { - IplImage* image = WImage::image_; - cvReleaseImage(&image); - WImage::SetIpl(0); - } - } - - bool IsNull() const {return WImage::image_ == NULL; } - -private: - // Disallow copy and assignment - WImageBuffer(const WImageBuffer&); - void operator=(const WImageBuffer&); -}; - -/** Like a WImageBuffer class but when the number of channels is known at compile time. -*/ -template -class WImageBufferC : public WImageC -{ -public: - typedef typename WImage::BaseType BaseType; - enum { kChannels = C }; - - // Default constructor which creates an object that can be - WImageBufferC() : WImageC(0) {} - - WImageBufferC(int width, int height) : WImageC(0) { - Allocate(width, height); - } - - // Constructor which takes ownership of a given IplImage so releases - // the image on destruction. - explicit WImageBufferC(IplImage* img) : WImageC(img) {} - - // Allocate an image. Does nothing if current size is the same as - // the new size. - void Allocate(int width, int height); - - // Set the data to point to an image, releasing the old data - void SetIpl(IplImage* img) { - ReleaseImage(); - WImageC::SetIpl(img); - } - - // Clone an image which reallocates the image if of a different dimension. - void CloneFrom(const WImageC& src) { - Allocate(src.Width(), src.Height()); - CopyFrom(src); - } - - ~WImageBufferC() { - ReleaseImage(); - } - - // Release the image if it isn't null. - void ReleaseImage() { - if (WImage::image_) { - IplImage* image = WImage::image_; - cvReleaseImage(&image); - WImageC::SetIpl(0); - } - } - - bool IsNull() const {return WImage::image_ == NULL; } - -private: - // Disallow copy and assignment - WImageBufferC(const WImageBufferC&); - void operator=(const WImageBufferC&); -}; - -/** View into an image class which allows treating a subimage as an image or treating external data -as an image -*/ -template class WImageView : public WImage -{ -public: - typedef typename WImage::BaseType BaseType; - - // Construct a subimage. No checks are done that the subimage lies - // completely inside the original image. - WImageView(WImage* img, int c, int r, int width, int height); - - // Refer to external data. - // If not given width_step assumed to be same as width. - WImageView(T* data, int width, int height, int channels, int width_step = -1); - - // Refer to external data. This does NOT take ownership - // of the supplied IplImage. - WImageView(IplImage* img) : WImage(img) {} - - // Copy constructor - WImageView(const WImage& img) : WImage(0) { - header_ = *(img.Ipl()); - WImage::SetIpl(&header_); - } - - WImageView& operator=(const WImage& img) { - header_ = *(img.Ipl()); - WImage::SetIpl(&header_); - return *this; - } - -protected: - IplImage header_; -}; - - -template -class WImageViewC : public WImageC -{ -public: - typedef typename WImage::BaseType BaseType; - enum { kChannels = C }; - - // Default constructor needed for vectors of views. - WImageViewC(); - - virtual ~WImageViewC() {} - - // Construct a subimage. No checks are done that the subimage lies - // completely inside the original image. - WImageViewC(WImageC* img, - int c, int r, int width, int height); - - // Refer to external data - WImageViewC(T* data, int width, int height, int width_step = -1); - - // Refer to external data. This does NOT take ownership - // of the supplied IplImage. - WImageViewC(IplImage* img) : WImageC(img) {} - - // Copy constructor which does a shallow copy to allow multiple views - // of same data. gcc-4.1.1 gets confused if both versions of - // the constructor and assignment operator are not provided. - WImageViewC(const WImageC& img) : WImageC(0) { - header_ = *(img.Ipl()); - WImageC::SetIpl(&header_); - } - WImageViewC(const WImageViewC& img) : WImageC(0) { - header_ = *(img.Ipl()); - WImageC::SetIpl(&header_); - } - - WImageViewC& operator=(const WImageC& img) { - header_ = *(img.Ipl()); - WImageC::SetIpl(&header_); - return *this; - } - WImageViewC& operator=(const WImageViewC& img) { - header_ = *(img.Ipl()); - WImageC::SetIpl(&header_); - return *this; - } - -protected: - IplImage header_; -}; - - -// Specializations for depth -template<> -inline int WImage::Depth() const {return IPL_DEPTH_8U; } -template<> -inline int WImage::Depth() const {return IPL_DEPTH_8S; } -template<> -inline int WImage::Depth() const {return IPL_DEPTH_16S; } -template<> -inline int WImage::Depth() const {return IPL_DEPTH_16U; } -template<> -inline int WImage::Depth() const {return IPL_DEPTH_32S; } -template<> -inline int WImage::Depth() const {return IPL_DEPTH_32F; } -template<> -inline int WImage::Depth() const {return IPL_DEPTH_64F; } - -template inline WImage::~WImage() {} -template inline WImageC::~WImageC() {} - -template -inline void WImageBuffer::Allocate(int width, int height, int nchannels) -{ - if (IsNull() || WImage::Width() != width || - WImage::Height() != height || WImage::Channels() != nchannels) { - ReleaseImage(); - WImage::image_ = cvCreateImage(cvSize(width, height), - WImage::Depth(), nchannels); - } -} - -template -inline void WImageBufferC::Allocate(int width, int height) -{ - if (IsNull() || WImage::Width() != width || WImage::Height() != height) { - ReleaseImage(); - WImageC::SetIpl(cvCreateImage(cvSize(width, height),WImage::Depth(), C)); - } -} - -template -WImageView::WImageView(WImage* img, int c, int r, int width, int height) - : WImage(0) -{ - header_ = *(img->Ipl()); - header_.imageData = reinterpret_cast((*img)(c, r)); - header_.width = width; - header_.height = height; - WImage::SetIpl(&header_); -} - -template -WImageView::WImageView(T* data, int width, int height, int nchannels, int width_step) - : WImage(0) -{ - cvInitImageHeader(&header_, cvSize(width, height), WImage::Depth(), nchannels); - header_.imageData = reinterpret_cast(data); - if (width_step > 0) { - header_.widthStep = width_step; - } - WImage::SetIpl(&header_); -} - -template -WImageViewC::WImageViewC(WImageC* img, int c, int r, int width, int height) - : WImageC(0) -{ - header_ = *(img->Ipl()); - header_.imageData = reinterpret_cast((*img)(c, r)); - header_.width = width; - header_.height = height; - WImageC::SetIpl(&header_); -} - -template -WImageViewC::WImageViewC() : WImageC(0) { - cvInitImageHeader(&header_, cvSize(0, 0), WImage::Depth(), C); - header_.imageData = reinterpret_cast(0); - WImageC::SetIpl(&header_); -} - -template -WImageViewC::WImageViewC(T* data, int width, int height, int width_step) - : WImageC(0) -{ - cvInitImageHeader(&header_, cvSize(width, height), WImage::Depth(), C); - header_.imageData = reinterpret_cast(data); - if (width_step > 0) { - header_.widthStep = width_step; - } - WImageC::SetIpl(&header_); -} - -// Construct a view into a region of an image -template -WImageView WImage::View(int c, int r, int width, int height) { - return WImageView(this, c, r, width, height); -} - -template -WImageViewC WImageC::View(int c, int r, int width, int height) { - return WImageViewC(this, c, r, width, height); -} - -//! @} core - -} // end of namespace - -#endif // __cplusplus - -#endif