├── .gitignore ├── CMakeLists.txt ├── LICENSE ├── README.md ├── VisionCoreConfig.cmake.in ├── include └── VisionCore │ ├── Buffers │ ├── Buffer1D.hpp │ ├── Buffer2D.hpp │ ├── Buffer3D.hpp │ ├── BufferPyramid.hpp │ ├── CUDATexture.hpp │ ├── GPUVariable.hpp │ ├── Image2D.hpp │ ├── ImagePyramid.hpp │ ├── PyramidBase.hpp │ ├── Reductions.hpp │ └── Volume.hpp │ ├── CUDAException.hpp │ ├── CUDAGenerics.hpp │ ├── Control │ ├── PID.hpp │ └── VelocityProfile.hpp │ ├── HelpersAutoDiff.hpp │ ├── HelpersCUDA.hpp │ ├── HelpersEigen.hpp │ ├── HelpersMisc.hpp │ ├── HelpersSophus.hpp │ ├── IO │ ├── File.hpp │ ├── ImageIO.hpp │ └── PLYModel.hpp │ ├── Image │ ├── BufferOps.hpp │ ├── ColorMap.hpp │ ├── ConnectedComponents.hpp │ ├── Filters.hpp │ ├── ImagePatch.hpp │ └── PixelConvert.hpp │ ├── LaunchUtils.hpp │ ├── Math │ ├── Angles.hpp │ ├── Convolution.hpp │ ├── DenavitHartenberg.hpp │ ├── Divergence.hpp │ ├── Fitting.hpp │ ├── Fourier.hpp │ ├── HammingDistance.hpp │ ├── Kalman.hpp │ ├── LeastSquares.hpp │ ├── LiangBarsky.hpp │ ├── LocalParamSE3.hpp │ ├── LossFunctions.hpp │ ├── PolarSpherical.hpp │ ├── RANSAC.hpp │ ├── Random.hpp │ └── Statistics.hpp │ ├── MemoryPolicy.hpp │ ├── MemoryPolicyCUDA.hpp │ ├── MemoryPolicyHost.hpp │ ├── MemoryPolicyOpenCL.hpp │ ├── MemoryPolicyOpenGL.hpp │ ├── Platform.hpp │ ├── TypeTraits.hpp │ ├── Types │ ├── AxisAlignedBoundingBox.hpp │ ├── CostVolumeElement.hpp │ ├── Gaussian.hpp │ ├── Hypersphere.hpp │ ├── Polynomial.hpp │ ├── Rectangle.hpp │ ├── SDF.hpp │ └── SquareUpperTriangularMatrix.hpp │ └── WrapGL │ ├── WrapGL.hpp │ ├── WrapGLBuffer.hpp │ ├── WrapGLCommon.hpp │ ├── WrapGLContext.hpp │ ├── WrapGLFramebuffer.hpp │ ├── WrapGLPixelProcessor.hpp │ ├── WrapGLProgram.hpp │ ├── WrapGLQuery.hpp │ ├── WrapGLSampler.hpp │ ├── WrapGLTexture.hpp │ ├── WrapGLTransformFeedback.hpp │ ├── WrapGLVertexArrayObject.hpp │ ├── WrapGLVertexProcessor.hpp │ └── impl │ ├── WrapGLBuffer_impl.hpp │ ├── WrapGLFramebuffer_impl.hpp │ ├── WrapGLPixelProcessor_impl.hpp │ ├── WrapGLProgram_impl.hpp │ ├── WrapGLQuery_impl.hpp │ ├── WrapGLSampler_impl.hpp │ ├── WrapGLTexture_impl.hpp │ ├── WrapGLTransformFeedback_impl.hpp │ ├── WrapGLVertexArrayObject_impl.hpp │ └── WrapGLVertexProcessor_impl.hpp ├── scripts ├── EigenAlignmentCheck.cpp ├── FindFFTW.cmake └── FindTBB.cmake ├── sources ├── IO │ ├── ImageIO.cpp │ ├── ImageUtilsCPU.cpp │ ├── PLYModel.cpp │ └── SaveBuffer.cpp ├── Image │ ├── BufferOpsCPU.cpp │ ├── BufferOpsGPU.cpp │ ├── ColorMapCPU.cpp │ ├── ColorMapDefs.hpp │ ├── ColorMapGPU.cpp │ ├── ConnectedComponents.cpp │ ├── FiltersCPU.cpp │ ├── FiltersGPU.cpp │ ├── JoinSplitHelpers.hpp │ ├── PixelConvertCPU.cpp │ └── PixelConvertGPU.cpp ├── Math │ ├── ConvolutionCPU.cpp │ ├── ConvolutionGPU.cpp │ ├── FourierCPU.cpp │ ├── FourierGPU.cpp │ └── Random.cpp ├── VisionCore.cpp └── WrapGL │ ├── WrapGLBuffer.cpp │ ├── WrapGLCommon.cpp │ ├── WrapGLFramebuffer.cpp │ ├── context_glut.cpp │ ├── context_windowless.cpp │ └── context_x11.cpp └── tests ├── Buffers ├── BufferTestHelpers.cpp ├── BufferTestHelpers.cu ├── BufferTestHelpers.hpp ├── CMakeLists.txt ├── UT_Buffer1D.cpp ├── UT_Buffer2D.cpp ├── UT_Buffer3D.cpp ├── UT_CUDABuffer1D.cpp ├── UT_CUDABuffer2D.cpp ├── UT_CUDABuffer3D.cpp ├── UT_CUDABuffer3D.cu ├── UT_CUDAPyramid.cpp ├── UT_CUDAPyramid.cu ├── UT_CUDAReductions.cpp ├── UT_CUDAReductions.cu ├── UT_OpenCLBuffer1D.cpp ├── UT_OpenCLBuffer2D.cpp ├── UT_OpenCLBuffer3D.cpp ├── UT_OpenCLImage2D.cpp ├── UT_OpenCLPyramid.cpp ├── UT_Pyramid.cpp └── UT_Reduction2D.cpp ├── CMakeLists.txt ├── Control ├── CMakeLists.txt ├── UT_PID.cpp └── UT_VelocityProfile.cpp ├── EigenConfigCPU.cpp ├── EigenConfigCUDA.cpp ├── EigenConfigCUDA.cu ├── GetEigenConfig.hpp ├── IO ├── CMakeLists.txt └── UT_PLYModel.cpp ├── Image ├── CMakeLists.txt └── UT_ImagePatch.cpp ├── Math ├── CMakeLists.txt ├── UT_CordSystems.cpp ├── UT_DenavitHartenberg.cpp ├── UT_Divergence.cpp ├── UT_Fitting.cpp ├── UT_HammingDistance.cpp ├── UT_Kalman.cpp ├── UT_LeastSquares.cpp ├── UT_LiangBarsky.cpp ├── UT_LocalParamSE3.cpp ├── UT_LossFunctions.cpp ├── UT_PolarSpherical.cpp ├── UT_RANSAC.cpp ├── UT_Random.cpp └── UT_Statistics.cpp ├── Types ├── CMakeLists.txt ├── UT_AxisAlignedBoundingBox.cpp ├── UT_CostVolumeElement.cpp ├── UT_Gaussian.cpp ├── UT_Hypersphere.cpp ├── UT_Polynomial.cpp ├── UT_Rectangle.cpp ├── UT_SDF.cpp └── UT_SquareUpperTriangularMatrix.cpp ├── UT_EigenConfig.cpp ├── UT_OpenCL.cpp ├── UT_Platform.cpp ├── WrapGL ├── CMakeLists.txt └── UT_GLBinding.cpp └── tests_main.cpp /.gitignore: -------------------------------------------------------------------------------- 1 | *.kdev4 2 | obj 3 | obj_release 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016, Robert Lukierski 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | * Neither the name of the copyright holder nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /VisionCoreConfig.cmake.in: -------------------------------------------------------------------------------- 1 | include(CMakeFindDependencyMacro) 2 | 3 | find_dependency(Sophus QUIET) 4 | 5 | if(@USE_GLBINDING@) 6 | find_dependency(glbinding) 7 | find_dependency(globjects) 8 | endif() 9 | 10 | if(@OpenCL_FOUND@) 11 | find_dependency(OpenCL) 12 | endif() 13 | 14 | if(@Vulkan_FOUND@) 15 | find_dependency(Vulkan) 16 | endif() 17 | 18 | if(@cereal_FOUND@) 19 | find_dependency(cereal) 20 | endif() 21 | 22 | if(@GLEW_FOUND@) 23 | find_dependency(GLEW) 24 | endif() 25 | 26 | if(@CUDA_FOUND@) 27 | set(VISIONCORE_CUDA_FLAGS "@CMAKE_CUDA_FLAGS@") 28 | endif() 29 | 30 | if(@EIGEN_GET_ALIGNMENT_OK@) 31 | set(EIGEN_CUDA_MAX_ALIGN_BYTES @EIGEN_IDEAL_MAX_ALIGN_BYTES@) 32 | endif() 33 | 34 | include("${CMAKE_CURRENT_LIST_DIR}/VisionCoreTargets.cmake") 35 | -------------------------------------------------------------------------------- /include/VisionCore/CUDAException.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * **************************************************************************** 3 | * Copyright (c) 2015, Robert Lukierski. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, this 10 | * list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | * this list of conditions and the following disclaimer in the documentation 14 | * and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | * **************************************************************************** 32 | * CUDA Exception. 33 | * **************************************************************************** 34 | */ 35 | 36 | #ifndef VISIONCORE_CUDAEXCEPTION_HPP 37 | #define VISIONCORE_CUDAEXCEPTION_HPP 38 | 39 | #ifdef VISIONCORE_HAVE_CUDA 40 | 41 | // system 42 | #include 43 | #include 44 | #include 45 | 46 | // CUDA 47 | #include 48 | 49 | namespace vc 50 | { 51 | 52 | class CUDAException : public std::exception 53 | { 54 | public: 55 | CUDAException(cudaError err = cudaSuccess, const std::string& what = "") : mWhat(what), mErr(err) 56 | { 57 | std::stringstream ss; 58 | 59 | ss << "CUDAException: " << mWhat << std::endl; 60 | 61 | if(mErr != cudaSuccess) 62 | { 63 | ss << "cudaError code: " << cudaGetErrorString(mErr); 64 | ss << " (" << mErr << ")" << std::endl; 65 | } 66 | 67 | mWhat = ss.str(); 68 | } 69 | 70 | virtual ~CUDAException() throw() {} 71 | 72 | virtual const char* what() const throw() 73 | { 74 | return mWhat.c_str(); 75 | } 76 | 77 | cudaError getError() const { return mErr; } 78 | private: 79 | std::string mWhat; 80 | cudaError mErr; 81 | }; 82 | 83 | } 84 | 85 | #endif // VISIONCORE_HAVE_CUDA 86 | 87 | #endif // VISIONCORE_CUDAEXCEPTION_HPP 88 | -------------------------------------------------------------------------------- /include/VisionCore/Control/PID.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * **************************************************************************** 3 | * Copyright (c) 2015, Robert Lukierski. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, this 10 | * list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | * this list of conditions and the following disclaimer in the documentation 14 | * and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | * **************************************************************************** 32 | * Simple PID controller. 33 | * **************************************************************************** 34 | */ 35 | 36 | #ifndef VISIONCORE_CONTROL_PID_HPP 37 | #define VISIONCORE_CONTROL_PID_HPP 38 | 39 | #include 40 | 41 | namespace vc 42 | { 43 | 44 | namespace control 45 | { 46 | 47 | template 48 | class PID 49 | { 50 | public: 51 | typedef T ValueType; 52 | typedef TT TimeType; 53 | 54 | inline PID() : e(0), kd(0), ki(0), kp(0), i(0) { } 55 | inline ~PID() { } 56 | 57 | inline ValueType operator()(const ValueType& x, const TimeType& dt) 58 | { 59 | ValueType e = x - x; 60 | ValueType p = kp * e; 61 | i += ki * e * dt; 62 | ValueType d = kd * (e - e) / dt; // WTF? 63 | e = e; 64 | return x + p + i + d; 65 | } 66 | 67 | inline void reset() 68 | { 69 | this->e = ValueType(0.0); 70 | this->i = ValueType(0.0); 71 | } 72 | 73 | ValueType kd; 74 | ValueType ki; 75 | ValueType kp; 76 | ValueType x; 77 | private: 78 | ValueType e; 79 | ValueType i; 80 | }; 81 | 82 | } 83 | 84 | } 85 | 86 | #endif // VISIONCORE_CONTROL_PID_HPP 87 | -------------------------------------------------------------------------------- /include/VisionCore/IO/ImageIO.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * **************************************************************************** 3 | * Copyright (c) 2016, Robert Lukierski. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, this 10 | * list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | * this list of conditions and the following disclaimer in the documentation 14 | * and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | * **************************************************************************** 32 | * Image IO. 33 | * **************************************************************************** 34 | */ 35 | 36 | #ifndef VISIONCORE_IO_IMAGE_HPP 37 | #define VISIONCORE_IO_IMAGE_HPP 38 | 39 | #include 40 | 41 | namespace vc 42 | { 43 | 44 | namespace io 45 | { 46 | 47 | template 48 | T loadImage(const std::string& fn); 49 | 50 | template 51 | void saveImage(const std::string& fn, const T& input); 52 | 53 | template 54 | void saveBufferAsText(const std::string& fn, const T& input); 55 | 56 | template 57 | void saveBufferAsBinary(const std::string& fn, const T& input); 58 | 59 | } 60 | 61 | } 62 | 63 | 64 | #endif // VISIONCORE_IO_IMAGE_HPP 65 | -------------------------------------------------------------------------------- /include/VisionCore/Image/ColorMap.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * **************************************************************************** 3 | * Copyright (c) 2016, Robert Lukierski. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, this 10 | * list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | * this list of conditions and the following disclaimer in the documentation 14 | * and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | * **************************************************************************** 32 | * Color Maps. 33 | * **************************************************************************** 34 | */ 35 | 36 | #ifndef VISIONCORE_IMAGE_COLORMAP_HPP 37 | #define VISIONCORE_IMAGE_COLORMAP_HPP 38 | 39 | #include 40 | 41 | #include 42 | #include 43 | 44 | namespace vc 45 | { 46 | 47 | namespace image 48 | { 49 | 50 | enum class ColorMap 51 | { 52 | AUTUMN = 0, 53 | BONE, 54 | COOL, 55 | HOT, 56 | HSV, 57 | JET, 58 | OCEAN, 59 | PARULA, 60 | PINK, 61 | RAINBOW, 62 | SPRING, 63 | SUMMER, 64 | WINTER 65 | }; 66 | 67 | template 68 | void createColorMap(ColorMap cm, const Buffer1DView& img_in, const T& vmin, const T& vmax, 69 | Buffer1DView& img_out); 70 | 71 | template 72 | void createColorMap(ColorMap cm, const Buffer2DView& img_in, const T& vmin, const T& vmax, 73 | Buffer2DView& img_out); 74 | 75 | template 76 | float3 getColorMapValue(ColorMap cm, const T& vmin, const T& vmax, const T& val); 77 | 78 | } 79 | 80 | } 81 | 82 | #endif // VISIONCORE_IMAGE_COLORMAP_HPP 83 | -------------------------------------------------------------------------------- /include/VisionCore/Image/Filters.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * **************************************************************************** 3 | * Copyright (c) 2016, Robert Lukierski. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, this 10 | * list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | * this list of conditions and the following disclaimer in the documentation 14 | * and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | * **************************************************************************** 32 | * Image Filters. 33 | * **************************************************************************** 34 | */ 35 | 36 | #ifndef VISIONCORE_IMAGE_FILTERS_HPP 37 | #define VISIONCORE_IMAGE_FILTERS_HPP 38 | 39 | #include 40 | 41 | #include 42 | 43 | namespace vc 44 | { 45 | 46 | namespace image 47 | { 48 | 49 | template 50 | void bilateral(const Buffer2DView& img_in, Buffer2DView& img_out, 51 | const T& gs, const T& gr, std::size_t dim = 3); 52 | 53 | template 54 | void bilateral(const Buffer2DView& img_in, Buffer2DView& img_out, 55 | const T& gs, const T& gr, const T& minval, std::size_t dim = 3); 56 | 57 | } 58 | 59 | } 60 | 61 | 62 | #endif // VISIONCORE_IMAGE_FILTERS_HPP 63 | -------------------------------------------------------------------------------- /include/VisionCore/Math/Convolution.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * **************************************************************************** 3 | * Copyright (c) 2016, Robert Lukierski. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, this 10 | * list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | * this list of conditions and the following disclaimer in the documentation 14 | * and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | * **************************************************************************** 32 | * Convolution. 33 | * **************************************************************************** 34 | */ 35 | 36 | #ifndef VISIONCORE_MATH_CONVOLUTION_HPP 37 | #define VISIONCORE_MATH_CONVOLUTION_HPP 38 | 39 | #include 40 | 41 | #include 42 | #include 43 | 44 | namespace vc 45 | { 46 | 47 | namespace math 48 | { 49 | 50 | template 51 | void convolve(const Buffer1DView& img_in, Buffer1DView& img_out, const T2& kern); 52 | 53 | template 54 | void convolve(const Buffer2DView& img_in, Buffer2DView& img_out, const T2& kern); 55 | 56 | // TODO add separable convolutions, see nVidia Sample 57 | 58 | } 59 | 60 | } 61 | 62 | 63 | #endif // VISIONCORE_MATH_CONVOLUTION_HPP 64 | -------------------------------------------------------------------------------- /include/VisionCore/Math/DenavitHartenberg.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * **************************************************************************** 3 | * Copyright (c) 2015, Robert Lukierski. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, this 10 | * list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | * this list of conditions and the following disclaimer in the documentation 14 | * and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | * **************************************************************************** 32 | * Denavit-Hartenberg robotic joint generator. 33 | * **************************************************************************** 34 | */ 35 | 36 | #ifndef VISIONCORE_MATH_DENAVIT_HARTENBERG_HPP 37 | #define VISIONCORE_MATH_DENAVIT_HARTENBERG_HPP 38 | 39 | #include 40 | 41 | namespace vc 42 | { 43 | 44 | namespace math 45 | { 46 | 47 | /** 48 | * Denavit-Hartenberg transformation generator. 49 | * 50 | * n-1^T_n = Trans_z_n-1(dn) * Rot_z_n-1(theta_n) * Trans_x_n(rn) * Rot_x_n(alphan) 51 | * 52 | * @param dn offset along previous z to the common normal. 53 | * @param thetan angle about previous z, from old x to new x. 54 | * @param rn length of the common normal. Assuming a revolute joint, this is the radius about previous z. 55 | * @param alphan angle about common normal, from old z axis to new z axis. 56 | * @param output result. 57 | * 58 | */ 59 | template 60 | EIGEN_DEVICE_FUNC void generateDenavitHartenberg(Scalar dn, Scalar thetan, Scalar rn, Scalar alphan, Eigen::Matrix& output) 61 | { 62 | output << 63 | cos(thetan) , -sin(thetan) * cos(alphan) , sin(thetan) * sin(alphan), rn * cos(thetan), 64 | sin(thetan) , cos(thetan) * cos(alphan) , -cos(thetan) * sin(alphan) , rn * sin(thetan), 65 | Scalar(0.0) , sin(alphan) , cos(alphan) , dn, 66 | Scalar(0.0) , Scalar(0.0) , Scalar(0.0), Scalar(1.0); 67 | } 68 | 69 | } 70 | 71 | } 72 | 73 | #endif // VISIONCORE_MATH_DENAVIT_HARTENBERG_HPP 74 | -------------------------------------------------------------------------------- /include/VisionCore/Math/LeastSquares.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * **************************************************************************** 3 | * Copyright (c) 2015, Robert Lukierski. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, this 10 | * list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | * this list of conditions and the following disclaimer in the documentation 14 | * and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | * **************************************************************************** 32 | * Simple Least-Squares Solver. 33 | * **************************************************************************** 34 | */ 35 | 36 | #ifndef VISIONCORE_MATH_LEAST_SQUARES_HPP 37 | #define VISIONCORE_MATH_LEAST_SQUARES_HPP 38 | 39 | #include 40 | #include 41 | 42 | namespace vc 43 | { 44 | 45 | namespace math 46 | { 47 | 48 | // TODO eigenify 49 | 50 | template 51 | class LSQ 52 | { 53 | public: 54 | EIGEN_MAKE_ALIGNED_OPERATOR_NEW 55 | 56 | typedef T Scalar; 57 | static constexpr int Dimension = dim; 58 | typedef Eigen::Matrix MatrixType; 59 | typedef Eigen::Matrix VectorType; 60 | typedef Eigen::AutoDiffScalar> JetType; 61 | 62 | EIGEN_DEVICE_FUNC inline LSQ(const std::size_t nc = 0) 63 | { 64 | reset(); 65 | NumConstraints = nc; 66 | } 67 | 68 | EIGEN_DEVICE_FUNC inline void reset() 69 | { 70 | A.setZero(); 71 | B.setZero(); 72 | Error = Scalar(0.0); 73 | NumConstraints = 0; 74 | } 75 | 76 | EIGEN_DEVICE_FUNC inline void update(const VectorType& J, const Scalar& res, const Scalar& weight = Scalar(1.0)) 77 | { 78 | A.noalias() += J * J.transpose() * weight; 79 | B.noalias() -= J * (res * weight); 80 | Error += res * res * weight; 81 | NumConstraints += 1; 82 | } 83 | 84 | EIGEN_DEVICE_FUNC inline void update(const JetType& j, const Scalar& weight = Scalar(1.0)) 85 | { 86 | update(j.deriviatives(), j.value(), weight); 87 | } 88 | 89 | EIGEN_DEVICE_FUNC inline void finishAndDivide() 90 | { 91 | A /= (Scalar)NumConstraints; 92 | B /= (Scalar)NumConstraints; 93 | Error /= (Scalar)NumConstraints; 94 | } 95 | 96 | EIGEN_DEVICE_FUNC inline VectorType solve() 97 | { 98 | return A.ldlt().solve(-B); 99 | } 100 | 101 | MatrixType A; 102 | VectorType B; 103 | Scalar Error; 104 | std::size_t NumConstraints; 105 | }; 106 | 107 | } 108 | 109 | } 110 | 111 | #endif // VISIONCORE_MATH_LEAST_SQUARES_HPP 112 | -------------------------------------------------------------------------------- /include/VisionCore/Math/LossFunctions.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * **************************************************************************** 3 | * Copyright (c) 2015, Robert Lukierski. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, this 10 | * list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | * this list of conditions and the following disclaimer in the documentation 14 | * and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | * **************************************************************************** 32 | * Loss functions and M-estimators. 33 | * **************************************************************************** 34 | */ 35 | 36 | #ifndef VISIONCORE_MATH_LOSS_FUNCTIONS_HPP 37 | #define VISIONCORE_MATH_LOSS_FUNCTIONS_HPP 38 | 39 | #include 40 | 41 | namespace vc 42 | { 43 | 44 | namespace math 45 | { 46 | 47 | template 48 | EIGEN_DEVICE_FUNC static inline T lossHuber(T x, T delta) 49 | { 50 | using Eigen::numext::abs; 51 | 52 | const T aa = abs(x); 53 | 54 | if(aa <= delta) 55 | { 56 | return T(0.5) * x * x; 57 | } 58 | else 59 | { 60 | return delta * ( aa - delta * T(0.5)); 61 | } 62 | } 63 | 64 | template 65 | EIGEN_DEVICE_FUNC static inline T lossCauchy(T x, T c) 66 | { 67 | const T term = x/c; 68 | return (c*c*T(0.5)) * log(T(1.0) + term * term); 69 | } 70 | 71 | template 72 | EIGEN_DEVICE_FUNC static inline T lossTurkey(T x, T c) 73 | { 74 | using Eigen::numext::abs; 75 | 76 | const T aa = abs(x); 77 | 78 | if(aa <= c) 79 | { 80 | const T term = T(1.0) - ((x / c) * (x / c)); 81 | return ((c*c)/T(6.0)) * (T(1.0) - term * term * term); 82 | } 83 | else 84 | { 85 | return (c*c) / T(6.0); 86 | } 87 | } 88 | 89 | template 90 | EIGEN_DEVICE_FUNC static inline T lossGermanMcClure(T x) 91 | { 92 | return (x*x / T(2.0)) / (T(1.0) + x*x); 93 | } 94 | 95 | template 96 | EIGEN_DEVICE_FUNC static inline T lossWelsch(T x, T c) 97 | { 98 | using Eigen::numext::exp; 99 | const T term = x/c; 100 | return (c*c / T(2.0)) * ( T(1.0) - exp(-(term * term)) ); 101 | } 102 | 103 | template 104 | EIGEN_DEVICE_FUNC static inline T lossL1(T x) 105 | { 106 | using Eigen::numext::abs; 107 | return abs(x); 108 | } 109 | 110 | template 111 | EIGEN_DEVICE_FUNC static inline T lossL2(T x) 112 | { 113 | return x*x; 114 | } 115 | 116 | } 117 | 118 | } 119 | 120 | #endif // VISIONCORE_MATH_LOSS_FUNCTIONS_HPP 121 | -------------------------------------------------------------------------------- /include/VisionCore/MemoryPolicyOpenCL.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * **************************************************************************** 3 | * Copyright (c) 2015, Robert Lukierski. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, this 10 | * list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | * this list of conditions and the following disclaimer in the documentation 14 | * and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | * **************************************************************************** 32 | * Memory Policies for OpenCL. 33 | * **************************************************************************** 34 | */ 35 | 36 | #ifndef VISIONCORE_MEMORY_POLICY_OPENCL_HPP 37 | #define VISIONCORE_MEMORY_POLICY_OPENCL_HPP 38 | 39 | #include 40 | 41 | namespace vc 42 | { 43 | 44 | struct TargetDeviceOpenCL 45 | { 46 | template using PointerType = cl::Memory*; 47 | template using TextureHandleType = int; 48 | }; 49 | 50 | } 51 | 52 | #endif // VISIONCORE_MEMORY_POLICY_OPENCL_HPP 53 | -------------------------------------------------------------------------------- /include/VisionCore/MemoryPolicyOpenGL.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * **************************************************************************** 3 | * Copyright (c) 2018, Robert Lukierski. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, this 10 | * list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | * this list of conditions and the following disclaimer in the documentation 14 | * and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | * **************************************************************************** 32 | * Memory Policies for OpenGL. 33 | * **************************************************************************** 34 | */ 35 | 36 | #ifndef VISIONCORE_MEMORY_POLICY_OPENGL_HPP 37 | #define VISIONCORE_MEMORY_POLICY_OPENGL_HPP 38 | 39 | #include 40 | 41 | // NOTE: This is a rather dummy memory policy, to be used for template specialization for OpenGL backends 42 | 43 | namespace vc 44 | { 45 | 46 | struct TargetDeviceOpenGL 47 | { 48 | template using PointerType = void*; 49 | template using TextureHandleType = int; 50 | }; 51 | 52 | } 53 | 54 | #endif // VISIONCORE_MEMORY_POLICY_OPENGL_HPP 55 | -------------------------------------------------------------------------------- /include/VisionCore/Types/CostVolumeElement.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * **************************************************************************** 3 | * Copyright (c) 2015, Robert Lukierski. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, this 10 | * list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | * this list of conditions and the following disclaimer in the documentation 14 | * and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | * **************************************************************************** 32 | * Cost Volume Element. 33 | * **************************************************************************** 34 | */ 35 | 36 | #ifndef VISIONCORE_TYPES_COSTVOLUMEELEMENT_HPP 37 | #define VISIONCORE_TYPES_COSTVOLUMEELEMENT_HPP 38 | 39 | #include 40 | 41 | namespace vc 42 | { 43 | 44 | namespace types 45 | { 46 | 47 | template 48 | struct VISIONCORE_ALIGN(8) CostVolumeElement 49 | { 50 | EIGEN_DEVICE_FUNC inline CostVolumeElement() { } 51 | 52 | EIGEN_DEVICE_FUNC inline CostVolumeElement(T v) 53 | { 54 | Cost = v; 55 | Count = 1; 56 | } 57 | 58 | EIGEN_DEVICE_FUNC inline operator T() 59 | { 60 | return get(); 61 | } 62 | 63 | EIGEN_DEVICE_FUNC inline T get() const 64 | { 65 | return Count > 0 ? Cost / (T)Count : __FLT_MAX__; 66 | } 67 | 68 | EIGEN_DEVICE_FUNC inline CostVolumeElement& operator=(const CostVolumeElement& other) 69 | { 70 | Cost = other.Cost; 71 | Count = other.Count; 72 | 73 | return *this; 74 | } 75 | 76 | EIGEN_DEVICE_FUNC inline CostVolumeElement& operator=(T v) 77 | { 78 | Cost = v; 79 | Count = 1; 80 | return *this; 81 | } 82 | 83 | EIGEN_DEVICE_FUNC inline CostVolumeElement& operator=(int v) 84 | { 85 | Cost = v; 86 | Count = 1; 87 | return *this; 88 | } 89 | 90 | unsigned int Count; 91 | T Cost; 92 | }; 93 | 94 | } 95 | 96 | } 97 | 98 | #endif // VISIONCORE_TYPES_COSTVOLUMEELEMENT_HPP 99 | -------------------------------------------------------------------------------- /include/VisionCore/Types/SDF.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * **************************************************************************** 3 | * Copyright (c) 2015, Robert Lukierski. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, this 10 | * list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | * this list of conditions and the following disclaimer in the documentation 14 | * and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | * **************************************************************************** 32 | * Sign-Distance Cell Element. 33 | * **************************************************************************** 34 | */ 35 | 36 | #ifndef VISIONCORE_TYPES_SDF_HPP 37 | #define VISIONCORE_TYPES_SDF_HPP 38 | 39 | #include 40 | 41 | namespace vc 42 | { 43 | 44 | namespace types 45 | { 46 | 47 | template 48 | struct VISIONCORE_ALIGN(8) SDF 49 | { 50 | EIGEN_DEVICE_FUNC inline SDF() {} 51 | 52 | EIGEN_DEVICE_FUNC inline SDF(T v) : Value(v), Weight(1) {} 53 | 54 | EIGEN_DEVICE_FUNC inline SDF(T v, T w) : Value(v), Weight(w) {} 55 | 56 | EIGEN_DEVICE_FUNC inline operator T() const 57 | { 58 | return Value; 59 | } 60 | 61 | EIGEN_DEVICE_FUNC inline void clamp(T minval, T maxval) 62 | { 63 | Value = ::clamp(Value, minval, maxval); 64 | } 65 | 66 | EIGEN_DEVICE_FUNC inline void limitWeight(T max_weight) 67 | { 68 | Weight = fminf(Weight, max_weight); 69 | } 70 | 71 | EIGEN_DEVICE_FUNC inline void operator+=(const SDF& rhs) 72 | { 73 | if(rhs.Weight > T(0.0)) 74 | { 75 | Value = (Weight * Value + rhs.Weight * rhs.Value); 76 | Weight += rhs.Weight; 77 | Value /= Weight; 78 | } 79 | } 80 | 81 | T Value; 82 | T Weight; 83 | }; 84 | 85 | template 86 | EIGEN_DEVICE_FUNC inline SDF operator+(const SDF& lhs, const SDF& rhs) 87 | { 88 | SDF res = lhs; 89 | res += rhs; 90 | return res; 91 | } 92 | 93 | } 94 | 95 | } 96 | 97 | #endif // VISIONCORE_TYPES_SDF_HPP 98 | -------------------------------------------------------------------------------- /include/VisionCore/WrapGL/WrapGL.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * **************************************************************************** 3 | * Copyright (c) 2015, Robert Lukierski. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, this 10 | * list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | * this list of conditions and the following disclaimer in the documentation 14 | * and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | * **************************************************************************** 32 | * Umbrella header. 33 | * **************************************************************************** 34 | */ 35 | 36 | #ifndef VISIONCORE_WRAPGL_HPP 37 | #define VISIONCORE_WRAPGL_HPP 38 | 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | #include 47 | #include 48 | #include 49 | #include 50 | 51 | #endif // VISIONCORE_WRAPGL_HPP 52 | -------------------------------------------------------------------------------- /include/VisionCore/WrapGL/WrapGLQuery.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * **************************************************************************** 3 | * Copyright (c) 2015, Robert Lukierski. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, this 10 | * list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | * this list of conditions and the following disclaimer in the documentation 14 | * and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | * **************************************************************************** 32 | * Queries. 33 | * **************************************************************************** 34 | */ 35 | 36 | #ifndef VISIONCORE_WRAPGL_QUERY_HPP 37 | #define VISIONCORE_WRAPGL_QUERY_HPP 38 | 39 | #include 40 | 41 | namespace vc 42 | { 43 | 44 | namespace wrapgl 45 | { 46 | 47 | class Query 48 | { 49 | public: 50 | typedef ScopeBinder Binder; 51 | 52 | enum class Target 53 | { 54 | eSamplesPassed = GL_SAMPLES_PASSED, 55 | eAnySamplesPasses = GL_ANY_SAMPLES_PASSED, 56 | eTransformFeedbackPrimitivesWritten = GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, 57 | eTimeElapsed = GL_TIME_ELAPSED, 58 | eTimestamp = GL_TIMESTAMP 59 | }; 60 | 61 | enum class Parameter 62 | { 63 | eCurrent = GL_CURRENT_QUERY, 64 | eCounterBits = GL_QUERY_COUNTER_BITS, 65 | eResult = GL_QUERY_RESULT, 66 | eResultNoWait = GL_QUERY_RESULT_NO_WAIT, 67 | eResultAvailable = GL_QUERY_RESULT_AVAILABLE 68 | }; 69 | 70 | inline Query(); 71 | inline ~Query(); 72 | 73 | inline void create(); 74 | inline void destroy(); 75 | inline bool isValid() const; 76 | 77 | // 78 | inline void begin(Target target) const; 79 | inline void end(Target target) const; 80 | 81 | inline void begin(Target target, GLuint idx) const; 82 | inline void end(Target target, GLuint idx) const; 83 | 84 | inline GLint get(Target target, Parameter pname); 85 | inline GLint get(Target target, GLuint index, Parameter pname); 86 | template 87 | inline void getObject(Parameter pname, T* params = nullptr); 88 | 89 | inline void queryTimestamp(); 90 | 91 | inline GLuint id() const; 92 | private: 93 | GLuint qid; 94 | }; 95 | 96 | template<> struct ScopeBinder 97 | { 98 | ScopeBinder() = delete; 99 | ScopeBinder(const ScopeBinder&) = delete; 100 | ScopeBinder(ScopeBinder&&) = delete; 101 | ScopeBinder& operator=(const ScopeBinder&) = delete; 102 | ScopeBinder& operator=(ScopeBinder&&) = delete; 103 | 104 | inline ScopeBinder(const Query& aobj, typename Query::Target tgt); 105 | inline ~ScopeBinder(); 106 | 107 | const Query& obj; 108 | typename Query::Target target; 109 | }; 110 | 111 | } 112 | 113 | } 114 | 115 | #include 116 | 117 | #endif // VISIONCORE_WRAPGL_QUERY_HPP 118 | -------------------------------------------------------------------------------- /include/VisionCore/WrapGL/WrapGLSampler.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * **************************************************************************** 3 | * Copyright (c) 2015, Robert Lukierski. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, this 10 | * list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | * this list of conditions and the following disclaimer in the documentation 14 | * and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | * **************************************************************************** 32 | * Texture Samplers. 33 | * **************************************************************************** 34 | */ 35 | 36 | #ifndef VISIONCORE_WRAPGL_SAMPLER_HPP 37 | #define VISIONCORE_WRAPGL_SAMPLER_HPP 38 | 39 | #include 40 | 41 | /** 42 | * TODO: 43 | * 44 | * glSamplerParameter 45 | */ 46 | 47 | namespace vc 48 | { 49 | 50 | namespace wrapgl 51 | { 52 | 53 | class Sampler 54 | { 55 | public: 56 | typedef ScopeBinder Binder; 57 | 58 | inline Sampler(); 59 | inline Sampler(GLuint texu); 60 | inline ~Sampler(); 61 | 62 | inline void create(GLuint texu); 63 | inline void destroy(); 64 | inline bool isValid() const; 65 | 66 | inline void bind() const; 67 | inline void unbind() const; 68 | 69 | template 70 | inline T get(GLenum param); 71 | template 72 | inline void set(GLenum param, T val); 73 | 74 | inline GLuint id() const; 75 | private: 76 | GLuint sid; 77 | GLuint texunit; 78 | }; 79 | 80 | } 81 | 82 | } 83 | 84 | #include 85 | 86 | #endif // VISIONCORE_WRAPGL_SAMPLER_HPP 87 | -------------------------------------------------------------------------------- /include/VisionCore/WrapGL/WrapGLTransformFeedback.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * **************************************************************************** 3 | * Copyright (c) 2015, Robert Lukierski. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, this 10 | * list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | * this list of conditions and the following disclaimer in the documentation 14 | * and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | * **************************************************************************** 32 | * Transform feedback. 33 | * **************************************************************************** 34 | */ 35 | 36 | #ifndef VISIONCORE_WRAPGL_TRANSFORM_FEEDBACK_HPP 37 | #define VISIONCORE_WRAPGL_TRANSFORM_FEEDBACK_HPP 38 | 39 | #include 40 | 41 | namespace vc 42 | { 43 | 44 | namespace wrapgl 45 | { 46 | 47 | class TransformFeedback 48 | { 49 | public: 50 | typedef ScopeBinder Binder; 51 | 52 | inline TransformFeedback(); 53 | inline ~TransformFeedback(); 54 | 55 | inline void create(); 56 | inline void destroy(); 57 | inline bool isValid() const; 58 | 59 | inline void bind() const; 60 | inline void unbind() const; 61 | 62 | inline void draw(GLenum mode = GL_POINTS) const; 63 | inline void draw(GLenum mode, GLsizei instcnt) const; 64 | 65 | inline static void begin(GLenum primode); 66 | inline static void end(); 67 | inline static void pause(); 68 | inline static void resume(); 69 | 70 | inline GLuint id() const; 71 | private: 72 | GLuint tbid; 73 | }; 74 | 75 | } 76 | 77 | } 78 | 79 | #include 80 | 81 | #endif // VISIONCORE_WRAPGL_TRANSFORM_FEEDBACK_HPP 82 | -------------------------------------------------------------------------------- /include/VisionCore/WrapGL/WrapGLVertexArrayObject.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * **************************************************************************** 3 | * Copyright (c) 2015, Robert Lukierski. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, this 10 | * list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | * this list of conditions and the following disclaimer in the documentation 14 | * and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | * **************************************************************************** 32 | * VAO. 33 | * **************************************************************************** 34 | */ 35 | 36 | #ifndef VISIONCORE_WRAPGL_VERTEX_ARRAY_OBJECT_HPP 37 | #define VISIONCORE_WRAPGL_VERTEX_ARRAY_OBJECT_HPP 38 | 39 | #include 40 | 41 | /** 42 | * TODO: 43 | * 44 | * glVertexBindingDivisor 45 | */ 46 | 47 | namespace vc 48 | { 49 | 50 | namespace wrapgl 51 | { 52 | 53 | class VertexArrayObject 54 | { 55 | public: 56 | typedef ScopeBinder Binder; 57 | 58 | inline VertexArrayObject(); 59 | virtual ~VertexArrayObject() { destroy(); } 60 | 61 | inline void create(); 62 | inline void destroy(); 63 | inline bool isValid() const; 64 | 65 | inline void bind() const; 66 | inline void unbind() const; 67 | 68 | inline GLuint id() const; 69 | 70 | inline void setDivisor(GLuint bindingindex, GLuint divisor); 71 | private: 72 | GLuint vaoid; 73 | }; 74 | 75 | } 76 | 77 | } 78 | 79 | #include 80 | 81 | #endif // VISIONCORE_WRAPGL_VERTEX_ARRAY_OBJECT_HPP 82 | -------------------------------------------------------------------------------- /include/VisionCore/WrapGL/impl/WrapGLSampler_impl.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * **************************************************************************** 3 | * Copyright (c) 2017, Robert Lukierski. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, this 10 | * list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | * this list of conditions and the following disclaimer in the documentation 14 | * and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | * **************************************************************************** 32 | * Texture Samplers. 33 | * **************************************************************************** 34 | */ 35 | 36 | #ifndef VISIONCORE_WRAPGL_SAMPLER_IMPL_HPP 37 | #define VISIONCORE_WRAPGL_SAMPLER_IMPL_HPP 38 | 39 | inline vc::wrapgl::Sampler::Sampler() : sid(0) 40 | { 41 | create(0); 42 | } 43 | 44 | inline vc::wrapgl::Sampler::Sampler(GLuint texu) : sid(0) 45 | { 46 | create(texu); 47 | } 48 | 49 | inline vc::wrapgl::Sampler::~Sampler() 50 | { 51 | destroy(); 52 | } 53 | 54 | inline void vc::wrapgl::Sampler::create(GLuint texu) 55 | { 56 | destroy(); 57 | 58 | glGenSamplers(1, &sid); 59 | WRAPGL_CHECK_ERROR(); 60 | texunit = texu; 61 | } 62 | 63 | inline void vc::wrapgl::Sampler::destroy() 64 | { 65 | if(sid != 0) 66 | { 67 | glDeleteSamplers(1, &sid); 68 | WRAPGL_CHECK_ERROR(); 69 | sid = 0; 70 | } 71 | } 72 | 73 | inline bool vc::wrapgl::Sampler::isValid() const 74 | { 75 | return sid != 0; 76 | } 77 | 78 | inline void vc::wrapgl::Sampler::bind() const 79 | { 80 | glBindSampler(texunit, sid); 81 | WRAPGL_CHECK_ERROR(); 82 | } 83 | 84 | inline void vc::wrapgl::Sampler::unbind() const 85 | { 86 | glBindSampler(texunit, 0); 87 | WRAPGL_CHECK_ERROR(); 88 | } 89 | 90 | template 91 | inline T vc::wrapgl::Sampler::get(GLenum param) 92 | { 93 | T ret; 94 | glGetSamplerParameterfv(sid, param, &ret); 95 | WRAPGL_CHECK_ERROR(); 96 | return ret; 97 | } 98 | 99 | template 100 | inline void vc::wrapgl::Sampler::set(GLenum param, T val) 101 | { 102 | glSamplerParameterf(sid, param, val); 103 | WRAPGL_CHECK_ERROR(); 104 | } 105 | 106 | inline GLuint vc::wrapgl::Sampler::id() const 107 | { 108 | return sid; 109 | } 110 | 111 | #endif // VISIONCORE_WRAPGL_SAMPLER_IMPL_HPP 112 | -------------------------------------------------------------------------------- /include/VisionCore/WrapGL/impl/WrapGLTransformFeedback_impl.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * **************************************************************************** 3 | * Copyright (c) 2017, Robert Lukierski. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, this 10 | * list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | * this list of conditions and the following disclaimer in the documentation 14 | * and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | * **************************************************************************** 32 | * Transform feedback. 33 | * **************************************************************************** 34 | */ 35 | 36 | #ifndef VISIONCORE_WRAPGL_TRANSFORM_FEEDBACK_IMPL_HPP 37 | #define VISIONCORE_WRAPGL_TRANSFORM_FEEDBACK_IMPL_HPP 38 | 39 | inline vc::wrapgl::TransformFeedback::TransformFeedback() : tbid(0) 40 | { 41 | create(); 42 | } 43 | 44 | inline vc::wrapgl::TransformFeedback::~TransformFeedback() 45 | { 46 | destroy(); 47 | } 48 | 49 | inline void vc::wrapgl::TransformFeedback::create() 50 | { 51 | destroy(); 52 | 53 | glGenTransformFeedbacks(1, &tbid); 54 | WRAPGL_CHECK_ERROR(); 55 | } 56 | 57 | inline void vc::wrapgl::TransformFeedback::destroy() 58 | { 59 | if(tbid != 0) 60 | { 61 | glDeleteTransformFeedbacks(1, &tbid); 62 | WRAPGL_CHECK_ERROR(); 63 | tbid = 0; 64 | } 65 | } 66 | 67 | inline bool vc::wrapgl::TransformFeedback::isValid() const 68 | { 69 | return tbid != 0; 70 | } 71 | 72 | inline void vc::wrapgl::TransformFeedback::bind() const 73 | { 74 | glBindTransformFeedback(GL_TRANSFORM_FEEDBACK, tbid); 75 | WRAPGL_CHECK_ERROR(); 76 | } 77 | 78 | inline void vc::wrapgl::TransformFeedback::unbind() const 79 | { 80 | glBindTransformFeedback(GL_TRANSFORM_FEEDBACK, 0); 81 | WRAPGL_CHECK_ERROR(); 82 | } 83 | 84 | inline void vc::wrapgl::TransformFeedback::draw(GLenum mode) const 85 | { 86 | glDrawTransformFeedback(mode, tbid); 87 | WRAPGL_CHECK_ERROR(); 88 | } 89 | 90 | inline void vc::wrapgl::TransformFeedback::draw(GLenum mode, GLsizei instcnt) const 91 | { 92 | glDrawTransformFeedbackInstanced(mode, tbid, instcnt); 93 | WRAPGL_CHECK_ERROR(); 94 | } 95 | 96 | inline void vc::wrapgl::TransformFeedback::begin(GLenum primode) 97 | { 98 | glBeginTransformFeedback(primode); 99 | WRAPGL_CHECK_ERROR(); 100 | } 101 | 102 | inline void vc::wrapgl::TransformFeedback::end() 103 | { 104 | glEndTransformFeedback(); 105 | WRAPGL_CHECK_ERROR(); 106 | } 107 | 108 | inline void vc::wrapgl::TransformFeedback::pause() 109 | { 110 | glPauseTransformFeedback(); 111 | WRAPGL_CHECK_ERROR(); 112 | } 113 | 114 | inline void vc::wrapgl::TransformFeedback::resume() 115 | { 116 | glPauseTransformFeedback(); 117 | WRAPGL_CHECK_ERROR(); 118 | } 119 | 120 | inline GLuint vc::wrapgl::TransformFeedback::id() const 121 | { 122 | return tbid; 123 | } 124 | 125 | #endif // VISIONCORE_WRAPGL_TRANSFORM_FEEDBACK_IMPL_HPP 126 | -------------------------------------------------------------------------------- /include/VisionCore/WrapGL/impl/WrapGLVertexArrayObject_impl.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * **************************************************************************** 3 | * Copyright (c) 2017, Robert Lukierski. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, this 10 | * list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | * this list of conditions and the following disclaimer in the documentation 14 | * and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | * **************************************************************************** 32 | * VAO. 33 | * **************************************************************************** 34 | */ 35 | 36 | #ifndef VISIONCORE_WRAPGL_VERTEX_ARRAY_OBJECT_IMPL_HPP 37 | #define VISIONCORE_WRAPGL_VERTEX_ARRAY_OBJECT_IMPL_HPP 38 | 39 | inline vc::wrapgl::VertexArrayObject::VertexArrayObject() : vaoid(0) 40 | { 41 | create(); 42 | } 43 | 44 | inline void vc::wrapgl::VertexArrayObject::create() 45 | { 46 | destroy(); 47 | 48 | glGenVertexArrays(1, &vaoid); 49 | WRAPGL_CHECK_ERROR(); 50 | } 51 | 52 | inline void vc::wrapgl::VertexArrayObject::destroy() 53 | { 54 | if(vaoid != 0) 55 | { 56 | glDeleteVertexArrays(1, &vaoid); 57 | WRAPGL_CHECK_ERROR(); 58 | vaoid = 0; 59 | } 60 | } 61 | 62 | inline bool vc::wrapgl::VertexArrayObject::isValid() const 63 | { 64 | return vaoid != 0; 65 | } 66 | 67 | inline void vc::wrapgl::VertexArrayObject::bind() const 68 | { 69 | glBindVertexArray(vaoid); 70 | WRAPGL_CHECK_ERROR(); 71 | } 72 | 73 | inline void vc::wrapgl::VertexArrayObject::unbind() const 74 | { 75 | glBindVertexArray(0); 76 | WRAPGL_CHECK_ERROR(); 77 | } 78 | 79 | inline GLuint vc::wrapgl::VertexArrayObject::id() const 80 | { 81 | return vaoid; 82 | } 83 | 84 | inline void vc::wrapgl::VertexArrayObject::setDivisor(GLuint bindingindex, GLuint divisor) 85 | { 86 | glVertexArrayBindingDivisor(vaoid, bindingindex, divisor); 87 | WRAPGL_CHECK_ERROR(); 88 | } 89 | 90 | #endif // VISIONCORE_WRAPGL_VERTEX_ARRAY_OBJECT_IMPL_HPP 91 | -------------------------------------------------------------------------------- /scripts/EigenAlignmentCheck.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | return EIGEN_IDEAL_MAX_ALIGN_BYTES; 6 | } 7 | 8 | -------------------------------------------------------------------------------- /scripts/FindFFTW.cmake: -------------------------------------------------------------------------------- 1 | # - Find the FFTW library 2 | # 3 | # Usage: 4 | # find_package(FFTW [REQUIRED] [QUIET] ) 5 | # 6 | # It sets the following variables: 7 | # FFTW_FOUND ... true if fftw is found on the system 8 | # FFTW_LIBRARIES ... full path to fftw library 9 | # FFTW_INCLUDES ... fftw include directory 10 | # 11 | # The following variables will be checked by the function 12 | # FFTW_USE_STATIC_LIBS ... if true, only static libraries are found 13 | # FFTW_ROOT ... if set, the libraries are exclusively searched 14 | # under this path 15 | # FFTW_LIBRARY ... fftw library to use 16 | # FFTW_INCLUDE_DIR ... fftw include directory 17 | # 18 | 19 | #If environment variable FFTWDIR is specified, it has same effect as FFTW_ROOT 20 | if( NOT FFTW_ROOT AND ENV{FFTWDIR} ) 21 | set( FFTW_ROOT $ENV{FFTWDIR} ) 22 | endif() 23 | 24 | # Check if we can use PkgConfig 25 | find_package(PkgConfig) 26 | 27 | #Determine from PKG 28 | if( PKG_CONFIG_FOUND AND NOT FFTW_ROOT ) 29 | pkg_check_modules( PKG_FFTW QUIET "fftw3" ) 30 | endif() 31 | 32 | #Check whether to search static or dynamic libs 33 | set( CMAKE_FIND_LIBRARY_SUFFIXES_SAV ${CMAKE_FIND_LIBRARY_SUFFIXES} ) 34 | 35 | if( ${FFTW_USE_STATIC_LIBS} ) 36 | set( CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_STATIC_LIBRARY_SUFFIX} ) 37 | else() 38 | set( CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_SHARED_LIBRARY_SUFFIX} ) 39 | endif() 40 | 41 | if( FFTW_ROOT ) 42 | 43 | #find libs 44 | find_library( 45 | FFTW_LIB 46 | NAMES "fftw3" 47 | PATHS ${FFTW_ROOT} 48 | PATH_SUFFIXES "lib" "lib64" 49 | NO_DEFAULT_PATH 50 | ) 51 | 52 | find_library( 53 | FFTW_THREADS_LIB 54 | NAMES "fftw3_threads" 55 | PATHS ${FFTW_ROOT} 56 | PATH_SUFFIXES "lib" "lib64" 57 | NO_DEFAULT_PATH 58 | ) 59 | 60 | find_library( 61 | FFTWF_LIB 62 | NAMES "fftw3f" 63 | PATHS ${FFTW_ROOT} 64 | PATH_SUFFIXES "lib" "lib64" 65 | NO_DEFAULT_PATH 66 | ) 67 | 68 | find_library( 69 | FFTWF_THREADS_LIB 70 | NAMES "fftw3f_threads" 71 | PATHS ${FFTW_ROOT} 72 | PATH_SUFFIXES "lib" "lib64" 73 | NO_DEFAULT_PATH 74 | ) 75 | 76 | find_library( 77 | FFTWL_LIB 78 | NAMES "fftw3l" 79 | PATHS ${FFTW_ROOT} 80 | PATH_SUFFIXES "lib" "lib64" 81 | NO_DEFAULT_PATH 82 | ) 83 | 84 | find_library( 85 | FFTWL_THREADS_LIB 86 | NAMES "fftw3l_threads" 87 | PATHS ${FFTW_ROOT} 88 | PATH_SUFFIXES "lib" "lib64" 89 | NO_DEFAULT_PATH 90 | ) 91 | 92 | #find includes 93 | find_path( 94 | FFTW_INCLUDES 95 | NAMES "fftw3.h" 96 | PATHS ${FFTW_ROOT} 97 | PATH_SUFFIXES "include" 98 | NO_DEFAULT_PATH 99 | ) 100 | 101 | else() 102 | 103 | find_library( 104 | FFTW_LIB 105 | NAMES "fftw3" 106 | PATHS ${PKG_FFTW_LIBRARY_DIRS} ${LIB_INSTALL_DIR} 107 | ) 108 | 109 | find_library( 110 | FFTW_THREADS_LIB 111 | NAMES "fftw3_threads" 112 | PATHS ${PKG_FFTW_LIBRARY_DIRS} ${LIB_INSTALL_DIR} 113 | ) 114 | 115 | find_library( 116 | FFTWF_LIB 117 | NAMES "fftw3f" 118 | PATHS ${PKG_FFTW_LIBRARY_DIRS} ${LIB_INSTALL_DIR} 119 | ) 120 | 121 | find_library( 122 | FFTWF_THREADS_LIB 123 | NAMES "fftw3f_threads" 124 | PATHS ${PKG_FFTW_LIBRARY_DIRS} ${LIB_INSTALL_DIR} 125 | ) 126 | 127 | find_library( 128 | FFTWL_LIB 129 | NAMES "fftw3l" 130 | PATHS ${PKG_FFTW_LIBRARY_DIRS} ${LIB_INSTALL_DIR} 131 | ) 132 | 133 | find_library( 134 | FFTWL_THREADS_LIB 135 | NAMES "fftw3l_threads" 136 | PATHS ${PKG_FFTW_LIBRARY_DIRS} ${LIB_INSTALL_DIR} 137 | ) 138 | 139 | find_path( 140 | FFTW_INCLUDES 141 | NAMES "fftw3.h" 142 | PATHS ${PKG_FFTW_INCLUDE_DIRS} ${INCLUDE_INSTALL_DIR} 143 | ) 144 | 145 | endif( FFTW_ROOT ) 146 | 147 | set(FFTW_LIBRARIES ${FFTW_LIB} ${FFTWF_LIB}) 148 | 149 | if(FFTWL_LIB) 150 | set(FFTW_LIBRARIES ${FFTW_LIBRARIES} ${FFTWL_LIB}) 151 | endif() 152 | 153 | set( CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_SAV} ) 154 | 155 | include(FindPackageHandleStandardArgs) 156 | find_package_handle_standard_args(FFTW DEFAULT_MSG 157 | FFTW_INCLUDES FFTW_LIBRARIES) 158 | 159 | mark_as_advanced(FFTW_INCLUDES FFTW_LIBRARIES FFTW_LIB FFTWF_LIB FFTWL_LIB FFTW_THREADS_LIB FFTWF_THREADS_LIB FFTWL_THREADS_LIB) 160 | 161 | -------------------------------------------------------------------------------- /sources/WrapGL/WrapGLBuffer.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * **************************************************************************** 3 | * Copyright (c) 2015, Robert Lukierski. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, this 10 | * list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | * this list of conditions and the following disclaimer in the documentation 14 | * and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | * **************************************************************************** 32 | * CUDA-Buffer Interop. 33 | * **************************************************************************** 34 | */ 35 | 36 | #include 37 | #include 38 | 39 | #ifdef VISIONCORE_HAVE_CUDA 40 | #define __gl_h_ 41 | #include 42 | 43 | ::cudaGraphicsResource* vc::internal::registerOpenGLBuffer(GLuint id, unsigned int flags) 44 | { 45 | ::cudaGraphicsResource* cuda_res = 0; 46 | cudaError_t err = cudaGraphicsGLRegisterBuffer( &cuda_res, id, flags ); 47 | if(err != cudaSuccess) { throw CUDAException(err, "Error registering OpenGL buffer"); } 48 | return cuda_res; 49 | } 50 | 51 | ::cudaGraphicsResource* vc::internal::registerOpenGLTexture(GLenum textype, GLuint id, unsigned int flags) 52 | { 53 | ::cudaGraphicsResource* cuda_res = 0; 54 | cudaError_t err = cudaGraphicsGLRegisterImage( &cuda_res, id , (GLenum)textype, flags ); 55 | if(err != cudaSuccess) { throw CUDAException(err, "Error registering OpenGL texture"); } 56 | return cuda_res; 57 | } 58 | 59 | #endif // VISIONCORE_HAVE_CUDA 60 | 61 | -------------------------------------------------------------------------------- /sources/WrapGL/WrapGLCommon.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * **************************************************************************** 3 | * Copyright (c) 2015, Robert Lukierski. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, this 10 | * list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | * this list of conditions and the following disclaimer in the documentation 14 | * and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | * **************************************************************************** 32 | * Debugging. 33 | * **************************************************************************** 34 | */ 35 | 36 | #include 37 | 38 | void vc::wrapgl::Debug::enable() 39 | { 40 | glEnable(GL_DEBUG_OUTPUT); 41 | } 42 | 43 | void vc::wrapgl::Debug::disable() 44 | { 45 | glDisable(GL_DEBUG_OUTPUT); 46 | } 47 | 48 | #ifdef VISIONCORE_HAVE_GLBINDING 49 | extern "C" void openGLDebugCallback(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *message, const void *userParam) 50 | #else // VISIONCORE_HAVE_GLBINDING 51 | extern "C" void openGLDebugCallback(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* message, const GLvoid* userParam) 52 | #endif // VISIONCORE_HAVE_GLBINDING 53 | { 54 | const vc::wrapgl::Debug::CallbackT& fun = *(const vc::wrapgl::Debug::CallbackT*)userParam; 55 | if(userParam != 0) 56 | { 57 | if(fun) 58 | { 59 | fun(source, type, id, severity, std::string(message, length-1)); 60 | } 61 | } 62 | } 63 | 64 | void vc::wrapgl::Debug::registerCallback(const CallbackT& fun) 65 | { 66 | glDebugMessageCallback(&openGLDebugCallback, (const void*)&fun); 67 | } 68 | 69 | void vc::wrapgl::Debug::insert(GLenum source, GLenum type, GLuint id, GLenum severity, const std::string& msg) 70 | { 71 | glDebugMessageInsert(source, type, id, severity, -1, msg.c_str()); 72 | } 73 | 74 | const char* vc::wrapgl::internal::getErrorString(const GLenum err) 75 | { 76 | switch(err) 77 | { 78 | case GL_INVALID_ENUM: return "Invalid Enum"; 79 | case GL_INVALID_VALUE: return "Invalid Value"; 80 | case GL_INVALID_OPERATION: return "Invalid Operation"; 81 | case GL_STACK_OVERFLOW: return "Stack Overflow"; 82 | case GL_STACK_UNDERFLOW: return "Stack Underflow"; 83 | case GL_OUT_OF_MEMORY: return "Out of Memory"; 84 | case GL_TABLE_TOO_LARGE: return "Table too Large"; 85 | default: return "Unknown Error"; 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /sources/WrapGL/WrapGLFramebuffer.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * **************************************************************************** 3 | * Copyright (c) 2015, Robert Lukierski. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, this 10 | * list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | * this list of conditions and the following disclaimer in the documentation 14 | * and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | * **************************************************************************** 32 | * Attachment list. 33 | * **************************************************************************** 34 | */ 35 | 36 | #include 37 | 38 | std::array vc::wrapgl::FrameBuffer::attachment_buffers = {{ 39 | GL_COLOR_ATTACHMENT0, 40 | GL_COLOR_ATTACHMENT1, 41 | GL_COLOR_ATTACHMENT2, 42 | GL_COLOR_ATTACHMENT3, 43 | GL_COLOR_ATTACHMENT4, 44 | GL_COLOR_ATTACHMENT5, 45 | GL_COLOR_ATTACHMENT6, 46 | GL_COLOR_ATTACHMENT7 47 | }}; 48 | -------------------------------------------------------------------------------- /tests/Buffers/BufferTestHelpers.cu: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /tests/Buffers/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2016, Robert Lukierski. 2 | # All rights reserved. 3 | # 4 | # Redistribution and use in source and binary forms, with or without 5 | # modification, are permitted provided that the following conditions are met: 6 | # 7 | # Redistributions of source code must retain the above copyright notice, this 8 | # list of conditions and the following disclaimer. 9 | # 10 | # Redistributions in binary form must reproduce the above copyright notice, 11 | # this list of conditions and the following disclaimer in the documentation 12 | # and/or other materials provided with the distribution. 13 | # 14 | # Neither the name of the copyright holder nor the names of its 15 | # contributors may be used to endorse or promote products derived from 16 | # this software without specific prior written permission. 17 | # 18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | # ------------------------------------------------------------------------------ 29 | 30 | cmake_minimum_required(VERSION 3.1) 31 | 32 | include_directories(.) 33 | 34 | set(TEST_SOURCES 35 | ../tests_main.cpp 36 | UT_Buffer1D.cpp 37 | UT_Buffer2D.cpp 38 | UT_Buffer3D.cpp 39 | UT_CUDABuffer1D.cpp 40 | UT_CUDABuffer2D.cpp 41 | #UT_Pyramid.cpp 42 | #UT_Reduction2D.cpp 43 | ) 44 | 45 | if(CUDA_FOUND) 46 | set(TEST_KERNEL_SOURCES 47 | UT_CUDABuffer3D.cu 48 | BufferTestHelpers.cu 49 | #UT_CUDAPyramid.cu 50 | #UT_CUDAReduction2D.cu 51 | #UT_CUDAReductions.cu 52 | ) 53 | endif() 54 | 55 | if(OpenCL_FOUND) 56 | list(APPEND TEST_SOURCES 57 | #UT_OpenCLBuffer1D.cpp 58 | #UT_OpenCLBuffer2D.cpp 59 | #UT_OpenCLBuffer3D.cpp 60 | #UT_OpenCLImage2D.cpp 61 | #UT_OpenCLPyramid.cpp 62 | ) 63 | endif() 64 | 65 | add_executable(UT_VisionCore_Buffers ${TEST_SOURCES} ${TEST_KERNEL_SOURCES}) 66 | target_link_libraries(UT_VisionCore_Buffers PUBLIC ${GTEST_LIBRARY} ${PROJECT_NAME}) 67 | if(CUDA_FOUND) 68 | target_link_libraries(UT_VisionCore_Buffers PUBLIC ${CUDA_LIBRARIES}) 69 | endif() 70 | if(OpenCL_FOUND) 71 | target_link_libraries(UT_VisionCore_Buffers PUBLIC ${OpenCL_LIBRARIES}) 72 | endif() 73 | add_test(UT_VisionCore_Buffers UT_VisionCore_Buffers --gtest_output=xml:UT_VisionCore_Buffers.xml) 74 | -------------------------------------------------------------------------------- /tests/Buffers/UT_Buffer1D.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * **************************************************************************** 3 | * Copyright (c) 2015, Robert Lukierski. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, this 10 | * list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | * this list of conditions and the following disclaimer in the documentation 14 | * and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | * **************************************************************************** 32 | * Basic Buffer1D Tests. 33 | * **************************************************************************** 34 | */ 35 | 36 | // system 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | #include 47 | #include 48 | 49 | // testing framework & libraries 50 | #include 51 | 52 | // google logger 53 | #include 54 | 55 | #include 56 | #include 57 | 58 | static constexpr std::size_t BufferSize = 4097; 59 | 60 | template 61 | class Test_Buffer1D : public ::testing::Test 62 | { 63 | public: 64 | Test_Buffer1D() 65 | { 66 | 67 | } 68 | 69 | virtual ~Test_Buffer1D() 70 | { 71 | 72 | } 73 | }; 74 | 75 | typedef ::testing::Types TypesToTest; 76 | TYPED_TEST_CASE(Test_Buffer1D, TypesToTest); 77 | 78 | TYPED_TEST(Test_Buffer1D, CPU) 79 | { 80 | typedef TypeParam BufferElementT; 81 | 82 | vc::Buffer1DManaged bufcpu(BufferSize); 83 | 84 | ASSERT_TRUE(bufcpu.isValid()) << "Wrong managed state"; 85 | ASSERT_EQ(bufcpu.size(), BufferSize) << "Wrong managed size"; 86 | ASSERT_EQ(bufcpu.bytes(), BufferSize * sizeof(BufferElementT)) << "Wrong managed size bytes"; 87 | 88 | for(std::size_t i = 0 ; i < bufcpu.size() ; ++i) 89 | { 90 | BufferElementOps::assign(bufcpu(i),i,BufferSize); 91 | } 92 | 93 | vc::Buffer1DView viewcpu(bufcpu); 94 | 95 | ASSERT_TRUE(viewcpu.isValid()) << "Wrong view state"; 96 | ASSERT_EQ(viewcpu.size(), BufferSize) << "Wrong size for view"; 97 | 98 | for(std::size_t i = 0 ; i < viewcpu.size() ; ++i) 99 | { 100 | BufferElementOps::check(viewcpu(i), viewcpu.ptr()[i],i); 101 | } 102 | } 103 | -------------------------------------------------------------------------------- /tests/Buffers/UT_CUDABuffer1D.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * **************************************************************************** 3 | * Copyright (c) 2015, Robert Lukierski. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, this 10 | * list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | * this list of conditions and the following disclaimer in the documentation 14 | * and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | * **************************************************************************** 32 | * Basic CUDA Buffer1D Tests. 33 | * **************************************************************************** 34 | */ 35 | 36 | // testing framework & libraries 37 | #include 38 | 39 | // google logger 40 | #include 41 | 42 | #include 43 | 44 | #include 45 | #include 46 | 47 | static constexpr std::size_t BufferSize = 4097; 48 | 49 | template 50 | class Test_CUDABuffer1D : public ::testing::Test 51 | { 52 | public: 53 | Test_CUDABuffer1D() 54 | { 55 | 56 | } 57 | 58 | virtual ~Test_CUDABuffer1D() 59 | { 60 | 61 | } 62 | }; 63 | 64 | typedef ::testing::Types TypesToTest; 65 | TYPED_TEST_CASE(Test_CUDABuffer1D, TypesToTest); 66 | 67 | TYPED_TEST(Test_CUDABuffer1D, TestHostDevice) 68 | { 69 | typedef TypeParam BufferElementT; 70 | 71 | 72 | 73 | // CPU buffer 1 74 | vc::Buffer1DManaged buffer_cpu1(BufferSize); 75 | 76 | // Fill H 77 | for(std::size_t i = 0 ; i < BufferSize ; ++i) 78 | { 79 | BufferElementOps::assign(buffer_cpu1(i),i,BufferSize); 80 | } 81 | 82 | // GPU Buffer 83 | vc::Buffer1DManaged buffer_gpu(BufferSize); 84 | 85 | LOG(INFO) << "Buffer1D Sizes, CPU: " << buffer_cpu1.bytes() << ", GPU: " << buffer_gpu.bytes() << " [bytes]"; 86 | 87 | // H->D 88 | buffer_gpu.copyFrom(buffer_cpu1); 89 | 90 | // CPU buffer 2 91 | vc::Buffer1DManaged buffer_cpu2(BufferSize); 92 | 93 | // D->H 94 | buffer_cpu2.copyFrom(buffer_gpu); 95 | 96 | // Check 97 | for(std::size_t i = 0 ; i < BufferSize ; ++i) 98 | { 99 | BufferElementOps::check(buffer_cpu2(i),buffer_cpu1(i),i); 100 | } 101 | 102 | // Now write from kernel 103 | LaunchKernel_WriteBuffer1D(buffer_gpu,BufferSize); 104 | 105 | // D->H 106 | buffer_cpu1.copyFrom(buffer_gpu); 107 | 108 | // Check 109 | for(std::size_t i = 0 ; i < BufferSize ; ++i) 110 | { 111 | BufferElementOps::check(buffer_cpu1(i),buffer_cpu2(i),i); 112 | } 113 | } 114 | -------------------------------------------------------------------------------- /tests/Buffers/UT_CUDABuffer3D.cu: -------------------------------------------------------------------------------- 1 | #include -------------------------------------------------------------------------------- /tests/Buffers/UT_CUDAPyramid.cu: -------------------------------------------------------------------------------- 1 | #include -------------------------------------------------------------------------------- /tests/Buffers/UT_CUDAReductions.cu: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /tests/Buffers/UT_OpenCLBuffer1D.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * **************************************************************************** 3 | * Copyright (c) 2015, Robert Lukierski. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, this 10 | * list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | * this list of conditions and the following disclaimer in the documentation 14 | * and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | * **************************************************************************** 32 | * Basic OpenCL Buffer1D Tests. 33 | * **************************************************************************** 34 | */ 35 | 36 | // system 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | #include 47 | #include 48 | 49 | // testing framework & libraries 50 | #include 51 | 52 | // google logger 53 | #include 54 | 55 | #include 56 | 57 | class Test_OpenCLBuffer1D : public ::testing::Test 58 | { 59 | public: 60 | Test_OpenCLBuffer1D() 61 | { 62 | 63 | } 64 | 65 | virtual ~Test_OpenCLBuffer1D() 66 | { 67 | 68 | } 69 | }; 70 | 71 | TEST_F(Test_OpenCLBuffer1D, OpenCL) 72 | { 73 | cl_int error; 74 | cl::CommandQueue queue = cl::CommandQueue::getDefault(&error); 75 | 76 | vc::Buffer1DManaged cpu_src(10), cpu_dst(10); 77 | 78 | for(std::size_t i = 0 ; i < 10 ; ++i) 79 | { 80 | cpu_src(i) = i + 1; 81 | } 82 | 83 | vc::Buffer1DManaged bufcl(10, cl::Context::getDefault(), CL_MEM_READ_ONLY); 84 | 85 | bufcl.copyFrom(queue, cpu_src); 86 | 87 | ASSERT_TRUE(bufcl.isValid()); 88 | 89 | vc::Buffer1DView viewcl(bufcl); 90 | 91 | ASSERT_TRUE(viewcl.isValid()); 92 | 93 | cpu_dst.copyFrom(queue, viewcl); 94 | 95 | for(std::size_t i = 0 ; i < 10 ; ++i) 96 | { 97 | ASSERT_TRUE(cpu_dst(i) == cpu_src(i)) << "Error at " << i << " and " << cpu_dst(i) << " where it should be " << cpu_src(i); 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /tests/Buffers/UT_OpenCLBuffer2D.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * **************************************************************************** 3 | * Copyright (c) 2015, Robert Lukierski. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, this 10 | * list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | * this list of conditions and the following disclaimer in the documentation 14 | * and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | * **************************************************************************** 32 | * Basic OpenCL Buffer2D Tests. 33 | * **************************************************************************** 34 | */ 35 | // system 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | #include 47 | 48 | // testing framework & libraries 49 | #include 50 | 51 | // google logger 52 | #include 53 | 54 | #include 55 | 56 | class Test_OpenCLBuffer2D : public ::testing::Test 57 | { 58 | public: 59 | Test_OpenCLBuffer2D() 60 | { 61 | 62 | } 63 | 64 | virtual ~Test_OpenCLBuffer2D() 65 | { 66 | 67 | } 68 | }; 69 | 70 | TEST_F(Test_OpenCLBuffer2D, OpenCL) 71 | { 72 | cl_int error; 73 | cl::CommandQueue queue = cl::CommandQueue::getDefault(&error); 74 | 75 | vc::Buffer2DManaged cpu_src(10,20), cpu_dst(10,20); 76 | 77 | for(std::size_t y = 0 ; y < cpu_src.height() ; ++y) 78 | { 79 | for(std::size_t x = 0 ; x < cpu_src.width() ; ++x) 80 | { 81 | cpu_src(x,y) = x * y; 82 | } 83 | } 84 | 85 | vc::Buffer2DManaged bufcl(10, 20, cl::Context::getDefault(), CL_MEM_READ_ONLY); 86 | 87 | bufcl.copyFrom(queue, cpu_src); 88 | 89 | ASSERT_TRUE(bufcl.isValid()); 90 | 91 | vc::Buffer2DView viewcl(bufcl); 92 | 93 | ASSERT_TRUE(viewcl.isValid()); 94 | 95 | cpu_dst.copyFrom(queue, viewcl); 96 | 97 | for(std::size_t y = 0 ; y < cpu_src.height() ; ++y) 98 | { 99 | for(std::size_t x = 0 ; x < cpu_src.width() ; ++x) 100 | { 101 | ASSERT_TRUE(cpu_dst(x,y) == cpu_src(x,y)); 102 | } 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /tests/Buffers/UT_OpenCLBuffer3D.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * **************************************************************************** 3 | * Copyright (c) 2015, Robert Lukierski. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, this 10 | * list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | * this list of conditions and the following disclaimer in the documentation 14 | * and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | * **************************************************************************** 32 | * Basic OpenCL Buffer3D Tests. 33 | * **************************************************************************** 34 | */ 35 | 36 | // system 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | #include 47 | #include 48 | 49 | // testing framework & libraries 50 | #include 51 | 52 | // google logger 53 | #include 54 | 55 | #include 56 | 57 | class Test_OpenCLBuffer3D : public ::testing::Test 58 | { 59 | public: 60 | Test_OpenCLBuffer3D() 61 | { 62 | 63 | } 64 | 65 | virtual ~Test_OpenCLBuffer3D() 66 | { 67 | 68 | } 69 | }; 70 | 71 | TEST_F(Test_OpenCLBuffer3D, OpenCL) 72 | { 73 | cl_int error; 74 | cl::CommandQueue queue = cl::CommandQueue::getDefault(&error); 75 | 76 | vc::Buffer3DManaged cpu_src(10,20,5), cpu_dst(10,20,5); 77 | 78 | for(std::size_t z = 0 ; z < cpu_src.depth() ; ++z) 79 | { 80 | for(std::size_t y = 0 ; y < cpu_src.height() ; ++y) 81 | { 82 | for(std::size_t x = 0 ; x < cpu_src.width() ; ++x) 83 | { 84 | cpu_src(x,y,z) = x * y * z; 85 | } 86 | } 87 | } 88 | 89 | vc::Buffer3DManaged bufcl(10, 20, 5, cl::Context::getDefault(), CL_MEM_READ_ONLY); 90 | 91 | bufcl.copyFrom(queue, cpu_src); 92 | 93 | ASSERT_TRUE(bufcl.isValid()); 94 | 95 | vc::Buffer3DView viewcl(bufcl); 96 | 97 | ASSERT_TRUE(viewcl.isValid()); 98 | 99 | cpu_dst.copyFrom(queue, viewcl); 100 | 101 | for(std::size_t z = 0 ; z < cpu_src.depth() ; ++z) 102 | { 103 | for(std::size_t y = 0 ; y < cpu_src.height() ; ++y) 104 | { 105 | for(std::size_t x = 0 ; x < cpu_src.width() ; ++x) 106 | { 107 | ASSERT_TRUE(cpu_dst(x,y,z) == cpu_src(x,y,z)); 108 | } 109 | } 110 | } 111 | } 112 | -------------------------------------------------------------------------------- /tests/Buffers/UT_OpenCLImage2D.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * **************************************************************************** 3 | * Copyright (c) 2015, Robert Lukierski. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, this 10 | * list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | * this list of conditions and the following disclaimer in the documentation 14 | * and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | * **************************************************************************** 32 | * Basic OpenCL Image2D Tests. 33 | * **************************************************************************** 34 | */ 35 | 36 | // system 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | #include 47 | #include 48 | 49 | // testing framework & libraries 50 | #include 51 | 52 | // google logger 53 | #include 54 | 55 | #include 56 | 57 | class Test_OpenCLImage2D : public ::testing::Test 58 | { 59 | public: 60 | Test_OpenCLImage2D() 61 | { 62 | 63 | } 64 | 65 | virtual ~Test_OpenCLImage2D() 66 | { 67 | 68 | } 69 | }; 70 | 71 | TEST_F(Test_OpenCLImage2D, OpenCL) 72 | { 73 | cl_int error; 74 | cl::CommandQueue queue = cl::CommandQueue::getDefault(&error); 75 | 76 | vc::Buffer2DManaged cpu_src(10,20), cpu_dst(10,20); 77 | 78 | for(std::size_t y = 0 ; y < cpu_src.height() ; ++y) 79 | { 80 | for(std::size_t x = 0 ; x < cpu_src.width() ; ++x) 81 | { 82 | cpu_src(x,y) = x * y; 83 | } 84 | } 85 | 86 | vc::Image2DManaged bufcl(10, 20, cl::Context::getDefault(), CL_MEM_READ_ONLY); 87 | 88 | bufcl.copyFrom(queue, cpu_src); 89 | 90 | ASSERT_TRUE(bufcl.isValid()); 91 | 92 | vc::Image2DView viewcl(bufcl); 93 | 94 | ASSERT_TRUE(viewcl.isValid()); 95 | 96 | cpu_dst.copyFrom(queue, viewcl); 97 | 98 | for(std::size_t y = 0 ; y < cpu_src.height() ; ++y) 99 | { 100 | for(std::size_t x = 0 ; x < cpu_src.width() ; ++x) 101 | { 102 | ASSERT_TRUE(cpu_dst(x,y) == cpu_src(x,y)); 103 | } 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /tests/Buffers/UT_OpenCLPyramid.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * **************************************************************************** 3 | * Copyright (c) 2015, Robert Lukierski. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, this 10 | * list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | * this list of conditions and the following disclaimer in the documentation 14 | * and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | * **************************************************************************** 32 | * Basic OpenCL Pyramid Tests. 33 | * **************************************************************************** 34 | */ 35 | 36 | // system 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | #include 47 | #include 48 | #include 49 | 50 | // testing framework & libraries 51 | #include 52 | 53 | // google logger 54 | #include 55 | 56 | #include 57 | #include 58 | #include 59 | 60 | class Test_OpenCLPyramid : public ::testing::Test 61 | { 62 | public: 63 | Test_OpenCLPyramid() 64 | { 65 | 66 | } 67 | 68 | virtual ~Test_OpenCLPyramid() 69 | { 70 | 71 | } 72 | }; 73 | 74 | TEST_F(Test_OpenCLPyramid, Buffer) 75 | { 76 | cl_int error; 77 | cl::CommandQueue queue = cl::CommandQueue::getDefault(&error); 78 | 79 | vc::BufferPyramidManaged pyr(320,240,cl::Context::getDefault(), CL_MEM_READ_ONLY); 80 | 81 | EXPECT_EQ(pyr[1].width(), (std::size_t)160); 82 | EXPECT_EQ(pyr[1].height(), (std::size_t)120); 83 | } 84 | 85 | TEST_F(Test_OpenCLPyramid, Image) 86 | { 87 | vc::ImagePyramidManaged pyr(320,240,cl::Context::getDefault(), CL_MEM_READ_ONLY); 88 | 89 | EXPECT_EQ(pyr[1].width(), (std::size_t)160); 90 | EXPECT_EQ(pyr[1].height(), (std::size_t)120); 91 | } 92 | -------------------------------------------------------------------------------- /tests/Buffers/UT_Pyramid.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * **************************************************************************** 3 | * Copyright (c) 2015, Robert Lukierski. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, this 10 | * list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | * this list of conditions and the following disclaimer in the documentation 14 | * and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | * **************************************************************************** 32 | * Basic Pyramid Tests. 33 | * **************************************************************************** 34 | */ 35 | 36 | // system 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | #include 47 | #include 48 | #include 49 | 50 | // testing framework & libraries 51 | #include 52 | 53 | // google logger 54 | #include 55 | 56 | #include 57 | #include 58 | #include 59 | 60 | class Test_Pyramid : public ::testing::Test 61 | { 62 | public: 63 | Test_Pyramid() 64 | { 65 | 66 | } 67 | 68 | virtual ~Test_Pyramid() 69 | { 70 | 71 | } 72 | }; 73 | 74 | TEST_F(Test_Pyramid, BufferCPU) 75 | { 76 | vc::BufferPyramidManaged pyr(320,240); 77 | 78 | EXPECT_EQ(pyr[1].width(), (std::size_t)160); 79 | EXPECT_EQ(pyr[1].height(), (std::size_t)120); 80 | } 81 | 82 | TEST_F(Test_Pyramid, ImageCPU) 83 | { 84 | vc::ImagePyramidManaged pyr(320,240); 85 | 86 | EXPECT_EQ(pyr[1].width(), (std::size_t)160); 87 | EXPECT_EQ(pyr[1].height(), (std::size_t)120); 88 | } 89 | -------------------------------------------------------------------------------- /tests/Buffers/UT_Reduction2D.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * **************************************************************************** 3 | * Copyright (c) 2015, Robert Lukierski. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, this 10 | * list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | * this list of conditions and the following disclaimer in the documentation 14 | * and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | * **************************************************************************** 32 | * Basic Reduction2D Tests. 33 | * **************************************************************************** 34 | */ 35 | 36 | // system 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | #include 47 | #include 48 | 49 | // testing framework & libraries 50 | #include 51 | 52 | // google logger 53 | #include 54 | 55 | #include 56 | #include 57 | 58 | class Test_Reduction2D : public ::testing::Test 59 | { 60 | public: 61 | Test_Reduction2D() 62 | { 63 | 64 | } 65 | 66 | virtual ~Test_Reduction2D() 67 | { 68 | 69 | } 70 | }; 71 | 72 | TEST_F(Test_Reduction2D, CPU) 73 | { 74 | vc::Buffer2DManaged bufcpu(128,128); 75 | 76 | float ground_truth = 0.0f; 77 | 78 | // fill 79 | for(std::size_t y = 0 ; y< bufcpu.height() ; ++y) 80 | { 81 | for(std::size_t x = 0 ; x < bufcpu.width() ; ++x) 82 | { 83 | const float val = 1.0f; 84 | bufcpu(x,y) = val; 85 | ground_truth += bufcpu(x,y); 86 | } 87 | } 88 | 89 | float our_result = vc::launchParallelReduce(bufcpu.width(), bufcpu.height(), 0.0f, 90 | [&](const std::size_t x, const std::size_t y, float& ret) 91 | { 92 | ret += bufcpu(x,y); 93 | }, 94 | [&](const float& v1, const float& v2) 95 | { 96 | return v1 + v2; 97 | }); 98 | 99 | ASSERT_FLOAT_EQ(ground_truth, our_result); 100 | } 101 | -------------------------------------------------------------------------------- /tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2016, Robert Lukierski. 2 | # All rights reserved. 3 | # 4 | # Redistribution and use in source and binary forms, with or without 5 | # modification, are permitted provided that the following conditions are met: 6 | # 7 | # Redistributions of source code must retain the above copyright notice, this 8 | # list of conditions and the following disclaimer. 9 | # 10 | # Redistributions in binary form must reproduce the above copyright notice, 11 | # this list of conditions and the following disclaimer in the documentation 12 | # and/or other materials provided with the distribution. 13 | # 14 | # Neither the name of the copyright holder nor the names of its 15 | # contributors may be used to endorse or promote products derived from 16 | # this software without specific prior written permission. 17 | # 18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | # ------------------------------------------------------------------------------ 29 | 30 | cmake_minimum_required(VERSION 3.1) 31 | 32 | # ------------------------------------------------------------------------------ 33 | # Dependencies 34 | # ------------------------------------------------------------------------------ 35 | # Google Test 36 | find_package(GTest REQUIRED QUIET) 37 | include_directories(${GTEST_INCLUDE_DIR}) 38 | 39 | # Sophus (Optional) 40 | find_package(Sophus QUIET) 41 | if(Sophus_FOUND) 42 | include_directories(${Sophus_INCLUDE_DIRS}) 43 | add_definitions(-DCORE_TESTS_HAVE_SOPHUS) 44 | endif() 45 | 46 | include_directories(.) 47 | 48 | # ------------------------------------------------------------------------------ 49 | # Build subtests 50 | # ------------------------------------------------------------------------------ 51 | add_subdirectory(Buffers) 52 | add_subdirectory(Control) 53 | add_subdirectory(IO) 54 | add_subdirectory(Image) 55 | add_subdirectory(Math) 56 | add_subdirectory(Types) 57 | add_subdirectory(WrapGL) 58 | 59 | # ========================================================================= 60 | # Build top level tests 61 | # ========================================================================= 62 | set(TEST_SOURCES 63 | tests_main.cpp 64 | UT_Platform.cpp 65 | EigenConfigCPU.cpp 66 | UT_EigenConfig.cpp 67 | ) 68 | 69 | if(OpenCL_FOUND) 70 | list(APPEND TEST_SOURCES UT_OpenCL.cpp) 71 | endif() 72 | 73 | if(CUDA_FOUND) 74 | set(TEST_KERNEL_SOURCES 75 | EigenConfigCUDA.cu 76 | ) 77 | endif() 78 | 79 | add_executable(UT_VisionCore ${TEST_SOURCES} ${TEST_KERNEL_SOURCES}) 80 | target_link_libraries(UT_VisionCore PUBLIC ${GTEST_LIBRARY} ${PROJECT_NAME}) 81 | if(CUDA_FOUND) 82 | target_link_libraries(UT_VisionCore PUBLIC ${CUDA_LIBRARIES}) 83 | endif() 84 | if(OpenCL_FOUND) 85 | target_link_libraries(UT_VisionCore PUBLIC ${OpenCL_LIBRARIES}) 86 | endif() 87 | add_test(UT_VisionCore UT_VisionCore --gtest_output=xml:UT_VisionCore.xml) 88 | -------------------------------------------------------------------------------- /tests/Control/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2016, Robert Lukierski. 2 | # All rights reserved. 3 | # 4 | # Redistribution and use in source and binary forms, with or without 5 | # modification, are permitted provided that the following conditions are met: 6 | # 7 | # Redistributions of source code must retain the above copyright notice, this 8 | # list of conditions and the following disclaimer. 9 | # 10 | # Redistributions in binary form must reproduce the above copyright notice, 11 | # this list of conditions and the following disclaimer in the documentation 12 | # and/or other materials provided with the distribution. 13 | # 14 | # Neither the name of the copyright holder nor the names of its 15 | # contributors may be used to endorse or promote products derived from 16 | # this software without specific prior written permission. 17 | # 18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | # ------------------------------------------------------------------------------ 29 | 30 | cmake_minimum_required(VERSION 3.1) 31 | 32 | include_directories(.) 33 | 34 | set(TEST_SOURCES 35 | ../tests_main.cpp 36 | UT_PID.cpp 37 | UT_VelocityProfile.cpp 38 | ) 39 | 40 | add_executable(UT_VisionCore_Control ${TEST_SOURCES}) 41 | target_link_libraries(UT_VisionCore_Control PUBLIC ${GTEST_LIBRARY} ${PROJECT_NAME}) 42 | add_test(UT_VisionCore_Control UT_VisionCore_Control --gtest_output=xml:UT_VisionCore_Control.xml) 43 | -------------------------------------------------------------------------------- /tests/Control/UT_PID.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * **************************************************************************** 3 | * Copyright (c) 2015, Robert Lukierski. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, this 10 | * list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | * this list of conditions and the following disclaimer in the documentation 14 | * and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | * **************************************************************************** 32 | */ 33 | 34 | // system 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | #include 47 | 48 | // testing framework & libraries 49 | #include 50 | 51 | // google logger 52 | #include 53 | 54 | #include 55 | 56 | class Test_PID : public ::testing::Test 57 | { 58 | public: 59 | Test_PID() 60 | { 61 | 62 | } 63 | 64 | virtual ~Test_PID() 65 | { 66 | 67 | } 68 | }; 69 | 70 | TEST_F(Test_PID, Dummy) 71 | { 72 | 73 | } 74 | -------------------------------------------------------------------------------- /tests/Control/UT_VelocityProfile.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * **************************************************************************** 3 | * Copyright (c) 2015, Robert Lukierski. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, this 10 | * list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | * this list of conditions and the following disclaimer in the documentation 14 | * and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | * **************************************************************************** 32 | */ 33 | 34 | // system 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | #include 47 | 48 | // testing framework & libraries 49 | #include 50 | 51 | // google logger 52 | #include 53 | 54 | #include 55 | 56 | class Test_VelocityProfile : public ::testing::Test 57 | { 58 | public: 59 | Test_VelocityProfile() 60 | { 61 | 62 | } 63 | 64 | virtual ~Test_VelocityProfile() 65 | { 66 | 67 | } 68 | }; 69 | 70 | TEST_F(Test_VelocityProfile, Dummy) 71 | { 72 | vc::control::TrapezoidalVelocityProfile vpr; 73 | } 74 | -------------------------------------------------------------------------------- /tests/EigenConfigCPU.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * **************************************************************************** 3 | * Copyright (c) 2015, Robert Lukierski. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, this 10 | * list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | * this list of conditions and the following disclaimer in the documentation 14 | * and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | * **************************************************************************** 32 | */ 33 | 34 | #include 35 | 36 | void GetEigenConfigCPU(float* data, const Sophus::SE3f& v) 37 | { 38 | getEigenConfiguration(data,v); 39 | } 40 | -------------------------------------------------------------------------------- /tests/EigenConfigCUDA.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * **************************************************************************** 3 | * Copyright (c) 2015, Robert Lukierski. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, this 10 | * list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | * this list of conditions and the following disclaimer in the documentation 14 | * and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | * **************************************************************************** 32 | */ 33 | 34 | #include 35 | #include 36 | 37 | void GetEigenConfigCUDAHost(float* data, const Sophus::SE3f& v) 38 | { 39 | getEigenConfiguration(data,v); 40 | } 41 | 42 | __global__ void Kernel_GetEigenConfig(vc::Buffer1DView buf, const Sophus::SE3f v) 43 | { 44 | getEigenConfiguration(buf.ptr(),v); 45 | } 46 | 47 | void GetEigenConfigCUDADevice(float* data, const Sophus::SE3f& v) 48 | { 49 | vc::Buffer1DManaged cpu_buf(MaxEigenConfigurationCount); 50 | vc::Buffer1DManaged gpu_buf(MaxEigenConfigurationCount); 51 | 52 | Kernel_GetEigenConfig<<<1,1>>>(gpu_buf, v); 53 | 54 | // wait for it 55 | const cudaError err = cudaDeviceSynchronize(); 56 | if(err != cudaSuccess) 57 | { 58 | throw vc::CUDAException(err, "Error launching the kernel"); 59 | } 60 | 61 | cpu_buf.copyFrom(gpu_buf); 62 | for(std::size_t i = 0 ; i < MaxEigenConfigurationCount ; ++i) 63 | { 64 | data[i] = cpu_buf[i]; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /tests/EigenConfigCUDA.cu: -------------------------------------------------------------------------------- 1 | /** 2 | * **************************************************************************** 3 | * Copyright (c) 2015, Robert Lukierski. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, this 10 | * list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | * this list of conditions and the following disclaimer in the documentation 14 | * and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | * **************************************************************************** 32 | */ 33 | 34 | #include 35 | -------------------------------------------------------------------------------- /tests/IO/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2016, Robert Lukierski. 2 | # All rights reserved. 3 | # 4 | # Redistribution and use in source and binary forms, with or without 5 | # modification, are permitted provided that the following conditions are met: 6 | # 7 | # Redistributions of source code must retain the above copyright notice, this 8 | # list of conditions and the following disclaimer. 9 | # 10 | # Redistributions in binary form must reproduce the above copyright notice, 11 | # this list of conditions and the following disclaimer in the documentation 12 | # and/or other materials provided with the distribution. 13 | # 14 | # Neither the name of the copyright holder nor the names of its 15 | # contributors may be used to endorse or promote products derived from 16 | # this software without specific prior written permission. 17 | # 18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | # ------------------------------------------------------------------------------ 29 | 30 | cmake_minimum_required(VERSION 3.1) 31 | 32 | include_directories(.) 33 | 34 | set(TEST_SOURCES 35 | ../tests_main.cpp 36 | UT_PLYModel.cpp 37 | ) 38 | 39 | add_executable(UT_VisionCore_IO ${TEST_SOURCES}) 40 | target_link_libraries(UT_VisionCore_IO PUBLIC ${GTEST_LIBRARY} ${PROJECT_NAME}) 41 | add_test(UT_VisionCore_IO UT_VisionCore_IO --gtest_output=xml:UT_VisionCore_IO.xml) 42 | -------------------------------------------------------------------------------- /tests/IO/UT_PLYModel.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * **************************************************************************** 3 | * Copyright (c) 2016, Robert Lukierski. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, this 10 | * list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | * this list of conditions and the following disclaimer in the documentation 14 | * and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | * **************************************************************************** 32 | */ 33 | 34 | // system 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | 47 | // testing framework & libraries 48 | #include 49 | 50 | #include 51 | 52 | class Test_PLYModel : public ::testing::Test 53 | { 54 | public: 55 | Test_PLYModel() 56 | { 57 | 58 | } 59 | 60 | virtual ~Test_PLYModel() 61 | { 62 | 63 | } 64 | }; 65 | 66 | TEST_F(Test_PLYModel, Live) 67 | { 68 | 69 | 70 | } 71 | -------------------------------------------------------------------------------- /tests/Image/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2016, Robert Lukierski. 2 | # All rights reserved. 3 | # 4 | # Redistribution and use in source and binary forms, with or without 5 | # modification, are permitted provided that the following conditions are met: 6 | # 7 | # Redistributions of source code must retain the above copyright notice, this 8 | # list of conditions and the following disclaimer. 9 | # 10 | # Redistributions in binary form must reproduce the above copyright notice, 11 | # this list of conditions and the following disclaimer in the documentation 12 | # and/or other materials provided with the distribution. 13 | # 14 | # Neither the name of the copyright holder nor the names of its 15 | # contributors may be used to endorse or promote products derived from 16 | # this software without specific prior written permission. 17 | # 18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | # ------------------------------------------------------------------------------ 29 | 30 | cmake_minimum_required(VERSION 3.1) 31 | 32 | include_directories(.) 33 | 34 | set(TEST_SOURCES 35 | ../tests_main.cpp 36 | UT_ImagePatch.cpp 37 | ) 38 | 39 | add_executable(UT_VisionCore_Image ${TEST_SOURCES}) 40 | target_link_libraries(UT_VisionCore_Image PUBLIC ${GTEST_LIBRARY} ${PROJECT_NAME}) 41 | add_test(UT_VisionCore_Image UT_VisionCore_Image --gtest_output=xml:UT_VisionCore_Image.xml) 42 | -------------------------------------------------------------------------------- /tests/Image/UT_ImagePatch.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * **************************************************************************** 3 | * Copyright (c) 2015, Robert Lukierski. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, this 10 | * list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | * this list of conditions and the following disclaimer in the documentation 14 | * and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | * **************************************************************************** 32 | */ 33 | 34 | // system 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | #include 47 | 48 | // testing framework & libraries 49 | #include 50 | 51 | // google logger 52 | #include 53 | 54 | #include 55 | 56 | class Test_ImagePatch : public ::testing::Test 57 | { 58 | public: 59 | Test_ImagePatch() 60 | { 61 | 62 | } 63 | 64 | virtual ~Test_ImagePatch() 65 | { 66 | 67 | } 68 | }; 69 | 70 | TEST_F(Test_ImagePatch, Dummy) 71 | { 72 | 73 | } 74 | -------------------------------------------------------------------------------- /tests/Math/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2016, Robert Lukierski. 2 | # All rights reserved. 3 | # 4 | # Redistribution and use in source and binary forms, with or without 5 | # modification, are permitted provided that the following conditions are met: 6 | # 7 | # Redistributions of source code must retain the above copyright notice, this 8 | # list of conditions and the following disclaimer. 9 | # 10 | # Redistributions in binary form must reproduce the above copyright notice, 11 | # this list of conditions and the following disclaimer in the documentation 12 | # and/or other materials provided with the distribution. 13 | # 14 | # Neither the name of the copyright holder nor the names of its 15 | # contributors may be used to endorse or promote products derived from 16 | # this software without specific prior written permission. 17 | # 18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | # ------------------------------------------------------------------------------ 29 | 30 | cmake_minimum_required(VERSION 3.1) 31 | 32 | include_directories(.) 33 | 34 | set(TEST_SOURCES 35 | ../tests_main.cpp 36 | #UT_CordSystems.cpp 37 | #UT_DenavitHartenberg.cpp 38 | #UT_Divergence.cpp 39 | #UT_Fitting.cpp 40 | #UT_HammingDistance.cpp 41 | #UT_Kalman.cpp 42 | #UT_LeastSquares.cpp 43 | #UT_LocalParamSE3.cpp 44 | #UT_LossFunctions.cpp 45 | #UT_PolarSpherical.cpp 46 | #UT_Random.cpp 47 | #UT_RANSAC.cpp 48 | UT_Statistics.cpp 49 | #UT_TinySolver.cpp 50 | ) 51 | 52 | add_executable(UT_VisionCore_Math ${TEST_SOURCES}) 53 | target_link_libraries(UT_VisionCore_Math PUBLIC ${GTEST_LIBRARY} ${PROJECT_NAME}) 54 | if(CUDA_FOUND) 55 | target_link_libraries(UT_VisionCore_Math PUBLIC ${CUDA_LIBRARIES}) 56 | endif() 57 | if(OpenCL_FOUND) 58 | target_link_libraries(UT_VisionCore_Math PUBLIC ${OpenCL_LIBRARIES}) 59 | endif() 60 | add_test(UT_VisionCore_Math UT_VisionCore_Math --gtest_output=xml:UT_VisionCore_Math.xml) 61 | -------------------------------------------------------------------------------- /tests/Math/UT_CordSystems.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * **************************************************************************** 3 | * Copyright (c) 2015, Robert Lukierski. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, this 10 | * list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | * this list of conditions and the following disclaimer in the documentation 14 | * and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | * **************************************************************************** 32 | */ 33 | // system 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | 46 | // testing framework & libraries 47 | #include 48 | 49 | // google logger 50 | #include 51 | 52 | #include 53 | 54 | class Test_CordSystems : public ::testing::Test 55 | { 56 | public: 57 | Test_CordSystems() 58 | { 59 | 60 | } 61 | 62 | virtual ~Test_CordSystems() 63 | { 64 | 65 | } 66 | }; 67 | 68 | TEST_F(Test_CordSystems, Dummy) 69 | { 70 | 71 | } 72 | -------------------------------------------------------------------------------- /tests/Math/UT_DenavitHartenberg.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * **************************************************************************** 3 | * Copyright (c) 2015, Robert Lukierski. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, this 10 | * list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | * this list of conditions and the following disclaimer in the documentation 14 | * and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | * **************************************************************************** 32 | */ 33 | // system 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | 46 | // testing framework & libraries 47 | #include 48 | 49 | // google logger 50 | #include 51 | 52 | #include 53 | 54 | class Test_DenavitHartenberg : public ::testing::Test 55 | { 56 | public: 57 | Test_DenavitHartenberg() 58 | { 59 | 60 | } 61 | 62 | virtual ~Test_DenavitHartenberg() 63 | { 64 | 65 | } 66 | }; 67 | 68 | TEST_F(Test_DenavitHartenberg, Dummy) 69 | { 70 | 71 | } 72 | -------------------------------------------------------------------------------- /tests/Math/UT_Divergence.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * **************************************************************************** 3 | * Copyright (c) 2015, Robert Lukierski. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, this 10 | * list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | * this list of conditions and the following disclaimer in the documentation 14 | * and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | * **************************************************************************** 32 | */ 33 | 34 | // system 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | 47 | // testing framework & libraries 48 | #include 49 | 50 | // google logger 51 | #include 52 | 53 | #include 54 | 55 | class Test_Divergence : public ::testing::Test 56 | { 57 | public: 58 | Test_Divergence() 59 | { 60 | 61 | } 62 | 63 | virtual ~Test_Divergence() 64 | { 65 | 66 | } 67 | }; 68 | 69 | TEST_F(Test_Divergence, Dummy) 70 | { 71 | 72 | } 73 | -------------------------------------------------------------------------------- /tests/Math/UT_Fitting.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * **************************************************************************** 3 | * Copyright (c) 2015, Robert Lukierski. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, this 10 | * list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | * this list of conditions and the following disclaimer in the documentation 14 | * and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | * **************************************************************************** 32 | */ 33 | 34 | // system 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | 47 | // testing framework & libraries 48 | #include 49 | 50 | // google logger 51 | #include 52 | 53 | #include 54 | #include 55 | 56 | class Test_Fitting : public ::testing::Test 57 | { 58 | public: 59 | Test_Fitting() 60 | { 61 | 62 | } 63 | 64 | virtual ~Test_Fitting() 65 | { 66 | 67 | } 68 | }; 69 | 70 | 71 | TEST_F(Test_Fitting, Dummy) 72 | { 73 | 74 | } 75 | -------------------------------------------------------------------------------- /tests/Math/UT_HammingDistance.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * **************************************************************************** 3 | * Copyright (c) 2015, Robert Lukierski. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, this 10 | * list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | * this list of conditions and the following disclaimer in the documentation 14 | * and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | * **************************************************************************** 32 | */ 33 | 34 | // system 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | 47 | // testing framework & libraries 48 | #include 49 | 50 | // google logger 51 | #include 52 | 53 | #include 54 | 55 | class Test_HammingDistance : public ::testing::Test 56 | { 57 | public: 58 | Test_HammingDistance() 59 | { 60 | 61 | } 62 | 63 | virtual ~Test_HammingDistance() 64 | { 65 | 66 | } 67 | }; 68 | 69 | TEST_F(Test_HammingDistance, Dummy) 70 | { 71 | 72 | } 73 | -------------------------------------------------------------------------------- /tests/Math/UT_Kalman.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * **************************************************************************** 3 | * Copyright (c) 2015, Robert Lukierski. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, this 10 | * list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | * this list of conditions and the following disclaimer in the documentation 14 | * and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | * **************************************************************************** 32 | */ 33 | // system 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | 46 | // testing framework & libraries 47 | #include 48 | 49 | // google logger 50 | #include 51 | 52 | #include 53 | 54 | class Test_Kalman : public ::testing::Test 55 | { 56 | public: 57 | Test_Kalman() 58 | { 59 | 60 | } 61 | 62 | virtual ~Test_Kalman() 63 | { 64 | 65 | } 66 | }; 67 | 68 | TEST_F(Test_Kalman, Dummy) 69 | { 70 | 71 | } 72 | -------------------------------------------------------------------------------- /tests/Math/UT_LeastSquares.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * **************************************************************************** 3 | * Copyright (c) 2015, Robert Lukierski. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, this 10 | * list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | * this list of conditions and the following disclaimer in the documentation 14 | * and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | * **************************************************************************** 32 | */ 33 | 34 | // system 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | 47 | // testing framework & libraries 48 | #include 49 | 50 | // google logger 51 | #include 52 | 53 | #include 54 | 55 | class Test_LeastSquares : public ::testing::Test 56 | { 57 | public: 58 | Test_LeastSquares() 59 | { 60 | 61 | } 62 | 63 | virtual ~Test_LeastSquares() 64 | { 65 | 66 | } 67 | }; 68 | 69 | TEST_F(Test_LeastSquares, Dummy) 70 | { 71 | 72 | } 73 | -------------------------------------------------------------------------------- /tests/Math/UT_LiangBarsky.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * **************************************************************************** 3 | * Copyright (c) 2015, Robert Lukierski. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, this 10 | * list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | * this list of conditions and the following disclaimer in the documentation 14 | * and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | * **************************************************************************** 32 | */ 33 | // system 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | 46 | // testing framework & libraries 47 | #include 48 | 49 | // google logger 50 | #include 51 | 52 | #include 53 | 54 | class Test_LiangBarsky : public ::testing::Test 55 | { 56 | public: 57 | Test_LiangBarsky() 58 | { 59 | 60 | } 61 | 62 | virtual ~Test_LiangBarsky() 63 | { 64 | 65 | } 66 | }; 67 | 68 | TEST_F(Test_LiangBarsky, Dummy) 69 | { 70 | 71 | } 72 | -------------------------------------------------------------------------------- /tests/Math/UT_LocalParamSE3.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * **************************************************************************** 3 | * Copyright (c) 2015, Robert Lukierski. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, this 10 | * list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | * this list of conditions and the following disclaimer in the documentation 14 | * and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | * **************************************************************************** 32 | */ 33 | 34 | // system 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | 47 | // testing framework & libraries 48 | #include 49 | 50 | // google logger 51 | #include 52 | 53 | #include 54 | 55 | class Test_LocalParamSE3 : public ::testing::Test 56 | { 57 | public: 58 | Test_LocalParamSE3() 59 | { 60 | 61 | } 62 | 63 | virtual ~Test_LocalParamSE3() 64 | { 65 | 66 | } 67 | }; 68 | 69 | TEST_F(Test_LocalParamSE3, Dummy) 70 | { 71 | 72 | } 73 | -------------------------------------------------------------------------------- /tests/Math/UT_LossFunctions.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * **************************************************************************** 3 | * Copyright (c) 2015, Robert Lukierski. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, this 10 | * list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | * this list of conditions and the following disclaimer in the documentation 14 | * and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | * **************************************************************************** 32 | */ 33 | 34 | // system 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | 47 | // testing framework & libraries 48 | #include 49 | 50 | // google logger 51 | #include 52 | 53 | #include 54 | 55 | class Test_LossFunctions : public ::testing::Test 56 | { 57 | public: 58 | Test_LossFunctions() 59 | { 60 | 61 | } 62 | 63 | virtual ~Test_LossFunctions() 64 | { 65 | 66 | } 67 | }; 68 | 69 | TEST_F(Test_LossFunctions, Dummy) 70 | { 71 | 72 | } 73 | -------------------------------------------------------------------------------- /tests/Math/UT_PolarSpherical.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * **************************************************************************** 3 | * Copyright (c) 2015, Robert Lukierski. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, this 10 | * list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | * this list of conditions and the following disclaimer in the documentation 14 | * and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | * **************************************************************************** 32 | */ 33 | 34 | // system 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | 47 | // testing framework & libraries 48 | #include 49 | 50 | // google logger 51 | #include 52 | 53 | #include 54 | 55 | class Test_PolarSpherical : public ::testing::Test 56 | { 57 | public: 58 | Test_PolarSpherical() 59 | { 60 | 61 | } 62 | 63 | virtual ~Test_PolarSpherical() 64 | { 65 | 66 | } 67 | }; 68 | 69 | TEST_F(Test_PolarSpherical, Dummy) 70 | { 71 | 72 | } 73 | -------------------------------------------------------------------------------- /tests/Math/UT_RANSAC.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * **************************************************************************** 3 | * Copyright (c) 2015, Robert Lukierski. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, this 10 | * list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | * this list of conditions and the following disclaimer in the documentation 14 | * and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | * **************************************************************************** 32 | */ 33 | // system 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | 46 | // testing framework & libraries 47 | #include 48 | 49 | // google logger 50 | #include 51 | 52 | #include 53 | 54 | class Test_RANSAC : public ::testing::Test 55 | { 56 | public: 57 | Test_RANSAC() 58 | { 59 | 60 | } 61 | 62 | virtual ~Test_RANSAC() 63 | { 64 | 65 | } 66 | }; 67 | 68 | TEST_F(Test_RANSAC, Lines2D) 69 | { 70 | 71 | } 72 | -------------------------------------------------------------------------------- /tests/Math/UT_Random.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * **************************************************************************** 3 | * Copyright (c) 2015, Robert Lukierski. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, this 10 | * list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | * this list of conditions and the following disclaimer in the documentation 14 | * and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | * **************************************************************************** 32 | */ 33 | 34 | // system 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | 47 | // testing framework & libraries 48 | #include 49 | 50 | // google logger 51 | #include 52 | 53 | #include 54 | 55 | class Test_Random : public ::testing::Test 56 | { 57 | public: 58 | Test_Random() 59 | { 60 | 61 | } 62 | 63 | virtual ~Test_Random() 64 | { 65 | 66 | } 67 | }; 68 | 69 | TEST_F(Test_Random, Dummy) 70 | { 71 | vc::Random::seed(); 72 | LOG(INFO) << "RInt: " << vc::Random::value(5,10); 73 | } 74 | -------------------------------------------------------------------------------- /tests/Math/UT_Statistics.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * **************************************************************************** 3 | * Copyright (c) 2015, Robert Lukierski. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, this 10 | * list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | * this list of conditions and the following disclaimer in the documentation 14 | * and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | * **************************************************************************** 32 | */ 33 | 34 | // system 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | 47 | // testing framework & libraries 48 | #include 49 | 50 | // google logger 51 | #include 52 | 53 | #include 54 | #include 55 | #include 56 | 57 | class Test_Statistics : public ::testing::Test 58 | { 59 | public: 60 | Test_Statistics() 61 | { 62 | 63 | } 64 | 65 | virtual ~Test_Statistics() 66 | { 67 | 68 | } 69 | }; 70 | 71 | TEST_F(Test_Statistics, AllanDeviation) 72 | { 73 | 74 | } 75 | -------------------------------------------------------------------------------- /tests/Types/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2016, Robert Lukierski. 2 | # All rights reserved. 3 | # 4 | # Redistribution and use in source and binary forms, with or without 5 | # modification, are permitted provided that the following conditions are met: 6 | # 7 | # Redistributions of source code must retain the above copyright notice, this 8 | # list of conditions and the following disclaimer. 9 | # 10 | # Redistributions in binary form must reproduce the above copyright notice, 11 | # this list of conditions and the following disclaimer in the documentation 12 | # and/or other materials provided with the distribution. 13 | # 14 | # Neither the name of the copyright holder nor the names of its 15 | # contributors may be used to endorse or promote products derived from 16 | # this software without specific prior written permission. 17 | # 18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | # ------------------------------------------------------------------------------ 29 | 30 | cmake_minimum_required(VERSION 3.1) 31 | 32 | include_directories(.) 33 | 34 | set(TEST_SOURCES 35 | ../tests_main.cpp 36 | UT_AxisAlignedBoundingBox.cpp 37 | UT_CostVolumeElement.cpp 38 | UT_Gaussian.cpp 39 | UT_Hypersphere.cpp 40 | UT_Polynomial.cpp 41 | UT_Rectangle.cpp 42 | UT_SDF.cpp 43 | UT_SquareUpperTriangularMatrix.cpp 44 | ) 45 | 46 | add_executable(UT_VisionCore_Types ${TEST_SOURCES}) 47 | target_link_libraries(UT_VisionCore_Types PUBLIC ${GTEST_LIBRARY} ${PROJECT_NAME}) 48 | add_test(UT_VisionCore_Types UT_VisionCore_Types --gtest_output=xml:UT_VisionCore_Types.xml) 49 | -------------------------------------------------------------------------------- /tests/Types/UT_AxisAlignedBoundingBox.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * **************************************************************************** 3 | * Copyright (c) 2015, Robert Lukierski. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, this 10 | * list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | * this list of conditions and the following disclaimer in the documentation 14 | * and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | * **************************************************************************** 32 | */ 33 | 34 | // system 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | 47 | // testing framework & libraries 48 | #include 49 | 50 | // google logger 51 | #include 52 | 53 | #include 54 | 55 | class Test_AxisAlignedBoundingBox : public ::testing::Test 56 | { 57 | public: 58 | Test_AxisAlignedBoundingBox() 59 | { 60 | 61 | } 62 | 63 | virtual ~Test_AxisAlignedBoundingBox() 64 | { 65 | 66 | } 67 | }; 68 | 69 | 70 | TEST_F(Test_AxisAlignedBoundingBox, Dummy) 71 | { 72 | 73 | 74 | } 75 | -------------------------------------------------------------------------------- /tests/Types/UT_CostVolumeElement.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * **************************************************************************** 3 | * Copyright (c) 2015, Robert Lukierski. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, this 10 | * list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | * this list of conditions and the following disclaimer in the documentation 14 | * and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | * **************************************************************************** 32 | */ 33 | 34 | // system 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | 47 | // testing framework & libraries 48 | #include 49 | 50 | // google logger 51 | #include 52 | 53 | #include 54 | 55 | class Test_CostVolumeElement : public ::testing::Test 56 | { 57 | public: 58 | Test_CostVolumeElement() 59 | { 60 | 61 | } 62 | 63 | virtual ~Test_CostVolumeElement() 64 | { 65 | 66 | } 67 | }; 68 | 69 | 70 | TEST_F(Test_CostVolumeElement, Dummy) 71 | { 72 | 73 | 74 | } 75 | -------------------------------------------------------------------------------- /tests/Types/UT_Gaussian.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * **************************************************************************** 3 | * Copyright (c) 2015, Robert Lukierski. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, this 10 | * list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | * this list of conditions and the following disclaimer in the documentation 14 | * and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | * **************************************************************************** 32 | */ 33 | // system 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | 46 | // testing framework & libraries 47 | #include 48 | 49 | // google logger 50 | #include 51 | 52 | #include 53 | 54 | class Test_Gaussian : public ::testing::Test 55 | { 56 | public: 57 | Test_Gaussian() 58 | { 59 | 60 | } 61 | 62 | virtual ~Test_Gaussian() 63 | { 64 | 65 | } 66 | }; 67 | 68 | 69 | TEST_F(Test_Gaussian, Dummy) 70 | { 71 | 72 | 73 | } 74 | -------------------------------------------------------------------------------- /tests/Types/UT_Hypersphere.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * **************************************************************************** 3 | * Copyright (c) 2015, Robert Lukierski. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, this 10 | * list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | * this list of conditions and the following disclaimer in the documentation 14 | * and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | * **************************************************************************** 32 | */ 33 | 34 | // system 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | 47 | // testing framework & libraries 48 | #include 49 | 50 | // google logger 51 | #include 52 | 53 | #include 54 | 55 | class Test_Hypersphere : public ::testing::Test 56 | { 57 | public: 58 | Test_Hypersphere() 59 | { 60 | 61 | } 62 | 63 | virtual ~Test_Hypersphere() 64 | { 65 | 66 | } 67 | }; 68 | 69 | 70 | TEST_F(Test_Hypersphere, Dummy) 71 | { 72 | 73 | 74 | } 75 | -------------------------------------------------------------------------------- /tests/Types/UT_Polynomial.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * **************************************************************************** 3 | * Copyright (c) 2015, Robert Lukierski. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, this 10 | * list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | * this list of conditions and the following disclaimer in the documentation 14 | * and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | * **************************************************************************** 32 | */ 33 | 34 | // system 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | #include 47 | 48 | // testing framework & libraries 49 | #include 50 | 51 | // google logger 52 | #include 53 | 54 | #include 55 | 56 | class Test_Polynomial : public ::testing::Test 57 | { 58 | public: 59 | Test_Polynomial() 60 | { 61 | 62 | } 63 | 64 | virtual ~Test_Polynomial() 65 | { 66 | 67 | } 68 | }; 69 | 70 | 71 | TEST_F(Test_Polynomial, Dummy) 72 | { 73 | 74 | } 75 | -------------------------------------------------------------------------------- /tests/Types/UT_Rectangle.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * **************************************************************************** 3 | * Copyright (c) 2015, Robert Lukierski. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, this 10 | * list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | * this list of conditions and the following disclaimer in the documentation 14 | * and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | * **************************************************************************** 32 | */ 33 | 34 | // system 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | 47 | // testing framework & libraries 48 | #include 49 | 50 | // google logger 51 | #include 52 | 53 | #include 54 | 55 | class Test_Rectangle : public ::testing::Test 56 | { 57 | public: 58 | Test_Rectangle() 59 | { 60 | 61 | } 62 | 63 | virtual ~Test_Rectangle() 64 | { 65 | 66 | } 67 | }; 68 | 69 | 70 | TEST_F(Test_Rectangle, Dummy) 71 | { 72 | 73 | 74 | } 75 | -------------------------------------------------------------------------------- /tests/Types/UT_SDF.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * **************************************************************************** 3 | * Copyright (c) 2015, Robert Lukierski. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, this 10 | * list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | * this list of conditions and the following disclaimer in the documentation 14 | * and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | * **************************************************************************** 32 | */ 33 | 34 | // system 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | 47 | // testing framework & libraries 48 | #include 49 | 50 | // google logger 51 | #include 52 | 53 | #include 54 | 55 | class Test_SDF : public ::testing::Test 56 | { 57 | public: 58 | Test_SDF() 59 | { 60 | 61 | } 62 | 63 | virtual ~Test_SDF() 64 | { 65 | 66 | } 67 | }; 68 | 69 | 70 | TEST_F(Test_SDF, Dummy) 71 | { 72 | 73 | 74 | } 75 | -------------------------------------------------------------------------------- /tests/Types/UT_SquareUpperTriangularMatrix.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * **************************************************************************** 3 | * Copyright (c) 2017, Robert Lukierski. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, this 10 | * list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | * this list of conditions and the following disclaimer in the documentation 14 | * and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | * **************************************************************************** 32 | */ 33 | 34 | // system 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | 47 | // testing framework & libraries 48 | #include 49 | 50 | // google logger 51 | #include 52 | 53 | #include 54 | 55 | class Test_SquareUpperTriangularMatrix : public ::testing::Test 56 | { 57 | public: 58 | Test_SquareUpperTriangularMatrix() 59 | { 60 | 61 | } 62 | 63 | virtual ~Test_SquareUpperTriangularMatrix() 64 | { 65 | 66 | } 67 | }; 68 | 69 | 70 | TEST_F(Test_SquareUpperTriangularMatrix, Dummy) 71 | { 72 | Eigen::Vector3f tmp(1.0f, 2.0f, 3.0f); 73 | 74 | vc::types::SquareUpperTriangularMatrix sutm; 75 | sutm.coeff()(0) = 1.0f; 76 | sutm.coeff()(1) = 2.0f; 77 | sutm.coeff()(2) = 3.0f; 78 | sutm.coeff()(3) = 4.0f; 79 | sutm.coeff()(4) = 5.0f; 80 | sutm.coeff()(5) = 6.0f; 81 | 82 | } 83 | -------------------------------------------------------------------------------- /tests/UT_OpenCL.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * **************************************************************************** 3 | * Copyright (c) 2015, Robert Lukierski. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, this 10 | * list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | * this list of conditions and the following disclaimer in the documentation 14 | * and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | * **************************************************************************** 32 | */ 33 | // system 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | 47 | // testing framework & libraries 48 | #include 49 | 50 | // google logger 51 | #include 52 | 53 | #include 54 | 55 | class Test_OpenCL : public ::testing::Test 56 | { 57 | public: 58 | Test_OpenCL() 59 | { 60 | 61 | } 62 | 63 | virtual ~Test_OpenCL() 64 | { 65 | 66 | } 67 | }; 68 | 69 | TEST_F(Test_OpenCL, DevicesContexts) 70 | { 71 | std::vector platforms; 72 | 73 | cl::Platform::get(&platforms); 74 | 75 | for(cl::Platform& plat : platforms) 76 | { 77 | LOG(INFO) << "Platform " << plat.getInfo() << " / " << plat.getInfo() << " / " << plat.getInfo() << " / " << plat.getInfo() << " / " << plat.getInfo(); 78 | 79 | std::vector devs; 80 | plat.getDevices(CL_DEVICE_TYPE_ALL, &devs); 81 | 82 | for(cl::Device& dev : devs) 83 | { 84 | LOG(INFO) << "\tDevice: " << dev.getInfo() << " / " << dev.getInfo(); 85 | } 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /tests/UT_Platform.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * **************************************************************************** 3 | * Copyright (c) 2015, Robert Lukierski. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, this 10 | * list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | * this list of conditions and the following disclaimer in the documentation 14 | * and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | * **************************************************************************** 32 | */ 33 | 34 | // system 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | #include 47 | 48 | // testing framework & libraries 49 | #include 50 | 51 | // google logger 52 | #include 53 | 54 | #include 55 | 56 | class Test_Platform : public ::testing::Test 57 | { 58 | public: 59 | Test_Platform() 60 | { 61 | 62 | } 63 | 64 | virtual ~Test_Platform() 65 | { 66 | 67 | } 68 | }; 69 | 70 | TEST_F(Test_Platform, Dummy) 71 | { 72 | 73 | } 74 | -------------------------------------------------------------------------------- /tests/WrapGL/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2016, Robert Lukierski. 2 | # All rights reserved. 3 | # 4 | # Redistribution and use in source and binary forms, with or without 5 | # modification, are permitted provided that the following conditions are met: 6 | # 7 | # Redistributions of source code must retain the above copyright notice, this 8 | # list of conditions and the following disclaimer. 9 | # 10 | # Redistributions in binary form must reproduce the above copyright notice, 11 | # this list of conditions and the following disclaimer in the documentation 12 | # and/or other materials provided with the distribution. 13 | # 14 | # Neither the name of the copyright holder nor the names of its 15 | # contributors may be used to endorse or promote products derived from 16 | # this software without specific prior written permission. 17 | # 18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | # ------------------------------------------------------------------------------ 29 | 30 | cmake_minimum_required(VERSION 3.1) 31 | 32 | include_directories(.) 33 | 34 | set(TEST_SOURCES 35 | ../tests_main.cpp 36 | UT_GLBinding.cpp 37 | ) 38 | 39 | add_executable(UT_VisionCore_WrapGL ${TEST_SOURCES}) 40 | target_link_libraries(UT_VisionCore_WrapGL PUBLIC ${GTEST_LIBRARY} ${PROJECT_NAME}) 41 | add_test(UT_VisionCore_WrapGL UT_VisionCore_WrapGL --gtest_output=xml:UT_VisionCore_WrapGL.xml) 42 | -------------------------------------------------------------------------------- /tests/WrapGL/UT_GLBinding.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * **************************************************************************** 3 | * Copyright (c) 2015, Robert Lukierski. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, this 10 | * list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | * this list of conditions and the following disclaimer in the documentation 14 | * and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | * **************************************************************************** 32 | */ 33 | 34 | // system 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | #include 47 | 48 | // testing framework & libraries 49 | #include 50 | 51 | // google logger 52 | #include 53 | 54 | #include 55 | #include 56 | #include 57 | #include 58 | #include 59 | #include 60 | #include 61 | #include 62 | #include 63 | #include 64 | 65 | class Test_WrapGL : public ::testing::Test 66 | { 67 | public: 68 | Test_WrapGL() 69 | { 70 | 71 | } 72 | 73 | virtual ~Test_WrapGL() 74 | { 75 | 76 | } 77 | }; 78 | 79 | TEST_F(Test_WrapGL, Dummy) 80 | { 81 | #if 0 82 | //wrapgl::FreeGLUTContext ctx("Test", 800, 600); 83 | wrapgl::X11Context ctx("Test", 800,600); 84 | 85 | while(!ctx.shouldQuit()) 86 | { 87 | glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 88 | 89 | ctx.finishFrame(); 90 | } 91 | 92 | ctx.shutdown(); 93 | #endif 94 | } 95 | -------------------------------------------------------------------------------- /tests/tests_main.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * **************************************************************************** 3 | * Copyright (c) 2015, Robert Lukierski. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * Redistributions of source code must retain the above copyright notice, this 10 | * list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | * this list of conditions and the following disclaimer in the documentation 14 | * and/or other materials provided with the distribution. 15 | * 16 | * Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | * **************************************************************************** 32 | * Tests entry point. 33 | * **************************************************************************** 34 | */ 35 | 36 | #include 37 | 38 | extern "C" int main(int argc, char** argv) 39 | { 40 | ::testing::InitGoogleTest(&argc, argv); 41 | int rc = RUN_ALL_TESTS(); 42 | 43 | return rc; 44 | } 45 | --------------------------------------------------------------------------------