Compare commits
86 Commits
input_meth
...
soc-2014-v
Author | SHA1 | Date | |
---|---|---|---|
189c2e9277 | |||
771bad9c6a | |||
3cdfea119d | |||
f0653c3d3f | |||
a8d2a6faf3 | |||
da426c10ee | |||
563b07fd93 | |||
5b7d72a81a | |||
0e0dd33e4c | |||
1053539f4d | |||
110f686560 | |||
5907b59138 | |||
cafeb1923b | |||
f6ebc9835e | |||
cf8a196672 | |||
835fa5e001 | |||
c5fd08803b | |||
bd7623f197 | |||
29edd88f37 | |||
72acb1ea30 | |||
77b4eb667b | |||
2369de1d62 | |||
07c3d98196 | |||
70df122693 | |||
0c05f6eee3 | |||
8628d008be | |||
4d35731bcb | |||
7fe4b23a98 | |||
c36fb0f4dc | |||
c8625b8ea4 | |||
034c724987 | |||
1fb9cff6d0 | |||
9e2fa35dea | |||
f53801306e | |||
e241976632 | |||
532d9a64e5 | |||
f72aa2c64b | |||
8b96d6a542 | |||
9f3f5cb03e | |||
13cfd0f607 | |||
8cbfc4f370 | |||
9add165373 | |||
3538836028 | |||
ded4f115cf | |||
37d5163d87 | |||
229761accd | |||
360dc0f0c2 | |||
df2fa56861 | |||
fbbeaebe47 | |||
29c7f17e50 | |||
e134cff6ae | |||
66d81bd0da | |||
744cac932c | |||
49479f4840 | |||
028fca8ba3 | |||
a55b71b437 | |||
633dbd01d7 | |||
9c9efe7a36 | |||
e2522f46e8 | |||
d72bbd3365 | |||
3ff7b8fd9c | |||
b57ef11e3d | |||
9c6f1bbcde | |||
31d6ffcef8 | |||
c2e01bb8dd | |||
d86efb2cef | |||
2c2e88ef47 | |||
36f2284a9e | |||
ff179051db | |||
21a992150a | |||
6c450f57db | |||
64f9559115 | |||
c005ef9fe7 | |||
9cdc6c75f3 | |||
e9b092ce1e | |||
e9196291be | |||
b477e670c2 | |||
60cef1a6cb | |||
dac03fce6e | |||
abf52c8a8c | |||
007738cddc | |||
e7c6245489 | |||
446fa8e097 | |||
93de165f5d | |||
8387bfd9c6 | |||
5f2ce2cd51 |
388
CMakeLists.txt
388
CMakeLists.txt
@@ -117,76 +117,6 @@ set(TESTS_OUTPUT_DIR ${EXECUTABLE_OUTPUT_PATH}/tests CACHE INTERNAL "" FORCE)
|
||||
get_blender_version()
|
||||
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Platform Specific Defaults
|
||||
|
||||
# list of var-names
|
||||
set(_init_vars)
|
||||
|
||||
# initialize to ON
|
||||
macro(option_defaults_init)
|
||||
foreach(_var ${ARGV})
|
||||
set(${_var} ON)
|
||||
list(APPEND _init_vars "${_var}")
|
||||
endforeach()
|
||||
unset(_INC)
|
||||
endmacro()
|
||||
|
||||
# remove from namespace
|
||||
macro(option_defaults_clear)
|
||||
foreach(_var ${_init_vars})
|
||||
unset(${_var})
|
||||
endforeach()
|
||||
unset(_var)
|
||||
unset(_init_vars)
|
||||
endmacro()
|
||||
|
||||
|
||||
# values to initialize WITH_****
|
||||
option_defaults_init(
|
||||
_init_BUILDINFO
|
||||
_init_CODEC_FFMPEG
|
||||
_init_CYCLES_OSL
|
||||
_init_IMAGE_OPENEXR
|
||||
_init_IMAGE_REDCODE
|
||||
_init_INPUT_NDOF
|
||||
_init_JACK
|
||||
_init_LIBMV_SCHUR_SPECIALIZATION
|
||||
_init_OPENCOLLADA
|
||||
_init_OPENCOLORIO
|
||||
_init_SDL
|
||||
_init_FFTW3
|
||||
_init_GAMEENGINE
|
||||
)
|
||||
|
||||
# customize...
|
||||
if(UNIX AND NOT APPLE)
|
||||
# some of these libraries are problematic on Linux
|
||||
# disable less important dependencies by default
|
||||
set(_init_BUILDINFO OFF)
|
||||
set(_init_CODEC_FFMPEG OFF)
|
||||
set(_init_CYCLES_OSL OFF)
|
||||
set(_init_IMAGE_OPENEXR OFF)
|
||||
set(_init_IMAGE_REDCODE OFF)
|
||||
set(_init_INPUT_NDOF OFF)
|
||||
set(_init_JACK OFF)
|
||||
set(_init_LIBMV_SCHUR_SPECIALIZATION OFF)
|
||||
set(_init_OPENCOLLADA OFF)
|
||||
set(_init_OPENCOLORIO OFF)
|
||||
set(_init_SDL OFF)
|
||||
set(_init_FFTW3 OFF)
|
||||
set(_init_GAMEENGINE OFF)
|
||||
endif()
|
||||
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Options
|
||||
|
||||
# First platform spesific non-cached vars
|
||||
if(UNIX AND NOT APPLE)
|
||||
set(WITH_X11 ON)
|
||||
endif()
|
||||
|
||||
# Blender internal features
|
||||
option(WITH_BLENDER "Build blender (disable to build only the blender player)" ON)
|
||||
mark_as_advanced(WITH_BLENDER)
|
||||
@@ -205,7 +135,7 @@ if(APPLE)
|
||||
option(WITH_PYTHON_FRAMEWORK "Enable building using the Python available in the framework (OSX only)" OFF)
|
||||
endif()
|
||||
|
||||
option(WITH_BUILDINFO "Include extra build details (only disable for development & faster builds)" ${_init_BUILDINFO})
|
||||
option(WITH_BUILDINFO "Include extra build details (only disable for development & faster builds)" ON)
|
||||
if(${CMAKE_VERSION} VERSION_LESS 2.8.8)
|
||||
# add_library OBJECT arg unsupported
|
||||
set(WITH_BUILDINFO OFF)
|
||||
@@ -213,13 +143,13 @@ endif()
|
||||
|
||||
option(WITH_IK_ITASC "Enable ITASC IK solver (only disable for development & for incompatible C++ compilers)" ON)
|
||||
option(WITH_IK_SOLVER "Enable Legacy IK solver (only disable for development)" ON)
|
||||
option(WITH_FFTW3 "Enable FFTW3 support (Used for smoke and audio effects)" ${_init_FFTW3})
|
||||
option(WITH_FFTW3 "Enable FFTW3 support (Used for smoke and audio effects)" ON)
|
||||
option(WITH_BULLET "Enable Bullet (Physics Engine)" ON)
|
||||
option(WITH_SYSTEM_BULLET "Use the systems bullet library (currently unsupported due to missing features in upstream!)" )
|
||||
mark_as_advanced(WITH_SYSTEM_BULLET)
|
||||
option(WITH_GAMEENGINE "Enable Game Engine" ${_init_GAMEENGINE})
|
||||
option(WITH_GAMEENGINE "Enable Game Engine" ON)
|
||||
option(WITH_PLAYER "Build Player" OFF)
|
||||
option(WITH_OPENCOLORIO "Enable OpenColorIO color management" ${_init_OPENCOLORIO})
|
||||
option(WITH_OPENCOLORIO "Enable OpenColorIO color management" ON)
|
||||
option(WITH_COMPOSITOR "Enable the tile based nodal compositor" ON)
|
||||
|
||||
# GHOST Windowing Library Options
|
||||
@@ -229,10 +159,6 @@ mark_as_advanced(WITH_GHOST_DEBUG)
|
||||
option(WITH_GHOST_SDL "Enable building blender against SDL for windowing rather then the native APIs" OFF)
|
||||
mark_as_advanced(WITH_GHOST_SDL)
|
||||
|
||||
if(WITH_X11)
|
||||
option(WITH_GHOST_XDND "Enable drag'n'drop support on X11 using XDND protocol" ON)
|
||||
endif()
|
||||
|
||||
# Misc...
|
||||
option(WITH_HEADLESS "Build without graphical support (renderfarm, server mode only)" OFF)
|
||||
mark_as_advanced(WITH_HEADLESS)
|
||||
@@ -242,9 +168,14 @@ mark_as_advanced(WITH_AUDASPACE)
|
||||
|
||||
option(WITH_OPENMP "Enable OpenMP (has to be supported by the compiler)" ON)
|
||||
|
||||
if(UNIX AND NOT APPLE)
|
||||
set(WITH_X11 ON)
|
||||
endif()
|
||||
|
||||
if(WITH_X11)
|
||||
option(WITH_X11_XINPUT "Enable X11 Xinput (tablet support and unicode input)" ON)
|
||||
option(WITH_X11_XF86VMODE "Enable X11 video mode switching" ON)
|
||||
option(WITH_GHOST_XDND "Enable drag'n'drop support on X11 using XDND protocol" ON)
|
||||
endif()
|
||||
|
||||
if(UNIX AND NOT APPLE)
|
||||
@@ -258,7 +189,13 @@ endif()
|
||||
|
||||
|
||||
# (unix defaults to System OpenJPEG On)
|
||||
option(WITH_SYSTEM_OPENJPEG "Use the operating systems OpenJPEG library" OFF)
|
||||
if(UNIX AND NOT APPLE)
|
||||
set(PLATFORM_DEFAULT ON)
|
||||
else()
|
||||
set(PLATFORM_DEFAULT OFF)
|
||||
endif()
|
||||
option(WITH_SYSTEM_OPENJPEG "Use the operating systems OpenJPEG library" ${PLATFORM_DEFAULT})
|
||||
unset(PLATFORM_DEFAULT)
|
||||
|
||||
|
||||
# Modifiers
|
||||
@@ -271,39 +208,43 @@ option(WITH_MOD_REMESH "Enable Remesh Modifier" ON)
|
||||
option(WITH_MOD_OCEANSIM "Enable Ocean Modifier" OFF)
|
||||
|
||||
# Image format support
|
||||
option(WITH_OPENIMAGEIO "Enable OpenImageIO Support (http://www.openimageio.org)" ON)
|
||||
option(WITH_IMAGE_OPENEXR "Enable OpenEXR Support (http://www.openexr.com)" ${_init_IMAGE_OPENEXR})
|
||||
option(WITH_OPENIMAGEIO "Enable OpenImageIO Support (http://www.openimageio.org)" OFF)
|
||||
option(WITH_IMAGE_OPENEXR "Enable OpenEXR Support (http://www.openexr.com)" ON)
|
||||
option(WITH_IMAGE_OPENJPEG "Enable OpenJpeg Support (http://www.openjpeg.org)" ON)
|
||||
option(WITH_IMAGE_TIFF "Enable LibTIFF Support" ON)
|
||||
option(WITH_IMAGE_DDS "Enable DDS Image Support" ON)
|
||||
option(WITH_IMAGE_CINEON "Enable CINEON and DPX Image Support" ON)
|
||||
option(WITH_IMAGE_HDR "Enable HDR Image Support" ON)
|
||||
option(WITH_IMAGE_REDCODE "Enable RedCode Image Support" ${_init_IMAGE_REDCODE})
|
||||
option(WITH_IMAGE_REDCODE "Enable RedCode Image Support" OFF)
|
||||
option(WITH_IMAGE_FRAMESERVER "Enable image FrameServer Support for rendering" ON)
|
||||
|
||||
# Audio/Video format support
|
||||
option(WITH_CODEC_AVI "Enable Blenders own AVI file support (raw/jpeg)" ON)
|
||||
option(WITH_CODEC_FFMPEG "Enable FFMPeg Support (http://ffmpeg.org)" ${_init_CODEC_FFMPEG})
|
||||
option(WITH_CODEC_FFMPEG "Enable FFMPeg Support (http://ffmpeg.org)" OFF)
|
||||
option(WITH_CODEC_SNDFILE "Enable libsndfile Support (http://www.mega-nerd.com/libsndfile)" OFF)
|
||||
|
||||
if(APPLE)
|
||||
option(WITH_CODEC_FFMPEG "Enable FFMPeg Support (http://ffmpeg.org)" ON)
|
||||
option(WITH_CODEC_QUICKTIME "Enable Quicktime Support" ON)
|
||||
else()
|
||||
option(WITH_CODEC_FFMPEG "Enable FFMPeg Support (http://ffmpeg.org)" OFF)
|
||||
endif()
|
||||
|
||||
# 3D format support
|
||||
# Disable opencollada when we don't have precompiled libs
|
||||
option(WITH_OPENCOLLADA "Enable OpenCollada Support (http://www.opencollada.org)" ${_init_OPENCOLLADA})
|
||||
if(APPLE OR WIN32)
|
||||
option(WITH_OPENCOLLADA "Enable OpenCollada Support (http://www.opencollada.org)" ON)
|
||||
else()
|
||||
option(WITH_OPENCOLLADA "Enable OpenCollada Support (http://www.opencollada.org)" OFF)
|
||||
endif()
|
||||
|
||||
# Sound output
|
||||
option(WITH_SDL "Enable SDL for sound and joystick support" ${_init_SDL})
|
||||
option(WITH_SDL "Enable SDL for sound and joystick support" ON)
|
||||
option(WITH_OPENAL "Enable OpenAL Support (http://www.openal.org)" ON)
|
||||
option(WITH_JACK "Enable Jack Support (http://www.jackaudio.org)" ${_init_JACK})
|
||||
option(WITH_JACK "Enable Jack Support (http://www.jackaudio.org)" OFF)
|
||||
if(UNIX AND NOT APPLE)
|
||||
option(WITH_JACK_DYNLOAD "Enable runtime dynamic Jack libraries loading" OFF)
|
||||
endif()
|
||||
if(UNIX AND NOT APPLE)
|
||||
option(WITH_SDL_DYNLOAD "Enable runtime dynamic SDL libraries loading" OFF)
|
||||
endif()
|
||||
|
||||
# Compression
|
||||
option(WITH_LZO "Enable fast LZO compression (used for pointcache)" ON)
|
||||
@@ -311,17 +252,13 @@ option(WITH_LZMA "Enable best LZMA compression, (used for pointcache)"
|
||||
|
||||
# Camera/motion tracking
|
||||
option(WITH_LIBMV "Enable libmv structure from motion library" ON)
|
||||
option(WITH_LIBMV_SCHUR_SPECIALIZATIONS "Enable fixed-size schur specializations." ${_init_LIBMV_SCHUR_SPECIALIZATION})
|
||||
mark_as_advanced(WITH_LIBMV_SCHUR_SPECIALIZATIONS)
|
||||
option(WITH_LIBMV_SCHUR_SPECIALIZATIONS "Enable fixed-size schur specializations." ON)
|
||||
|
||||
# Freestyle
|
||||
option(WITH_FREESTYLE "Enable Freestyle (advanced edges rendering)" ON)
|
||||
|
||||
# Misc
|
||||
if (WIN32)
|
||||
option(WITH_INPUT_IME "Enable Input Method Editor (IME)" ON)
|
||||
endif()
|
||||
option(WITH_INPUT_NDOF "Enable NDOF input devices (SpaceNavigator and friends)" ${_init_INPUT_NDOF})
|
||||
option(WITH_INPUT_NDOF "Enable NDOF input devices (SpaceNavigator and friends)" ON)
|
||||
option(WITH_RAYOPTIMIZATION "Enable use of SIMD (SSE) optimizations for the raytracer" ON)
|
||||
option(WITH_OPENNL "Enable use of Open Numerical Library" ON)
|
||||
if(UNIX AND NOT APPLE)
|
||||
@@ -336,8 +273,6 @@ option(WITH_PYTHON_INSTALL "Copy system python into the blender install fo
|
||||
option(WITH_PYTHON_INSTALL_NUMPY "Copy system numpy into the blender install folder" ON)
|
||||
set(PYTHON_NUMPY_PATH "" CACHE PATH "Path to python site-packages or dist-packages containing 'numpy' module")
|
||||
mark_as_advanced(PYTHON_NUMPY_PATH)
|
||||
option(WITH_CPU_SSE "Enable SIMD instruction if they're detected on the host machine" ON)
|
||||
mark_as_advanced(WITH_CPU_SSE)
|
||||
|
||||
if(UNIX AND NOT APPLE)
|
||||
option(WITH_PYTHON_INSTALL_REQUESTS "Copy system requests into the blender install folder" ON)
|
||||
@@ -349,13 +284,13 @@ endif()
|
||||
option(WITH_CYCLES "Enable cycles Render Engine" ON)
|
||||
option(WITH_CYCLES_STANDALONE "Build cycles standalone application" OFF)
|
||||
option(WITH_CYCLES_STANDALONE_GUI "Build cycles standalone with GUI" OFF)
|
||||
option(WITH_CYCLES_OSL "Build Cycles with OSL support" ${_init_CYCLES_OSL})
|
||||
option(WITH_CYCLES_OSL "Build Cycles with OSL support" OFF)
|
||||
option(WITH_CYCLES_CUDA_BINARIES "Build cycles CUDA binaries" OFF)
|
||||
set(CYCLES_CUDA_BINARIES_ARCH sm_20 sm_21 sm_30 sm_35 sm_50 CACHE STRING "CUDA architectures to build binaries for")
|
||||
mark_as_advanced(CYCLES_CUDA_BINARIES_ARCH)
|
||||
unset(PLATFORM_DEFAULT)
|
||||
option(WITH_CYCLES_LOGGING "Build cycles with logging support" ON)
|
||||
option(WITH_CYCLES_DEBUG "Build cycles with extra debug capabilities" OFF)
|
||||
option(WITH_CYCLES_LOGGING "Build cycles with logging support" OFF)
|
||||
option(WITH_CYCLES_DEBUG "Build cycles with with extra debug capabilties" OFF)
|
||||
mark_as_advanced(WITH_CYCLES_LOGGING)
|
||||
mark_as_advanced(WITH_CYCLES_DEBUG)
|
||||
|
||||
@@ -385,19 +320,17 @@ mark_as_advanced(WITH_ASSERT_ABORT)
|
||||
|
||||
option(WITH_BOOST "Enable features depending on boost" ON)
|
||||
|
||||
if(CMAKE_COMPILER_IS_GNUCC)
|
||||
option(WITH_GCC_MUDFLAP "Enable mudflap" OFF)
|
||||
mark_as_advanced(WITH_GCC_MUDFLAP)
|
||||
endif()
|
||||
|
||||
# Unit testsing
|
||||
option(WITH_GTESTS "Enable GTest unit testing" OFF)
|
||||
|
||||
|
||||
# Documentation
|
||||
if(UNIX AND NOT APPLE)
|
||||
option(WITH_DOC_MANPAGE "Create a manual page (Unix manpage)" OFF)
|
||||
endif()
|
||||
|
||||
|
||||
# OpenGL
|
||||
|
||||
option(WITH_GLEW_MX "Support multiple GLEW contexts (experimental)" OFF )
|
||||
option(WITH_GLEW_MX "Support multiple GLEW contexts (experimental)" ON )
|
||||
option(WITH_GLEW_ES "Switches to experimental copy of GLEW that has support for OpenGL ES. (temporary option for development purposes)" OFF)
|
||||
option(WITH_GL_EGL "Use the EGL OpenGL system library instead of the platform specific OpenGL system library (CGL, glX, or WGL)" OFF)
|
||||
option(WITH_GL_PROFILE_COMPAT "Support using the OpenGL 'compatibility' profile. (deprecated)" ON )
|
||||
@@ -413,7 +346,7 @@ mark_as_advanced(
|
||||
WITH_GL_PROFILE_ES20
|
||||
)
|
||||
|
||||
if(WITH_GL_PROFILE_COMPAT)
|
||||
if (WITH_GL_PROFILE_COMPAT)
|
||||
set(WITH_GLU ON)
|
||||
else()
|
||||
set(WITH_GLU OFF)
|
||||
@@ -429,34 +362,6 @@ if(WITH_GLEW_ES AND WITH_SYSTEM_GLEW)
|
||||
set(WITH_SYSTEM_GLEW OFF)
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
getDefaultWindowsPrefixBase(CMAKE_GENERIC_PROGRAM_FILES)
|
||||
set(CPACK_INSTALL_PREFIX ${CMAKE_GENERIC_PROGRAM_FILES}/${})
|
||||
endif()
|
||||
|
||||
# avoid using again
|
||||
option_defaults_clear()
|
||||
|
||||
# end option(...)
|
||||
|
||||
|
||||
|
||||
# By default we want to install to the directory we are compiling our executables
|
||||
# unless specified otherwise, which we currently do not allow
|
||||
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
|
||||
if(MSVC)
|
||||
set(CMAKE_INSTALL_PREFIX ${EXECUTABLE_OUTPUT_PATH}/\${BUILD_TYPE} CACHE PATH "default install path" FORCE)
|
||||
elseif(APPLE)
|
||||
set(CMAKE_INSTALL_PREFIX ${EXECUTABLE_OUTPUT_PATH}/\${BUILD_TYPE} CACHE PATH "default install path" FORCE)
|
||||
else()
|
||||
if(WITH_INSTALL_PORTABLE)
|
||||
set(CMAKE_INSTALL_PREFIX ${EXECUTABLE_OUTPUT_PATH} CACHE PATH "default install path" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
|
||||
# Apple
|
||||
|
||||
if(APPLE)
|
||||
@@ -609,7 +514,7 @@ if(NOT WITH_PYTHON)
|
||||
set(WITH_CYCLES OFF)
|
||||
endif()
|
||||
|
||||
# enable boost for cycles, audaspace or i18n
|
||||
# enable boost for cycles, booleans, audaspace or i18n
|
||||
# otherwise if the user disabled
|
||||
if(NOT WITH_BOOST)
|
||||
# Explicitly disabled. so disable all deps.
|
||||
@@ -622,12 +527,13 @@ if(NOT WITH_BOOST)
|
||||
endmacro()
|
||||
|
||||
set_and_warn(WITH_CYCLES OFF)
|
||||
set_and_warn(WITH_MOD_BOOLEAN OFF)
|
||||
set_and_warn(WITH_AUDASPACE OFF)
|
||||
set_and_warn(WITH_INTERNATIONAL OFF)
|
||||
|
||||
set_and_warn(WITH_OPENAL OFF) # depends on AUDASPACE
|
||||
set_and_warn(WITH_GAMEENGINE OFF) # depends on AUDASPACE
|
||||
elseif(WITH_CYCLES OR WITH_OPENIMAGEIO OR WITH_AUDASPACE OR WITH_INTERNATIONAL)
|
||||
elseif(WITH_CYCLES OR WITH_OPENIMAGEIO OR WITH_MOD_BOOLEAN OR WITH_AUDASPACE OR WITH_INTERNATIONAL)
|
||||
# Keep enabled
|
||||
else()
|
||||
# Enabled but we don't need it
|
||||
@@ -647,7 +553,7 @@ endif()
|
||||
|
||||
# auto enable llvm for cycles_osl
|
||||
if(WITH_CYCLES_OSL)
|
||||
set(WITH_LLVM ON CACHE BOOL "" FORCE)
|
||||
set(WITH_LLVM ON CACHE BOOL "ON" FORCE)
|
||||
endif()
|
||||
|
||||
# don't store paths to libs for portable distribution
|
||||
@@ -662,13 +568,7 @@ if(WITH_GHOST_SDL OR WITH_HEADLESS)
|
||||
set(WITH_GHOST_XDND OFF)
|
||||
endif()
|
||||
|
||||
if(WITH_CPU_SSE)
|
||||
TEST_SSE_SUPPORT(COMPILER_SSE_FLAG COMPILER_SSE2_FLAG)
|
||||
else()
|
||||
message(STATUS "SSE and SSE2 optimizations are DISABLED!")
|
||||
set(COMPILER_SSE_FLAG)
|
||||
set(COMPILER_SSE2_FLAG)
|
||||
endif()
|
||||
TEST_SSE_SUPPORT(COMPILER_SSE_FLAG COMPILER_SSE2_FLAG)
|
||||
|
||||
TEST_STDBOOL_SUPPORT()
|
||||
if(HAVE_STDBOOL_H)
|
||||
@@ -778,6 +678,7 @@ endif()
|
||||
|
||||
if(UNIX AND NOT APPLE)
|
||||
macro(find_package_wrapper)
|
||||
string(TOUPPER ${ARGV0} _NAME_UPPER)
|
||||
if(WITH_STATIC_LIBS)
|
||||
set(_cmake_find_library_suffixes_back ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||
@@ -837,23 +738,16 @@ if(UNIX AND NOT APPLE)
|
||||
endif()
|
||||
|
||||
if(WITH_SDL)
|
||||
if(WITH_SDL_DYNLOAD)
|
||||
set(SDLMAIN_LIBRARY)
|
||||
set(SDL_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/extern/sdlew/include/SDL2")
|
||||
set(SDL_LIBRARY)
|
||||
set(SDL_LIBRARY_TEMP)
|
||||
else()
|
||||
find_package_wrapper(SDL)
|
||||
mark_as_advanced(
|
||||
SDLMAIN_LIBRARY
|
||||
SDL_INCLUDE_DIR
|
||||
SDL_LIBRARY
|
||||
SDL_LIBRARY_TEMP
|
||||
)
|
||||
# unset(SDLMAIN_LIBRARY CACHE)
|
||||
if(NOT SDL_FOUND)
|
||||
set(WITH_SDL OFF)
|
||||
endif()
|
||||
find_package_wrapper(SDL)
|
||||
mark_as_advanced(
|
||||
SDLMAIN_LIBRARY
|
||||
SDL_INCLUDE_DIR
|
||||
SDL_LIBRARY
|
||||
SDL_LIBRARY_TEMP
|
||||
)
|
||||
# unset(SDLMAIN_LIBRARY CACHE)
|
||||
if(NOT SDL_FOUND)
|
||||
set(WITH_SDL OFF)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -887,6 +781,7 @@ if(UNIX AND NOT APPLE)
|
||||
|
||||
mark_as_advanced(FFMPEG_LIBRARIES)
|
||||
set(FFMPEG_LIBPATH ${FFMPEG}/lib)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__STDC_CONSTANT_MACROS")
|
||||
endif()
|
||||
|
||||
if(WITH_FFTW3)
|
||||
@@ -1058,9 +953,6 @@ if(UNIX AND NOT APPLE)
|
||||
message(FATAL_ERROR "LLVM not found.")
|
||||
endif()
|
||||
|
||||
endif()
|
||||
|
||||
if(WITH_LLVM OR WITH_SDL_DYNLOAD)
|
||||
# Fix for conflict with Mesa llvmpipe
|
||||
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -Wl,--version-script=${CMAKE_SOURCE_DIR}/source/creator/blender.map")
|
||||
endif()
|
||||
@@ -1081,21 +973,16 @@ if(UNIX AND NOT APPLE)
|
||||
|
||||
if(OSL_INCLUDES AND OSL_LIBRARIES AND OSL_COMPILER)
|
||||
set(OSL_FOUND TRUE)
|
||||
message(STATUS "OSL includes = ${OSL_INCLUDES}")
|
||||
message(STATUS "OSL library = ${OSL_LIBRARIES}")
|
||||
message(STATUS "OSL compiler = ${OSL_COMPILER}")
|
||||
else()
|
||||
message(STATUS "OSL not found")
|
||||
set(WITH_CYCLES_OSL OFF)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# OpenSuse needs lutil, ArchLinux not, for now keep, can avoid by using --as-needed
|
||||
list(APPEND PLATFORM_LINKLIBS -lutil -lc -lm)
|
||||
|
||||
find_package(Threads REQUIRED)
|
||||
list(APPEND PLATFORM_LINKLIBS ${CMAKE_THREAD_LIBS_INIT})
|
||||
|
||||
if(CMAKE_DL_LIBS)
|
||||
list(APPEND PLATFORM_LINKLIBS ${CMAKE_DL_LIBS})
|
||||
endif()
|
||||
list(APPEND PLATFORM_LINKLIBS -lutil -lc -lm -lpthread)
|
||||
|
||||
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||
if(NOT WITH_PYTHON_MODULE)
|
||||
@@ -1105,6 +992,11 @@ if(UNIX AND NOT APPLE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -pthread")
|
||||
if(CMAKE_DL_LIBS)
|
||||
list(APPEND PLATFORM_LINKLIBS ${CMAKE_DL_LIBS})
|
||||
endif()
|
||||
|
||||
# lfs on glibc, all compilers should use
|
||||
add_definitions(-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE)
|
||||
|
||||
@@ -1152,7 +1044,7 @@ elseif(WIN32)
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SAFESEH:NO")
|
||||
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /SAFESEH:NO")
|
||||
|
||||
list(APPEND PLATFORM_LINKLIBS ws2_32 vfw32 winmm kernel32 user32 gdi32 comdlg32 advapi32 shfolder shell32 ole32 oleaut32 uuid psapi imm32)
|
||||
list(APPEND PLATFORM_LINKLIBS ws2_32 vfw32 winmm kernel32 user32 gdi32 comdlg32 advapi32 shfolder shell32 ole32 oleaut32 uuid psapi)
|
||||
|
||||
add_definitions(
|
||||
-D_CRT_NONSTDC_NO_DEPRECATE
|
||||
@@ -1163,16 +1055,18 @@ elseif(WIN32)
|
||||
)
|
||||
|
||||
# MSVC11 needs _ALLOW_KEYWORD_MACROS to build
|
||||
add_definitions(-D_ALLOW_KEYWORD_MACROS)
|
||||
if(NOT MSVC_VERSION VERSION_LESS 1700)
|
||||
add_definitions(-D_ALLOW_KEYWORD_MACROS)
|
||||
endif()
|
||||
|
||||
if(CMAKE_CL_64)
|
||||
# We want to support Vista level ABI for x64
|
||||
add_definitions(-D_WIN32_WINNT=0x600)
|
||||
if(NOT MSVC_VERSION VERSION_LESS 1700)
|
||||
add_definitions(-D_WIN32_WINNT=0x600)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Make cmake find the msvc redistributables
|
||||
set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP TRUE)
|
||||
include(InstallRequiredSystemLibraries)
|
||||
add_definitions(-DOIIO_STATIC_BUILD)
|
||||
|
||||
set(CMAKE_CXX_FLAGS "/nologo /J /Gd /EHsc /MP" CACHE STRING "MSVC MT C++ flags " FORCE)
|
||||
set(CMAKE_C_FLAGS "/nologo /J /Gd /MP" CACHE STRING "MSVC MT C++ flags " FORCE)
|
||||
@@ -1194,6 +1088,30 @@ elseif(WIN32)
|
||||
set(CMAKE_C_FLAGS_MINSIZEREL "/O1 /Ob1 /MT /MP" CACHE STRING "MSVC MT flags " FORCE)
|
||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "/O2 /Ob1 /MT /Zi /MP" CACHE STRING "MSVC MT flags " FORCE)
|
||||
|
||||
# most msvc warnings are C & C++
|
||||
set(_WARNINGS
|
||||
# warning level:
|
||||
"/W3"
|
||||
"/w34062" # switch statement contains 'default' but no 'case' labels
|
||||
# disable:
|
||||
"/wd4018" # signed/unsigned mismatch
|
||||
"/wd4065" # switch statement contains 'default' but no 'case' labels
|
||||
"/wd4127" # conditional expression is constant
|
||||
"/wd4181" # qualifier applied to reference type; ignored
|
||||
"/wd4200" # zero-sized array in struct/union
|
||||
"/wd4244" # conversion from 'type1' to 'type2', possible loss of data
|
||||
"/wd4267" # conversion from 'size_t' to 'type', possible loss of data
|
||||
"/wd4305" # truncation from 'type1' to 'type2'
|
||||
"/wd4800" # forcing value to bool 'true' or 'false'
|
||||
# errors:
|
||||
"/we4013" # 'function' undefined; assuming extern returning int
|
||||
"/we4431" # missing type specifier - int assumed
|
||||
)
|
||||
|
||||
string(REPLACE ";" " " _WARNINGS "${_WARNINGS}")
|
||||
set(C_WARNINGS "${_WARNINGS}")
|
||||
set(CXX_WARNINGS "${_WARNINGS}")
|
||||
unset(_WARNINGS)
|
||||
|
||||
set(PLATFORM_LINKFLAGS "/SUBSYSTEM:CONSOLE /STACK:2097152 /INCREMENTAL:NO /NODEFAULTLIB:msvcrt.lib /NODEFAULTLIB:msvcmrt.lib /NODEFAULTLIB:msvcurt.lib /NODEFAULTLIB:msvcrtd.lib")
|
||||
|
||||
@@ -1210,22 +1128,28 @@ elseif(WIN32)
|
||||
# Setup 64bit and 64bit windows systems
|
||||
if(CMAKE_CL_64)
|
||||
message(STATUS "64 bit compiler detected.")
|
||||
set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/win64_vc12)
|
||||
set(LIBDIR_BASE ${CMAKE_SOURCE_DIR}/../lib/win64)
|
||||
else()
|
||||
message(STATUS "32 bit compiler detected.")
|
||||
set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/windows_vc12)
|
||||
set(LIBDIR_BASE ${CMAKE_SOURCE_DIR}/../lib/windows)
|
||||
endif()
|
||||
if(MSVC12)
|
||||
message(STATUS "Visual C++ 2013 detected.")
|
||||
set(LIBDIR ${LIBDIR_BASE}_vc12)
|
||||
else()
|
||||
set(LIBDIR ${LIBDIR_BASE})
|
||||
endif()
|
||||
else()
|
||||
message(STATUS using LIBDIR ${LIBDIR})
|
||||
endif()
|
||||
|
||||
# Add each of our libraries to our cmake_prefix_path so find_package() could work
|
||||
file(GLOB children RELATIVE ${LIBDIR} ${LIBDIR}/*)
|
||||
foreach(child ${children})
|
||||
if(IS_DIRECTORY ${LIBDIR}/${child})
|
||||
list(APPEND CMAKE_PREFIX_PATH ${LIBDIR}/${child})
|
||||
endif()
|
||||
endforeach()
|
||||
FILE(GLOB children RELATIVE ${LIBDIR} ${LIBDIR}/*)
|
||||
FOREACH(child ${children})
|
||||
IF(IS_DIRECTORY ${LIBDIR}/${child})
|
||||
LIST(APPEND CMAKE_PREFIX_PATH ${LIBDIR}/${child})
|
||||
ENDIF()
|
||||
ENDFOREACH()
|
||||
|
||||
set(ZLIB_INCLUDE_DIRS ${LIBDIR}/zlib/include)
|
||||
set(ZLIB_LIBRARIES ${LIBDIR}/zlib/lib/libz_st.lib)
|
||||
@@ -1330,13 +1254,23 @@ elseif(WIN32)
|
||||
set(OPENEXR_INCLUDE_DIR ${OPENEXR}/include)
|
||||
set(OPENEXR_INCLUDE_DIRS ${OPENEXR}/include/OpenEXR)
|
||||
set(OPENEXR_LIBPATH ${OPENEXR}/lib)
|
||||
set(OPENEXR_LIBRARIES
|
||||
${OPENEXR_LIBPATH}/Iex-2_1.lib
|
||||
${OPENEXR_LIBPATH}/Half.lib
|
||||
${OPENEXR_LIBPATH}/IlmImf-2_1.lib
|
||||
${OPENEXR_LIBPATH}/Imath-2_1.lib
|
||||
${OPENEXR_LIBPATH}/IlmThread-2_1.lib
|
||||
)
|
||||
if(MSVC12)
|
||||
set(OPENEXR_LIBRARIES
|
||||
${OPENEXR_LIBPATH}/Iex-2_1.lib
|
||||
${OPENEXR_LIBPATH}/Half.lib
|
||||
${OPENEXR_LIBPATH}/IlmImf-2_1.lib
|
||||
${OPENEXR_LIBPATH}/Imath-2_1.lib
|
||||
${OPENEXR_LIBPATH}/IlmThread-2_1.lib
|
||||
)
|
||||
else()
|
||||
set(OPENEXR_LIBRARIES
|
||||
${OPENEXR_LIBPATH}/Iex.lib
|
||||
${OPENEXR_LIBPATH}/Half.lib
|
||||
${OPENEXR_LIBPATH}/IlmImf.lib
|
||||
${OPENEXR_LIBPATH}/Imath.lib
|
||||
${OPENEXR_LIBPATH}/IlmThread.lib
|
||||
)
|
||||
endif()
|
||||
endif(NOT OPENEXR_FOUND)
|
||||
endif()
|
||||
|
||||
@@ -1385,7 +1319,7 @@ elseif(WIN32)
|
||||
set(Boost_USE_MULTITHREADED ON) # suffix -mt
|
||||
set(Boost_USE_STATIC_LIBS ON) # suffix -s
|
||||
find_package(Boost COMPONENTS date_time filesystem thread regex system ${boost_extra_libs})
|
||||
if(NOT Boost_FOUND)
|
||||
IF(NOT Boost_FOUND)
|
||||
message(WARNING "USING HARDCODED boost locations")
|
||||
set(BOOST ${LIBDIR}/boost)
|
||||
set(BOOST_INCLUDE_DIR ${BOOST}/include)
|
||||
@@ -1432,8 +1366,6 @@ elseif(WIN32)
|
||||
set(OPENIMAGEIO_LIBRARIES ${OIIO_OPTIMIZED} ${OIIO_DEBUG})
|
||||
set(OPENIMAGEIO_LIBPATH ${OPENIMAGEIO}/lib)
|
||||
set(OPENIMAGEIO_DEFINITIONS "-DUSE_TBB=0")
|
||||
set(OPENCOLORIO_DEFINITIONS "-DOCIO_STATIC_BUILD")
|
||||
add_definitions(-DOIIO_STATIC_BUILD)
|
||||
endif()
|
||||
|
||||
if(WITH_LLVM)
|
||||
@@ -1508,7 +1440,7 @@ elseif(WIN32)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
list(APPEND PLATFORM_LINKLIBS -lshell32 -lshfolder -lgdi32 -lmsvcrt -lwinmm -lmingw32 -lm -lws2_32 -lz -lstdc++ -lole32 -luuid -lwsock32 -lpsapi -limm32)
|
||||
list(APPEND PLATFORM_LINKLIBS -lshell32 -lshfolder -lgdi32 -lmsvcrt -lwinmm -lmingw32 -lm -lws2_32 -lz -lstdc++ -lole32 -luuid -lwsock32 -lpsapi)
|
||||
set(PLATFORM_CFLAGS "-pipe -funsigned-char -fno-strict-aliasing")
|
||||
|
||||
if(WITH_MINGW64)
|
||||
@@ -1733,7 +1665,7 @@ elseif(WIN32)
|
||||
if(WITH_SDL)
|
||||
set(SDL ${LIBDIR}/sdl)
|
||||
set(SDL_INCLUDE_DIR ${SDL}/include)
|
||||
set(SDL_LIBRARY SDL2)
|
||||
set(SDL_LIBRARY SDL)
|
||||
set(SDL_LIBPATH ${SDL}/lib)
|
||||
endif()
|
||||
|
||||
@@ -1758,7 +1690,6 @@ elseif(WIN32)
|
||||
set(OSL_FOUND TRUE)
|
||||
else()
|
||||
message(STATUS "OSL not found")
|
||||
set(WITH_CYCLES_OSL OFF)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -1862,6 +1793,7 @@ elseif(APPLE)
|
||||
set(FFMPEG_INCLUDE_DIRS ${FFMPEG}/include)
|
||||
set(FFMPEG_LIBRARIES avcodec avdevice avformat avutil mp3lame swscale x264 xvidcore theora theoradec theoraenc vorbis vorbisenc vorbisfile ogg)
|
||||
set(FFMPEG_LIBPATH ${FFMPEG}/lib)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__STDC_CONSTANT_MACROS")
|
||||
endif()
|
||||
|
||||
find_library(SYSTEMSTUBS_LIBRARY
|
||||
@@ -1942,9 +1874,8 @@ elseif(APPLE)
|
||||
if(WITH_SDL)
|
||||
set(SDL ${LIBDIR}/sdl)
|
||||
set(SDL_INCLUDE_DIR ${SDL}/include)
|
||||
set(SDL_LIBRARY SDL2)
|
||||
set(SDL_LIBRARY SDL)
|
||||
set(SDL_LIBPATH ${SDL}/lib)
|
||||
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -lazy_framework ForceFeedback")
|
||||
endif()
|
||||
|
||||
set(PNG "${LIBDIR}/png")
|
||||
@@ -1997,6 +1928,7 @@ elseif(APPLE)
|
||||
set(OPENCOLORIO_INCLUDE_DIRS ${OPENCOLORIO}/include)
|
||||
set(OPENCOLORIO_LIBRARIES OpenColorIO tinyxml yaml-cpp)
|
||||
set(OPENCOLORIO_LIBPATH ${OPENCOLORIO}/lib)
|
||||
set(OPENCOLORIO_DEFINITIONS "-DOCIO_STATIC_BUILD")
|
||||
endif()
|
||||
|
||||
if(WITH_LLVM)
|
||||
@@ -2052,7 +1984,6 @@ elseif(APPLE)
|
||||
set(OSL_FOUND TRUE)
|
||||
else()
|
||||
message(STATUS "OSL not found")
|
||||
set(WITH_CYCLES_OSL OFF)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -2071,7 +2002,7 @@ elseif(APPLE)
|
||||
link_directories(${LIBDIR}/openmp/lib)
|
||||
# This is a workaround for our helperbinaries ( datatoc, masgfmt, ... ),
|
||||
# They are linked also to omp lib, so we need it in builddir for runtime exexcution, TODO: remove all unneeded dependencies from these
|
||||
execute_process(COMMAND ditto -arch ${CMAKE_OSX_ARCHITECTURES} ${LIBDIR}/openmp/lib/libiomp5.dylib ${CMAKE_BINARY_DIR}/Resources/lib/libiomp5.dylib) # for intermediate binaries, in respect to lib ID
|
||||
execute_process(COMMAND ditto -arch ${CMAKE_OSX_ARCHITECTURES} ${LIBDIR}/openmp/lib/libiomp5.dylib ${CMAKE_BINARY_DIR}/bin/libiomp5.dylib) # for intermediate binaries, lib id @loader_path
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
@@ -2224,7 +2155,7 @@ elseif(WITH_GL_PROFILE_ES20)
|
||||
|
||||
list(APPEND BLENDER_GL_LIBRARIES "${OPENGLES_LIBRARY}")
|
||||
|
||||
if(NOT OPENGLES_LIBRARY)
|
||||
if (NOT OPENGLES_LIBRARY)
|
||||
message(FATAL_ERROR "To compile WITH_GL_EGL you need to set OPENGLES_LIBRARY to the file path of an OpenGL ES 2.0 library.")
|
||||
endif()
|
||||
|
||||
@@ -2250,7 +2181,7 @@ elseif(WITH_GL_PROFILE_ES20)
|
||||
|
||||
mark_as_advanced(D3DCOMPILER_DLL)
|
||||
|
||||
if(D3DCOMPILER_DLL STREQUAL "")
|
||||
if (D3DCOMPILER_DLL STREQUAL "")
|
||||
message(FATAL_ERROR "To compile WITH_GL_ANGLE you need to set D3DCOMPILER_DLL to the file path of a copy of the DirectX redistributable DLL file: D3DCompiler_46.dll")
|
||||
endif()
|
||||
|
||||
@@ -2276,7 +2207,7 @@ if(WITH_GL_EGL)
|
||||
|
||||
list(APPEND BLENDER_GL_LIBRARIES "${OPENGLES_LIBRARY}" "${OPENGLES_EGL_LIBRARY}")
|
||||
|
||||
if(NOT OPENGLES_EGL_LIBRARY)
|
||||
if (NOT OPENGLES_EGL_LIBRARY)
|
||||
message(FATAL_ERROR "To compile WITH_GL_EGL you need to set OPENGLES_EGL_LIBRARY to the file path of an EGL library.")
|
||||
endif()
|
||||
|
||||
@@ -2557,31 +2488,7 @@ elseif(CMAKE_C_COMPILER_ID MATCHES "Intel")
|
||||
# disable numbered, false positives
|
||||
set(C_WARNINGS "${C_WARNINGS} -wd188,186,144,913,556")
|
||||
set(CXX_WARNINGS "${CXX_WARNINGS} -wd188,186,144,913,556")
|
||||
elseif(CMAKE_C_COMPILER_ID MATCHES "MSVC")
|
||||
# most msvc warnings are C & C++
|
||||
set(_WARNINGS
|
||||
# warning level:
|
||||
"/W3"
|
||||
"/w34062" # switch statement contains 'default' but no 'case' labels
|
||||
# disable:
|
||||
"/wd4018" # signed/unsigned mismatch
|
||||
"/wd4065" # switch statement contains 'default' but no 'case' labels
|
||||
"/wd4127" # conditional expression is constant
|
||||
"/wd4181" # qualifier applied to reference type; ignored
|
||||
"/wd4200" # zero-sized array in struct/union
|
||||
"/wd4244" # conversion from 'type1' to 'type2', possible loss of data
|
||||
"/wd4267" # conversion from 'size_t' to 'type', possible loss of data
|
||||
"/wd4305" # truncation from 'type1' to 'type2'
|
||||
"/wd4800" # forcing value to bool 'true' or 'false'
|
||||
# errors:
|
||||
"/we4013" # 'function' undefined; assuming extern returning int
|
||||
"/we4431" # missing type specifier - int assumed
|
||||
)
|
||||
|
||||
string(REPLACE ";" " " _WARNINGS "${_WARNINGS}")
|
||||
set(C_WARNINGS "${_WARNINGS}")
|
||||
set(CXX_WARNINGS "${_WARNINGS}")
|
||||
unset(_WARNINGS)
|
||||
endif()
|
||||
|
||||
# ensure python header is found since detection can fail, this could happen
|
||||
@@ -2608,6 +2515,13 @@ if(WITH_PYTHON)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(WITH_GCC_MUDFLAP)
|
||||
set(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -fmudflapth -funwind-tables")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lpthread -lmudflapth -rdynamic")
|
||||
ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_NO_ERROR_MUDFLAP -Wno-error=mudflap)
|
||||
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_ERROR_MUDFLAP -Wno-error=mudflap)
|
||||
endif()
|
||||
|
||||
# Include warnings first, so its possible to disable them with user defined flags
|
||||
# eg: -Wno-uninitialized
|
||||
set(CMAKE_C_FLAGS "${C_WARNINGS} ${CMAKE_C_FLAGS} ${PLATFORM_CFLAGS}")
|
||||
@@ -2761,7 +2675,6 @@ if(FIRST_RUN)
|
||||
info_cfg_text("Audio:")
|
||||
info_cfg_option(WITH_OPENAL)
|
||||
info_cfg_option(WITH_SDL)
|
||||
info_cfg_option(WITH_SDL_DYNLOAD)
|
||||
info_cfg_option(WITH_JACK)
|
||||
info_cfg_option(WITH_JACK_DYNLOAD)
|
||||
info_cfg_option(WITH_CODEC_AVI)
|
||||
@@ -2808,8 +2721,3 @@ if(FIRST_RUN)
|
||||
|
||||
message("${_config_msg}")
|
||||
endif()
|
||||
|
||||
if(0)
|
||||
print_all_vars()
|
||||
endif()
|
||||
|
||||
|
19
GNUmakefile
19
GNUmakefile
@@ -52,10 +52,6 @@ ifneq "$(findstring debug, $(MAKECMDGOALS))" ""
|
||||
BUILD_DIR:=$(BUILD_DIR)_debug
|
||||
BUILD_TYPE:=Debug
|
||||
endif
|
||||
ifneq "$(findstring full, $(MAKECMDGOALS))" ""
|
||||
BUILD_DIR:=$(BUILD_DIR)_full
|
||||
BUILD_CMAKE_ARGS:=$(BUILD_CMAKE_ARGS) -C"$(BLENDER_DIR)/build_files/cmake/config/blender_full.cmake"
|
||||
endif
|
||||
ifneq "$(findstring lite, $(MAKECMDGOALS))" ""
|
||||
BUILD_DIR:=$(BUILD_DIR)_lite
|
||||
BUILD_CMAKE_ARGS:=$(BUILD_CMAKE_ARGS) -C"$(BLENDER_DIR)/build_files/cmake/config/blender_lite.cmake"
|
||||
@@ -133,7 +129,6 @@ all:
|
||||
@echo
|
||||
|
||||
debug: all
|
||||
full: all
|
||||
lite: all
|
||||
cycles: all
|
||||
headless: all
|
||||
@@ -152,7 +147,6 @@ help:
|
||||
@echo ""
|
||||
@echo "Convenience targets provided for building blender, (multiple at once can be used)"
|
||||
@echo " * debug - build a debug binary"
|
||||
@echo " * full - enable all supported dependencies & options"
|
||||
@echo " * lite - disable non essential features for a smaller binary and faster build"
|
||||
@echo " * headless - build without an interface (renderfarm or server automation)"
|
||||
@echo " * cycles - build Cycles standalone only, without Blender"
|
||||
@@ -207,9 +201,6 @@ help:
|
||||
@echo " * doc_dna - generate blender file format reference"
|
||||
@echo " * doc_man - generate manpage"
|
||||
@echo ""
|
||||
@echo "Information"
|
||||
@echo " * help - this help message"
|
||||
@echo " * help_features - show a list of optional features when building"
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# Packages
|
||||
@@ -406,16 +397,6 @@ doc_dna:
|
||||
doc_man:
|
||||
python3 doc/manpage/blender.1.py "$(BUILD_DIR)/bin/blender"
|
||||
|
||||
help_features:
|
||||
@python3 -c \
|
||||
"import re; \
|
||||
print('\n'.join([ \
|
||||
w for l in open('"$(BLENDER_DIR)"/CMakeLists.txt', 'r').readlines() \
|
||||
if not l.lstrip().startswith('#') \
|
||||
for w in (re.sub(\
|
||||
r'.*\boption\s*\(\s*(WITH_[a-zA-Z0-9_]+)\s+(\".*\")\s*.*', r'\g<1> - \g<2>', l).strip('() \n'),) \
|
||||
if w.startswith('WITH_')]))" | uniq
|
||||
|
||||
|
||||
clean:
|
||||
$(MAKE) -C "$(BUILD_DIR)" clean
|
||||
|
10
SConstruct
10
SConstruct
@@ -218,8 +218,6 @@ else:
|
||||
if not env['BF_FANCY']:
|
||||
B.bc.disable()
|
||||
|
||||
if env['WITH_BF_SDL_DYNLOAD']:
|
||||
env['BF_SDL_INC'] = '#extern/sdlew/include/SDL2'
|
||||
|
||||
# remove install dir so old and new files are not mixed.
|
||||
# NOTE: only do the scripts directory for now, otherwise is too disruptive for developers
|
||||
@@ -422,9 +420,6 @@ if env['OURPLATFORM']=='darwin':
|
||||
env.Append(LINKFLAGS=['-F/Library/Frameworks','-Xlinker','-weak_framework','-Xlinker','Jackmp'])
|
||||
print B.bc.OKGREEN + "Using Jack"
|
||||
|
||||
if env['WITH_BF_SDL']:
|
||||
env.Append(LINKFLAGS=['-lazy_framework','ForceFeedback'])
|
||||
|
||||
if env['WITH_BF_QUICKTIME'] == 1:
|
||||
env['PLATFORM_LINKFLAGS'] = env['PLATFORM_LINKFLAGS']+['-framework','QTKit']
|
||||
|
||||
@@ -757,7 +752,6 @@ if B.targets != ['cudakernels']:
|
||||
data_to_c_simple("source/blender/gpu/shaders/gpu_shader_sep_gaussian_blur_frag.glsl")
|
||||
data_to_c_simple("source/blender/gpu/shaders/gpu_shader_sep_gaussian_blur_vert.glsl")
|
||||
data_to_c_simple("source/blender/gpu/shaders/gpu_shader_vertex.glsl")
|
||||
data_to_c_simple("source/blender/gpu/shaders/gpu_shader_vertex_world.glsl")
|
||||
data_to_c_simple("source/blender/gpu/shaders/gpu_shader_vsm_store_frag.glsl")
|
||||
data_to_c_simple("source/blender/gpu/shaders/gpu_shader_vsm_store_vert.glsl")
|
||||
data_to_c_simple("intern/opencolorio/gpu_shader_display_transform.glsl")
|
||||
@@ -861,11 +855,9 @@ if B.targets != ['cudakernels']:
|
||||
from FindUnorderedMap import FindUnorderedMap
|
||||
|
||||
conf = Configure(env)
|
||||
old_linkflags = conf.env['LINKFLAGS']
|
||||
conf.env.Append(LINKFLAGS=env['PLATFORM_LINKFLAGS'])
|
||||
FindSharedPtr(conf)
|
||||
FindUnorderedMap(conf)
|
||||
conf.env['LINKFLAGS'] = old_linkflags
|
||||
env = conf.Finish()
|
||||
|
||||
# End of auto configuration
|
||||
@@ -1188,7 +1180,7 @@ if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'win64-vc', 'linuxcross'):
|
||||
dllsources += ['${BF_PTHREADS_LIBPATH}/${BF_PTHREADS_LIB}.dll']
|
||||
|
||||
if env['WITH_BF_SDL']:
|
||||
dllsources.append('${BF_SDL_LIBPATH}/SDL2.dll')
|
||||
dllsources.append('${BF_SDL_LIBPATH}/SDL.dll')
|
||||
|
||||
if env['WITH_BF_PYTHON']:
|
||||
if env['BF_DEBUG']:
|
||||
|
@@ -83,7 +83,7 @@ ARGUMENTS_INFO="\"COMMAND LINE ARGUMENTS:
|
||||
-t n, --threads=n
|
||||
Use a specific number of threads when building the libraries (auto-detected as '\$THREADS').
|
||||
|
||||
--no-sudo
|
||||
--no_sudo
|
||||
Disable use of sudo (this script won't be able to do much though, will just print needed packages...).
|
||||
|
||||
--with-all
|
||||
@@ -471,12 +471,11 @@ while true; do
|
||||
esac
|
||||
done
|
||||
|
||||
if [ $WITH_ALL == true -a $OPENCOLLADA_SKIP == false ]; then
|
||||
if $WITH_ALL; then
|
||||
WITH_OPENCOLLADA=true
|
||||
fi
|
||||
|
||||
|
||||
|
||||
# This has to be done here, because user might force some versions...
|
||||
PYTHON_SOURCE=( "http://python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tgz" )
|
||||
NUMPY_SOURCE=( "http://sourceforge.net/projects/numpy/files/NumPy/$NUMPY_VERSION/numpy-$NUMPY_VERSION.tar.gz" )
|
||||
@@ -498,12 +497,8 @@ LLVM_SOURCE=( "http://llvm.org/releases/$LLVM_VERSION/llvm-$LLVM_VERSION.src.tar
|
||||
LLVM_CLANG_SOURCE=( "http://llvm.org/releases/$LLVM_VERSION/clang-$LLVM_VERSION.src.tar.gz" "http://llvm.org/releases/$LLVM_VERSION/cfe-$LLVM_VERSION.src.tar.gz" )
|
||||
#OSL_SOURCE=( "https://github.com/imageworks/OpenShadingLanguage/archive/Release-$OSL_VERSION.tar.gz" )
|
||||
#OSL_SOURCE=( "https://github.com/imageworks/OpenShadingLanguage.git" )
|
||||
#OSL_SOURCE=( "https://github.com/mont29/OpenShadingLanguage.git" )
|
||||
#OSL_REPO_UID="85179714e1bc69cd25ecb6bb711c1a156685d395"
|
||||
#OSL_REPO_BRANCH="master"
|
||||
OSL_SOURCE=( "https://github.com/Nazg-Gul/OpenShadingLanguage.git" )
|
||||
OSL_REPO_UID="22ee5ea298fd215430dfbd160b5aefd507f06db0"
|
||||
OSL_REPO_BRANCH="blender-fixes"
|
||||
OSL_SOURCE=( "https://github.com/mont29/OpenShadingLanguage.git" )
|
||||
OSL_REPO_UID="85179714e1bc69cd25ecb6bb711c1a156685d395"
|
||||
|
||||
OPENCOLLADA_SOURCE=( "https://github.com/KhronosGroup/OpenCOLLADA.git" )
|
||||
OPENCOLLADA_REPO_UID="18da7f4109a8eafaa290a33f5550501cc4c8bae8"
|
||||
@@ -1409,13 +1404,12 @@ clean_OSL() {
|
||||
|
||||
compile_OSL() {
|
||||
# To be changed each time we make edits that would modify the compiled result!
|
||||
osl_magic=16
|
||||
osl_magic=15
|
||||
_init_osl
|
||||
|
||||
# Clean install if needed!
|
||||
magic_compile_check osl-$OSL_VERSION $osl_magic
|
||||
if [ $? -eq 1 -o $OSL_FORCE_REBUILD == true ]; then
|
||||
rm -Rf $_src # XXX Radical, but not easy to change remote repo fully automatically
|
||||
clean_OSL
|
||||
fi
|
||||
|
||||
@@ -1439,10 +1433,10 @@ compile_OSL() {
|
||||
|
||||
cd $_src
|
||||
|
||||
git remote set-url origin ${OSL_SOURCE[0]}
|
||||
git remote set-url origin $OSL_SOURCE
|
||||
|
||||
# XXX For now, always update from latest repo...
|
||||
git pull --no-edit -X theirs origin $OSL_GIT_BRANCH
|
||||
git pull -X theirs origin master
|
||||
|
||||
# Stick to same rev as windows' libs...
|
||||
git checkout $OSL_REPO_UID
|
||||
@@ -1801,7 +1795,7 @@ install_DEB() {
|
||||
_packages="gawk cmake cmake-curses-gui scons build-essential libjpeg-dev libpng-dev \
|
||||
libfreetype6-dev libx11-dev libxi-dev wget libsqlite3-dev libbz2-dev \
|
||||
libncurses5-dev libssl-dev liblzma-dev libreadline-dev $OPENJPEG_DEV \
|
||||
libopenal-dev libglew-dev libglewmx-dev yasm $THEORA_DEV $VORBIS_DEV $OGG_DEV \
|
||||
libopenal-dev libglew-dev yasm $THEORA_DEV $VORBIS_DEV $OGG_DEV \
|
||||
libsdl1.2-dev libfftw3-dev patch bzip2 libxml2-dev libtinyxml-dev"
|
||||
|
||||
OPENJPEG_USE=true
|
||||
|
@@ -2,4 +2,4 @@ BF_BUILDDIR = '../blender-build/linux-glibc211-i686'
|
||||
BF_INSTALLDIR = '../blender-install/linux-glibc211-i686'
|
||||
BF_NUMJOBS = 1
|
||||
|
||||
BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30', 'sm_35', 'sm_50', 'sm_52']
|
||||
BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30', 'sm_35', 'sm_50']
|
||||
|
@@ -2,4 +2,4 @@ BF_BUILDDIR = '../blender-build/linux-glibc211-x86_64'
|
||||
BF_INSTALLDIR = '../blender-install/linux-glibc211-x86_64'
|
||||
BF_NUMJOBS = 1
|
||||
|
||||
BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30', 'sm_35', 'sm_50', 'sm_52']
|
||||
BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30', 'sm_35', 'sm_50']
|
||||
|
@@ -79,8 +79,6 @@ WITH_BF_STATICZLIB = True
|
||||
BF_ZLIB_LIB_STATIC = '${BF_ZLIB}/lib/libz.a'
|
||||
|
||||
WITH_BF_SDL = True
|
||||
WITH_BF_SDL_DYNLOAD = True
|
||||
|
||||
WITH_BF_OGG = True
|
||||
|
||||
WITH_BF_OPENMP = True
|
||||
|
@@ -79,8 +79,6 @@ WITH_BF_STATICZLIB = True
|
||||
BF_ZLIB_LIB_STATIC = '${BF_ZLIB}/lib/libz.a'
|
||||
|
||||
WITH_BF_SDL = True
|
||||
WITH_BF_SDL_DYNLOAD = True
|
||||
|
||||
WITH_BF_OGG = True
|
||||
|
||||
WITH_BF_OPENMP = True
|
||||
|
@@ -64,8 +64,6 @@ WITH_BF_STATICZLIB = True
|
||||
BF_ZLIB_LIB_STATIC = '${BF_ZLIB}/lib/libz.a'
|
||||
|
||||
WITH_BF_SDL = True
|
||||
WITH_BF_SDL_DYNLOAD = True
|
||||
|
||||
WITH_BF_OGG = False
|
||||
|
||||
WITH_BF_OPENMP = True
|
||||
|
@@ -64,8 +64,6 @@ WITH_BF_STATICZLIB = True
|
||||
BF_ZLIB_LIB_STATIC = '${BF_ZLIB}/lib/libz.a'
|
||||
|
||||
WITH_BF_SDL = True
|
||||
WITH_BF_SDL_DYNLOAD = True
|
||||
|
||||
WITH_BF_OGG = False
|
||||
|
||||
WITH_BF_OPENMP = True
|
||||
|
@@ -3,12 +3,6 @@
|
||||
|
||||
# <pep8 compliant>
|
||||
|
||||
# List of the branches being built automatically overnight
|
||||
NIGHT_SCHEDULE_BRANCHES=[None, "gooseberry"]
|
||||
|
||||
# List of the branches available for force build
|
||||
FORCE_SCHEDULE_BRANCHES=["master", "gooseberry", "experimental-build"]
|
||||
|
||||
"""
|
||||
Stock Twisted directory lister doesn't provide any information about last file
|
||||
modification time, we hack the class a bit in order to have such functionaliity
|
||||
@@ -17,6 +11,7 @@ modification time, we hack the class a bit in order to have such functionaliity
|
||||
|
||||
from buildbot.status.web.base import DirectoryLister
|
||||
|
||||
|
||||
def get_files_and_directories(self, directory):
|
||||
from twisted.web.static import (getTypeAndEncoding,
|
||||
formatFileSize)
|
||||
@@ -118,7 +113,7 @@ def schedule_force_build(name):
|
||||
codebases=[forcesched.CodebaseParameter(
|
||||
codebase="blender",
|
||||
branch=forcesched.ChoiceStringParameter(
|
||||
name="branch", choices=FORCE_SCHEDULE_BRANCHES, default="master"),
|
||||
name="branch", choices=["master", "testbuild"], default="master"),
|
||||
# Do not hide revision, can be handy!
|
||||
repository=forcesched.FixedParameter(name="repository", default="", hide=True),
|
||||
project=forcesched.FixedParameter(name="project", default="", hide=True)),
|
||||
@@ -132,22 +127,18 @@ def schedule_force_build(name):
|
||||
|
||||
|
||||
def schedule_build(name, hour, minute=0):
|
||||
for current_branch in NIGHT_SCHEDULE_BRANCHES:
|
||||
scheduler_name = "nightly " + name
|
||||
if current_branch:
|
||||
scheduler_name += ' ' + current_branch
|
||||
c['schedulers'].append(timed.Nightly(name=scheduler_name,
|
||||
codebases={
|
||||
"blender": {"repository": ""},
|
||||
"blender-translations": {"repository": "", "branch": "master"},
|
||||
"blender-addons": {"repository": "", "branch": "master"},
|
||||
"blender-addons-contrib": {"repository": "", "branch": "master"},
|
||||
"scons": {"repository": "", "branch": "master"},
|
||||
"lib svn": {"repository": "", "branch": "master"}},
|
||||
branch=current_branch,
|
||||
builderNames=[name],
|
||||
hour=hour,
|
||||
minute=minute))
|
||||
c['schedulers'].append(timed.Nightly(name='nightly ' + name,
|
||||
codebases={
|
||||
"blender": {"repository": ""},
|
||||
"blender-translations": {"repository": ""},
|
||||
"blender-addons": {"repository": ""},
|
||||
"blender-addons-contrib": {"repository": ""},
|
||||
"scons": {"repository": ""},
|
||||
"lib svn": {"repository": ""}},
|
||||
branch=None,
|
||||
builderNames=[name],
|
||||
hour=hour,
|
||||
minute=minute))
|
||||
|
||||
|
||||
# BUILDERS
|
||||
@@ -304,8 +295,6 @@ add_builder(c, 'linux_glibc211_i386_scons', '', generic_builder, hour=1)
|
||||
add_builder(c, 'linux_glibc211_x86_64_scons', '', generic_builder, hour=2)
|
||||
add_builder(c, 'win32_scons_vc2013', 'windows_vc12', generic_builder, hour=1)
|
||||
add_builder(c, 'win64_scons_vc2013', 'win64_vc12', generic_builder, hour=2)
|
||||
add_builder(c, 'win32_cmake_vc2013', 'windows_vc12', generic_builder, hour=3)
|
||||
add_builder(c, 'win64_cmake_vc2013', 'win64_vc12', generic_builder, hour=4)
|
||||
#add_builder(c, 'mingw_win32_scons', 'mingw32', generic_builder, hour=4)
|
||||
add_builder(c, 'mingw_win64_scons', 'mingw64', generic_builder, hour=3)
|
||||
#add_builder(c, 'freebsd_i386_cmake', '', generic_builder, hour=1)
|
||||
|
@@ -30,12 +30,12 @@ import zipfile
|
||||
# extension stripping
|
||||
def strip_extension(filename):
|
||||
extensions = '.zip', '.tar', '.bz2', '.gz', '.tgz', '.tbz', '.exe'
|
||||
filename_noext, ext = os.path.splitext(filename)
|
||||
if ext in extensions:
|
||||
return strip_extension(filename_noext) # may have .tar.bz2
|
||||
else:
|
||||
return filename
|
||||
|
||||
for ext in extensions:
|
||||
if filename.endswith(ext):
|
||||
filename = filename[:-len(ext)]
|
||||
|
||||
return filename
|
||||
|
||||
# extract platform from package name
|
||||
def get_platform(filename):
|
||||
@@ -48,11 +48,12 @@ def get_platform(filename):
|
||||
tokens = filename.split("-")
|
||||
platforms = ('osx', 'mac', 'bsd',
|
||||
'win', 'linux', 'source',
|
||||
'irix', 'solaris', 'mingw')
|
||||
'solaris',
|
||||
'mingw')
|
||||
platform_tokens = []
|
||||
found = False
|
||||
|
||||
for i, token in enumerate(tokens):
|
||||
for token in tokens:
|
||||
if not found:
|
||||
for platform in platforms:
|
||||
if platform in token.lower():
|
||||
@@ -64,19 +65,20 @@ def get_platform(filename):
|
||||
|
||||
return '-'.join(platform_tokens)
|
||||
|
||||
|
||||
def get_branch(filename):
|
||||
tokens = filename.split("-")
|
||||
branch = ""
|
||||
|
||||
for token in tokens:
|
||||
if token == "blender":
|
||||
return branch
|
||||
|
||||
for token in tokens:
|
||||
if branch == "":
|
||||
branch = token
|
||||
else:
|
||||
branch = branch + "-" + token
|
||||
|
||||
if token == "blender":
|
||||
return branch
|
||||
|
||||
return ""
|
||||
|
||||
# get filename
|
||||
@@ -110,16 +112,11 @@ branch = get_branch(packagename)
|
||||
|
||||
if platform == '':
|
||||
sys.stderr.write('Failed to detect platform ' +
|
||||
'from package: %r\n' % packagename)
|
||||
'from package: %r\n' % packagename)
|
||||
sys.exit(1)
|
||||
|
||||
# extract
|
||||
if not branch or branch == 'master':
|
||||
directory = 'public_html/download'
|
||||
elif branch == 'experimental-build':
|
||||
directory = 'public_html/download/experimental'
|
||||
else:
|
||||
directory = 'public_html/download'
|
||||
directory = 'public_html/download'
|
||||
|
||||
try:
|
||||
zf = z.open(package)
|
||||
@@ -129,6 +126,8 @@ try:
|
||||
|
||||
zf.close()
|
||||
z.close()
|
||||
|
||||
os.remove(filename)
|
||||
except Exception, ex:
|
||||
sys.stderr.write('Failed to unzip package: %s\n' % str(ex))
|
||||
sys.exit(1)
|
||||
|
@@ -33,7 +33,7 @@ builder = sys.argv[1]
|
||||
# we run from build/ directory
|
||||
blender_dir = '../blender.git'
|
||||
|
||||
if 'cmake' in builder:
|
||||
if builder.find('cmake') != -1:
|
||||
# cmake
|
||||
|
||||
# set build options
|
||||
@@ -46,21 +46,11 @@ if 'cmake' in builder:
|
||||
elif builder.endswith('mac_ppc_cmake'):
|
||||
cmake_options.append('-DCMAKE_OSX_ARCHITECTURES:STRING=ppc')
|
||||
|
||||
if 'win64' in builder:
|
||||
cmake_options.append(['-G','"Visual Studio 12 2013 Win64"'])
|
||||
elif 'win32' in builder:
|
||||
cmake_options.append(['-G','"Visual Studio 12 2013"'])
|
||||
|
||||
cmake_options.append("-C../blender.git/build_files/cmake/config/blender_full.cmake")
|
||||
cmake_options.append("-DWITH_CYCLES_CUDA_BINARIES=1")
|
||||
# configure and make
|
||||
retcode = subprocess.call(['cmake', blender_dir] + cmake_options)
|
||||
if retcode != 0:
|
||||
sys.exit(retcode)
|
||||
if 'win' in builder:
|
||||
retcode = subprocess.call(['msbuild', 'INSTALL.vcxproj', '/p:Configuration=Release'])
|
||||
else:
|
||||
retcode = subprocess.call(['make', '-s', '-j4', 'install'])
|
||||
retcode = subprocess.call(['make', '-s', '-j4', 'install'])
|
||||
sys.exit(retcode)
|
||||
else:
|
||||
python_bin = 'python'
|
||||
|
@@ -115,28 +115,6 @@ if builder.find('scons') != -1:
|
||||
|
||||
retcode = subprocess.call([python_bin, 'scons/scons.py'] + scons_options)
|
||||
sys.exit(retcode)
|
||||
else:
|
||||
#cmake
|
||||
if 'win' in builder:
|
||||
files = [f for f in os.listdir('.') if os.path.isfile(f) and f.endswith('.zip')]
|
||||
for f in files:
|
||||
os.remove(f)
|
||||
retcode = subprocess.call(['cpack', '-G','ZIP'])
|
||||
result_file = [f for f in os.listdir('.') if os.path.isfile(f) and f.endswith('.zip')][0]
|
||||
os.rename(result_file, "{}.zip".format(builder))
|
||||
# create zip file
|
||||
try:
|
||||
upload_zip = "buildbot_upload.zip"
|
||||
if os.path.exists(upload_zip):
|
||||
os.remove(upload_zip)
|
||||
z = zipfile.ZipFile(upload_zip, "w", compression=zipfile.ZIP_STORED)
|
||||
z.write("{}.zip".format(builder))
|
||||
z.close()
|
||||
sys.exit(retcode)
|
||||
except Exception, ex:
|
||||
sys.stderr.write('Create buildbot_upload.zip failed' + str(ex) + '\n')
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
# clean release directory if it already exists
|
||||
release_dir = 'release'
|
||||
|
@@ -75,5 +75,3 @@ MARK_AS_ADVANCED(
|
||||
GLEW_LIBRARY
|
||||
GLEW_MX_LIBRARY
|
||||
)
|
||||
|
||||
UNSET(_glew_SEARCH_DIRS)
|
||||
|
@@ -140,8 +140,3 @@ IF(OPENCOLLADA_FOUND)
|
||||
SET(OPENCOLLADA_LIBRARIES ${_opencollada_LIBRARIES})
|
||||
SET(OPENCOLLADA_INCLUDE_DIRS ${_opencollada_INCLUDES})
|
||||
ENDIF(OPENCOLLADA_FOUND)
|
||||
|
||||
UNSET(COMPONENT)
|
||||
UNSET(UPPERCOMPONENT)
|
||||
UNSET(_opencollada_LIBRARIES)
|
||||
UNSET(_opencollada_INCLUDES)
|
||||
|
@@ -63,12 +63,11 @@ FOREACH(COMPONENT ${_opencolorio_FIND_COMPONENTS})
|
||||
PATH_SUFFIXES
|
||||
lib64 lib
|
||||
)
|
||||
IF(OPENCOLORIO_${UPPERCOMPONENT}_LIBRARY)
|
||||
if(OPENCOLORIO_${UPPERCOMPONENT}_LIBRARY)
|
||||
LIST(APPEND _opencolorio_LIBRARIES "${OPENCOLORIO_${UPPERCOMPONENT}_LIBRARY}")
|
||||
ENDIF()
|
||||
endif()
|
||||
ENDFOREACH()
|
||||
|
||||
|
||||
# handle the QUIETLY and REQUIRED arguments and set OPENCOLORIO_FOUND to TRUE if
|
||||
# all listed variables are TRUE
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
@@ -83,13 +82,5 @@ ENDIF(OPENCOLORIO_FOUND)
|
||||
MARK_AS_ADVANCED(
|
||||
OPENCOLORIO_INCLUDE_DIR
|
||||
OPENCOLORIO_LIBRARY
|
||||
OPENCOLORIO_OPENCOLORIO_LIBRARY
|
||||
OPENCOLORIO_TINYXML_LIBRARY
|
||||
OPENCOLORIO_YAML-CPP_LIBRARY
|
||||
)
|
||||
|
||||
UNSET(COMPONENT)
|
||||
UNSET(UPPERCOMPONENT)
|
||||
UNSET(_opencolorio_FIND_COMPONENTS)
|
||||
UNSET(_opencolorio_LIBRARIES)
|
||||
UNSET(_opencolorio_SEARCH_DIRS)
|
||||
|
@@ -137,9 +137,3 @@ FOREACH(COMPONENT ${_openexr_FIND_COMPONENTS})
|
||||
STRING(TOUPPER ${COMPONENT} UPPERCOMPONENT)
|
||||
MARK_AS_ADVANCED(OPENEXR_${UPPERCOMPONENT}_LIBRARY)
|
||||
ENDFOREACH()
|
||||
|
||||
UNSET(COMPONENT)
|
||||
UNSET(UPPERCOMPONENT)
|
||||
UNSET(_openexr_FIND_COMPONENTS)
|
||||
UNSET(_openexr_LIBRARIES)
|
||||
UNSET(_openexr_SEARCH_DIRS)
|
||||
|
@@ -74,4 +74,3 @@ MARK_AS_ADVANCED(
|
||||
OPENGLES_INCLUDE_DIR
|
||||
)
|
||||
|
||||
UNSET(_opengles_SEARCH_DIRS)
|
||||
|
@@ -69,5 +69,3 @@ MARK_AS_ADVANCED(
|
||||
OPENIMAGEIO_INCLUDE_DIR
|
||||
OPENIMAGEIO_LIBRARY
|
||||
)
|
||||
|
||||
UNSET(_openimageio_SEARCH_DIRS)
|
||||
|
@@ -69,5 +69,3 @@ MARK_AS_ADVANCED(
|
||||
OPENJPEG_INCLUDE_DIR
|
||||
OPENJPEG_LIBRARY
|
||||
)
|
||||
|
||||
UNSET(_openjpeg_SEARCH_DIRS)
|
||||
|
@@ -146,14 +146,6 @@ file(WRITE buildinfo.h.txt
|
||||
"#define BUILD_TIME \"${BUILD_TIME}\"\n"
|
||||
)
|
||||
|
||||
# cleanup
|
||||
unset(MY_WC_HASH)
|
||||
unset(MY_WC_COMMIT_TIMESTAMP)
|
||||
unset(MY_WC_BRANCH)
|
||||
unset(BUILD_DATE)
|
||||
unset(BUILD_TIME)
|
||||
|
||||
|
||||
# Copy the file to the final header only if the version changes
|
||||
# and avoid needless rebuilds
|
||||
# TODO: verify this comment is true, as BUILD_TIME probably changes
|
||||
|
@@ -201,7 +201,7 @@ def cmake_get_src(f):
|
||||
# replace_line(f, i - 1, new_path_rel)
|
||||
|
||||
else:
|
||||
raise Exception("non existent include %s:%d -> %s" % (f, i, new_file))
|
||||
raise Exception("non existant include %s:%d -> %s" % (f, i, new_file))
|
||||
|
||||
# print(new_file)
|
||||
|
||||
|
@@ -125,8 +125,6 @@ def create_nb_project_main():
|
||||
f.write(' </configuration>\n')
|
||||
f.write('</project>\n')
|
||||
|
||||
f.close()
|
||||
|
||||
f = open(join(PROJECT_DIR_NB, "configurations.xml"), 'w')
|
||||
|
||||
f.write('<?xml version="1.0" encoding="UTF-8"?>\n')
|
||||
@@ -245,8 +243,6 @@ def create_nb_project_main():
|
||||
|
||||
f.write('</configurationDescriptor>\n')
|
||||
|
||||
f.close()
|
||||
|
||||
|
||||
def main():
|
||||
create_nb_project_main()
|
||||
|
@@ -63,21 +63,21 @@ def create_qtc_project_main():
|
||||
if SIMPLE_PROJECTFILE:
|
||||
# --- qtcreator specific, simple format
|
||||
PROJECT_NAME = "Blender"
|
||||
with open(os.path.join(PROJECT_DIR, "%s.files" % PROJECT_NAME), 'w') as f:
|
||||
f.write("\n".join(files_rel))
|
||||
f = open(os.path.join(PROJECT_DIR, "%s.files" % PROJECT_NAME), 'w')
|
||||
f.write("\n".join(files_rel))
|
||||
|
||||
with open(os.path.join(PROJECT_DIR, "%s.includes" % PROJECT_NAME), 'w') as f:
|
||||
f.write("\n".join(sorted(list(set(os.path.dirname(f)
|
||||
for f in files_rel if is_c_header(f))))))
|
||||
f = open(os.path.join(PROJECT_DIR, "%s.includes" % PROJECT_NAME), 'w')
|
||||
f.write("\n".join(sorted(list(set(os.path.dirname(f)
|
||||
for f in files_rel if is_c_header(f))))))
|
||||
|
||||
qtc_prj = os.path.join(PROJECT_DIR, "%s.creator" % PROJECT_NAME)
|
||||
with open(qtc_prj, 'w') as f:
|
||||
f.write("[General]\n")
|
||||
f = open(qtc_prj, 'w')
|
||||
f.write("[General]\n")
|
||||
|
||||
qtc_cfg = os.path.join(PROJECT_DIR, "%s.config" % PROJECT_NAME)
|
||||
if not os.path.exists(qtc_cfg):
|
||||
with open(qtc_cfg, 'w') as f:
|
||||
f.write("// ADD PREDEFINED MACROS HERE!\n")
|
||||
f = open(qtc_cfg, 'w')
|
||||
f.write("// ADD PREDEFINED MACROS HERE!\n")
|
||||
else:
|
||||
includes, defines = cmake_advanced_info()
|
||||
|
||||
@@ -96,30 +96,29 @@ def create_qtc_project_main():
|
||||
PROJECT_NAME = project_name_get()
|
||||
|
||||
FILE_NAME = PROJECT_NAME.lower()
|
||||
with open(os.path.join(PROJECT_DIR, "%s.files" % FILE_NAME), 'w') as f:
|
||||
f.write("\n".join(files_rel))
|
||||
f = open(os.path.join(PROJECT_DIR, "%s.files" % FILE_NAME), 'w')
|
||||
f.write("\n".join(files_rel))
|
||||
|
||||
with open(os.path.join(PROJECT_DIR, "%s.includes" % FILE_NAME), 'w', encoding='utf-8') as f:
|
||||
f.write("\n".join(sorted(includes)))
|
||||
f = open(os.path.join(PROJECT_DIR, "%s.includes" % FILE_NAME), 'w', encoding='utf-8')
|
||||
f.write("\n".join(sorted(includes)))
|
||||
|
||||
qtc_prj = os.path.join(PROJECT_DIR, "%s.creator" % FILE_NAME)
|
||||
with open(qtc_prj, 'w') as f:
|
||||
f.write("[General]\n")
|
||||
f = open(qtc_prj, 'w')
|
||||
f.write("[General]\n")
|
||||
|
||||
qtc_cfg = os.path.join(PROJECT_DIR, "%s.config" % FILE_NAME)
|
||||
with open(qtc_cfg, 'w') as f:
|
||||
f.write("// ADD PREDEFINED MACROS TO %s_custom.config!\n" % FILE_NAME)
|
||||
|
||||
qtc_custom_cfg = os.path.join(PROJECT_DIR, "%s_custom.config" % FILE_NAME)
|
||||
if os.path.exists(qtc_custom_cfg):
|
||||
with open(qtc_custom_cfg, 'r') as fc:
|
||||
f.write(fc.read())
|
||||
f.write("\n")
|
||||
|
||||
defines_final = [("#define %s %s" % (item[0], quote_define(item[1]))) for item in defines]
|
||||
if sys.platform != "win32":
|
||||
defines_final += cmake_compiler_defines()
|
||||
f.write("\n".join(defines_final))
|
||||
f = open(qtc_cfg, 'w')
|
||||
f.write("// ADD PREDEFINED MACROS TO %s_custom.config!\n" % FILE_NAME)
|
||||
qtc_custom_cfg = os.path.join(PROJECT_DIR, "%s_custom.config" % FILE_NAME)
|
||||
if os.path.exists(qtc_custom_cfg):
|
||||
fc = open(qtc_custom_cfg, 'r')
|
||||
f.write(fc.read())
|
||||
fc.close()
|
||||
f.write("\n")
|
||||
defines_final = [("#define %s %s" % (item[0], quote_define(item[1]))) for item in defines]
|
||||
if sys.platform != "win32":
|
||||
defines_final += cmake_compiler_defines()
|
||||
f.write("\n".join(defines_final))
|
||||
|
||||
print("Blender project file written to: %r" % qtc_prj)
|
||||
# --- end
|
||||
@@ -138,17 +137,17 @@ def create_qtc_project_python():
|
||||
PROJECT_NAME = project_name_get() + "_Python"
|
||||
|
||||
FILE_NAME = PROJECT_NAME.lower()
|
||||
with open(os.path.join(PROJECT_DIR, "%s.files" % FILE_NAME), 'w') as f:
|
||||
f.write("\n".join(files_rel))
|
||||
f = open(os.path.join(PROJECT_DIR, "%s.files" % FILE_NAME), 'w')
|
||||
f.write("\n".join(files_rel))
|
||||
|
||||
qtc_prj = os.path.join(PROJECT_DIR, "%s.creator" % FILE_NAME)
|
||||
with open(qtc_prj, 'w') as f:
|
||||
f.write("[General]\n")
|
||||
f = open(qtc_prj, 'w')
|
||||
f.write("[General]\n")
|
||||
|
||||
qtc_cfg = os.path.join(PROJECT_DIR, "%s.config" % FILE_NAME)
|
||||
if not os.path.exists(qtc_cfg):
|
||||
with open(qtc_cfg, 'w') as f:
|
||||
f.write("// ADD PREDEFINED MACROS HERE!\n")
|
||||
f = open(qtc_cfg, 'w')
|
||||
f.write("// ADD PREDEFINED MACROS HERE!\n")
|
||||
|
||||
print("Python project file written to: %r" % qtc_prj)
|
||||
|
||||
|
@@ -1,62 +0,0 @@
|
||||
# turn everything OFF except for python which defaults to ON
|
||||
# and is needed for the UI
|
||||
#
|
||||
# Example usage:
|
||||
# cmake -C../blender/build_files/cmake/config/blender_full.cmake ../blender
|
||||
#
|
||||
|
||||
set(WITH_BUILDINFO ON CACHE BOOL "" FORCE)
|
||||
set(WITH_BULLET ON CACHE BOOL "" FORCE)
|
||||
set(WITH_CODEC_AVI ON CACHE BOOL "" FORCE)
|
||||
set(WITH_CODEC_FFMPEG ON CACHE BOOL "" FORCE)
|
||||
set(WITH_CODEC_SNDFILE ON CACHE BOOL "" FORCE)
|
||||
set(WITH_CYCLES ON CACHE BOOL "" FORCE)
|
||||
set(WITH_FFTW3 ON CACHE BOOL "" FORCE)
|
||||
set(WITH_LIBMV ON CACHE BOOL "" FORCE)
|
||||
set(WITH_GAMEENGINE ON CACHE BOOL "" FORCE)
|
||||
set(WITH_COMPOSITOR ON CACHE BOOL "" FORCE)
|
||||
set(WITH_FREESTYLE ON CACHE BOOL "" FORCE)
|
||||
set(WITH_GHOST_XDND ON CACHE BOOL "" FORCE)
|
||||
set(WITH_IK_SOLVER ON CACHE BOOL "" FORCE)
|
||||
set(WITH_IK_ITASC ON CACHE BOOL "" FORCE)
|
||||
set(WITH_IMAGE_CINEON ON CACHE BOOL "" FORCE)
|
||||
set(WITH_IMAGE_DDS ON CACHE BOOL "" FORCE)
|
||||
set(WITH_IMAGE_FRAMESERVER ON CACHE BOOL "" FORCE)
|
||||
set(WITH_IMAGE_HDR ON CACHE BOOL "" FORCE)
|
||||
set(WITH_IMAGE_OPENEXR ON CACHE BOOL "" FORCE)
|
||||
set(WITH_IMAGE_OPENJPEG ON CACHE BOOL "" FORCE)
|
||||
set(WITH_IMAGE_REDCODE ON CACHE BOOL "" FORCE)
|
||||
set(WITH_IMAGE_TIFF ON CACHE BOOL "" FORCE)
|
||||
set(WITH_INPUT_NDOF ON CACHE BOOL "" FORCE)
|
||||
set(WITH_INTERNATIONAL ON CACHE BOOL "" FORCE)
|
||||
set(WITH_JACK ON CACHE BOOL "" FORCE)
|
||||
set(WITH_LZMA ON CACHE BOOL "" FORCE)
|
||||
set(WITH_LZO ON CACHE BOOL "" FORCE)
|
||||
set(WITH_MOD_BOOLEAN ON CACHE BOOL "" FORCE)
|
||||
set(WITH_MOD_FLUID ON CACHE BOOL "" FORCE)
|
||||
set(WITH_MOD_REMESH ON CACHE BOOL "" FORCE)
|
||||
set(WITH_MOD_SMOKE ON CACHE BOOL "" FORCE)
|
||||
set(WITH_MOD_OCEANSIM ON CACHE BOOL "" FORCE)
|
||||
set(WITH_AUDASPACE ON CACHE BOOL "" FORCE)
|
||||
set(WITH_OPENAL ON CACHE BOOL "" FORCE)
|
||||
set(WITH_OPENCOLLADA ON CACHE BOOL "" FORCE)
|
||||
set(WITH_OPENCOLORIO ON CACHE BOOL "" FORCE)
|
||||
set(WITH_OPENMP ON CACHE BOOL "" FORCE)
|
||||
set(WITH_OPENNL ON CACHE BOOL "" FORCE)
|
||||
set(WITH_PYTHON_INSTALL ON CACHE BOOL "" FORCE)
|
||||
set(WITH_RAYOPTIMIZATION ON CACHE BOOL "" FORCE)
|
||||
set(WITH_SDL ON CACHE BOOL "" FORCE)
|
||||
set(WITH_X11_XINPUT ON CACHE BOOL "" FORCE)
|
||||
set(WITH_X11_XF86VMODE ON CACHE BOOL "" FORCE)
|
||||
|
||||
set(WITH_PLAYER ON CACHE BOOL "" FORCE)
|
||||
set(WITH_MEM_JEMALLOC ON CACHE BOOL "" FORCE)
|
||||
|
||||
if(UNIX AND NOT APPLE)
|
||||
set(WITH_DOC_MANPAGE ON CACHE BOOL "" FORCE)
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
set(WITH_CODEC_QUICKTIME ON CACHE BOOL "" FORCE)
|
||||
endif()
|
||||
|
@@ -44,7 +44,6 @@ set(WITH_AUDASPACE OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_OPENAL OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_OPENCOLLADA OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_OPENCOLORIO OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_OPENIMAGEIO OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_OPENMP OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_OPENNL OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_PYTHON_INSTALL OFF CACHE BOOL "" FORCE)
|
||||
|
@@ -221,7 +221,7 @@ macro(SETUP_LIBDIRS)
|
||||
if(WITH_PYTHON) # AND NOT WITH_PYTHON_MODULE # WIN32 needs
|
||||
link_directories(${PYTHON_LIBPATH})
|
||||
endif()
|
||||
if(WITH_SDL AND NOT WITH_SDL_DYNLOAD)
|
||||
if(WITH_SDL)
|
||||
link_directories(${SDL_LIBPATH})
|
||||
endif()
|
||||
if(WITH_CODEC_FFMPEG)
|
||||
@@ -321,7 +321,7 @@ macro(setup_liblinks
|
||||
if(WITH_CODEC_SNDFILE)
|
||||
target_link_libraries(${target} ${SNDFILE_LIBRARIES})
|
||||
endif()
|
||||
if(WITH_SDL AND NOT WITH_SDL_DYNLOAD)
|
||||
if(WITH_SDL)
|
||||
target_link_libraries(${target} ${SDL_LIBRARY})
|
||||
endif()
|
||||
if(WITH_CODEC_QUICKTIME)
|
||||
@@ -559,7 +559,6 @@ macro(SETUP_BLENDER_SORTED_LIBS)
|
||||
extern_wcwidth
|
||||
extern_libmv
|
||||
extern_glog
|
||||
extern_sdlew
|
||||
|
||||
bf_intern_glew_mx
|
||||
)
|
||||
@@ -723,8 +722,6 @@ macro(TEST_SSE_SUPPORT
|
||||
endmacro()
|
||||
|
||||
macro(TEST_STDBOOL_SUPPORT)
|
||||
include(CheckCSourceRuns)
|
||||
|
||||
# This program will compile correctly if and only if
|
||||
# this C compiler supports C99 stdbool.
|
||||
check_c_source_runs("
|
||||
@@ -999,7 +996,7 @@ macro(ADD_CHECK_CXX_COMPILER_FLAG
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
function(get_blender_version)
|
||||
macro(get_blender_version)
|
||||
# So cmake depends on BKE_blender.h, beware of inf-loops!
|
||||
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/source/blender/blenkernel/BKE_blender.h
|
||||
${CMAKE_BINARY_DIR}/source/blender/blenkernel/BKE_blender.h.done)
|
||||
@@ -1034,24 +1031,31 @@ function(get_blender_version)
|
||||
|
||||
math(EXPR BLENDER_VERSION_MAJOR "${_out_version} / 100")
|
||||
math(EXPR BLENDER_VERSION_MINOR "${_out_version} % 100")
|
||||
set(BLENDER_VERSION "${BLENDER_VERSION_MAJOR}.${BLENDER_VERSION_MINOR}" PARENT_SCOPE)
|
||||
set(BLENDER_VERSION "${BLENDER_VERSION_MAJOR}.${BLENDER_VERSION_MINOR}")
|
||||
|
||||
set(BLENDER_SUBVERSION ${_out_subversion} PARENT_SCOPE)
|
||||
set(BLENDER_VERSION_CHAR ${_out_version_char} PARENT_SCOPE)
|
||||
set(BLENDER_VERSION_CYCLE ${_out_version_cycle} PARENT_SCOPE)
|
||||
set(BLENDER_SUBVERSION ${_out_subversion})
|
||||
set(BLENDER_VERSION_CHAR ${_out_version_char})
|
||||
set(BLENDER_VERSION_CYCLE ${_out_version_cycle})
|
||||
|
||||
# for packaging, alpha to numbers
|
||||
string(COMPARE EQUAL "${BLENDER_VERSION_CHAR}" "" _out_version_char_empty)
|
||||
if(${_out_version_char_empty})
|
||||
set(BLENDER_VERSION_CHAR_INDEX "0" PARENT_SCOPE)
|
||||
set(BLENDER_VERSION_CHAR_INDEX "0")
|
||||
else()
|
||||
set(_char_ls a b c d e f g h i j k l m n o p q r s t u v w x y z)
|
||||
list(FIND _char_ls ${BLENDER_VERSION_CHAR} _out_version_char_index)
|
||||
math(EXPR BLENDER_VERSION_CHAR_INDEX "${_out_version_char_index} + 1" PARENT_SCOPE)
|
||||
math(EXPR BLENDER_VERSION_CHAR_INDEX "${_out_version_char_index} + 1")
|
||||
unset(_char_ls)
|
||||
unset(_out_version_char_index)
|
||||
endif()
|
||||
|
||||
unset(_out_subversion)
|
||||
unset(_out_version_char)
|
||||
unset(_out_version_char_empty)
|
||||
unset(_out_version_cycle)
|
||||
|
||||
# message(STATUS "Version (Internal): ${BLENDER_VERSION}.${BLENDER_SUBVERSION}, Version (external): ${BLENDER_VERSION}${BLENDER_VERSION_CHAR}-${BLENDER_VERSION_CYCLE}")
|
||||
endfunction()
|
||||
endmacro()
|
||||
|
||||
|
||||
# hacks to override initial project settings
|
||||
@@ -1148,7 +1152,6 @@ macro(delayed_install
|
||||
endif()
|
||||
set_property(GLOBAL APPEND PROPERTY DELAYED_INSTALL_DESTINATIONS ${destination})
|
||||
endforeach()
|
||||
unset(f)
|
||||
endmacro()
|
||||
|
||||
# note this is a function instead of a macro so that ${BUILD_TYPE} in targetdir
|
||||
@@ -1168,7 +1171,6 @@ function(delayed_do_install
|
||||
list(GET destinations ${i} d)
|
||||
install(FILES ${f} DESTINATION ${targetdir}/${d})
|
||||
endforeach()
|
||||
unset(f)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
@@ -1383,14 +1385,3 @@ macro(find_python_package
|
||||
|
||||
unset(_upper_package)
|
||||
endmacro()
|
||||
|
||||
# like Python's 'print(dir())'
|
||||
macro(print_all_vars)
|
||||
get_cmake_property(_vars VARIABLES)
|
||||
foreach(_var ${_vars})
|
||||
message("${_var}=${${_var}}")
|
||||
endforeach()
|
||||
unset(_vars)
|
||||
unset(_var)
|
||||
endmacro()
|
||||
|
||||
|
@@ -2,6 +2,7 @@ set(PROJECT_DESCRIPTION "Blender is a very fast and versatile 3D modeller/rende
|
||||
set(PROJECT_COPYRIGHT "Copyright (C) 2001-2012 Blender Foundation")
|
||||
set(PROJECT_CONTACT "foundation@blender.org")
|
||||
set(PROJECT_VENDOR "Blender Foundation")
|
||||
set(ORG_WEBSITE "www.blender.org")
|
||||
|
||||
set(MAJOR_VERSION ${BLENDER_VERSION_MAJOR})
|
||||
set(MINOR_VERSION ${BLENDER_VERSION_MINOR})
|
||||
@@ -31,7 +32,6 @@ if(EXISTS ${CMAKE_SOURCE_DIR}/.git/)
|
||||
endif()
|
||||
endif()
|
||||
set(BUILD_REV ${MY_WC_HASH})
|
||||
unset(MY_WC_HASH)
|
||||
|
||||
|
||||
# Force Package Name
|
||||
@@ -41,7 +41,7 @@ set(CPACK_PACKAGE_FILE_NAME ${PROJECT_NAME}-${MAJOR_VERSION}.${MINOR_VERSION}.${
|
||||
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||
# RPM packages
|
||||
include(build_files/cmake/RpmBuild.cmake)
|
||||
if(RPMBUILD_FOUND)
|
||||
if(RPMBUILD_FOUND AND NOT WIN32)
|
||||
set(CPACK_GENERATOR "RPM")
|
||||
set(CPACK_RPM_PACKAGE_RELEASE "git${CPACK_DATE}.${BUILD_REV}")
|
||||
set(CPACK_SET_DESTDIR "true")
|
||||
@@ -61,25 +61,7 @@ if(APPLE)
|
||||
set(CPACK_COMPONENT_LIBRARIES_HIDDEN TRUE)
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
set(CPACK_PACKAGE_INSTALL_DIRECTORY "Blender Foundation/Blender")
|
||||
set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "Blender Foundation/Blender")
|
||||
|
||||
set(CPACK_NSIS_MUI_ICON ${CMAKE_SOURCE_DIR}/source/icons/winblender.ico)
|
||||
set(CPACK_NSIS_COMPRESSOR "/SOLID lzma")
|
||||
|
||||
set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_SOURCE_DIR}/release/text/GPL-license.txt)
|
||||
set(CPACK_WIX_PRODUCT_ICON ${CMAKE_SOURCE_DIR}/source/icons/winblender.ico)
|
||||
set(CPACK_WIX_UPGRADE_GUID "B767E4FD-7DE7-4094-B051-3AE62E13A17A")
|
||||
|
||||
set(CPACK_WIX_UI_BANNER ${LIBDIR}/package/installer_wix/WIX_UI_BANNER.bmp)
|
||||
set(CPACK_WIX_UI_DIALOG ${LIBDIR}/package/installer_wix/WIX_UI_DIALOG.bmp)
|
||||
|
||||
#force lzma instead of deflate
|
||||
set(CPACK_WIX_LIGHT_EXTRA_FLAGS -dcl:high)
|
||||
endif()
|
||||
|
||||
set(CPACK_PACKAGE_EXECUTABLES "blender" "blender")
|
||||
set(CPACK_PACKAGE_EXECUTABLES "blender")
|
||||
include(CPack)
|
||||
|
||||
# Target for build_archive.py script, to automatically pass along
|
||||
@@ -94,8 +76,6 @@ macro(add_package_archive packagename extension)
|
||||
OUTPUT ${package_output}
|
||||
COMMAND ${build_archive} ${packagename} ${extension} bin release
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
|
||||
unset(build_archive)
|
||||
unset(package_output)
|
||||
endmacro()
|
||||
|
||||
if(APPLE)
|
||||
|
@@ -17,7 +17,7 @@ else
|
||||
blender_version_full=${blender_version}
|
||||
fi
|
||||
|
||||
blender_ver_string=$blender_version+git$blender_version_full
|
||||
blender_ver_string=$blender_version+svn$blender_version_full
|
||||
|
||||
pkgname=blender-snapshot
|
||||
pkgver=$blender_ver_string
|
||||
@@ -27,8 +27,8 @@ arch=('i686' 'x86_64')
|
||||
url="www.blender.org"
|
||||
license=('GPL')
|
||||
groups=()
|
||||
depends=('libjpeg' 'libpng' 'openjpeg' 'libtiff' 'openexr' 'python>=3.4' 'gettext' 'libxi' 'libxmu' 'mesa' 'freetype2' 'openal' 'sdl' 'libsndfile' 'ffmpeg')
|
||||
makedepends=('cmake' 'git')
|
||||
depends=('libjpeg' 'libpng' 'openjpeg' 'libtiff' 'openexr' 'python>=3.2' 'gettext' 'libxi' 'libxmu' 'mesa' 'freetype2' 'openal' 'sdl' 'libsndfile' 'ffmpeg')
|
||||
makedepends=('cmake' 'svn')
|
||||
optdepends=()
|
||||
provides=()
|
||||
conflicts=('blender')
|
||||
@@ -36,7 +36,7 @@ replaces=('blender')
|
||||
backup=()
|
||||
options=()
|
||||
install=blender.install
|
||||
# use current git to make the package.
|
||||
# use current svn to make the package.
|
||||
# source=(http://download.blender.org/source/$pkgname-$pkgver.tar.gz)
|
||||
# md5sums=('27edb80c82c25252d43d6a01980d953a') #generate with 'makepkg -g'
|
||||
source=()
|
||||
@@ -51,7 +51,11 @@ build() {
|
||||
-DCMAKE_BUILD_TYPE:STRING=Release \
|
||||
-DWITH_INSTALL_PORTABLE:BOOL=OFF \
|
||||
-DWITH_PYTHON_INSTALL:BOOL=OFF \
|
||||
-DWITH_OPENCOLLADA:BOOL=OFF
|
||||
-DWITH_OPENCOLLADA:BOOL=OFF \
|
||||
-DPYTHON_VERSION:STRING=3.2 \
|
||||
-DPYTHON_LIBPATH:STRING=/usr/lib \
|
||||
-DPYTHON_LIBRARY:STRING=python3.2mu \
|
||||
-DPYTHON_INCLUDE_DIRS:STRING=/usr/include/python3.2mu
|
||||
|
||||
make $MAKEFLAGS
|
||||
}
|
||||
|
@@ -68,7 +68,7 @@ BF_SNDFILE_LIBPATH = '${BF_SNDFILE}/lib ${BF_FFMPEG}/lib' #ogg libs are stored i
|
||||
WITH_BF_SDL = True
|
||||
BF_SDL = LIBDIR + '/sdl' #$(shell sdl-config --prefix)
|
||||
BF_SDL_INC = '${BF_SDL}/include' #$(shell $(BF_SDL)/bin/sdl-config --cflags)
|
||||
BF_SDL_LIB = 'SDL2' #BF_SDL #$(shell $(BF_SDL)/bin/sdl-config --libs) -lSDL_mixer
|
||||
BF_SDL_LIB = 'SDL' #BF_SDL #$(shell $(BF_SDL)/bin/sdl-config --libs) -lSDL_mixer
|
||||
BF_SDL_LIBPATH = '${BF_SDL}/lib'
|
||||
|
||||
WITH_BF_OPENEXR = True
|
||||
@@ -205,7 +205,7 @@ BF_BOOST_LIBPATH = '${BF_BOOST}/lib'
|
||||
|
||||
WITH_BF_CYCLES_CUDA_BINARIES = False
|
||||
BF_CYCLES_CUDA_NVCC = '/usr/local/cuda/bin/nvcc'
|
||||
BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30', 'sm_35', 'sm_50', 'sm_52']
|
||||
BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30', 'sm_35', 'sm_50']
|
||||
|
||||
#Freestyle
|
||||
WITH_BF_FREESTYLE = True
|
||||
|
@@ -197,7 +197,7 @@ BF_BOOST = '/usr'
|
||||
BF_BOOST_INC = '${BF_BOOST}/include'
|
||||
BF_BOOST_LIB = 'boost_filesystem boost_regex boost_system boost_thread boost_date_time'
|
||||
BF_BOOST_LIB_STATIC = '${BF_BOOST_LIBPATH}/libboost_filesystem.a ${BF_BOOST_LIBPATH}/libboost_date_time.a ' + \
|
||||
'${BF_BOOST_LIBPATH}/libboost_regex.a ${BF_BOOST_LIBPATH}/libboost_locale.a ${BF_BOOST_LIBPATH}/libboost_system.a ' + \
|
||||
'${BF_BOOST_LIBPATH}/libboost_regex.a ${BF_BOOST_LIBPATH}/libboost_locale.a ${BF_BOOST_LIBPATH}/libboost_system.a' + \
|
||||
'${BF_BOOST_LIBPATH}/libboost_thread.a'
|
||||
BF_BOOST_LIB_INTERNATIONAL = 'boost_locale'
|
||||
BF_BOOST_LIBPATH = '${BF_BOOST}/lib'
|
||||
@@ -262,6 +262,6 @@ BF_INSTALLDIR='../install/linux'
|
||||
#Link against pthread
|
||||
PLATFORM_LINKFLAGS = ['-pthread']
|
||||
|
||||
#Fix for LLVM conflict with Mesa llvmpipe, SDL dynload also requires symbols to be hidden.
|
||||
# TODO(sergey): Move this to SConstruct, so we can have this line depended on user config.
|
||||
PLATFORM_LINKFLAGS += ['-Wl,--version-script=source/creator/blender.map']
|
||||
#Fix for LLVM conflict with Mesa llvmpipe
|
||||
if WITH_BF_LLVM:
|
||||
PLATFORM_LINKFLAGS += ['-Wl,--version-script=source/creator/blender.map']
|
||||
|
@@ -196,7 +196,7 @@ C_WARN = ['-Wno-char-subscripts', '-Wdeclaration-after-statement', '-Wstrict-pro
|
||||
|
||||
CC_WARN = [ '-Wall' ]
|
||||
|
||||
LLIBS = ['-lshell32', '-lshfolder', '-lgdi32', '-lmsvcrt', '-lwinmm', '-lmingw32', '-lm', '-lws2_32', '-lz', '-lstdc++','-lole32','-luuid', '-lwsock32', '-lpsapi', '-limm32']
|
||||
LLIBS = ['-lshell32', '-lshfolder', '-lgdi32', '-lmsvcrt', '-lwinmm', '-lmingw32', '-lm', '-lws2_32', '-lz', '-lstdc++','-lole32','-luuid', '-lwsock32', '-lpsapi']
|
||||
|
||||
PLATFORM_LINKFLAGS = ['-Xlinker', '--stack=2097152']
|
||||
|
||||
|
@@ -57,7 +57,7 @@ BF_SNDFILE_LIBPATH = '${BF_SNDFILE}/lib'
|
||||
WITH_BF_SDL = True
|
||||
BF_SDL = LIBDIR + '/sdl'
|
||||
BF_SDL_INC = '${BF_SDL}/include'
|
||||
BF_SDL_LIB = 'SDL2.lib'
|
||||
BF_SDL_LIB = 'SDL.lib'
|
||||
BF_SDL_LIBPATH = '${BF_SDL}/lib'
|
||||
|
||||
BF_PTHREADS = LIBDIR + '/pthreads'
|
||||
@@ -197,7 +197,7 @@ BF_BOOST_LIBPATH = '${BF_BOOST}/lib'
|
||||
#CUDA
|
||||
WITH_BF_CYCLES_CUDA_BINARIES = False
|
||||
#BF_CYCLES_CUDA_NVCC = "" # Path to the nvidia compiler
|
||||
BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30', 'sm_35', 'sm_50', 'sm_52']
|
||||
BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30', 'sm_35', 'sm_50']
|
||||
|
||||
#Ray trace optimization
|
||||
WITH_BF_RAYOPTIMIZATION = True
|
||||
@@ -235,7 +235,7 @@ C_WARN = []
|
||||
CC_WARN = []
|
||||
CXX_WARN = []
|
||||
|
||||
LLIBS = ['ws2_32', 'vfw32', 'winmm', 'kernel32', 'user32', 'gdi32', 'comdlg32', 'advapi32', 'shfolder', 'shell32', 'ole32', 'oleaut32', 'uuid', 'psapi', 'imm32']
|
||||
LLIBS = ['ws2_32', 'vfw32', 'winmm', 'kernel32', 'user32', 'gdi32', 'comdlg32', 'advapi32', 'shfolder', 'shell32', 'ole32', 'oleaut32', 'uuid', 'psapi']
|
||||
|
||||
PLATFORM_LINKFLAGS = ['/SUBSYSTEM:CONSOLE','/MACHINE:IX86','/STACK:2097152','/INCREMENTAL:NO', '/LARGEADDRESSAWARE', '/NODEFAULTLIB:msvcrt.lib', '/NODEFAULTLIB:msvcmrt.lib', '/NODEFAULTLIB:msvcurt.lib', '/NODEFAULTLIB:msvcrtd.lib']
|
||||
|
||||
|
@@ -190,7 +190,7 @@ C_WARN = ['-Wno-char-subscripts', '-Wdeclaration-after-statement', '-Wstrict-pro
|
||||
|
||||
CC_WARN = [ '-Wall' ]
|
||||
|
||||
LLIBS = ['-lshell32', '-lshfolder', '-lgdi32', '-lmsvcrt', '-lwinmm', '-lmingw32', '-lm', '-lws2_32', '-lz', '-lstdc++','-lole32','-luuid', '-lwsock32', '-lpsapi', '-lpthread', '-limm32']
|
||||
LLIBS = ['-lshell32', '-lshfolder', '-lgdi32', '-lmsvcrt', '-lwinmm', '-lmingw32', '-lm', '-lws2_32', '-lz', '-lstdc++','-lole32','-luuid', '-lwsock32', '-lpsapi', '-lpthread']
|
||||
|
||||
PLATFORM_LINKFLAGS = ['-Xlinker', '--stack=2097152']
|
||||
|
||||
|
@@ -52,7 +52,7 @@ BF_ICONV_LIBPATH = '${BF_ICONV}/lib'
|
||||
WITH_BF_SDL = True
|
||||
BF_SDL = LIBDIR + '/sdl'
|
||||
BF_SDL_INC = '${BF_SDL}/include'
|
||||
BF_SDL_LIB = 'SDL2.lib'
|
||||
BF_SDL_LIB = 'SDL.lib'
|
||||
BF_SDL_LIBPATH = '${BF_SDL}/lib'
|
||||
|
||||
WITH_BF_JACK = False
|
||||
@@ -200,7 +200,7 @@ BF_BOOST_LIBPATH = '${BF_BOOST}/lib'
|
||||
#CUDA
|
||||
WITH_BF_CYCLES_CUDA_BINARIES = False
|
||||
#BF_CYCLES_CUDA_NVCC = "" # Path to the nvidia compiler
|
||||
BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30', 'sm_35', 'sm_50', 'sm_52']
|
||||
BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30', 'sm_35', 'sm_50']
|
||||
|
||||
#Ray trace optimization
|
||||
WITH_BF_RAYOPTIMIZATION = True
|
||||
@@ -242,7 +242,7 @@ C_WARN = []
|
||||
CC_WARN = []
|
||||
CXX_WARN = []
|
||||
|
||||
LLIBS = ['ws2_32', 'vfw32', 'winmm', 'kernel32', 'user32', 'gdi32', 'comdlg32', 'advapi32', 'shfolder', 'shell32', 'ole32', 'oleaut32', 'uuid', 'psapi', 'imm32']
|
||||
LLIBS = ['ws2_32', 'vfw32', 'winmm', 'kernel32', 'user32', 'gdi32', 'comdlg32', 'advapi32', 'shfolder', 'shell32', 'ole32', 'oleaut32', 'uuid', 'psapi']
|
||||
|
||||
PLATFORM_LINKFLAGS = ['/SUBSYSTEM:CONSOLE','/MACHINE:X64','/STACK:2097152','/OPT:NOREF','/INCREMENTAL:NO', '/NODEFAULTLIB:msvcrt.lib', '/NODEFAULTLIB:msvcmrt.lib', '/NODEFAULTLIB:msvcurt.lib', '/NODEFAULTLIB:msvcrtd.lib']
|
||||
|
||||
|
@@ -143,7 +143,7 @@ def setup_staticlibs(lenv):
|
||||
libincs += Split(lenv['BF_FREETYPE_LIBPATH'])
|
||||
if lenv['WITH_BF_PYTHON']:
|
||||
libincs += Split(lenv['BF_PYTHON_LIBPATH'])
|
||||
if lenv['WITH_BF_SDL'] and not lenv['WITH_BF_SDL_DYNLOAD']:
|
||||
if lenv['WITH_BF_SDL']:
|
||||
libincs += Split(lenv['BF_SDL_LIBPATH'])
|
||||
if lenv['WITH_BF_JACK'] and not lenv['WITH_BF_JACK_DYNLOAD']:
|
||||
libincs += Split(lenv['BF_JACK_LIBPATH'])
|
||||
@@ -303,7 +303,7 @@ def setup_syslibs(lenv):
|
||||
if lenv['WITH_BF_ELTOPO']:
|
||||
syslibs += Split(lenv['BF_LAPACK_LIB'])
|
||||
'''
|
||||
if lenv['WITH_BF_SDL'] and not lenv['WITH_BF_SDL_DYNLOAD']:
|
||||
if lenv['WITH_BF_SDL']:
|
||||
syslibs += Split(lenv['BF_SDL_LIB'])
|
||||
if not lenv['WITH_BF_STATICOPENGL']:
|
||||
syslibs += Split(lenv['BF_OPENGL_LIB'])
|
||||
@@ -381,19 +381,12 @@ def creator(env):
|
||||
defs.append('WITH_BINRELOC')
|
||||
|
||||
if env['WITH_BF_SDL']:
|
||||
if env['WITH_BF_SDL_DYNLOAD']:
|
||||
defs.append('WITH_SDL_DYNLOAD')
|
||||
incs.append('#/extern/sdlew/include')
|
||||
defs.append('WITH_SDL')
|
||||
|
||||
if env['WITH_BF_LIBMV']:
|
||||
incs.append('#/extern/libmv')
|
||||
defs.append('WITH_LIBMV')
|
||||
|
||||
if env['WITH_BF_CYCLES'] and env['WITH_BF_CYCLES_LOGGING']:
|
||||
incs.append('#/intern/cycles/blender')
|
||||
defs.append('WITH_CYCLES_LOGGING')
|
||||
|
||||
if env['WITH_BF_FFMPEG']:
|
||||
defs.append('WITH_FFMPEG')
|
||||
|
||||
@@ -816,6 +809,10 @@ def AppIt(target=None, source=None, env=None):
|
||||
instname = env['LCGDIR'][1:] # made libiomp5 part of blender libs
|
||||
cmd = 'ditto --arch %s %s/openmp/lib/libiomp5.dylib %s/%s.app/Contents/Resources/lib/'%(osxarch, instname, installdir, binary) # copy libiomp5
|
||||
commands.getoutput(cmd)
|
||||
cmd = 'install_name_tool -id @loader_path/../Resources/lib/libiomp5.dylib %s/%s.app/Contents/Resources/lib/libiomp5.dylib'%(installdir, binary) # change id of libiomp5
|
||||
commands.getoutput(cmd)
|
||||
cmd = 'install_name_tool -change @loader_path/libiomp5.dylib @loader_path/../Resources/lib/libiomp5.dylib %s/%s.app/Contents/MacOS/%s'%(installdir, binary, binary) # change ref to libiomp5 ( blender )
|
||||
commands.getoutput(cmd)
|
||||
|
||||
# extract copy system python, be sure to update other build systems
|
||||
# when making changes to the files that are copied.
|
||||
|
@@ -108,7 +108,7 @@ def validate_arguments(args, bc):
|
||||
opts_list = [
|
||||
'WITH_BF_FREESTYLE', 'WITH_BF_PYTHON', 'WITH_BF_PYTHON_SAFETY', 'WITH_BF_PYTHON_SECURITY', 'BF_PYTHON', 'BF_PYTHON_VERSION', 'BF_PYTHON_INC', 'BF_PYTHON_BINARY', 'BF_PYTHON_LIB', 'BF_PYTHON_LIBPATH', 'BF_PYTHON_LIBPATH_ARCH', 'WITH_BF_STATICPYTHON', 'WITH_OSX_STATICPYTHON', 'BF_PYTHON_LIB_STATIC', 'BF_PYTHON_DLL', 'BF_PYTHON_ABI_FLAGS',
|
||||
'WITH_BF_OPENAL', 'BF_OPENAL', 'BF_OPENAL_INC', 'BF_OPENAL_LIB', 'BF_OPENAL_LIBPATH', 'WITH_BF_STATICOPENAL', 'BF_OPENAL_LIB_STATIC',
|
||||
'WITH_BF_SDL', 'BF_SDL', 'BF_SDL_INC', 'BF_SDL_LIB', 'BF_SDL_LIBPATH', 'WITH_BF_SDL_DYNLOAD',
|
||||
'WITH_BF_SDL', 'BF_SDL', 'BF_SDL_INC', 'BF_SDL_LIB', 'BF_SDL_LIBPATH',
|
||||
'WITH_BF_JACK', 'BF_JACK', 'BF_JACK_INC', 'BF_JACK_LIB', 'BF_JACK_LIBPATH', 'WITH_BF_JACK_DYNLOAD',
|
||||
'WITH_BF_SNDFILE', 'BF_SNDFILE', 'BF_SNDFILE_INC', 'BF_SNDFILE_LIB', 'BF_SNDFILE_LIBPATH', 'WITH_BF_STATICSNDFILE', 'BF_SNDFILE_LIB_STATIC',
|
||||
'BF_PTHREADS', 'BF_PTHREADS_INC', 'BF_PTHREADS_LIB', 'BF_PTHREADS_LIBPATH',
|
||||
@@ -137,7 +137,6 @@ def validate_arguments(args, bc):
|
||||
'WITH_BF_FFTW3', 'BF_FFTW3', 'BF_FFTW3_INC', 'BF_FFTW3_LIB', 'BF_FFTW3_LIBPATH', 'WITH_BF_STATICFFTW3', 'BF_FFTW3_LIB_STATIC',
|
||||
'WITH_BF_STATICOPENGL', 'BF_OPENGL', 'BF_OPENGL_INC', 'BF_OPENGL_LIB', 'BF_OPENGL_LIBPATH', 'BF_OPENGL_LIB_STATIC',
|
||||
'WITH_BF_EGL', 'WITH_BF_GLEW_ES', 'BF_GLEW_INC', 'WITH_BF_GL_PROFILE_CORE', 'WITH_BF_GL_PROFILE_COMPAT', 'WITH_BF_GL_PROFILE_ES20',
|
||||
'WITH_BF_GLEW_MX', 'WITH_BF_GL_EGL', 'WITH_BF_GL_ANGLE',
|
||||
|
||||
'WITH_BF_COLLADA', 'BF_COLLADA', 'BF_COLLADA_INC', 'BF_COLLADA_LIB', 'BF_OPENCOLLADA', 'BF_OPENCOLLADA_INC', 'BF_OPENCOLLADA_LIB', 'BF_OPENCOLLADA_LIBPATH', 'BF_PCRE', 'BF_PCRE_LIB', 'BF_PCRE_LIBPATH', 'BF_EXPAT', 'BF_EXPAT_LIB', 'BF_EXPAT_LIBPATH',
|
||||
'WITH_BF_STATICOPENCOLLADA', 'BF_OPENCOLLADA_LIB_STATIC',
|
||||
@@ -197,7 +196,7 @@ def validate_arguments(args, bc):
|
||||
'C_WARN', 'CC_WARN', 'CXX_WARN',
|
||||
'LLIBS', 'PLATFORM_LINKFLAGS', 'MACOSX_ARCHITECTURE', 'MACOSX_SDK', 'XCODE_CUR_VER', 'C_COMPILER_ID',
|
||||
'BF_CYCLES_CUDA_BINARIES_ARCH', 'BF_PROGRAM_LINKFLAGS', 'MACOSX_DEPLOYMENT_TARGET',
|
||||
'WITH_BF_CYCLES_DEBUG', 'WITH_BF_CYCLES_LOGGING'
|
||||
'WITH_BF_CYCLES_DEBUG'
|
||||
]
|
||||
|
||||
|
||||
@@ -300,7 +299,6 @@ def read_opts(env, cfg, args):
|
||||
('BF_SDL_INC', 'SDL include path', ''),
|
||||
('BF_SDL_LIB', 'SDL library', ''),
|
||||
('BF_SDL_LIBPATH', 'SDL library path', ''),
|
||||
(BoolVariable('WITH_BF_SDL_DYNLOAD', 'Enable runtime dynamic SDL libraries loading (works only on Linux)', False)),
|
||||
|
||||
(BoolVariable('WITH_BF_JACK', 'Enable jack support if true', True)),
|
||||
('BF_JACK', 'jack base path', ''),
|
||||
@@ -467,7 +465,7 @@ def read_opts(env, cfg, args):
|
||||
('BF_OPENGL_LIB_STATIC', 'OpenGL static libraries', ''),
|
||||
('BF_OPENGL_LINKFLAGS', 'OpenGL link flags', ''),
|
||||
|
||||
(BoolVariable('WITH_BF_GLEW_MX', '', False)),
|
||||
(BoolVariable('WITH_BF_GLEW_MX', '', True)),
|
||||
(BoolVariable('WITH_BF_GLEW_ES', '', False)),
|
||||
(BoolVariable('WITH_BF_GL_EGL', '', False)),
|
||||
(BoolVariable('WITH_BF_GL_PROFILE_COMPAT', '', True)),
|
||||
@@ -605,7 +603,6 @@ def read_opts(env, cfg, args):
|
||||
('BF_CYCLES_CUDA_ENV', 'preset environement nvcc will execute in', ''),
|
||||
('BF_CYCLES_CUDA_BINARIES_ARCH', 'CUDA architectures to compile binaries for', []),
|
||||
(BoolVariable('WITH_BF_CYCLES_DEBUG', 'Build Cycles engine with extra debugging capabilities', False)),
|
||||
(BoolVariable('WITH_BF_CYCLES_LOGGING', 'Build Cycles engine with logging support', True)),
|
||||
|
||||
(BoolVariable('WITH_BF_OIIO', 'Build with OpenImageIO', False)),
|
||||
(BoolVariable('WITH_BF_STATICOIIO', 'Statically link to OpenImageIO', False)),
|
||||
|
@@ -13,10 +13,8 @@ blender_subversion=$(grep "BLENDER_SUBVERSION\s" "$blender_srcdir/source/blender
|
||||
|
||||
if [ "$blender_version_cycle" = "release" ] ; then
|
||||
VERSION=$(expr $blender_version / 100).$(expr $blender_version % 100)$blender_version_char
|
||||
SUBMODULE_EXCLUDE="^\(release/scripts/addons_contrib\)$"
|
||||
else
|
||||
VERSION=$(expr $blender_version / 100).$(expr $blender_version % 100)_$blender_subversion
|
||||
SUBMODULE_EXCLUDE="^$" # dummy regex
|
||||
fi
|
||||
|
||||
MANIFEST="blender-$VERSION-manifest.txt"
|
||||
@@ -32,7 +30,7 @@ echo -n "Building manifest of files: \"$BASE_DIR/$MANIFEST\" ..."
|
||||
git ls-files | python3 -c "$FILTER_FILES_PY" > $BASE_DIR/$MANIFEST
|
||||
|
||||
# Enumerate submodules
|
||||
for lcv in $(git submodule | awk '{print $2}' | grep -v "$SUBMODULE_EXCLUDE"); do
|
||||
for lcv in $(git submodule | awk '{print $2}'); do
|
||||
cd "$BASE_DIR"
|
||||
cd "$blender_srcdir/$lcv"
|
||||
git ls-files | python3 -c "$FILTER_FILES_PY" | awk '$0="'"$lcv"/'"$0' >> $BASE_DIR/$MANIFEST
|
||||
|
@@ -112,7 +112,7 @@ class DNACatalogHTML:
|
||||
# ${version} and ${revision}
|
||||
if bpy:
|
||||
version = '.'.join(map(str, bpy.app.version))
|
||||
revision = bpy.app.build_hash
|
||||
revision = bpy.app.build_revision[:-1]
|
||||
else:
|
||||
version = str(header.Version)
|
||||
revision = 'Unknown'
|
||||
@@ -404,7 +404,7 @@ def main():
|
||||
# Files
|
||||
if '--dna-versioned' in sys.argv:
|
||||
blender_version = '_'.join(map(str, bpy.app.version))
|
||||
filename = 'dna-{0}-{1}_endian-{2}-{3}'.format(sys.arch, sys.byteorder, blender_version, bpy.app.build_hash)
|
||||
filename = 'dna-{0}-{1}_endian-{2}-r{3}'.format(sys.arch, sys.byteorder, blender_version, bpy.app.build_revision[2:-1])
|
||||
else:
|
||||
filename = 'dna'
|
||||
dir = os.path.dirname(__file__)
|
||||
@@ -451,7 +451,7 @@ def main():
|
||||
os.remove(Path_Blend)
|
||||
|
||||
# export dna to xhtml
|
||||
log.info("6: export sdna to xhtml file: %r" % Path_HTML)
|
||||
log.info("6: export sdna to xhtml file")
|
||||
handleHTML = open(Path_HTML, "w")
|
||||
catalog.WriteToHTML(handleHTML)
|
||||
handleHTML.close()
|
||||
|
@@ -563,26 +563,20 @@ Bringing it all together
|
||||
|
||||
# handle the keymap
|
||||
wm = bpy.context.window_manager
|
||||
# Note that in background mode (no GUI available), keyconfigs are not available either, so we have to check this
|
||||
# to avoid nasty errors in background case.
|
||||
kc = wm.keyconfigs.addon
|
||||
if kc:
|
||||
km = wm.keyconfigs.addon.keymaps.new(name='Object Mode', space_type='EMPTY')
|
||||
kmi = km.keymap_items.new(ObjectCursorArray.bl_idname, 'SPACE', 'PRESS', ctrl=True, shift=True)
|
||||
kmi.properties.total = 4
|
||||
addon_keymaps.append((km, kmi))
|
||||
km = wm.keyconfigs.addon.keymaps.new(name='Object Mode', space_type='EMPTY')
|
||||
kmi = km.keymap_items.new(ObjectCursorArray.bl_idname, 'SPACE', 'PRESS', ctrl=True, shift=True)
|
||||
kmi.properties.total = 4
|
||||
addon_keymaps.append((km, kmi))
|
||||
|
||||
def unregister():
|
||||
# Note: when unregistering, it's usually good practice to do it in reverse order you registered.
|
||||
# Can avoid strange issues like keymap still referring to operators already unregistered...
|
||||
bpy.utils.unregister_class(ObjectCursorArray)
|
||||
bpy.types.VIEW3D_MT_object.remove(menu_func)
|
||||
|
||||
# handle the keymap
|
||||
for km, kmi in addon_keymaps:
|
||||
km.keymap_items.remove(kmi)
|
||||
addon_keymaps.clear()
|
||||
|
||||
bpy.utils.unregister_class(ObjectCursorArray)
|
||||
bpy.types.VIEW3D_MT_object.remove(menu_func)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
register()
|
||||
|
@@ -3,10 +3,6 @@
|
||||
# bash doc/python_api/sphinx_doc_gen.sh
|
||||
# ssh upload means you need an account on the server
|
||||
|
||||
if [ "$1" == "" ] ; then
|
||||
echo "Expected a single argument for the username on blender.org, aborting"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
# Upload vars
|
||||
@@ -20,9 +16,9 @@ DO_OUT_PDF=false
|
||||
|
||||
|
||||
BLENDER="./blender.bin"
|
||||
SSH_USER=$1
|
||||
SSH_USER="ideasman42"
|
||||
SSH_HOST=$SSH_USER"@blender.org"
|
||||
SSH_UPLOAD="/data/www/vhosts/www.blender.org/api" # blender_python_api_VERSION, added after
|
||||
SSH_UPLOAD="/data/www/vhosts/www.blender.org/documentation" # blender_python_api_VERSION, added after
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
# Blender Version & Info
|
||||
|
4
extern/CMakeLists.txt
vendored
4
extern/CMakeLists.txt
vendored
@@ -90,7 +90,3 @@ endif()
|
||||
if(WITH_GTESTS)
|
||||
add_subdirectory(gtest)
|
||||
endif()
|
||||
|
||||
if(WITH_SDL AND WITH_SDL_DYNLOAD)
|
||||
add_subdirectory(sdlew)
|
||||
endif()
|
||||
|
3
extern/SConscript
vendored
3
extern/SConscript
vendored
@@ -50,6 +50,3 @@ if env['WITH_GHOST_XDND']:
|
||||
# FreeBSD doesn't seems to support XDND protocol
|
||||
if env['OURPLATFORM'] in ('linux', 'openbsd3', 'sunos5', 'aix4', 'aix5'):
|
||||
SConscript(['xdnd/SConscript'])
|
||||
|
||||
if env['WITH_BF_SDL'] and env['WITH_BF_SDL_DYNLOAD']:
|
||||
SConscript(['sdlew/SConscript'])
|
||||
|
1
extern/carve/CMakeLists.txt
vendored
1
extern/carve/CMakeLists.txt
vendored
@@ -161,7 +161,6 @@ if(WITH_BOOST)
|
||||
|
||||
add_definitions(
|
||||
-DCARVE_SYSTEM_BOOST
|
||||
-DHAVE_BOOST_LIBRARY
|
||||
)
|
||||
|
||||
list(APPEND INC_SYS
|
||||
|
1
extern/carve/SConscript
vendored
1
extern/carve/SConscript
vendored
@@ -19,7 +19,6 @@ if env['WITH_BF_BOOST']:
|
||||
defs.append('HAVE_BOOST_UNORDERED_COLLECTIONS')
|
||||
|
||||
defs.append('CARVE_SYSTEM_BOOST')
|
||||
defs.append('HAVE_BOOST_LIBRARY')
|
||||
incs.append(env['BF_BOOST_INC'])
|
||||
|
||||
env.BlenderLib ('extern_carve', Split(sources), incs, defs, libtype=['extern'], priority=[40] )
|
||||
|
4
extern/carve/bundle.sh
vendored
4
extern/carve/bundle.sh
vendored
@@ -31,8 +31,6 @@ headers=`find ./lib -type f -iname '*.h' -or -iname '*.hpp' | sed -r 's/^\.\//\t
|
||||
includes=`find ./include -type f -iname '*.h' -or -iname '*.hpp' | sed -r 's/^\.\//\t/' | sort -d`
|
||||
|
||||
cp patches/files/config.h include/carve/config.h
|
||||
mkdir -p include/carve/random
|
||||
cp patches/files/random.h include/carve/random/random.h
|
||||
|
||||
cat > CMakeLists.txt << EOF
|
||||
# ***** BEGIN GPL LICENSE BLOCK *****
|
||||
@@ -93,7 +91,6 @@ if(WITH_BOOST)
|
||||
|
||||
add_definitions(
|
||||
-DCARVE_SYSTEM_BOOST
|
||||
-DHAVE_BOOST_LIBRARY
|
||||
)
|
||||
|
||||
list(APPEND INC_SYS
|
||||
@@ -126,7 +123,6 @@ if env['WITH_BF_BOOST']:
|
||||
defs.append('HAVE_BOOST_UNORDERED_COLLECTIONS')
|
||||
|
||||
defs.append('CARVE_SYSTEM_BOOST')
|
||||
defs.append('HAVE_BOOST_LIBRARY')
|
||||
incs.append(env['BF_BOOST_INC'])
|
||||
|
||||
env.BlenderLib ('extern_carve', Split(sources), incs, defs, libtype=['extern'], priority=[40] )
|
||||
|
61
extern/carve/include/carve/random/random.h
vendored
61
extern/carve/include/carve/random/random.h
vendored
@@ -1,61 +0,0 @@
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
#include <vector>
|
||||
|
||||
namespace boost {
|
||||
#if __cplusplus > 199711L
|
||||
# include <random>
|
||||
typedef std::mt19937 mt19937;
|
||||
#else
|
||||
# include <stdlib.h>
|
||||
struct mt19937 {
|
||||
int operator()() {
|
||||
return rand();
|
||||
}
|
||||
|
||||
int max() {
|
||||
return RAND_MAX;
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
||||
template<typename T>
|
||||
struct uniform_on_sphere {
|
||||
typedef std::vector<T> result_type;
|
||||
|
||||
uniform_on_sphere(int dimension) {
|
||||
assert(dimension == 3);
|
||||
}
|
||||
|
||||
std::vector<T>
|
||||
operator()(float u1, float u2) {
|
||||
T z = 1.0 - 2.0*u1;
|
||||
T r = std::sqrt(std::max(0.0, 1.0 - z*z));
|
||||
T phi = 2.0*M_PI*u2;
|
||||
T x = r*std::cos(phi);
|
||||
T y = r*std::sin(phi);
|
||||
std::vector<T> result;
|
||||
result.push_back(x);
|
||||
result.push_back(y);
|
||||
result.push_back(z);
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
template<typename RNG, typename DISTR>
|
||||
struct variate_generator {
|
||||
|
||||
variate_generator(RNG rng, DISTR distr)
|
||||
: rng_(rng), distr_(distr) {}
|
||||
|
||||
typename DISTR::result_type
|
||||
operator()() {
|
||||
float rng_max_inv = 1.0 / rng_.max();
|
||||
return distr_(rng_() * rng_max_inv, rng_() * rng_max_inv);
|
||||
}
|
||||
|
||||
RNG rng_;
|
||||
DISTR distr_;
|
||||
};
|
||||
|
||||
}
|
6
extern/carve/lib/polyhedron.cpp
vendored
6
extern/carve/lib/polyhedron.cpp
vendored
@@ -36,11 +36,7 @@
|
||||
|
||||
#include <carve/mesh.hpp>
|
||||
|
||||
#ifdef HAVE_BOOST_LIBRARY
|
||||
# include BOOST_INCLUDE(random.hpp)
|
||||
#else
|
||||
# include <carve/random/random.h>
|
||||
#endif
|
||||
#include BOOST_INCLUDE(random.hpp)
|
||||
|
||||
namespace {
|
||||
bool emb_test(carve::poly::Polyhedron *poly,
|
||||
|
61
extern/carve/patches/files/random.h
vendored
61
extern/carve/patches/files/random.h
vendored
@@ -1,61 +0,0 @@
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
#include <vector>
|
||||
|
||||
namespace boost {
|
||||
#if __cplusplus > 199711L
|
||||
# include <random>
|
||||
typedef std::mt19937 mt19937;
|
||||
#else
|
||||
# include <stdlib.h>
|
||||
struct mt19937 {
|
||||
int operator()() {
|
||||
return rand();
|
||||
}
|
||||
|
||||
int max() {
|
||||
return RAND_MAX;
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
||||
template<typename T>
|
||||
struct uniform_on_sphere {
|
||||
typedef std::vector<T> result_type;
|
||||
|
||||
uniform_on_sphere(int dimension) {
|
||||
assert(dimension == 3);
|
||||
}
|
||||
|
||||
std::vector<T>
|
||||
operator()(float u1, float u2) {
|
||||
T z = 1.0 - 2.0*u1;
|
||||
T r = std::sqrt(std::max(0.0, 1.0 - z*z));
|
||||
T phi = 2.0*M_PI*u2;
|
||||
T x = r*std::cos(phi);
|
||||
T y = r*std::sin(phi);
|
||||
std::vector<T> result;
|
||||
result.push_back(x);
|
||||
result.push_back(y);
|
||||
result.push_back(z);
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
template<typename RNG, typename DISTR>
|
||||
struct variate_generator {
|
||||
|
||||
variate_generator(RNG rng, DISTR distr)
|
||||
: rng_(rng), distr_(distr) {}
|
||||
|
||||
typename DISTR::result_type
|
||||
operator()() {
|
||||
float rng_max_inv = 1.0 / rng_.max();
|
||||
return distr_(rng_() * rng_max_inv, rng_() * rng_max_inv);
|
||||
}
|
||||
|
||||
RNG rng_;
|
||||
DISTR distr_;
|
||||
};
|
||||
|
||||
}
|
16
extern/carve/patches/random.patch
vendored
16
extern/carve/patches/random.patch
vendored
@@ -1,16 +0,0 @@
|
||||
diff -r 9a85d733a43d lib/polyhedron.cpp
|
||||
--- a/lib/polyhedron.cpp Tue Jun 24 11:15:23 2014 +1000
|
||||
+++ b/lib/polyhedron.cpp Thu Nov 13 17:36:06 2014 +0500
|
||||
@@ -36,7 +36,11 @@
|
||||
|
||||
#include <carve/mesh.hpp>
|
||||
|
||||
-#include BOOST_INCLUDE(random.hpp)
|
||||
+#ifdef HAVE_BOOST_LIBRARY
|
||||
+# include BOOST_INCLUDE(random.hpp)
|
||||
+#else
|
||||
+# include <carve/random/random.h>
|
||||
+#endif
|
||||
|
||||
namespace {
|
||||
bool emb_test(carve::poly::Polyhedron *poly,
|
1
extern/carve/patches/series
vendored
1
extern/carve/patches/series
vendored
@@ -11,4 +11,3 @@ mesh_simplify_uninitialized_var.patch
|
||||
memory_leak_fix.patch
|
||||
msvc_fix.patch
|
||||
face_hole_merge_workaround.patch
|
||||
random.patch
|
||||
|
11
extern/clew/include/clew.h
vendored
11
extern/clew/include/clew.h
vendored
@@ -350,7 +350,7 @@ typedef unsigned int cl_GLenum;
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#if defined(_M_IX86)
|
||||
#if _M_IX86_FP >= 0 && !defined(__SSE__)
|
||||
#if _M_IX86_FP >= 0
|
||||
#define __SSE__
|
||||
#endif
|
||||
#if _M_IX86_FP >= 1
|
||||
@@ -1815,11 +1815,6 @@ typedef struct _cl_buffer_region {
|
||||
|
||||
/* Function signature typedef's */
|
||||
|
||||
#ifdef __APPLE__
|
||||
# pragma GCC diagnostic push
|
||||
# pragma GCC diagnostic ignored "-Wignored-attributes"
|
||||
#endif
|
||||
|
||||
/* Platform API */
|
||||
typedef CL_API_ENTRY cl_int (CL_API_CALL *
|
||||
PFNCLGETPLATFORMIDS)(cl_uint /* num_entries */,
|
||||
@@ -2481,10 +2476,6 @@ PFNCLCREATEFROMGLTEXTURE3D)(cl_context /* context */,
|
||||
cl_int * /* errcode_ret */) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
# pragma GCC diagnostic pop // ignored "-Wignored-attributes"
|
||||
#endif
|
||||
|
||||
/* cl_khr_gl_sharing extension */
|
||||
|
||||
#define cl_khr_gl_sharing 1
|
||||
|
18
extern/glew-es/include/GL/eglew.h
vendored
18
extern/glew-es/include/GL/eglew.h
vendored
@@ -594,9 +594,9 @@ typedef EGLBoolean (EGLAPIENTRY * PFNWAITSYNC ) (EGLDisplay dp
|
||||
#if !defined(EGL_ANDROID_blob_cache)
|
||||
#define EGL_ANDROID_blob_cache 1
|
||||
|
||||
typedef khronos_ssize_t EGLsizeiANDROID; // NOTE jwilkins: missing typedef
|
||||
typedef EGLsizeiANDROID (*EGLGetBlobFuncANDROID) (const void* key, EGLsizeiANDROID keySize, void* value, EGLsizeiANDROID valueSize); // NOTE jwilkins: missing typedef
|
||||
typedef void (*EGLSetBlobFuncANDROID) (const void* key, EGLsizeiANDROID keySize, const void* value, EGLsizeiANDROID valueSize); // NOTE jwilkins: missing typedef
|
||||
typedef khronos_ssize_t EGLsizeiANDROID; // XXX jwilkins: missing typedef
|
||||
typedef EGLsizeiANDROID (*EGLGetBlobFuncANDROID) (const void* key, EGLsizeiANDROID keySize, void* value, EGLsizeiANDROID valueSize); // XXX jwilkins: missing typedef
|
||||
typedef void (*EGLSetBlobFuncANDROID) (const void* key, EGLsizeiANDROID keySize, const void* value, EGLsizeiANDROID valueSize); // XXX jwilkins: missing typedef
|
||||
|
||||
typedef void (EGLAPIENTRY * PFNEGLSETBLOBCACHEFUNCSANDROIDPROC) (EGLDisplay dpy, EGLSetBlobFuncANDROID set, EGLGetBlobFuncANDROID get);
|
||||
|
||||
@@ -633,7 +633,7 @@ typedef void (EGLAPIENTRY * PFNEGLSETBLOBCACHEFUNCSANDROIDPROC) (EGLDisplay dpy,
|
||||
#if !defined(EGL_ANDROID_native_fence_sync)
|
||||
#define EGL_ANDROID_native_fence_sync 1
|
||||
|
||||
typedef void* EGLSyncKHR; // NOTE jwilkins: missing typedef
|
||||
typedef void* EGLSyncKHR; // XXX jwilkins: missing typedef
|
||||
|
||||
#define EGL_SYNC_NATIVE_FENCE_ANDROID 0x3144
|
||||
#define EGL_SYNC_NATIVE_FENCE_FD_ANDROID 0x3145
|
||||
@@ -1013,7 +1013,7 @@ typedef EGLBoolean (EGLAPIENTRY * PFNEGLSIGNALSYNCKHRPROC) (EGLDisplay dpy, EGLS
|
||||
|
||||
#define EGL_CONSUMER_ACQUIRE_TIMEOUT_USEC_KHR 0x321E
|
||||
|
||||
typedef void* EGLStreamKHR; // NOTE jwilkins: missing typedef
|
||||
typedef void* EGLStreamKHR; // XXX jwilkins: missing typedef
|
||||
|
||||
typedef EGLBoolean (EGLAPIENTRY * PFNEGLSTREAMCONSUMERACQUIREKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream);
|
||||
typedef EGLBoolean (EGLAPIENTRY * PFNEGLSTREAMCONSUMERGLTEXTUREEXTERNALKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream);
|
||||
@@ -1032,7 +1032,7 @@ typedef EGLBoolean (EGLAPIENTRY * PFNEGLSTREAMCONSUMERRELEASEKHRPROC) (EGLDispla
|
||||
#if !defined(EGL_KHR_stream_cross_process_fd)
|
||||
#define EGL_KHR_stream_cross_process_fd 1
|
||||
|
||||
typedef int EGLNativeFileDescriptorKHR; // NOTE jwilkins: missing typedef
|
||||
typedef int EGLNativeFileDescriptorKHR; // XXX jwilkins: missing typedef
|
||||
|
||||
typedef EGLStreamKHR (EGLAPIENTRY * PFNEGLCREATESTREAMFROMFILEDESCRIPTORKHRPROC) (EGLDisplay dpy, EGLNativeFileDescriptorKHR file_descriptor);
|
||||
typedef EGLNativeFileDescriptorKHR (EGLAPIENTRY * PFNEGLGETSTREAMFILEDESCRIPTORKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream);
|
||||
@@ -1107,7 +1107,7 @@ typedef EGLSurface (EGLAPIENTRY * PFNEGLCREATESTREAMPRODUCERSURFACEKHRPROC) (EGL
|
||||
#if !defined(EGL_KHR_wait_sync)
|
||||
#define EGL_KHR_wait_sync 1
|
||||
|
||||
typedef void* EGLSyncKHR; // NOTE jwilkins: missing typedef
|
||||
typedef void* EGLSyncKHR; // XXX jwilkins: missing typedef
|
||||
|
||||
typedef EGLint (EGLAPIENTRY * PFNEGLWAITSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint flags);
|
||||
|
||||
@@ -1452,8 +1452,8 @@ extern GLboolean eglewContextIsSupported (const EGLEWContext* ctx, const char* n
|
||||
#define EGLEW_GET_VAR(x) (*(const GLboolean*)&x)
|
||||
#define EGLEW_GET_FUN(x) x
|
||||
|
||||
extern GLenum eglewContextInit(EGLDisplay display); // NOTE jwilkins: context handling not really written yet?
|
||||
#define eglewInit eglewContextInit // NOTE jwilkins: context handling not really written yet?
|
||||
extern GLenum eglewContextInit(EGLDisplay display); // XXX jwilkins: context handling not really written yet?
|
||||
#define eglewInit eglewContextInit // XXX jwilkins: context handling not really written yet?
|
||||
|
||||
extern GLboolean eglewIsSupported (const char* name);
|
||||
|
||||
|
150
extern/glew-es/include/GL/glesew.h
vendored
150
extern/glew-es/include/GL/glesew.h
vendored
@@ -64,22 +64,22 @@
|
||||
#error glesew.h included instead of glew.h
|
||||
#endif
|
||||
|
||||
// NOTE jwilkins: changing versions from 'ifdef' to 'if' requires setting defaults
|
||||
// XXX jwilkins: changing versions from 'ifdef' to 'if' requires setting defaults
|
||||
#ifndef GL_ES_VERSION_1_0 // XXX
|
||||
#define GL_ES_VERSION_1_0 1 // XXX
|
||||
#endif // XXX
|
||||
|
||||
// NOTE jwilkins: changing versions from 'ifdef' to 'if' requires setting defaults
|
||||
// XXX jwilkins: changing versions from 'ifdef' to 'if' requires setting defaults
|
||||
#ifndef GL_ES_VERSION_CL_1_1 // XXX
|
||||
#define GL_ES_VERSION_CL_1_1 1 // XXX
|
||||
#endif // XXX
|
||||
|
||||
// NOTE jwilkins: changing versions from 'ifdef' to 'if' requires setting defaults
|
||||
// XXX jwilkins: changing versions from 'ifdef' to 'if' requires setting defaults
|
||||
#ifndef GL_ES_VERSION_CM_1_1 // XXX
|
||||
#define GL_ES_VERSION_CM_1_1 1 // XXX
|
||||
#endif // XXX
|
||||
|
||||
// NOTE jwilkins: changing versions from 'ifdef' to 'if' requires setting defaults
|
||||
// XXX jwilkins: changing versions from 'ifdef' to 'if' requires setting defaults
|
||||
#ifndef GL_ES_VERSION_2_0 // XXX
|
||||
#define GL_ES_VERSION_2_0 1 // XXX
|
||||
#endif // XXX
|
||||
@@ -108,7 +108,7 @@ typedef int GLclampx;
|
||||
/* Internal convenience typedefs */
|
||||
typedef void (*_GLfuncptr)();
|
||||
|
||||
// NOTE jwilkins: had to add these
|
||||
// XXX jwilkins: had to add these
|
||||
#if defined(_MSC_VER) && _MSC_VER < 1400
|
||||
typedef __int64 GLint64EXT;
|
||||
typedef unsigned __int64 GLuint64EXT;
|
||||
@@ -528,7 +528,7 @@ typedef struct __GLsync *GLsync;
|
||||
|
||||
/*************************************************************/
|
||||
|
||||
#if !GL_ES_VERSION_2_0 // NOTE jwilkins: not in all versions of ES
|
||||
#if !GL_ES_VERSION_2_0 // XXX jwilkins: not in all versions of ES
|
||||
GLAPI void GLAPIENTRY glAlphaFunc (GLenum func, GLclampf ref);
|
||||
#endif // XXX
|
||||
GLAPI void GLAPIENTRY glBindTexture (GLenum target, GLuint texture);
|
||||
@@ -536,11 +536,11 @@ GLAPI void GLAPIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor);
|
||||
GLAPI void GLAPIENTRY glClear (GLbitfield mask);
|
||||
GLAPI void GLAPIENTRY glClearColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
|
||||
GLAPI void GLAPIENTRY glClearStencil (GLint s);
|
||||
#if !GL_ES_VERSION_2_0 // NOTE jwilkins: not in all versions of ES
|
||||
#if !GL_ES_VERSION_2_0 // XXX jwilkins: not in all versions of ES
|
||||
GLAPI void GLAPIENTRY glColor4f (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
|
||||
#endif
|
||||
GLAPI void GLAPIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
|
||||
#if !GL_ES_VERSION_2_0 // NOTE jwilkins: not in all versions of ES
|
||||
#if !GL_ES_VERSION_2_0 // XXX jwilkins: not in all versions of ES
|
||||
GLAPI void GLAPIENTRY glColorPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
|
||||
#endif
|
||||
GLAPI void GLAPIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
|
||||
@@ -550,18 +550,18 @@ GLAPI void GLAPIENTRY glDeleteTextures (GLsizei n, const GLuint *textures);
|
||||
GLAPI void GLAPIENTRY glDepthFunc (GLenum func);
|
||||
GLAPI void GLAPIENTRY glDepthMask (GLboolean flag);
|
||||
GLAPI void GLAPIENTRY glDisable (GLenum cap);
|
||||
#if !GL_ES_VERSION_2_0 // NOTE jwilkins: not in all versions of ES
|
||||
#if !GL_ES_VERSION_2_0 // XXX jwilkins: not in all versions of ES
|
||||
GLAPI void GLAPIENTRY glDisableClientState (GLenum array);
|
||||
#endif
|
||||
GLAPI void GLAPIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count);
|
||||
GLAPI void GLAPIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices);
|
||||
GLAPI void GLAPIENTRY glEnable (GLenum cap);
|
||||
#if !GL_ES_VERSION_2_0 // NOTE jwilkins: not in all versions of ES
|
||||
#if !GL_ES_VERSION_2_0 // XXX jwilkins: not in all versions of ES
|
||||
GLAPI void GLAPIENTRY glEnableClientState (GLenum array);
|
||||
#endif
|
||||
GLAPI void GLAPIENTRY glFinish (void);
|
||||
GLAPI void GLAPIENTRY glFlush (void);
|
||||
#if !GL_ES_VERSION_2_0 // NOTE jwilkins: not in all versions of ES
|
||||
#if !GL_ES_VERSION_2_0 // XXX jwilkins: not in all versions of ES
|
||||
GLAPI void GLAPIENTRY glFogf (GLenum pname, GLfloat param);
|
||||
GLAPI void GLAPIENTRY glFogfv (GLenum pname, const GLfloat *params);
|
||||
#endif
|
||||
@@ -571,14 +571,14 @@ GLAPI GLenum GLAPIENTRY glGetError (void);
|
||||
GLAPI void GLAPIENTRY glGetIntegerv (GLenum pname, GLint *params);
|
||||
GLAPI const GLubyte * GLAPIENTRY glGetString (GLenum name);
|
||||
GLAPI void GLAPIENTRY glHint (GLenum target, GLenum mode);
|
||||
#if !GL_ES_VERSION_2_0 // NOTE jwilkins: not in all versions of ES
|
||||
#if !GL_ES_VERSION_2_0 // XXX jwilkins: not in all versions of ES
|
||||
GLAPI void GLAPIENTRY glLightModelf (GLenum pname, GLfloat param);
|
||||
GLAPI void GLAPIENTRY glLightModelfv (GLenum pname, const GLfloat *params);
|
||||
GLAPI void GLAPIENTRY glLightf (GLenum light, GLenum pname, GLfloat param);
|
||||
GLAPI void GLAPIENTRY glLightfv (GLenum light, GLenum pname, const GLfloat *params);
|
||||
#endif
|
||||
GLAPI void GLAPIENTRY glLineWidth (GLfloat width);
|
||||
#if !GL_ES_VERSION_2_0 // NOTE jwilkins: not in all versions of ES
|
||||
#if !GL_ES_VERSION_2_0 // XXX jwilkins: not in all versions of ES
|
||||
GLAPI void GLAPIENTRY glLoadIdentity (void);
|
||||
GLAPI void GLAPIENTRY glLoadMatrixf (const GLfloat *m);
|
||||
GLAPI void GLAPIENTRY glLogicOp (GLenum opcode);
|
||||
@@ -591,27 +591,27 @@ GLAPI void GLAPIENTRY glNormal3f (GLfloat nx, GLfloat ny, GLfloat nz);
|
||||
GLAPI void GLAPIENTRY glNormalPointer (GLenum type, GLsizei stride, const GLvoid *pointer);
|
||||
#endif
|
||||
GLAPI void GLAPIENTRY glPixelStorei (GLenum pname, GLint param);
|
||||
#if !GL_ES_VERSION_2_0 // NOTE jwilkins: not in all versions of ES
|
||||
#if !GL_ES_VERSION_2_0 // XXX jwilkins: not in all versions of ES
|
||||
GLAPI void GLAPIENTRY glPointSize (GLfloat size);
|
||||
#endif // XXX
|
||||
GLAPI void GLAPIENTRY glPolygonOffset (GLfloat factor, GLfloat units);
|
||||
#if !GL_ES_VERSION_2_0 // NOTE jwilkins: not in all versions of ES
|
||||
#if !GL_ES_VERSION_2_0 // XXX jwilkins: not in all versions of ES
|
||||
GLAPI void GLAPIENTRY glPopMatrix (void);
|
||||
GLAPI void GLAPIENTRY glPushMatrix (void);
|
||||
#endif
|
||||
GLAPI void GLAPIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels);
|
||||
#if !GL_ES_VERSION_2_0 // NOTE jwilkins: not in all versions of ES
|
||||
#if !GL_ES_VERSION_2_0 // XXX jwilkins: not in all versions of ES
|
||||
GLAPI void GLAPIENTRY glRotatef (GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
|
||||
GLAPI void GLAPIENTRY glScalef (GLfloat x, GLfloat y, GLfloat z);
|
||||
#endif
|
||||
GLAPI void GLAPIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
#if !GL_ES_VERSION_2_0 // NOTE jwilkins: not in all versions of ES
|
||||
#if !GL_ES_VERSION_2_0 // XXX jwilkins: not in all versions of ES
|
||||
GLAPI void GLAPIENTRY glShadeModel (GLenum mode);
|
||||
#endif // XXX
|
||||
GLAPI void GLAPIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask);
|
||||
GLAPI void GLAPIENTRY glStencilMask (GLuint mask);
|
||||
GLAPI void GLAPIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass);
|
||||
#if !GL_ES_VERSION_2_0 // NOTE jwilkins: not in all versions of ES
|
||||
#if !GL_ES_VERSION_2_0 // XXX jwilkins: not in all versions of ES
|
||||
GLAPI void GLAPIENTRY glTexCoordPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
|
||||
GLAPI void GLAPIENTRY glTexEnvf (GLenum target, GLenum pname, GLfloat param);
|
||||
GLAPI void GLAPIENTRY glTexEnvfv (GLenum target, GLenum pname, const GLfloat *params);
|
||||
@@ -619,7 +619,7 @@ GLAPI void GLAPIENTRY glTexEnvfv (GLenum target, GLenum pname, const GLfloat *pa
|
||||
GLAPI void GLAPIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
GLAPI void GLAPIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param);
|
||||
GLAPI void GLAPIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
#if !GL_ES_VERSION_2_0 // NOTE jwilkins: not in all versions of ES
|
||||
#if !GL_ES_VERSION_2_0 // XXX jwilkins: not in all versions of ES
|
||||
GLAPI void GLAPIENTRY glTranslatef (GLfloat x, GLfloat y, GLfloat z);
|
||||
GLAPI void GLAPIENTRY glVertexPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
|
||||
#endif
|
||||
@@ -627,7 +627,7 @@ GLAPI void GLAPIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei heigh
|
||||
|
||||
/* --------------------------- GL_ES_VERSION_1_0 --------------------------- */
|
||||
|
||||
#if GL_ES_VERSION_1_0 // NOTE jwilkins: should be if not ifdef
|
||||
#if GL_ES_VERSION_1_0 // XXX jwilkins: should be if not ifdef
|
||||
#define GL_ES_VERSION_1_0 1
|
||||
|
||||
typedef void (GLAPIENTRY * PFNGLACTIVETEXTUREPROC) (GLenum texture);
|
||||
@@ -711,14 +711,14 @@ typedef void (GLAPIENTRY * PFNGLTRANSLATEXPROC) (GLfixed x, GLfixed y, GLfixed z
|
||||
#define glTranslatex GLEW_GET_FUN(__glewTranslatex)
|
||||
|
||||
#else // XXX
|
||||
#define GL_ES_VERSION_1_0 0 // NOTE jwilkins: define version token
|
||||
#define GL_ES_VERSION_1_0 0 // XXX jwilkins: define version token
|
||||
#endif /* !GL_ES_VERSION_1_0 */
|
||||
|
||||
#define GLEW_ES_VERSION_1_0 GLEW_GET_VAR(__GLEW_ES_VERSION_1_0) // NOTE jwilkins: always needs to be defined
|
||||
#define GLEW_ES_VERSION_1_0 GLEW_GET_VAR(__GLEW_ES_VERSION_1_0) // XXX jwilkins: always needs to be defined
|
||||
|
||||
/* -------------------------- GL_ES_VERSION_CL_1_1 ------------------------- */
|
||||
|
||||
#if GL_ES_VERSION_CL_1_1 // NOTE jwilkins: should be if not ifdef
|
||||
#if GL_ES_VERSION_CL_1_1 // XXX jwilkins: should be if not ifdef
|
||||
#define GL_ES_VERSION_CL_1_1 1
|
||||
|
||||
#define GL_VERSION_ES_CL_1_1 0x1
|
||||
@@ -897,14 +897,14 @@ typedef void (GLAPIENTRY * PFNGLTEXPARAMETERXVPROC) (GLenum, GLenum, const GLfi
|
||||
#define glTexParameterxv GLEW_GET_FUN(__glewTexParameterxv)
|
||||
|
||||
#else // XXX
|
||||
#define GL_ES_VERSION_CL_1_1 0 // NOTE jwilkins: define version token
|
||||
#define GL_ES_VERSION_CL_1_1 0 // XXX jwilkins: define version token
|
||||
#endif /* !GL_ES_VERSION_CL_1_1 */
|
||||
|
||||
#define GLEW_ES_VERSION_CL_1_1 GLEW_GET_VAR(__GLEW_ES_VERSION_CL_1_1) // NOTE jwilkins: always needs to be defined
|
||||
#define GLEW_ES_VERSION_CL_1_1 GLEW_GET_VAR(__GLEW_ES_VERSION_CL_1_1) // XXX jwilkins: always needs to be defined
|
||||
|
||||
/* -------------------------- GL_ES_VERSION_CM_1_1 ------------------------- */
|
||||
|
||||
#if GL_ES_VERSION_CM_1_1 // NOTE jwilkins: should be if not ifdef
|
||||
#if GL_ES_VERSION_CM_1_1 // XXX jwilkins: should be if not ifdef
|
||||
#define GL_ES_VERSION_CM_1_1 1
|
||||
|
||||
#define GL_VERSION_ES_CM_1_1 0x1
|
||||
@@ -933,14 +933,14 @@ typedef void (GLAPIENTRY * PFNGLTEXPARAMETERFVPROC) (GLenum, GLenum , const GLf
|
||||
#define glTexParameterfv GLEW_GET_FUN(__glewTexParameterfv)
|
||||
|
||||
#else // XXX
|
||||
#define GL_ES_VERSION_CM_1_1 0 // NOTE jwilkins: define version token
|
||||
#define GL_ES_VERSION_CM_1_1 0 // XXX jwilkins: define version token
|
||||
#endif /* !GL_ES_VERSION_CM_1_1 */
|
||||
|
||||
#define GLEW_ES_VERSION_CM_1_1 GLEW_GET_VAR(__GLEW_ES_VERSION_CM_1_1) // NOTE jwilkins: always needs to be defined
|
||||
#define GLEW_ES_VERSION_CM_1_1 GLEW_GET_VAR(__GLEW_ES_VERSION_CM_1_1) // XXX jwilkins: always needs to be defined
|
||||
|
||||
/* --------------------------- GL_ES_VERSION_2_0 --------------------------- */
|
||||
|
||||
#if GL_ES_VERSION_2_0 // NOTE jwilkins: should be if not ifdef
|
||||
#if GL_ES_VERSION_2_0 // XXX jwilkins: should be if not ifdef
|
||||
#define GL_ES_VERSION_2_0 1
|
||||
|
||||
#define GL_NONE 0
|
||||
@@ -1084,7 +1084,7 @@ typedef void (GLAPIENTRY * PFNGLTEXPARAMETERFVPROC) (GLenum, GLenum , const GLf
|
||||
#define GL_DYNAMIC_DRAW 0x88E8 // XXX missing enum
|
||||
#define GL_SAMPLE_BUFFERS 0x80A8 // XXX missing enum
|
||||
|
||||
typedef char GLchar; // NOTE jwilkins: this typedef is missing when ES 1.1 is not enabled
|
||||
typedef char GLchar; // XXX jwilkins: this typedef is missing when ES 1.1 is not enabled
|
||||
typedef khronos_intptr_t GLintptr; // XXX
|
||||
typedef khronos_ssize_t GLsizeiptr; // XXX
|
||||
|
||||
@@ -1173,17 +1173,17 @@ typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FPROC) (GLuint indx, GLfloat x, GL
|
||||
typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FVPROC) (GLuint indx, const GLfloat* values);
|
||||
typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBPOINTERPROC) (GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* ptr);
|
||||
|
||||
typedef void (GLAPIENTRY * PFNGLBINDBUFFERPROC) (GLenum , GLuint ); // NOTE jwilkins: missing function
|
||||
typedef void (GLAPIENTRY * PFNGLBUFFERDATAPROC) (GLenum , GLsizeiptr, const GLvoid *, GLenum ); // NOTE jwilkins: missing function
|
||||
typedef void (GLAPIENTRY * PFNGLBUFFERSUBDATAPROC) (GLenum, GLintptr, GLsizeiptr, const GLvoid *); // NOTE jwilkins: missing function
|
||||
typedef void (GLAPIENTRY * PFNGLDELETEBUFFERSPROC) (GLsizei , const GLuint *); // NOTE jwilkins: missing function
|
||||
typedef void (GLAPIENTRY * PFNGLGENBUFFERSPROC) (GLsizei, GLuint *); // NOTE jwilkins: missing function
|
||||
typedef void (GLAPIENTRY * PFNGLTEXPARAMETERIPROC) (GLenum, GLenum, GLint); // NOTE jwilkins: missing function
|
||||
typedef GLboolean (GLAPIENTRY * PFNGLISENABLEDPROC) (GLenum); // NOTE jwilkins: missing function
|
||||
typedef void (GLAPIENTRY * PFNGLGETFLOATVPROC) (GLenum , GLfloat *); // NOTE jwilkins: missing function
|
||||
typedef void (GLAPIENTRY * PFNGLDEPTHRANGEFPROC) (GLclampf zNear, GLclampf zFar); // NOTE jwilkins: missing function
|
||||
typedef void (GLAPIENTRY * PFNGLACTIVETEXTUREPROC) (GLenum texture); // NOTE jwilkins: missing function
|
||||
typedef void (GLAPIENTRY * PFNGLGETBOOLEANVPROC) (GLenum, GLboolean *); // NOTE jwilkins: missing function
|
||||
typedef void (GLAPIENTRY * PFNGLBINDBUFFERPROC) (GLenum , GLuint ); // XXX jwilkins: missing function
|
||||
typedef void (GLAPIENTRY * PFNGLBUFFERDATAPROC) (GLenum , GLsizeiptr, const GLvoid *, GLenum ); // XXX jwilkins: missing function
|
||||
typedef void (GLAPIENTRY * PFNGLBUFFERSUBDATAPROC) (GLenum, GLintptr, GLsizeiptr, const GLvoid *); // XXX jwilkins: missing function
|
||||
typedef void (GLAPIENTRY * PFNGLDELETEBUFFERSPROC) (GLsizei , const GLuint *); // XXX jwilkins: missing function
|
||||
typedef void (GLAPIENTRY * PFNGLGENBUFFERSPROC) (GLsizei, GLuint *); // XXX jwilkins: missing function
|
||||
typedef void (GLAPIENTRY * PFNGLTEXPARAMETERIPROC) (GLenum, GLenum, GLint); // XXX jwilkins: missing function
|
||||
typedef GLboolean (GLAPIENTRY * PFNGLISENABLEDPROC) (GLenum); // XXX jwilkins: missing function
|
||||
typedef void (GLAPIENTRY * PFNGLGETFLOATVPROC) (GLenum , GLfloat *); // XXX jwilkins: missing function
|
||||
typedef void (GLAPIENTRY * PFNGLDEPTHRANGEFPROC) (GLclampf zNear, GLclampf zFar); // XXX jwilkins: missing function
|
||||
typedef void (GLAPIENTRY * PFNGLACTIVETEXTUREPROC) (GLenum texture); // XXX jwilkins: missing function
|
||||
typedef void (GLAPIENTRY * PFNGLGETBOOLEANVPROC) (GLenum, GLboolean *); // XXX jwilkins: missing function
|
||||
|
||||
#define glAttachShader GLEW_GET_FUN(__glewAttachShader)
|
||||
#define glBindAttribLocation GLEW_GET_FUN(__glewBindAttribLocation)
|
||||
@@ -1270,17 +1270,17 @@ typedef void (GLAPIENTRY * PFNGLGETBOOLEANVPROC) (GLenum, GLboolean *); // NOTE
|
||||
#define glVertexAttrib4fv GLEW_GET_FUN(__glewVertexAttrib4fv)
|
||||
#define glVertexAttribPointer GLEW_GET_FUN(__glewVertexAttribPointer)
|
||||
|
||||
#define glBindBuffer GLEW_GET_FUN(__glewBindBuffer) // NOTE jwilkins: missing function
|
||||
#define glBufferData GLEW_GET_FUN(__glewBufferData) // NOTE jwilkins: missing function
|
||||
#define glBufferSubData GLEW_GET_FUN(__glewBufferSubData) // NOTE jwilkins: missing function
|
||||
#define glDeleteBuffers GLEW_GET_FUN(__glewDeleteBuffers) // NOTE jwilkins: missing function
|
||||
#define glGenBuffers GLEW_GET_FUN(__glewGenBuffers) // NOTE jwilkins: missing function
|
||||
#define glTexParameteri GLEW_GET_FUN(__glewTexParameteri) // NOTE jwilkins: missing function
|
||||
#define glIsEnabled GLEW_GET_FUN(__glewIsEnabled) // NOTE jwilkins: missing function
|
||||
#define glGetFloatv GLEW_GET_FUN(__glewGetFloatv) // NOTE jwilkins: missing function
|
||||
#define glDepthRangef GLEW_GET_FUN(__glewDepthRangef) // NOTE jwilkins: missing function
|
||||
#define glActiveTexture GLEW_GET_FUN(__glewActiveTexture) // NOTE jwilkins: missing function
|
||||
#define glGetBooleanv GLEW_GET_FUN(__glewGetBooleanv) // NOTE jwilkins: missing function
|
||||
#define glBindBuffer GLEW_GET_FUN(__glewBindBuffer) // XXX jwilkins: missing function
|
||||
#define glBufferData GLEW_GET_FUN(__glewBufferData) // XXX jwilkins: missing function
|
||||
#define glBufferSubData GLEW_GET_FUN(__glewBufferSubData) // XXX jwilkins: missing function
|
||||
#define glDeleteBuffers GLEW_GET_FUN(__glewDeleteBuffers) // XXX jwilkins: missing function
|
||||
#define glGenBuffers GLEW_GET_FUN(__glewGenBuffers) // XXX jwilkins: missing function
|
||||
#define glTexParameteri GLEW_GET_FUN(__glewTexParameteri) // XXX jwilkins: missing function
|
||||
#define glIsEnabled GLEW_GET_FUN(__glewIsEnabled) // XXX jwilkins: missing function
|
||||
#define glGetFloatv GLEW_GET_FUN(__glewGetFloatv) // XXX jwilkins: missing function
|
||||
#define glDepthRangef GLEW_GET_FUN(__glewDepthRangef) // XXX jwilkins: missing function
|
||||
#define glActiveTexture GLEW_GET_FUN(__glewActiveTexture) // XXX jwilkins: missing function
|
||||
#define glGetBooleanv GLEW_GET_FUN(__glewGetBooleanv) // XXX jwilkins: missing function
|
||||
|
||||
#define GLEW_ES_VERSION_2_0 GLEW_GET_VAR(__GLEW_ES_VERSION_2_0)
|
||||
|
||||
@@ -1459,7 +1459,7 @@ typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBDIVISORANGLEPROC) (GLuint index, GLu
|
||||
#if !defined(GL_ANGLE_texture_usage)
|
||||
#define GL_ANGLE_texture_usage 1
|
||||
|
||||
#define GL_NONE 0 // NOTE jwilkins: had to change this from 0x0000 so it would match other definition of GL_NONE
|
||||
#define GL_NONE 0 // XXX jwilkins: had to change this from 0x0000 so it would match other definition of GL_NONE
|
||||
#define GL_TEXTURE_USAGE_ANGLE 0x93A2
|
||||
#define GL_FRAMEBUFFER_ATTACHMENT_ANGLE 0x93A3
|
||||
|
||||
@@ -1874,7 +1874,7 @@ typedef GLboolean (GLAPIENTRY * PFNGLISQUERYEXTPROC) (GLuint id);
|
||||
#if !defined(GL_EXT_robustness)
|
||||
#define GL_EXT_robustness 1
|
||||
|
||||
#define GL_NO_ERROR 0 // NOTE jwilkins: had to change this from 0x0000 so it would math other definition
|
||||
#define GL_NO_ERROR 0 // XXX jwilkins: had to change this from 0x0000 so it would math other definition
|
||||
#define GL_LOSE_CONTEXT_ON_RESET_EXT 0x8252
|
||||
#define GL_GUILTY_CONTEXT_RESET_EXT 0x8253
|
||||
#define GL_INNOCENT_CONTEXT_RESET_EXT 0x8254
|
||||
@@ -1909,7 +1909,7 @@ typedef void (GLAPIENTRY * PFNGLREADNPIXELSEXTPROC) (GLint x, GLint y, GLsizei w
|
||||
|
||||
#endif /* !GL_EXT_sRGB */
|
||||
|
||||
#if 0 // NOTE jwilkins: there is an inconsistency between the ES and Non-ES versions of this extension??
|
||||
#if 0 // XXX jwilkins: there is an inconsistency between the ES and Non-ES versions of this extension??
|
||||
/* --------------------- GL_EXT_separate_shader_objects -------------------- */
|
||||
|
||||
#if !defined(GL_EXT_separate_shader_objects)
|
||||
@@ -2320,9 +2320,9 @@ typedef void (GLAPIENTRY * PFNGLCLIPPLANEFIMGPROC) (GLenum p, GLfloat eqn[4]);
|
||||
#define GL_DEBUG_SEVERITY_LOW 0x9148
|
||||
#define GL_DEBUG_OUTPUT 0x92E0
|
||||
|
||||
typedef void (APIENTRY *GLDEBUGPROC)(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* message, GLvoid* userParam); // NOTE jwilkins: added this typedef
|
||||
typedef void (APIENTRY *GLDEBUGPROC)(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* message, GLvoid* userParam); // XXX jwilkins: added this typedef
|
||||
|
||||
typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGECALLBACKPROC) (GLDEBUGPROC callback, void* userParam); // NOTE jwilkins: had to fix DEBUGPROC
|
||||
typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGECALLBACKPROC) (GLDEBUGPROC callback, void* userParam); // XXX jwilkins: had to fix DEBUGPROC
|
||||
typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGECONTROLPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint* ids, GLboolean enabled);
|
||||
typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGEINSERTPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const char* buf);
|
||||
typedef GLuint (GLAPIENTRY * PFNGLGETDEBUGMESSAGELOGPROC) (GLuint count, GLsizei bufsize, GLenum* sources, GLenum* types, GLuint* ids, GLenum* severities, GLsizei* lengths, char* messageLog);
|
||||
@@ -3730,7 +3730,7 @@ struct GLEWContextStruct
|
||||
{
|
||||
#endif /* GLEW_MX */
|
||||
|
||||
#if GL_ES_VERSION_1_0 // NOTE jwilkins: glew doesn't actually seem to be designed to let you use the extension macros
|
||||
#if GL_ES_VERSION_1_0 // XXX jwilkins: glew doesn't actually seem to be designed to let you use the extension macros
|
||||
GLEW_FUN_EXPORT PFNGLACTIVETEXTUREPROC __glewActiveTexture;
|
||||
GLEW_FUN_EXPORT PFNGLALPHAFUNCXPROC __glewAlphaFuncx;
|
||||
GLEW_FUN_EXPORT PFNGLCLEARCOLORXPROC __glewClearColorx;
|
||||
@@ -3770,9 +3770,9 @@ GLEW_FUN_EXPORT PFNGLTEXENVXPROC __glewTexEnvx;
|
||||
GLEW_FUN_EXPORT PFNGLTEXENVXVPROC __glewTexEnvxv;
|
||||
GLEW_FUN_EXPORT PFNGLTEXPARAMETERXPROC __glewTexParameterx;
|
||||
GLEW_FUN_EXPORT PFNGLTRANSLATEXPROC __glewTranslatex;
|
||||
#endif // NOTE jwilkins
|
||||
#endif // XXX jwilkins
|
||||
|
||||
#if GL_ES_VERSION_CL_1_1 // NOTE jwilkins
|
||||
#if GL_ES_VERSION_CL_1_1 // XXX jwilkins
|
||||
GLEW_FUN_EXPORT PFNGLBINDBUFFERPROC __glewBindBuffer;
|
||||
GLEW_FUN_EXPORT PFNGLBUFFERDATAPROC __glewBufferData;
|
||||
GLEW_FUN_EXPORT PFNGLBUFFERSUBDATAPROC __glewBufferSubData;
|
||||
@@ -3801,7 +3801,7 @@ GLEW_FUN_EXPORT PFNGLTEXENVIVPROC __glewTexEnviv;
|
||||
GLEW_FUN_EXPORT PFNGLTEXPARAMETERIPROC __glewTexParameteri;
|
||||
GLEW_FUN_EXPORT PFNGLTEXPARAMETERIVPROC __glewTexParameteriv;
|
||||
GLEW_FUN_EXPORT PFNGLTEXPARAMETERXVPROC __glewTexParameterxv;
|
||||
#endif // NOTE jwilkins
|
||||
#endif // XXX jwilkins
|
||||
|
||||
#if GL_ES_VERSION_CM_1_1 // XXX
|
||||
GLEW_FUN_EXPORT PFNGLCLIPPLANEFPROC __glewClipPlanef;
|
||||
@@ -3814,7 +3814,7 @@ GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERFVPROC __glewGetTexParameterfv;
|
||||
GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFPROC __glewPointParameterf;
|
||||
GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFVPROC __glewPointParameterfv;
|
||||
GLEW_FUN_EXPORT PFNGLTEXPARAMETERFVPROC __glewTexParameterfv;
|
||||
#endif // NOTE jwilkins
|
||||
#endif // XXX jwilkins
|
||||
|
||||
GLEW_FUN_EXPORT PFNGLATTACHSHADERPROC __glewAttachShader;
|
||||
GLEW_FUN_EXPORT PFNGLBINDATTRIBLOCATIONPROC __glewBindAttribLocation;
|
||||
@@ -3901,18 +3901,18 @@ GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FPROC __glewVertexAttrib4f;
|
||||
GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FVPROC __glewVertexAttrib4fv;
|
||||
GLEW_FUN_EXPORT PFNGLVERTEXATTRIBPOINTERPROC __glewVertexAttribPointer;
|
||||
|
||||
#if !GL_ES_VERSION_CL_1_1 // NOTE jwilkins
|
||||
GLEW_FUN_EXPORT PFNGLBINDBUFFERPROC __glewBindBuffer; // NOTE jwilkins: missing function
|
||||
GLEW_FUN_EXPORT PFNGLBUFFERDATAPROC __glewBufferData; // NOTE jwilkins: missing function
|
||||
GLEW_FUN_EXPORT PFNGLBUFFERSUBDATAPROC __glewBufferSubData; // NOTE jwilkins: missing function
|
||||
GLEW_FUN_EXPORT PFNGLDELETEBUFFERSPROC __glewDeleteBuffers; // NOTE jwilkins: missing function
|
||||
GLEW_FUN_EXPORT PFNGLGENBUFFERSPROC __glewGenBuffers; // NOTE jwilkins: missing function
|
||||
GLEW_FUN_EXPORT PFNGLTEXPARAMETERIPROC __glewTexParameteri; // NOTE jwilkins: missing function
|
||||
GLEW_FUN_EXPORT PFNGLISENABLEDPROC __glewIsEnabled; // NOTE jwilkins: missing function
|
||||
GLEW_FUN_EXPORT PFNGLGETFLOATVPROC __glewGetFloatv; // NOTE jwilkins: missing function
|
||||
GLEW_FUN_EXPORT PFNGLDEPTHRANGEFPROC __glewDepthRangef; // NOTE jwilkins: missing function
|
||||
GLEW_FUN_EXPORT PFNGLACTIVETEXTUREPROC __glewActiveTexture; // NOTE jwilkins: missing function
|
||||
GLEW_FUN_EXPORT PFNGLGETBOOLEANVPROC __glewGetBooleanv; // NOTE jwilkins: missing function
|
||||
#if !GL_ES_VERSION_CL_1_1 // XXX jwilkins
|
||||
GLEW_FUN_EXPORT PFNGLBINDBUFFERPROC __glewBindBuffer; // XXX jwilkins: missing function
|
||||
GLEW_FUN_EXPORT PFNGLBUFFERDATAPROC __glewBufferData; // XXX jwilkins: missing function
|
||||
GLEW_FUN_EXPORT PFNGLBUFFERSUBDATAPROC __glewBufferSubData; // XXX jwilkins: missing function
|
||||
GLEW_FUN_EXPORT PFNGLDELETEBUFFERSPROC __glewDeleteBuffers; // XXX jwilkins: missing function
|
||||
GLEW_FUN_EXPORT PFNGLGENBUFFERSPROC __glewGenBuffers; // XXX jwilkins: missing function
|
||||
GLEW_FUN_EXPORT PFNGLTEXPARAMETERIPROC __glewTexParameteri; // XXX jwilkins: missing function
|
||||
GLEW_FUN_EXPORT PFNGLISENABLEDPROC __glewIsEnabled; // XXX jwilkins: missing function
|
||||
GLEW_FUN_EXPORT PFNGLGETFLOATVPROC __glewGetFloatv; // XXX jwilkins: missing function
|
||||
GLEW_FUN_EXPORT PFNGLDEPTHRANGEFPROC __glewDepthRangef; // XXX jwilkins: missing function
|
||||
GLEW_FUN_EXPORT PFNGLACTIVETEXTUREPROC __glewActiveTexture; // XXX jwilkins: missing function
|
||||
GLEW_FUN_EXPORT PFNGLGETBOOLEANVPROC __glewGetBooleanv; // XXX jwilkins: missing function
|
||||
#endif // XXX
|
||||
|
||||
GLEW_FUN_EXPORT PFNGLBEGINPERFMONITORAMDPROC __glewBeginPerfMonitorAMD;
|
||||
@@ -3985,7 +3985,7 @@ GLEW_FUN_EXPORT PFNGLGETNUNIFORMFVEXTPROC __glewGetnUniformfvEXT;
|
||||
GLEW_FUN_EXPORT PFNGLGETNUNIFORMIVEXTPROC __glewGetnUniformivEXT;
|
||||
GLEW_FUN_EXPORT PFNGLREADNPIXELSEXTPROC __glewReadnPixelsEXT;
|
||||
|
||||
#if 0 // NOTE jwilkins: there is an inconsistency between the ES and Non-ES versions of this extension??
|
||||
#if 0 // XXX jwilkins: there is an inconsistency between the ES and Non-ES versions of this extension??
|
||||
GLEW_FUN_EXPORT PFNGLACTIVESHADERPROGRAMEXTPROC __glewActiveShaderProgramEXT;
|
||||
GLEW_FUN_EXPORT PFNGLBINDPROGRAMPIPELINEEXTPROC __glewBindProgramPipelineEXT;
|
||||
GLEW_FUN_EXPORT PFNGLCREATESHADERPROGRAMVEXTPROC __glewCreateShaderProgramvEXT;
|
||||
|
14
extern/glew-es/include/GL/glew.h
vendored
14
extern/glew-es/include/GL/glew.h
vendored
@@ -5472,7 +5472,7 @@ typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum
|
||||
|
||||
#endif /* !GL_ARB_seamless_cube_map */
|
||||
|
||||
#if 0 // NOTE jwilkins: there is an inconsistency between the ES and Non-ES versions of this extension??
|
||||
#if 0 // XXX jwilkins: there is an inconsistency between the ES and Non-ES versions of this extension??
|
||||
/* --------------------- GL_ARB_separate_shader_objects -------------------- */
|
||||
|
||||
#if !defined(GL_ARB_separate_shader_objects)
|
||||
@@ -9736,7 +9736,7 @@ typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORPOINTEREXTPROC) (GLint size, GLenu
|
||||
|
||||
#endif /* !GL_EXT_secondary_color */
|
||||
|
||||
#if 0 // NOTE jwilkins: there is an inconsistency between the ES and Non-ES versions of this extension??
|
||||
#if 0 // XXX jwilkins: there is an inconsistency between the ES and Non-ES versions of this extension??
|
||||
/* --------------------- GL_EXT_separate_shader_objects -------------------- */
|
||||
|
||||
#if !defined(GL_EXT_separate_shader_objects)
|
||||
@@ -17948,7 +17948,7 @@ GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERFVPROC __glewSamplerParameterfv;
|
||||
GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERIPROC __glewSamplerParameteri;
|
||||
GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERIVPROC __glewSamplerParameteriv;
|
||||
|
||||
#if 0 // NOTE jwilkins: inconsistencies between ES and Desktop versions
|
||||
#if 0 // XXX jwilkins: inconsistencies between ES and Desktop versions
|
||||
GLEW_FUN_EXPORT PFNGLACTIVESHADERPROGRAMPROC __glewActiveShaderProgram;
|
||||
GLEW_FUN_EXPORT PFNGLBINDPROGRAMPIPELINEPROC __glewBindProgramPipeline;
|
||||
GLEW_FUN_EXPORT PFNGLCREATESHADERPROGRAMVPROC __glewCreateShaderProgramv;
|
||||
@@ -18849,7 +18849,7 @@ GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3USEXTPROC __glewSecondaryColor3usEXT;
|
||||
GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3USVEXTPROC __glewSecondaryColor3usvEXT;
|
||||
GLEW_FUN_EXPORT PFNGLSECONDARYCOLORPOINTEREXTPROC __glewSecondaryColorPointerEXT;
|
||||
|
||||
#if 0 // NOTE jwilkins: inconsistencies...
|
||||
#if 0 // XXX jwilkins: inconsistencies...
|
||||
GLEW_FUN_EXPORT PFNGLACTIVEPROGRAMEXTPROC __glewActiveProgramEXT;
|
||||
GLEW_FUN_EXPORT PFNGLCREATESHADERPROGRAMEXTPROC __glewCreateShaderProgramEXT;
|
||||
GLEW_FUN_EXPORT PFNGLUSESHADERPROGRAMEXTPROC __glewUseShaderProgramEXT;
|
||||
@@ -19008,7 +19008,7 @@ GLEW_FUN_EXPORT PFNGLDEBUGMESSAGEINSERTPROC __glewDebugMessageInsert;
|
||||
GLEW_FUN_EXPORT PFNGLGETDEBUGMESSAGELOGPROC __glewGetDebugMessageLog;
|
||||
GLEW_FUN_EXPORT PFNGLGETOBJECTLABELPROC __glewGetObjectLabel;
|
||||
GLEW_FUN_EXPORT PFNGLGETOBJECTPTRLABELPROC __glewGetObjectPtrLabel;
|
||||
//GLEW_FUN_EXPORT PFNGLGETPOINTERVPROC __glewGetPointerv; // NOTE jwilkins redefinition?
|
||||
//GLEW_FUN_EXPORT PFNGLGETPOINTERVPROC __glewGetPointerv; // XXX jwilkins redefinition?
|
||||
GLEW_FUN_EXPORT PFNGLOBJECTLABELPROC __glewObjectLabel;
|
||||
GLEW_FUN_EXPORT PFNGLOBJECTPTRLABELPROC __glewObjectPtrLabel;
|
||||
GLEW_FUN_EXPORT PFNGLPOPDEBUGGROUPPROC __glewPopDebugGroup;
|
||||
@@ -19950,7 +19950,7 @@ GLEW_VAR_EXPORT GLboolean __GLEW_ARB_robustness_share_group_isolation;
|
||||
GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sample_shading;
|
||||
GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sampler_objects;
|
||||
GLEW_VAR_EXPORT GLboolean __GLEW_ARB_seamless_cube_map;
|
||||
#if 0 // NOTE jwilkins: there is an inconsistency between the ES and Non-ES versions of this extension??
|
||||
#if 0 // XXX jwilkins: there is an inconsistency between the ES and Non-ES versions of this extension??
|
||||
GLEW_VAR_EXPORT GLboolean __GLEW_ARB_separate_shader_objects;
|
||||
#endif
|
||||
GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_atomic_counters;
|
||||
@@ -20093,7 +20093,7 @@ GLEW_VAR_EXPORT GLboolean __GLEW_EXT_provoking_vertex;
|
||||
GLEW_VAR_EXPORT GLboolean __GLEW_EXT_rescale_normal;
|
||||
GLEW_VAR_EXPORT GLboolean __GLEW_EXT_scene_marker;
|
||||
GLEW_VAR_EXPORT GLboolean __GLEW_EXT_secondary_color;
|
||||
#if 0 // NOTE jwilkins: there is an inconsistency between the ES and Non-ES versions of this extension??
|
||||
#if 0 // XXX jwilkins: there is an inconsistency between the ES and Non-ES versions of this extension??
|
||||
GLEW_VAR_EXPORT GLboolean __GLEW_EXT_separate_shader_objects;
|
||||
#endif
|
||||
GLEW_VAR_EXPORT GLboolean __GLEW_EXT_separate_specular_color;
|
||||
|
8
extern/glew-es/include/GL/wglew.h
vendored
8
extern/glew-es/include/GL/wglew.h
vendored
@@ -954,8 +954,8 @@ typedef BOOL (WINAPI * PFNWGLCOPYIMAGESUBDATANVPROC) (HGLRC hSrcRC, GLuint srcNa
|
||||
#if !defined(WGL_NV_gpu_affinity)
|
||||
#define WGL_NV_gpu_affinity 1
|
||||
|
||||
#define ERROR_INCOMPATIBLE_AFFINITY_MASKS_NV 0x20D0 // NOTE jwilkins: incorrect name
|
||||
#define ERROR_MISSING_AFFINITY_MASK_NV 0x20D1 // NOTE jwilkins: incorrect name
|
||||
#define ERROR_INCOMPATIBLE_AFFINITY_MASKS_NV 0x20D0 // XXX jwilkins: incorrect name
|
||||
#define ERROR_MISSING_AFFINITY_MASK_NV 0x20D1 // XXX jwilkins: incorrect name
|
||||
|
||||
DECLARE_HANDLE(HGPUNV);
|
||||
typedef struct _GPU_DEVICE {
|
||||
@@ -1406,8 +1406,8 @@ GLEWAPI GLboolean wglewContextIsSupported (const WGLEWContext* ctx, const char*
|
||||
#define WGLEW_GET_VAR(x) (*(const GLboolean*)&x)
|
||||
#define WGLEW_GET_FUN(x) x
|
||||
|
||||
GLEWAPI GLenum wglewContextInit (void); // NOTE jwilkins: Why does this require GLEW_MX? Should I enable GLEW_MX? instead?
|
||||
#define wglewInit() wglewContextInit() // NOTE jwilkins: Why does this require GLEW_MX? Should I enable GLEW_MX? instead?
|
||||
GLEWAPI GLenum wglewContextInit (void); // XXX jwilkins: Why does this require GLEW_MX? Should I enable GLEW_MX? instead?
|
||||
#define wglewInit() wglewContextInit() // XXX jwilkins: Why does this require GLEW_MX? Should I enable GLEW_MX? instead?
|
||||
|
||||
GLEWAPI GLboolean wglewIsSupported (const char* name);
|
||||
|
||||
|
90
extern/glew-es/src/glew.c
vendored
90
extern/glew-es/src/glew.c
vendored
@@ -97,7 +97,7 @@
|
||||
#ifdef linux
|
||||
|
||||
#include <dlfcn.h>
|
||||
//NOTE jwilkins: to do ?? properly set the lib paths depending on openGL version.
|
||||
//XXX jwilkins: to do ?? properly set the lib paths depending on openGL version.
|
||||
#if defined(GLEW_USE_LIB_ES20)
|
||||
#define GLEW_OPENGLES_LIB_PATH "/usr/lib/libGLESv2.so"
|
||||
#elif defined(GLEW_USE_LIB_ES11)
|
||||
@@ -235,7 +235,7 @@ void* NSGLGetProcAddress (const GLubyte *name)
|
||||
static HMODULE hLibEGL = NULL;
|
||||
static HMODULE hLibGLESv2 = NULL;
|
||||
|
||||
void* weGetProcAddress(const char* name) // NOTE jwilkins
|
||||
void* weGetProcAddress(const char* name) // XXX jwilkins
|
||||
{
|
||||
void* proc = eglGetProcAddress(name);
|
||||
|
||||
@@ -271,7 +271,7 @@ void* NSGLGetProcAddress (const GLubyte *name)
|
||||
#elif defined(_WIN32)
|
||||
static HMODULE hOpenGL = NULL;
|
||||
|
||||
void* wGetProcAddress(const char* name) // NOTE jwilkins
|
||||
void* wGetProcAddress(const char* name) // XXX jwilkins
|
||||
{
|
||||
void* proc = wglGetProcAddress(name);
|
||||
|
||||
@@ -408,7 +408,7 @@ static GLboolean _glewSearchExtension (const char* name, const GLubyte *start, c
|
||||
return GL_FALSE;
|
||||
}
|
||||
#ifndef GLEW_ES_ONLY
|
||||
else { // NOTE jwilkins: unified extension string is deprecated
|
||||
else { // XXX jwilkins: unified extension string is deprecated
|
||||
PFNGLGETSTRINGIPROC pglGetStringi = (PFNGLGETSTRINGIPROC)glewGetProcAddress("glGetStringi");
|
||||
|
||||
if (pglGetStringi != NULL) {
|
||||
@@ -1362,7 +1362,7 @@ PFNGLSAMPLERPARAMETERFVPROC __glewSamplerParameterfv = NULL;
|
||||
PFNGLSAMPLERPARAMETERIPROC __glewSamplerParameteri = NULL;
|
||||
PFNGLSAMPLERPARAMETERIVPROC __glewSamplerParameteriv = NULL;
|
||||
|
||||
#if 0 // NOTE jwilkins: inconsistencies
|
||||
#if 0 // XXX jwilkins: inconsistencies
|
||||
PFNGLACTIVESHADERPROGRAMPROC __glewActiveShaderProgram = NULL;
|
||||
PFNGLBINDPROGRAMPIPELINEPROC __glewBindProgramPipeline = NULL;
|
||||
PFNGLCREATESHADERPROGRAMVPROC __glewCreateShaderProgramv = NULL;
|
||||
@@ -2263,7 +2263,7 @@ PFNGLSECONDARYCOLOR3USEXTPROC __glewSecondaryColor3usEXT = NULL;
|
||||
PFNGLSECONDARYCOLOR3USVEXTPROC __glewSecondaryColor3usvEXT = NULL;
|
||||
PFNGLSECONDARYCOLORPOINTEREXTPROC __glewSecondaryColorPointerEXT = NULL;
|
||||
|
||||
#if 0 // NOTE jwilkins: inconsistencies
|
||||
#if 0 // XXX jwilkins: inconsistencies
|
||||
PFNGLACTIVEPROGRAMEXTPROC __glewActiveProgramEXT = NULL;
|
||||
PFNGLCREATESHADERPROGRAMEXTPROC __glewCreateShaderProgramEXT = NULL;
|
||||
PFNGLUSESHADERPROGRAMEXTPROC __glewUseShaderProgramEXT = NULL;
|
||||
@@ -2422,7 +2422,7 @@ PFNGLDEBUGMESSAGEINSERTPROC __glewDebugMessageInsert = NULL;
|
||||
PFNGLGETDEBUGMESSAGELOGPROC __glewGetDebugMessageLog = NULL;
|
||||
PFNGLGETOBJECTLABELPROC __glewGetObjectLabel = NULL;
|
||||
PFNGLGETOBJECTPTRLABELPROC __glewGetObjectPtrLabel = NULL;
|
||||
//PFNGLGETPOINTERVPROC __glewGetPointerv = NULL; // NOTE jwilkins: not sure if I'm the one who commented this out
|
||||
//PFNGLGETPOINTERVPROC __glewGetPointerv = NULL; // XXX jwilkins: not sure if I'm the one who commented this out
|
||||
PFNGLOBJECTLABELPROC __glewObjectLabel = NULL;
|
||||
PFNGLOBJECTPTRLABELPROC __glewObjectPtrLabel = NULL;
|
||||
PFNGLPOPDEBUGGROUPPROC __glewPopDebugGroup = NULL;
|
||||
@@ -3240,7 +3240,7 @@ PFNGLMULTIDRAWELEMENTSSUNPROC __glewMultiDrawElementsSUN = NULL;
|
||||
|
||||
#else
|
||||
|
||||
#if GL_ES_VERSION_1_0 // NOTE jwilkins: glew doesn't actually seem to be designed to let you use the extension macros
|
||||
#if GL_ES_VERSION_1_0 // XXX jwilkins: glew doesn't actually seem to be designed to let you use the extension macros
|
||||
PFNGLACTIVETEXTUREPROC __glewActiveTexture = NULL;
|
||||
PFNGLALPHAFUNCXPROC __glewAlphaFuncx = NULL;
|
||||
PFNGLCLEARCOLORXPROC __glewClearColorx = NULL;
|
||||
@@ -3280,9 +3280,9 @@ PFNGLTEXENVXPROC __glewTexEnvx = NULL;
|
||||
PFNGLTEXENVXVPROC __glewTexEnvxv = NULL;
|
||||
PFNGLTEXPARAMETERXPROC __glewTexParameterx = NULL;
|
||||
PFNGLTRANSLATEXPROC __glewTranslatex = NULL;
|
||||
#endif // NOTE jwilkins
|
||||
#endif // XXX jwilkins
|
||||
|
||||
#if GL_ES_VERSION_CL_1_1 // NOTE jwilkins
|
||||
#if GL_ES_VERSION_CL_1_1 // XXX jwilkins
|
||||
PFNGLBINDBUFFERPROC __glewBindBuffer = NULL;
|
||||
PFNGLBUFFERDATAPROC __glewBufferData = NULL;
|
||||
PFNGLBUFFERSUBDATAPROC __glewBufferSubData = NULL;
|
||||
@@ -3311,9 +3311,9 @@ PFNGLTEXENVIVPROC __glewTexEnviv = NULL;
|
||||
PFNGLTEXPARAMETERIPROC __glewTexParameteri = NULL;
|
||||
PFNGLTEXPARAMETERIVPROC __glewTexParameteriv = NULL;
|
||||
PFNGLTEXPARAMETERXVPROC __glewTexParameterxv = NULL;
|
||||
#endif // NOTE jwilkins
|
||||
#endif // XXX jwilkins
|
||||
|
||||
#if GL_ES_VERSION_CM_1_1 // NOTE jwilkins
|
||||
#if GL_ES_VERSION_CM_1_1 // XXX jwilkins
|
||||
PFNGLCLIPPLANEFPROC __glewClipPlanef = NULL;
|
||||
PFNGLGETCLIPPLANEFPROC __glewGetClipPlanef = NULL;
|
||||
PFNGLGETFLOATVPROC __glewGetFloatv = NULL;
|
||||
@@ -3411,7 +3411,7 @@ PFNGLVERTEXATTRIB4FPROC __glewVertexAttrib4f = NULL;
|
||||
PFNGLVERTEXATTRIB4FVPROC __glewVertexAttrib4fv = NULL;
|
||||
PFNGLVERTEXATTRIBPOINTERPROC __glewVertexAttribPointer = NULL;
|
||||
|
||||
#if !GL_ES_VERSION_CL_1_1 // NOTE jwilkins: missing function
|
||||
#if !GL_ES_VERSION_CL_1_1 // XXX jwilkins: missing function
|
||||
PFNGLBINDBUFFERPROC __glewBindBuffer = NULL; // XXX
|
||||
PFNGLBUFFERDATAPROC __glewBufferData = NULL; // XXX
|
||||
PFNGLBUFFERSUBDATAPROC __glewBufferSubData = NULL; // XXX
|
||||
@@ -3611,7 +3611,7 @@ PFNGLBLENDEQUATIONEXTPROC __glewBlendEquationEXT = NULL;
|
||||
PFNGLMULTIDRAWARRAYSEXTPROC __glewMultiDrawArraysEXT = NULL;
|
||||
PFNGLMULTIDRAWELEMENTSEXTPROC __glewMultiDrawElementsEXT = NULL;
|
||||
|
||||
#if 0 // NOTE jwilkins: there is an inconsistency between the ES and Non-ES versions of this extension??
|
||||
#if 0 // XXX jwilkins: there is an inconsistency between the ES and Non-ES versions of this extension??
|
||||
PFNGLACTIVESHADERPROGRAMEXTPROC __glewActiveShaderProgramEXT = NULL;
|
||||
PFNGLBINDPROGRAMPIPELINEEXTPROC __glewBindProgramPipelineEXT = NULL;
|
||||
PFNGLCREATESHADERPROGRAMVEXTPROC __glewCreateShaderProgramvEXT = NULL;
|
||||
@@ -3650,7 +3650,7 @@ PFNGLDEBUGMESSAGEINSERTPROC __glewDebugMessageInsert = NULL;
|
||||
PFNGLGETDEBUGMESSAGELOGPROC __glewGetDebugMessageLog = NULL;
|
||||
PFNGLGETOBJECTLABELPROC __glewGetObjectLabel = NULL;
|
||||
PFNGLGETOBJECTPTRLABELPROC __glewGetObjectPtrLabel = NULL;
|
||||
PFNGLGETPOINTERVPROC __glewGetPointerv = NULL; // NOTE jwilkins: multiple defs
|
||||
PFNGLGETPOINTERVPROC __glewGetPointerv = NULL; // XXX jwilkins: multiple defs
|
||||
PFNGLOBJECTLABELPROC __glewObjectLabel = NULL;
|
||||
PFNGLOBJECTPTRLABELPROC __glewObjectPtrLabel = NULL;
|
||||
PFNGLPOPDEBUGGROUPPROC __glewPopDebugGroup = NULL;
|
||||
@@ -3801,7 +3801,7 @@ GLboolean __GLEW_ARB_robustness_share_group_isolation = GL_FALSE;
|
||||
GLboolean __GLEW_ARB_sample_shading = GL_FALSE;
|
||||
GLboolean __GLEW_ARB_sampler_objects = GL_FALSE;
|
||||
GLboolean __GLEW_ARB_seamless_cube_map = GL_FALSE;
|
||||
#if 0 // NOTE jwilkins: there is an inconsistency between the ES and Non-ES versions of this extension??
|
||||
#if 0 // XXX jwilkins: there is an inconsistency between the ES and Non-ES versions of this extension??
|
||||
GLboolean __GLEW_ARB_separate_shader_objects = GL_FALSE;
|
||||
#endif
|
||||
GLboolean __GLEW_ARB_shader_atomic_counters = GL_FALSE;
|
||||
@@ -3944,7 +3944,7 @@ GLboolean __GLEW_EXT_provoking_vertex = GL_FALSE;
|
||||
GLboolean __GLEW_EXT_rescale_normal = GL_FALSE;
|
||||
GLboolean __GLEW_EXT_scene_marker = GL_FALSE;
|
||||
GLboolean __GLEW_EXT_secondary_color = GL_FALSE;
|
||||
#if 0 // NOTE jwilkins: there is an inconsistency between the ES and Non-ES versions of this extension??
|
||||
#if 0 // XXX jwilkins: there is an inconsistency between the ES and Non-ES versions of this extension??
|
||||
GLboolean __GLEW_EXT_separate_shader_objects = GL_FALSE;
|
||||
#endif
|
||||
GLboolean __GLEW_EXT_separate_specular_color = GL_FALSE;
|
||||
@@ -4421,7 +4421,7 @@ GLboolean __GLEW_AMD_performance_monitor = GL_FALSE;
|
||||
GLboolean __GLEW_APPLE_rgb_422 = GL_FALSE;
|
||||
GLboolean __GLEW_EXT_blend_minmax = GL_FALSE;
|
||||
GLboolean __GLEW_EXT_multi_draw_arrays = GL_FALSE;
|
||||
#if 0 // NOTE jwilkins: there is an inconsistency between the ES and Non-ES versions of this extension??
|
||||
#if 0 // XXX jwilkins: there is an inconsistency between the ES and Non-ES versions of this extension??
|
||||
GLboolean __GLEW_EXT_separate_shader_objects = GL_FALSE;
|
||||
#endif // XXX
|
||||
GLboolean __GLEW_EXT_texture_compression_dxt1 = GL_FALSE;
|
||||
@@ -6306,7 +6306,7 @@ static GLboolean _glewInit_GL_ARB_sampler_objects (GLEW_CONTEXT_ARG_DEF_INIT)
|
||||
|
||||
#endif /* GL_ARB_seamless_cube_map */
|
||||
|
||||
#if 0 // NOTE jwilkins: there is an inconsistency between the ES and Non-ES versions of this extension??
|
||||
#if 0 // XXX jwilkins: there is an inconsistency between the ES and Non-ES versions of this extension??
|
||||
#ifdef GL_ARB_separate_shader_objects
|
||||
|
||||
static GLboolean _glewInit_GL_ARB_separate_shader_objects (GLEW_CONTEXT_ARG_DEF_INIT)
|
||||
@@ -8324,16 +8324,16 @@ static GLboolean _glewInit_GL_EXT_secondary_color (GLEW_CONTEXT_ARG_DEF_INIT)
|
||||
|
||||
#endif /* GL_EXT_secondary_color */
|
||||
|
||||
#if 0 // NOTE jwilkins: there is an inconsistency between the ES and Non-ES versions of this extension??
|
||||
#if 0 // XXX jwilkins: there is an inconsistency between the ES and Non-ES versions of this extension??
|
||||
#ifdef GL_EXT_separate_shader_objects
|
||||
|
||||
static GLboolean _glewInit_GL_EXT_separate_shader_objects (GLEW_CONTEXT_ARG_DEF_INIT)
|
||||
{
|
||||
GLboolean r = GL_FALSE;
|
||||
|
||||
r = ((glActiveProgramEXT = (PFNGLACTIVEPROGRAMEXTPROC)glewGetProcAddress((const GLubyte*)"glActiveProgramEXT")) == NULL) || r; // NOTE jwilkins: may be modified
|
||||
r = ((glCreateShaderProgramEXT = (PFNGLCREATESHADERPROGRAMEXTPROC)glewGetProcAddress((const GLubyte*)"glCreateShaderProgramEXT")) == NULL) || r; // NOTE jwilkins: may be modified
|
||||
r = ((glUseShaderProgramEXT = (PFNGLUSESHADERPROGRAMEXTPROC)glewGetProcAddress((const GLubyte*)"glUseShaderProgramEXT")) == NULL) || r; // NOTE jwilkins: may be modified
|
||||
r = ((glActiveProgramEXT = (PFNGLACTIVEPROGRAMEXTPROC)glewGetProcAddress((const GLubyte*)"glActiveProgramEXT")) == NULL) || r; // XXX jwilkins: may be modified
|
||||
r = ((glCreateShaderProgramEXT = (PFNGLCREATESHADERPROGRAMEXTPROC)glewGetProcAddress((const GLubyte*)"glCreateShaderProgramEXT")) == NULL) || r; // XXX jwilkins: may be modified
|
||||
r = ((glUseShaderProgramEXT = (PFNGLUSESHADERPROGRAMEXTPROC)glewGetProcAddress((const GLubyte*)"glUseShaderProgramEXT")) == NULL) || r; // XXX jwilkins: may be modified
|
||||
|
||||
return r;
|
||||
}
|
||||
@@ -10540,7 +10540,7 @@ static GLboolean _glewInit_GL_WIN_swap_hint (GLEW_CONTEXT_ARG_DEF_INIT)
|
||||
|
||||
#endif /* GL_WIN_swap_hint */
|
||||
|
||||
#if GL_ES_VERSION_1_0 // NOTE jwilkins: changed from ifdef
|
||||
#if GL_ES_VERSION_1_0 // XXX jwilkins: changed from ifdef
|
||||
|
||||
static GLboolean _glewInit_GL_ES_VERSION_1_0 (GLEW_CONTEXT_ARG_DEF_INIT)
|
||||
{
|
||||
@@ -10591,7 +10591,7 @@ static GLboolean _glewInit_GL_ES_VERSION_1_0 (GLEW_CONTEXT_ARG_DEF_INIT)
|
||||
|
||||
#endif /* GL_ES_VERSION_1_0 */
|
||||
|
||||
#if GL_ES_VERSION_CL_1_1 // NOTE jwilkins: should be 'if' not 'ifdef'
|
||||
#if GL_ES_VERSION_CL_1_1 // XXX jwilkins: should be 'if' not 'ifdef'
|
||||
|
||||
static GLboolean _glewInit_GL_ES_VERSION_CL_1_1 (GLEW_CONTEXT_ARG_DEF_INIT)
|
||||
{
|
||||
@@ -10631,7 +10631,7 @@ static GLboolean _glewInit_GL_ES_VERSION_CL_1_1 (GLEW_CONTEXT_ARG_DEF_INIT)
|
||||
|
||||
#endif /* GL_ES_VERSION_CL_1_1 */
|
||||
|
||||
#if GL_ES_VERSION_CM_1_1 // NOTE jwilkins: should be 'if' not 'ifdef'
|
||||
#if GL_ES_VERSION_CM_1_1 // XXX jwilkins: should be 'if' not 'ifdef'
|
||||
|
||||
static GLboolean _glewInit_GL_ES_VERSION_CM_1_1 (GLEW_CONTEXT_ARG_DEF_INIT)
|
||||
{
|
||||
@@ -10744,17 +10744,17 @@ static GLboolean _glewInit_GL_ES_VERSION_2_0 (GLEW_CONTEXT_ARG_DEF_INIT)
|
||||
r = ((glVertexAttrib4fv = (PFNGLVERTEXATTRIB4FVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4fv")) == NULL) || r;
|
||||
r = ((glVertexAttribPointer = (PFNGLVERTEXATTRIBPOINTERPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribPointer")) == NULL) || r;
|
||||
|
||||
r = ((glBindBuffer = (PFNGLBINDBUFFERPROC)glewGetProcAddress((const GLubyte*)"glBindBuffer")) == NULL) || r; // NOTE jwilkins: missing function
|
||||
r = ((glBufferData = (PFNGLBUFFERDATAPROC)glewGetProcAddress((const GLubyte*)"glBufferData")) == NULL) || r; // NOTE jwilkins: missing function
|
||||
r = ((glBufferSubData = (PFNGLBUFFERSUBDATAPROC)glewGetProcAddress((const GLubyte*)"glBufferSubData")) == NULL) || r; // NOTE jwilkins: missing function
|
||||
r = ((glDeleteBuffers = (PFNGLDELETEBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glDeleteBuffers")) == NULL) || r; // NOTE jwilkins: missing function
|
||||
r = ((glGenBuffers = (PFNGLGENBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glGenBuffers")) == NULL) || r; // NOTE jwilkins: missing function
|
||||
r = ((glTexParameteri = (PFNGLTEXPARAMETERIPROC)glewGetProcAddress((const GLubyte*)"glTexParameteri")) == NULL) || r; // NOTE jwilkins: missing function
|
||||
r = ((glIsEnabled = (PFNGLISENABLEDPROC)glewGetProcAddress((const GLubyte*)"glIsEnabled")) == NULL) || r; // NOTE jwilkins: missing function
|
||||
r = ((glGetFloatv = (PFNGLGETFLOATVPROC)glewGetProcAddress((const GLubyte*)"glGetFloatv")) == NULL) || r; // NOTE jwilkins: missing function
|
||||
r = ((glDepthRangef = (PFNGLDEPTHRANGEFPROC)glewGetProcAddress((const GLubyte*)"glDepthRangef")) == NULL) || r; // NOTE jwilkins: missing function
|
||||
r = ((glActiveTexture = (PFNGLACTIVETEXTUREPROC)glewGetProcAddress((const GLubyte*)"glActiveTexture")) == NULL) || r; // NOTE jwilkins: missing function
|
||||
r = ((glGetBooleanv = (PFNGLGETBOOLEANVPROC)glewGetProcAddress((const GLubyte*)"glGetBooleanv")) == NULL) || r; // NOTE jwilkins: missing function
|
||||
r = ((glBindBuffer = (PFNGLBINDBUFFERPROC)glewGetProcAddress((const GLubyte*)"glBindBuffer")) == NULL) || r; // XXX jwilkins: missing function
|
||||
r = ((glBufferData = (PFNGLBUFFERDATAPROC)glewGetProcAddress((const GLubyte*)"glBufferData")) == NULL) || r; // XXX jwilkins: missing function
|
||||
r = ((glBufferSubData = (PFNGLBUFFERSUBDATAPROC)glewGetProcAddress((const GLubyte*)"glBufferSubData")) == NULL) || r; // XXX jwilkins: missing function
|
||||
r = ((glDeleteBuffers = (PFNGLDELETEBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glDeleteBuffers")) == NULL) || r; // XXX jwilkins: missing function
|
||||
r = ((glGenBuffers = (PFNGLGENBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glGenBuffers")) == NULL) || r; // XXX jwilkins: missing function
|
||||
r = ((glTexParameteri = (PFNGLTEXPARAMETERIPROC)glewGetProcAddress((const GLubyte*)"glTexParameteri")) == NULL) || r; // XXX jwilkins: missing function
|
||||
r = ((glIsEnabled = (PFNGLISENABLEDPROC)glewGetProcAddress((const GLubyte*)"glIsEnabled")) == NULL) || r; // XXX jwilkins: missing function
|
||||
r = ((glGetFloatv = (PFNGLGETFLOATVPROC)glewGetProcAddress((const GLubyte*)"glGetFloatv")) == NULL) || r; // XXX jwilkins: missing function
|
||||
r = ((glDepthRangef = (PFNGLDEPTHRANGEFPROC)glewGetProcAddress((const GLubyte*)"glDepthRangef")) == NULL) || r; // XXX jwilkins: missing function
|
||||
r = ((glActiveTexture = (PFNGLACTIVETEXTUREPROC)glewGetProcAddress((const GLubyte*)"glActiveTexture")) == NULL) || r; // XXX jwilkins: missing function
|
||||
r = ((glGetBooleanv = (PFNGLGETBOOLEANVPROC)glewGetProcAddress((const GLubyte*)"glGetBooleanv")) == NULL) || r; // XXX jwilkins: missing function
|
||||
|
||||
return r;
|
||||
}
|
||||
@@ -11800,7 +11800,7 @@ GLenum glewContextInit (GLEW_CONTEXT_ARG_DEF_LIST)
|
||||
extEnd = extStart + _glewStrLen(extStart);
|
||||
#ifndef GLEW_ES_ONLY
|
||||
}
|
||||
else { // NOTE jwilkins: unified extension string is deprecated
|
||||
else { // XXX jwilkins: unified extension string is deprecated
|
||||
extStart = 0;
|
||||
extEnd = 0;
|
||||
}
|
||||
@@ -12218,7 +12218,7 @@ GLenum glewContextInit (GLEW_CONTEXT_ARG_DEF_LIST)
|
||||
#ifdef GL_ARB_seamless_cube_map
|
||||
CONST_CAST(GLEW_ARB_seamless_cube_map) = _glewSearchExtension("GL_ARB_seamless_cube_map", extStart, extEnd);
|
||||
#endif /* GL_ARB_seamless_cube_map */
|
||||
#if 0 // NOTE jwilkins: there is an inconsistency between the ES and Non-ES versions of this extension??
|
||||
#if 0 // XXX jwilkins: there is an inconsistency between the ES and Non-ES versions of this extension??
|
||||
#ifdef GL_ARB_separate_shader_objects
|
||||
CONST_CAST(GLEW_ARB_separate_shader_objects) = _glewSearchExtension("GL_ARB_separate_shader_objects", extStart, extEnd);
|
||||
if (glewExperimental || GLEW_ARB_separate_shader_objects) CONST_CAST(GLEW_ARB_separate_shader_objects) = !_glewInit_GL_ARB_separate_shader_objects(GLEW_CONTEXT_ARG_VAR_INIT);
|
||||
@@ -12722,7 +12722,7 @@ GLenum glewContextInit (GLEW_CONTEXT_ARG_DEF_LIST)
|
||||
CONST_CAST(GLEW_EXT_secondary_color) = _glewSearchExtension("GL_EXT_secondary_color", extStart, extEnd);
|
||||
if (glewExperimental || GLEW_EXT_secondary_color) CONST_CAST(GLEW_EXT_secondary_color) = !_glewInit_GL_EXT_secondary_color(GLEW_CONTEXT_ARG_VAR_INIT);
|
||||
#endif /* GL_EXT_secondary_color */
|
||||
#if 0 // NOTE jwilkins: there is an inconsistency between the ES and Non-ES versions of this extension??
|
||||
#if 0 // XXX jwilkins: there is an inconsistency between the ES and Non-ES versions of this extension??
|
||||
#ifdef GL_EXT_separate_shader_objects
|
||||
CONST_CAST(GLEW_EXT_separate_shader_objects) = _glewSearchExtension("GL_EXT_separate_shader_objects", extStart, extEnd);
|
||||
if (glewExperimental || GLEW_EXT_separate_shader_objects) CONST_CAST(GLEW_EXT_separate_shader_objects) = !_glewInit_GL_EXT_separate_shader_objects(GLEW_CONTEXT_ARG_VAR_INIT);
|
||||
@@ -13450,13 +13450,13 @@ GLenum glewContextInit (GLEW_CONTEXT_ARG_DEF_LIST)
|
||||
CONST_CAST(GLEW_WIN_swap_hint) = _glewSearchExtension("GL_WIN_swap_hint", extStart, extEnd);
|
||||
if (glewExperimental || GLEW_WIN_swap_hint) CONST_CAST(GLEW_WIN_swap_hint) = !_glewInit_GL_WIN_swap_hint(GLEW_CONTEXT_ARG_VAR_INIT);
|
||||
#endif /* GL_WIN_swap_hint */
|
||||
#if GL_ES_VERSION_1_0 // NOTE jwilkins: should be 'if' not 'ifdef'
|
||||
#if GL_ES_VERSION_1_0 // XXX jwilkins: should be 'if' not 'ifdef'
|
||||
if (glewExperimental || GLEW_ES_VERSION_1_0) CONST_CAST(GLEW_ES_VERSION_1_0) = !_glewInit_GL_ES_VERSION_1_0(GLEW_CONTEXT_ARG_VAR_INIT);
|
||||
#endif /* GL_ES_VERSION_1_0 */
|
||||
#if GL_ES_VERSION_CL_1_1 // NOTE jwilkins: should be 'if' not 'ifdef'
|
||||
#if GL_ES_VERSION_CL_1_1 // XXX jwilkins: should be 'if' not 'ifdef'
|
||||
if (glewExperimental || GLEW_ES_VERSION_CL_1_1) CONST_CAST(GLEW_ES_VERSION_CL_1_1) = !_glewInit_GL_ES_VERSION_CL_1_1(GLEW_CONTEXT_ARG_VAR_INIT);
|
||||
#endif /* GL_ES_VERSION_CL_1_1 */
|
||||
#if GL_ES_VERSION_CM_1_1 // NOTE jwilkins: should be 'if' not 'ifdef'
|
||||
#if GL_ES_VERSION_CM_1_1 // XXX jwilkins: should be 'if' not 'ifdef'
|
||||
if (glewExperimental || GLEW_ES_VERSION_CM_1_1) CONST_CAST(GLEW_ES_VERSION_CM_1_1) = !_glewInit_GL_ES_VERSION_CM_1_1(GLEW_CONTEXT_ARG_VAR_INIT);
|
||||
#endif /* GL_ES_VERSION_CM_1_1 */
|
||||
#ifdef GL_ES_VERSION_2_0
|
||||
@@ -17639,7 +17639,7 @@ GLboolean glewIsSupported (const char* name)
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
#if 0 // NOTE jwilkins: there is an inconsistency between the ES and Non-ES versions of this extension??
|
||||
#if 0 // XXX jwilkins: there is an inconsistency between the ES and Non-ES versions of this extension??
|
||||
#ifdef GL_ARB_separate_shader_objects
|
||||
if (_glewStrSame3(&pos, &len, (const GLubyte*)"separate_shader_objects", 23))
|
||||
{
|
||||
@@ -18786,7 +18786,7 @@ GLboolean glewIsSupported (const char* name)
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
#if 0 // NOTE jwilkins: there is an inconsistency between the ES and Non-ES versions of this extension??
|
||||
#if 0 // XXX jwilkins: there is an inconsistency between the ES and Non-ES versions of this extension??
|
||||
#ifdef GL_EXT_separate_shader_objects
|
||||
if (_glewStrSame3(&pos, &len, (const GLubyte*)"separate_shader_objects", 23))
|
||||
{
|
||||
|
22
extern/libmv/CMakeLists.txt
vendored
22
extern/libmv/CMakeLists.txt
vendored
@@ -71,20 +71,14 @@ if(WITH_LIBMV)
|
||||
)
|
||||
|
||||
list(APPEND SRC
|
||||
intern/autotrack.cc
|
||||
intern/camera_intrinsics.cc
|
||||
intern/detector.cc
|
||||
intern/frame_accessor.cc
|
||||
intern/homography.cc
|
||||
intern/image.cc
|
||||
intern/logging.cc
|
||||
intern/reconstruction.cc
|
||||
intern/track_region.cc
|
||||
intern/tracks.cc
|
||||
intern/tracksN.cc
|
||||
libmv/autotrack/autotrack.cc
|
||||
libmv/autotrack/predict_tracks.cc
|
||||
libmv/autotrack/tracks.cc
|
||||
libmv/base/aligned_malloc.cc
|
||||
libmv/image/array_nd.cc
|
||||
libmv/image/convolve.cc
|
||||
@@ -120,27 +114,14 @@ if(WITH_LIBMV)
|
||||
libmv/tracking/trklt_region_tracker.cc
|
||||
|
||||
|
||||
intern/autotrack.h
|
||||
intern/camera_intrinsics.h
|
||||
intern/detector.h
|
||||
intern/frame_accessor.h
|
||||
intern/homography.h
|
||||
intern/image.h
|
||||
intern/logging.h
|
||||
intern/reconstruction.h
|
||||
intern/track_region.h
|
||||
intern/tracks.h
|
||||
intern/tracksN.h
|
||||
libmv/autotrack/autotrack.h
|
||||
libmv/autotrack/callbacks.h
|
||||
libmv/autotrack/frame_accessor.h
|
||||
libmv/autotrack/marker.h
|
||||
libmv/autotrack/model.h
|
||||
libmv/autotrack/predict_tracks.h
|
||||
libmv/autotrack/quad.h
|
||||
libmv/autotrack/reconstruction.h
|
||||
libmv/autotrack/region.h
|
||||
libmv/autotrack/tracks.h
|
||||
libmv/base/aligned_malloc.h
|
||||
libmv/base/id_generator.h
|
||||
libmv/base/scoped_ptr.h
|
||||
@@ -190,7 +171,6 @@ if(WITH_LIBMV)
|
||||
libmv/simple_pipeline/tracks.h
|
||||
libmv/tracking/brute_region_tracker.h
|
||||
libmv/tracking/hybrid_region_tracker.h
|
||||
libmv/tracking/kalman_filter.h
|
||||
libmv/tracking/klt_region_tracker.h
|
||||
libmv/tracking/pyramid_region_tracker.h
|
||||
libmv/tracking/region_tracker.h
|
||||
@@ -217,8 +197,6 @@ if(WITH_LIBMV)
|
||||
if(WITH_GTESTS)
|
||||
blender_add_lib(libmv_test_dataset "./libmv/multiview/test_data_sets.cc" "" "")
|
||||
|
||||
BLENDER_SRC_GTEST("libmv_predict_tracks" "./libmv/autotrack/predict_tracks_test.cc" "libmv_test_dataset;extern_libmv;extern_ceres")
|
||||
BLENDER_SRC_GTEST("libmv_tracks" "./libmv/autotrack/tracks_test.cc" "libmv_test_dataset;extern_libmv;extern_ceres")
|
||||
BLENDER_SRC_GTEST("libmv_scoped_ptr" "./libmv/base/scoped_ptr_test.cc" "libmv_test_dataset;extern_libmv;extern_ceres")
|
||||
BLENDER_SRC_GTEST("libmv_vector" "./libmv/base/vector_test.cc" "libmv_test_dataset;extern_libmv;extern_ceres")
|
||||
BLENDER_SRC_GTEST("libmv_array_nd" "./libmv/image/array_nd_test.cc" "libmv_test_dataset;extern_libmv;extern_ceres")
|
||||
|
701
extern/libmv/ChangeLog
vendored
701
extern/libmv/ChangeLog
vendored
@@ -1,365 +1,3 @@
|
||||
commit d976e034cdf74b34860e0632d7b29713f47c5756
|
||||
Author: Keir Mierle <mierle@gmail.com>
|
||||
Date: Sat Aug 23 00:38:01 2014 -0700
|
||||
|
||||
Minor keyframe selection cleanups
|
||||
|
||||
Reviewers: sergey
|
||||
|
||||
Reviewed By: sergey
|
||||
|
||||
Differential Revision: https://developer.blender.org/D757
|
||||
|
||||
commit bc99ca55dadfca89fde0f93764397c2fe028943d
|
||||
Author: Sergey Sharybin <sergey.vfx@gmail.com>
|
||||
Date: Sat Aug 23 01:55:32 2014 +0600
|
||||
|
||||
implement backward prediction
|
||||
|
||||
The title actually says it all, just extend current implementation
|
||||
of PredictMarkerPosition() to cases when tracking happens in the reverse
|
||||
order (from the end frame to start).
|
||||
|
||||
it's still doesn't solve all the ambiguity happening in the function
|
||||
in cases when one tracks the feature and then re-tracks it in order
|
||||
to refine the sliding. This is considered a separate TODO for now and
|
||||
will likely be solved by passing tracking direction to the prediction
|
||||
function.
|
||||
|
||||
Reviewers: keir
|
||||
|
||||
Reviewed By: keir
|
||||
|
||||
Differential Revision: https://developer.blender.org/D663
|
||||
|
||||
commit 5b87682d98df65ade02638bc6482d824cf0dd0b3
|
||||
Author: Keir Mierle <mierle@gmail.com>
|
||||
Date: Thu Aug 21 22:45:22 2014 -0700
|
||||
|
||||
Make libmv compile on Ubuntu 14.04
|
||||
|
||||
Reviewers: fsiddi
|
||||
|
||||
Reviewed By: fsiddi
|
||||
|
||||
Subscribers: sergey
|
||||
|
||||
Differential Revision: https://developer.blender.org/D755
|
||||
|
||||
commit 0a81db623c458e0384b4f7060d1bcff8993fb469
|
||||
Author: Sergey Sharybin <sergey.vfx@gmail.com>
|
||||
Date: Wed Jul 23 00:42:00 2014 +0600
|
||||
|
||||
Fix wrong residual blocks counter
|
||||
|
||||
This happened in cases when having zero-weighted tracks
|
||||
and could lead to some assert failures on marking parameter
|
||||
block constant.
|
||||
|
||||
commit 2824dbac54cacf74828678be7a5c9fd960ce83e2
|
||||
Author: Sergey Sharybin <sergey.vfx@gmail.com>
|
||||
Date: Fri Jul 18 12:52:03 2014 +0600
|
||||
|
||||
Fix search area sliding issue
|
||||
|
||||
The only way to do this is to store search region in floats
|
||||
and round when we need to sample it. Otherwise you'll always
|
||||
have sliding effect caused by rounding the issues, especially
|
||||
when doing incremental offset (thing which happens in the
|
||||
prediction code).
|
||||
|
||||
Pretty much straightforward change apart from stuff to be kept
|
||||
in mind: offset calculation int should happen relative to the
|
||||
rounded search region. This is because tracker works in the space
|
||||
of the search window image which get's rounded on the frame access,
|
||||
|
||||
This makes API a bit creepy because frame accessor uses the same
|
||||
Region struct as the search window in Marker and ideally we would
|
||||
need to have either IntRegion or Region<int> in order to make
|
||||
Libmv fully track on what's getting rounded and when.
|
||||
|
||||
Reviewers: keir
|
||||
|
||||
Reviewed By: keir
|
||||
|
||||
Differential Revision: https://developer.blender.org/D616
|
||||
|
||||
commit 04862c479332308be47a0f27361402444ace8880
|
||||
Author: Keir Mierle <mierle@gmail.com>
|
||||
Date: Fri May 9 23:00:03 2014 +0200
|
||||
|
||||
Start the automatic 2D tracking code
|
||||
|
||||
This starts the 2D automatic tracking code. It is totally unfinished.
|
||||
|
||||
Reviewers: sergey
|
||||
|
||||
Reviewed By: sergey
|
||||
|
||||
Differential Revision: https://developer.blender.org/D523
|
||||
|
||||
commit be679f67d807a2139c1f7d7e2ca45141940b30d5
|
||||
Author: Keir Mierle <mierle@gmail.com>
|
||||
Date: Fri May 9 14:36:04 2014 +0200
|
||||
|
||||
Also shift the search window
|
||||
|
||||
Reviewers: sergey
|
||||
|
||||
Reviewed By: sergey
|
||||
|
||||
Differential Revision: https://developer.blender.org/D520
|
||||
|
||||
commit 66b8f5eef2633ebcde32a388fc14c60171011821
|
||||
Author: Keir Mierle <mierle@gmail.com>
|
||||
Date: Fri May 9 13:06:28 2014 +0200
|
||||
|
||||
Change the search region to absolute frame coordinates
|
||||
|
||||
Smarter Eigen usage
|
||||
|
||||
Better error logging
|
||||
|
||||
Reviewers: sergey
|
||||
|
||||
Reviewed By: sergey
|
||||
|
||||
Differential Revision: https://developer.blender.org/D519
|
||||
|
||||
commit a08193319ae409fad8f08887eae1f79f02e91eaa
|
||||
Author: Keir Mierle <mierle@gmail.com>
|
||||
Date: Fri May 9 12:02:47 2014 +0200
|
||||
|
||||
First cut at predictive tracing
|
||||
|
||||
This adds a Kalman filter-based approach to predict where a marker
|
||||
will go in the next frame to track. Hopefully this will make the
|
||||
tracker work faster by avoiding lengthy searches. This code
|
||||
compiles, but is otherwise untested, and likely does not work.
|
||||
|
||||
Fix else branch
|
||||
|
||||
Add some tests
|
||||
|
||||
Update patch coordinates as well (and test)
|
||||
|
||||
Reviewers: sergey
|
||||
|
||||
Reviewed By: sergey
|
||||
|
||||
Differential Revision: https://developer.blender.org/D518
|
||||
|
||||
commit 607ffb2f62b56e34a841abbb952d83e19cd1e23c
|
||||
Author: Keir Mierle <mierle@gmail.com>
|
||||
Date: Thu May 8 16:05:28 2014 +0200
|
||||
|
||||
Add constructor to AutoTrack
|
||||
|
||||
commit c39e20a0c27da3733804c3848454b5d4c4f0e66b
|
||||
Author: Keir Mierle <mierle@gmail.com>
|
||||
Date: Thu May 8 16:04:20 2014 +0200
|
||||
|
||||
Fix GetMarker compilation issue
|
||||
|
||||
commit 8dd93e431b6e44439c803bfd26ec2669b656177e
|
||||
Author: Keir Mierle <mierle@gmail.com>
|
||||
Date: Thu May 8 15:50:26 2014 +0200
|
||||
|
||||
Expose GetMarker() in AutoTrack
|
||||
|
||||
Reviewers: sergey
|
||||
|
||||
Reviewed By: sergey
|
||||
|
||||
Differential Revision: https://developer.blender.org/D516
|
||||
|
||||
commit 4405dff60ea08d454b64da1a7c0595d9328cf8a3
|
||||
Author: Keir Mierle <mierle@gmail.com>
|
||||
Date: Thu May 8 15:38:14 2014 +0200
|
||||
|
||||
Add public SetMarkers to AutoTrack
|
||||
|
||||
Reviewers: sergey
|
||||
|
||||
Reviewed By: sergey
|
||||
|
||||
Differential Revision: https://developer.blender.org/D515
|
||||
|
||||
commit c90837f6db276a3b1f610eaad509155f6a43b24f
|
||||
Author: Keir Mierle <mierle@gmail.com>
|
||||
Date: Thu May 8 15:17:48 2014 +0200
|
||||
|
||||
Make autotrack skeleton compile
|
||||
|
||||
Reviewers: sergey
|
||||
|
||||
Reviewed By: sergey
|
||||
|
||||
Differential Revision: https://developer.blender.org/D514
|
||||
|
||||
commit be01baa2e82e36f63e548f073157e68d2ff870c0
|
||||
Author: Keir Mierle <mierle@gmail.com>
|
||||
Date: Wed May 7 18:48:55 2014 +0200
|
||||
|
||||
Add preliminary TrackMarkerToFrame in autotrack
|
||||
|
||||
Reviewers: sergey
|
||||
|
||||
Reviewed By: sergey
|
||||
|
||||
Differential Revision: https://developer.blender.org/D509
|
||||
|
||||
commit 0cab028d591b3d08672ca86eb6c6e4ac1aacf1d0
|
||||
Author: Sergey Sharybin <sergey.vfx@gmail.com>
|
||||
Date: Wed May 7 17:59:11 2014 +0200
|
||||
|
||||
Remove assert from ArrayND Resize
|
||||
|
||||
That assert broke initialization of arrays which doesn't
|
||||
own the data since constructor uses Resize to set shape
|
||||
and strides.
|
||||
|
||||
Strides are still to be fixed, but that's for later.
|
||||
|
||||
commit 64f9c118029a9351e9023e96527c120e1d724d5b
|
||||
Author: Sergey Sharybin <sergey.vfx@gmail.com>
|
||||
Date: Wed May 7 17:42:21 2014 +0200
|
||||
|
||||
Fix ArrayND freeing the data it doesn't own
|
||||
|
||||
Can't really guarantee it works fully correct now,
|
||||
but at least this check is needed anyway and compilation
|
||||
works just fine.
|
||||
|
||||
Reviewers: keir
|
||||
|
||||
Reviewed By: keir
|
||||
|
||||
Differential Revision: https://developer.blender.org/D508
|
||||
|
||||
commit 0618f1c8e88dfc738cdde55784da80b889905e7c
|
||||
Author: Keir Mierle <mierle@gmail.com>
|
||||
Date: Wed May 7 12:03:32 2014 +0200
|
||||
|
||||
Minor changes
|
||||
|
||||
Reviewers: sergey
|
||||
|
||||
Reviewed By: sergey
|
||||
|
||||
Differential Revision: https://developer.blender.org/D505
|
||||
|
||||
commit 5c34335e1bb90c4ed701ee830c718ed4e20dbffa
|
||||
Author: Sergey Sharybin <sergey.vfx@gmail.com>
|
||||
Date: Wed May 7 11:12:23 2014 +0200
|
||||
|
||||
Fix compilation error in frame accessor
|
||||
|
||||
- int64 is not a standard type, we've got int64_t defined in
|
||||
std int. We also have an msvc port of this header, so should
|
||||
not be an issue.
|
||||
|
||||
- Fixed inconsistency in usage of CacheKey and Key, used Key.
|
||||
|
||||
- Some functions weren't marked as virtual.
|
||||
|
||||
Additional change: added self to authors.
|
||||
|
||||
Reviewers: keir
|
||||
|
||||
Reviewed By: keir
|
||||
|
||||
Differential Revision: https://developer.blender.org/D504
|
||||
|
||||
commit 06bc207614e262cd688e2c3ed820ade7c77bdb66
|
||||
Author: Keir Mierle <mierle@gmail.com>
|
||||
Date: Tue May 6 22:30:59 2014 +0200
|
||||
|
||||
Start new Tracks implementation
|
||||
|
||||
This adds the new Tracks implementation, as well as a
|
||||
trivial test to show it compiles.
|
||||
|
||||
Reviewers: sergey
|
||||
|
||||
Reviewed By: sergey
|
||||
|
||||
Differential Revision: https://developer.blender.org/D502
|
||||
|
||||
commit 25ce061e6da69881460ba7718bb0d660a2380a02
|
||||
Author: Keir Mierle <mierle@gmail.com>
|
||||
Date: Tue May 6 19:10:51 2014 +0200
|
||||
|
||||
Add Reconstruction class for new API
|
||||
|
||||
This starts the new Reconstruction class (with support for e.g. planes). This
|
||||
also starts the new namespace "mv" which will eventually have all the symbols
|
||||
we wish to export.
|
||||
|
||||
Reviewers: sergey
|
||||
|
||||
Reviewed By: sergey
|
||||
|
||||
Differential Revision: https://developer.blender.org/D501
|
||||
|
||||
commit 0a6af3e29016048978aea607673340500e050339
|
||||
Author: Keir Mierle <mierle@gmail.com>
|
||||
Date: Tue May 6 17:52:53 2014 +0200
|
||||
|
||||
Add a new Tracks implementation
|
||||
|
||||
Reviewers: sergey
|
||||
|
||||
Reviewed By: sergey
|
||||
|
||||
Differential Revision: https://developer.blender.org/D500
|
||||
|
||||
commit 887b68d29c2b198f4939f9ab5153881aa2c1806e
|
||||
Author: Keir Mierle <mierle@gmail.com>
|
||||
Date: Tue May 6 17:01:39 2014 +0200
|
||||
|
||||
Initial commit of unfinished AutoTrack API
|
||||
|
||||
This starts the creating the new AutoTrack API. The new API will
|
||||
make it possible for libmv to do full autotracking, including
|
||||
predictive tracking and also support multiple motion models (3D
|
||||
planes etc).
|
||||
|
||||
The first goal (not in this patch) is to convert Blender to use
|
||||
the new API without adding any new functionality.
|
||||
|
||||
Note: This does not add any of the API to the build system!
|
||||
It likely does not compile.
|
||||
|
||||
Reviewers: sergey
|
||||
|
||||
Reviewed By: sergey
|
||||
|
||||
Differential Revision: https://developer.blender.org/D499
|
||||
|
||||
commit 08cc227d431d257d27f300fbb8e6991e663302da
|
||||
Author: Sergey Sharybin <sergey.vfx@gmail.com>
|
||||
Date: Tue May 6 13:09:22 2014 +0200
|
||||
|
||||
Fix homography test failure
|
||||
|
||||
It was caused by assuming that reconstructed homography matrix
|
||||
should look exactly the same as the matrix used to generate a
|
||||
test case.
|
||||
|
||||
It's not actually valid assumption because different-looking
|
||||
matrices could correspond to the same exact transform.
|
||||
|
||||
In this change we make it so actual "re-projected" vectors
|
||||
are being checked, not the values in matrix. This makes it
|
||||
more predictable verification.
|
||||
|
||||
Reviewers: keir
|
||||
|
||||
Reviewed By: keir
|
||||
|
||||
Differential Revision: https://developer.blender.org/D488
|
||||
|
||||
commit 0b7d83dc9627447dc7df64d7e3a468aefe9ddc13
|
||||
Author: Sergey Sharybin <sergey.vfx@gmail.com>
|
||||
Date: Wed Apr 23 19:14:55 2014 +0600
|
||||
@@ -700,3 +338,342 @@ Date: Thu Feb 13 23:55:03 2014 +0600
|
||||
|
||||
Actually we're to switch to external Ceres rather than
|
||||
bundled one, would make life much easier actually.
|
||||
|
||||
commit b1381540305d69c702eb2f051bd543fb5c1c3e2c
|
||||
Author: Sergey Sharybin <sergey.vfx@gmail.com>
|
||||
Date: Thu Feb 6 18:01:58 2014 +0600
|
||||
|
||||
Made FAST detector optional
|
||||
|
||||
This way it's possible to bundle Libmv sources subset
|
||||
to applications which doesn't need FAST detector.
|
||||
|
||||
Mainly this is done for Blender integration.
|
||||
|
||||
commit da4607f010bca0b3532cd4444afbb10bc774fc32
|
||||
Author: Sergey Sharybin <sergey.vfx@gmail.com>
|
||||
Date: Tue Jan 28 18:32:39 2014 +0600
|
||||
|
||||
Implemented scoped_array and use it in detector
|
||||
|
||||
scoped_array is pretty much the same as scoped_ptr
|
||||
with the only difference that it'll free memory using
|
||||
delete[] operator.
|
||||
|
||||
It also gives some additional API functions to access
|
||||
array elements.
|
||||
|
||||
Currently it only used to manage images denoted as byte
|
||||
arrays in detector.
|
||||
|
||||
Reviewers: keir
|
||||
|
||||
Reviewed By: keir
|
||||
|
||||
Differential Revision: https://developer.blender.org/D266
|
||||
|
||||
commit cd7eb3eff2e69ce5e08570ead83ae6d35ee48857
|
||||
Author: Sergey Sharybin <sergey.vfx@gmail.com>
|
||||
Date: Tue Jan 28 17:23:47 2014 +0600
|
||||
|
||||
Improvements to weighted tracks behavior
|
||||
|
||||
First thing changed by this commit is making it so
|
||||
Euclidean intersection takes track weight into account
|
||||
when solving minimization problem. This behaves the
|
||||
same exact way as it is for BA step.
|
||||
|
||||
Second thing is related on how average reprojection error
|
||||
is being calculated. It didn't take track weight into
|
||||
account which could confuse users. Now average reprojection
|
||||
error will give the same result as intersection/BA uses
|
||||
during minimization which gives much more predictable
|
||||
behavior.
|
||||
|
||||
Reviewers: keir
|
||||
|
||||
Reviewed By: keir
|
||||
|
||||
CC: sebastian_k
|
||||
|
||||
Differential Revision: https://developer.blender.org/D265
|
||||
|
||||
commit 6559b36dc14369175bfa0830323146acd3426483
|
||||
Author: Sergey Sharybin <sergey.vfx@gmail.com>
|
||||
Date: Tue Jan 28 16:39:14 2014 +0600
|
||||
|
||||
Fixes for keyframe selection
|
||||
|
||||
Using tracks with constant zero weight used to crash
|
||||
keyframe selection since it was trying to use missing
|
||||
parameter blocks for Jacobian evaluation,
|
||||
|
||||
Also fixed possible issues with wrong camera block being
|
||||
marked as variable. This could technically happen when
|
||||
having zero weighted tracks. Made it so all camera blocks
|
||||
are marked as variable for now.
|
||||
|
||||
commit 557d531b061aa69d114e89cbb325c5175389afec
|
||||
Author: Sergey Sharybin <sergey.vfx@gmail.com>
|
||||
Date: Tue Jan 28 16:10:33 2014 +0600
|
||||
|
||||
Style cleanup: wrong indentation of wrapped line
|
||||
|
||||
commit ca15262cf07a873268173965ee1fb84f9729b744
|
||||
Author: Sergey Sharybin <sergey.vfx@gmail.com>
|
||||
Date: Tue Jan 28 15:21:36 2014 +0600
|
||||
|
||||
Rework detector API and implement Harris detector
|
||||
|
||||
Switch the detector API to a single function which accepts
|
||||
a float image and detector options. This makes usage of
|
||||
feature detection more unified across different algorithms.
|
||||
|
||||
Options structure is pretty much straightforward and contains
|
||||
detector to be used and all the detector-specific settings.
|
||||
|
||||
Also implemented Harris feature detection algorithm which
|
||||
is not as fast as FAST one but is expected to detect more
|
||||
robust feature points.
|
||||
|
||||
Reviewers: keir
|
||||
|
||||
Reviewed By: keir
|
||||
|
||||
Differential Revision: https://developer.blender.org/D258
|
||||
|
||||
commit 6458915f64fceba108c5279b7320ca8c76e8a742
|
||||
Author: Sergey Sharybin <sergey.vfx@gmail.com>
|
||||
Date: Fri Jan 24 19:14:18 2014 +0600
|
||||
|
||||
Add arcanist configuration file
|
||||
|
||||
commit 0a69fadadc5aacbd339f839ac5bd12c3571278b1
|
||||
Author: Sergey Sharybin <sergey.vfx@gmail.com>
|
||||
Date: Thu Jan 9 15:50:11 2014 +0600
|
||||
|
||||
Fix compilation error on NetBSD
|
||||
|
||||
- NetBSD doesn't provide sincos(3) in libm, so don't try to use it
|
||||
- Use posix_memalign on NetBSD
|
||||
|
||||
Original patch is by Jeorg Sonnenberger to Blender patch tracker, thanks!
|
||||
|
||||
commit b0df3e291e6c85f791658be04334efafc41989f5
|
||||
Author: Sergey Sharybin <sergey.vfx@gmail.com>
|
||||
Date: Thu Jan 2 15:12:18 2014 +0600
|
||||
|
||||
Fix build configuration warnings
|
||||
|
||||
Those warnings were mainly caused by installation
|
||||
configuration of Ceres. Made some tweaks to make
|
||||
CMake happy for now.
|
||||
|
||||
But for sure bigger cleanup here is needed.
|
||||
|
||||
commit b68de6acd20f3ffab92e0cd450198a700cd109ab
|
||||
Author: Sergey Sharybin <sergey.vfx@gmail.com>
|
||||
Date: Thu Jan 2 15:04:05 2014 +0600
|
||||
|
||||
Code and style cleanup
|
||||
|
||||
Mainly fixed some style warnings reported by cpplint.
|
||||
|
||||
Also changed how camera (un)distortion happens internally
|
||||
by replacing number of channels as a template argument
|
||||
with number as channels passing as function argument.
|
||||
Makes code easier to follow by eliminating loads checks
|
||||
how much channels are used and which argument to pass to
|
||||
the template.
|
||||
|
||||
commit b9e467e7c077b58199c4110f6967b7c18d1e7bf7
|
||||
Author: Sergey Sharybin <sergey.vfx@gmail.com>
|
||||
Date: Tue Dec 31 20:34:39 2013 +0600
|
||||
|
||||
Update Ceres to the latest upstream
|
||||
|
||||
This brings up much easier termination type usage,
|
||||
which for us means we might use:
|
||||
|
||||
ceres::Summary::IsSolutionUsable()
|
||||
|
||||
instead of doing manual funky enum values check.
|
||||
|
||||
commit 3aeb2367e50b52ca2b9d59d4f0f0b4bbfd6a05e8
|
||||
Author: Sergey Sharybin <sergey.vfx@gmail.com>
|
||||
Date: Tue Dec 31 20:43:24 2013 +0600
|
||||
|
||||
Update gtest to latest version 1.7.0
|
||||
|
||||
Also reshuffled CMakeLists in order to avoid
|
||||
conflicts happening between gflags bundled to
|
||||
Ceres and third_party.
|
||||
|
||||
commit 30aaa9cd0b4a4eb0948a17824e7e7622d8ebcb41
|
||||
Author: Sergey Sharybin <sergey.vfx@gmail.com>
|
||||
Date: Tue Dec 31 20:10:06 2013 +0600
|
||||
|
||||
Changes for VC2013
|
||||
|
||||
Solves compilation error when using msvc2013
|
||||
|
||||
Original patch is by Alexandr Kuznetsov to blender.git
|
||||
|
||||
commit b204c0d25065a2b149de256929ff37d8f00f45bb
|
||||
Author: Keir Mierle <mierle@gmail.com>
|
||||
Date: Tue Dec 31 20:05:58 2013 +0600
|
||||
|
||||
Eagerly attempt to refine a track before doing a brute search
|
||||
|
||||
Before the refinement phase of tracking, a brute force SAD search
|
||||
is run across the search area. This works well but is slow;
|
||||
especially if the guess for the track's location is accurate.
|
||||
|
||||
This patch runs a refinement phase before running a brute force
|
||||
search, hoping that the guessed position (in x2, y2) is close to
|
||||
the best answer. If it is, then no brute search is done. If it is
|
||||
not, then a normal brute force search followed by refinement is
|
||||
done.
|
||||
|
||||
In some cases this may produce worse tracks than before; the
|
||||
regressions will need investigation. The predictive motion model
|
||||
(to be implemented) will reduce the probability of that happening.
|
||||
|
||||
commit 5361513f0328ff94b53125d29129561bb03132e8
|
||||
Author: Keir Mierle <mierle@gmail.com>
|
||||
Date: Tue Dec 31 20:04:46 2013 +0600
|
||||
|
||||
Fix bug where libmv tracking incorrectly succeeds on failure
|
||||
|
||||
Before this patch, if Ceres returned USER_SUCCESS indicating that
|
||||
Ceres was only changing the tracked quad slightly between
|
||||
iterations (indicating convergence), no final correlation check
|
||||
was done. This leads to incorrectly returning that the tracking
|
||||
was successful, when it actually failed.
|
||||
|
||||
commit ba9e63eed09e33a48bbcb081058f45ac16f8738e
|
||||
Author: Sergey Sharybin <sergey.vfx@gmail.com>
|
||||
Date: Tue Dec 31 20:00:46 2013 +0600
|
||||
|
||||
Implementation of weighted tracks
|
||||
|
||||
Added a weight field to Track structure which means
|
||||
how much affect this track will have on the final
|
||||
reconstruction.
|
||||
|
||||
Currently it affects on BA step only which in most
|
||||
cases will work just fine. However, it worth looking
|
||||
into weight support for intersection/resection.
|
||||
|
||||
commit 4600df8b685ca8c4daa22d6c3b0125fd42c3bc67
|
||||
Author: Sergey Sharybin <sergey.vfx@gmail.com>
|
||||
Date: Tue Dec 31 19:30:14 2013 +0600
|
||||
|
||||
Code cleanup: move function prototype to header file
|
||||
|
||||
commit 0ce5b6efde774b3f042acf9e42c95674548f1c01
|
||||
Author: Sergey Sharybin <sergey.vfx@gmail.com>
|
||||
Date: Tue Dec 31 19:26:48 2013 +0600
|
||||
|
||||
Get rid of Allow Fallback option for euclidean resection
|
||||
|
||||
It was rather confusing from the user usage point of view
|
||||
and didn't get so much improvement after new bundle adjuster
|
||||
was added.
|
||||
|
||||
In the future we might want to switch resection to PPnP algorithm,
|
||||
which could also might be a nice alternative to fallback option.
|
||||
|
||||
commit 5d063426f4809000c27f38ed798e4224bbd09a6d
|
||||
Author: Sergey Sharybin <sergey.vfx@gmail.com>
|
||||
Date: Tue Dec 31 19:24:05 2013 +0600
|
||||
|
||||
Use explicit declaration of int types sign
|
||||
|
||||
Mainly needs to make blender happy with this custom
|
||||
header which used to run into conflict with other int
|
||||
types headers.
|
||||
|
||||
Wouldn't harm being more explicit here anyway.
|
||||
|
||||
commit c5be59dee94f94de369006c544080282cfb245cc
|
||||
Author: Sergey Sharybin <sergey.vfx@gmail.com>
|
||||
Date: Tue Dec 31 14:50:00 2013 +0600
|
||||
|
||||
Implement refinement of estimated homography/fundamental matrices
|
||||
|
||||
It was only possible to perform algebraic estimation, which didn't
|
||||
give so much accurate results.
|
||||
|
||||
Implemented a way to perform algebraic estimation followed with
|
||||
refinement step using Ceres minimizer.
|
||||
|
||||
The code was actually mostly already there since keyframe selection
|
||||
patch. Made such estimation a generic function in multiview/ and
|
||||
hanged API for estimation in order to pass all additional options via
|
||||
an options structure (the same way as it's done fr Ceres).
|
||||
|
||||
Most of the options are straight-forward to understand,but some
|
||||
deserves more description here:
|
||||
|
||||
* expected_average_symmetric_distance is used as an early output check
|
||||
and as soon as average symmetric error goes below this threshold
|
||||
refining finishes.
|
||||
|
||||
This distance is measured in the same units as input points are.
|
||||
|
||||
It is arguable whether we need callback for this or not, but seems
|
||||
Ceres doesn't have some kind of absolute threshold for function value
|
||||
and function_tolerance behaves different from logic behind expected
|
||||
symmetric error.
|
||||
|
||||
* There' an option to normalize correspondences before estimating the
|
||||
homography in order to increase estimation stability. See
|
||||
|
||||
R. Hartley and A. Zisserman. Multiple View Geometry in Computer
|
||||
Vision. Cambridge University Press, second edition, 2003.
|
||||
|
||||
https://www.cs.ubc.ca/grads/resources/thesis/May09/Dubrofsky_Elan.pdf
|
||||
|
||||
commit 1cdad972c4a9005e78891524cbd6d65600ca7e99
|
||||
Author: Sergey Sharybin <sergey.vfx@gmail.com>
|
||||
Date: Wed Sep 25 16:12:29 2013 +0600
|
||||
|
||||
Code cleanup: Minor function capitalization fix
|
||||
|
||||
Original patch by Joseph Mansfield to the Blender repository.
|
||||
|
||||
commit 434316d084e8a41fd452f03610d7244d664948dc
|
||||
Author: Sergey Sharybin <sergey.vfx@gmail.com>
|
||||
Date: Wed Sep 25 16:07:43 2013 +0600
|
||||
|
||||
Code cleanup: spelling correction
|
||||
|
||||
Original patch by Joseph Mansfield to the Blender repository.
|
||||
|
||||
commit 5cfe8465ac70407c0959c53bcd5206657a1322a2
|
||||
Author: Sergey Sharybin <sergey.vfx@gmail.com>
|
||||
Date: Wed Sep 25 16:02:48 2013 +0600
|
||||
|
||||
Fix for uninitialized covariance matrix
|
||||
|
||||
Lead to unpredictable tracking termination criteria.
|
||||
|
||||
commit fd86b77d413489649a989f075b061714ed9a72fc
|
||||
Author: Sergey Sharybin <sergey.vfx@gmail.com>
|
||||
Date: Wed Sep 25 16:01:19 2013 +0600
|
||||
|
||||
Add Procrustes PNP ("PPnP") resection algorithm to libmv
|
||||
|
||||
This adds a new Euclidean resection method, used to create the
|
||||
initial reconstruction in the motion tracker, to libmv. The method
|
||||
is based on the Procrustes PNP algorithm (aka "PPnP"). Currently
|
||||
the algorithm is not connected with the motion tracker, but it
|
||||
will be eventually since it supports initialization.
|
||||
|
||||
Having an initial guess when doing resection is important for
|
||||
ambiguous cases where potentially the user could offer extra
|
||||
guidance to the solver, in the form of "this point is in front of
|
||||
that point".
|
||||
|
||||
Original patch by Keir Mierle made to Blender repository.
|
||||
|
17
extern/libmv/SConscript
vendored
17
extern/libmv/SConscript
vendored
@@ -6,6 +6,7 @@
|
||||
|
||||
import sys
|
||||
import os
|
||||
from FindSharedPtr import FindSharedPtr
|
||||
|
||||
Import('env')
|
||||
|
||||
@@ -28,7 +29,6 @@ if env['WITH_BF_LIBMV']:
|
||||
|
||||
src = env.Glob('intern/*.cc')
|
||||
src.remove('intern' + os.sep + 'stub.cc')
|
||||
src += env.Glob('libmv/autotrack/*.cc')
|
||||
src += env.Glob('libmv/base/*.cc')
|
||||
src += env.Glob('libmv/image/*.cc')
|
||||
src += env.Glob('libmv/multiview/*.cc')
|
||||
@@ -46,24 +46,17 @@ if env['WITH_BF_LIBMV']:
|
||||
if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
|
||||
incs += ' ./third_party/msinttypes'
|
||||
|
||||
src += ['./third_party/glog/src/logging.cc', './third_party/glog/src/raw_logging.cc', './third_party/glog/src/utilities.cc', './third_party/glog/src/vlog_is_on.cc']
|
||||
src += ['./third_party/glog/src/windows/port.cc']
|
||||
else:
|
||||
src += env.Glob("third_party/glog/src/*.cc")
|
||||
incs += ' ./third_party/glog/src'
|
||||
else:
|
||||
src = env.Glob("intern/stub.cc")
|
||||
|
||||
src = [src for src in src if src.find('_test.cc') == -1]
|
||||
|
||||
env.BlenderLib(libname = 'extern_libmv', sources=src, includes=Split(incs), defines=defs, libtype=['extern', 'player'], priority=[20,137])
|
||||
|
||||
if env['WITH_BF_LIBMV'] or (env['WITH_BF_CYCLES'] and env['WITH_BF_CYCLES_LOGGING']):
|
||||
glog_src = []
|
||||
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'):
|
||||
glog_src += ['./third_party/glog/src/logging.cc', './third_party/glog/src/raw_logging.cc', './third_party/glog/src/utilities.cc', './third_party/glog/src/vlog_is_on.cc']
|
||||
glog_src += ['./third_party/glog/src/windows/port.cc']
|
||||
else:
|
||||
glog_src += env.Glob("third_party/glog/src/*.cc")
|
||||
|
||||
env.BlenderLib(libname = 'extern_glog', sources=glog_src, includes=Split(incs), defines=defs, libtype=['extern', 'player'], priority=[20,137])
|
||||
env.BlenderLib ( libname = 'extern_libmv', sources=src, includes=Split(incs), defines=defs, libtype=['extern', 'player'], priority=[20,137] )
|
||||
|
||||
if env['WITH_BF_LIBMV']:
|
||||
SConscript(['third_party/SConscript'])
|
||||
|
27
extern/libmv/bundle.sh
vendored
27
extern/libmv/bundle.sh
vendored
@@ -159,36 +159,30 @@ if(WITH_LIBMV)
|
||||
|
||||
list(APPEND INC_SYS
|
||||
../Eigen3
|
||||
\${PNG_INCLUDE_DIRS}
|
||||
\${PNG_INCLUDE_DIR}
|
||||
\${ZLIB_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
list(APPEND SRC
|
||||
intern/autotrack.cc
|
||||
intern/camera_intrinsics.cc
|
||||
intern/detector.cc
|
||||
intern/frame_accessor.cc
|
||||
intern/homography.cc
|
||||
intern/image.cc
|
||||
intern/logging.cc
|
||||
intern/reconstruction.cc
|
||||
intern/track_region.cc
|
||||
intern/tracks.cc
|
||||
intern/tracksN.cc
|
||||
${sources}
|
||||
${third_sources}
|
||||
|
||||
intern/autotrack.h
|
||||
intern/camera_intrinsics.h
|
||||
intern/detector.h
|
||||
intern/frame_accessor.h
|
||||
intern/homography.h
|
||||
intern/image.h
|
||||
intern/logging.h
|
||||
intern/reconstruction.h
|
||||
intern/track_region.h
|
||||
intern/tracks.h
|
||||
intern/tracksN.h
|
||||
${headers}
|
||||
|
||||
${third_headers}
|
||||
@@ -213,7 +207,7 @@ ${tests}
|
||||
endif()
|
||||
else()
|
||||
list(APPEND SRC
|
||||
intern/stub.cc
|
||||
libmv-capi_stub.cc
|
||||
)
|
||||
endif()
|
||||
|
||||
@@ -224,7 +218,7 @@ if(WITH_LIBMV)
|
||||
endif()
|
||||
|
||||
# make GLog a separate target, so it can be used for gtest as well.
|
||||
if(WITH_LIBMV OR WITH_GTESTS OR WITH_CYCLES_LOGGING)
|
||||
if(WITH_LIBMV OR WITH_GTESTS)
|
||||
# We compile GLog together with GFlag so we don't worry about
|
||||
# adding extra lib to linker.
|
||||
set(GLOG_SRC
|
||||
@@ -321,24 +315,17 @@ $src
|
||||
if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
|
||||
incs += ' ./third_party/msinttypes'
|
||||
${win_src}
|
||||
src += ['./third_party/glog/src/logging.cc', './third_party/glog/src/raw_logging.cc', './third_party/glog/src/utilities.cc', './third_party/glog/src/vlog_is_on.cc']
|
||||
src += ['./third_party/glog/src/windows/port.cc']
|
||||
else:
|
||||
src += env.Glob("third_party/glog/src/*.cc")
|
||||
incs += ' ./third_party/glog/src'
|
||||
else:
|
||||
src = env.Glob("intern/stub.cc")
|
||||
|
||||
src = [src for src in src if src.find('_test.cc') == -1]
|
||||
|
||||
env.BlenderLib(libname = 'extern_libmv', sources=src, includes=Split(incs), defines=defs, libtype=['extern', 'player'], priority=[20,137])
|
||||
|
||||
if env['WITH_BF_LIBMV'] or (env['WITH_BF_CYCLES'] and env['WITH_BF_CYCLES_LOGGING']):
|
||||
glog_src = []
|
||||
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'):
|
||||
glog_src += ['./third_party/glog/src/logging.cc', './third_party/glog/src/raw_logging.cc', './third_party/glog/src/utilities.cc', './third_party/glog/src/vlog_is_on.cc']
|
||||
glog_src += ['./third_party/glog/src/windows/port.cc']
|
||||
else:
|
||||
glog_src += env.Glob("third_party/glog/src/*.cc")
|
||||
|
||||
env.BlenderLib(libname = 'extern_glog', sources=glog_src, includes=Split(incs), defines=defs, libtype=['extern', 'player'], priority=[20,137])
|
||||
env.BlenderLib ( libname = 'extern_libmv', sources=src, includes=Split(incs), defines=defs, libtype=['extern', 'player'], priority=[20,137] )
|
||||
|
||||
if env['WITH_BF_LIBMV']:
|
||||
SConscript(['third_party/SConscript'])
|
||||
|
16
extern/libmv/files.txt
vendored
16
extern/libmv/files.txt
vendored
@@ -1,18 +1,3 @@
|
||||
libmv/autotrack/autotrack.cc
|
||||
libmv/autotrack/autotrack.h
|
||||
libmv/autotrack/callbacks.h
|
||||
libmv/autotrack/frame_accessor.h
|
||||
libmv/autotrack/marker.h
|
||||
libmv/autotrack/model.h
|
||||
libmv/autotrack/predict_tracks.cc
|
||||
libmv/autotrack/predict_tracks.h
|
||||
libmv/autotrack/predict_tracks_test.cc
|
||||
libmv/autotrack/quad.h
|
||||
libmv/autotrack/reconstruction.h
|
||||
libmv/autotrack/region.h
|
||||
libmv/autotrack/tracks.cc
|
||||
libmv/autotrack/tracks.h
|
||||
libmv/autotrack/tracks_test.cc
|
||||
libmv/base/aligned_malloc.cc
|
||||
libmv/base/aligned_malloc.h
|
||||
libmv/base/id_generator.h
|
||||
@@ -119,7 +104,6 @@ libmv/tracking/brute_region_tracker.h
|
||||
libmv/tracking/brute_region_tracker_test.cc
|
||||
libmv/tracking/hybrid_region_tracker.cc
|
||||
libmv/tracking/hybrid_region_tracker.h
|
||||
libmv/tracking/kalman_filter.h
|
||||
libmv/tracking/klt_region_tracker.cc
|
||||
libmv/tracking/klt_region_tracker.h
|
||||
libmv/tracking/klt_region_tracker_test.cc
|
||||
|
99
extern/libmv/intern/autotrack.cc
vendored
99
extern/libmv/intern/autotrack.cc
vendored
@@ -1,99 +0,0 @@
|
||||
/*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2014 Blender Foundation.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Contributor(s): Blender Foundation,
|
||||
* Sergey Sharybin
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
#include "intern/autotrack.h"
|
||||
#include "intern/tracksN.h"
|
||||
#include "intern/utildefines.h"
|
||||
#include "libmv/autotrack/autotrack.h"
|
||||
|
||||
using mv::AutoTrack;
|
||||
using mv::FrameAccessor;
|
||||
using mv::Marker;
|
||||
using libmv::TrackRegionOptions;
|
||||
using libmv::TrackRegionResult;
|
||||
|
||||
libmv_AutoTrack* libmv_autoTrackNew(libmv_FrameAccessor *frame_accessor) {
|
||||
return (libmv_AutoTrack*) LIBMV_OBJECT_NEW(AutoTrack,
|
||||
(FrameAccessor*) frame_accessor);
|
||||
}
|
||||
|
||||
void libmv_autoTrackDestroy(libmv_AutoTrack* libmv_autotrack) {
|
||||
LIBMV_OBJECT_DELETE(libmv_autotrack, AutoTrack);
|
||||
}
|
||||
|
||||
void libmv_autoTrackSetOptions(libmv_AutoTrack* libmv_autotrack,
|
||||
const libmv_AutoTrackOptions* options) {
|
||||
AutoTrack *autotrack = ((AutoTrack*) libmv_autotrack);
|
||||
libmv_configureTrackRegionOptions(options->track_region,
|
||||
&autotrack->options.track_region);
|
||||
|
||||
autotrack->options.search_region.min(0) = options->search_region.min[0];
|
||||
autotrack->options.search_region.min(1) = options->search_region.min[1];
|
||||
autotrack->options.search_region.max(0) = options->search_region.max[0];
|
||||
autotrack->options.search_region.max(1) = options->search_region.max[1];
|
||||
}
|
||||
|
||||
int libmv_autoTrackMarker(libmv_AutoTrack* libmv_autotrack,
|
||||
const libmv_TrackRegionOptions* libmv_options,
|
||||
libmv_Marker *libmv_tracked_marker,
|
||||
libmv_TrackRegionResult* libmv_result) {
|
||||
|
||||
Marker tracked_marker;
|
||||
TrackRegionOptions options;
|
||||
TrackRegionResult result;
|
||||
libmv_apiMarkerToMarker(*libmv_tracked_marker, &tracked_marker);
|
||||
libmv_configureTrackRegionOptions(*libmv_options,
|
||||
&options);
|
||||
(((AutoTrack*) libmv_autotrack)->TrackMarker(&tracked_marker,
|
||||
&result,
|
||||
&options));
|
||||
libmv_markerToApiMarker(tracked_marker, libmv_tracked_marker);
|
||||
libmv_regionTrackergetResult(result, libmv_result);
|
||||
return result.is_usable();
|
||||
}
|
||||
|
||||
void libmv_autoTrackAddMarker(libmv_AutoTrack* libmv_autotrack,
|
||||
const libmv_Marker* libmv_marker) {
|
||||
Marker marker;
|
||||
libmv_apiMarkerToMarker(*libmv_marker, &marker);
|
||||
((AutoTrack*) libmv_autotrack)->AddMarker(marker);
|
||||
}
|
||||
|
||||
int libmv_autoTrackGetMarker(libmv_AutoTrack* libmv_autotrack,
|
||||
int clip,
|
||||
int frame,
|
||||
int track,
|
||||
libmv_Marker *libmv_marker) {
|
||||
Marker marker;
|
||||
int ok = ((AutoTrack*) libmv_autotrack)->GetMarker(clip,
|
||||
frame,
|
||||
track,
|
||||
&marker);
|
||||
if (ok) {
|
||||
libmv_markerToApiMarker(marker, libmv_marker);
|
||||
}
|
||||
return ok;
|
||||
}
|
71
extern/libmv/intern/autotrack.h
vendored
71
extern/libmv/intern/autotrack.h
vendored
@@ -1,71 +0,0 @@
|
||||
/*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2014 Blender Foundation.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Contributor(s): Blender Foundation,
|
||||
* Sergey Sharybin
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
#ifndef LIBMV_C_API_AUTOTRACK_H_
|
||||
#define LIBMV_C_API_AUTOTRACK_H_
|
||||
|
||||
#include "intern/frame_accessor.h"
|
||||
#include "intern/tracksN.h"
|
||||
#include "intern/track_region.h"
|
||||
#include "intern/region.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct libmv_AutoTrack libmv_AutoTrack;
|
||||
|
||||
typedef struct libmv_AutoTrackOptions {
|
||||
libmv_TrackRegionOptions track_region;
|
||||
libmv_Region search_region;
|
||||
} libmv_AutoTrackOptions;
|
||||
|
||||
libmv_AutoTrack* libmv_autoTrackNew(libmv_FrameAccessor *frame_accessor);
|
||||
|
||||
void libmv_autoTrackDestroy(libmv_AutoTrack* libmv_autotrack);
|
||||
|
||||
void libmv_autoTrackSetOptions(libmv_AutoTrack* libmv_autotrack,
|
||||
const libmv_AutoTrackOptions* options);
|
||||
|
||||
int libmv_autoTrackMarker(libmv_AutoTrack* libmv_autotrack,
|
||||
const libmv_TrackRegionOptions* libmv_options,
|
||||
libmv_Marker *libmv_tracker_marker,
|
||||
libmv_TrackRegionResult* libmv_result);
|
||||
|
||||
void libmv_autoTrackAddMarker(libmv_AutoTrack* libmv_autotrack,
|
||||
const libmv_Marker* libmv_marker);
|
||||
|
||||
int libmv_autoTrackGetMarker(libmv_AutoTrack* libmv_autotrack,
|
||||
int clip,
|
||||
int frame,
|
||||
int track,
|
||||
libmv_Marker *libmv_marker);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // LIBMV_C_API_TRACKS_H_
|
3
extern/libmv/intern/camera_intrinsics.cc
vendored
3
extern/libmv/intern/camera_intrinsics.cc
vendored
@@ -349,7 +349,6 @@ CameraIntrinsics* libmv_cameraIntrinsicsCreateFromOptions(
|
||||
default:
|
||||
assert(!"Unknown distortion model");
|
||||
}
|
||||
libmv_cameraIntrinsicsFillFromOptions(camera_intrinsics_options,
|
||||
camera_intrinsics);
|
||||
libmv_cameraIntrinsicsFillFromOptions(camera_intrinsics_options, camera_intrinsics);
|
||||
return camera_intrinsics;
|
||||
}
|
||||
|
164
extern/libmv/intern/frame_accessor.cc
vendored
164
extern/libmv/intern/frame_accessor.cc
vendored
@@ -1,164 +0,0 @@
|
||||
/*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2014 Blender Foundation.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Contributor(s): Blender Foundation,
|
||||
* Sergey Sharybin
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
#include "intern/frame_accessor.h"
|
||||
#include "intern/image.h"
|
||||
#include "intern/utildefines.h"
|
||||
#include "libmv/autotrack/frame_accessor.h"
|
||||
#include "libmv/autotrack/region.h"
|
||||
#include "libmv/image/image.h"
|
||||
|
||||
namespace {
|
||||
|
||||
using libmv::FloatImage;
|
||||
using mv::FrameAccessor;
|
||||
using mv::Region;
|
||||
|
||||
struct LibmvFrameAccessor : public FrameAccessor {
|
||||
LibmvFrameAccessor(libmv_FrameAccessorUserData* user_data,
|
||||
libmv_GetImageCallback get_image_callback,
|
||||
libmv_ReleaseImageCallback release_image_callback)
|
||||
: user_data_(user_data),
|
||||
get_image_callback_(get_image_callback),
|
||||
release_image_callback_(release_image_callback) { }
|
||||
|
||||
libmv_InputMode get_libmv_input_mode(InputMode input_mode) {
|
||||
switch (input_mode) {
|
||||
#define CHECK_INPUT_MODE(mode) \
|
||||
case mode: \
|
||||
return LIBMV_IMAGE_MODE_ ## mode;
|
||||
CHECK_INPUT_MODE(MONO)
|
||||
CHECK_INPUT_MODE(RGBA)
|
||||
#undef CHECK_INPUT_MODE
|
||||
}
|
||||
assert(!"unknown input mode passed from Libmv.");
|
||||
// TODO(sergey): Proper error handling here in the future.
|
||||
return LIBMV_IMAGE_MODE_MONO;
|
||||
}
|
||||
|
||||
void get_libmv_region(const Region& region,
|
||||
libmv_Region* libmv_region) {
|
||||
libmv_region->min[0] = region.min(0);
|
||||
libmv_region->min[1] = region.min(1);
|
||||
libmv_region->max[0] = region.max(0);
|
||||
libmv_region->max[1] = region.max(1);
|
||||
}
|
||||
|
||||
Key GetImage(int clip,
|
||||
int frame,
|
||||
InputMode input_mode,
|
||||
int downscale,
|
||||
const Region* region,
|
||||
const Transform* transform,
|
||||
FloatImage* destination) {
|
||||
float *float_buffer;
|
||||
int width, height, channels;
|
||||
libmv_Region libmv_region;
|
||||
if (region) {
|
||||
get_libmv_region(*region, &libmv_region);
|
||||
}
|
||||
Key cache_key = get_image_callback_(user_data_,
|
||||
clip,
|
||||
frame,
|
||||
get_libmv_input_mode(input_mode),
|
||||
downscale,
|
||||
region != NULL ? &libmv_region : NULL,
|
||||
(libmv_FrameTransform*) transform,
|
||||
&float_buffer,
|
||||
&width,
|
||||
&height,
|
||||
&channels);
|
||||
|
||||
// TODO(sergey): Dumb code for until we can set data directly.
|
||||
FloatImage temp_image(float_buffer,
|
||||
height,
|
||||
width,
|
||||
channels);
|
||||
destination->CopyFrom(temp_image);
|
||||
|
||||
return cache_key;
|
||||
}
|
||||
|
||||
void ReleaseImage(Key cache_key) {
|
||||
release_image_callback_(cache_key);
|
||||
}
|
||||
|
||||
bool GetClipDimensions(int clip, int *width, int *height) {
|
||||
return false;
|
||||
}
|
||||
|
||||
int NumClips() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
int NumFrames(int clip) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
libmv_FrameAccessorUserData* user_data_;
|
||||
libmv_GetImageCallback get_image_callback_;
|
||||
libmv_ReleaseImageCallback release_image_callback_;
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
||||
libmv_FrameAccessor* libmv_FrameAccessorNew(
|
||||
libmv_FrameAccessorUserData* user_data,
|
||||
libmv_GetImageCallback get_image_callback,
|
||||
libmv_ReleaseImageCallback release_image_callback) {
|
||||
return (libmv_FrameAccessor*) LIBMV_OBJECT_NEW(LibmvFrameAccessor,
|
||||
user_data,
|
||||
get_image_callback,
|
||||
release_image_callback);
|
||||
}
|
||||
|
||||
void libmv_FrameAccessorDestroy(libmv_FrameAccessor* frame_accessor) {
|
||||
LIBMV_OBJECT_DELETE(frame_accessor, LibmvFrameAccessor);
|
||||
}
|
||||
|
||||
int64_t libmv_frameAccessorgetTransformKey(const libmv_FrameTransform *transform) {
|
||||
return ((FrameAccessor::Transform*) transform)->key();
|
||||
}
|
||||
|
||||
void libmv_frameAccessorgetTransformRun(const libmv_FrameTransform *transform,
|
||||
const libmv_FloatImage *input_image,
|
||||
libmv_FloatImage *output_image) {
|
||||
const FloatImage input(input_image->buffer,
|
||||
input_image->height,
|
||||
input_image->width,
|
||||
input_image->channels);
|
||||
|
||||
FloatImage output;
|
||||
((FrameAccessor::Transform*) transform)->run(input,
|
||||
&output);
|
||||
|
||||
int num_pixels = output.Width() *output.Height() * output.Depth();
|
||||
output_image->buffer = new float[num_pixels];
|
||||
memcpy(output_image->buffer, output.Data(), num_pixels * sizeof(float));
|
||||
output_image->width = output.Width();
|
||||
output_image->height = output.Height();
|
||||
output_image->channels = output.Depth();
|
||||
}
|
79
extern/libmv/intern/frame_accessor.h
vendored
79
extern/libmv/intern/frame_accessor.h
vendored
@@ -1,79 +0,0 @@
|
||||
/*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2014 Blender Foundation.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Contributor(s): Blender Foundation,
|
||||
* Sergey Sharybin
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
#ifndef LIBMV_C_API_FRAME_ACCESSOR_H_
|
||||
#define LIBMV_C_API_FRAME_ACCESSOR_H_
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "intern/image.h"
|
||||
#include "intern/region.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct libmv_FrameAccessor libmv_FrameAccessor;
|
||||
typedef struct libmv_FrameTransform libmv_FrameTransform;
|
||||
typedef struct libmv_FrameAccessorUserData libmv_FrameAccessorUserData;
|
||||
typedef void *libmv_CacheKey;
|
||||
|
||||
typedef enum {
|
||||
LIBMV_IMAGE_MODE_MONO,
|
||||
LIBMV_IMAGE_MODE_RGBA,
|
||||
} libmv_InputMode;
|
||||
|
||||
typedef libmv_CacheKey (*libmv_GetImageCallback) (
|
||||
libmv_FrameAccessorUserData* user_data,
|
||||
int clip,
|
||||
int frame,
|
||||
libmv_InputMode input_mode,
|
||||
int downscale,
|
||||
const libmv_Region* region,
|
||||
const libmv_FrameTransform* transform,
|
||||
float** destination,
|
||||
int* width,
|
||||
int* height,
|
||||
int* channels);
|
||||
|
||||
typedef void (*libmv_ReleaseImageCallback) (libmv_CacheKey cache_key);
|
||||
|
||||
libmv_FrameAccessor* libmv_FrameAccessorNew(
|
||||
libmv_FrameAccessorUserData* user_data,
|
||||
libmv_GetImageCallback get_image_callback,
|
||||
libmv_ReleaseImageCallback release_image_callback);
|
||||
void libmv_FrameAccessorDestroy(libmv_FrameAccessor* frame_accessor);
|
||||
|
||||
int64_t libmv_frameAccessorgetTransformKey(const libmv_FrameTransform *transform);
|
||||
|
||||
void libmv_frameAccessorgetTransformRun(const libmv_FrameTransform *transform,
|
||||
const libmv_FloatImage *input_image,
|
||||
libmv_FloatImage *output_image);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // LIBMV_C_API_FRAME_ACCESSOR_H_
|
6
extern/libmv/intern/image.cc
vendored
6
extern/libmv/intern/image.cc
vendored
@@ -34,7 +34,7 @@
|
||||
using libmv::FloatImage;
|
||||
using libmv::SamplePlanarPatch;
|
||||
|
||||
void libmv_floatImageDestroy(libmv_FloatImage *image) {
|
||||
void libmv_floatImaheDestroy(libmv_FloatImage *image) {
|
||||
delete [] image->buffer;
|
||||
}
|
||||
|
||||
@@ -238,7 +238,7 @@ void libmv_samplePlanarPatchFloat(const float* image,
|
||||
libmv_floatImageToFloatBuffer(libmv_patch, patch);
|
||||
}
|
||||
|
||||
void libmv_samplePlanarPatchByte(const unsigned char* image,
|
||||
void libmv_samplePlanarPatchByte(const unsigned char* image,
|
||||
int width,
|
||||
int height,
|
||||
int channels,
|
||||
@@ -268,5 +268,5 @@ void libmv_samplePlanarPatchByte(const unsigned char* image,
|
||||
warped_position_x,
|
||||
warped_position_y);
|
||||
|
||||
libmv_floatImageToByteBuffer(libmv_patch, patch);
|
||||
libmv_floatImageToByteBuffer(libmv_patch, patch);
|
||||
}
|
||||
|
2
extern/libmv/intern/image.h
vendored
2
extern/libmv/intern/image.h
vendored
@@ -64,7 +64,7 @@ typedef struct libmv_FloatImage {
|
||||
int channels;
|
||||
} libmv_FloatImage;
|
||||
|
||||
void libmv_floatImageDestroy(libmv_FloatImage *image);
|
||||
void libmv_floatImaheDestroy(libmv_FloatImage *image);
|
||||
|
||||
void libmv_samplePlanarPatchFloat(const float* image,
|
||||
int width,
|
||||
|
16
extern/libmv/intern/reconstruction.cc
vendored
16
extern/libmv/intern/reconstruction.cc
vendored
@@ -61,7 +61,6 @@ struct libmv_Reconstruction {
|
||||
CameraIntrinsics *intrinsics;
|
||||
|
||||
double error;
|
||||
bool is_valid;
|
||||
};
|
||||
|
||||
namespace {
|
||||
@@ -221,7 +220,8 @@ Marker libmv_projectMarker(const EuclideanPoint& point,
|
||||
|
||||
void libmv_getNormalizedTracks(const Tracks &tracks,
|
||||
const CameraIntrinsics &camera_intrinsics,
|
||||
Tracks *normalized_tracks) {
|
||||
Tracks *normalized_tracks)
|
||||
{
|
||||
libmv::vector<Marker> markers = tracks.AllMarkers();
|
||||
for (int i = 0; i < markers.size(); ++i) {
|
||||
Marker &marker = markers[i];
|
||||
@@ -290,12 +290,6 @@ libmv_Reconstruction *libmv_solveReconstruction(
|
||||
|
||||
LG << "number of markers for init: " << keyframe_markers.size();
|
||||
|
||||
if (keyframe_markers.size() < 8) {
|
||||
LG << "No enough markers to initialize from";
|
||||
libmv_reconstruction->is_valid = false;
|
||||
return libmv_reconstruction;
|
||||
}
|
||||
|
||||
update_callback.invoke(0, "Initial reconstruction");
|
||||
|
||||
EuclideanReconstructTwoFrames(keyframe_markers, &reconstruction);
|
||||
@@ -326,7 +320,6 @@ libmv_Reconstruction *libmv_solveReconstruction(
|
||||
progress_update_callback,
|
||||
callback_customdata);
|
||||
|
||||
libmv_reconstruction->is_valid = true;
|
||||
return (libmv_Reconstruction *) libmv_reconstruction;
|
||||
}
|
||||
|
||||
@@ -385,14 +378,9 @@ libmv_Reconstruction *libmv_solveModal(
|
||||
progress_update_callback,
|
||||
callback_customdata);
|
||||
|
||||
libmv_reconstruction->is_valid = true;
|
||||
return (libmv_Reconstruction *) libmv_reconstruction;
|
||||
}
|
||||
|
||||
int libmv_reconstructionIsValid(libmv_Reconstruction *libmv_reconstruction) {
|
||||
return libmv_reconstruction->is_valid;
|
||||
}
|
||||
|
||||
void libmv_reconstructionDestroy(libmv_Reconstruction *libmv_reconstruction) {
|
||||
LIBMV_OBJECT_DELETE(libmv_reconstruction->intrinsics, CameraIntrinsics);
|
||||
LIBMV_OBJECT_DELETE(libmv_reconstruction, libmv_Reconstruction);
|
||||
|
2
extern/libmv/intern/reconstruction.h
vendored
2
extern/libmv/intern/reconstruction.h
vendored
@@ -68,8 +68,6 @@ libmv_Reconstruction* libmv_solveModal(
|
||||
reconstruct_progress_update_cb progress_update_callback,
|
||||
void* callback_customdata);
|
||||
|
||||
int libmv_reconstructionIsValid(libmv_Reconstruction *libmv_reconstruction);
|
||||
|
||||
void libmv_reconstructionDestroy(libmv_Reconstruction* libmv_reconstruction);
|
||||
|
||||
int libmv_reprojectionPointForTrack(
|
||||
|
73
extern/libmv/intern/stub.cc
vendored
73
extern/libmv/intern/stub.cc
vendored
@@ -97,10 +97,6 @@ void libmv_samplePlanarPatchByte(const unsigned char * /*image*/,
|
||||
/* TODO(sergey): implement */
|
||||
}
|
||||
|
||||
void libmv_floatImageDestroy(libmv_FloatImage* /*image*/)
|
||||
{
|
||||
}
|
||||
|
||||
/* ************ Tracks ************ */
|
||||
|
||||
libmv_Tracks *libmv_tracksNew(void) {
|
||||
@@ -138,10 +134,6 @@ libmv_Reconstruction *libmv_solveModal(
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int libmv_reconstructionIsValid(libmv_Reconstruction * /*libmv_reconstruction*/) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int libmv_reprojectionPointForTrack(
|
||||
const libmv_Reconstruction * /*libmv_reconstruction*/,
|
||||
int /*track*/,
|
||||
@@ -336,68 +328,3 @@ void libmv_homography2DFromCorrespondencesEuc(/* const */ double (*x1)[2],
|
||||
H[1][1] = 1.0f;
|
||||
H[2][2] = 1.0f;
|
||||
}
|
||||
|
||||
/* ************ autotrack ************ */
|
||||
|
||||
libmv_AutoTrack* libmv_autoTrackNew(libmv_FrameAccessor* /*frame_accessor*/)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void libmv_autoTrackDestroy(libmv_AutoTrack* /*libmv_autotrack*/)
|
||||
{
|
||||
}
|
||||
|
||||
void libmv_autoTrackSetOptions(libmv_AutoTrack* /*libmv_autotrack*/,
|
||||
const libmv_AutoTrackOptions* /*options*/)
|
||||
{
|
||||
}
|
||||
|
||||
int libmv_autoTrackMarker(libmv_AutoTrack* /*libmv_autotrack*/,
|
||||
const libmv_TrackRegionOptions* /*libmv_options*/,
|
||||
libmv_Marker */*libmv_tracker_marker*/,
|
||||
libmv_TrackRegionResult* /*libmv_result*/)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void libmv_autoTrackAddMarker(libmv_AutoTrack* /*libmv_autotrack*/,
|
||||
const libmv_Marker* /*libmv_marker*/)
|
||||
{
|
||||
}
|
||||
|
||||
int libmv_autoTrackGetMarker(libmv_AutoTrack* /*libmv_autotrack*/,
|
||||
int /*clip*/,
|
||||
int /*frame*/,
|
||||
int /*track*/,
|
||||
libmv_Marker* /*libmv_marker*/)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* ************ frame accessor ************ */
|
||||
|
||||
libmv_FrameAccessor* libmv_FrameAccessorNew(
|
||||
libmv_FrameAccessorUserData* /*user_data**/,
|
||||
libmv_GetImageCallback /*get_image_callback*/,
|
||||
libmv_ReleaseImageCallback /*release_image_callback*/)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void libmv_FrameAccessorDestroy(libmv_FrameAccessor* /*frame_accessor*/)
|
||||
{
|
||||
}
|
||||
|
||||
int64_t libmv_frameAccessorgetTransformKey(
|
||||
const libmv_FrameTransform */*transform*/)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void libmv_frameAccessorgetTransformRun(const libmv_FrameTransform* /*transform*/,
|
||||
const libmv_FloatImage* /*input_image*/,
|
||||
libmv_FloatImage* /*output_image*/)
|
||||
{
|
||||
}
|
||||
|
||||
|
138
extern/libmv/intern/tracksN.cc
vendored
138
extern/libmv/intern/tracksN.cc
vendored
@@ -1,138 +0,0 @@
|
||||
/*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2011 Blender Foundation.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Contributor(s): Blender Foundation,
|
||||
* Sergey Sharybin
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
#include "intern/tracksN.h"
|
||||
#include "intern/utildefines.h"
|
||||
#include "libmv/autotrack/marker.h"
|
||||
#include "libmv/autotrack/tracks.h"
|
||||
|
||||
using mv::Marker;
|
||||
using mv::Tracks;
|
||||
|
||||
void libmv_apiMarkerToMarker(const libmv_Marker& libmv_marker,
|
||||
Marker *marker) {
|
||||
marker->clip = libmv_marker.clip;
|
||||
marker->frame = libmv_marker.frame;
|
||||
marker->track = libmv_marker.track;
|
||||
marker->center(0) = libmv_marker.center[0];
|
||||
marker->center(1) = libmv_marker.center[1];
|
||||
for (int i = 0; i < 4; i++) {
|
||||
marker->patch.coordinates(i, 0) = libmv_marker.patch[i][0];
|
||||
marker->patch.coordinates(i, 1) = libmv_marker.patch[i][1];
|
||||
}
|
||||
marker->search_region.min(0) = libmv_marker.search_region_min[0];
|
||||
marker->search_region.min(1) = libmv_marker.search_region_min[1];
|
||||
marker->search_region.max(0) = libmv_marker.search_region_max[0];
|
||||
marker->search_region.max(1) = libmv_marker.search_region_max[1];
|
||||
marker->weight = libmv_marker.weight;
|
||||
marker->source = (Marker::Source) libmv_marker.source;
|
||||
marker->status = (Marker::Status) libmv_marker.status;
|
||||
marker->reference_clip = libmv_marker.reference_clip;
|
||||
marker->reference_frame = libmv_marker.reference_frame;
|
||||
marker->model_type = (Marker::ModelType) libmv_marker.model_type;
|
||||
marker->model_id = libmv_marker.model_id;
|
||||
marker->disabled_channels = libmv_marker.disabled_channels;
|
||||
}
|
||||
|
||||
void libmv_markerToApiMarker(const Marker& marker,
|
||||
libmv_Marker *libmv_marker) {
|
||||
libmv_marker->clip = marker.clip;
|
||||
libmv_marker->frame = marker.frame;
|
||||
libmv_marker->track = marker.track;
|
||||
libmv_marker->center[0] = marker.center(0);
|
||||
libmv_marker->center[1] = marker.center(1);
|
||||
for (int i = 0; i < 4; i++) {
|
||||
libmv_marker->patch[i][0] = marker.patch.coordinates(i, 0);
|
||||
libmv_marker->patch[i][1] = marker.patch.coordinates(i, 1);
|
||||
}
|
||||
libmv_marker->search_region_min[0] = marker.search_region.min(0);
|
||||
libmv_marker->search_region_min[1] = marker.search_region.min(1);
|
||||
libmv_marker->search_region_max[0] = marker.search_region.max(0);
|
||||
libmv_marker->search_region_max[1] = marker.search_region.max(1);
|
||||
libmv_marker->weight = marker.weight;
|
||||
libmv_marker->source = (libmv_MarkerSource) marker.source;
|
||||
libmv_marker->status = (libmv_MarkerStatus) marker.status;
|
||||
libmv_marker->reference_clip = marker.reference_clip;
|
||||
libmv_marker->reference_frame = marker.reference_frame;
|
||||
libmv_marker->model_type = (libmv_MarkerModelType) marker.model_type;
|
||||
libmv_marker->model_id = marker.model_id;
|
||||
libmv_marker->disabled_channels = marker.disabled_channels;
|
||||
}
|
||||
|
||||
libmv_TracksN* libmv_tracksNewN(void) {
|
||||
Tracks* tracks = LIBMV_OBJECT_NEW(Tracks);
|
||||
|
||||
return (libmv_TracksN*) tracks;
|
||||
}
|
||||
|
||||
void libmv_tracksDestroyN(libmv_TracksN* libmv_tracks) {
|
||||
LIBMV_OBJECT_DELETE(libmv_tracks, Tracks);
|
||||
}
|
||||
|
||||
void libmv_tracksAddMarkerN(libmv_TracksN* libmv_tracks,
|
||||
const libmv_Marker* libmv_marker) {
|
||||
Marker marker;
|
||||
libmv_apiMarkerToMarker(*libmv_marker, &marker);
|
||||
((Tracks*) libmv_tracks)->AddMarker(marker);
|
||||
}
|
||||
|
||||
void libmv_tracksGetMarkerN(libmv_TracksN* libmv_tracks,
|
||||
int clip,
|
||||
int frame,
|
||||
int track,
|
||||
libmv_Marker* libmv_marker) {
|
||||
Marker marker;
|
||||
((Tracks*) libmv_tracks)->GetMarker(clip, frame, track, &marker);
|
||||
libmv_markerToApiMarker(marker, libmv_marker);
|
||||
}
|
||||
|
||||
void libmv_tracksRemoveMarkerN(libmv_TracksN* libmv_tracks,
|
||||
int clip,
|
||||
int frame,
|
||||
int track) {
|
||||
((Tracks *) libmv_tracks)->RemoveMarker(clip, frame, track);
|
||||
}
|
||||
|
||||
void libmv_tracksRemoveMarkersForTrack(libmv_TracksN* libmv_tracks,
|
||||
int track) {
|
||||
((Tracks *) libmv_tracks)->RemoveMarkersForTrack(track);
|
||||
}
|
||||
|
||||
int libmv_tracksMaxClipN(libmv_TracksN* libmv_tracks) {
|
||||
return ((Tracks*) libmv_tracks)->MaxClip();
|
||||
}
|
||||
|
||||
int libmv_tracksMaxFrameN(libmv_TracksN* libmv_tracks, int clip) {
|
||||
return ((Tracks*) libmv_tracks)->MaxFrame(clip);
|
||||
}
|
||||
|
||||
int libmv_tracksMaxTrackN(libmv_TracksN* libmv_tracks) {
|
||||
return ((Tracks*) libmv_tracks)->MaxTrack();
|
||||
}
|
||||
|
||||
int libmv_tracksNumMarkersN(libmv_TracksN* libmv_tracks) {
|
||||
return ((Tracks*) libmv_tracks)->NumMarkers();
|
||||
}
|
129
extern/libmv/intern/tracksN.h
vendored
129
extern/libmv/intern/tracksN.h
vendored
@@ -1,129 +0,0 @@
|
||||
/*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2011 Blender Foundation.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Contributor(s): Blender Foundation,
|
||||
* Sergey Sharybin
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
// TODO(serrgey): For the time being we're converting simple pipeline
|
||||
// to an autotrack pipeline we call it tracks.
|
||||
// Once we've done with porting we remove N.
|
||||
|
||||
#ifndef LIBMV_C_API_TRACKSN_H_
|
||||
#define LIBMV_C_API_TRACKSN_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct libmv_TracksN libmv_TracksN;
|
||||
|
||||
// Keep order in this enums exactly the same as in mv::Marker.
|
||||
// Otherwise API wouldn't convert the values properly.
|
||||
typedef enum libmv_MarkerSource {
|
||||
LIBMV_MARKER_SOURCE_MANUAL,
|
||||
LIBMV_MARKER_SOURCE_DETECTED,
|
||||
LIBMV_MARKER_SOURCE_TRACKED,
|
||||
LIBMV_MARKER_SOURCE_MATCHED,
|
||||
LIBMV_MARKER_SOURCE_PREDICTED,
|
||||
} libmv_MarkerSource;
|
||||
|
||||
typedef enum libmv_MarkerStatus {
|
||||
LIBMV_MARKER_STATUS_UNKNOWN,
|
||||
LIBMV_MARKER_STATUS_INLIER,
|
||||
LIBMV_MARKER_STATUS_OUTLIER,
|
||||
} libmv_MarkerStatus;
|
||||
|
||||
typedef enum libmv_MarkerModelType {
|
||||
LIBMV_MARKER_MODEL_TYPE_POINT,
|
||||
LIBMV_MARKER_MODEL_TYPE_PLANE,
|
||||
LIBMV_MARKER_MODEL_TYPE_LINE,
|
||||
LIBMV_MARKER_MODEL_TYPE_CUBE,
|
||||
} libmv_MarkerModelType;
|
||||
|
||||
enum libmv_MarkerChannel {
|
||||
LIBMV_MARKER_CHANNEL_R = (1 << 0),
|
||||
LIBMV_MARKER_CHANNEL_G = (1 << 1),
|
||||
LIBMV_MARKER_CHANNEL_B = (1 << 2),
|
||||
};
|
||||
|
||||
typedef struct libmv_Marker {
|
||||
int clip;
|
||||
int frame;
|
||||
int track;
|
||||
float center[2];
|
||||
float patch[4][2];
|
||||
float search_region_min[2];
|
||||
float search_region_max[2];
|
||||
float weight;
|
||||
libmv_MarkerSource source;
|
||||
libmv_MarkerStatus status;
|
||||
int reference_clip;
|
||||
int reference_frame;
|
||||
libmv_MarkerModelType model_type;
|
||||
int model_id;
|
||||
int disabled_channels;
|
||||
} libmv_Marker;
|
||||
|
||||
#ifdef __cplusplus
|
||||
namespace mv {
|
||||
struct Marker;
|
||||
}
|
||||
void libmv_apiMarkerToMarker(const libmv_Marker& libmv_marker,
|
||||
mv::Marker *marker);
|
||||
|
||||
void libmv_markerToApiMarker(const mv::Marker& marker,
|
||||
libmv_Marker *libmv_marker);
|
||||
#endif
|
||||
|
||||
libmv_TracksN* libmv_tracksNewN(void);
|
||||
|
||||
void libmv_tracksDestroyN(libmv_TracksN* libmv_tracks);
|
||||
|
||||
|
||||
void libmv_tracksAddMarkerN(libmv_TracksN* libmv_tracks,
|
||||
const libmv_Marker* libmv_marker);
|
||||
|
||||
void libmv_tracksGetMarkerN(libmv_TracksN* libmv_tracks,
|
||||
int clip,
|
||||
int frame,
|
||||
int track,
|
||||
libmv_Marker* libmv_marker);
|
||||
|
||||
void libmv_tracksRemoveMarkerN(libmv_TracksN* libmv_tracks,
|
||||
int clip,
|
||||
int frame,
|
||||
int track);
|
||||
|
||||
void libmv_tracksRemoveMarkersForTrack(libmv_TracksN* libmv_tracks,
|
||||
int track);
|
||||
|
||||
int libmv_tracksMaxClipN(libmv_TracksN* libmv_tracks);
|
||||
int libmv_tracksMaxFrameN(libmv_TracksN* libmv_tracks, int clip);
|
||||
int libmv_tracksMaxTrackN(libmv_TracksN* libmv_tracks);
|
||||
int libmv_tracksNumMarkersN(libmv_TracksN* libmv_tracks);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // LIBMV_C_API_TRACKS_H_
|
3
extern/libmv/libmv-capi.h
vendored
3
extern/libmv/libmv-capi.h
vendored
@@ -27,16 +27,13 @@
|
||||
#ifndef LIBMV_C_API_H
|
||||
#define LIBMV_C_API_H
|
||||
|
||||
#include "intern/autotrack.h"
|
||||
#include "intern/camera_intrinsics.h"
|
||||
#include "intern/detector.h"
|
||||
#include "intern/frame_accessor.h"
|
||||
#include "intern/homography.h"
|
||||
#include "intern/image.h"
|
||||
#include "intern/logging.h"
|
||||
#include "intern/reconstruction.h"
|
||||
#include "intern/track_region.h"
|
||||
#include "intern/tracks.h"
|
||||
#include "intern/tracksN.h"
|
||||
|
||||
#endif // LIBMV_C_API_H
|
||||
|
290
extern/libmv/libmv/autotrack/autotrack.cc
vendored
290
extern/libmv/libmv/autotrack/autotrack.cc
vendored
@@ -1,290 +0,0 @@
|
||||
// Copyright (c) 2014 libmv authors.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to
|
||||
// deal in the Software without restriction, including without limitation the
|
||||
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
// sell copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
// IN THE SOFTWARE.
|
||||
//
|
||||
// Author: mierle@gmail.com (Keir Mierle)
|
||||
|
||||
#include "libmv/autotrack/autotrack.h"
|
||||
#include "libmv/autotrack/quad.h"
|
||||
#include "libmv/autotrack/frame_accessor.h"
|
||||
#include "libmv/autotrack/predict_tracks.h"
|
||||
#include "libmv/base/scoped_ptr.h"
|
||||
#include "libmv/logging/logging.h"
|
||||
#include "libmv/numeric/numeric.h"
|
||||
|
||||
namespace mv {
|
||||
|
||||
namespace {
|
||||
|
||||
class DisableChannelsTransform : public FrameAccessor::Transform {
|
||||
public:
|
||||
DisableChannelsTransform(int disabled_channels)
|
||||
: disabled_channels_(disabled_channels) { }
|
||||
|
||||
int64_t key() const {
|
||||
return disabled_channels_;
|
||||
}
|
||||
|
||||
void run(const FloatImage& input, FloatImage* output) const {
|
||||
bool disable_red = (disabled_channels_ & Marker::CHANNEL_R) != 0,
|
||||
disable_green = (disabled_channels_ & Marker::CHANNEL_G) != 0,
|
||||
disable_blue = (disabled_channels_ & Marker::CHANNEL_B) != 0;
|
||||
|
||||
LG << "Disabling channels: "
|
||||
<< (disable_red ? "R " : "")
|
||||
<< (disable_green ? "G " : "")
|
||||
<< (disable_blue ? "B" : "");
|
||||
|
||||
// It's important to rescale the resultappropriately so that e.g. if only
|
||||
// blue is selected, it's not zeroed out.
|
||||
float scale = (disable_red ? 0.0f : 0.2126f) +
|
||||
(disable_green ? 0.0f : 0.7152f) +
|
||||
(disable_blue ? 0.0f : 0.0722f);
|
||||
|
||||
output->Resize(input.Height(), input.Width(), 1);
|
||||
for (int y = 0; y < input.Height(); y++) {
|
||||
for (int x = 0; x < input.Width(); x++) {
|
||||
float r = disable_red ? 0.0f : input(y, x, 0);
|
||||
float g = disable_green ? 0.0f : input(y, x, 1);
|
||||
float b = disable_blue ? 0.0f : input(y, x, 2);
|
||||
(*output)(y, x, 0) = (0.2126f * r + 0.7152f * g + 0.0722f * b) / scale;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
// Bitfield representing visible channels, bits are from Marker::Channel.
|
||||
int disabled_channels_;
|
||||
};
|
||||
|
||||
template<typename QuadT, typename ArrayT>
|
||||
void QuadToArrays(const QuadT& quad, ArrayT* x, ArrayT* y) {
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
x[i] = quad.coordinates(i, 0);
|
||||
y[i] = quad.coordinates(i, 1);
|
||||
}
|
||||
}
|
||||
|
||||
void MarkerToArrays(const Marker& marker, double* x, double* y) {
|
||||
Quad2Df offset_quad = marker.patch;
|
||||
Vec2f origin = marker.search_region.Rounded().min;
|
||||
offset_quad.coordinates.rowwise() -= origin.transpose();
|
||||
QuadToArrays(offset_quad, x, y);
|
||||
x[4] = marker.center.x() - origin(0);
|
||||
y[4] = marker.center.y() - origin(1);
|
||||
}
|
||||
|
||||
FrameAccessor::Key GetImageForMarker(const Marker& marker,
|
||||
FrameAccessor* frame_accessor,
|
||||
FloatImage* image) {
|
||||
// TODO(sergey): Currently we pass float region to the accessor,
|
||||
// but we don't want the accessor to decide the rounding, so we
|
||||
// do rounding here.
|
||||
// Ideally we would need to pass IntRegion to the frame accessor.
|
||||
Region region = marker.search_region.Rounded();
|
||||
libmv::scoped_ptr<FrameAccessor::Transform> transform = NULL;
|
||||
if (marker.disabled_channels != 0) {
|
||||
transform.reset(new DisableChannelsTransform(marker.disabled_channels));
|
||||
}
|
||||
return frame_accessor->GetImage(marker.clip,
|
||||
marker.frame,
|
||||
FrameAccessor::MONO,
|
||||
0, // No downscale for now.
|
||||
®ion,
|
||||
transform.get(),
|
||||
image);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
bool AutoTrack::TrackMarker(Marker* tracked_marker,
|
||||
TrackRegionResult* result,
|
||||
const TrackRegionOptions* track_options) {
|
||||
// Try to predict the location of the second marker.
|
||||
bool predicted_position = false;
|
||||
if (PredictMarkerPosition(tracks_, tracked_marker)) {
|
||||
LG << "Succesfully predicted!";
|
||||
predicted_position = true;
|
||||
} else {
|
||||
LG << "Prediction failed; trying to track anyway.";
|
||||
}
|
||||
|
||||
Marker reference_marker;
|
||||
tracks_.GetMarker(tracked_marker->reference_clip,
|
||||
tracked_marker->reference_frame,
|
||||
tracked_marker->track,
|
||||
&reference_marker);
|
||||
|
||||
// Convert markers into the format expected by TrackRegion.
|
||||
double x1[5], y1[5];
|
||||
MarkerToArrays(reference_marker, x1, y1);
|
||||
|
||||
double x2[5], y2[5];
|
||||
MarkerToArrays(*tracked_marker, x2, y2);
|
||||
|
||||
// TODO(keir): Technically this could take a smaller slice from the source
|
||||
// image instead of taking one the size of the search window.
|
||||
FloatImage reference_image;
|
||||
FrameAccessor::Key reference_key = GetImageForMarker(reference_marker,
|
||||
frame_accessor_,
|
||||
&reference_image);
|
||||
if (!reference_key) {
|
||||
LG << "Couldn't get frame for reference marker: " << reference_marker;
|
||||
return false;
|
||||
}
|
||||
|
||||
FloatImage tracked_image;
|
||||
FrameAccessor::Key tracked_key = GetImageForMarker(*tracked_marker,
|
||||
frame_accessor_,
|
||||
&tracked_image);
|
||||
if (!tracked_key) {
|
||||
LG << "Couldn't get frame for tracked marker: " << tracked_marker;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Store original position befoer tracking, so we can claculate offset later.
|
||||
Vec2f original_center = tracked_marker->center;
|
||||
|
||||
// Do the tracking!
|
||||
TrackRegionOptions local_track_region_options;
|
||||
if (track_options) {
|
||||
local_track_region_options = *track_options;
|
||||
}
|
||||
local_track_region_options.num_extra_points = 1; // For center point.
|
||||
local_track_region_options.attempt_refine_before_brute = predicted_position;
|
||||
TrackRegion(reference_image,
|
||||
tracked_image,
|
||||
x1, y1,
|
||||
local_track_region_options,
|
||||
x2, y2,
|
||||
result);
|
||||
|
||||
// Copy results over the tracked marker.
|
||||
Vec2f tracked_origin = tracked_marker->search_region.Rounded().min;
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
tracked_marker->patch.coordinates(i, 0) = x2[i] + tracked_origin[0];
|
||||
tracked_marker->patch.coordinates(i, 1) = y2[i] + tracked_origin[1];
|
||||
}
|
||||
tracked_marker->center(0) = x2[4] + tracked_origin[0];
|
||||
tracked_marker->center(1) = y2[4] + tracked_origin[1];
|
||||
Vec2f delta = tracked_marker->center - original_center;
|
||||
tracked_marker->search_region.Offset(delta);
|
||||
tracked_marker->source = Marker::TRACKED;
|
||||
tracked_marker->status = Marker::UNKNOWN;
|
||||
tracked_marker->reference_clip = reference_marker.clip;
|
||||
tracked_marker->reference_frame = reference_marker.frame;
|
||||
|
||||
// Release the images from the accessor cache.
|
||||
frame_accessor_->ReleaseImage(reference_key);
|
||||
frame_accessor_->ReleaseImage(tracked_key);
|
||||
|
||||
// TODO(keir): Possibly the return here should get removed since the results
|
||||
// are part of TrackResult. However, eventually the autotrack stuff will have
|
||||
// extra status (e.g. prediction fail, etc) that should get included.
|
||||
return true;
|
||||
}
|
||||
|
||||
void AutoTrack::AddMarker(const Marker& marker) {
|
||||
tracks_.AddMarker(marker);
|
||||
}
|
||||
|
||||
void AutoTrack::SetMarkers(vector<Marker>* markers) {
|
||||
tracks_.SetMarkers(markers);
|
||||
}
|
||||
|
||||
bool AutoTrack::GetMarker(int clip, int frame, int track,
|
||||
Marker* markers) const {
|
||||
return tracks_.GetMarker(clip, frame, track, markers);
|
||||
}
|
||||
|
||||
void AutoTrack::DetectAndTrack(const DetectAndTrackOptions& options) {
|
||||
int num_clips = frame_accessor_->NumClips();
|
||||
for (int clip = 0; clip < num_clips; ++clip) {
|
||||
int num_frames = frame_accessor_->NumFrames(clip);
|
||||
vector<Marker> previous_frame_markers;
|
||||
// Q: How to decide track #s when detecting?
|
||||
// Q: How to match markers from previous frame? set of prev frame tracks?
|
||||
// Q: How to decide what markers should get tracked and which ones should not?
|
||||
for (int frame = 0; frame < num_frames; ++frame) {
|
||||
if (Cancelled()) {
|
||||
LG << "Got cancel message while detecting and tracking...";
|
||||
return;
|
||||
}
|
||||
// First, get or detect markers for this frame.
|
||||
vector<Marker> this_frame_markers;
|
||||
tracks_.GetMarkersInFrame(clip, frame, &this_frame_markers);
|
||||
LG << "Clip " << clip << ", frame " << frame << " have "
|
||||
<< this_frame_markers.size();
|
||||
if (this_frame_markers.size() < options.min_num_features) {
|
||||
DetectFeaturesInFrame(clip, frame);
|
||||
this_frame_markers.clear();
|
||||
tracks_.GetMarkersInFrame(clip, frame, &this_frame_markers);
|
||||
LG << "... detected " << this_frame_markers.size() << " features.";
|
||||
}
|
||||
if (previous_frame_markers.empty()) {
|
||||
LG << "First frame; skipping tracking stage.";
|
||||
previous_frame_markers.swap(this_frame_markers);
|
||||
continue;
|
||||
}
|
||||
// Second, find tracks that should get tracked forward into this frame.
|
||||
// To avoid tracking markers that are already tracked to this frame, make
|
||||
// a sorted set of the tracks that exist in the last frame.
|
||||
vector<int> tracks_in_this_frame;
|
||||
for (int i = 0; i < this_frame_markers.size(); ++i) {
|
||||
tracks_in_this_frame.push_back(this_frame_markers[i].track);
|
||||
}
|
||||
std::sort(tracks_in_this_frame.begin(),
|
||||
tracks_in_this_frame.end());
|
||||
|
||||
// Find tracks in the previous frame that are not in this one.
|
||||
vector<Marker*> previous_frame_markers_to_track;
|
||||
int num_skipped = 0;
|
||||
for (int i = 0; i < previous_frame_markers.size(); ++i) {
|
||||
if (std::binary_search(tracks_in_this_frame.begin(),
|
||||
tracks_in_this_frame.end(),
|
||||
previous_frame_markers[i].track)) {
|
||||
num_skipped++;
|
||||
} else {
|
||||
previous_frame_markers_to_track.push_back(&previous_frame_markers[i]);
|
||||
}
|
||||
}
|
||||
|
||||
// Finally track the markers from the last frame into this one.
|
||||
// TODO(keir): Use OMP.
|
||||
for (int i = 0; i < previous_frame_markers_to_track.size(); ++i) {
|
||||
Marker this_frame_marker = *previous_frame_markers_to_track[i];
|
||||
this_frame_marker.frame = frame;
|
||||
LG << "Tracking: " << this_frame_marker;
|
||||
TrackRegionResult result;
|
||||
TrackMarker(&this_frame_marker, &result);
|
||||
if (result.is_usable()) {
|
||||
LG << "Success: " << this_frame_marker;
|
||||
AddMarker(this_frame_marker);
|
||||
this_frame_markers.push_back(this_frame_marker);
|
||||
} else {
|
||||
LG << "Failed to track: " << this_frame_marker;
|
||||
}
|
||||
}
|
||||
// Put the markers from this frame
|
||||
previous_frame_markers.swap(this_frame_markers);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace mv
|
226
extern/libmv/libmv/autotrack/autotrack.h
vendored
226
extern/libmv/libmv/autotrack/autotrack.h
vendored
@@ -1,226 +0,0 @@
|
||||
// Copyright (c) 2014 libmv authors.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to
|
||||
// deal in the Software without restriction, including without limitation the
|
||||
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
// sell copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
// IN THE SOFTWARE.
|
||||
//
|
||||
// Author: mierle@gmail.com (Keir Mierle)
|
||||
|
||||
#ifndef LIBMV_AUTOTRACK_AUTOTRACK_H_
|
||||
#define LIBMV_AUTOTRACK_AUTOTRACK_H_
|
||||
|
||||
#include "libmv/autotrack/tracks.h"
|
||||
#include "libmv/autotrack/region.h"
|
||||
#include "libmv/tracking/track_region.h"
|
||||
|
||||
namespace libmv {
|
||||
class CameraIntrinsics;
|
||||
};
|
||||
|
||||
namespace mv {
|
||||
|
||||
using libmv::CameraIntrinsics;
|
||||
using libmv::TrackRegionOptions;
|
||||
using libmv::TrackRegionResult;
|
||||
|
||||
struct FrameAccessor;
|
||||
class OperationListener;
|
||||
|
||||
// The coordinator of all tracking operations; keeps track of all state
|
||||
// relating to tracking and reconstruction; for example, 2D tracks and motion
|
||||
// models, reconstructed cameras, points, and planes; tracking settings; etc.
|
||||
//
|
||||
// Typical usage for full autotrack:
|
||||
//
|
||||
// AutoTrack auto_track(image_accessor);
|
||||
// auto_track.SetNumFramesInClip(0, 10);
|
||||
// auto_track.SetNumFramesInClip(1, 54);
|
||||
// auto_track.AutoTrack()
|
||||
//
|
||||
// It is also possible to specify options to control the reconstruction.
|
||||
// Furthermore, the individual methods of reconstruction are exposed to make it
|
||||
// possible to interact with the pipeline as it runs. For example, to track one
|
||||
// marker across frames,
|
||||
//
|
||||
// AutoTrack auto_track(image_accessor);
|
||||
// auto_track.SetNumFramesInClip(0, 10);
|
||||
// auto_track.SetNumFramesInClip(1, 54);
|
||||
// auto_track.AddMarker(...);
|
||||
// auto_track.TrackMarkerToFrame(int clip1, int frame1,
|
||||
// int clip2, int frame2,
|
||||
// options?)
|
||||
//
|
||||
class AutoTrack {
|
||||
public:
|
||||
struct Options {
|
||||
// Default configuration for 2D tracking when calling TrackMarkerToFrame().
|
||||
TrackRegionOptions track_region;
|
||||
|
||||
// Default search window for region tracking, in absolute frame pixels.
|
||||
Region search_region;
|
||||
};
|
||||
|
||||
AutoTrack(FrameAccessor* frame_accessor)
|
||||
: frame_accessor_(frame_accessor) {}
|
||||
|
||||
// Marker manipulation.
|
||||
// Clip manipulation.
|
||||
|
||||
// Set the number of clips. These clips will get accessed from the frame
|
||||
// accessor, matches between frames found, and a reconstruction created.
|
||||
//void SetNumFrames(int clip, int num_frames);
|
||||
|
||||
// Tracking & Matching
|
||||
|
||||
// Find the marker for the track in the frame indicated by the marker.
|
||||
// Caller maintains ownership of *result and *tracked_marker.
|
||||
bool TrackMarker(Marker* tracked_marker,
|
||||
TrackRegionResult* result,
|
||||
const TrackRegionOptions* track_options=NULL);
|
||||
|
||||
// Wrapper around Tracks API; however these may add additional processing.
|
||||
void AddMarker(const Marker& tracked_marker);
|
||||
void SetMarkers(vector<Marker>* markers);
|
||||
bool GetMarker(int clip, int frame, int track, Marker* marker) const;
|
||||
|
||||
// TODO(keir): Implement frame matching! This could be very cool for loop
|
||||
// closing and connecting across clips.
|
||||
//void MatchFrames(int clip1, int frame1, int clip2, int frame2) {}
|
||||
|
||||
// Wrapper around the Reconstruction API.
|
||||
// Returns the new ID.
|
||||
int AddCameraIntrinsics(CameraIntrinsics* intrinsics) {
|
||||
(void) intrinsics;
|
||||
return 0;
|
||||
} // XXX
|
||||
int SetClipIntrinsics(int clip, int intrinsics) {
|
||||
(void) clip;
|
||||
(void) intrinsics;
|
||||
return 0;
|
||||
} // XXX
|
||||
|
||||
enum Motion {
|
||||
GENERAL_CAMERA_MOTION,
|
||||
TRIPOD_CAMERA_MOTION,
|
||||
};
|
||||
int SetClipMotion(int clip, Motion motion) {
|
||||
(void) clip;
|
||||
(void) motion;
|
||||
return 0;
|
||||
} // XXX
|
||||
|
||||
// Decide what to refine for the given intrinsics. bundle_options is from
|
||||
// bundle.h (e.g. BUNDLE_FOCAL_LENGTH | BUNDLE_RADIAL_K1).
|
||||
void SetIntrinsicsRefine(int intrinsics, int bundle_options) {
|
||||
(void) intrinsics;
|
||||
(void) bundle_options;
|
||||
} // XXX
|
||||
|
||||
// Keyframe read/write.
|
||||
struct ClipFrame {
|
||||
int clip;
|
||||
int frame;
|
||||
};
|
||||
const vector<ClipFrame>& keyframes() { return keyframes_; }
|
||||
void ClearKeyframes() { keyframes_.clear(); }
|
||||
void SetKeyframes(const vector<ClipFrame>& keyframes) {
|
||||
keyframes_ = keyframes;
|
||||
}
|
||||
|
||||
// What about reporting what happened? -- callbacks; maybe result struct.
|
||||
void Reconstruct();
|
||||
|
||||
// Detect and track in 2D.
|
||||
struct DetectAndTrackOptions {
|
||||
int min_num_features;
|
||||
};
|
||||
void DetectAndTrack(const DetectAndTrackOptions& options);
|
||||
|
||||
struct DetectFeaturesInFrameOptions {
|
||||
};
|
||||
void DetectFeaturesInFrame(int clip, int frame,
|
||||
const DetectFeaturesInFrameOptions* options=NULL) {
|
||||
(void) clip;
|
||||
(void) frame;
|
||||
(void) options;
|
||||
} // XXX
|
||||
|
||||
// Does not take ownership of the given listener, but keeps a reference to it.
|
||||
void AddListener(OperationListener* listener) {(void) listener;} // XXX
|
||||
|
||||
// Create the initial reconstruction,
|
||||
//void FindInitialReconstruction();
|
||||
|
||||
// State machine
|
||||
//
|
||||
// Question: Have explicit state? Or determine state from existing data?
|
||||
// Conclusion: Determine state from existing data.
|
||||
//
|
||||
// Preliminary state thoughts
|
||||
//
|
||||
// No tracks or markers
|
||||
// - Tracks empty.
|
||||
//
|
||||
// Initial tracks found
|
||||
// - All images have at least 5 tracks
|
||||
//
|
||||
// Ran RANSAC on tracks to mark inliers / outliers.
|
||||
// - All images have at least 8 "inlier" tracks
|
||||
//
|
||||
// Detector matching run to close loops and match across clips
|
||||
// - At least 5 matching tracks between clips
|
||||
//
|
||||
// Initial reconstruction found (2 frames)?
|
||||
// - There exists two cameras with intrinsics / extrinsics
|
||||
//
|
||||
// Preliminary reconstruction finished
|
||||
// - Poses for all frames in all clips estimated.
|
||||
//
|
||||
// Final reconstruction finished
|
||||
// - Final reconstruction bundle adjusted.
|
||||
|
||||
// For now, expose options directly. In the future this may change.
|
||||
Options options;
|
||||
|
||||
private:
|
||||
bool Log();
|
||||
bool Progress();
|
||||
bool Cancelled() { return false; }
|
||||
|
||||
Tracks tracks_; // May be normalized camera coordinates or raw pixels.
|
||||
//Reconstruction reconstruction_;
|
||||
|
||||
// TODO(keir): Add the motion models here.
|
||||
//vector<MotionModel> motion_models_;
|
||||
|
||||
// TODO(keir): Should num_clips and num_frames get moved to FrameAccessor?
|
||||
// TODO(keir): What about masking for clips and frames to prevent various
|
||||
// things like reconstruction or tracking from happening on certain frames?
|
||||
FrameAccessor* frame_accessor_;
|
||||
//int num_clips_;
|
||||
//vector<int> num_frames_; // Indexed by clip.
|
||||
|
||||
// The intrinsics for each clip, assuming each clip has fixed intrinsics.
|
||||
// TODO(keir): Decide what the semantics should be for varying focal length.
|
||||
vector<int> clip_intrinsics_;
|
||||
|
||||
vector<ClipFrame> keyframes_;
|
||||
};
|
||||
|
||||
} // namespace mv
|
||||
|
||||
#endif // LIBMV_AUTOTRACK_AUTOTRACK_H_
|
38
extern/libmv/libmv/autotrack/callbacks.h
vendored
38
extern/libmv/libmv/autotrack/callbacks.h
vendored
@@ -1,38 +0,0 @@
|
||||
// Copyright (c) 2014 libmv authors.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to
|
||||
// deal in the Software without restriction, including without limitation the
|
||||
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
// sell copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
// IN THE SOFTWARE.
|
||||
//
|
||||
// Author: mierle@gmail.com (Keir Mierle)
|
||||
|
||||
#ifndef LIBMV_AUTOTRACK_LISTENER_H_
|
||||
#define LIBMV_AUTOTRACK_LISTENER_H_
|
||||
|
||||
namespace mv {
|
||||
|
||||
struct OperationListener {
|
||||
// All hooks return true to continue or false to indicate the operation
|
||||
// should abort. Hooks should be thread safe (reentrant).
|
||||
virtual bool Log(const string& message) = 0;
|
||||
virtual bool Progress(double fraction) = 0;
|
||||
virtual bool Cancelled() = 0;
|
||||
};
|
||||
|
||||
} // namespace mv
|
||||
|
||||
#endif // LIBMV_AUTOTRACK_LISTENER_H_
|
86
extern/libmv/libmv/autotrack/frame_accessor.h
vendored
86
extern/libmv/libmv/autotrack/frame_accessor.h
vendored
@@ -1,86 +0,0 @@
|
||||
// Copyright (c) 2014 libmv authors.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to
|
||||
// deal in the Software without restriction, including without limitation the
|
||||
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
// sell copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
// IN THE SOFTWARE.
|
||||
//
|
||||
// Author: mierle@gmail.com (Keir Mierle)
|
||||
|
||||
#ifndef LIBMV_AUTOTRACK_FRAME_ACCESSOR_H_
|
||||
#define LIBMV_AUTOTRACK_FRAME_ACCESSOR_H_
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "libmv/image/image.h"
|
||||
|
||||
namespace mv {
|
||||
|
||||
struct Region;
|
||||
|
||||
using libmv::FloatImage;
|
||||
|
||||
// This is the abstraction to different sources of images that will be part of
|
||||
// a reconstruction. These may come from disk or they may come from Blender. In
|
||||
// most cases it's expected that the implementation provides some caching
|
||||
// otherwise performance will be terrible. Sometimes the images need to get
|
||||
// filtered, and this interface provides for that as well (and permits
|
||||
// implementations to cache filtered image pieces).
|
||||
struct FrameAccessor {
|
||||
struct Transform {
|
||||
virtual ~Transform() { }
|
||||
// The key should depend on the transform arguments. Must be non-zero.
|
||||
virtual int64_t key() const = 0;
|
||||
|
||||
// Apply the expected transform. Output is sized correctly already.
|
||||
// TODO(keir): What about blurs that need to access pixels outside the ROI?
|
||||
virtual void run(const FloatImage& input, FloatImage* output) const = 0;
|
||||
};
|
||||
|
||||
enum InputMode {
|
||||
MONO,
|
||||
RGBA
|
||||
};
|
||||
|
||||
typedef void* Key;
|
||||
|
||||
// Get a possibly-filtered version of a frame of a video. Downscale will
|
||||
// cause the input image to get downscaled by 2^downscale for pyramid access.
|
||||
// Region is always in original-image coordinates, and describes the
|
||||
// requested area. The transform describes an (optional) transform to apply
|
||||
// to the image before it is returned.
|
||||
//
|
||||
// When done with an image, you must call ReleaseImage with the returned key.
|
||||
virtual Key GetImage(int clip,
|
||||
int frame,
|
||||
InputMode input_mode,
|
||||
int downscale, // Downscale by 2^downscale.
|
||||
const Region* region, // Get full image if NULL.
|
||||
const Transform* transform, // May be NULL.
|
||||
FloatImage* destination) = 0;
|
||||
|
||||
// Releases an image from the frame accessor. Non-caching implementations may
|
||||
// free the image immediately; others may hold onto the image.
|
||||
virtual void ReleaseImage(Key) = 0;
|
||||
|
||||
virtual bool GetClipDimensions(int clip, int* width, int* height) = 0;
|
||||
virtual int NumClips() = 0;
|
||||
virtual int NumFrames(int clip) = 0;
|
||||
};
|
||||
|
||||
} // namespace libmv
|
||||
|
||||
#endif // LIBMV_AUTOTRACK_FRAME_ACCESSOR_H_
|
144
extern/libmv/libmv/autotrack/marker.h
vendored
144
extern/libmv/libmv/autotrack/marker.h
vendored
@@ -1,144 +0,0 @@
|
||||
// Copyright (c) 2014 libmv authors.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to
|
||||
// deal in the Software without restriction, including without limitation the
|
||||
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
// sell copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
// IN THE SOFTWARE.
|
||||
//
|
||||
// Author: mierle@gmail.com (Keir Mierle)
|
||||
|
||||
#ifndef LIBMV_AUTOTRACK_MARKER_H_
|
||||
#define LIBMV_AUTOTRACK_MARKER_H_
|
||||
|
||||
#include <ostream>
|
||||
|
||||
#include "libmv/autotrack/quad.h"
|
||||
#include "libmv/autotrack/region.h"
|
||||
#include "libmv/numeric/numeric.h"
|
||||
|
||||
namespace mv {
|
||||
|
||||
using libmv::Vec2f;
|
||||
|
||||
// A marker is the 2D location of a tracked region (quad) in an image.
|
||||
// Note that some of this information could be normalized by having a
|
||||
// collection of inter-connected structs. Instead the "fat Marker" design below
|
||||
// trades memory for data structure simplicity.
|
||||
struct Marker {
|
||||
int clip; // The clip this marker is from.
|
||||
int frame; // The frame within the clip this marker is from.
|
||||
int track; // The track this marker is from.
|
||||
|
||||
// The center of the marker in frame coordinates. This is typically, but not
|
||||
// always, the same as the center of the patch.
|
||||
Vec2f center;
|
||||
|
||||
// A frame-realtive quad defining the part of the image the marker covers.
|
||||
// For reference markers, the pixels in the patch are the tracking pattern.
|
||||
Quad2Df patch;
|
||||
|
||||
// Some markers are less certain than others; the weight determines the
|
||||
// amount this marker contributes to the error. 1.0 indicates normal
|
||||
// contribution; 0.0 indicates a zero-weight track (and will be omitted from
|
||||
// bundle adjustment).
|
||||
float weight;
|
||||
|
||||
enum Source {
|
||||
MANUAL, // The user placed this marker manually.
|
||||
DETECTED, // A keypoint detector found this point.
|
||||
TRACKED, // The tracking algorithm placed this marker.
|
||||
MATCHED, // A matching algorithm (e.g. SIFT or SURF or ORB) found this.
|
||||
PREDICTED, // A motion model predicted this marker. This is needed for
|
||||
// handling occlusions in some cases where an imaginary marker
|
||||
// is placed to keep camera motion smooth.
|
||||
};
|
||||
Source source;
|
||||
|
||||
// Markers may be inliers or outliers if the tracking fails; this allows
|
||||
// visualizing the markers in the image.
|
||||
enum Status {
|
||||
UNKNOWN,
|
||||
INLIER,
|
||||
OUTLIER
|
||||
};
|
||||
Status status;
|
||||
|
||||
// When doing correlation tracking, where to search in the current frame for
|
||||
// the pattern from the reference frame, in absolute frame coordinates.
|
||||
Region search_region;
|
||||
|
||||
// For tracked and matched markers, indicates what the reference was.
|
||||
int reference_clip;
|
||||
int reference_frame;
|
||||
|
||||
// Model related information for non-point tracks.
|
||||
//
|
||||
// Some tracks are on a larger object, such as a plane or a line or perhaps
|
||||
// another primitive (a rectangular prisim). This captures the information
|
||||
// needed to say that for example a collection of markers belongs to model #2
|
||||
// (and model #2 is a plane).
|
||||
enum ModelType {
|
||||
POINT,
|
||||
PLANE,
|
||||
LINE,
|
||||
CUBE
|
||||
};
|
||||
ModelType model_type;
|
||||
|
||||
// The model ID this track (e.g. the second model, which is a plane).
|
||||
int model_id;
|
||||
|
||||
// TODO(keir): Add a "int model_argument" to capture that e.g. a marker is on
|
||||
// the 3rd face of a cube.
|
||||
|
||||
enum Channel {
|
||||
CHANNEL_R = (1 << 0),
|
||||
CHANNEL_G = (1 << 1),
|
||||
CHANNEL_B = (1 << 2),
|
||||
};
|
||||
|
||||
// Channels from the original frame which this marker is unable to see.
|
||||
int disabled_channels;
|
||||
|
||||
// Offset everything (center, patch, search) by the given delta.
|
||||
template<typename T>
|
||||
void Offset(const T& offset) {
|
||||
center += offset.template cast<float>();
|
||||
patch.coordinates.rowwise() += offset.template cast<int>();
|
||||
search_region.Offset(offset);
|
||||
}
|
||||
|
||||
// Shift the center to the given new position (and patch, search).
|
||||
template<typename T>
|
||||
void SetPosition(const T& new_center) {
|
||||
Offset(new_center - center);
|
||||
}
|
||||
};
|
||||
|
||||
inline std::ostream& operator<<(std::ostream& out, const Marker& marker) {
|
||||
out << "{"
|
||||
<< marker.clip << ", "
|
||||
<< marker.frame << ", "
|
||||
<< marker.track << ", ("
|
||||
<< marker.center.x() << ", "
|
||||
<< marker.center.y() << ")"
|
||||
<< "}";
|
||||
return out;
|
||||
}
|
||||
|
||||
} // namespace mv
|
||||
|
||||
#endif // LIBMV_AUTOTRACK_MARKER_H_
|
44
extern/libmv/libmv/autotrack/model.h
vendored
44
extern/libmv/libmv/autotrack/model.h
vendored
@@ -1,44 +0,0 @@
|
||||
// Copyright (c) 2014 libmv authors.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to
|
||||
// deal in the Software without restriction, including without limitation the
|
||||
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
// sell copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
// IN THE SOFTWARE.
|
||||
//
|
||||
// Author: mierle@gmail.com (Keir Mierle)
|
||||
|
||||
#ifndef LIBMV_AUTOTRACK_MODEL_H_
|
||||
#define LIBMV_AUTOTRACK_MODEL_H_
|
||||
|
||||
#include "libmv/numeric/numeric.h"
|
||||
#include "libmv/autotrack/quad.h"
|
||||
|
||||
namespace mv {
|
||||
|
||||
struct Model {
|
||||
enum ModelType {
|
||||
POINT,
|
||||
PLANE,
|
||||
LINE,
|
||||
CUBE
|
||||
};
|
||||
|
||||
// ???
|
||||
};
|
||||
|
||||
} // namespace mv
|
||||
|
||||
#endif // LIBMV_AUTOTRACK_MODEL_H_
|
316
extern/libmv/libmv/autotrack/predict_tracks.cc
vendored
316
extern/libmv/libmv/autotrack/predict_tracks.cc
vendored
@@ -1,316 +0,0 @@
|
||||
// Copyright (c) 2014 libmv authors.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to
|
||||
// deal in the Software without restriction, including without limitation the
|
||||
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
// sell copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
// IN THE SOFTWARE.
|
||||
//
|
||||
// Author: mierle@gmail.com (Keir Mierle)
|
||||
|
||||
#include "libmv/autotrack/marker.h"
|
||||
#include "libmv/autotrack/predict_tracks.h"
|
||||
#include "libmv/autotrack/tracks.h"
|
||||
#include "libmv/base/vector.h"
|
||||
#include "libmv/logging/logging.h"
|
||||
#include "libmv/tracking/kalman_filter.h"
|
||||
|
||||
namespace mv {
|
||||
|
||||
namespace {
|
||||
|
||||
using libmv::vector;
|
||||
using libmv::Vec2;
|
||||
|
||||
// Implied time delta between steps. Set empirically by tweaking and seeing
|
||||
// what numbers did best at prediction.
|
||||
const double dt = 3.8;
|
||||
|
||||
// State transition matrix.
|
||||
|
||||
// The states for predicting a track are as follows:
|
||||
//
|
||||
// 0 - X position
|
||||
// 1 - X velocity
|
||||
// 2 - X acceleration
|
||||
// 3 - Y position
|
||||
// 4 - Y velocity
|
||||
// 5 - Y acceleration
|
||||
//
|
||||
// Note that in the velocity-only state transition matrix, the acceleration
|
||||
// component is ignored; so technically the system could be modelled with only
|
||||
// 4 states instead of 6. For ease of implementation, this keeps order 6.
|
||||
|
||||
// Choose one or the other model from below (velocity or acceleration).
|
||||
|
||||
// For a typical system having constant velocity. This gives smooth-appearing
|
||||
// predictions, but they are not always as accurate.
|
||||
const double velocity_state_transition_data[] = {
|
||||
1, dt, 0, 0, 0, 0,
|
||||
0, 1, 0, 0, 0, 0,
|
||||
0, 0, 1, 0, 0, 0,
|
||||
0, 0, 0, 1, dt, 0,
|
||||
0, 0, 0, 0, 1, 0,
|
||||
0, 0, 0, 0, 0, 1
|
||||
};
|
||||
|
||||
// This 3rd-order system also models acceleration. This makes for "jerky"
|
||||
// predictions, but that tend to be more accurate.
|
||||
const double acceleration_state_transition_data[] = {
|
||||
1, dt, dt*dt/2, 0, 0, 0,
|
||||
0, 1, dt, 0, 0, 0,
|
||||
0, 0, 1, 0, 0, 0,
|
||||
0, 0, 0, 1, dt, dt*dt/2,
|
||||
0, 0, 0, 0, 1, dt,
|
||||
0, 0, 0, 0, 0, 1
|
||||
};
|
||||
|
||||
// This system (attempts) to add an angular velocity component. However, it's
|
||||
// total junk.
|
||||
const double angular_state_transition_data[] = {
|
||||
1, dt, -dt, 0, 0, 0, // Position x
|
||||
0, 1, 0, 0, 0, 0, // Velocity x
|
||||
0, 0, 1, 0, 0, 0, // Angular momentum
|
||||
0, 0, dt, 1, dt, 0, // Position y
|
||||
0, 0, 0, 0, 1, 0, // Velocity y
|
||||
0, 0, 0, 0, 0, 1 // Ignored
|
||||
};
|
||||
|
||||
const double* state_transition_data = velocity_state_transition_data;
|
||||
|
||||
// Observation matrix.
|
||||
const double observation_data[] = {
|
||||
1., 0., 0., 0., 0., 0.,
|
||||
0., 0., 0., 1., 0., 0.
|
||||
};
|
||||
|
||||
// Process covariance.
|
||||
const double process_covariance_data[] = {
|
||||
35, 0, 0, 0, 0, 0,
|
||||
0, 5, 0, 0, 0, 0,
|
||||
0, 0, 5, 0, 0, 0,
|
||||
0, 0, 0, 35, 0, 0,
|
||||
0, 0, 0, 0, 5, 0,
|
||||
0, 0, 0, 0, 0, 5
|
||||
};
|
||||
|
||||
// Process covariance.
|
||||
const double measurement_covariance_data[] = {
|
||||
0.01, 0.00,
|
||||
0.00, 0.01,
|
||||
};
|
||||
|
||||
// Initial covariance.
|
||||
const double initial_covariance_data[] = {
|
||||
10, 0, 0, 0, 0, 0,
|
||||
0, 1, 0, 0, 0, 0,
|
||||
0, 0, 1, 0, 0, 0,
|
||||
0, 0, 0, 10, 0, 0,
|
||||
0, 0, 0, 0, 1, 0,
|
||||
0, 0, 0, 0, 0, 1
|
||||
};
|
||||
|
||||
typedef mv::KalmanFilter<double, 6, 2> TrackerKalman;
|
||||
|
||||
TrackerKalman filter(state_transition_data,
|
||||
observation_data,
|
||||
process_covariance_data,
|
||||
measurement_covariance_data);
|
||||
|
||||
bool OrderByFrameLessThan(const Marker* a, const Marker* b) {
|
||||
if (a->frame == b->frame) {
|
||||
if (a->clip == b->clip) {
|
||||
return a->track < b->track;
|
||||
}
|
||||
return a->clip < b->clip;
|
||||
}
|
||||
return a->frame < b-> frame;
|
||||
}
|
||||
|
||||
// Predicted must be after the previous markers (in the frame numbering sense).
|
||||
void RunPrediction(const vector<Marker*> previous_markers,
|
||||
Marker* predicted_marker) {
|
||||
TrackerKalman::State state;
|
||||
state.mean << previous_markers[0]->center.x(), 0, 0,
|
||||
previous_markers[0]->center.y(), 0, 0;
|
||||
state.covariance = Eigen::Matrix<double, 6, 6, Eigen::RowMajor>(
|
||||
initial_covariance_data);
|
||||
|
||||
int current_frame = previous_markers[0]->frame;
|
||||
int target_frame = predicted_marker->frame;
|
||||
|
||||
bool predict_forward = current_frame < target_frame;
|
||||
int frame_delta = predict_forward ? 1 : -1;
|
||||
|
||||
for (int i = 1; i < previous_markers.size(); ++i) {
|
||||
// Step forward predicting the state until it is on the current marker.
|
||||
int predictions = 0;
|
||||
for (;
|
||||
current_frame != previous_markers[i]->frame;
|
||||
current_frame += frame_delta) {
|
||||
filter.Step(&state);
|
||||
predictions++;
|
||||
LG << "Predicted point (frame " << current_frame << "): "
|
||||
<< state.mean(0) << ", " << state.mean(3);
|
||||
}
|
||||
// Log the error -- not actually used, but interesting.
|
||||
Vec2 error = previous_markers[i]->center.cast<double>() -
|
||||
Vec2(state.mean(0), state.mean(3));
|
||||
LG << "Prediction error for " << predictions << " steps: ("
|
||||
<< error.x() << ", " << error.y() << "); norm: " << error.norm();
|
||||
// Now that the state is predicted in the current frame, update the state
|
||||
// based on the measurement from the current frame.
|
||||
filter.Update(previous_markers[i]->center.cast<double>(),
|
||||
Eigen::Matrix<double, 2, 2, Eigen::RowMajor>(
|
||||
measurement_covariance_data),
|
||||
&state);
|
||||
LG << "Updated point: " << state.mean(0) << ", " << state.mean(3);
|
||||
}
|
||||
// At this point as all the prediction that's possible is done. Finally
|
||||
// predict until the target frame.
|
||||
for (; current_frame != target_frame; current_frame += frame_delta) {
|
||||
filter.Step(&state);
|
||||
LG << "Final predicted point (frame " << current_frame << "): "
|
||||
<< state.mean(0) << ", " << state.mean(3);
|
||||
}
|
||||
|
||||
// The x and y positions are at 0 and 3; ignore acceleration and velocity.
|
||||
predicted_marker->center.x() = state.mean(0);
|
||||
predicted_marker->center.y() = state.mean(3);
|
||||
|
||||
// Take the patch from the last marker then shift it to match the prediction.
|
||||
const Marker& last_marker = *previous_markers[previous_markers.size() - 1];
|
||||
predicted_marker->patch = last_marker.patch;
|
||||
Vec2f delta = predicted_marker->center - last_marker.center;
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
predicted_marker->patch.coordinates.row(i) += delta;
|
||||
}
|
||||
|
||||
// Alter the search area as well so it always corresponds to the center.
|
||||
predicted_marker->search_region = last_marker.search_region;
|
||||
predicted_marker->search_region.Offset(delta);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
bool PredictMarkerPosition(const Tracks& tracks, Marker* marker) {
|
||||
// Get all markers for this clip and track.
|
||||
vector<Marker> markers;
|
||||
tracks.GetMarkersForTrackInClip(marker->clip, marker->track, &markers);
|
||||
|
||||
if (markers.empty()) {
|
||||
LG << "No markers to predict from for " << *marker;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Order the markers by frame within the clip.
|
||||
vector<Marker*> boxed_markers(markers.size());
|
||||
for (int i = 0; i < markers.size(); ++i) {
|
||||
boxed_markers[i] = &markers[i];
|
||||
}
|
||||
std::sort(boxed_markers.begin(), boxed_markers.end(), OrderByFrameLessThan);
|
||||
|
||||
// Find the insertion point for this marker among the returned ones.
|
||||
int insert_at = -1; // If we find the exact frame
|
||||
int insert_before = -1; // Otherwise...
|
||||
for (int i = 0; i < boxed_markers.size(); ++i) {
|
||||
if (boxed_markers[i]->frame == marker->frame) {
|
||||
insert_at = i;
|
||||
break;
|
||||
}
|
||||
if (boxed_markers[i]->frame > marker->frame) {
|
||||
insert_before = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Forward starts at the marker or insertion point, and goes forward.
|
||||
int forward_scan_begin, forward_scan_end;
|
||||
|
||||
// Backward scan starts at the marker or insertion point, and goes backward.
|
||||
int backward_scan_begin, backward_scan_end;
|
||||
|
||||
// Determine the scanning ranges.
|
||||
if (insert_at == -1 && insert_before == -1) {
|
||||
// Didn't find an insertion point except the end.
|
||||
forward_scan_begin = forward_scan_end = 0;
|
||||
backward_scan_begin = markers.size() - 1;
|
||||
backward_scan_end = 0;
|
||||
} else if (insert_at != -1) {
|
||||
// Found existing marker; scan before and after it.
|
||||
forward_scan_begin = insert_at + 1;
|
||||
forward_scan_end = markers.size() - 1;;
|
||||
backward_scan_begin = insert_at - 1;
|
||||
backward_scan_end = 0;
|
||||
} else {
|
||||
// Didn't find existing marker but found an insertion point.
|
||||
forward_scan_begin = insert_before;
|
||||
forward_scan_end = markers.size() - 1;;
|
||||
backward_scan_begin = insert_before - 1;
|
||||
backward_scan_end = 0;
|
||||
}
|
||||
|
||||
const int num_consecutive_needed = 2;
|
||||
|
||||
if (forward_scan_begin <= forward_scan_end &&
|
||||
forward_scan_end - forward_scan_begin > num_consecutive_needed) {
|
||||
// TODO(keir): Finish this.
|
||||
}
|
||||
|
||||
bool predict_forward = false;
|
||||
if (backward_scan_end <= backward_scan_begin) {
|
||||
// TODO(keir): Add smarter handling and detecting of consecutive frames!
|
||||
predict_forward = true;
|
||||
}
|
||||
|
||||
const int max_frames_to_predict_from = 20;
|
||||
if (predict_forward) {
|
||||
if (backward_scan_begin - backward_scan_end < num_consecutive_needed) {
|
||||
// Not enough information to do a prediction.
|
||||
LG << "Predicting forward impossible, not enough information";
|
||||
return false;
|
||||
}
|
||||
LG << "Predicting forward";
|
||||
int predict_begin =
|
||||
std::max(backward_scan_begin - max_frames_to_predict_from, 0);
|
||||
int predict_end = backward_scan_begin;
|
||||
vector<Marker*> previous_markers;
|
||||
for (int i = predict_begin; i <= predict_end; ++i) {
|
||||
previous_markers.push_back(boxed_markers[i]);
|
||||
}
|
||||
RunPrediction(previous_markers, marker);
|
||||
return true;
|
||||
} else {
|
||||
if (forward_scan_end - forward_scan_begin < num_consecutive_needed) {
|
||||
// Not enough information to do a prediction.
|
||||
LG << "Predicting backward impossible, not enough information";
|
||||
return false;
|
||||
}
|
||||
LG << "Predicting backward";
|
||||
int predict_begin =
|
||||
std::min(forward_scan_begin + max_frames_to_predict_from,
|
||||
forward_scan_end);
|
||||
int predict_end = forward_scan_begin;
|
||||
vector<Marker*> previous_markers;
|
||||
for (int i = predict_begin; i >= predict_end; --i) {
|
||||
previous_markers.push_back(boxed_markers[i]);
|
||||
}
|
||||
RunPrediction(previous_markers, marker);
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} // namespace mv
|
37
extern/libmv/libmv/autotrack/predict_tracks.h
vendored
37
extern/libmv/libmv/autotrack/predict_tracks.h
vendored
@@ -1,37 +0,0 @@
|
||||
// Copyright (c) 2014 libmv authors.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to
|
||||
// deal in the Software without restriction, including without limitation the
|
||||
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
// sell copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
// IN THE SOFTWARE.
|
||||
//
|
||||
// Author: mierle@gmail.com (Keir Mierle)
|
||||
|
||||
#ifndef LIBMV_AUTOTRACK_PREDICT_TRACKS_H_
|
||||
#define LIBMV_AUTOTRACK_PREDICT_TRACKS_H_
|
||||
|
||||
namespace mv {
|
||||
|
||||
class Tracks;
|
||||
struct Marker;
|
||||
|
||||
// Predict the position of the given marker, and update it accordingly. The
|
||||
// existing position will be overwritten.
|
||||
bool PredictMarkerPosition(const Tracks& tracks, Marker* marker);
|
||||
|
||||
} // namespace mv
|
||||
|
||||
#endif // LIBMV_AUTOTRACK_PREDICT_TRACKS_H_
|
201
extern/libmv/libmv/autotrack/predict_tracks_test.cc
vendored
201
extern/libmv/libmv/autotrack/predict_tracks_test.cc
vendored
@@ -1,201 +0,0 @@
|
||||
// Copyright (c) 2014 libmv authors.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to
|
||||
// deal in the Software without restriction, including without limitation the
|
||||
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
// sell copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
// IN THE SOFTWARE.
|
||||
//
|
||||
// Author: mierle@gmail.com (Keir Mierle)
|
||||
|
||||
#include "libmv/autotrack/predict_tracks.h"
|
||||
|
||||
#include "libmv/autotrack/marker.h"
|
||||
#include "libmv/autotrack/tracks.h"
|
||||
#include "libmv/logging/logging.h"
|
||||
#include "testing/testing.h"
|
||||
|
||||
namespace mv {
|
||||
|
||||
void AddMarker(int frame, float x, float y, Tracks* tracks) {
|
||||
Marker marker;
|
||||
marker.clip = marker.track = 0;
|
||||
marker.frame = frame;
|
||||
marker.center.x() = x;
|
||||
marker.center.y() = y;
|
||||
marker.patch.coordinates << x - 1, y - 1,
|
||||
x + 1, y - 1,
|
||||
x + 1, y + 1,
|
||||
x - 1, y + 1;
|
||||
tracks->AddMarker(marker);
|
||||
}
|
||||
|
||||
TEST(PredictMarkerPosition, EasyLinearMotion) {
|
||||
Tracks tracks;
|
||||
AddMarker(0, 1.0, 0.0, &tracks);
|
||||
AddMarker(1, 2.0, 5.0, &tracks);
|
||||
AddMarker(2, 3.0, 10.0, &tracks);
|
||||
AddMarker(3, 4.0, 15.0, &tracks);
|
||||
AddMarker(4, 5.0, 20.0, &tracks);
|
||||
AddMarker(5, 6.0, 25.0, &tracks);
|
||||
AddMarker(6, 7.0, 30.0, &tracks);
|
||||
AddMarker(7, 8.0, 35.0, &tracks);
|
||||
|
||||
Marker predicted;
|
||||
predicted.clip = 0;
|
||||
predicted.track = 0;
|
||||
predicted.frame = 8;
|
||||
|
||||
PredictMarkerPosition(tracks, &predicted);
|
||||
double error = (libmv::Vec2f(9.0, 40.0) - predicted.center).norm();
|
||||
LG << "Got error: " << error;
|
||||
EXPECT_LT(error, 0.1);
|
||||
|
||||
// Check the patch coordinates as well.
|
||||
double x = 9, y = 40.0;
|
||||
Quad2Df expected_patch;
|
||||
expected_patch.coordinates << x - 1, y - 1,
|
||||
x + 1, y - 1,
|
||||
x + 1, y + 1,
|
||||
x - 1, y + 1;
|
||||
|
||||
error = (expected_patch.coordinates - predicted.patch.coordinates).norm();
|
||||
LG << "Patch error: " << error;
|
||||
EXPECT_LT(error, 0.1);
|
||||
}
|
||||
|
||||
TEST(PredictMarkerPosition, EasyBackwardLinearMotion) {
|
||||
Tracks tracks;
|
||||
AddMarker(8, 1.0, 0.0, &tracks);
|
||||
AddMarker(7, 2.0, 5.0, &tracks);
|
||||
AddMarker(6, 3.0, 10.0, &tracks);
|
||||
AddMarker(5, 4.0, 15.0, &tracks);
|
||||
AddMarker(4, 5.0, 20.0, &tracks);
|
||||
AddMarker(3, 6.0, 25.0, &tracks);
|
||||
AddMarker(2, 7.0, 30.0, &tracks);
|
||||
AddMarker(1, 8.0, 35.0, &tracks);
|
||||
|
||||
Marker predicted;
|
||||
predicted.clip = 0;
|
||||
predicted.track = 0;
|
||||
predicted.frame = 0;
|
||||
|
||||
PredictMarkerPosition(tracks, &predicted);
|
||||
LG << predicted;
|
||||
double error = (libmv::Vec2f(9.0, 40.0) - predicted.center).norm();
|
||||
LG << "Got error: " << error;
|
||||
EXPECT_LT(error, 0.1);
|
||||
|
||||
// Check the patch coordinates as well.
|
||||
double x = 9.0, y = 40.0;
|
||||
Quad2Df expected_patch;
|
||||
expected_patch.coordinates << x - 1, y - 1,
|
||||
x + 1, y - 1,
|
||||
x + 1, y + 1,
|
||||
x - 1, y + 1;
|
||||
|
||||
error = (expected_patch.coordinates - predicted.patch.coordinates).norm();
|
||||
LG << "Patch error: " << error;
|
||||
EXPECT_LT(error, 0.1);
|
||||
}
|
||||
|
||||
TEST(PredictMarkerPosition, TwoFrameGap) {
|
||||
Tracks tracks;
|
||||
AddMarker(0, 1.0, 0.0, &tracks);
|
||||
AddMarker(1, 2.0, 5.0, &tracks);
|
||||
AddMarker(2, 3.0, 10.0, &tracks);
|
||||
AddMarker(3, 4.0, 15.0, &tracks);
|
||||
AddMarker(4, 5.0, 20.0, &tracks);
|
||||
AddMarker(5, 6.0, 25.0, &tracks);
|
||||
AddMarker(6, 7.0, 30.0, &tracks);
|
||||
// Missing frame 7!
|
||||
|
||||
Marker predicted;
|
||||
predicted.clip = 0;
|
||||
predicted.track = 0;
|
||||
predicted.frame = 8;
|
||||
|
||||
PredictMarkerPosition(tracks, &predicted);
|
||||
double error = (libmv::Vec2f(9.0, 40.0) - predicted.center).norm();
|
||||
LG << "Got error: " << error;
|
||||
EXPECT_LT(error, 0.1);
|
||||
}
|
||||
|
||||
TEST(PredictMarkerPosition, FourFrameGap) {
|
||||
Tracks tracks;
|
||||
AddMarker(0, 1.0, 0.0, &tracks);
|
||||
AddMarker(1, 2.0, 5.0, &tracks);
|
||||
AddMarker(2, 3.0, 10.0, &tracks);
|
||||
AddMarker(3, 4.0, 15.0, &tracks);
|
||||
// Missing frames 4, 5, 6, 7.
|
||||
|
||||
Marker predicted;
|
||||
predicted.clip = 0;
|
||||
predicted.track = 0;
|
||||
predicted.frame = 8;
|
||||
|
||||
PredictMarkerPosition(tracks, &predicted);
|
||||
double error = (libmv::Vec2f(9.0, 40.0) - predicted.center).norm();
|
||||
LG << "Got error: " << error;
|
||||
EXPECT_LT(error, 2.0); // Generous error due to larger prediction window.
|
||||
}
|
||||
|
||||
TEST(PredictMarkerPosition, MultipleGaps) {
|
||||
Tracks tracks;
|
||||
AddMarker(0, 1.0, 0.0, &tracks);
|
||||
AddMarker(1, 2.0, 5.0, &tracks);
|
||||
AddMarker(2, 3.0, 10.0, &tracks);
|
||||
// AddMarker(3, 4.0, 15.0, &tracks); // Note the 3-frame gap.
|
||||
// AddMarker(4, 5.0, 20.0, &tracks);
|
||||
// AddMarker(5, 6.0, 25.0, &tracks);
|
||||
AddMarker(6, 7.0, 30.0, &tracks); // Intermediate measurement.
|
||||
// AddMarker(7, 8.0, 35.0, &tracks);
|
||||
|
||||
Marker predicted;
|
||||
predicted.clip = 0;
|
||||
predicted.track = 0;
|
||||
predicted.frame = 8;
|
||||
|
||||
PredictMarkerPosition(tracks, &predicted);
|
||||
double error = (libmv::Vec2f(9.0, 40.0) - predicted.center).norm();
|
||||
LG << "Got error: " << error;
|
||||
EXPECT_LT(error, 1.0); // Generous error due to larger prediction window.
|
||||
}
|
||||
|
||||
TEST(PredictMarkerPosition, MarkersInRandomOrder) {
|
||||
Tracks tracks;
|
||||
|
||||
// This is the same as the easy, except that the tracks are randomly ordered.
|
||||
AddMarker(0, 1.0, 0.0, &tracks);
|
||||
AddMarker(2, 3.0, 10.0, &tracks);
|
||||
AddMarker(7, 8.0, 35.0, &tracks);
|
||||
AddMarker(5, 6.0, 25.0, &tracks);
|
||||
AddMarker(4, 5.0, 20.0, &tracks);
|
||||
AddMarker(3, 4.0, 15.0, &tracks);
|
||||
AddMarker(6, 7.0, 30.0, &tracks);
|
||||
AddMarker(1, 2.0, 5.0, &tracks);
|
||||
|
||||
Marker predicted;
|
||||
predicted.clip = 0;
|
||||
predicted.track = 0;
|
||||
predicted.frame = 8;
|
||||
|
||||
PredictMarkerPosition(tracks, &predicted);
|
||||
double error = (libmv::Vec2f(9.0, 40.0) - predicted.center).norm();
|
||||
LG << "Got error: " << error;
|
||||
EXPECT_LT(error, 0.1);
|
||||
}
|
||||
|
||||
} // namespace mv
|
57
extern/libmv/libmv/autotrack/quad.h
vendored
57
extern/libmv/libmv/autotrack/quad.h
vendored
@@ -1,57 +0,0 @@
|
||||
// Copyright (c) 2014 libmv authors.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to
|
||||
// deal in the Software without restriction, including without limitation the
|
||||
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
// sell copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
// IN THE SOFTWARE.
|
||||
//
|
||||
// Author: mierle@gmail.com (Keir Mierle)
|
||||
|
||||
#ifndef LIBMV_AUTOTRACK_QUAD_H_
|
||||
#define LIBMV_AUTOTRACK_QUAD_H_
|
||||
|
||||
#include <Eigen/Core>
|
||||
|
||||
namespace mv {
|
||||
|
||||
template<typename T, int D>
|
||||
struct Quad {
|
||||
// A quad is 4 points; generally in 2D or 3D.
|
||||
//
|
||||
// +----------> x
|
||||
// |\.
|
||||
// | \.
|
||||
// | z (z goes into screen)
|
||||
// |
|
||||
// | r0----->r1
|
||||
// | ^ |
|
||||
// | | . |
|
||||
// | | V
|
||||
// | r3<-----r2
|
||||
// | \.
|
||||
// | \.
|
||||
// v normal goes away (right handed).
|
||||
// y
|
||||
//
|
||||
// Each row is one of the corners coordinates; either (x, y) or (x, y, z).
|
||||
Eigen::Matrix<T, 4, D> coordinates;
|
||||
};
|
||||
|
||||
typedef Quad<float, 2> Quad2Df;
|
||||
|
||||
} // namespace mv
|
||||
|
||||
#endif // LIBMV_AUTOTRACK_QUAD_H_
|
89
extern/libmv/libmv/autotrack/reconstruction.h
vendored
89
extern/libmv/libmv/autotrack/reconstruction.h
vendored
@@ -1,89 +0,0 @@
|
||||
// Copyright (c) 2014 libmv authors.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to
|
||||
// deal in the Software without restriction, including without limitation the
|
||||
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
// sell copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
// IN THE SOFTWARE.
|
||||
//
|
||||
// Author: mierle@gmail.com (Keir Mierle)
|
||||
|
||||
#ifndef LIBMV_AUTOTRACK_RECONSTRUCTION_H_
|
||||
#define LIBMV_AUTOTRACK_RECONSTRUCTION_H_
|
||||
|
||||
#include "libmv/base/vector.h"
|
||||
#include "libmv/numeric/numeric.h"
|
||||
#include "libmv/simple_pipeline/camera_intrinsics.h"
|
||||
|
||||
namespace mv {
|
||||
|
||||
using libmv::CameraIntrinsics;
|
||||
using libmv::vector;
|
||||
|
||||
class Model;
|
||||
|
||||
class CameraPose {
|
||||
int clip;
|
||||
int frame;
|
||||
int intrinsics;
|
||||
Mat3 R;
|
||||
Vec3 t;
|
||||
};
|
||||
|
||||
class Point {
|
||||
int track;
|
||||
|
||||
// The coordinates of the point. Note that not all coordinates are always
|
||||
// used; for example points on a plane only use the first two coordinates.
|
||||
Vec3 X;
|
||||
};
|
||||
|
||||
// A reconstruction for a set of tracks. The indexing for clip, frame, and
|
||||
// track should match that of a Tracs object, stored elsewhere.
|
||||
class Reconstruction {
|
||||
public:
|
||||
// All methods copy their input reference or take ownership of the pointer.
|
||||
void AddCameraPose(const CameraPose& pose);
|
||||
int AddCameraIntrinsics(CameraIntrinsics* intrinsics);
|
||||
int AddPoint(const Point& point);
|
||||
int AddModel(Model* model);
|
||||
|
||||
// Returns the corresponding pose or point or NULL if missing.
|
||||
CameraPose* CameraPoseForFrame(int clip, int frame);
|
||||
const CameraPose* CameraPoseForFrame(int clip, int frame) const;
|
||||
Point* PointForTrack(int track);
|
||||
const Point* PointForTrack(int track) const;
|
||||
|
||||
const vector<vector<CameraPose> >& camera_poses() const {
|
||||
return camera_poses_;
|
||||
}
|
||||
|
||||
private:
|
||||
// Indexed by CameraPose::intrinsics. Owns the intrinsics objects.
|
||||
vector<CameraIntrinsics*> camera_intrinsics_;
|
||||
|
||||
// Indexed by Marker::clip then by Marker::frame.
|
||||
vector<vector<CameraPose> > camera_poses_;
|
||||
|
||||
// Indexed by Marker::track.
|
||||
vector<Point> points_;
|
||||
|
||||
// Indexed by Marker::model_id. Owns model objects.
|
||||
vector<Model*> models_;
|
||||
};
|
||||
|
||||
} // namespace mv
|
||||
|
||||
#endif // LIBMV_AUTOTRACK_RECONSTRUCTION_H_
|
67
extern/libmv/libmv/autotrack/region.h
vendored
67
extern/libmv/libmv/autotrack/region.h
vendored
@@ -1,67 +0,0 @@
|
||||
// Copyright (c) 2014 libmv authors.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to
|
||||
// deal in the Software without restriction, including without limitation the
|
||||
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
// sell copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
// IN THE SOFTWARE.
|
||||
//
|
||||
// Author: mierle@gmail.com (Keir Mierle)
|
||||
|
||||
#ifndef LIBMV_AUTOTRACK_REGION_H_
|
||||
#define LIBMV_AUTOTRACK_REGION_H_
|
||||
|
||||
#include "libmv/numeric/numeric.h"
|
||||
|
||||
namespace mv {
|
||||
|
||||
using libmv::Vec2f;
|
||||
|
||||
// A region is a bounding box within an image.
|
||||
//
|
||||
// +----------> x
|
||||
// |
|
||||
// | (min.x, min.y) (max.x, min.y)
|
||||
// | +-------------------------+
|
||||
// | | |
|
||||
// | | |
|
||||
// | | |
|
||||
// | +-------------------------+
|
||||
// v (min.x, max.y) (max.x, max.y)
|
||||
// y
|
||||
//
|
||||
struct Region {
|
||||
Vec2f min;
|
||||
Vec2f max;
|
||||
|
||||
template<typename T>
|
||||
void Offset(const T& offset) {
|
||||
min += offset.template cast<float>();
|
||||
max += offset.template cast<float>();
|
||||
}
|
||||
|
||||
Region Rounded() const {
|
||||
Region result;
|
||||
result.min(0) = ceil(this->min(0));
|
||||
result.min(1) = ceil(this->min(1));
|
||||
result.max(0) = ceil(this->max(0));
|
||||
result.max(1) = ceil(this->max(1));
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace mv
|
||||
|
||||
#endif // LIBMV_AUTOTRACK_REGION_H_
|
193
extern/libmv/libmv/autotrack/tracks.cc
vendored
193
extern/libmv/libmv/autotrack/tracks.cc
vendored
@@ -1,193 +0,0 @@
|
||||
// Copyright (c) 2014 libmv authors.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to
|
||||
// deal in the Software without restriction, including without limitation the
|
||||
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
// sell copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
// IN THE SOFTWARE.
|
||||
//
|
||||
// Author: mierle@gmail.com (Keir Mierle)
|
||||
|
||||
#include "libmv/autotrack/tracks.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <vector>
|
||||
#include <iterator>
|
||||
|
||||
#include "libmv/numeric/numeric.h"
|
||||
|
||||
namespace mv {
|
||||
|
||||
Tracks::Tracks(const Tracks& other) {
|
||||
markers_ = other.markers_;
|
||||
}
|
||||
|
||||
Tracks::Tracks(const vector<Marker>& markers) : markers_(markers) {}
|
||||
|
||||
bool Tracks::GetMarker(int clip, int frame, int track, Marker* marker) const {
|
||||
for (int i = 0; i < markers_.size(); ++i) {
|
||||
if (markers_[i].clip == clip &&
|
||||
markers_[i].frame == frame &&
|
||||
markers_[i].track == track) {
|
||||
*marker = markers_[i];
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void Tracks::GetMarkersForTrack(int track, vector<Marker>* markers) const {
|
||||
for (int i = 0; i < markers_.size(); ++i) {
|
||||
if (track == markers_[i].track) {
|
||||
markers->push_back(markers_[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Tracks::GetMarkersForTrackInClip(int clip,
|
||||
int track,
|
||||
vector<Marker>* markers) const {
|
||||
for (int i = 0; i < markers_.size(); ++i) {
|
||||
if (clip == markers_[i].clip &&
|
||||
track == markers_[i].track) {
|
||||
markers->push_back(markers_[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Tracks::GetMarkersInFrame(int clip,
|
||||
int frame,
|
||||
vector<Marker>* markers) const {
|
||||
for (int i = 0; i < markers_.size(); ++i) {
|
||||
if (markers_[i].clip == clip &&
|
||||
markers_[i].frame == frame) {
|
||||
markers->push_back(markers_[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Tracks::GetMarkersForTracksInBothImages(int clip1, int frame1,
|
||||
int clip2, int frame2,
|
||||
vector<Marker>* markers) const {
|
||||
std::vector<int> image1_tracks;
|
||||
std::vector<int> image2_tracks;
|
||||
|
||||
// Collect the tracks in each of the two images.
|
||||
for (int i = 0; i < markers_.size(); ++i) {
|
||||
int clip = markers_[i].clip;
|
||||
int frame = markers_[i].frame;
|
||||
if (clip == clip1 && frame == frame1) {
|
||||
image1_tracks.push_back(markers_[i].track);
|
||||
} else if (clip == clip2 && frame == frame2) {
|
||||
image2_tracks.push_back(markers_[i].track);
|
||||
}
|
||||
}
|
||||
|
||||
// Intersect the two sets to find the tracks of interest.
|
||||
std::sort(image1_tracks.begin(), image1_tracks.end());
|
||||
std::sort(image2_tracks.begin(), image2_tracks.end());
|
||||
std::vector<int> intersection;
|
||||
std::set_intersection(image1_tracks.begin(), image1_tracks.end(),
|
||||
image2_tracks.begin(), image2_tracks.end(),
|
||||
std::back_inserter(intersection));
|
||||
|
||||
// Scan through and get the relevant tracks from the two images.
|
||||
for (int i = 0; i < markers_.size(); ++i) {
|
||||
// Save markers that are in either frame and are in our candidate set.
|
||||
if (((markers_[i].clip == clip1 &&
|
||||
markers_[i].frame == frame1) ||
|
||||
(markers_[i].clip == clip2 &&
|
||||
markers_[i].frame == frame2)) &&
|
||||
std::binary_search(intersection.begin(),
|
||||
intersection.end(),
|
||||
markers_[i].track)) {
|
||||
markers->push_back(markers_[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Tracks::AddMarker(const Marker& marker) {
|
||||
// TODO(keir): This is quadratic for repeated insertions. Fix this by adding
|
||||
// a smarter data structure like a set<>.
|
||||
for (int i = 0; i < markers_.size(); ++i) {
|
||||
if (markers_[i].clip == marker.clip &&
|
||||
markers_[i].frame == marker.frame &&
|
||||
markers_[i].track == marker.track) {
|
||||
markers_[i] = marker;
|
||||
return;
|
||||
}
|
||||
}
|
||||
markers_.push_back(marker);
|
||||
}
|
||||
|
||||
void Tracks::SetMarkers(vector<Marker>* markers) {
|
||||
std::swap(markers_, *markers);
|
||||
}
|
||||
|
||||
bool Tracks::RemoveMarker(int clip, int frame, int track) {
|
||||
int size = markers_.size();
|
||||
for (int i = 0; i < markers_.size(); ++i) {
|
||||
if (markers_[i].clip == clip &&
|
||||
markers_[i].frame == frame &&
|
||||
markers_[i].track == track) {
|
||||
markers_[i] = markers_[size - 1];
|
||||
markers_.resize(size - 1);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void Tracks::RemoveMarkersForTrack(int track) {
|
||||
int size = 0;
|
||||
for (int i = 0; i < markers_.size(); ++i) {
|
||||
if (markers_[i].track != track) {
|
||||
markers_[size++] = markers_[i];
|
||||
}
|
||||
}
|
||||
markers_.resize(size);
|
||||
}
|
||||
|
||||
int Tracks::MaxClip() const {
|
||||
int max_clip = 0;
|
||||
for (int i = 0; i < markers_.size(); ++i) {
|
||||
max_clip = std::max(markers_[i].clip, max_clip);
|
||||
}
|
||||
return max_clip;
|
||||
}
|
||||
|
||||
int Tracks::MaxFrame(int clip) const {
|
||||
int max_frame = 0;
|
||||
for (int i = 0; i < markers_.size(); ++i) {
|
||||
if (markers_[i].clip == clip) {
|
||||
max_frame = std::max(markers_[i].frame, max_frame);
|
||||
}
|
||||
}
|
||||
return max_frame;
|
||||
}
|
||||
|
||||
int Tracks::MaxTrack() const {
|
||||
int max_track = 0;
|
||||
for (int i = 0; i < markers_.size(); ++i) {
|
||||
max_track = std::max(markers_[i].track, max_track);
|
||||
}
|
||||
return max_track;
|
||||
}
|
||||
|
||||
int Tracks::NumMarkers() const {
|
||||
return markers_.size();
|
||||
}
|
||||
|
||||
} // namespace mv
|
82
extern/libmv/libmv/autotrack/tracks.h
vendored
82
extern/libmv/libmv/autotrack/tracks.h
vendored
@@ -1,82 +0,0 @@
|
||||
// Copyright (c) 2014 libmv authors.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to
|
||||
// deal in the Software without restriction, including without limitation the
|
||||
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
// sell copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
// IN THE SOFTWARE.
|
||||
//
|
||||
// Author: mierle@gmail.com (Keir Mierle)
|
||||
|
||||
#ifndef LIBMV_AUTOTRACK_TRACKS_H_
|
||||
#define LIBMV_AUTOTRACK_TRACKS_H_
|
||||
|
||||
#include "libmv/base/vector.h"
|
||||
#include "libmv/autotrack/marker.h"
|
||||
|
||||
namespace mv {
|
||||
|
||||
using libmv::vector;
|
||||
|
||||
// The Tracks container stores correspondences between frames.
|
||||
class Tracks {
|
||||
public:
|
||||
Tracks() { }
|
||||
Tracks(const Tracks &other);
|
||||
|
||||
// Create a tracks object with markers already initialized. Copies markers.
|
||||
explicit Tracks(const vector<Marker>& markers);
|
||||
|
||||
// All getters append to the output argument vector.
|
||||
bool GetMarker(int clip, int frame, int track, Marker* marker) const;
|
||||
void GetMarkersForTrack(int track, vector<Marker>* markers) const;
|
||||
void GetMarkersForTrackInClip(int clip,
|
||||
int track,
|
||||
vector<Marker>* markers) const;
|
||||
void GetMarkersInFrame(int clip, int frame, vector<Marker>* markers) const;
|
||||
|
||||
// Get the markers in frame1 and frame2 which have a common track.
|
||||
//
|
||||
// This is not the same as the union of the markers in frame1 and
|
||||
// frame2; each marker is for a track that appears in both images.
|
||||
void GetMarkersForTracksInBothImages(int clip1, int frame1,
|
||||
int clip2, int frame2,
|
||||
vector<Marker>* markers) const;
|
||||
|
||||
void AddMarker(const Marker& marker);
|
||||
|
||||
// Moves the contents of *markers over top of the existing markers. This
|
||||
// destroys *markers in the process (but avoids copies).
|
||||
void SetMarkers(vector<Marker>* markers);
|
||||
bool RemoveMarker(int clip, int frame, int track);
|
||||
void RemoveMarkersForTrack(int track);
|
||||
|
||||
int MaxClip() const;
|
||||
int MaxFrame(int clip) const;
|
||||
int MaxTrack() const;
|
||||
int NumMarkers() const;
|
||||
|
||||
const vector<Marker>& markers() const { return markers_; }
|
||||
|
||||
private:
|
||||
vector<Marker> markers_;
|
||||
|
||||
// TODO(keir): Consider adding access-map data structures to avoid all the
|
||||
// linear lookup penalties for the accessors.
|
||||
};
|
||||
|
||||
} // namespace mv
|
||||
|
||||
#endif // LIBMV_AUTOTRACK_TRACKS_H_
|
52
extern/libmv/libmv/autotrack/tracks_test.cc
vendored
52
extern/libmv/libmv/autotrack/tracks_test.cc
vendored
@@ -1,52 +0,0 @@
|
||||
// Copyright (c) 2014 libmv authors.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to
|
||||
// deal in the Software without restriction, including without limitation the
|
||||
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
// sell copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
// IN THE SOFTWARE.
|
||||
//
|
||||
// Author: mierle@gmail.com (Keir Mierle)
|
||||
|
||||
#include "libmv/autotrack/tracks.h"
|
||||
|
||||
#include "testing/testing.h"
|
||||
#include "libmv/logging/logging.h"
|
||||
|
||||
namespace mv {
|
||||
|
||||
TEST(Tracks, MaxFrame) {
|
||||
Marker marker;
|
||||
Tracks tracks;
|
||||
|
||||
// Add some markers to clip 0.
|
||||
marker.clip = 0;
|
||||
marker.frame = 1;
|
||||
tracks.AddMarker(marker);
|
||||
|
||||
// Add some markers to clip 1.
|
||||
marker.clip = 1;
|
||||
marker.frame = 1;
|
||||
tracks.AddMarker(marker);
|
||||
|
||||
marker.clip = 1;
|
||||
marker.frame = 12;
|
||||
tracks.AddMarker(marker);
|
||||
|
||||
EXPECT_EQ(1, tracks.MaxFrame(0));
|
||||
EXPECT_EQ(12, tracks.MaxFrame(1));
|
||||
}
|
||||
|
||||
} // namespace mv
|
6
extern/libmv/libmv/base/vector.h
vendored
6
extern/libmv/libmv/base/vector.h
vendored
@@ -101,6 +101,8 @@ class vector {
|
||||
size_ = size;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void push_back(const T &value) {
|
||||
if (size_ == capacity_) {
|
||||
reserve(size_ ? 2 * size_ : 1);
|
||||
@@ -128,10 +130,6 @@ class vector {
|
||||
}
|
||||
}
|
||||
|
||||
bool empty() {
|
||||
return size_ == 0;
|
||||
}
|
||||
|
||||
private:
|
||||
void construct(int start, int end) {
|
||||
for (int i = start; i < end; ++i) {
|
||||
|
24
extern/libmv/libmv/image/array_nd.h
vendored
24
extern/libmv/libmv/image/array_nd.h
vendored
@@ -41,35 +41,33 @@ class ArrayND : public BaseArray {
|
||||
typedef Tuple<int, N> Index;
|
||||
|
||||
/// Create an empty array.
|
||||
ArrayND() : data_(NULL), own_data_(true) { Resize(Index(0)); }
|
||||
ArrayND() : data_(NULL), own_data(true) { Resize(Index(0)); }
|
||||
|
||||
/// Create an array with the specified shape.
|
||||
ArrayND(const Index &shape) : data_(NULL), own_data_(true) { Resize(shape); }
|
||||
ArrayND(const Index &shape) : data_(NULL), own_data(true) { Resize(shape); }
|
||||
|
||||
/// Create an array with the specified shape.
|
||||
ArrayND(int *shape) : data_(NULL), own_data_(true) { Resize(shape); }
|
||||
ArrayND(int *shape) : data_(NULL), own_data(true) { Resize(shape); }
|
||||
|
||||
/// Copy constructor.
|
||||
ArrayND(const ArrayND<T, N> &b) : data_(NULL), own_data_(true) {
|
||||
ArrayND(const ArrayND<T, N> &b) : data_(NULL), own_data(true) {
|
||||
ResizeLike(b);
|
||||
std::memcpy(Data(), b.Data(), sizeof(T) * Size());
|
||||
}
|
||||
|
||||
ArrayND(int s0) : data_(NULL), own_data_(true) { Resize(s0); }
|
||||
ArrayND(int s0, int s1) : data_(NULL), own_data_(true) { Resize(s0, s1); }
|
||||
ArrayND(int s0, int s1, int s2) : data_(NULL), own_data_(true) {
|
||||
ArrayND(int s0) : data_(NULL), own_data(true) { Resize(s0); }
|
||||
ArrayND(int s0, int s1) : data_(NULL), own_data(true) { Resize(s0, s1); }
|
||||
ArrayND(int s0, int s1, int s2) : data_(NULL), own_data(true) {
|
||||
Resize(s0, s1, s2);
|
||||
}
|
||||
|
||||
ArrayND(T* data, int s0, int s1, int s2) : data_(data), own_data_(false) {
|
||||
ArrayND(T* data, int s0, int s1, int s2) : data_(data), own_data(false) {
|
||||
Resize(s0, s1, s2);
|
||||
}
|
||||
|
||||
/// Destructor deletes pixel data.
|
||||
~ArrayND() {
|
||||
if (own_data_) {
|
||||
delete [] data_;
|
||||
}
|
||||
delete [] data_;
|
||||
}
|
||||
|
||||
/// Assignation copies pixel data.
|
||||
@@ -99,7 +97,7 @@ class ArrayND : public BaseArray {
|
||||
for (int i = N - 1; i > 0; --i) {
|
||||
strides_(i - 1) = strides_(i) * shape_(i);
|
||||
}
|
||||
if (own_data_) {
|
||||
if (own_data) {
|
||||
delete [] data_;
|
||||
data_ = NULL;
|
||||
if (Size() > 0) {
|
||||
@@ -338,7 +336,7 @@ class ArrayND : public BaseArray {
|
||||
T *data_;
|
||||
|
||||
/// Flag if this Array either own or reference the data
|
||||
bool own_data_;
|
||||
bool own_data;
|
||||
};
|
||||
|
||||
/// 3D array (row, column, channel).
|
||||
|
@@ -69,50 +69,54 @@ double GRIC(const Vec &e, int d, int k, int r) {
|
||||
// http://www.robots.ox.ac.uk/~vgg/publications/papers/torr99.ps.gz
|
||||
double lambda3 = 2.0;
|
||||
|
||||
// Variance of tracker position. Physically, this is typically about 0.1px,
|
||||
// and when squared becomes 0.01 px^2.
|
||||
// measurement error of tracker
|
||||
double sigma2 = 0.01;
|
||||
|
||||
// Finally, calculate the GRIC score.
|
||||
double gric = 0.0;
|
||||
// Actual GRIC computation
|
||||
double gric_result = 0.0;
|
||||
|
||||
for (int i = 0; i < n; i++) {
|
||||
gric += std::min(e(i) * e(i) / sigma2, lambda3 * (r - d));
|
||||
double rho = std::min(e(i) * e(i) / sigma2, lambda3 * (r - d));
|
||||
gric_result += rho;
|
||||
}
|
||||
gric += lambda1 * d * n;
|
||||
gric += lambda2 * k;
|
||||
return gric;
|
||||
|
||||
gric_result += lambda1 * d * n;
|
||||
gric_result += lambda2 * k;
|
||||
|
||||
return gric_result;
|
||||
}
|
||||
|
||||
// Compute a generalized inverse using eigen value decomposition, clamping the
|
||||
// smallest eigenvalues if requested. This is needed to compute the variance of
|
||||
// Compute a generalized inverse using eigen value decomposition.
|
||||
// It'll actually also zero 7 last eigen values to deal with
|
||||
// gauges, since this function is used to compute variance of
|
||||
// reconstructed 3D points.
|
||||
//
|
||||
// TODO(keir): Consider moving this into the numeric code, since this is not
|
||||
// related to keyframe selection.
|
||||
Mat PseudoInverseWithClampedEigenvalues(const Mat &matrix,
|
||||
int num_eigenvalues_to_clamp) {
|
||||
Eigen::EigenSolver<Mat> eigen_solver(matrix);
|
||||
Mat D = eigen_solver.pseudoEigenvalueMatrix();
|
||||
Mat V = eigen_solver.pseudoEigenvectors();
|
||||
// TODO(sergey): Could be generalized by making it so number
|
||||
// of values to be zeroed is passed by an argument
|
||||
// and moved to numeric module.
|
||||
Mat pseudoInverse(const Mat &matrix) {
|
||||
Eigen::EigenSolver<Mat> eigenSolver(matrix);
|
||||
Mat D = eigenSolver.pseudoEigenvalueMatrix();
|
||||
Mat V = eigenSolver.pseudoEigenvectors();
|
||||
|
||||
// Clamp too-small singular values to zero to prevent numeric blowup.
|
||||
double epsilon = std::numeric_limits<double>::epsilon();
|
||||
|
||||
for (int i = 0; i < D.cols(); ++i) {
|
||||
if (D(i, i) > epsilon) {
|
||||
if (D(i, i) > epsilon)
|
||||
D(i, i) = 1.0 / D(i, i);
|
||||
} else {
|
||||
else
|
||||
D(i, i) = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
// Apply the clamp.
|
||||
for (int i = D.cols() - num_eigenvalues_to_clamp; i < D.cols(); ++i) {
|
||||
// Zero last 7 (which corresponds to smallest eigen values).
|
||||
// 7 equals to the number of gauge freedoms.
|
||||
for (int i = D.cols() - 7; i < D.cols(); ++i)
|
||||
D(i, i) = 0.0;
|
||||
}
|
||||
|
||||
return V * D * V.inverse();
|
||||
}
|
||||
|
||||
void FilterZeroWeightMarkersFromTracks(const Tracks &tracks,
|
||||
void filterZeroWeightMarkersFromTracks(const Tracks &tracks,
|
||||
Tracks *filtered_tracks) {
|
||||
vector<Marker> all_markers = tracks.AllMarkers();
|
||||
|
||||
@@ -139,7 +143,7 @@ void SelectKeyframesBasedOnGRICAndVariance(const Tracks &_tracks,
|
||||
// http://www.cs.ait.ac.th/~mdailey/papers/Tahir-KeyFrame.pdf
|
||||
|
||||
Tracks filtered_tracks;
|
||||
FilterZeroWeightMarkersFromTracks(_tracks, &filtered_tracks);
|
||||
filterZeroWeightMarkersFromTracks(_tracks, &filtered_tracks);
|
||||
|
||||
int max_image = filtered_tracks.MaxImage();
|
||||
int next_keyframe = 1;
|
||||
@@ -220,9 +224,9 @@ void SelectKeyframesBasedOnGRICAndVariance(const Tracks &_tracks,
|
||||
|
||||
EstimateFundamentalOptions estimate_fundamental_options;
|
||||
EstimateFundamentalFromCorrespondences(x1,
|
||||
x2,
|
||||
estimate_fundamental_options,
|
||||
&F);
|
||||
x2,
|
||||
estimate_fundamental_options,
|
||||
&F);
|
||||
|
||||
// Convert fundamental to original pixel space.
|
||||
F = N_inverse * F * N;
|
||||
@@ -375,8 +379,7 @@ void SelectKeyframesBasedOnGRICAndVariance(const Tracks &_tracks,
|
||||
Mat &jacobian = evaluation.jacobian;
|
||||
|
||||
Mat JT_J = jacobian.transpose() * jacobian;
|
||||
// There are 7 degrees of freedom, so clamp them out.
|
||||
Mat JT_J_inv = PseudoInverseWithClampedEigenvalues(JT_J, 7);
|
||||
Mat JT_J_inv = pseudoInverse(JT_J);
|
||||
|
||||
Mat temp_derived = JT_J * JT_J_inv * JT_J;
|
||||
bool is_inversed = (temp_derived - JT_J).cwiseAbs2().sum() <
|
||||
|
112
extern/libmv/libmv/tracking/kalman_filter.h
vendored
112
extern/libmv/libmv/tracking/kalman_filter.h
vendored
@@ -1,112 +0,0 @@
|
||||
// Copyright (c) 2014 libmv authors.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to
|
||||
// deal in the Software without restriction, including without limitation the
|
||||
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
// sell copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
// IN THE SOFTWARE.
|
||||
|
||||
#ifndef LIBMV_TRACKING_KALMAN_FILTER_H_
|
||||
|
||||
#include "libmv/numeric/numeric.h"
|
||||
|
||||
namespace mv {
|
||||
|
||||
// A Kalman filter with order N and observation size K.
|
||||
template<typename T, int N, int K>
|
||||
class KalmanFilter {
|
||||
public:
|
||||
struct State {
|
||||
Eigen::Matrix<T, N, 1> mean;
|
||||
Eigen::Matrix<T, N, N> covariance;
|
||||
};
|
||||
|
||||
// Initialize from row-major data; convenient for constant initializers.
|
||||
KalmanFilter(const T* state_transition_data,
|
||||
const T* observation_data,
|
||||
const T* process_covariance_data,
|
||||
const T* default_measurement_covariance_data)
|
||||
: state_transition_matrix_(
|
||||
Eigen::Matrix<T, N, N, Eigen::RowMajor>(state_transition_data)),
|
||||
observation_matrix_(
|
||||
Eigen::Matrix<T, K, N, Eigen::RowMajor>(observation_data)),
|
||||
process_covariance_(
|
||||
Eigen::Matrix<T, N, N, Eigen::RowMajor>(process_covariance_data)),
|
||||
default_measurement_covariance_(
|
||||
Eigen::Matrix<T, K, K, Eigen::RowMajor>(
|
||||
default_measurement_covariance_data)) {
|
||||
}
|
||||
|
||||
KalmanFilter(
|
||||
const Eigen::Matrix<T, N, N> &state_transition_matrix,
|
||||
const Eigen::Matrix<T, K, N> &observation_matrix,
|
||||
const Eigen::Matrix<T, N, N> &process_covariance,
|
||||
const Eigen::Matrix<T, K, K> &default_measurement_covariance)
|
||||
: state_transition_matrix_(state_transition_matrix),
|
||||
observation_matrix_(observation_matrix),
|
||||
process_covariance_(process_covariance),
|
||||
default_measurement_covariance_(default_measurement_covariance) {
|
||||
}
|
||||
|
||||
// Advances the system according to the current state estimate.
|
||||
void Step(State *state) const {
|
||||
state->mean = state_transition_matrix_ * state->mean;
|
||||
state->covariance = state_transition_matrix_ *
|
||||
state->covariance *
|
||||
state_transition_matrix_.transpose() +
|
||||
process_covariance_;
|
||||
}
|
||||
|
||||
// Updates a state with a new measurement.
|
||||
void Update(const Eigen::Matrix<T, K, 1> &measurement_mean,
|
||||
const Eigen::Matrix<T, K, K> &measurement_covariance,
|
||||
State *state) const {
|
||||
// Calculate the innovation, which is a distribution over prediction error.
|
||||
Eigen::Matrix<T, K, 1> innovation_mean = measurement_mean -
|
||||
observation_matrix_ *
|
||||
state->mean;
|
||||
Eigen::Matrix<T, K, K> innovation_covariance =
|
||||
observation_matrix_ *
|
||||
state->covariance *
|
||||
observation_matrix_.transpose() +
|
||||
measurement_covariance;
|
||||
|
||||
// Calculate the Kalman gain.
|
||||
Eigen::Matrix<T, 6, 2> kalman_gain = state->covariance *
|
||||
observation_matrix_.transpose() *
|
||||
innovation_covariance.inverse();
|
||||
|
||||
// Update the state mean and covariance.
|
||||
state->mean += kalman_gain * innovation_mean;
|
||||
state->covariance = (Eigen::Matrix<T, N, N>::Identity() -
|
||||
kalman_gain * observation_matrix_) *
|
||||
state->covariance;
|
||||
}
|
||||
|
||||
void Update(State *state,
|
||||
const Eigen::Matrix<T, K, 1> &measurement_mean) const {
|
||||
Update(state, measurement_mean, default_measurement_covariance_);
|
||||
}
|
||||
|
||||
private:
|
||||
const Eigen::Matrix<T, N, N> state_transition_matrix_;
|
||||
const Eigen::Matrix<T, K, N> observation_matrix_;
|
||||
const Eigen::Matrix<T, N, N> process_covariance_;
|
||||
const Eigen::Matrix<T, K, K> default_measurement_covariance_;
|
||||
};
|
||||
|
||||
} // namespace mv
|
||||
|
||||
#endif // LIBMV_TRACKING_KALMAN_FILTER_H_
|
11
extern/libmv/libmv/tracking/track_region.h
vendored
11
extern/libmv/libmv/tracking/track_region.h
vendored
@@ -42,13 +42,7 @@ struct TrackRegionOptions {
|
||||
};
|
||||
Mode mode;
|
||||
|
||||
// Minimum normalized cross-correlation necessary between the final tracked
|
||||
// positoin of the patch on the destination image and the reference patch
|
||||
// needed to declare tracking success. If the minimum correlation is not met,
|
||||
// then TrackResult::termination is INSUFFICIENT_CORRELATION.
|
||||
double minimum_correlation;
|
||||
|
||||
// Maximum number of Ceres iterations to run for the inner minimization.
|
||||
int max_iterations;
|
||||
|
||||
// Use the "Efficient Second-order Minimization" scheme. This increases
|
||||
@@ -130,11 +124,6 @@ struct TrackRegionResult {
|
||||
};
|
||||
Termination termination;
|
||||
|
||||
bool is_usable() {
|
||||
return termination == CONVERGENCE ||
|
||||
termination == NO_CONVERGENCE;
|
||||
}
|
||||
|
||||
int num_iterations;
|
||||
double correlation;
|
||||
|
||||
|
148
extern/libmv/third_party/ceres/ChangeLog
vendored
148
extern/libmv/third_party/ceres/ChangeLog
vendored
@@ -1,78 +1,3 @@
|
||||
commit 0435246de5f45e69b2c97d244ed61bedd340215a
|
||||
Author: Sameer Agarwal <sameeragarwal@google.com>
|
||||
Date: Wed Oct 8 18:12:53 2014 -0700
|
||||
|
||||
Add seene to users.rst
|
||||
|
||||
Change-Id: If40726775a3d4b234b6e10517fe9943d122a3384
|
||||
|
||||
commit fdf32b315f39553639f0becf078ad4eec763a10e
|
||||
Author: Sameer Agarwal <sameeragarwal@google.com>
|
||||
Date: Wed Oct 8 16:04:32 2014 -0700
|
||||
|
||||
Fix some errant tabs.
|
||||
|
||||
Change-Id: Iaf1906eaade49467ba282656cf0a10879d258b1f
|
||||
|
||||
commit 6768b3586a027bb850c0a50e2a27380f5d80142a
|
||||
Author: Sameer Agarwal <sameeragarwal@google.com>
|
||||
Date: Wed Oct 8 12:48:16 2014 -0700
|
||||
|
||||
Minor cleanups in preparation for a release.
|
||||
|
||||
1. Fix the release script to ignore the version.h checking.
|
||||
2. Fix some ceres documentation formatting errors.
|
||||
|
||||
Change-Id: I3fd6b85e771b242f463d6a36c3efd8d691f9242f
|
||||
|
||||
commit 7b6bd1cd31aa0b8cb7fb97600c1b9999846e3152
|
||||
Author: Sameer Agarwal <sameeragarwal@google.com>
|
||||
Date: Thu Oct 2 16:16:26 2014 -0700
|
||||
|
||||
Documentation update.
|
||||
|
||||
1. Complete restructuring of the documentation to account for
|
||||
GradientProblemSolver.
|
||||
2. Update the version history to account for changes since 1.9.0.
|
||||
3. Add links and document the various examples that ship with ceres.
|
||||
4. Documentation for GradientProblem GradientProblemSolver.
|
||||
|
||||
Change-Id: If3a18f2850cbc98be1bc34435e9ea468785b8b27
|
||||
|
||||
commit b7d321f505e936b6c09aeb43ae3f7b1252388a95
|
||||
Author: Sameer Agarwal <sameeragarwal@google.com>
|
||||
Date: Fri Oct 3 15:47:59 2014 -0700
|
||||
|
||||
Relax the warning/error handing in GCC.
|
||||
|
||||
Thanks to Matthew Woehlke for suggesting this.
|
||||
|
||||
Change-Id: Iae754465c086b0841a7816df1a36781371d0dc9a
|
||||
|
||||
commit 94c6e7d27b5d48d81ab54ed9cdcbc55c3c099311
|
||||
Author: Sameer Agarwal <sameeragarwal@google.com>
|
||||
Date: Wed Oct 1 15:55:13 2014 -0700
|
||||
|
||||
Improve multithreading when using inner iterations.
|
||||
|
||||
Inner iterations by default would use problems where the evaluator
|
||||
was configured to use exactly one thread for doing the evaluation.
|
||||
This is fine when there are multiple inner iteration problems
|
||||
being executed concurrently, but every now and then there are
|
||||
problem decompositions where there is just one parameter block
|
||||
in the current independent set and it touches every single
|
||||
residual block. In such cases it is essential that the evaluator
|
||||
be configured to use multiple threads.
|
||||
|
||||
We now pay attention to the size of the independent set and
|
||||
dynamically configure the number of threads being used by the
|
||||
outer loop and the evaluator loop.
|
||||
|
||||
Thanks to William Rucklidge for reporting this issue and providing
|
||||
a test problem to debug.
|
||||
|
||||
Change-Id: Iaff9a4ab6d2658cf7b61ea213575d23aab604e3b
|
||||
|
||||
commit 9e11cd16d09403b9270e621e839d5948b6a74b8d
|
||||
Author: Sameer Agarwal <sameeragarwal@google.com>
|
||||
Date: Mon Sep 29 14:27:58 2014 -0700
|
||||
@@ -671,3 +596,76 @@ Date: Thu Jun 5 21:30:13 2014 -0700
|
||||
solve.
|
||||
|
||||
Change-Id: I80f35cfc9f2cbf78f1df4aceace27075779d8a3a
|
||||
|
||||
commit bd90384226a7f8629467f72fc410a9e8086a2dff
|
||||
Author: Sameer Agarwal <sameeragarwal@google.com>
|
||||
Date: Mon Aug 18 11:27:06 2014 -0700
|
||||
|
||||
Lint comments from William Rucklidge.
|
||||
|
||||
Also some minor refactoring of the trust_region_preprocessor_test.cc
|
||||
|
||||
Change-Id: Ica28002254c95722faf93a7ef35bf3deab557f0b
|
||||
|
||||
commit 3150321db4a0cb1bb4894961a030d95dacae3591
|
||||
Author: Sameer Agarwal <sameeragarwal@google.com>
|
||||
Date: Tue Aug 12 22:46:51 2014 -0700
|
||||
|
||||
Preprocessor for the LineSearchMinimizer.
|
||||
|
||||
Change-Id: Ieb5dfe1c0b96ef323c1130edd0c3a8a8b2c644cc
|
||||
|
||||
commit f7da411ef0d0067e269629887d64cdb769368800
|
||||
Author: Sameer Agarwal <sameeragarwal@google.com>
|
||||
Date: Thu Aug 7 14:30:33 2014 -0700
|
||||
|
||||
Preprocessor for the TrustRegionMinimizer.
|
||||
|
||||
1. Base class for preprocessors.
|
||||
2. A preprocessor for problems that will be solved using
|
||||
the trust region minimizer.
|
||||
3. Added sanity tests to the program reordering options
|
||||
for Schur type linear solvers.
|
||||
4. Tests for the TrustRegionPreprocessor.
|
||||
|
||||
Change-Id: I88cd926f0053bbbf2bd6b11e03ec55b8bf473cf1
|
||||
|
||||
commit 54893ba523106e38ab06eb72fb5d8748685c7797
|
||||
Author: Alex Stewart <alexs.mac@gmail.com>
|
||||
Date: Mon Aug 11 19:04:18 2014 +0100
|
||||
|
||||
Add missing #include of <limits> for loss functions.
|
||||
|
||||
Change-Id: Id632451429e03031a1533a9be795270debc70706
|
||||
|
||||
commit 4a2a888905fd1ce7203e45df15762d52740bb240
|
||||
Author: Sameer Agarwal <sameeragarwal@google.com>
|
||||
Date: Thu Aug 7 11:48:03 2014 -0700
|
||||
|
||||
Change ownership of pointers in Minimizer::Options.
|
||||
|
||||
This is a intermediate change to clean things up
|
||||
in preparation for a broader refactoring of the SolverImpl.
|
||||
|
||||
Essentially we are replacing raw pointers in Minimizer::Options
|
||||
with shared_ptr objects. For now this only makes things a bit
|
||||
more complicated looking inside solver_impl.cc, but going
|
||||
forward this will lead to considerable simplifications in
|
||||
tracking ownership of various pointers.
|
||||
|
||||
Change-Id: I21db8fc6763c29b0d15e834d7c968a0f514042a0
|
||||
|
||||
commit 0d4e3bd664d442b700fee2895c7a8ac37717dc08
|
||||
Author: Sameer Agarwal <sameeragarwal@google.com>
|
||||
Date: Thu Aug 7 12:19:10 2014 -0700
|
||||
|
||||
GradientCheckingProblem's parameter blocks are initialized correctly.
|
||||
|
||||
Ensure that when a new problem object is constructed for validing
|
||||
gradients, the parameter blocks have their data pointers point to
|
||||
the user's parameter blocks.
|
||||
|
||||
We used to do this inside solver_impl.cc, but doing this at
|
||||
construction is the right thing to do.
|
||||
|
||||
Change-Id: I3bfdc89bb0027c8d67cde937e8f2fa385d89c30c
|
||||
|
2
extern/libmv/third_party/ceres/bundle.sh
vendored
2
extern/libmv/third_party/ceres/bundle.sh
vendored
@@ -143,7 +143,7 @@ if(WITH_LIBMV_SCHUR_SPECIALIZATIONS)
|
||||
${generated_sources}
|
||||
)
|
||||
else()
|
||||
add_definitions(-DCERES_RESTRICT_SCHUR_SPECIALIZATION)
|
||||
add_definitions-DCERES_RESTRICT_SCHUR_SPECIALIZATION)
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
|
@@ -72,6 +72,7 @@ class CERES_EXPORT GradientProblemSolver {
|
||||
max_line_search_step_expansion = 10.0;
|
||||
max_num_iterations = 50;
|
||||
max_solver_time_in_seconds = 1e9;
|
||||
num_threads = 1;
|
||||
function_tolerance = 1e-6;
|
||||
gradient_tolerance = 1e-10;
|
||||
logging_type = PER_MINIMIZER_ITERATION;
|
||||
@@ -223,6 +224,10 @@ class CERES_EXPORT GradientProblemSolver {
|
||||
// Maximum time for which the minimizer should run for.
|
||||
double max_solver_time_in_seconds;
|
||||
|
||||
// Number of threads used by Ceres for evaluating the cost and
|
||||
// jacobians.
|
||||
int num_threads;
|
||||
|
||||
// Minimizer terminates when
|
||||
//
|
||||
// (new_cost - old_cost) < function_tolerance * old_cost;
|
||||
@@ -246,6 +251,13 @@ class CERES_EXPORT GradientProblemSolver {
|
||||
// is sent to STDOUT.
|
||||
bool minimizer_progress_to_stdout;
|
||||
|
||||
// If true, the user's parameter blocks are updated at the end of
|
||||
// every Minimizer iteration, otherwise they are updated when the
|
||||
// Minimizer terminates. This is useful if, for example, the user
|
||||
// wishes to visualize the state of the optimization every
|
||||
// iteration.
|
||||
bool update_state_every_iteration;
|
||||
|
||||
// Callbacks that are executed at the end of each iteration of the
|
||||
// Minimizer. An iteration may terminate midway, either due to
|
||||
// numerical failures or because one of the convergence tests has
|
||||
@@ -297,10 +309,10 @@ class CERES_EXPORT GradientProblemSolver {
|
||||
// Sum total of all time spent inside Ceres when Solve is called.
|
||||
double total_time_in_seconds;
|
||||
|
||||
// Time (in seconds) spent evaluating the cost.
|
||||
// Time (in seconds) spent evaluating the residual vector.
|
||||
double cost_evaluation_time_in_seconds;
|
||||
|
||||
// Time (in seconds) spent evaluating the gradient.
|
||||
// Time (in seconds) spent evaluating the jacobian matrix.
|
||||
double gradient_evaluation_time_in_seconds;
|
||||
|
||||
// Number of parameters in the probem.
|
||||
|
@@ -1,5 +1,5 @@
|
||||
// Ceres Solver - A fast non-linear least squares minimizer
|
||||
// Copyright 2014 Google Inc. All rights reserved.
|
||||
// Copyright 2012 Google Inc. All rights reserved.
|
||||
// http://code.google.com/p/ceres-solver/
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
@@ -140,24 +140,15 @@ void CoordinateDescentMinimizer::Minimize(
|
||||
}
|
||||
|
||||
for (int i = 0; i < independent_set_offsets_.size() - 1; ++i) {
|
||||
const int num_problems =
|
||||
independent_set_offsets_[i + 1] - independent_set_offsets_[i];
|
||||
// No point paying the price for an OpemMP call if the set is of
|
||||
// No point paying the price for an OpemMP call if the set if of
|
||||
// size zero.
|
||||
if (num_problems == 0) {
|
||||
if (independent_set_offsets_[i] == independent_set_offsets_[i + 1]) {
|
||||
continue;
|
||||
}
|
||||
|
||||
#ifdef CERES_USE_OPENMP
|
||||
const int num_inner_iteration_threads =
|
||||
min(options.num_threads, num_problems);
|
||||
evaluator_options_.num_threads =
|
||||
max(1, options.num_threads / num_inner_iteration_threads);
|
||||
|
||||
// The parameter blocks in each independent set can be optimized
|
||||
// in parallel, since they do not co-occur in any residual block.
|
||||
#pragma omp parallel for num_threads(num_inner_iteration_threads)
|
||||
#endif
|
||||
#pragma omp parallel for num_threads(options.num_threads)
|
||||
for (int j = independent_set_offsets_[i];
|
||||
j < independent_set_offsets_[i + 1];
|
||||
++j) {
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user